jodit 4.2.25 → 4.2.32
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/.nvmrc +1 -1
- package/CHANGELOG.md +119 -5
- package/es2015/jodit.css +14 -2
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +422 -284
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- 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 +25 -18
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.css +14 -2
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +416 -278
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +25 -18
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +14 -2
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +416 -278
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- 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 +25 -18
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +14 -2
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +391 -272
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- 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 +25 -18
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/164.fat.min.js +10 -0
- package/es5/164.js +4939 -0
- package/es5/164.min.js +10 -0
- package/es5/5.fat.min.js +10 -0
- package/es5/5.js +76 -0
- package/es5/5.min.js +10 -0
- package/es5/jodit.css +21 -6
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +817 -5709
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- 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 +26 -19
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/esm/config.js +3 -7
- package/esm/core/async/async.js +2 -1
- package/esm/core/constants.d.ts +2 -0
- package/esm/core/constants.js +12 -8
- package/esm/core/decorators/watch/watch.js +0 -1
- package/esm/core/dom/dom.d.ts +2 -1
- package/esm/core/dom/dom.js +12 -6
- package/esm/core/event-emitter/event-emitter.js +3 -3
- package/esm/core/global.js +16 -3
- package/esm/core/helpers/array/to-array.d.ts +1 -6
- package/esm/core/helpers/array/to-array.js +1 -1
- package/esm/core/helpers/async/set-timeout.d.ts +0 -3
- package/esm/core/helpers/async/set-timeout.js +3 -2
- package/esm/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
- package/esm/core/helpers/checker/has-browser-color-picker.js +2 -1
- package/esm/core/helpers/checker/is-url.d.ts +0 -3
- package/esm/core/helpers/checker/is-url.js +2 -1
- package/esm/core/helpers/html/apply-styles.js +3 -3
- package/esm/core/helpers/html/clean-from-word.js +2 -1
- package/esm/core/helpers/html/htmlspecialchars.d.ts +0 -3
- package/esm/core/helpers/html/htmlspecialchars.js +2 -1
- package/esm/core/helpers/normalize/normalize-key-aliases.js +2 -1
- package/esm/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/esm/core/helpers/size/get-scroll-parent.js +3 -2
- package/esm/core/helpers/utils/complete-url.js +2 -1
- package/esm/core/helpers/utils/convert-media-url-to-video-embed.js +2 -1
- package/esm/core/helpers/utils/default-language.js +3 -2
- package/esm/core/helpers/utils/reset.js +3 -3
- package/esm/core/request/ajax.js +2 -1
- package/esm/core/selection/selection.js +1 -0
- package/esm/core/selection/style/api/has-same-style.js +15 -10
- package/esm/core/selection/style/api/toggle-attributes.js +2 -1
- package/esm/core/selection/style/commit-style.d.ts +1 -1
- package/esm/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/esm/core/ui/button/tooltip/tooltip.js +11 -5
- package/esm/core/ui/form/inputs/file/file.d.ts +1 -0
- package/esm/core/ui/form/inputs/file/file.js +1 -0
- package/esm/core/ui/form/validators/input.d.ts +3 -3
- package/esm/core/ui/form/validators/select.d.ts +1 -1
- package/esm/jodit.js +3 -0
- package/esm/modules/file-browser/config.js +9 -1
- package/esm/modules/file-browser/data-provider.js +0 -1
- package/esm/modules/file-browser/file-browser.js +0 -1
- package/esm/modules/table/table.d.ts +2 -3
- package/esm/modules/table/table.js +27 -35
- package/esm/modules/toolbar/button/button.d.ts +1 -1
- package/esm/plugins/add-new-line/add-new-line.js +4 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +1 -0
- package/esm/plugins/clean-html/config.d.ts +3 -3
- package/esm/plugins/clean-html/helpers/visitor/filters/fill-empty-paragraph.js +9 -1
- package/esm/plugins/hotkeys/hotkeys.js +4 -2
- package/esm/plugins/iframe/config.d.ts +15 -3
- package/esm/plugins/iframe/config.js +1 -0
- package/esm/plugins/iframe/iframe.js +3 -0
- package/esm/plugins/indent/helpers.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/a.d.ts +2 -2
- package/esm/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/img.d.ts +1 -1
- package/esm/plugins/search/config.js +2 -2
- package/esm/plugins/search/helpers/highlight-text-ranges.js +3 -1
- package/esm/plugins/select-cells/select-cells.js +1 -1
- package/esm/plugins/source/editor/engines/ace.d.ts +0 -1
- package/esm/plugins/speech-recognize/config.js +1 -1
- package/esm/plugins/speech-recognize/helpers/api.d.ts +1 -1
- package/esm/plugins/speech-recognize/helpers/api.js +5 -2
- package/esm/plugins/speech-recognize/helpers/sound.js +6 -4
- package/esm/plugins/stat/config.d.ts +1 -0
- package/esm/plugins/stat/config.js +1 -0
- package/esm/plugins/stat/stat.js +14 -3
- package/esm/plugins/symbols/langs/index.d.ts +2 -1
- package/esm/plugins/symbols/langs/index.js +2 -1
- package/esm/plugins/symbols/langs/ua.d.ts +1 -0
- package/esm/plugins/symbols/langs/ua.js +9 -0
- package/esm/plugins/table/config.js +19 -3
- package/esm/polyfills.d.ts +10 -0
- package/esm/polyfills.js +54 -0
- package/esm/tsconfig.json +1 -1
- package/package.json +1 -1
- package/types/core/constants.d.ts +2 -0
- package/types/core/dom/dom.d.ts +2 -1
- package/types/core/helpers/array/to-array.d.ts +1 -6
- package/types/core/helpers/async/set-timeout.d.ts +0 -3
- package/types/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
- package/types/core/helpers/checker/is-url.d.ts +0 -3
- package/types/core/helpers/html/htmlspecialchars.d.ts +0 -3
- package/types/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/types/core/selection/style/commit-style.d.ts +1 -1
- package/types/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/types/core/ui/form/inputs/file/file.d.ts +1 -0
- package/types/core/ui/form/validators/input.d.ts +3 -3
- package/types/core/ui/form/validators/select.d.ts +1 -1
- package/types/modules/table/table.d.ts +2 -3
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/plugins/clean-html/config.d.ts +3 -3
- package/types/plugins/iframe/config.d.ts +15 -3
- package/types/plugins/indent/helpers.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/a.d.ts +2 -2
- package/types/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/img.d.ts +1 -1
- package/types/plugins/source/editor/engines/ace.d.ts +0 -1
- package/types/plugins/speech-recognize/helpers/api.d.ts +1 -1
- package/types/plugins/stat/config.d.ts +1 -0
- package/types/plugins/symbols/langs/index.d.ts +2 -1
- package/types/plugins/symbols/langs/ua.d.ts +1 -0
- package/types/polyfills.d.ts +10 -0
- package/types/tsconfig.json +1 -1
|
@@ -15,7 +15,8 @@ export class hotkeys extends Plugin {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.onKeyPress = (event) => {
|
|
18
|
-
const special = this.specialKeys[event.which]
|
|
18
|
+
const special = this.specialKeys[event.which];
|
|
19
|
+
const character = (event.key || String.fromCharCode(event.which)).toLowerCase();
|
|
19
20
|
const modif = [special || character];
|
|
20
21
|
['alt', 'ctrl', 'shift', 'meta'].forEach(specialKey => {
|
|
21
22
|
if (event[specialKey + 'Key'] && special !== specialKey) {
|
|
@@ -109,7 +110,8 @@ export class hotkeys extends Plugin {
|
|
|
109
110
|
}
|
|
110
111
|
})
|
|
111
112
|
.on('keydown.hotkeys', (event) => {
|
|
112
|
-
const shortcut = this.onKeyPress(event)
|
|
113
|
+
const shortcut = this.onKeyPress(event);
|
|
114
|
+
const stop = {
|
|
113
115
|
shouldStop: true
|
|
114
116
|
};
|
|
115
117
|
const resultOfFire = this.j.e.fire(shortcut + '.hotkey', event.type, stop);
|
|
@@ -22,7 +22,7 @@ declare module 'jodit/config' {
|
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```javascript
|
|
25
|
-
*
|
|
25
|
+
* Jodit.make('#editor', {
|
|
26
26
|
* iframe: true,
|
|
27
27
|
* iframeBaseUrl: 'https://xdsoft.net/jodit/docs/',
|
|
28
28
|
* });
|
|
@@ -41,7 +41,7 @@ declare module 'jodit/config' {
|
|
|
41
41
|
* Custom style to be used inside the iframe to display content.
|
|
42
42
|
* @example
|
|
43
43
|
* ```javascript
|
|
44
|
-
*
|
|
44
|
+
* Jodit.make('#editor', {
|
|
45
45
|
* iframe: true,
|
|
46
46
|
* iframeStyle: 'html{margin: 0px;}',
|
|
47
47
|
* })
|
|
@@ -53,13 +53,25 @@ declare module 'jodit/config' {
|
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```javascript
|
|
56
|
-
*
|
|
56
|
+
* Jodit.make('#editor', {
|
|
57
57
|
* iframe: true,
|
|
58
58
|
* iframeCSSLinks: ['styles/default.css'],
|
|
59
59
|
* })
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
62
|
iframeCSSLinks: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Custom sandbox attribute for the iframe.
|
|
65
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
|
|
66
|
+
* ```javascript
|
|
67
|
+
* Jodit.make('#editor', {
|
|
68
|
+
* iframe: true,
|
|
69
|
+
* iframeSandbox: 'allow-same-origin allow-scripts'
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
* Empty string value means that all restrictions are enabled.
|
|
73
|
+
*/
|
|
74
|
+
iframeSandbox: string | null;
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
77
|
export {};
|
|
@@ -61,6 +61,9 @@ export function iframe(editor) {
|
|
|
61
61
|
iframe.setAttribute('allowtransparency', 'true');
|
|
62
62
|
iframe.setAttribute('tabindex', opt.tabIndex.toString());
|
|
63
63
|
iframe.setAttribute('frameborder', '0');
|
|
64
|
+
if (opt.iframeSandbox != null) {
|
|
65
|
+
iframe.setAttribute('sandbox', opt.iframeSandbox);
|
|
66
|
+
}
|
|
64
67
|
editor.workplace.appendChild(iframe);
|
|
65
68
|
editor.iframe = iframe;
|
|
66
69
|
const result = editor.e.fire('generateDocumentStructure.iframe', null, editor);
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* Get style rule key for current direction
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare const getKey: (direction: string, box: HTMLElement) =>
|
|
10
|
+
export declare const getKey: (direction: string, box: HTMLElement) => "marginLeft" | "marginRight" | "paddingLeft" | "paddingRight";
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
|
-
import type { IControlType
|
|
10
|
-
declare const _default:
|
|
9
|
+
import type { IControlType } from "../../../../types";
|
|
10
|
+
declare const _default: Array<IControlType | string>;
|
|
11
11
|
export default _default;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @module plugins/inline-popup
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType } from "../../../../types";
|
|
10
|
-
declare const _default:
|
|
10
|
+
declare const _default: Array<IControlType | string>;
|
|
11
11
|
export default _default;
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { IControlType, IJodit } from "../../../../types";
|
|
10
10
|
export declare const align: IControlType<IJodit>;
|
|
11
|
-
declare const _default:
|
|
11
|
+
declare const _default: Array<IControlType | string>;
|
|
12
12
|
export default _default;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
import { globalWindow } from "../../core/constants.js";
|
|
6
7
|
import { Icon } from "../../core/ui/icon.js";
|
|
7
8
|
import { Config } from "../../config.js";
|
|
8
9
|
import "./interface.js";
|
|
@@ -10,8 +11,7 @@ import searchIcon from "./search.svg.js";
|
|
|
10
11
|
Config.prototype.useSearch = true;
|
|
11
12
|
Config.prototype.search = {
|
|
12
13
|
lazyIdleTimeout: 0,
|
|
13
|
-
|
|
14
|
-
useCustomHighlightAPI: typeof window.Highlight !== 'undefined'
|
|
14
|
+
useCustomHighlightAPI: globalWindow && typeof globalWindow.Highlight !== 'undefined'
|
|
15
15
|
};
|
|
16
16
|
Icon.set('search', searchIcon);
|
|
17
17
|
Config.prototype.controls.find = {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
import { globalWindow } from "../../../core/constants.js";
|
|
6
7
|
import { Dom } from "../../../core/dom/dom.js";
|
|
7
8
|
import { $$ } from "../../../core/helpers/utils/selector.js";
|
|
8
9
|
/**
|
|
@@ -73,7 +74,8 @@ function isSelectionWrapper(node) {
|
|
|
73
74
|
function checkNativeSelectionMethod(jodit, rng, restRanges) {
|
|
74
75
|
if (jodit.o.search.useCustomHighlightAPI &&
|
|
75
76
|
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
76
|
-
|
|
77
|
+
globalWindow &&
|
|
78
|
+
typeof globalWindow.Highlight !== 'undefined') {
|
|
77
79
|
const ranges = [rng, ...restRanges].map(rng => {
|
|
78
80
|
const range = jodit.selection.createRange();
|
|
79
81
|
range.setStart(rng.startContainer, rng.startOffset);
|
|
@@ -283,7 +283,7 @@ export class selectCells extends Plugin {
|
|
|
283
283
|
break;
|
|
284
284
|
case 'addcolumnafter':
|
|
285
285
|
case 'addcolumnbefore':
|
|
286
|
-
this.__tableModule.appendColumn(table, cell
|
|
286
|
+
this.__tableModule.appendColumn(table, cell, command === 'addcolumnafter');
|
|
287
287
|
break;
|
|
288
288
|
case 'addrowafter':
|
|
289
289
|
case 'addrowbefore':
|
|
@@ -55,7 +55,7 @@ Config.prototype.controls.speechRecognize = {
|
|
|
55
55
|
api = new RecognizeManager(jodit.async, nativeApi);
|
|
56
56
|
api.lang = isString(lang)
|
|
57
57
|
? lang
|
|
58
|
-
: attr(jodit.od.documentElement, 'lang') ?? undefined;
|
|
58
|
+
: (attr(jodit.od.documentElement, 'lang') ?? undefined);
|
|
59
59
|
api.continuous = continuous;
|
|
60
60
|
api.interimResults = interimResults;
|
|
61
61
|
api.sound = sound;
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { globalWindow } from "../../../core/constants.js";
|
|
7
|
+
export const SpeechRecognition = globalWindow
|
|
8
|
+
? globalWindow.SpeechRecognition ||
|
|
9
|
+
globalWindow.webkitSpeechRecognition
|
|
10
|
+
: undefined;
|
|
@@ -6,18 +6,20 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugins/speech-recognize
|
|
8
8
|
*/
|
|
9
|
+
import { globalWindow } from "../../../core/constants.js";
|
|
9
10
|
import { PII } from "../constants.js";
|
|
10
11
|
/**
|
|
11
12
|
* @internal
|
|
12
13
|
*/
|
|
13
14
|
export function sound({ sec = 0.1, frequency = PII, gain = 0.1, type = 'sine' } = {}) {
|
|
14
|
-
if (
|
|
15
|
-
typeof
|
|
15
|
+
if (!globalWindow ||
|
|
16
|
+
(typeof globalWindow.AudioContext === 'undefined' &&
|
|
17
|
+
typeof globalWindow.webkitAudioContext === 'undefined')) {
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
20
|
// one context per document
|
|
19
|
-
const context = new (
|
|
20
|
-
|
|
21
|
+
const context = new (globalWindow.AudioContext ||
|
|
22
|
+
globalWindow.webkitAudioContext)();
|
|
21
23
|
const vol = context.createGain();
|
|
22
24
|
const osc = context.createOscillator();
|
|
23
25
|
osc.type = type;
|
package/esm/plugins/stat/stat.js
CHANGED
|
@@ -29,9 +29,20 @@ export class stat extends Plugin {
|
|
|
29
29
|
this.calc = this.j.async.throttle(() => {
|
|
30
30
|
const text = this.j.text;
|
|
31
31
|
if (this.j.o.showCharsCounter && this.charCounter) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let chars;
|
|
33
|
+
if (this.j.o.countHTMLChars) {
|
|
34
|
+
chars = this.j.value;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (this.j.o.countTextSpaces) {
|
|
38
|
+
chars = text
|
|
39
|
+
.replace(INVISIBLE_SPACE_REG_EXP(), '')
|
|
40
|
+
.replace(/[\r\n]/g, '');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
chars = text.replace(SPACE_REG_EXP(), '');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
35
46
|
this.charCounter.textContent = this.j.i18n('Chars: %d', chars.length);
|
|
36
47
|
}
|
|
37
48
|
if (this.j.o.showWordsCounter && this.wordCounter) {
|
|
@@ -22,6 +22,7 @@ import * as pl from "./pl.js";
|
|
|
22
22
|
import * as pt_br from "./pt_br.js";
|
|
23
23
|
import * as ru from "./ru.js";
|
|
24
24
|
import * as tr from "./tr.js";
|
|
25
|
+
import * as ua from "./ua.js";
|
|
25
26
|
import * as zh_cn from "./zh_cn.js";
|
|
26
27
|
import * as zh_tw from "./zh_tw.js";
|
|
27
|
-
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 };
|
|
28
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, ua, zh_cn, zh_tw };
|
|
@@ -22,6 +22,7 @@ import * as pl from "./pl.js";
|
|
|
22
22
|
import * as pt_br from "./pt_br.js";
|
|
23
23
|
import * as ru from "./ru.js";
|
|
24
24
|
import * as tr from "./tr.js";
|
|
25
|
+
import * as ua from "./ua.js";
|
|
25
26
|
import * as zh_cn from "./zh_cn.js";
|
|
26
27
|
import * as zh_tw from "./zh_tw.js";
|
|
27
|
-
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 };
|
|
28
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, ua, zh_cn, zh_tw };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export let symbols: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
|
+
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
symbols: 'символ'
|
|
9
|
+
};
|
|
@@ -25,6 +25,8 @@ Config.prototype.controls.table = {
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
popup: (editor, current, close, button) => {
|
|
28
|
+
editor.editor.normalize();
|
|
29
|
+
const snapshot = editor.history.snapshot.make();
|
|
28
30
|
const control = button.control;
|
|
29
31
|
const default_rows_count = control.data && control.data.rows ? control.data.rows : 10, default_cols_count = control.data && control.data.cols ? control.data.cols : 10;
|
|
30
32
|
const generateExtraClasses = () => {
|
|
@@ -117,10 +119,24 @@ Config.prototype.controls.table = {
|
|
|
117
119
|
table.classList.add(className);
|
|
118
120
|
});
|
|
119
121
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
editor.s.restore();
|
|
123
|
+
editor.s.removeMarkers();
|
|
124
|
+
editor.editor.normalize();
|
|
125
|
+
editor.history.snapshot.restore(snapshot);
|
|
126
|
+
const block = Dom.furthest(editor.s.current(), Dom.isBlock, editor.editor);
|
|
127
|
+
if (block && Dom.isEmpty(block)) {
|
|
128
|
+
Dom.replace(block, table, undefined, false, true);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
if (block) {
|
|
132
|
+
const fake = crt.text('\n');
|
|
133
|
+
Dom.after(block, fake);
|
|
134
|
+
Dom.after(fake, table);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
editor.s.insertNode(table, false);
|
|
138
|
+
}
|
|
122
139
|
}
|
|
123
|
-
editor.s.insertNode(table, false);
|
|
124
140
|
if (first_td) {
|
|
125
141
|
editor.s.setCursorIn(first_td);
|
|
126
142
|
scrollIntoViewIfNeeded(first_td, editor.editor, editor.ed);
|
|
@@ -0,0 +1,10 @@
|
|
|
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import "classlist-polyfill";
|
|
7
|
+
import "es6-promise/auto";
|
|
8
|
+
import "core-js/es/symbol";
|
|
9
|
+
import "core-js/es/array/find-index";
|
|
10
|
+
import "core-js/es/array/from";
|
package/esm/polyfills.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import "classlist-polyfill";
|
|
7
|
+
import "es6-promise/auto";
|
|
8
|
+
import "core-js/es/symbol";
|
|
9
|
+
import "core-js/es/array/find-index";
|
|
10
|
+
import "core-js/es/array/from";
|
|
11
|
+
// for ie11
|
|
12
|
+
if (!Array.prototype.includes) {
|
|
13
|
+
Array.prototype.includes = function (value) {
|
|
14
|
+
return this.indexOf(value) > -1;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// for ie11
|
|
18
|
+
if (typeof Object.assign !== 'function') {
|
|
19
|
+
// Must be writable: true, enumerable: false, configurable: true
|
|
20
|
+
Object.defineProperty(Object, 'assign', {
|
|
21
|
+
value: function assign(target, varArgs) {
|
|
22
|
+
// .length of function is 2
|
|
23
|
+
if (target == null) {
|
|
24
|
+
throw new TypeError('Cannot convert undefined or null to object');
|
|
25
|
+
}
|
|
26
|
+
const to = Object(target);
|
|
27
|
+
for (let index = 1; index < arguments.length; index++) {
|
|
28
|
+
// eslint-disable-next-line prefer-rest-params
|
|
29
|
+
const nextSource = arguments[index];
|
|
30
|
+
if (nextSource != null) {
|
|
31
|
+
for (const nextKey in nextSource) {
|
|
32
|
+
// Avoid bugs when hasOwnProperty is shadowed
|
|
33
|
+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
34
|
+
to[nextKey] = nextSource[nextKey];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return to;
|
|
40
|
+
},
|
|
41
|
+
writable: true,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (!Array.prototype.find) {
|
|
46
|
+
Array.prototype.find = function (value) {
|
|
47
|
+
return this.indexOf(value) > -1 ? value : undefined;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (!String.prototype.endsWith) {
|
|
51
|
+
String.prototype.endsWith = function (value) {
|
|
52
|
+
return this[this.length - 1] === value;
|
|
53
|
+
};
|
|
54
|
+
}
|
package/esm/tsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -32,6 +32,8 @@ export declare const INVISIBLE_SPACE_REG_EXP_START: () => RegExp;
|
|
|
32
32
|
export declare const SPACE_REG_EXP: () => RegExp;
|
|
33
33
|
export declare const SPACE_REG_EXP_START: () => RegExp;
|
|
34
34
|
export declare const SPACE_REG_EXP_END: () => RegExp;
|
|
35
|
+
export declare const globalWindow: typeof window;
|
|
36
|
+
export declare const globalDocument: Document;
|
|
35
37
|
export declare const IS_BLOCK: RegExp;
|
|
36
38
|
export declare const IS_INLINE: RegExp;
|
|
37
39
|
export declare const LIST_TAGS: Set<"ol" | "ul">;
|
package/types/core/dom/dom.d.ts
CHANGED
|
@@ -45,8 +45,9 @@ export declare class Dom {
|
|
|
45
45
|
* // Replace the first <span> element to the < p >
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
+
static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames): T;
|
|
48
49
|
static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames, create: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
|
|
49
|
-
static replace<T extends Node>(elm: Node, newTagName: T | string, create
|
|
50
|
+
static replace<T extends Node>(elm: Node, newTagName: T | string, create?: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
|
|
50
51
|
/**
|
|
51
52
|
* Checks whether the Node text and blank (in this case it may contain invisible auxiliary characters ,
|
|
52
53
|
* it is also empty )
|
|
@@ -12,9 +12,4 @@
|
|
|
12
12
|
* Jodit.modules.Helpers.toArray(1) // []
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export declare const toArray:
|
|
16
|
-
<T>(arrayLike: ArrayLike<T>): T[];
|
|
17
|
-
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
18
|
-
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
19
|
-
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
20
|
-
};
|
|
15
|
+
export declare const toArray: typeof Array.from;
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* @module helpers/async
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Create async callback if set timeout value - else call function immediately
|
|
11
8
|
*/
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* @module helpers/checker
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Check if browser has a color picker (a new HTML5 attribute for input tag)
|
|
11
8
|
*/
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* @module helpers/html
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Convert special characters to HTML entities
|
|
11
8
|
*/
|
|
@@ -23,7 +23,7 @@ export declare class CommitStyle implements ICommitStyle {
|
|
|
23
23
|
*/
|
|
24
24
|
get isElementCommit(): boolean;
|
|
25
25
|
get defaultTag(): HTMLTagNames;
|
|
26
|
-
get elementIsDefault():
|
|
26
|
+
get elementIsDefault(): boolean;
|
|
27
27
|
constructor(options: IStyleOptions);
|
|
28
28
|
apply(jodit: IJodit): void;
|
|
29
29
|
}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module ui/form
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { IUIInputValidator } from "../../../../types";
|
|
10
10
|
/**
|
|
11
11
|
* Input is required
|
|
12
12
|
*/
|
|
13
|
-
export declare const required: IUIInputValidator
|
|
13
|
+
export declare const required: IUIInputValidator;
|
|
14
14
|
/**
|
|
15
15
|
* Input value should be valid URL
|
|
16
16
|
*/
|
|
17
|
-
export declare const url: IUIInputValidator
|
|
17
|
+
export declare const url: IUIInputValidator;
|
|
@@ -62,11 +62,10 @@ export declare class Table extends ViewComponent<IJodit> {
|
|
|
62
62
|
* Remove row
|
|
63
63
|
*/
|
|
64
64
|
removeRow(table: HTMLTableElement, rowIndex: number): void;
|
|
65
|
-
private static __appendColumn;
|
|
66
65
|
/**
|
|
67
66
|
* Insert column before / after all the columns containing the selected cells
|
|
68
67
|
*/
|
|
69
|
-
appendColumn(table: HTMLTableElement,
|
|
68
|
+
appendColumn(table: HTMLTableElement, selectedCell: HTMLTableCellElement, insertAfter?: boolean): void;
|
|
70
69
|
private static __removeColumn;
|
|
71
70
|
/**
|
|
72
71
|
* Remove column by index
|
|
@@ -86,7 +85,7 @@ export declare class Table extends ViewComponent<IJodit> {
|
|
|
86
85
|
normalizeTable(table: HTMLTableElement): void;
|
|
87
86
|
private static __mergeSelected;
|
|
88
87
|
/**
|
|
89
|
-
* It combines all
|
|
88
|
+
* It combines all the selected cells into one. The contents of the cells will also be combined
|
|
90
89
|
*/
|
|
91
90
|
mergeSelected(table: HTMLTableElement): void;
|
|
92
91
|
private static __splitHorizontal;
|
|
@@ -20,7 +20,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
20
20
|
theme: string;
|
|
21
21
|
currentValue: string;
|
|
22
22
|
hasTrigger: boolean;
|
|
23
|
-
size: "
|
|
23
|
+
size: "tiny" | "xsmall" | "small" | "middle" | "large";
|
|
24
24
|
name: string;
|
|
25
25
|
value: string | number | boolean;
|
|
26
26
|
variant: import("../../../types").ButtonVariant;
|
|
@@ -19,9 +19,9 @@ declare module 'jodit/config' {
|
|
|
19
19
|
removeEmptyElements: boolean;
|
|
20
20
|
replaceOldTags: IDictionary<HTMLTagNames> | false;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* You can use an iframe with the sandbox attribute to safely paste and test HTML code.
|
|
23
|
+
* It prevents scripts and handlers from running, but it does slow things down.
|
|
24
|
+
*
|
|
25
25
|
* ```javascript
|
|
26
26
|
* Jodit.make('#editor', {
|
|
27
27
|
* cleanHTML: {
|