jodit 4.19.12 → 4.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/es2015/jodit.css +76 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +9 -9
- package/es2015/jodit.js +1583 -681
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +9 -9
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +9 -9
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +9 -9
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +76 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +14 -14
- package/es2021/jodit.js +1564 -678
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +14 -14
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +76 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +14 -14
- package/es2021.en/jodit.js +1514 -628
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +14 -14
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +96 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1844 -791
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +10 -3
- package/esm/core/constants.js +1 -1
- package/esm/core/global.d.ts +6 -0
- package/esm/core/global.js +21 -4
- package/esm/core/helpers/html/safe-html.js +26 -0
- package/esm/core/helpers/utils/anchor.d.ts +22 -0
- package/esm/core/helpers/utils/anchor.js +29 -0
- package/esm/core/helpers/utils/index.d.ts +1 -0
- package/esm/core/helpers/utils/index.js +1 -0
- package/esm/core/ui/popup/popup.d.ts +5 -0
- package/esm/core/ui/popup/popup.js +5 -0
- package/esm/jodit.d.ts +4 -0
- package/esm/jodit.js +16 -15
- package/esm/langs/ar.d.ts +5 -0
- package/esm/langs/ar.js +5 -0
- package/esm/langs/az.d.ts +5 -0
- package/esm/langs/az.js +5 -0
- package/esm/langs/cs_cz.d.ts +5 -0
- package/esm/langs/cs_cz.js +6 -1
- package/esm/langs/de.d.ts +5 -0
- package/esm/langs/de.js +6 -0
- package/esm/langs/es.d.ts +5 -0
- package/esm/langs/es.js +6 -1
- package/esm/langs/fa.d.ts +5 -0
- package/esm/langs/fa.js +6 -1
- package/esm/langs/fi.d.ts +5 -0
- package/esm/langs/fi.js +5 -0
- package/esm/langs/fr.d.ts +5 -0
- package/esm/langs/fr.js +5 -0
- package/esm/langs/he.d.ts +5 -0
- package/esm/langs/he.js +6 -1
- package/esm/langs/hu.d.ts +5 -0
- package/esm/langs/hu.js +5 -0
- package/esm/langs/id.d.ts +5 -0
- package/esm/langs/id.js +6 -1
- package/esm/langs/it.d.ts +5 -0
- package/esm/langs/it.js +6 -1
- package/esm/langs/ja.d.ts +5 -0
- package/esm/langs/ja.js +6 -1
- package/esm/langs/ko.d.ts +5 -0
- package/esm/langs/ko.js +6 -1
- package/esm/langs/mn.d.ts +5 -0
- package/esm/langs/mn.js +6 -1
- package/esm/langs/nl.d.ts +5 -0
- package/esm/langs/nl.js +5 -0
- package/esm/langs/no.d.ts +5 -0
- package/esm/langs/no.js +5 -0
- package/esm/langs/pl.d.ts +5 -0
- package/esm/langs/pl.js +5 -0
- package/esm/langs/pt_br.d.ts +5 -0
- package/esm/langs/pt_br.js +6 -1
- package/esm/langs/ru.d.ts +5 -0
- package/esm/langs/ru.js +6 -1
- package/esm/langs/sk.d.ts +5 -0
- package/esm/langs/sk.js +5 -0
- package/esm/langs/sv.d.ts +5 -0
- package/esm/langs/sv.js +5 -0
- package/esm/langs/tr.d.ts +5 -0
- package/esm/langs/tr.js +6 -1
- package/esm/langs/ua.d.ts +5 -0
- package/esm/langs/ua.js +6 -1
- package/esm/langs/zh_cn.d.ts +5 -0
- package/esm/langs/zh_cn.js +6 -1
- package/esm/langs/zh_tw.d.ts +5 -0
- package/esm/langs/zh_tw.js +5 -0
- package/esm/languages.js +7 -1
- package/esm/modules/file-browser/file-browser.d.ts +3 -4
- package/esm/modules/file-browser/file-browser.js +12 -12
- package/esm/modules/toolbar/button/button.d.ts +7 -0
- package/esm/modules/toolbar/button/button.js +30 -4
- package/esm/modules/uploader/config.js +18 -18
- package/esm/modules/uploader/helpers/index.d.ts +1 -0
- package/esm/modules/uploader/helpers/index.js +1 -0
- package/esm/modules/uploader/helpers/normalize-uploader-data.d.ts +32 -0
- package/esm/modules/uploader/helpers/normalize-uploader-data.js +54 -0
- package/esm/modules/uploader/helpers/send-files.js +11 -6
- package/esm/modules/uploader/uploader.d.ts +4 -5
- package/esm/modules/uploader/uploader.js +12 -8
- package/esm/plugins/all.d.ts +1 -0
- package/esm/plugins/all.js +1 -0
- package/esm/plugins/anchor/anchor.d.ts +67 -0
- package/esm/plugins/anchor/anchor.js +302 -0
- package/esm/plugins/anchor/config.d.ts +6 -0
- package/esm/plugins/anchor/config.js +13 -0
- package/esm/plugins/file/file.d.ts +1 -1
- package/esm/plugins/file/file.js +6 -6
- package/esm/plugins/image/image.js +2 -2
- package/esm/plugins/image-caption/image-caption.js +1 -2
- package/esm/plugins/image-properties/utils/open-image-popup.js +7 -6
- package/esm/plugins/index.d.ts +1 -0
- package/esm/plugins/inline-popup/config/config.d.ts +8 -2
- package/esm/plugins/inline-popup/config/config.js +1 -0
- package/esm/plugins/inline-popup/config/items/cells.js +0 -10
- package/esm/plugins/inline-popup/config/items/img.js +1 -1
- package/esm/plugins/inline-popup/inline-popup.d.ts +9 -12
- package/esm/plugins/inline-popup/inline-popup.js +53 -77
- package/esm/plugins/link/link.js +150 -3
- package/esm/plugins/select/select.d.ts +31 -0
- package/esm/plugins/select/select.js +235 -2
- package/esm/plugins/select-cells/select-cells.d.ts +11 -0
- package/esm/plugins/select-cells/select-cells.js +48 -17
- package/esm/plugins/video/config.d.ts +1 -1
- package/esm/plugins/video/config.js +4 -3
- package/esm/plugins/video-properties/video-properties.js +7 -6
- package/esm/styles/icons/anchor.svg.js +1 -0
- package/esm/styles/icons/index.d.ts +1 -1
- package/esm/styles/icons/index.js +2 -1
- package/esm/types/file-browser.d.ts +8 -1
- package/esm/types/popup.d.ts +1 -0
- package/esm/types/uploader.d.ts +39 -1
- package/package.json +1 -1
- package/types/config.d.ts +10 -3
- package/types/core/global.d.ts +6 -0
- package/types/core/helpers/utils/anchor.d.ts +22 -0
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/ui/popup/popup.d.ts +5 -0
- package/types/jodit.d.ts +4 -0
- package/types/langs/ar.d.ts +5 -0
- package/types/langs/az.d.ts +5 -0
- package/types/langs/cs_cz.d.ts +5 -0
- package/types/langs/de.d.ts +5 -0
- package/types/langs/es.d.ts +5 -0
- package/types/langs/fa.d.ts +5 -0
- package/types/langs/fi.d.ts +5 -0
- package/types/langs/fr.d.ts +5 -0
- package/types/langs/he.d.ts +5 -0
- package/types/langs/hu.d.ts +5 -0
- package/types/langs/id.d.ts +5 -0
- package/types/langs/it.d.ts +5 -0
- package/types/langs/ja.d.ts +5 -0
- package/types/langs/ko.d.ts +5 -0
- package/types/langs/mn.d.ts +5 -0
- package/types/langs/nl.d.ts +5 -0
- package/types/langs/no.d.ts +5 -0
- package/types/langs/pl.d.ts +5 -0
- package/types/langs/pt_br.d.ts +5 -0
- package/types/langs/ru.d.ts +5 -0
- package/types/langs/sk.d.ts +5 -0
- package/types/langs/sv.d.ts +5 -0
- package/types/langs/tr.d.ts +5 -0
- package/types/langs/ua.d.ts +5 -0
- package/types/langs/zh_cn.d.ts +5 -0
- package/types/langs/zh_tw.d.ts +5 -0
- package/types/modules/file-browser/file-browser.d.ts +3 -4
- package/types/modules/toolbar/button/button.d.ts +7 -0
- package/types/modules/uploader/helpers/index.d.ts +1 -0
- package/types/modules/uploader/helpers/normalize-uploader-data.d.ts +32 -0
- package/types/modules/uploader/uploader.d.ts +4 -5
- package/types/plugins/anchor/anchor.d.ts +67 -0
- package/types/plugins/anchor/config.d.ts +6 -0
- package/types/plugins/file/file.d.ts +1 -1
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/inline-popup/config/config.d.ts +8 -2
- package/types/plugins/inline-popup/inline-popup.d.ts +9 -12
- package/types/plugins/select/select.d.ts +31 -0
- package/types/plugins/select-cells/select-cells.d.ts +11 -0
- package/types/plugins/video/config.d.ts +1 -1
- package/types/styles/icons/index.d.ts +1 -1
- package/types/types/file-browser.d.ts +8 -1
- package/types/types/popup.d.ts +1 -0
- package/types/types/uploader.d.ts +39 -1
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/config.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { IUploaderData } from "./types/index";
|
|
|
13
13
|
import type { ImageCaptionMarkup } from "./types/index";
|
|
14
14
|
import type { ImagePropertiesOptions } from "./plugins/image-properties/interface";
|
|
15
15
|
import type { IControlType } from "./types/index";
|
|
16
|
+
import type { IUIElement } from "./types/index";
|
|
16
17
|
import type { formTemplate } from "./plugins/link/template";
|
|
17
18
|
import type { IUIForm } from "./types/index";
|
|
18
19
|
import type { IUIOption } from "./types/index";
|
|
@@ -1306,7 +1307,7 @@ interface Config {
|
|
|
1306
1307
|
* Jodit.make('#editor', {
|
|
1307
1308
|
* file: {
|
|
1308
1309
|
* defaultHandlerSuccess(data) {
|
|
1309
|
-
* data.
|
|
1310
|
+
* data.items.forEach(({ file }) => {
|
|
1310
1311
|
* this.s.insertHTML(`<a class="file" href="${data.baseurl + file}">${file}</a>`);
|
|
1311
1312
|
* });
|
|
1312
1313
|
* }
|
|
@@ -1501,7 +1502,7 @@ interface Config {
|
|
|
1501
1502
|
* Element-specific popup toolbars. Keys are tag names (e.g. `img`, `a`, `cells`)
|
|
1502
1503
|
* and values are button lists or factory functions that return them.
|
|
1503
1504
|
*/
|
|
1504
|
-
popup: IDictionary<Array<IControlType | string> | ((editor: IJodit, target: HTMLElement | undefined, close: () => void) => Array<IControlType | string> | HTMLElement | string)>;
|
|
1505
|
+
popup: IDictionary<Array<IControlType | string> | ((editor: IJodit, target: HTMLElement | undefined, close: () => void) => Array<IControlType | string> | HTMLElement | IUIElement | string)>;
|
|
1505
1506
|
/**
|
|
1506
1507
|
* List of button names to exclude from the inline toolbar
|
|
1507
1508
|
*/
|
|
@@ -1514,6 +1515,12 @@ interface Config {
|
|
|
1514
1515
|
* Show an inline toolbar when the user selects text
|
|
1515
1516
|
*/
|
|
1516
1517
|
toolbarInlineForSelection: boolean;
|
|
1518
|
+
/**
|
|
1519
|
+
* Keep an inline toolbar open after one of its buttons runs, beside its
|
|
1520
|
+
* element or the selection. A list the button opened still closes.
|
|
1521
|
+
* `false` closes the toolbar after every button
|
|
1522
|
+
*/
|
|
1523
|
+
toolbarInlineKeepOpen: boolean;
|
|
1517
1524
|
/**
|
|
1518
1525
|
* CSS selector or array of selectors for elements that should not trigger the inline toolbar
|
|
1519
1526
|
*/
|
|
@@ -2144,7 +2151,7 @@ interface Config {
|
|
|
2144
2151
|
* Jodit.make('#editor', {
|
|
2145
2152
|
* video: {
|
|
2146
2153
|
* defaultHandlerSuccess(data) {
|
|
2147
|
-
* data.
|
|
2154
|
+
* data.items.forEach(({ file }) => {
|
|
2148
2155
|
* this.s.insertHTML(`<video controls preload="metadata" src="${data.baseurl + file}"></video>`);
|
|
2149
2156
|
* });
|
|
2150
2157
|
* }
|
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.
|
|
6
|
+
export const APP_VERSION = "4.20.0";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/core/global.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export declare const instances: IDictionary<IJodit>;
|
|
|
15
15
|
export declare function uniqueUid(): string;
|
|
16
16
|
export declare const pluginSystem: PluginSystem;
|
|
17
17
|
export declare const modules: IDictionary<Function>;
|
|
18
|
+
/**
|
|
19
|
+
* Merge language packs into the global `lang` registry
|
|
20
|
+
*
|
|
21
|
+
* `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
|
|
22
|
+
* pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
|
|
23
|
+
*/
|
|
18
24
|
export declare const extendLang: (langs: IDictionary) => void;
|
|
19
25
|
/**
|
|
20
26
|
* Create unique box(HTMLCotainer) and remove it after destroy
|
package/esm/core/global.js
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import { isJoditObject } from "./helpers/checker/is-jodit-object.js";
|
|
7
|
+
import { isPlainObject } from "./helpers/checker/is-plain-object.js";
|
|
7
8
|
import { isString } from "./helpers/checker/is-string.js";
|
|
8
9
|
import { isViewObject } from "./helpers/checker/is-view-object.js";
|
|
9
10
|
import { kebabCase } from "./helpers/string/kebab-case.js";
|
|
10
11
|
import { attr } from "./helpers/utils/attr.js";
|
|
11
12
|
import { css } from "./helpers/utils/css.js";
|
|
12
13
|
import { getClassName } from "./helpers/utils/get-class-name.js";
|
|
14
|
+
import { isUnsafeProtoKey } from "./helpers/utils/is-unsafe-proto-key.js";
|
|
13
15
|
import { PluginSystem } from "./plugin/plugin-system.js";
|
|
14
16
|
import { eventEmitter as globalEventEmitter } from "./event-emitter/global.js";
|
|
15
17
|
import { lang } from "./constants.js";
|
|
@@ -36,14 +38,29 @@ export const pluginSystem = new PluginSystem({
|
|
|
36
38
|
getContainer
|
|
37
39
|
});
|
|
38
40
|
export const modules = {};
|
|
41
|
+
// A CommonJS pack imported as a namespace carries the dictionary in `default`; a translation of the word is a string
|
|
42
|
+
const unwrapModule = (pack) => isPlainObject(pack) && isPlainObject(pack.default) ? pack.default : pack;
|
|
43
|
+
/**
|
|
44
|
+
* Merge language packs into the global `lang` registry
|
|
45
|
+
*
|
|
46
|
+
* `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
|
|
47
|
+
* pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
|
|
48
|
+
*/
|
|
39
49
|
export const extendLang = (langs) => {
|
|
40
50
|
Object.keys(langs).forEach(key => {
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
const pack = unwrapModule(langs[key]);
|
|
52
|
+
if (isUnsafeProtoKey(key) || !isPlainObject(pack)) {
|
|
53
|
+
return;
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
lang[key]
|
|
55
|
+
if (!Object.prototype.hasOwnProperty.call(lang, key) ||
|
|
56
|
+
!isPlainObject(lang[key])) {
|
|
57
|
+
lang[key] = {};
|
|
46
58
|
}
|
|
59
|
+
Object.keys(pack).forEach(name => {
|
|
60
|
+
if (!isUnsafeProtoKey(name)) {
|
|
61
|
+
lang[key][name] = pack[name];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
47
64
|
});
|
|
48
65
|
};
|
|
49
66
|
const boxes = new WeakMap();
|
|
@@ -139,6 +139,18 @@ const URL_ATTRIBUTES = [
|
|
|
139
139
|
'background',
|
|
140
140
|
'xlink:href'
|
|
141
141
|
];
|
|
142
|
+
/**
|
|
143
|
+
* SVG animation elements can write a URL attribute at run time, as
|
|
144
|
+
* `<animate attributeName="href" values="javascript:…">` does, and the
|
|
145
|
+
* attributes below carry the values they write.
|
|
146
|
+
*/
|
|
147
|
+
const ANIMATION_TAGS = new Set([
|
|
148
|
+
'animate',
|
|
149
|
+
'set',
|
|
150
|
+
'animatemotion',
|
|
151
|
+
'animatetransform'
|
|
152
|
+
]);
|
|
153
|
+
const ANIMATION_VALUE_ATTRIBUTES = ['values', 'from', 'to', 'by'];
|
|
142
154
|
/**
|
|
143
155
|
* Tags that load their URL as a *document* (scripts inside run). An SVG data
|
|
144
156
|
* URL is only an XSS vector here — as an `<img>` source it renders inertly.
|
|
@@ -209,6 +221,20 @@ export function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError, re
|
|
|
209
221
|
effected = true;
|
|
210
222
|
}
|
|
211
223
|
}
|
|
224
|
+
// SMIL sets the attribute on click time, after the static check above:
|
|
225
|
+
// `<svg><a><animate attributeName="href" values="javascript:…">` ran
|
|
226
|
+
// in Chromium and Safari. Drop the values that hold a dangerous
|
|
227
|
+
// scheme; `values` is a `;` list. See GHSA-6wrw-v5gj-6xg7
|
|
228
|
+
if (ANIMATION_TAGS.has(tagName)) {
|
|
229
|
+
for (const name of ANIMATION_VALUE_ATTRIBUTES) {
|
|
230
|
+
const value = attrRaw(elm, name);
|
|
231
|
+
if (value &&
|
|
232
|
+
value.split(';').some(part => isDangerousUrl(part, 'a'))) {
|
|
233
|
+
attr(elm, name, null);
|
|
234
|
+
effected = true;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
212
238
|
}
|
|
213
239
|
return effected;
|
|
214
240
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module helpers/utils
|
|
8
|
+
*/
|
|
9
|
+
import type { Nullable } from "../../../types/index";
|
|
10
|
+
/**
|
|
11
|
+
* The name a link reaches an anchor by: its `id`, or in older content its
|
|
12
|
+
* `name`
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAnchorName(anchor: HTMLAnchorElement): string;
|
|
15
|
+
/**
|
|
16
|
+
* An anchor: an `<a>` with a name, no `href` and nothing in it
|
|
17
|
+
*/
|
|
18
|
+
export declare function isAnchor(node: Nullable<Node>): node is HTMLAnchorElement;
|
|
19
|
+
/**
|
|
20
|
+
* The anchors in `root`, in the order they come
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAnchors(root: ParentNode): HTMLAnchorElement[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import { Dom } from "../../dom/dom.js";
|
|
7
|
+
import { toArray } from "../array/to-array.js";
|
|
8
|
+
/**
|
|
9
|
+
* The name a link reaches an anchor by: its `id`, or in older content its
|
|
10
|
+
* `name`
|
|
11
|
+
*/
|
|
12
|
+
export function getAnchorName(anchor) {
|
|
13
|
+
return anchor.id || anchor.getAttribute('name') || '';
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* An anchor: an `<a>` with a name, no `href` and nothing in it
|
|
17
|
+
*/
|
|
18
|
+
export function isAnchor(node) {
|
|
19
|
+
return (Dom.isTag(node, 'a') &&
|
|
20
|
+
!node.hasAttribute('href') &&
|
|
21
|
+
!node.hasChildNodes() &&
|
|
22
|
+
getAnchorName(node) !== '');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The anchors in `root`, in the order they come
|
|
26
|
+
*/
|
|
27
|
+
export function getAnchors(root) {
|
|
28
|
+
return toArray(root.querySelectorAll('a')).filter(isAnchor);
|
|
29
|
+
}
|
|
@@ -16,6 +16,11 @@ export declare class Popup extends UIGroup implements IPopup {
|
|
|
16
16
|
className(): string;
|
|
17
17
|
isOpened: boolean;
|
|
18
18
|
strategy: PopupStrategy;
|
|
19
|
+
/**
|
|
20
|
+
* The popup stays open after one of its buttons runs: the button closes
|
|
21
|
+
* only the lists it opened. See #1741
|
|
22
|
+
*/
|
|
23
|
+
keepOpen: boolean;
|
|
19
24
|
protected appendChildToContainer(childContainer: HTMLElement): void;
|
|
20
25
|
viewBound: () => IBound;
|
|
21
26
|
private __targetBound;
|
|
@@ -335,6 +335,11 @@ let Popup = Popup_1 = class Popup extends UIGroup {
|
|
|
335
335
|
this.smart = smart;
|
|
336
336
|
this.isOpened = false;
|
|
337
337
|
this.strategy = 'leftBottom';
|
|
338
|
+
/**
|
|
339
|
+
* The popup stays open after one of its buttons runs: the button closes
|
|
340
|
+
* only the lists it opened. See #1741
|
|
341
|
+
*/
|
|
342
|
+
this.keepOpen = false;
|
|
338
343
|
this.viewBound = () => ({
|
|
339
344
|
left: 0,
|
|
340
345
|
top: 0,
|
package/esm/jodit.d.ts
CHANGED
|
@@ -131,6 +131,10 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
131
131
|
static readonly constants: typeof constants;
|
|
132
132
|
static readonly instances: IDictionary<IJodit>;
|
|
133
133
|
static readonly lang: any;
|
|
134
|
+
/**
|
|
135
|
+
* Merge language packs into `Jodit.lang`; prototype keys are ignored
|
|
136
|
+
*/
|
|
137
|
+
static readonly extendLang: (langs: IDictionary) => void;
|
|
134
138
|
static readonly core: {
|
|
135
139
|
Plugin: typeof Modules.Plugin;
|
|
136
140
|
};
|
package/esm/jodit.js
CHANGED
|
@@ -17,7 +17,7 @@ var Jodit_1;
|
|
|
17
17
|
import * as constants from "./core/constants.js";
|
|
18
18
|
import { FAT_MODE, IS_PROD, KEY_BACKSPACE, KEY_DELETE, KEY_ENTER, lang } from "./core/constants.js";
|
|
19
19
|
import { autobind, cache, cached, derive, throttle, watch } from "./core/decorators/index.js";
|
|
20
|
-
import { eventEmitter, instances, modules, pluginSystem } from "./core/global.js";
|
|
20
|
+
import { eventEmitter, extendLang, instances, modules, pluginSystem } from "./core/global.js";
|
|
21
21
|
import { asArray, attr, callPromise, ConfigMerge, ConfigProto, css, error, isFunction, isJoditObject, isNumber, isPromise, isString, isVoid, kebabCase, markAsAtomic, normalizeKeyAliases, resolveElement, toArray, ucfirst } from "./core/helpers/index.js";
|
|
22
22
|
import { removeEmptyMarkedTags } from "./core/helpers/html/tag-scan.js";
|
|
23
23
|
import { cssInline } from "./core/helpers/utils/css.js";
|
|
@@ -25,6 +25,7 @@ import { Ajax } from "./core/request/index.js";
|
|
|
25
25
|
import { Dlgs } from "./core/traits/dlgs.js";
|
|
26
26
|
import { Config } from "./config.js";
|
|
27
27
|
import { Create, Dom, History, Plugin, Selection, StatusBar, STATUSES, ViewWithToolbar } from "./modules/index.js";
|
|
28
|
+
import { getItems } from "./modules/uploader/helpers/normalize-uploader-data.js";
|
|
28
29
|
const FOCUS_EVENTS = new Set(['focus', 'blur', 'focusin', 'focusout']);
|
|
29
30
|
const EDITING_KEYS = new Set([KEY_ENTER, KEY_BACKSPACE, KEY_DELETE]);
|
|
30
31
|
/**
|
|
@@ -306,20 +307,16 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
306
307
|
theme: jodit.o.theme,
|
|
307
308
|
shadowRoot: jodit.o.shadowRoot,
|
|
308
309
|
defaultCallback(data) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
jodit.s.insertNode(jodit.createInside.fromHTML(`<a href='${url}' title='${url}'>${url}</a>`));
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
}
|
|
310
|
+
const { baseurl } = data;
|
|
311
|
+
getItems(data).forEach(({ file, isImage }) => {
|
|
312
|
+
const url = baseurl + file;
|
|
313
|
+
if (isImage) {
|
|
314
|
+
jodit.s.insertImage(url, null, jodit.o.imageDefaultWidth);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
jodit.s.insertNode(jodit.createInside.fromHTML(`<a href='${url}' title='${url}'>${url}</a>`));
|
|
318
|
+
}
|
|
319
|
+
});
|
|
323
320
|
}
|
|
324
321
|
}, this.o.filebrowser);
|
|
325
322
|
return jodit.getInstance('FileBrowser', options);
|
|
@@ -1404,6 +1401,10 @@ Jodit.decorators = {};
|
|
|
1404
1401
|
Jodit.constants = constants;
|
|
1405
1402
|
Jodit.instances = instances;
|
|
1406
1403
|
Jodit.lang = lang;
|
|
1404
|
+
/**
|
|
1405
|
+
* Merge language packs into `Jodit.lang`; prototype keys are ignored
|
|
1406
|
+
*/
|
|
1407
|
+
Jodit.extendLang = extendLang;
|
|
1407
1408
|
Jodit.core = {
|
|
1408
1409
|
Plugin
|
|
1409
1410
|
};
|
package/esm/langs/ar.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ declare const _exports: {
|
|
|
27
27
|
'Insert file': string;
|
|
28
28
|
'Insert youtube/vimeo video': string;
|
|
29
29
|
'Insert link': string;
|
|
30
|
+
'Insert anchor': string;
|
|
31
|
+
'Link to an anchor': string;
|
|
32
|
+
'On this page': string;
|
|
33
|
+
'The name cannot contain spaces': string;
|
|
34
|
+
'This name is already in use': string;
|
|
30
35
|
'Font size': string;
|
|
31
36
|
'Font family': string;
|
|
32
37
|
'Insert format block': string;
|
package/esm/langs/ar.js
CHANGED
|
@@ -37,6 +37,11 @@ export default {
|
|
|
37
37
|
'Insert file': 'ادخال الملف',
|
|
38
38
|
'Insert youtube/vimeo video': 'إدراج فيديو يوتيوب/فيميو ',
|
|
39
39
|
'Insert link': 'إدراج رابط',
|
|
40
|
+
'Insert anchor': 'إدراج مرساة',
|
|
41
|
+
'Link to an anchor': 'ربط بمرساة',
|
|
42
|
+
'On this page': 'في هذه الصفحة',
|
|
43
|
+
'The name cannot contain spaces': 'لا يمكن أن يحتوي الاسم على مسافات',
|
|
44
|
+
'This name is already in use': 'هذا الاسم مستخدم بالفعل',
|
|
40
45
|
'Font size': 'حجم الخط',
|
|
41
46
|
'Font family': 'نوع الخط',
|
|
42
47
|
'Insert format block': 'إدراج كتلة تنسيق',
|
package/esm/langs/az.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Line height': string;
|
package/esm/langs/az.js
CHANGED
|
@@ -40,6 +40,11 @@ export default {
|
|
|
40
40
|
'Insert file': 'Fayl əlavə et',
|
|
41
41
|
'Insert youtube/vimeo video': 'Youtube/vimeo video əlavə et',
|
|
42
42
|
'Insert link': 'Keçid əlavə et',
|
|
43
|
+
'Insert anchor': 'Lövbər əlavə et',
|
|
44
|
+
'Link to an anchor': 'Lövbərə keçid',
|
|
45
|
+
'On this page': 'Bu səhifədə',
|
|
46
|
+
'The name cannot contain spaces': 'Adda boşluq ola bilməz',
|
|
47
|
+
'This name is already in use': 'Bu ad artıq istifadə olunur',
|
|
43
48
|
'Font size': 'Şrift ölçüsü',
|
|
44
49
|
'Font family': 'Şrift ailəsi',
|
|
45
50
|
'Line height': 'Sətir hündürlüyü',
|
package/esm/langs/cs_cz.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Insert format block': string;
|
package/esm/langs/cs_cz.js
CHANGED
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
'Buy full version': 'Koupit plnou verzi',
|
|
19
19
|
'Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.':
|
|
20
20
|
'Copyright © XDSoft.net - Chupurnov Valeriy. Všechna práva vyhrazena.',
|
|
21
|
-
Anchor: '
|
|
21
|
+
Anchor: 'Kotva',
|
|
22
22
|
'Open in new tab': 'Otevřít v nové záložce',
|
|
23
23
|
'Open in fullsize': 'Otevřít v celoobrazovkovém režimu',
|
|
24
24
|
'Clear Formatting': 'Vyčistit formátování',
|
|
@@ -38,6 +38,11 @@ export default {
|
|
|
38
38
|
'Insert file': 'Vložit soubor',
|
|
39
39
|
'Insert youtube/vimeo video': 'Vložit video (YT/Vimeo)',
|
|
40
40
|
'Insert link': 'Vložit odkaz',
|
|
41
|
+
'Insert anchor': 'Vložit kotvu',
|
|
42
|
+
'Link to an anchor': 'Odkaz na kotvu',
|
|
43
|
+
'On this page': 'Na této stránce',
|
|
44
|
+
'The name cannot contain spaces': 'Název nesmí obsahovat mezery',
|
|
45
|
+
'This name is already in use': 'Tento název se již používá',
|
|
41
46
|
'Font size': 'Velikost písma',
|
|
42
47
|
'Font family': 'Typ písma',
|
|
43
48
|
'Insert format block': 'Formátovat blok',
|
package/esm/langs/de.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Insert format block': string;
|
package/esm/langs/de.js
CHANGED
|
@@ -39,6 +39,12 @@ export default {
|
|
|
39
39
|
'Insert file': 'Datei einfügen',
|
|
40
40
|
'Insert youtube/vimeo video': 'Youtube/vimeo Video einfügen',
|
|
41
41
|
'Insert link': 'Link einfügen',
|
|
42
|
+
'Insert anchor': 'Anker einfügen',
|
|
43
|
+
'Link to an anchor': 'Mit einem Anker verlinken',
|
|
44
|
+
'On this page': 'Auf dieser Seite',
|
|
45
|
+
'The name cannot contain spaces':
|
|
46
|
+
'Der Name darf keine Leerzeichen enthalten',
|
|
47
|
+
'This name is already in use': 'Dieser Name wird bereits verwendet',
|
|
42
48
|
'Font size': 'Schriftgröße',
|
|
43
49
|
'Font family': 'Schriftfamilie',
|
|
44
50
|
'Insert format block': 'Formatblock einfügen',
|
package/esm/langs/es.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Insert format block': string;
|
package/esm/langs/es.js
CHANGED
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
'Buy full version': 'Compre la versión completa',
|
|
19
19
|
'Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.':
|
|
20
20
|
'Copyright © XDSoft.net - Chupurnov Valeriy. Todos los derechos reservados.',
|
|
21
|
-
Anchor: '
|
|
21
|
+
Anchor: 'Ancla',
|
|
22
22
|
'Open in new tab': 'Abrir en nueva pestaña',
|
|
23
23
|
'Open in fullsize': 'Abrir editor en pantalla completa',
|
|
24
24
|
'Clear Formatting': 'Limpiar formato',
|
|
@@ -38,6 +38,11 @@ export default {
|
|
|
38
38
|
'Insert file': 'Insertar archivo',
|
|
39
39
|
'Insert youtube/vimeo video': 'Insertar video de Youtube/vimeo',
|
|
40
40
|
'Insert link': 'Insertar vínculo',
|
|
41
|
+
'Insert anchor': 'Insertar ancla',
|
|
42
|
+
'Link to an anchor': 'Enlazar a un ancla',
|
|
43
|
+
'On this page': 'En esta página',
|
|
44
|
+
'The name cannot contain spaces': 'El nombre no puede contener espacios',
|
|
45
|
+
'This name is already in use': 'Este nombre ya está en uso',
|
|
41
46
|
'Font size': 'Tamaño de letra',
|
|
42
47
|
'Font family': 'Familia de letra',
|
|
43
48
|
'Insert format block': 'Insertar bloque',
|
package/esm/langs/fa.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Insert format block': string;
|
package/esm/langs/fa.js
CHANGED
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
'Buy full version': 'خرید نسخه کامل',
|
|
18
18
|
'Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.':
|
|
19
19
|
'Copyright © XDSoft.net - Chupurnov Valeriy. Alle Rechte vorbehalten.',
|
|
20
|
-
Anchor: '
|
|
20
|
+
Anchor: 'لنگر',
|
|
21
21
|
'Open in new tab': 'بازکردن در تب جدید',
|
|
22
22
|
'Open in fullsize': 'تمام صفحه کردن ویرایشگر',
|
|
23
23
|
'Clear Formatting': 'پاک کردن قالب ها',
|
|
@@ -38,6 +38,11 @@ export default {
|
|
|
38
38
|
'Insert file': 'افزودن فایل',
|
|
39
39
|
'Insert youtube/vimeo video': 'افزودن ویدیو از یوتیوب و وایمو',
|
|
40
40
|
'Insert link': 'افزودن لینک',
|
|
41
|
+
'Insert anchor': 'افزودن لنگر',
|
|
42
|
+
'Link to an anchor': 'پیوند به لنگر',
|
|
43
|
+
'On this page': 'در این صفحه',
|
|
44
|
+
'The name cannot contain spaces': 'نام نمیتواند فاصله داشته باشد',
|
|
45
|
+
'This name is already in use': 'این نام قبلاً استفاده شده است',
|
|
41
46
|
'Font size': 'اندازه فونت',
|
|
42
47
|
'Font family': 'فونت',
|
|
43
48
|
'Insert format block': 'افزودن بلاک',
|
package/esm/langs/fi.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ declare const _exports: {
|
|
|
28
28
|
'Insert file': string;
|
|
29
29
|
'Insert youtube/vimeo video': string;
|
|
30
30
|
'Insert link': string;
|
|
31
|
+
'Insert anchor': string;
|
|
32
|
+
'Link to an anchor': string;
|
|
33
|
+
'On this page': string;
|
|
34
|
+
'The name cannot contain spaces': string;
|
|
35
|
+
'This name is already in use': string;
|
|
31
36
|
'Font size': string;
|
|
32
37
|
'Font family': string;
|
|
33
38
|
'Insert format block': string;
|
package/esm/langs/fi.js
CHANGED
|
@@ -38,6 +38,11 @@ export default {
|
|
|
38
38
|
'Insert file': 'Lisää tiedosto',
|
|
39
39
|
'Insert youtube/vimeo video': 'Lisää Youtube-/vimeo- video',
|
|
40
40
|
'Insert link': 'Lisää linkki',
|
|
41
|
+
'Insert anchor': 'Lisää ankkuri',
|
|
42
|
+
'Link to an anchor': 'Linkitä ankkuriin',
|
|
43
|
+
'On this page': 'Tällä sivulla',
|
|
44
|
+
'The name cannot contain spaces': 'Nimessä ei voi olla välilyöntejä',
|
|
45
|
+
'This name is already in use': 'Tämä nimi on jo käytössä',
|
|
41
46
|
'Font size': 'Kirjasimen koko',
|
|
42
47
|
'Font family': 'Kirjasimen nimi',
|
|
43
48
|
'Insert format block': 'Lisää muotoilualue',
|