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,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
*/
/**
* [[include:plugins/copy-format/README.md]]
* @packageDocumentation
* @module plugins/clipboard
*/
import type { IJodit } from "../../types/index";
export declare function copyFormat(editor: IJodit): void;

View File

@@ -0,0 +1,112 @@
/*!
* 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/dom.js";
import { extendLang, pluginSystem } from "../../core/global.js";
import { css } from "../../core/helpers/utils/css.js";
import { Icon } from "../../core/ui/icon.js";
import { Config } from "../../config.js";
import copyFormatIcon from "./copy-format.svg.js";
import * as langs from "./langs/index.js";
const pluginKey = 'copy-format';
/**
* Plug-in copy and paste formatting from one element to another
*/
const copyStyles = [
'lineHeight',
'fontWeight',
'fontStyle',
'fontSize',
'fontFamily',
'color',
'margin',
'padding',
'borderWidth',
'borderStyle',
'borderColor',
'borderRadius',
'backgroundColor',
'textDecorationLine'
];
const getStyle = (editor, key, box, defaultStyles) => {
let result = css(box, key);
if (result === defaultStyles[key]) {
if (box.parentNode &&
box !== editor.editor &&
box.parentNode !== editor.editor) {
result = getStyle(editor, key, box.parentNode, defaultStyles);
}
else {
result = undefined;
}
}
return result;
};
const getStyles = (editor, box, defaultStyles) => {
const result = {};
if (box) {
copyStyles.forEach((key) => {
result[key] = getStyle(editor, key, box, defaultStyles);
if (key.match(/border(Style|Color)/) && !result.borderWidth) {
result[key] = undefined;
}
});
}
return result;
};
Config.prototype.controls.copyformat = {
exec: (editor, current, { button }) => {
if (!current) {
return;
}
if (editor.buffer.exists(pluginKey)) {
editor.buffer.delete(pluginKey);
editor.e.off(editor.editor, 'mouseup.' + pluginKey);
}
else {
const defaultStyles = {}, box = Dom.up(current, (elm) => elm && !Dom.isText(elm), editor.editor) || editor.editor;
const ideal = editor.createInside.span();
editor.editor.appendChild(ideal);
copyStyles.forEach((key) => {
defaultStyles[key] = css(ideal, key);
});
if (ideal !== editor.editor) {
Dom.safeRemove(ideal);
}
const format = getStyles(editor, box, defaultStyles);
const onMouseUp = () => {
editor.buffer.delete(pluginKey);
const currentNode = editor.s.current();
if (currentNode) {
if (Dom.isTag(currentNode, 'img')) {
css(currentNode, format);
}
else {
editor.s.commitStyle({
attributes: {
style: format
}
});
}
}
editor.e.off(editor.editor, 'mouseup.' + pluginKey);
};
editor.e.on(editor.editor, 'mouseup.' + pluginKey, onMouseUp);
editor.buffer.set(pluginKey, true);
}
button.update();
},
isActive: (editor) => editor.buffer.exists(pluginKey),
tooltip: 'Paint format'
};
export function copyFormat(editor) {
editor.registerButton({
name: 'copyformat',
group: 'clipboard'
});
extendLang(langs);
}
pluginSystem.add('copyformat', copyFormat);
Icon.set('copyformat', copyFormatIcon);

View File

@@ -0,0 +1 @@
export default "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 16 16\"> <path stroke-width=\"0\" d=\"M16 9v-6h-3v-1c0-0.55-0.45-1-1-1h-11c-0.55 0-1 0.45-1 1v3c0 0.55 0.45 1 1 1h11c0.55 0 1-0.45 1-1v-1h2v4h-9v2h-0.5c-0.276 0-0.5 0.224-0.5 0.5v5c0 0.276 0.224 0.5 0.5 0.5h2c0.276 0 0.5-0.224 0.5-0.5v-5c0-0.276-0.224-0.5-0.5-0.5h-0.5v-1h9zM12 3h-11v-1h11v1z\"/> </svg> ";

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'نسخ التنسيق'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Kopírovat formát'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Format kopierenт'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Copiar formato'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'کپی کردن قالب'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Kopioi muotoilu'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Format de copie'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'העתק עיצוב'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Formátum másolás'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'salin format'
};

View File

@@ -0,0 +1,27 @@
/*!
* 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 ar from "./ar";
import cs_cz from "./cs_cz";
import de from "./de";
import es from "./es";
import fa from "./fa";
import fi from "./fi";
import fr from "./fr";
import he from "./he";
import hu from "./hu";
import id from "./id";
import it from "./it";
import ja from "./ja";
import ko from "./ko";
import mn from "./mn";
import nl from "./nl";
import pl from "./pl";
import pt_br from "./pt_br";
import ru from "./ru";
import tr from "./tr";
import zh_cn from "./zh_cn";
import zh_tw from "./zh_tw";
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };

View File

@@ -0,0 +1,27 @@
/*!
* 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 ar from "./ar.js";
import cs_cz from "./cs_cz.js";
import de from "./de.js";
import es from "./es.js";
import fa from "./fa.js";
import fi from "./fi.js";
import fr from "./fr.js";
import he from "./he.js";
import hu from "./hu.js";
import id from "./id.js";
import it from "./it.js";
import ja from "./ja.js";
import ko from "./ko.js";
import mn from "./mn.js";
import nl from "./nl.js";
import pl from "./pl.js";
import pt_br from "./pt_br.js";
import ru from "./ru.js";
import tr from "./tr.js";
import zh_cn from "./zh_cn.js";
import zh_tw from "./zh_tw.js";
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Copia il formato'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'copyformat'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': '복사 형식'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Формат хуулах'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'opmaak kopiëren'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'format kopii'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Copiar formato'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Копировать формат'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': 'Kopyalama Biçimi'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': '复制格式'
};

View File

@@ -0,0 +1,4 @@
declare const _exports: {
'copy-format': string;
};
export = _exports;

View File

@@ -0,0 +1,9 @@
"use strict";
/*!
* 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
*/
export default {
'copy-format': '複製格式'
};