jodit 4.5.3 → 4.5.5
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 +39 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +8 -3
- package/es2015/jodit.min.js +2 -2
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +8 -3
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +1 -1
- 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 +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +8 -3
- package/es2021/jodit.min.js +2 -2
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +8 -3
- package/es2021.en/jodit.min.js +2 -2
- 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/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/975.fat.min.js +1 -1
- package/es5/975.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +8 -3
- package/es5/jodit.min.css +2 -2
- 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/esm/core/async/async.js +15 -16
- package/esm/core/component/component.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/create/create.js +2 -1
- package/esm/core/decorators/cache/cache.js +2 -1
- package/esm/core/decorators/persistent/persistent.js +2 -1
- package/esm/core/decorators/watch/watch.js +3 -2
- package/esm/core/dom/dom.js +15 -11
- package/esm/core/dom/lazy-walker.js +6 -3
- package/esm/core/event-emitter/event-emitter.js +8 -6
- package/esm/core/event-emitter/eventify.js +6 -3
- package/esm/core/event-emitter/observable.js +1 -1
- package/esm/core/global.js +4 -6
- package/esm/core/helpers/array/to-array.js +2 -1
- package/esm/core/helpers/html/apply-styles.js +1 -1
- package/esm/core/helpers/size/position.js +3 -2
- package/esm/core/helpers/string/i18n.js +3 -3
- package/esm/core/helpers/utils/get-class-name.js +2 -1
- package/esm/core/helpers/utils/get.js +1 -1
- package/esm/core/helpers/utils/print.js +4 -3
- package/esm/core/helpers/utils/reset.js +3 -2
- package/esm/core/helpers/utils/selector.js +1 -1
- package/esm/core/helpers/utils/utils.js +6 -5
- package/esm/core/plugin/plugin-system.js +1 -1
- package/esm/core/plugin/plugin.js +3 -2
- package/esm/core/request/ajax.js +7 -4
- package/esm/core/selection/helpers/index.js +2 -1
- package/esm/core/selection/selection.js +27 -20
- package/esm/core/selection/style/api/is-suit-element.js +5 -3
- package/esm/core/selection/style/api/list/wrap-list.js +2 -2
- package/esm/core/selection/style/api/toggle-attributes.js +2 -1
- package/esm/core/selection/style/api/unwrap-children.js +2 -1
- package/esm/core/selection/style/apply-style.js +2 -1
- package/esm/core/selection/style/commit-style.js +2 -1
- package/esm/core/storage/engines/local-storage-provider.js +5 -5
- package/esm/core/traits/mods.js +2 -1
- package/esm/core/ui/button/group/group.js +5 -3
- package/esm/core/ui/element.js +3 -2
- package/esm/core/ui/form/form.js +3 -2
- package/esm/core/ui/form/inputs/area/area.js +1 -1
- package/esm/core/ui/form/inputs/input/input.js +8 -5
- package/esm/core/ui/form/inputs/select/select.js +2 -1
- package/esm/core/ui/group/group.js +2 -2
- package/esm/core/ui/group/list.js +5 -2
- package/esm/core/ui/helpers/buttons.js +2 -1
- package/esm/core/ui/icon.js +6 -5
- package/esm/core/view/view-with-toolbar.js +6 -6
- package/esm/core/view/view.js +7 -5
- package/esm/index.js +2 -1
- package/esm/jodit.js +6 -5
- package/esm/modules/context-menu/context-menu.js +2 -1
- package/esm/modules/file-browser/builders/context-menu.js +2 -1
- package/esm/modules/file-browser/data-provider.js +7 -4
- package/esm/modules/file-browser/file-browser.js +16 -9
- package/esm/modules/history/history.js +2 -1
- package/esm/modules/image-editor/image-editor.js +1 -1
- package/esm/modules/status-bar/status-bar.js +4 -2
- package/esm/modules/table/table.js +4 -2
- package/esm/modules/toolbar/button/button.js +26 -15
- package/esm/modules/toolbar/button/select/select.js +2 -1
- package/esm/modules/uploader/helpers/send.js +1 -1
- package/esm/modules/uploader/uploader.js +1 -1
- package/esm/plugins/ai-assistant/ai-assistant.js +3 -2
- package/esm/plugins/backspace/backspace.js +2 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +6 -4
- package/esm/plugins/backspace/cases/check-unwrap-first-list-item.js +2 -1
- package/esm/plugins/clipboard/clipboard.js +7 -4
- package/esm/plugins/delete/delete.js +2 -1
- package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +3 -2
- package/esm/plugins/enter/enter.js +2 -2
- package/esm/plugins/font/config.js +7 -4
- package/esm/plugins/format-block/config.js +4 -2
- package/esm/plugins/fullsize/fullsize.js +4 -2
- package/esm/plugins/iframe/iframe.js +2 -1
- package/esm/plugins/image-processor/image-processor.js +3 -2
- package/esm/plugins/image-properties/image-properties.js +4 -3
- package/esm/plugins/inline-popup/inline-popup.js +1 -1
- package/esm/plugins/key-arrow-outside/key-arrow-outside.js +2 -1
- package/esm/plugins/link/link.js +9 -8
- package/esm/plugins/mobile/config.js +2 -2
- package/esm/plugins/mobile/mobile.js +3 -4
- package/esm/plugins/ordered-list/config.js +2 -1
- package/esm/plugins/ordered-list/ordered-list.js +1 -1
- package/esm/plugins/paste/paste.js +10 -5
- package/esm/plugins/paste-from-word/paste-from-word.js +2 -1
- package/esm/plugins/placeholder/placeholder.js +2 -1
- package/esm/plugins/print/lib/generate-critical-css.js +3 -3
- package/esm/plugins/search/helpers/highlight-text-ranges.js +1 -1
- package/esm/plugins/search/helpers/sentence-finder.js +2 -1
- package/esm/plugins/search/search.js +13 -7
- package/esm/plugins/search/ui/search.js +1 -1
- package/esm/plugins/select-cells/select-cells.js +8 -4
- package/esm/plugins/size/size.js +3 -2
- package/esm/plugins/source/editor/engines/ace.js +2 -1
- package/esm/plugins/source/editor/sourceEditor.js +2 -1
- package/esm/plugins/source/source.js +31 -18
- package/esm/plugins/speech-recognize/config.js +5 -3
- package/esm/plugins/symbols/symbols.js +1 -1
- package/esm/plugins/video/config.js +4 -4
- package/esm/plugins/wrap-nodes/wrap-nodes.js +9 -6
- package/esm/plugins/xpath/xpath.js +1 -1
- package/package.json +1 -1
|
@@ -34,10 +34,12 @@ export class clipboard {
|
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
init(editor) {
|
|
37
|
-
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = this.buttons) === null || _a === void 0 ? void 0 : _a.forEach(btn => editor.registerButton(btn));
|
|
38
39
|
editor.e
|
|
39
40
|
.off(`copy.${CLIPBOARD_ID} cut.${CLIPBOARD_ID}`)
|
|
40
41
|
.on(`copy.${CLIPBOARD_ID} cut.${CLIPBOARD_ID}`, (event) => {
|
|
42
|
+
var _a;
|
|
41
43
|
const selectedText = editor.s.html;
|
|
42
44
|
const clipboardData = getDataTransfer(event) ||
|
|
43
45
|
getDataTransfer(editor.ew) ||
|
|
@@ -57,13 +59,14 @@ export class clipboard {
|
|
|
57
59
|
editor.s.focus();
|
|
58
60
|
}
|
|
59
61
|
event.preventDefault();
|
|
60
|
-
editor
|
|
62
|
+
(_a = editor === null || editor === void 0 ? void 0 : editor.events) === null || _a === void 0 ? void 0 : _a.fire('afterCopy', selectedText);
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
/** @override */
|
|
64
66
|
destruct(editor) {
|
|
65
|
-
|
|
66
|
-
editor
|
|
67
|
+
var _a, _b;
|
|
68
|
+
(_a = cached(editor, 'buffer')) === null || _a === void 0 ? void 0 : _a.set(CLIPBOARD_ID, '');
|
|
69
|
+
(_b = editor === null || editor === void 0 ? void 0 : editor.events) === null || _b === void 0 ? void 0 : _b.off('.' + CLIPBOARD_ID);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
pluginSystem.add('clipboard', clipboard);
|
|
@@ -117,8 +117,9 @@ export class deleteCommand extends Plugin {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
__moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
|
|
120
|
+
var _a;
|
|
120
121
|
if (!leftSibling || !Dom.isText(leftSibling)) {
|
|
121
|
-
const root = Dom.closest(fake, Dom.isBlock, jodit.editor)
|
|
122
|
+
const root = (_a = Dom.closest(fake, Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
|
|
122
123
|
const leftText = Dom.prev(fake, Dom.isText, root);
|
|
123
124
|
if (leftText) {
|
|
124
125
|
range.setStartAfter(leftText);
|
|
@@ -91,6 +91,7 @@ export class dragAndDropElement extends Plugin {
|
|
|
91
91
|
* Mouse move handler handler
|
|
92
92
|
*/
|
|
93
93
|
onDrag(event) {
|
|
94
|
+
var _a, _b;
|
|
94
95
|
if (!this.draggable || this.state === DragState.IDLE) {
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
@@ -115,8 +116,8 @@ export class dragAndDropElement extends Plugin {
|
|
|
115
116
|
display: 'inline-block',
|
|
116
117
|
left: event.clientX,
|
|
117
118
|
top: event.clientY,
|
|
118
|
-
width: target
|
|
119
|
-
height: target
|
|
119
|
+
width: (_a = target === null || target === void 0 ? void 0 : target.offsetWidth) !== null && _a !== void 0 ? _a : 100,
|
|
120
|
+
height: (_b = target === null || target === void 0 ? void 0 : target.offsetHeight) !== null && _b !== void 0 ? _b : 100
|
|
120
121
|
});
|
|
121
122
|
getContainer(this.j, dragAndDropElement).appendChild(this.draggable);
|
|
122
123
|
}
|
|
@@ -64,8 +64,8 @@ export class enter extends Plugin {
|
|
|
64
64
|
let block = getBlockWrapper(fake, jodit);
|
|
65
65
|
const isLi = Dom.isLeaf(block);
|
|
66
66
|
// if use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
|
|
67
|
-
if ((!isLi || event
|
|
68
|
-
checkBR(fake, jodit, event
|
|
67
|
+
if ((!isLi || (event === null || event === void 0 ? void 0 : event.shiftKey)) &&
|
|
68
|
+
checkBR(fake, jodit, event === null || event === void 0 ? void 0 : event.shiftKey)) {
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
// wrap no wrapped element
|
|
@@ -35,6 +35,7 @@ Config.prototype.controls.fontsize = {
|
|
|
35
35
|
},
|
|
36
36
|
tooltip: 'Font size',
|
|
37
37
|
value: (editor, button) => {
|
|
38
|
+
var _a;
|
|
38
39
|
const current = editor.s.current();
|
|
39
40
|
if (!current) {
|
|
40
41
|
return;
|
|
@@ -44,24 +45,26 @@ Config.prototype.controls.fontsize = {
|
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
const control = button.control;
|
|
47
|
-
const cssKey = control.data
|
|
48
|
+
const cssKey = ((_a = control.data) === null || _a === void 0 ? void 0 : _a.cssRule) || 'font-size';
|
|
48
49
|
const value = css(box, cssKey);
|
|
49
50
|
return value.toString();
|
|
50
51
|
},
|
|
51
52
|
isChildActive: (editor, button) => {
|
|
53
|
+
var _a, _b;
|
|
52
54
|
const value = button.state.value;
|
|
53
|
-
const normalize = button.control.data
|
|
55
|
+
const normalize = (_b = (_a = button.control.data) === null || _a === void 0 ? void 0 : _a.normalize) !== null && _b !== void 0 ? _b : ((v) => v);
|
|
54
56
|
return Boolean(value &&
|
|
55
57
|
button.control.args &&
|
|
56
58
|
normalize(button.control.args[0].toString()) ===
|
|
57
59
|
normalize(value.toString()));
|
|
58
60
|
},
|
|
59
61
|
isActive: (editor, button) => {
|
|
62
|
+
var _a, _b;
|
|
60
63
|
const value = button.state.value;
|
|
61
64
|
if (!value) {
|
|
62
65
|
return false;
|
|
63
66
|
}
|
|
64
|
-
const normalize = button.control.data
|
|
67
|
+
const normalize = (_b = (_a = button.control.data) === null || _a === void 0 ? void 0 : _a.normalize) !== null && _b !== void 0 ? _b : ((v) => v);
|
|
65
68
|
let keySet = button.control.data.cacheListSet;
|
|
66
69
|
if (!keySet) {
|
|
67
70
|
const keys = Object.keys(button.control.list).map(normalize);
|
|
@@ -98,7 +101,7 @@ Config.prototype.controls.font = {
|
|
|
98
101
|
key.indexOf('dings') === -1 &&
|
|
99
102
|
document.fonts.check(`16px ${key}`, value);
|
|
100
103
|
}
|
|
101
|
-
catch { }
|
|
104
|
+
catch (_a) { }
|
|
102
105
|
return `<span data-style="${key}" style="${isAvailable ? `font-family: ${key}!important;` : ''}">${value}</span>`;
|
|
103
106
|
},
|
|
104
107
|
data: {
|
|
@@ -12,9 +12,10 @@ Icon.set('paragraph', paragraphIcon);
|
|
|
12
12
|
Config.prototype.controls.paragraph = {
|
|
13
13
|
command: 'formatBlock',
|
|
14
14
|
value(editor, button) {
|
|
15
|
+
var _a, _b;
|
|
15
16
|
const control = button.control, current = editor.s.current();
|
|
16
17
|
const currentBox = Dom.closest(current, Dom.isBlock, editor.editor);
|
|
17
|
-
return currentBox
|
|
18
|
+
return (_a = currentBox === null || currentBox === void 0 ? void 0 : currentBox.nodeName.toLowerCase()) !== null && _a !== void 0 ? _a : (_b = control.data) === null || _b === void 0 ? void 0 : _b.currentValue;
|
|
18
19
|
},
|
|
19
20
|
update(editor, button) {
|
|
20
21
|
const control = button.control, current = editor.s.current();
|
|
@@ -42,7 +43,8 @@ Config.prototype.controls.paragraph = {
|
|
|
42
43
|
pre: 'Code'
|
|
43
44
|
},
|
|
44
45
|
isChildActive: (editor, button) => {
|
|
45
|
-
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return Boolean(button.state.value === ((_b = (_a = button.control) === null || _a === void 0 ? void 0 : _a.args) === null || _b === void 0 ? void 0 : _b[0]));
|
|
46
48
|
},
|
|
47
49
|
isActive: (editor, button) => {
|
|
48
50
|
return (button.state.value !== editor.o.enter &&
|
|
@@ -41,6 +41,7 @@ export function fullsize(editor) {
|
|
|
41
41
|
* Change editor's state between FullSize and normal
|
|
42
42
|
*/
|
|
43
43
|
toggle = (enable) => {
|
|
44
|
+
var _a;
|
|
44
45
|
const { container, events } = editor;
|
|
45
46
|
if (!container) {
|
|
46
47
|
return;
|
|
@@ -54,7 +55,7 @@ export function fullsize(editor) {
|
|
|
54
55
|
container.classList.toggle('jodit_fullsize', enable);
|
|
55
56
|
if (editor.toolbar) {
|
|
56
57
|
isJoditObject(editor) &&
|
|
57
|
-
editor.toolbarContainer
|
|
58
|
+
((_a = editor.toolbarContainer) === null || _a === void 0 ? void 0 : _a.appendChild(editor.toolbar.container));
|
|
58
59
|
css(editor.toolbar.container, 'width', 'auto');
|
|
59
60
|
}
|
|
60
61
|
enable
|
|
@@ -80,7 +81,8 @@ export function fullsize(editor) {
|
|
|
80
81
|
}
|
|
81
82
|
editor.e
|
|
82
83
|
.on('afterInit afterOpen', () => {
|
|
83
|
-
|
|
84
|
+
var _a;
|
|
85
|
+
editor.toggleFullSize((_a = editor === null || editor === void 0 ? void 0 : editor.options) === null || _a === void 0 ? void 0 : _a.fullsize);
|
|
84
86
|
})
|
|
85
87
|
.on('toggleFullSize', toggle)
|
|
86
88
|
.on('beforeDestruct', () => {
|
|
@@ -171,7 +171,8 @@ export function iframe(editor) {
|
|
|
171
171
|
}
|
|
172
172
|
})
|
|
173
173
|
.on(editor.ew, 'mousedown touchstart keydown keyup touchend click mouseup mousemove scroll', (e) => {
|
|
174
|
-
|
|
174
|
+
var _a;
|
|
175
|
+
(_a = editor.events) === null || _a === void 0 ? void 0 : _a.fire(editor.ow, e);
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
return false;
|
|
@@ -28,7 +28,7 @@ export class imageProcessor extends Plugin {
|
|
|
28
28
|
afterInit(jodit) { }
|
|
29
29
|
beforeDestruct(jodit) {
|
|
30
30
|
const buffer = cached(jodit, 'buffer');
|
|
31
|
-
const list = buffer
|
|
31
|
+
const list = buffer === null || buffer === void 0 ? void 0 : buffer.get(JODIT_IMAGE_BLOB_ID);
|
|
32
32
|
if (buffer && list) {
|
|
33
33
|
const keys = Object.keys(list);
|
|
34
34
|
for (const uri of keys) {
|
|
@@ -67,7 +67,8 @@ export class imageProcessor extends Plugin {
|
|
|
67
67
|
dataBind(elm, JODIT_IMAGE_PROCESSOR_BINDED, true);
|
|
68
68
|
if (!elm.complete) {
|
|
69
69
|
editor.e.on(elm, 'load', function ElementOnLoad() {
|
|
70
|
-
|
|
70
|
+
var _a;
|
|
71
|
+
!editor.isInDestruct && ((_a = editor.e) === null || _a === void 0 ? void 0 : _a.fire('resize'));
|
|
71
72
|
editor.e.off(elm, 'load', ElementOnLoad);
|
|
72
73
|
});
|
|
73
74
|
}
|
|
@@ -224,9 +224,10 @@ export class imageProperties extends Plugin {
|
|
|
224
224
|
}
|
|
225
225
|
/** @override */
|
|
226
226
|
beforeDestruct(editor) {
|
|
227
|
-
|
|
228
|
-
cached(this, '
|
|
229
|
-
cached(this, '
|
|
227
|
+
var _a, _b, _c;
|
|
228
|
+
Object.values((_a = cached(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
|
|
229
|
+
(_b = cached(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
|
|
230
|
+
(_c = cached(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
|
|
230
231
|
editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
|
|
231
232
|
}
|
|
232
233
|
}
|
|
@@ -170,7 +170,7 @@ export class inlinePopup extends Plugin {
|
|
|
170
170
|
const type = 'selection';
|
|
171
171
|
const sel = this.j.s.sel;
|
|
172
172
|
const range = this.j.s.range;
|
|
173
|
-
if (sel
|
|
173
|
+
if ((sel === null || sel === void 0 ? void 0 : sel.isCollapsed) || this.isSelectedTarget(range)) {
|
|
174
174
|
if (this.type === type && this.popup.isOpened) {
|
|
175
175
|
this.hidePopup();
|
|
176
176
|
}
|
|
@@ -25,6 +25,7 @@ export class keyArrowOutside extends Plugin {
|
|
|
25
25
|
afterInit(jodit) { }
|
|
26
26
|
beforeDestruct(jodit) { }
|
|
27
27
|
onKeyDownArrow(e) {
|
|
28
|
+
var _a;
|
|
28
29
|
if (e.key !== KEY_RIGHT || !this.j.selection.isCollapsed()) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
@@ -32,7 +33,7 @@ export class keyArrowOutside extends Plugin {
|
|
|
32
33
|
if (!Dom.isText(endContainer)) {
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
if (endContainer.nodeValue
|
|
36
|
+
if (((_a = endContainer.nodeValue) === null || _a === void 0 ? void 0 : _a.length) === endOffset) {
|
|
36
37
|
const { parentNode } = endContainer;
|
|
37
38
|
if (Dom.isInlineBlock(parentNode) &&
|
|
38
39
|
!Dom.findNotEmptyNeighbor(parentNode, false, this.j.editor)) {
|
package/esm/plugins/link/link.js
CHANGED
|
@@ -55,7 +55,7 @@ export class link extends Plugin {
|
|
|
55
55
|
dialog.open();
|
|
56
56
|
jodit.async.requestIdleCallback(() => {
|
|
57
57
|
const { url_input } = refs(htmlForm.container);
|
|
58
|
-
url_input
|
|
58
|
+
url_input === null || url_input === void 0 ? void 0 : url_input.focus();
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
61
|
hotkeys: jodit.o.link.hotkeys
|
|
@@ -72,16 +72,16 @@ export class link extends Plugin {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
onProcessPasteLink(ignore, html) {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
75
76
|
const { jodit } = this;
|
|
76
77
|
if (!isURL(html) || !jodit.o.link.processPastedLink) {
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
80
|
jodit.e.stopPropagation('processPaste');
|
|
80
81
|
if (jodit.o.link.processVideoLink) {
|
|
81
|
-
const embed = call(jodit.o.video
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
height: jodit.o.video?.defaultHeight
|
|
82
|
+
const embed = call((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.parseUrlToVideoEmbed) !== null && _b !== void 0 ? _b : convertMediaUrlToVideoEmbed, html, {
|
|
83
|
+
width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
|
|
84
|
+
height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
|
|
85
85
|
});
|
|
86
86
|
if (embed !== html) {
|
|
87
87
|
return jodit.createInside.fromHTML(embed);
|
|
@@ -258,7 +258,8 @@ __decorate([
|
|
|
258
258
|
], link.prototype, "__generateForm", null);
|
|
259
259
|
pluginSystem.add('link', link);
|
|
260
260
|
function writeClasses(modeClassName, className_input, className_select, a) {
|
|
261
|
-
|
|
261
|
+
var _a;
|
|
262
|
+
if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
|
|
262
263
|
if (modeClassName === 'input') {
|
|
263
264
|
if (className_input.value === '' && a.hasAttribute('class')) {
|
|
264
265
|
attr(a, 'class', null);
|
|
@@ -272,7 +273,7 @@ function writeClasses(modeClassName, className_input, className_select, a) {
|
|
|
272
273
|
attr(a, 'class', null);
|
|
273
274
|
}
|
|
274
275
|
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
275
|
-
const className = className_select.selectedOptions.item(i)
|
|
276
|
+
const className = (_a = className_select.selectedOptions.item(i)) === null || _a === void 0 ? void 0 : _a.value;
|
|
276
277
|
if (className) {
|
|
277
278
|
a.classList.add(className);
|
|
278
279
|
}
|
|
@@ -300,7 +301,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
|
|
|
300
301
|
if (className) {
|
|
301
302
|
for (let i = 0; i < className_select.options.length; i++) {
|
|
302
303
|
const option = className_select.options.item(i);
|
|
303
|
-
if (option
|
|
304
|
+
if ((option === null || option === void 0 ? void 0 : option.value) && option.value === className) {
|
|
304
305
|
option.selected = true;
|
|
305
306
|
}
|
|
306
307
|
}
|
|
@@ -121,12 +121,12 @@ Config.prototype.controls.dots = {
|
|
|
121
121
|
store = {
|
|
122
122
|
toolbar: makeCollection(editor),
|
|
123
123
|
rebuild: () => {
|
|
124
|
+
var _a, _b;
|
|
124
125
|
if (button) {
|
|
125
126
|
const buttons = editor.e.fire('getDiffButtons.mobile', button.closest(ToolbarCollection));
|
|
126
127
|
if (buttons && store) {
|
|
127
128
|
store.toolbar.build(splitArray(buttons));
|
|
128
|
-
const w = editor.toolbar
|
|
129
|
-
.offsetWidth || 36;
|
|
129
|
+
const w = ((_b = (_a = editor.toolbar) === null || _a === void 0 ? void 0 : _a.firstButton) === null || _b === void 0 ? void 0 : _b.container.offsetWidth) || 36;
|
|
130
130
|
store.toolbar.container.style.width =
|
|
131
131
|
(w + 4) * 3 + 'px';
|
|
132
132
|
}
|
|
@@ -40,10 +40,11 @@ export function mobile(editor) {
|
|
|
40
40
|
if (editor.o.toolbarAdaptive) {
|
|
41
41
|
editor.e
|
|
42
42
|
.on('resize afterInit recalcAdaptive changePlace afterAddPlace', () => {
|
|
43
|
+
var _a, _b;
|
|
43
44
|
if (!editor.o.toolbar) {
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
|
-
const width = (editor.container.parentElement
|
|
47
|
+
const width = ((_a = editor.container.parentElement) !== null && _a !== void 0 ? _a : editor.container).offsetWidth;
|
|
47
48
|
const newStore = (() => {
|
|
48
49
|
if (editor.isFullSize || width >= editor.o.sizeLG) {
|
|
49
50
|
return splitArray(editor.o.buttons);
|
|
@@ -59,9 +60,7 @@ export function mobile(editor) {
|
|
|
59
60
|
if (newStore.toString() !== store.toString()) {
|
|
60
61
|
store = newStore;
|
|
61
62
|
editor.e.fire('closeAllPopups');
|
|
62
|
-
editor.toolbar
|
|
63
|
-
?.setRemoveButtons(editor.o.removeButtons)
|
|
64
|
-
.build(store.concat(editor.o.extraButtons));
|
|
63
|
+
(_b = editor.toolbar) === null || _b === void 0 ? void 0 : _b.setRemoveButtons(editor.o.removeButtons).build(store.concat(editor.o.extraButtons));
|
|
65
64
|
}
|
|
66
65
|
})
|
|
67
66
|
.on(editor.ow, 'load resize', () => editor.e.fire('recalcAdaptive'));
|
|
@@ -9,8 +9,9 @@ import { Config } from "../../config.js";
|
|
|
9
9
|
import olIcon from "./icons/ol.svg.js";
|
|
10
10
|
import ulIcon from "./icons/ul.svg.js";
|
|
11
11
|
const memoExec = (jodit, _, { control }) => {
|
|
12
|
+
var _a;
|
|
12
13
|
const key = `button${control.command}`;
|
|
13
|
-
const value = (control.args && control.args[0])
|
|
14
|
+
const value = (_a = (control.args && control.args[0])) !== null && _a !== void 0 ? _a : dataBind(jodit, key);
|
|
14
15
|
dataBind(jodit, key, value);
|
|
15
16
|
jodit.execCommand(control.command, false, value === 'default' ? null : value);
|
|
16
17
|
};
|
|
@@ -73,9 +73,9 @@ export class paste extends Plugin {
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
const dt = getDataTransfer(e), texts = [
|
|
76
|
-
dt
|
|
77
|
-
dt
|
|
78
|
-
dt
|
|
76
|
+
dt === null || dt === void 0 ? void 0 : dt.getData(TEXT_PLAIN),
|
|
77
|
+
dt === null || dt === void 0 ? void 0 : dt.getData(TEXT_HTML),
|
|
78
|
+
dt === null || dt === void 0 ? void 0 : dt.getData(TEXT_RTF)
|
|
79
79
|
];
|
|
80
80
|
for (const value of texts) {
|
|
81
81
|
if (isHTML(value) &&
|
|
@@ -94,7 +94,7 @@ export class paste extends Plugin {
|
|
|
94
94
|
*/
|
|
95
95
|
defaultPasteProcess(e) {
|
|
96
96
|
const dt = getDataTransfer(e);
|
|
97
|
-
let text = dt
|
|
97
|
+
let text = (dt === null || dt === void 0 ? void 0 : dt.getData(TEXT_HTML)) || (dt === null || dt === void 0 ? void 0 : dt.getData(TEXT_PLAIN));
|
|
98
98
|
if (dt && text && trim(text) !== '') {
|
|
99
99
|
const result = this.j.e.fire('processPaste', e, text, getAllTypes(dt));
|
|
100
100
|
if (result !== undefined) {
|
|
@@ -153,7 +153,12 @@ export class paste extends Plugin {
|
|
|
153
153
|
case INSERT_AS_TEXT:
|
|
154
154
|
html = htmlspecialchars(html);
|
|
155
155
|
break;
|
|
156
|
-
default:
|
|
156
|
+
default: {
|
|
157
|
+
const newHTML = this.j.e.fire('onCustomPasteHTMLOption', action, html, e);
|
|
158
|
+
if (typeof newHTML === 'string') {
|
|
159
|
+
html = newHTML;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
pasteInsertHtml(e, this.j, html);
|
|
@@ -46,10 +46,11 @@ export class pasteFromWord extends Plugin {
|
|
|
46
46
|
* Clear extra styles and tags from Word's pasted text
|
|
47
47
|
*/
|
|
48
48
|
insertFromWordByType(e, html, insertType, texts) {
|
|
49
|
+
var _a;
|
|
49
50
|
switch (insertType) {
|
|
50
51
|
case INSERT_AS_HTML: {
|
|
51
52
|
html = applyStyles(html);
|
|
52
|
-
const value = this.j.events
|
|
53
|
+
const value = (_a = this.j.events) === null || _a === void 0 ? void 0 : _a.fire('beautifyHTML', html);
|
|
53
54
|
if (isString(value)) {
|
|
54
55
|
html = value;
|
|
55
56
|
}
|
|
@@ -28,11 +28,12 @@ import "./config.js";
|
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
30
|
export function isEditorEmpty(root) {
|
|
31
|
+
var _a;
|
|
31
32
|
if (!root.firstChild) {
|
|
32
33
|
return true;
|
|
33
34
|
}
|
|
34
35
|
const first = root.firstChild;
|
|
35
|
-
if (INSEPARABLE_TAGS.has(first.nodeName
|
|
36
|
+
if (INSEPARABLE_TAGS.has((_a = first.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) ||
|
|
36
37
|
/^(TABLE)$/i.test(first.nodeName)) {
|
|
37
38
|
return false;
|
|
38
39
|
}
|
|
@@ -14,7 +14,7 @@ export function generateCriticalCSS(jodit) {
|
|
|
14
14
|
try {
|
|
15
15
|
return toArray(s.cssRules);
|
|
16
16
|
}
|
|
17
|
-
catch { }
|
|
17
|
+
catch (_a) { }
|
|
18
18
|
return [];
|
|
19
19
|
})
|
|
20
20
|
.flat();
|
|
@@ -22,7 +22,7 @@ export function generateCriticalCSS(jodit) {
|
|
|
22
22
|
try {
|
|
23
23
|
return Boolean(r && el.matches(r.selectorText));
|
|
24
24
|
}
|
|
25
|
-
catch { }
|
|
25
|
+
catch (_a) { }
|
|
26
26
|
return false;
|
|
27
27
|
});
|
|
28
28
|
};
|
|
@@ -97,6 +97,6 @@ export function generateCriticalCSS(jodit) {
|
|
|
97
97
|
});
|
|
98
98
|
return cp.generateCSS();
|
|
99
99
|
}
|
|
100
|
-
catch { }
|
|
100
|
+
catch (_a) { }
|
|
101
101
|
return '';
|
|
102
102
|
}
|
|
@@ -42,7 +42,7 @@ export function highlightTextRanges(jodit, rng, restRanges, ci, root) {
|
|
|
42
42
|
while (next && !next.nextSibling && next !== root) {
|
|
43
43
|
next = next.parentNode;
|
|
44
44
|
}
|
|
45
|
-
step = next
|
|
45
|
+
step = next === null || next === void 0 ? void 0 : next.nextSibling;
|
|
46
46
|
}
|
|
47
47
|
next = step;
|
|
48
48
|
} while (next && next !== root);
|
|
@@ -11,7 +11,8 @@ export class SentenceFinder {
|
|
|
11
11
|
this.value = '';
|
|
12
12
|
}
|
|
13
13
|
add(node) {
|
|
14
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
const value = ((_a = node.nodeValue) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
15
16
|
if (!value.length) {
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
@@ -130,13 +130,14 @@ export class search extends Plugin {
|
|
|
130
130
|
return false;
|
|
131
131
|
}
|
|
132
132
|
async findAndSelect(query, next) {
|
|
133
|
+
var _a;
|
|
133
134
|
const bounds = await this.findQueryBounds(query, 'walker');
|
|
134
135
|
if (!bounds.length) {
|
|
135
136
|
return false;
|
|
136
137
|
}
|
|
137
138
|
if (this.previousQuery !== query ||
|
|
138
139
|
!getSelectionWrappers(this.j.editor).length) {
|
|
139
|
-
this.drawPromise
|
|
140
|
+
(_a = this.drawPromise) === null || _a === void 0 ? void 0 : _a.rejectCallback();
|
|
140
141
|
this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
|
|
141
142
|
clearSelectionWrappers(this.j);
|
|
142
143
|
this.drawPromise = this.__drawSelectionRanges(bounds);
|
|
@@ -182,10 +183,13 @@ export class search extends Plugin {
|
|
|
182
183
|
}
|
|
183
184
|
async isValidCache(promise) {
|
|
184
185
|
const res = await promise;
|
|
185
|
-
return res.every(r =>
|
|
186
|
-
|
|
187
|
-
r.
|
|
188
|
-
|
|
186
|
+
return res.every(r => {
|
|
187
|
+
var _a, _b, _c, _d;
|
|
188
|
+
return r.startContainer.isConnected &&
|
|
189
|
+
r.startOffset <= ((_b = (_a = r.startContainer.nodeValue) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) &&
|
|
190
|
+
r.endContainer.isConnected &&
|
|
191
|
+
r.endOffset <= ((_d = (_c = r.endContainer.nodeValue) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0);
|
|
192
|
+
});
|
|
189
193
|
}
|
|
190
194
|
async find(walker, query) {
|
|
191
195
|
if (!query.length) {
|
|
@@ -208,7 +212,8 @@ export class search extends Plugin {
|
|
|
208
212
|
return false;
|
|
209
213
|
})
|
|
210
214
|
.on('end', () => {
|
|
211
|
-
|
|
215
|
+
var _a;
|
|
216
|
+
resolve((_a = sentence.ranges(query)) !== null && _a !== void 0 ? _a : []);
|
|
212
217
|
})
|
|
213
218
|
.setWork(this.j.editor);
|
|
214
219
|
});
|
|
@@ -319,7 +324,8 @@ export class search extends Plugin {
|
|
|
319
324
|
}
|
|
320
325
|
/** @override */
|
|
321
326
|
beforeDestruct(jodit) {
|
|
322
|
-
|
|
327
|
+
var _a;
|
|
328
|
+
(_a = cached(this, 'ui')) === null || _a === void 0 ? void 0 : _a.destruct();
|
|
323
329
|
jodit.e.off('.search');
|
|
324
330
|
}
|
|
325
331
|
}
|
|
@@ -145,7 +145,7 @@ let UISearch = class UISearch extends UIElement {
|
|
|
145
145
|
this.j.e.fire('hidePopup');
|
|
146
146
|
this.setMod('replace', searchAndReplace);
|
|
147
147
|
// this.current = this.j.s.current();
|
|
148
|
-
const selStr = query
|
|
148
|
+
const selStr = query !== null && query !== void 0 ? query : (this.j.s.sel || '').toString();
|
|
149
149
|
if (selStr) {
|
|
150
150
|
this.queryInput.value = selStr;
|
|
151
151
|
}
|
|
@@ -66,10 +66,11 @@ export class selectCells extends Plugin {
|
|
|
66
66
|
// For `clickEditor` correct working. Because `mousedown` on first cell
|
|
67
67
|
// and mouseup on another cell call `click` only for `TR` element.
|
|
68
68
|
.on('clickTr clickTbody', () => {
|
|
69
|
+
var _a;
|
|
69
70
|
const cellsCount = this.__tableModule.getAllSelectedCells().length;
|
|
70
71
|
if (cellsCount) {
|
|
71
72
|
if (cellsCount > 1) {
|
|
72
|
-
this.j.s.sel
|
|
73
|
+
(_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
73
74
|
}
|
|
74
75
|
return false;
|
|
75
76
|
}
|
|
@@ -119,6 +120,7 @@ export class selectCells extends Plugin {
|
|
|
119
120
|
* Mouse move inside the table
|
|
120
121
|
*/
|
|
121
122
|
__onMove(table, e) {
|
|
123
|
+
var _a;
|
|
122
124
|
if (this.j.o.readonly && !this.j.isLocked) {
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
@@ -148,7 +150,7 @@ export class selectCells extends Plugin {
|
|
|
148
150
|
}
|
|
149
151
|
const cellsCount = this.__tableModule.getAllSelectedCells().length;
|
|
150
152
|
if (cellsCount > 1) {
|
|
151
|
-
this.j.s.sel
|
|
153
|
+
(_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
152
154
|
}
|
|
153
155
|
this.j.e.fire('hidePopup');
|
|
154
156
|
e.stopPropagation();
|
|
@@ -157,7 +159,8 @@ export class selectCells extends Plugin {
|
|
|
157
159
|
const n = this.j.createInside.fromHTML('<div style="color:rgba(0,0,0,0.01);width:0;height:0"> </div>');
|
|
158
160
|
cell.appendChild(n);
|
|
159
161
|
this.j.async.setTimeout(() => {
|
|
160
|
-
|
|
162
|
+
var _a;
|
|
163
|
+
(_a = n.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(n);
|
|
161
164
|
}, this.j.defaultTimeout / 5);
|
|
162
165
|
})();
|
|
163
166
|
}
|
|
@@ -165,7 +168,8 @@ export class selectCells extends Plugin {
|
|
|
165
168
|
* On click in outside - remove selection
|
|
166
169
|
*/
|
|
167
170
|
__onRemoveSelection(e) {
|
|
168
|
-
|
|
171
|
+
var _a;
|
|
172
|
+
if (!((_a = e === null || e === void 0 ? void 0 : e.buffer) === null || _a === void 0 ? void 0 : _a.actionTrigger) &&
|
|
169
173
|
!this.__selectedCell &&
|
|
170
174
|
this.__tableModule.getAllSelectedCells().length) {
|
|
171
175
|
this.j.unlock();
|
package/esm/plugins/size/size.js
CHANGED
|
@@ -113,8 +113,9 @@ let size = class size extends Plugin {
|
|
|
113
113
|
* Returns service spaces: toolbar + statusbar
|
|
114
114
|
*/
|
|
115
115
|
__getNotWorkHeight() {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
var _a, _b;
|
|
117
|
+
return ((((_a = this.j.toolbarContainer) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0) +
|
|
118
|
+
(((_b = this.j.statusbar) === null || _b === void 0 ? void 0 : _b.getHeight()) || 0) +
|
|
118
119
|
2);
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
@@ -142,11 +142,12 @@ export class AceEditor extends SourceEditor {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
destruct() {
|
|
145
|
+
var _a, _b;
|
|
145
146
|
this.instance.off('change', this.toWYSIWYG);
|
|
146
147
|
this.instance.off('focus', this.proxyOnFocus);
|
|
147
148
|
this.instance.off('mousedown', this.proxyOnMouseDown);
|
|
148
149
|
this.instance.destroy();
|
|
149
|
-
this.j
|
|
150
|
+
(_b = (_a = this.j) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.off('aceInited.source');
|
|
150
151
|
}
|
|
151
152
|
setValue(value) {
|
|
152
153
|
if (!this.j.o.editHTMLDocumentMode && this.j.o.beautifyHTML) {
|
|
@@ -24,8 +24,9 @@ export class SourceEditor {
|
|
|
24
24
|
this.j.e.fire(this, 'ready');
|
|
25
25
|
}
|
|
26
26
|
onReadyAlways(onReady) {
|
|
27
|
+
var _a;
|
|
27
28
|
if (!this.isReady) {
|
|
28
|
-
this.j.events
|
|
29
|
+
(_a = this.j.events) === null || _a === void 0 ? void 0 : _a.on(this, 'ready', onReady);
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
32
|
onReady();
|