jodit 4.0.1 → 4.0.3
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 +10 -6
- package/es2015/jodit.css +5 -7
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +50 -39
- 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 +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.css +5 -7
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +50 -39
- 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 +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +5 -7
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +50 -39
- 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 +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +5 -7
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +50 -39
- 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 +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +7 -9
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +51 -38
- 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 +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/selection.js +5 -1
- package/esm/core/ui/popup/popup.js +5 -4
- package/esm/jodit.js +6 -12
- package/esm/modules/context-menu/context-menu.js +5 -3
- package/esm/modules/dialog/dialog.js +5 -3
- package/esm/modules/file-browser/builders/context-menu.js +3 -1
- package/esm/modules/file-browser/data-provider.js +6 -6
- package/esm/modules/file-browser/file-browser.js +1 -5
- package/esm/modules/toolbar/button/button.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/a.d.ts +1 -1
- 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/select/select.d.ts +2 -1
- package/esm/plugins/select/select.js +12 -2
- package/package.json +1 -1
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/a.d.ts +1 -1
- 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/select/select.d.ts +2 -1
package/es2021.en/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.0.
|
|
4
|
+
* Version: v4.0.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1692,7 +1692,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1692
1692
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1693
1693
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1694
1694
|
*/
|
|
1695
|
-
const APP_VERSION = "4.0.
|
|
1695
|
+
const APP_VERSION = "4.0.3";
|
|
1696
1696
|
// prettier-ignore
|
|
1697
1697
|
const ES = "es2021";
|
|
1698
1698
|
const IS_ES_MODERN = true;
|
|
@@ -10966,7 +10966,8 @@ class Selection {
|
|
|
10966
10966
|
if (this.isCollapsed()) {
|
|
10967
10967
|
return this;
|
|
10968
10968
|
}
|
|
10969
|
-
const { range } = this
|
|
10969
|
+
const { range } = this;
|
|
10970
|
+
const c = range.cloneRange();
|
|
10970
10971
|
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isOrContains(this.j.editor, range.commonAncestorContainer, true)) {
|
|
10971
10972
|
return this;
|
|
10972
10973
|
}
|
|
@@ -11014,6 +11015,9 @@ class Selection {
|
|
|
11014
11015
|
}
|
|
11015
11016
|
this.selectRange(c);
|
|
11016
11017
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.safeRemove(leftFake, rightFake);
|
|
11018
|
+
if (this.isCollapsed()) {
|
|
11019
|
+
throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Selection is collapsed');
|
|
11020
|
+
}
|
|
11017
11021
|
return this;
|
|
11018
11022
|
}
|
|
11019
11023
|
}
|
|
@@ -15472,10 +15476,11 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UI
|
|
|
15472
15476
|
.off(this.container, 'scroll mousewheel', up)
|
|
15473
15477
|
.off(ow, 'scroll', up)
|
|
15474
15478
|
.off(ow, 'resize', up);
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
+
if (this.j.container.isConnected) {
|
|
15480
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.up(this.j.container, box => {
|
|
15481
|
+
box && this.j.e.off(box, 'scroll mousewheel', up);
|
|
15482
|
+
});
|
|
15483
|
+
}
|
|
15479
15484
|
}
|
|
15480
15485
|
/**
|
|
15481
15486
|
* Set ZIndex
|
|
@@ -16605,18 +16610,12 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
|
|
|
16605
16610
|
}
|
|
16606
16611
|
if (result !== false) {
|
|
16607
16612
|
this.s.focus();
|
|
16608
|
-
|
|
16609
|
-
this.
|
|
16610
|
-
this.s.expandSelection();
|
|
16613
|
+
try {
|
|
16614
|
+
result = this.nativeExecCommand(command, showUI, value);
|
|
16611
16615
|
}
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
}
|
|
16616
|
-
catch (e) {
|
|
16617
|
-
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
|
|
16618
|
-
throw e;
|
|
16619
|
-
}
|
|
16616
|
+
catch (e) {
|
|
16617
|
+
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
|
|
16618
|
+
throw e;
|
|
16620
16619
|
}
|
|
16621
16620
|
}
|
|
16622
16621
|
}
|
|
@@ -16627,7 +16626,7 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
|
|
|
16627
16626
|
* @param third - The third option is for the team
|
|
16628
16627
|
*/
|
|
16629
16628
|
this.e.fire('afterCommand', command, showUI, value);
|
|
16630
|
-
this.
|
|
16629
|
+
this.__imdSynchronizeValues(); // synchrony
|
|
16631
16630
|
return result;
|
|
16632
16631
|
}
|
|
16633
16632
|
/**
|
|
@@ -17457,7 +17456,8 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
|
|
|
17457
17456
|
* ```
|
|
17458
17457
|
*/
|
|
17459
17458
|
show(x, y, actions) {
|
|
17460
|
-
const self = this
|
|
17459
|
+
const self = this;
|
|
17460
|
+
self.clear();
|
|
17461
17461
|
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .kJ)(actions)) {
|
|
17462
17462
|
return;
|
|
17463
17463
|
}
|
|
@@ -17470,12 +17470,13 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
|
|
|
17470
17470
|
action.setMod('context', 'menu');
|
|
17471
17471
|
action.onAction((e) => {
|
|
17472
17472
|
item.exec?.call(self, e);
|
|
17473
|
+
self.clear();
|
|
17473
17474
|
self.close();
|
|
17474
17475
|
return false;
|
|
17475
17476
|
});
|
|
17476
|
-
|
|
17477
|
+
this.append(action);
|
|
17477
17478
|
});
|
|
17478
|
-
this.
|
|
17479
|
+
this.open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
|
|
17479
17480
|
}
|
|
17480
17481
|
};
|
|
17481
17482
|
ContextMenu = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .gn)([
|
|
@@ -18066,10 +18067,12 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
|
|
|
18066
18067
|
this.getMod('static') === true) {
|
|
18067
18068
|
return this;
|
|
18068
18069
|
}
|
|
18070
|
+
const { e } = this;
|
|
18069
18071
|
/**
|
|
18070
18072
|
* Called up to close the window
|
|
18071
18073
|
*/
|
|
18072
|
-
if (
|
|
18074
|
+
if (e.fire(this, 'beforeClose') === false ||
|
|
18075
|
+
e.fire('beforeClose', this) === false) {
|
|
18073
18076
|
return this;
|
|
18074
18077
|
}
|
|
18075
18078
|
this.setMod('active', false);
|
|
@@ -18082,8 +18085,8 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
|
|
|
18082
18085
|
/**
|
|
18083
18086
|
* It called after the window is closed
|
|
18084
18087
|
*/
|
|
18085
|
-
|
|
18086
|
-
|
|
18088
|
+
e.fire(this, 'afterClose');
|
|
18089
|
+
e.fire(this.ow, 'joditCloseDialog');
|
|
18087
18090
|
if (this.destroyAfterClose) {
|
|
18088
18091
|
this.destruct();
|
|
18089
18092
|
}
|
|
@@ -18526,7 +18529,9 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
|
|
|
18526
18529
|
]);
|
|
18527
18530
|
}, self.defaultTimeout);
|
|
18528
18531
|
self.e
|
|
18529
|
-
.on('beforeClose', () =>
|
|
18532
|
+
.on('beforeClose', () => {
|
|
18533
|
+
contextmenu.close();
|
|
18534
|
+
})
|
|
18530
18535
|
.on('beforeDestruct', () => contextmenu.destruct());
|
|
18531
18536
|
e.stopPropagation();
|
|
18532
18537
|
e.preventDefault();
|
|
@@ -19006,7 +19011,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.fil
|
|
|
19006
19011
|
|
|
19007
19012
|
|
|
19008
19013
|
const DEFAULT_SOURCE_NAME = 'default';
|
|
19009
|
-
const possibleRules = [
|
|
19014
|
+
const possibleRules = new Set([
|
|
19010
19015
|
'allowFiles',
|
|
19011
19016
|
'allowFileMove',
|
|
19012
19017
|
'allowFileUpload',
|
|
@@ -19020,7 +19025,7 @@ const possibleRules = [
|
|
|
19020
19025
|
'allowFolderRename',
|
|
19021
19026
|
'allowImageResize',
|
|
19022
19027
|
'allowImageCrop'
|
|
19023
|
-
];
|
|
19028
|
+
]);
|
|
19024
19029
|
let DataProvider = class DataProvider {
|
|
19025
19030
|
constructor(parent, options) {
|
|
19026
19031
|
this.parent = parent;
|
|
@@ -19101,13 +19106,13 @@ let DataProvider = class DataProvider {
|
|
|
19101
19106
|
canI(action) {
|
|
19102
19107
|
const rule = 'allow' + action;
|
|
19103
19108
|
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__.IS_PROD) {
|
|
19104
|
-
if (!possibleRules.
|
|
19109
|
+
if (!possibleRules.has(rule)) {
|
|
19105
19110
|
throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.error)('Wrong action ' + action);
|
|
19106
19111
|
}
|
|
19107
19112
|
}
|
|
19108
|
-
const
|
|
19109
|
-
if (
|
|
19110
|
-
return
|
|
19113
|
+
const presetValue = this.o.permissionsPresets[rule];
|
|
19114
|
+
if (presetValue !== undefined) {
|
|
19115
|
+
return presetValue;
|
|
19111
19116
|
}
|
|
19112
19117
|
return (this.__currentPermissions == null ||
|
|
19113
19118
|
this.__currentPermissions[rule] === undefined ||
|
|
@@ -19617,11 +19622,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
|
|
|
19617
19622
|
minHeight: 300,
|
|
19618
19623
|
buttons: this.o.headerButtons ?? ['fullsize', 'dialog.close']
|
|
19619
19624
|
});
|
|
19620
|
-
['afterClose', 'beforeOpen'].forEach(proxyEvent =>
|
|
19621
|
-
dialog.events.on(dialog, proxyEvent, () => {
|
|
19622
|
-
this.e.fire(proxyEvent);
|
|
19623
|
-
});
|
|
19624
|
-
});
|
|
19625
|
+
['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
|
|
19625
19626
|
dialog.setSize(this.o.width, this.o.height);
|
|
19626
19627
|
return dialog;
|
|
19627
19628
|
}
|
|
@@ -36913,13 +36914,20 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
|
|
|
36913
36914
|
}
|
|
36914
36915
|
beforeCommandCut(command) {
|
|
36915
36916
|
const { s } = this.j;
|
|
36916
|
-
if (
|
|
36917
|
+
if (!s.isCollapsed()) {
|
|
36917
36918
|
const current = s.current();
|
|
36918
36919
|
if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .i.isOrContains(this.j.editor, current)) {
|
|
36919
36920
|
this.onCopyNormalizeSelectionBound();
|
|
36920
36921
|
}
|
|
36921
36922
|
}
|
|
36922
36923
|
}
|
|
36924
|
+
beforeCommandSelectall(command) {
|
|
36925
|
+
const { s } = this.j;
|
|
36926
|
+
s.focus();
|
|
36927
|
+
s.select(this.j.editor, true);
|
|
36928
|
+
s.expandSelection();
|
|
36929
|
+
return false;
|
|
36930
|
+
}
|
|
36923
36931
|
onCopyNormalizeSelectionBound(e) {
|
|
36924
36932
|
const { s, editor, o } = this.j;
|
|
36925
36933
|
if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
|
|
@@ -36941,8 +36949,11 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
|
|
|
36941
36949
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('ow:click')
|
|
36942
36950
|
], select.prototype, "onOutsideClick", null);
|
|
36943
36951
|
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
|
|
36944
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':
|
|
36952
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandCut'])
|
|
36945
36953
|
], select.prototype, "beforeCommandCut", null);
|
|
36954
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
|
|
36955
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandSelectall'])
|
|
36956
|
+
], select.prototype, "beforeCommandSelectall", null);
|
|
36946
36957
|
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
|
|
36947
36958
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':copy', ':cut'])
|
|
36948
36959
|
], select.prototype, "onCopyNormalizeSelectionBound", null);
|