jodit 4.5.2 → 4.5.4
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 +6 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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/ai-assistant/interface.d.ts +8 -0
- package/esm/plugins/ai-assistant/interface.js +5 -0
- 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 +4 -4
- 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
- package/types/plugins/ai-assistant/interface.d.ts +8 -0
|
@@ -43,15 +43,18 @@ export class source extends Plugin {
|
|
|
43
43
|
this.tempMarkerEndReg = /{end-jodit-selection}/g;
|
|
44
44
|
// override it for ace editors
|
|
45
45
|
this.getSelectionStart = () => {
|
|
46
|
-
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return (_b = (_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.getSelectionStart()) !== null && _b !== void 0 ? _b : 0;
|
|
47
48
|
};
|
|
48
49
|
this.getSelectionEnd = () => {
|
|
49
|
-
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return (_b = (_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.getSelectionEnd()) !== null && _b !== void 0 ? _b : 0;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
onInsertHTML(html) {
|
|
55
|
+
var _a;
|
|
53
56
|
if (!this.j.o.readonly && !this.j.isEditorMode()) {
|
|
54
|
-
this.sourceEditor
|
|
57
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.insertRaw(html);
|
|
55
58
|
this.toWYSIWYG();
|
|
56
59
|
return false;
|
|
57
60
|
}
|
|
@@ -114,20 +117,24 @@ export class source extends Plugin {
|
|
|
114
117
|
return str.replace(consts.INVISIBLE_SPACE_REG_EXP(), '');
|
|
115
118
|
}
|
|
116
119
|
onSelectAll(command) {
|
|
120
|
+
var _a;
|
|
117
121
|
if (command.toLowerCase() === 'selectall' &&
|
|
118
122
|
this.j.getRealMode() === MODE_SOURCE) {
|
|
119
|
-
this.sourceEditor
|
|
123
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.selectAll();
|
|
120
124
|
return false;
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
getMirrorValue() {
|
|
124
|
-
|
|
128
|
+
var _a;
|
|
129
|
+
return ((_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.getValue()) || '';
|
|
125
130
|
}
|
|
126
131
|
setMirrorValue(value) {
|
|
127
|
-
|
|
132
|
+
var _a;
|
|
133
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.setValue(value);
|
|
128
134
|
}
|
|
129
135
|
setFocusToMirror() {
|
|
130
|
-
|
|
136
|
+
var _a;
|
|
137
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.focus();
|
|
131
138
|
}
|
|
132
139
|
saveSelection() {
|
|
133
140
|
if (this.j.getRealMode() === consts.MODE_WYSIWYG) {
|
|
@@ -202,10 +209,12 @@ export class source extends Plugin {
|
|
|
202
209
|
this.setFocusToMirror(); // need for setting focus after change mode
|
|
203
210
|
}
|
|
204
211
|
setMirrorSelectionRange(start, end) {
|
|
205
|
-
|
|
212
|
+
var _a;
|
|
213
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end);
|
|
206
214
|
}
|
|
207
215
|
onReadonlyReact() {
|
|
208
|
-
|
|
216
|
+
var _a;
|
|
217
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.setReadOnly(this.j.o.readonly);
|
|
209
218
|
}
|
|
210
219
|
/** @override */
|
|
211
220
|
afterInit(editor) {
|
|
@@ -216,27 +225,28 @@ export class source extends Plugin {
|
|
|
216
225
|
});
|
|
217
226
|
this.sourceEditor = createSourceEditor('area', editor, this.mirrorContainer, this.toWYSIWYG, this.fromWYSIWYG);
|
|
218
227
|
editor.e.on(editor.ow, 'keydown', (e) => {
|
|
219
|
-
|
|
228
|
+
var _a;
|
|
229
|
+
if (e.key === KEY_ESC && ((_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.isFocused)) {
|
|
220
230
|
this.sourceEditor.blur();
|
|
221
231
|
}
|
|
222
232
|
});
|
|
223
233
|
this.onReadonlyReact();
|
|
224
234
|
editor.e
|
|
225
235
|
.on('placeholder.source', (text) => {
|
|
226
|
-
|
|
236
|
+
var _a;
|
|
237
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.setPlaceHolder(text);
|
|
227
238
|
})
|
|
228
239
|
.on('change.source', this.syncValueFromWYSIWYG)
|
|
229
240
|
.on('beautifyHTML', html => html);
|
|
230
241
|
if (editor.o.beautifyHTML) {
|
|
231
242
|
const addEventListener = () => {
|
|
243
|
+
var _a;
|
|
232
244
|
if (editor.isInDestruct) {
|
|
233
245
|
return false;
|
|
234
246
|
}
|
|
235
247
|
const html_beautify = editor.ow.html_beautify;
|
|
236
248
|
if (html_beautify && !editor.isInDestruct) {
|
|
237
|
-
editor.events
|
|
238
|
-
?.off('beautifyHTML')
|
|
239
|
-
.on('beautifyHTML', html => html_beautify(html));
|
|
249
|
+
(_a = editor.events) === null || _a === void 0 ? void 0 : _a.off('beautifyHTML').on('beautifyHTML', html => html_beautify(html));
|
|
240
250
|
return true;
|
|
241
251
|
}
|
|
242
252
|
return false;
|
|
@@ -256,19 +266,22 @@ export class source extends Plugin {
|
|
|
256
266
|
}
|
|
257
267
|
}
|
|
258
268
|
initSourceEditor(editor) {
|
|
269
|
+
var _a;
|
|
259
270
|
if (editor.o.sourceEditor !== 'area') {
|
|
260
271
|
const sourceEditor = createSourceEditor(editor.o.sourceEditor, editor, this.mirrorContainer, this.toWYSIWYG, this.fromWYSIWYG);
|
|
261
272
|
sourceEditor.onReadyAlways(() => {
|
|
262
|
-
|
|
273
|
+
var _a, _b;
|
|
274
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.destruct();
|
|
263
275
|
this.sourceEditor = sourceEditor;
|
|
264
276
|
this.syncValueFromWYSIWYG(true);
|
|
265
|
-
editor.events
|
|
277
|
+
(_b = editor.events) === null || _b === void 0 ? void 0 : _b.fire('sourceEditorReady', editor);
|
|
266
278
|
});
|
|
267
279
|
}
|
|
268
280
|
else {
|
|
269
|
-
this.sourceEditor
|
|
281
|
+
(_a = this.sourceEditor) === null || _a === void 0 ? void 0 : _a.onReadyAlways(() => {
|
|
282
|
+
var _a;
|
|
270
283
|
this.syncValueFromWYSIWYG(true);
|
|
271
|
-
editor.events
|
|
284
|
+
(_a = editor.events) === null || _a === void 0 ? void 0 : _a.fire('sourceEditorReady', editor);
|
|
272
285
|
});
|
|
273
286
|
}
|
|
274
287
|
}
|
|
@@ -38,12 +38,13 @@ Config.prototype.controls.speechRecognize = {
|
|
|
38
38
|
},
|
|
39
39
|
isActive(jodit, _) {
|
|
40
40
|
const api = dataBind(jodit, 'speech');
|
|
41
|
-
return Boolean(api
|
|
41
|
+
return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
|
|
42
42
|
},
|
|
43
43
|
isDisabled(jodit) {
|
|
44
44
|
return !jodit.o.speechRecognize.api;
|
|
45
45
|
},
|
|
46
46
|
exec(jodit, current, { button, control }) {
|
|
47
|
+
var _a;
|
|
47
48
|
const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
|
|
48
49
|
if (!ApiConstructor) {
|
|
49
50
|
jodit.alert('Speech recognize API unsupported in your browser');
|
|
@@ -55,7 +56,7 @@ Config.prototype.controls.speechRecognize = {
|
|
|
55
56
|
api = new RecognizeManager(jodit.async, nativeApi);
|
|
56
57
|
api.lang = isString(lang)
|
|
57
58
|
? lang
|
|
58
|
-
: (attr(jodit.od.documentElement, 'lang')
|
|
59
|
+
: ((_a = attr(jodit.od.documentElement, 'lang')) !== null && _a !== void 0 ? _a : undefined);
|
|
59
60
|
api.continuous = continuous;
|
|
60
61
|
api.interimResults = interimResults;
|
|
61
62
|
api.sound = sound;
|
|
@@ -95,7 +96,8 @@ Config.prototype.controls.speechRecognize = {
|
|
|
95
96
|
interimResults: 'Interim Results'
|
|
96
97
|
},
|
|
97
98
|
childTemplate(jodit, key, value) {
|
|
98
|
-
|
|
99
|
+
var _a;
|
|
100
|
+
const api = dataBind(jodit, 'speech'), checked = (_a = api === null || api === void 0 ? void 0 : api[key]) !== null && _a !== void 0 ? _a : jodit.o.speechRecognize[key];
|
|
99
101
|
return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'> ${value}</span>`;
|
|
100
102
|
},
|
|
101
103
|
mods: {
|
|
@@ -64,7 +64,7 @@ export class symbols extends Plugin {
|
|
|
64
64
|
if (Dom.isTag(this, 'a')) {
|
|
65
65
|
jodit.s.focus();
|
|
66
66
|
jodit.s.insertHTML(this.innerHTML);
|
|
67
|
-
if (!e
|
|
67
|
+
if (!(e === null || e === void 0 ? void 0 : e.shiftKey)) {
|
|
68
68
|
jodit.e.fire(this, 'close_dialog');
|
|
69
69
|
}
|
|
70
70
|
e && e.preventDefault();
|
|
@@ -58,10 +58,10 @@ Config.prototype.controls.video = {
|
|
|
58
58
|
content: formCode.container
|
|
59
59
|
});
|
|
60
60
|
formLink.onSubmit(data => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width: jodit.o.video
|
|
64
|
-
height: jodit.o.video
|
|
61
|
+
var _a, _b, _c, _d;
|
|
62
|
+
insertCode(call((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.parseUrlToVideoEmbed) !== null && _b !== void 0 ? _b : convertMediaUrlToVideoEmbed, data.url, {
|
|
63
|
+
width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
|
|
64
|
+
height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
|
|
65
65
|
}));
|
|
66
66
|
});
|
|
67
67
|
formCode.onSubmit(data => {
|
|
@@ -28,12 +28,15 @@ class wrapNodes extends Plugin {
|
|
|
28
28
|
/**
|
|
29
29
|
* Found Node which should be wrapped
|
|
30
30
|
*/
|
|
31
|
-
this.isSuitableStart = (n) =>
|
|
32
|
-
|
|
33
|
-
(
|
|
34
|
-
(n.
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
this.isSuitableStart = (n) => {
|
|
32
|
+
var _a;
|
|
33
|
+
return (Dom.isText(n) &&
|
|
34
|
+
isString(n.nodeValue) &&
|
|
35
|
+
(/[^\s]/.test(n.nodeValue) ||
|
|
36
|
+
(((_a = n.parentNode) === null || _a === void 0 ? void 0 : _a.firstChild) === n &&
|
|
37
|
+
this.isSuitable(n.nextSibling)))) ||
|
|
38
|
+
(this.isNotWrapped(n) && !Dom.isTemporary(n));
|
|
39
|
+
};
|
|
37
40
|
/**
|
|
38
41
|
* Node should add in a block element
|
|
39
42
|
*/
|
package/package.json
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/ai-assistant
|
|
8
|
+
*/
|
|
1
9
|
export interface AiAssistantSettings {
|
|
2
10
|
/** Callback function for AI assistant to process and return the result */
|
|
3
11
|
aiAssistantCallback?: (prompt: string, htmlFragment: string) => Promise<string>;
|