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
|
@@ -48,16 +48,14 @@ export class ViewWithToolbar extends View {
|
|
|
48
48
|
* Helper for appended toolbar in its place
|
|
49
49
|
*/
|
|
50
50
|
buildToolbar() {
|
|
51
|
+
var _a;
|
|
51
52
|
if (!this.o.toolbar) {
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
55
|
const buttons = this.o.buttons
|
|
55
56
|
? splitArray(this.o.buttons)
|
|
56
57
|
: [];
|
|
57
|
-
this.toolbar
|
|
58
|
-
?.setRemoveButtons(this.o.removeButtons)
|
|
59
|
-
.build(buttons.concat(this.o.extraButtons || []))
|
|
60
|
-
.appendTo(this.toolbarContainer);
|
|
58
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(this.toolbarContainer);
|
|
61
59
|
}
|
|
62
60
|
getRegisteredButtonGroups() {
|
|
63
61
|
return this.groupToButtons;
|
|
@@ -66,8 +64,9 @@ export class ViewWithToolbar extends View {
|
|
|
66
64
|
* Register button for a group
|
|
67
65
|
*/
|
|
68
66
|
registerButton(btn) {
|
|
67
|
+
var _a;
|
|
69
68
|
this.registeredButtons.add(btn);
|
|
70
|
-
const group = btn.group
|
|
69
|
+
const group = (_a = btn.group) !== null && _a !== void 0 ? _a : 'other';
|
|
71
70
|
if (!this.groupToButtons[group]) {
|
|
72
71
|
this.groupToButtons[group] = [];
|
|
73
72
|
}
|
|
@@ -83,8 +82,9 @@ export class ViewWithToolbar extends View {
|
|
|
83
82
|
* Remove button from a group
|
|
84
83
|
*/
|
|
85
84
|
unregisterButton(btn) {
|
|
85
|
+
var _a;
|
|
86
86
|
this.registeredButtons.delete(btn);
|
|
87
|
-
const groupName = btn.group
|
|
87
|
+
const groupName = (_a = btn.group) !== null && _a !== void 0 ? _a : 'other', group = this.groupToButtons[groupName];
|
|
88
88
|
if (group) {
|
|
89
89
|
const index = group.indexOf(btn.name);
|
|
90
90
|
if (index !== -1) {
|
package/esm/core/view/view.js
CHANGED
|
@@ -168,7 +168,8 @@ let View = View_1 = class View extends Component {
|
|
|
168
168
|
* Can change ownerWindow here
|
|
169
169
|
*/
|
|
170
170
|
initOwners() {
|
|
171
|
-
|
|
171
|
+
var _a;
|
|
172
|
+
this.ownerWindow = (_a = this.o.ownerWindow) !== null && _a !== void 0 ? _a : window;
|
|
172
173
|
}
|
|
173
174
|
/**
|
|
174
175
|
* Add option's event handlers in emitter
|
|
@@ -177,7 +178,7 @@ let View = View_1 = class View extends Component {
|
|
|
177
178
|
if (!options) {
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
180
|
-
const e = options
|
|
181
|
+
const e = options === null || options === void 0 ? void 0 : options.events;
|
|
181
182
|
e && Object.keys(e).forEach((key) => this.e.on(key, e[key]));
|
|
182
183
|
}
|
|
183
184
|
constructor(options, isJodit = false) {
|
|
@@ -243,17 +244,18 @@ let View = View_1 = class View extends Component {
|
|
|
243
244
|
}
|
|
244
245
|
/** @override */
|
|
245
246
|
destruct() {
|
|
247
|
+
var _a, _b, _c;
|
|
246
248
|
if (this.isDestructed) {
|
|
247
249
|
return;
|
|
248
250
|
}
|
|
249
|
-
cached(this, 'progressbar')
|
|
250
|
-
cached(this, 'message')
|
|
251
|
+
(_a = cached(this, 'progressbar')) === null || _a === void 0 ? void 0 : _a.destruct();
|
|
252
|
+
(_b = cached(this, 'message')) === null || _b === void 0 ? void 0 : _b.destruct();
|
|
251
253
|
if (this.events) {
|
|
252
254
|
this.events.destruct();
|
|
253
255
|
// @ts-ignore
|
|
254
256
|
this.events = undefined;
|
|
255
257
|
}
|
|
256
|
-
cached(this, 'buffer')
|
|
258
|
+
(_c = cached(this, 'buffer')) === null || _c === void 0 ? void 0 : _c.clear();
|
|
257
259
|
Dom.safeRemove(this.container);
|
|
258
260
|
super.destruct();
|
|
259
261
|
}
|
package/esm/index.js
CHANGED
|
@@ -32,9 +32,10 @@ Object.keys(Icons)
|
|
|
32
32
|
Object.keys(Modules)
|
|
33
33
|
.filter(esFilter)
|
|
34
34
|
.forEach((key) => {
|
|
35
|
+
var _a;
|
|
35
36
|
// @ts-ignore
|
|
36
37
|
const module = Modules[key];
|
|
37
|
-
const name = isFunction(module.prototype
|
|
38
|
+
const name = isFunction((_a = module.prototype) === null || _a === void 0 ? void 0 : _a.className)
|
|
38
39
|
? module.prototype.className()
|
|
39
40
|
: key;
|
|
40
41
|
if (!isString(name)) {
|
package/esm/jodit.js
CHANGED
|
@@ -480,7 +480,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
480
480
|
this.o.commandToHotkeys[commandNameOriginal] ||
|
|
481
481
|
command.hotkeys;
|
|
482
482
|
if (hotkeys) {
|
|
483
|
-
this.registerHotkeyToCommand(hotkeys, commandName, options
|
|
483
|
+
this.registerHotkeyToCommand(hotkeys, commandName, options === null || options === void 0 ? void 0 : options.stopPropagation);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
return this;
|
|
@@ -497,7 +497,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
497
497
|
.off(shortcuts)
|
|
498
498
|
.on(shortcuts, (type, stop) => {
|
|
499
499
|
if (stop) {
|
|
500
|
-
stop.shouldStop = shouldStop
|
|
500
|
+
stop.shouldStop = shouldStop !== null && shouldStop !== void 0 ? shouldStop : true;
|
|
501
501
|
}
|
|
502
502
|
return this.execCommand(commandName); // because need `beforeCommand`
|
|
503
503
|
});
|
|
@@ -1061,7 +1061,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
1061
1061
|
try {
|
|
1062
1062
|
this.ed.execCommand('defaultParagraphSeparator', false, this.o.enter.toLowerCase());
|
|
1063
1063
|
}
|
|
1064
|
-
catch { }
|
|
1064
|
+
catch (_a) { }
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
/**
|
|
@@ -1158,13 +1158,14 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
1158
1158
|
* Jodit's Destructor. Remove editor, and return source input
|
|
1159
1159
|
*/
|
|
1160
1160
|
destruct() {
|
|
1161
|
+
var _a, _b;
|
|
1161
1162
|
if (this.isInDestruct) {
|
|
1162
1163
|
return;
|
|
1163
1164
|
}
|
|
1164
1165
|
this.setStatus(STATUSES.beforeDestruct);
|
|
1165
1166
|
this.__elementToPlace.clear();
|
|
1166
|
-
cached(this, 'storage')
|
|
1167
|
-
cached(this, 'buffer')
|
|
1167
|
+
(_a = cached(this, 'storage')) === null || _a === void 0 ? void 0 : _a.clear();
|
|
1168
|
+
(_b = cached(this, 'buffer')) === null || _b === void 0 ? void 0 : _b.clear();
|
|
1168
1169
|
this.commands.clear();
|
|
1169
1170
|
this.__selectionLocked = null;
|
|
1170
1171
|
this.e.off(this.ow, 'resize');
|
|
@@ -50,7 +50,8 @@ let ContextMenu = class ContextMenu extends Popup {
|
|
|
50
50
|
this.jodit && action.setParentView(this.jodit);
|
|
51
51
|
action.setMod('context', 'menu');
|
|
52
52
|
action.onAction((e) => {
|
|
53
|
-
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = item.exec) === null || _a === void 0 ? void 0 : _a.call(self, e);
|
|
54
55
|
self.clear();
|
|
55
56
|
self.close();
|
|
56
57
|
return false;
|
|
@@ -81,6 +81,7 @@ export default (self) => {
|
|
|
81
81
|
const image = self.c.element('img');
|
|
82
82
|
image.setAttribute('src', src);
|
|
83
83
|
const onload = () => {
|
|
84
|
+
var _a;
|
|
84
85
|
if (self.isInDestruct) {
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
@@ -97,7 +98,7 @@ export default (self) => {
|
|
|
97
98
|
temp_content.appendChild(preview_box);
|
|
98
99
|
preview_box.appendChild(image);
|
|
99
100
|
preview.setPosition();
|
|
100
|
-
self
|
|
101
|
+
(_a = self === null || self === void 0 ? void 0 : self.events) === null || _a === void 0 ? void 0 : _a.fire('previewOpenedAndLoaded');
|
|
101
102
|
};
|
|
102
103
|
self.e.on(image, 'load', onload);
|
|
103
104
|
if (image.complete) {
|
|
@@ -52,7 +52,7 @@ let DataProvider = class DataProvider {
|
|
|
52
52
|
const instances = this.__ajaxInstances;
|
|
53
53
|
if (instances.has(name)) {
|
|
54
54
|
const ajax = instances.get(name);
|
|
55
|
-
ajax
|
|
55
|
+
ajax === null || ajax === void 0 ? void 0 : ajax.abort();
|
|
56
56
|
instances.delete(name);
|
|
57
57
|
}
|
|
58
58
|
const opts = ConfigProto(this.options[name] !== undefined
|
|
@@ -171,9 +171,12 @@ let DataProvider = class DataProvider {
|
|
|
171
171
|
!mods.onlyImages ||
|
|
172
172
|
item.isImage === undefined ||
|
|
173
173
|
item.isImage;
|
|
174
|
-
const inFilter = (item) =>
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
const inFilter = (item) => {
|
|
175
|
+
var _a;
|
|
176
|
+
return !((_a = mods.filterWord) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
177
|
+
this.o.filter === undefined ||
|
|
178
|
+
this.o.filter(item, mods.filterWord);
|
|
179
|
+
};
|
|
177
180
|
sources.forEach(source => {
|
|
178
181
|
if (source.files && source.files.length) {
|
|
179
182
|
const { sort } = this.o;
|
|
@@ -68,10 +68,11 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
get _dialog() {
|
|
71
|
+
var _a;
|
|
71
72
|
const dialog = this.dlg({
|
|
72
73
|
minWidth: Math.min(700, screen.width),
|
|
73
74
|
minHeight: 300,
|
|
74
|
-
buttons: this.o.headerButtons
|
|
75
|
+
buttons: (_a = this.o.headerButtons) !== null && _a !== void 0 ? _a : ['fullsize', 'dialog.close']
|
|
75
76
|
});
|
|
76
77
|
['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
|
|
77
78
|
dialog.setSize(this.o.width, this.o.height);
|
|
@@ -130,6 +131,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
130
131
|
this.state.onlyImages = onlyImages;
|
|
131
132
|
return this.async
|
|
132
133
|
.promise((resolve, reject) => {
|
|
134
|
+
var _a;
|
|
133
135
|
if (!this.o.items || !this.o.items.url) {
|
|
134
136
|
throw error('Need set options.filebrowser.ajax.url');
|
|
135
137
|
}
|
|
@@ -148,17 +150,18 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
148
150
|
.off('select.filebrowser')
|
|
149
151
|
.on('select.filebrowser', this.onSelect(callback));
|
|
150
152
|
const header = this.c.div();
|
|
151
|
-
this.toolbar
|
|
153
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.appendTo(header);
|
|
152
154
|
this.__updateToolbarButtons();
|
|
153
155
|
this._dialog.open(this.browser, header);
|
|
154
156
|
this.e.fire('sort.filebrowser', this.state.sortBy);
|
|
155
157
|
loadTree(this)
|
|
156
158
|
.then(resolve, reject)
|
|
157
159
|
.finally(() => {
|
|
160
|
+
var _a;
|
|
158
161
|
if (this.isInDestruct) {
|
|
159
162
|
return;
|
|
160
163
|
}
|
|
161
|
-
this
|
|
164
|
+
(_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
|
|
162
165
|
});
|
|
163
166
|
})
|
|
164
167
|
.catch((e) => {
|
|
@@ -168,7 +171,8 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
168
171
|
});
|
|
169
172
|
}
|
|
170
173
|
__getButtons() {
|
|
171
|
-
|
|
174
|
+
var _a;
|
|
175
|
+
const options = ((_a = this.o.buttons) !== null && _a !== void 0 ? _a : []);
|
|
172
176
|
return options.filter((btn) => {
|
|
173
177
|
if (!isString(btn)) {
|
|
174
178
|
return true;
|
|
@@ -186,7 +190,8 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
186
190
|
});
|
|
187
191
|
}
|
|
188
192
|
initUploader(editor) {
|
|
189
|
-
|
|
193
|
+
var _a;
|
|
194
|
+
const self = this, options = (_a = editor === null || editor === void 0 ? void 0 : editor.options) === null || _a === void 0 ? void 0 : _a.uploader, uploaderOptions = ConfigProto(options || {}, Config.defaultOptions.uploader);
|
|
190
195
|
const uploadHandler = () => loadItems(this);
|
|
191
196
|
self.uploader = self.getInstance('Uploader', uploaderOptions);
|
|
192
197
|
self.uploader
|
|
@@ -297,28 +302,30 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
297
302
|
}
|
|
298
303
|
if (storeLastOpenedFolder) {
|
|
299
304
|
const currentPath = self.storage.get('currentPath'), currentSource = self.storage.get('currentSource');
|
|
300
|
-
self.state.currentPath = currentPath
|
|
301
|
-
self.state.currentSource = currentSource
|
|
305
|
+
self.state.currentPath = currentPath !== null && currentPath !== void 0 ? currentPath : '';
|
|
306
|
+
self.state.currentSource = currentSource !== null && currentSource !== void 0 ? currentSource : '';
|
|
302
307
|
}
|
|
303
308
|
self.initUploader(self);
|
|
304
309
|
self.setStatus(STATUSES.ready);
|
|
305
310
|
}
|
|
306
311
|
destruct() {
|
|
312
|
+
var _a;
|
|
307
313
|
if (this.isInDestruct) {
|
|
308
314
|
return;
|
|
309
315
|
}
|
|
310
|
-
cached(this, '_dialog')
|
|
316
|
+
(_a = cached(this, '_dialog')) === null || _a === void 0 ? void 0 : _a.destruct();
|
|
311
317
|
super.destruct();
|
|
312
318
|
this.events && this.e.off('.filebrowser');
|
|
313
319
|
this.uploader && this.uploader.destruct();
|
|
314
320
|
}
|
|
315
321
|
__updateToolbarButtons() {
|
|
322
|
+
var _a;
|
|
316
323
|
const buttons = this.__getButtons();
|
|
317
324
|
if (isEqualButtonList(this.__prevButtons, buttons)) {
|
|
318
325
|
return;
|
|
319
326
|
}
|
|
320
327
|
this.__prevButtons = buttons;
|
|
321
|
-
this.toolbar
|
|
328
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.build(buttons);
|
|
322
329
|
}
|
|
323
330
|
};
|
|
324
331
|
__decorate([
|
|
@@ -149,7 +149,8 @@ export class History extends ViewComponent {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
fireChangeStack() {
|
|
152
|
-
|
|
152
|
+
var _a;
|
|
153
|
+
this.j && !this.j.isInDestruct && ((_a = this.j.events) === null || _a === void 0 ? void 0 : _a.fire('changeStack'));
|
|
153
154
|
}
|
|
154
155
|
destruct() {
|
|
155
156
|
if (this.isInDestruct) {
|
|
@@ -119,7 +119,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends ViewComponent {
|
|
|
119
119
|
}
|
|
120
120
|
onTitleModeClick(e) {
|
|
121
121
|
const self = this, title = e.target;
|
|
122
|
-
const slide = title
|
|
122
|
+
const slide = title === null || title === void 0 ? void 0 : title.parentElement;
|
|
123
123
|
if (!slide) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
@@ -44,7 +44,8 @@ let StatusBar = class StatusBar extends ViewComponent {
|
|
|
44
44
|
* Height of statusbar
|
|
45
45
|
*/
|
|
46
46
|
getHeight() {
|
|
47
|
-
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0;
|
|
48
49
|
}
|
|
49
50
|
findEmpty(inTheRight = false) {
|
|
50
51
|
const items = this.getElms(inTheRight ? 'item-right' : 'item');
|
|
@@ -59,13 +60,14 @@ let StatusBar = class StatusBar extends ViewComponent {
|
|
|
59
60
|
* Add element in statusbar
|
|
60
61
|
*/
|
|
61
62
|
append(child, inTheRight = false) {
|
|
63
|
+
var _a;
|
|
62
64
|
const wrapper = this.findEmpty(inTheRight) ||
|
|
63
65
|
this.j.c.div(this.getFullElName('item'));
|
|
64
66
|
if (inTheRight) {
|
|
65
67
|
wrapper.classList.add(this.getFullElName('item-right'));
|
|
66
68
|
}
|
|
67
69
|
wrapper.appendChild(child);
|
|
68
|
-
this.container
|
|
70
|
+
(_a = this.container) === null || _a === void 0 ? void 0 : _a.appendChild(wrapper);
|
|
69
71
|
if (this.j.o.statusbar) {
|
|
70
72
|
this.show();
|
|
71
73
|
}
|
|
@@ -166,6 +166,7 @@ export class Table extends ViewComponent {
|
|
|
166
166
|
return Table.__formalCoordinate(table, cell, max);
|
|
167
167
|
}
|
|
168
168
|
static __appendRow(table, line, after, create) {
|
|
169
|
+
var _a;
|
|
169
170
|
let row;
|
|
170
171
|
if (!line) {
|
|
171
172
|
const columnsCount = Table.__getColumnsCount(table);
|
|
@@ -195,7 +196,7 @@ export class Table extends ViewComponent {
|
|
|
195
196
|
line.parentNode && line.parentNode.insertBefore(row, line);
|
|
196
197
|
}
|
|
197
198
|
else {
|
|
198
|
-
(table.getElementsByTagName('tbody')
|
|
199
|
+
(((_a = table.getElementsByTagName('tbody')) === null || _a === void 0 ? void 0 : _a[0]) || table).appendChild(row);
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
@@ -636,8 +637,9 @@ export class Table extends ViewComponent {
|
|
|
636
637
|
return Table.__setColumnWidthByDelta(table, column, delta, noUnmark, marked);
|
|
637
638
|
}
|
|
638
639
|
static __mark(cell, key, value, marked) {
|
|
640
|
+
var _a;
|
|
639
641
|
marked.push(cell);
|
|
640
|
-
const dict = markedValue.get(cell)
|
|
642
|
+
const dict = (_a = markedValue.get(cell)) !== null && _a !== void 0 ? _a : {};
|
|
641
643
|
dict[key] = value === undefined ? 1 : value;
|
|
642
644
|
markedValue.set(cell, dict);
|
|
643
645
|
}
|
|
@@ -36,26 +36,28 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
36
36
|
}
|
|
37
37
|
/** @override **/
|
|
38
38
|
update() {
|
|
39
|
+
var _a, _b;
|
|
39
40
|
const { control, state } = this, tc = this.closest(ToolbarCollection);
|
|
40
41
|
if (!tc) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
const value = control.value
|
|
44
|
+
const value = (_a = control.value) === null || _a === void 0 ? void 0 : _a.call(control, tc.jodit, this);
|
|
44
45
|
if (value !== undefined) {
|
|
45
46
|
state.value = value;
|
|
46
47
|
}
|
|
47
48
|
state.disabled = this.__calculateDisabledStatus(tc);
|
|
48
49
|
state.activated = this.__calculateActivatedStatus(tc);
|
|
49
|
-
control.update
|
|
50
|
+
(_b = control.update) === null || _b === void 0 ? void 0 : _b.call(control, tc.jodit, this);
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* Calculates whether the button is active
|
|
53
54
|
*/
|
|
54
55
|
__calculateActivatedStatus(tc) {
|
|
56
|
+
var _a, _b;
|
|
55
57
|
if (isJoditObject(this.j) && !this.j.editorIsActive) {
|
|
56
58
|
return false;
|
|
57
59
|
}
|
|
58
|
-
if (this.control.isActive
|
|
60
|
+
if ((_b = (_a = this.control).isActive) === null || _b === void 0 ? void 0 : _b.call(_a, this.j, this)) {
|
|
59
61
|
return true;
|
|
60
62
|
}
|
|
61
63
|
return Boolean(tc && tc.shouldBeActive(this));
|
|
@@ -64,6 +66,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
64
66
|
* Calculates whether an element is blocked for the user
|
|
65
67
|
*/
|
|
66
68
|
__calculateDisabledStatus(tc) {
|
|
69
|
+
var _a, _b;
|
|
67
70
|
if (this.j.o.disabled) {
|
|
68
71
|
return true;
|
|
69
72
|
}
|
|
@@ -72,7 +75,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
72
75
|
!this.j.o.activeButtonsInReadOnly.includes(this.control.name))) {
|
|
73
76
|
return true;
|
|
74
77
|
}
|
|
75
|
-
if (this.control.isDisabled
|
|
78
|
+
if ((_b = (_a = this.control).isDisabled) === null || _b === void 0 ? void 0 : _b.call(_a, this.j, this)) {
|
|
76
79
|
return true;
|
|
77
80
|
}
|
|
78
81
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
@@ -114,7 +117,8 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
114
117
|
}
|
|
115
118
|
/** @override */
|
|
116
119
|
focus() {
|
|
117
|
-
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = this.container.querySelector('button')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
118
122
|
}
|
|
119
123
|
onChangeHasTrigger() {
|
|
120
124
|
if (this.state.hasTrigger) {
|
|
@@ -171,6 +175,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
171
175
|
* Init constant data from control
|
|
172
176
|
*/
|
|
173
177
|
__initFromControl() {
|
|
178
|
+
var _a;
|
|
174
179
|
const { control: ctr, state } = this;
|
|
175
180
|
this.updateSize();
|
|
176
181
|
state.name = ctr.name;
|
|
@@ -188,7 +193,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
188
193
|
else {
|
|
189
194
|
const name = ctr.icon || ctr.name;
|
|
190
195
|
state.icon.name =
|
|
191
|
-
Icon.exists(name) || this.j.o.extraIcons
|
|
196
|
+
Icon.exists(name) || ((_a = this.j.o.extraIcons) === null || _a === void 0 ? void 0 : _a[name])
|
|
192
197
|
? name
|
|
193
198
|
: '';
|
|
194
199
|
}
|
|
@@ -207,6 +212,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
207
212
|
* Click on trigger button
|
|
208
213
|
*/
|
|
209
214
|
onTriggerClick(e) {
|
|
215
|
+
var _a, _b, _c;
|
|
210
216
|
if (this.openedPopup) {
|
|
211
217
|
this.__closePopup();
|
|
212
218
|
return;
|
|
@@ -223,7 +229,7 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
223
229
|
popup.parentElement = this;
|
|
224
230
|
try {
|
|
225
231
|
if (this.j.e.fire(camelCase(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
|
|
226
|
-
const target = this.toolbar
|
|
232
|
+
const target = (_c = (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.getTarget(this)) !== null && _b !== void 0 ? _b : this.target) !== null && _c !== void 0 ? _c : null;
|
|
227
233
|
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
228
234
|
if (elm) {
|
|
229
235
|
popup
|
|
@@ -254,7 +260,8 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
254
260
|
* Create an open popup list
|
|
255
261
|
*/
|
|
256
262
|
__openControlList(control) {
|
|
257
|
-
|
|
263
|
+
var _a;
|
|
264
|
+
const controls = (_a = this.jodit.options.controls) !== null && _a !== void 0 ? _a : {}, getControl = (key) => findControlType(key, controls);
|
|
258
265
|
const list = control.list, menu = this.openPopup(), toolbar = makeCollection(this.j);
|
|
259
266
|
menu.parentElement = this;
|
|
260
267
|
toolbar.parentElement = menu;
|
|
@@ -284,10 +291,13 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
284
291
|
template: childTemplate &&
|
|
285
292
|
((j, k, v) => childTemplate(j, k, v, this)),
|
|
286
293
|
exec: control.childExec
|
|
287
|
-
? (view, current, options) =>
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
294
|
+
? (view, current, options) => {
|
|
295
|
+
var _a;
|
|
296
|
+
return (_a = control.childExec) === null || _a === void 0 ? void 0 : _a.call(control, view, current, {
|
|
297
|
+
...options,
|
|
298
|
+
parentControl: control
|
|
299
|
+
});
|
|
300
|
+
}
|
|
291
301
|
: control.exec,
|
|
292
302
|
data: control.data,
|
|
293
303
|
command: control.command,
|
|
@@ -342,9 +352,10 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
342
352
|
* Click handler
|
|
343
353
|
*/
|
|
344
354
|
onClick(originalEvent) {
|
|
355
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
345
356
|
const { control: ctr } = this;
|
|
346
357
|
if (isFunction(ctr.exec)) {
|
|
347
|
-
const target = this.toolbar
|
|
358
|
+
const target = (_c = (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.getTarget(this)) !== null && _b !== void 0 ? _b : this.target) !== null && _c !== void 0 ? _c : null;
|
|
348
359
|
const result = ctr.exec(this.j, target, {
|
|
349
360
|
control: ctr,
|
|
350
361
|
originalEvent,
|
|
@@ -352,14 +363,14 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
352
363
|
});
|
|
353
364
|
// For memorise exec
|
|
354
365
|
if (result !== false && result !== true) {
|
|
355
|
-
this.j
|
|
366
|
+
(_e = (_d = this.j) === null || _d === void 0 ? void 0 : _d.e) === null || _e === void 0 ? void 0 : _e.fire('synchro');
|
|
356
367
|
if (this.parentElement) {
|
|
357
368
|
this.parentElement.update();
|
|
358
369
|
}
|
|
359
370
|
/**
|
|
360
371
|
* Fired after calling `button.exec` function
|
|
361
372
|
*/
|
|
362
|
-
this.j
|
|
373
|
+
(_g = (_f = this.j) === null || _f === void 0 ? void 0 : _f.e) === null || _g === void 0 ? void 0 : _g.fire('closeAllPopups afterExec');
|
|
363
374
|
}
|
|
364
375
|
if (result !== false) {
|
|
365
376
|
return;
|
|
@@ -22,6 +22,7 @@ let ToolbarSelect = class ToolbarSelect extends ToolbarButton {
|
|
|
22
22
|
return 'ToolbarSelect';
|
|
23
23
|
}
|
|
24
24
|
update() {
|
|
25
|
+
var _a, _b, _c;
|
|
25
26
|
super.update();
|
|
26
27
|
this.state.icon.name = '';
|
|
27
28
|
const { list, data } = this.control;
|
|
@@ -36,7 +37,7 @@ let ToolbarSelect = class ToolbarSelect extends ToolbarButton {
|
|
|
36
37
|
}
|
|
37
38
|
const text = (isPlainObject(list) ? list[key.toString()] || key : key).toString();
|
|
38
39
|
this.state.text =
|
|
39
|
-
this.control.textTemplate
|
|
40
|
+
(_c = (_b = (_a = this.control).textTemplate) === null || _b === void 0 ? void 0 : _b.call(_a, this.jodit, text)) !== null && _c !== void 0 ? _c : text;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
};
|
|
@@ -100,8 +100,9 @@ export class aiAssistant extends Plugin {
|
|
|
100
100
|
}
|
|
101
101
|
/** @override */
|
|
102
102
|
beforeDestruct(_) {
|
|
103
|
-
|
|
104
|
-
cached(this, '
|
|
103
|
+
var _a, _b;
|
|
104
|
+
(_a = cached(this, '__container')) === null || _a === void 0 ? void 0 : _a.destruct();
|
|
105
|
+
(_b = cached(this, '__dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
__decorate([
|
|
@@ -98,11 +98,12 @@ export class backspace extends Plugin {
|
|
|
98
98
|
* Remove node and replace cursor position out of it
|
|
99
99
|
*/
|
|
100
100
|
safeRemoveEmptyNode(fakeNode) {
|
|
101
|
+
var _a, _b;
|
|
101
102
|
const { range } = this.j.s;
|
|
102
103
|
if (range.startContainer === fakeNode) {
|
|
103
104
|
if (fakeNode.previousSibling) {
|
|
104
105
|
if (Dom.isText(fakeNode.previousSibling)) {
|
|
105
|
-
range.setStart(fakeNode.previousSibling, fakeNode.previousSibling.nodeValue
|
|
106
|
+
range.setStart(fakeNode.previousSibling, (_b = (_a = fakeNode.previousSibling.nodeValue) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0);
|
|
106
107
|
}
|
|
107
108
|
else {
|
|
108
109
|
range.setStartAfter(fakeNode.previousSibling);
|
|
@@ -22,6 +22,7 @@ import { findMostNestedNeighbor } from "../helpers.js";
|
|
|
22
22
|
*/
|
|
23
23
|
// eslint-disable-next-line complexity
|
|
24
24
|
export function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
25
|
+
var _a, _b;
|
|
25
26
|
const step = backspace ? -1 : 1;
|
|
26
27
|
const anotherSibling = Dom.sibling(fakeNode, !backspace);
|
|
27
28
|
let sibling = Dom.sibling(fakeNode, backspace);
|
|
@@ -33,19 +34,19 @@ export function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
33
34
|
}
|
|
34
35
|
while (sibling && (Dom.isText(sibling) || Dom.isInlineBlock(sibling))) {
|
|
35
36
|
while (Dom.isInlineBlock(sibling)) {
|
|
36
|
-
sibling = (backspace ? sibling
|
|
37
|
+
sibling = (backspace ? sibling === null || sibling === void 0 ? void 0 : sibling.lastChild : sibling === null || sibling === void 0 ? void 0 : sibling.firstChild);
|
|
37
38
|
}
|
|
38
39
|
if (!sibling) {
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
|
-
if (sibling.nodeValue
|
|
42
|
+
if ((_a = sibling.nodeValue) === null || _a === void 0 ? void 0 : _a.length) {
|
|
42
43
|
removed = tryRemoveChar(sibling, backspace, step, anotherSibling);
|
|
43
44
|
if (!sibling.nodeValue.length &&
|
|
44
45
|
Dom.isInlineBlock(sibling.parentNode)) {
|
|
45
46
|
sibling.nodeValue = INVISIBLE_SPACE;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
if (!sibling.nodeValue
|
|
49
|
+
if (!((_b = sibling.nodeValue) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
49
50
|
removeNeighbor = sibling;
|
|
50
51
|
}
|
|
51
52
|
if (!isVoid(removed) && removed !== INVISIBLE_SPACE) {
|
|
@@ -135,9 +136,10 @@ function tryRemoveChar(sibling, backspace, step, anotherSibling) {
|
|
|
135
136
|
return removed;
|
|
136
137
|
}
|
|
137
138
|
function replaceSpaceOnNBSP(anotherSibling, backspace, value) {
|
|
139
|
+
var _a;
|
|
138
140
|
if (!anotherSibling ||
|
|
139
141
|
!Dom.isText(anotherSibling) ||
|
|
140
|
-
(!backspace ? / $/ : /^ /).test(anotherSibling.nodeValue
|
|
142
|
+
(!backspace ? / $/ : /^ /).test((_a = anotherSibling.nodeValue) !== null && _a !== void 0 ? _a : '') ||
|
|
141
143
|
!trimInv(anotherSibling.nodeValue || '').length) {
|
|
142
144
|
for (let i = backspace ? value.length - 1 : 0; backspace ? i >= 0 : i < value.length; i += backspace ? -1 : 1) {
|
|
143
145
|
if (value[i] === ' ') {
|
|
@@ -20,10 +20,11 @@ import { call } from "../../../core/helpers/utils/index.js";
|
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
22
|
export function checkUnwrapFirstListItem(jodit, fakeNode, backspace) {
|
|
23
|
+
var _a;
|
|
23
24
|
const li = Dom.closest(fakeNode, Dom.isElement, jodit.editor);
|
|
24
25
|
const { s } = jodit;
|
|
25
26
|
if (Dom.isLeaf(li) &&
|
|
26
|
-
li
|
|
27
|
+
((_a = li === null || li === void 0 ? void 0 : li.parentElement) === null || _a === void 0 ? void 0 : _a[backspace ? 'firstElementChild' : 'lastElementChild']) === li &&
|
|
27
28
|
s.cursorInTheEdge(backspace, li)) {
|
|
28
29
|
const ul = li.parentElement;
|
|
29
30
|
const p = jodit.createInside.element(jodit.o.enterBlock);
|