inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
import type { IControlType, IDictionary, IJodit } from "../../../types/index";
declare module 'jodit/config' {
interface Config {
popup: IDictionary<Array<IControlType | string> | ((editor: IJodit, target: HTMLElement | undefined, close: () => void) => Array<IControlType | string> | HTMLElement | string)>;
toolbarInlineDisabledButtons: string[];
toolbarInline: boolean;
toolbarInlineForSelection: boolean;
toolbarInlineDisableFor: string | string[];
}
}

View File

@@ -0,0 +1,57 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { Icon } from "../../../core/ui/icon.js";
import { Config } from "../../../config.js";
import a from "./items/a.js";
import cells from "./items/cells.js";
import jodit from "./items/iframe.js";
import img from "./items/img.js";
import toolbar from "./items/toolbar.js";
import * as addcolumn from "../icons/addcolumn.svg.js";
import * as addrow from "../icons/addrow.svg.js";
import * as merge from "../icons/merge.svg.js";
import * as splitg from "../icons/splitg.svg.js";
import * as splitv from "../icons/splitv.svg.js";
import * as th from "../icons/th.svg.js";
import * as thList from "../icons/th-list.svg.js";
Config.prototype.toolbarInline = true;
Config.prototype.toolbarInlineForSelection = false;
Config.prototype.toolbarInlineDisableFor = [];
Config.prototype.toolbarInlineDisabledButtons = ['source'];
Icon.set('addcolumn', addcolumn.default)
.set('addrow', addrow.default)
.set('merge', merge.default)
.set('th', th.default)
.set('splitg', splitg.default)
.set('splitv', splitv.default)
.set('th-list', thList.default);
Config.prototype.popup = {
a,
img,
cells,
toolbar,
jodit,
iframe: jodit,
'jodit-media': jodit,
selection: [
'bold',
'underline',
'italic',
'ul',
'ol',
'\n',
'outdent',
'indent',
'fontsize',
'brush',
'cut',
'\n',
'paragraph',
'link',
'align',
'dots'
]
};

View File

@@ -0,0 +1,11 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
import type { IControlType } from "../../../../types/index";
declare const _default: Array<IControlType | string>;
export default _default;

View File

@@ -0,0 +1,26 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { attr } from "../../../../core/helpers/utils/attr.js";
export default [
{
name: 'eye',
tooltip: 'Open link',
exec: (editor, current) => {
const href = attr(current, 'href');
if (current && href) {
editor.ow.open(href);
}
}
},
{
name: 'link',
tooltip: 'Edit link',
icon: 'pencil'
},
'unlink',
'brush',
'file'
];

View File

@@ -0,0 +1,11 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
import type { IControlType } from "../../../../types/index";
declare const _default: Array<IControlType | string>;
export default _default;

View File

@@ -0,0 +1,104 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { isJoditObject, isString } from "../../../../core/helpers/checker/index.js";
import { css } from "../../../../core/helpers/utils/css.js";
const cmd = (control) => control.args && isString(control.args[0])
? control.args[0].toLowerCase()
: '';
export default [
'brushCell',
{
name: 'valign',
list: ['Top', 'Middle', 'Bottom', 'Normal'],
childTemplate: (_, __, value) => value,
exec: (editor, table, { control }) => {
const command = cmd(control);
editor
.getInstance('Table', editor.o)
.getAllSelectedCells()
.forEach((cell) => {
css(cell, 'vertical-align', command === 'normal' ? '' : command);
});
},
tooltip: 'Vertical align'
},
{
name: 'splitv',
list: {
tablesplitv: 'Split vertical',
tablesplitg: 'Split horizontal'
},
tooltip: 'Split'
},
{
name: 'align',
icon: 'left'
},
'\n',
{
name: 'merge',
command: 'tablemerge',
tooltip: 'Merge'
},
{
name: 'addcolumn',
list: {
tableaddcolumnbefore: 'Insert column before',
tableaddcolumnafter: 'Insert column after'
},
exec: (editor, table, { control }) => {
if (!isJoditObject(editor)) {
return;
}
if (!control.args) {
return false;
}
const command = cmd(control);
editor.execCommand(command, false, table);
},
tooltip: 'Add column'
},
{
name: 'addrow',
list: {
tableaddrowbefore: 'Insert row above',
tableaddrowafter: 'Insert row below'
},
exec: (editor, table, { control }) => {
if (!isJoditObject(editor)) {
return;
}
if (!control.args) {
return false;
}
const command = cmd(control);
editor.execCommand(command, false, table);
},
tooltip: 'Add row'
},
{
name: 'delete',
icon: 'bin',
list: {
tablebin: 'Delete table',
tablebinrow: 'Delete row',
tablebincolumn: 'Delete column',
tableempty: 'Empty cell'
},
exec: (editor, table, { control }) => {
if (!isJoditObject(editor)) {
return;
}
if (!control.args) {
return false;
}
const command = cmd(control);
editor.execCommand(command, false, table);
editor.e.fire('hidePopup');
},
tooltip: 'Delete'
}
];

View File

@@ -0,0 +1,15 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
import type { IJodit } from "../../../../types/index";
declare const _default: (import("../../../../types/index").IControlType<IJodit, import("../../../../types/index").IToolbarButton> | {
name: string;
tooltip: string;
exec: (editor: IJodit, image: HTMLImageElement) => void;
})[];
export default _default;

View File

@@ -0,0 +1,16 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { align } from "./img.js";
export default [
{
name: 'bin',
tooltip: 'Delete',
exec: (editor, image) => {
image && editor.s.removeNode(image);
}
},
align
];

View File

@@ -0,0 +1,12 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
import type { IControlType, IJodit } from "../../../../types/index";
export declare const align: IControlType<IJodit>;
declare const _default: Array<IControlType | string>;
export default _default;

View File

@@ -0,0 +1,72 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { Dom } from "../../../../core/dom/index.js";
import { isString } from "../../../../core/helpers/checker/is-string.js";
import { hAlignElement } from "../../../../core/helpers/utils/align.js";
import { css } from "../../../../core/helpers/utils/css.js";
export const align = {
name: 'left',
childTemplate: (_, __, value) => value,
list: ['Left', 'Right', 'Center', 'Normal'],
exec: (editor, elm, { control }) => {
if (!Dom.isTag(elm, new Set(['img', 'jodit', 'jodit-media']))) {
return;
}
const command = control.args && isString(control.args[0])
? control.args[0].toLowerCase()
: '';
if (!command) {
return false;
}
hAlignElement(elm, command);
if (Dom.isTag(elm, new Set(['jodit', 'jodit-media'])) &&
elm.firstElementChild) {
hAlignElement(elm.firstElementChild, command);
}
editor.synchronizeValues();
editor.e.fire('recalcPositionPopup');
},
tooltip: 'Horizontal align'
};
export default [
{
name: 'delete',
icon: 'bin',
tooltip: 'Delete',
exec: (editor, image) => {
image && editor.s.removeNode(image);
}
},
{
name: 'pencil',
exec(editor, current) {
const tagName = current.tagName.toLowerCase();
if (tagName === 'img') {
editor.e.fire('openImageProperties', current);
}
},
tooltip: 'Edit'
},
{
name: 'valign',
list: ['Top', 'Middle', 'Bottom', 'Normal'],
tooltip: 'Vertical align',
exec: (editor, image, { control }) => {
if (!Dom.isTag(image, 'img')) {
return;
}
const command = control.args && isString(control.args[0])
? control.args[0].toLowerCase()
: '';
if (!command) {
return false;
}
css(image, 'vertical-align', command === 'normal' ? '' : command);
editor.e.fire('recalcPositionPopup');
}
},
align
];

View File

@@ -0,0 +1,10 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
declare const _default: string[];
export default _default;

View File

@@ -0,0 +1,35 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/inline-popup
*/
export default [
'bold',
'italic',
'|',
'ul',
'ol',
'eraser',
'|',
'fontsize',
'brush',
'paragraph',
'---',
'image',
'table',
'\n',
'link',
'|',
'align',
'|',
'undo',
'redo',
'|',
'copyformat',
'fullsize',
'---',
'dots'
];