jodit 4.0.0-beta.86 → 4.0.0-beta.88
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 +42 -8
- package/README.md +5 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +46 -43
- 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 +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +46 -43
- 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 +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +43 -43
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +43 -43
- 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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +85 -69
- package/es5/jodit.min.css +2 -2
- 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/interface.d.ts +5 -0
- package/esm/core/selection/interface.js +6 -1
- package/esm/core/selection/style/commit-style.js +2 -0
- package/esm/core/ui/button/button/button.js +2 -1
- package/esm/core/ui/button/group/group.js +2 -1
- package/esm/core/ui/button/tooltip/tooltip.js +2 -1
- package/esm/core/ui/element.js +2 -1
- package/esm/core/ui/form/block/block.js +2 -1
- package/esm/core/ui/form/form.js +2 -1
- package/esm/core/ui/form/inputs/area/area.js +2 -1
- package/esm/core/ui/form/inputs/checkbox/checkbox.js +2 -1
- package/esm/core/ui/form/inputs/file/file.js +2 -1
- package/esm/core/ui/form/inputs/input/input.js +2 -1
- package/esm/core/ui/form/inputs/select/select.js +2 -1
- package/esm/core/ui/group/group.js +2 -1
- package/esm/core/ui/group/list.js +2 -1
- package/esm/core/ui/group/separator.js +2 -1
- package/esm/core/ui/group/spacer.js +2 -1
- package/esm/core/ui/icon.js +4 -1
- package/esm/core/view/view.js +2 -1
- package/esm/jodit.js +3 -11
- package/esm/modules/context-menu/context-menu.js +2 -1
- package/esm/modules/dialog/dialog.js +2 -1
- package/esm/modules/file-browser/file-browser.js +2 -1
- package/esm/modules/image-editor/image-editor.js +2 -1
- package/esm/modules/messages/message.js +2 -1
- package/esm/modules/messages/messages.js +2 -1
- package/esm/modules/status-bar/status-bar.js +2 -1
- package/esm/modules/toolbar/button/button.js +2 -1
- package/esm/modules/toolbar/button/content.js +2 -1
- package/esm/modules/toolbar/button/select/select.js +2 -1
- package/esm/modules/toolbar/collection/collection.js +2 -1
- package/esm/modules/toolbar/collection/editor-collection.js +2 -1
- package/esm/plugins/backspace/interface.d.ts +9 -8
- package/esm/plugins/resize-handler/resize-handler.js +2 -1
- package/esm/plugins/search/ui/search.js +2 -1
- package/esm/plugins/size/size.js +2 -1
- package/esm/plugins/speech-recognize/helpers/recognize-manager.js +2 -1
- package/esm/plugins/wrap-nodes/wrap-nodes.js +34 -30
- package/examples/arabic.lang.html +111 -64
- package/examples/assets/app.css +1 -3
- package/examples/color-picker.html +122 -72
- package/examples/custom-icons.html +204 -157
- package/examples/custom-toolbar.html +110 -63
- package/examples/example.default.html +4 -3
- package/examples/fullsize.html +107 -60
- package/examples/index.html +6 -5
- package/examples/inline-mode.html +193 -92
- package/examples/oneinstance.html +138 -90
- package/examples/theme.html +6 -5
- package/package.json +1 -1
- package/types/core/selection/interface.d.ts +5 -0
- package/types/plugins/backspace/interface.d.ts +9 -8
- package/examples/assets/prism.css +0 -200
- package/examples/assets/prism.js +0 -1254
package/es2021/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.0-beta.
|
|
4
|
+
* Version: v4.0.0-beta.88
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1716,7 +1716,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1716
1716
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1717
1717
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1718
1718
|
*/
|
|
1719
|
-
const APP_VERSION = "4.0.0-beta.
|
|
1719
|
+
const APP_VERSION = "4.0.0-beta.88";
|
|
1720
1720
|
// prettier-ignore
|
|
1721
1721
|
const ES = "es2021";
|
|
1722
1722
|
const IS_ES_MODERN = true;
|
|
@@ -12224,6 +12224,8 @@ class CommitStyle {
|
|
|
12224
12224
|
});
|
|
12225
12225
|
this.__applyMap = new WeakMap();
|
|
12226
12226
|
}
|
|
12227
|
+
jodit.synchronizeValues();
|
|
12228
|
+
jodit.e.fire('afterCommitStyle', this);
|
|
12227
12229
|
}
|
|
12228
12230
|
}
|
|
12229
12231
|
|
|
@@ -15015,7 +15017,10 @@ class Icon {
|
|
|
15015
15017
|
let iconElement;
|
|
15016
15018
|
const { name, iconURL, fill } = icon;
|
|
15017
15019
|
const clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
|
|
15018
|
-
|
|
15020
|
+
let iconFromEvent;
|
|
15021
|
+
if (!/<svg/.test(name)) {
|
|
15022
|
+
iconFromEvent = jodit.o.getIcon?.(name, clearName);
|
|
15023
|
+
}
|
|
15019
15024
|
const cacheKey = `${name}${iconURL}${fill}${iconFromEvent ?? ''}`;
|
|
15020
15025
|
if (jodit.o.cache && this.__cache.has(cacheKey)) {
|
|
15021
15026
|
return this.__cache.get(cacheKey)?.cloneNode(true);
|
|
@@ -17053,20 +17058,11 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
|
|
|
17053
17058
|
if (this.o.disabled) {
|
|
17054
17059
|
this.setDisabled(true);
|
|
17055
17060
|
}
|
|
17056
|
-
// if enter plugin
|
|
17061
|
+
// if enter plugin isn't installed
|
|
17057
17062
|
try {
|
|
17058
17063
|
this.ed.execCommand('defaultParagraphSeparator', false, this.o.enter.toLowerCase());
|
|
17059
17064
|
}
|
|
17060
17065
|
catch { }
|
|
17061
|
-
// fix for native resizing
|
|
17062
|
-
try {
|
|
17063
|
-
this.ed.execCommand('enableObjectResizing', false, 'false');
|
|
17064
|
-
}
|
|
17065
|
-
catch { }
|
|
17066
|
-
try {
|
|
17067
|
-
this.ed.execCommand('enableInlineTableEditing', false, 'false');
|
|
17068
|
-
}
|
|
17069
|
-
catch { }
|
|
17070
17066
|
});
|
|
17071
17067
|
}
|
|
17072
17068
|
/**
|
|
@@ -40830,16 +40826,20 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
|
|
|
40830
40826
|
/**
|
|
40831
40827
|
* Found Node which should be wrapped
|
|
40832
40828
|
*/
|
|
40833
|
-
this.isSuitableStart = (n) => (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) &&
|
|
40834
|
-
(
|
|
40829
|
+
this.isSuitableStart = (n) => (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) &&
|
|
40830
|
+
(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .H)(n.nodeValue) &&
|
|
40831
|
+
(/[^\s]/.test(n.nodeValue) ||
|
|
40832
|
+
(n.parentNode?.firstChild === n &&
|
|
40833
|
+
this.isSuitable(n.nextSibling)))) ||
|
|
40834
|
+
(this.isNotWrapped(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTemporary(n));
|
|
40835
40835
|
/**
|
|
40836
|
-
* Node should add in block element
|
|
40836
|
+
* Node should add in a block element
|
|
40837
40837
|
*/
|
|
40838
|
-
this.isSuitable = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) || this.
|
|
40838
|
+
this.isSuitable = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) || this.isNotWrapped(n);
|
|
40839
40839
|
/**
|
|
40840
|
-
* Some element which
|
|
40840
|
+
* Some element which needs to append in block
|
|
40841
40841
|
*/
|
|
40842
|
-
this.
|
|
40842
|
+
this.isNotWrapped = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(n) &&
|
|
40843
40843
|
!(jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isBlock(n) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(n, this.j.o.wrapNodes.exclude));
|
|
40844
40844
|
}
|
|
40845
40845
|
/** @override **/
|
|
@@ -40851,7 +40851,7 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
|
|
|
40851
40851
|
.on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn', this.preprocessInput, {
|
|
40852
40852
|
top: true
|
|
40853
40853
|
})
|
|
40854
|
-
.on('afterInit.wtn postProcessSetEditorValue.wtn', this.postProcessSetEditorValue);
|
|
40854
|
+
.on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn', this.postProcessSetEditorValue);
|
|
40855
40855
|
}
|
|
40856
40856
|
/** @override **/
|
|
40857
40857
|
beforeDestruct(jodit) {
|
|
@@ -40867,7 +40867,7 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
|
|
|
40867
40867
|
}
|
|
40868
40868
|
let child = jodit.editor.firstChild, isChanged = false;
|
|
40869
40869
|
while (child) {
|
|
40870
|
-
child =
|
|
40870
|
+
child = checkAloneListLeaf(child, jodit);
|
|
40871
40871
|
if (this.isSuitableStart(child)) {
|
|
40872
40872
|
if (!isChanged) {
|
|
40873
40873
|
jodit.s.save();
|
|
@@ -40892,28 +40892,6 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
|
|
|
40892
40892
|
}
|
|
40893
40893
|
}
|
|
40894
40894
|
}
|
|
40895
|
-
checkAloneListLeaf(child, jodit) {
|
|
40896
|
-
let result = child;
|
|
40897
|
-
let next = child;
|
|
40898
|
-
do {
|
|
40899
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(next) &&
|
|
40900
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isLeaf(next) &&
|
|
40901
|
-
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isList(next.parentElement)) {
|
|
40902
|
-
const nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.findNotEmptySibling(next, false);
|
|
40903
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(result, 'ul')) {
|
|
40904
|
-
result.appendChild(next);
|
|
40905
|
-
}
|
|
40906
|
-
else {
|
|
40907
|
-
result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.wrap(next, 'ul', jodit.createInside);
|
|
40908
|
-
}
|
|
40909
|
-
next = nextChild;
|
|
40910
|
-
}
|
|
40911
|
-
else {
|
|
40912
|
-
break;
|
|
40913
|
-
}
|
|
40914
|
-
} while (next);
|
|
40915
|
-
return result;
|
|
40916
|
-
}
|
|
40917
40895
|
/**
|
|
40918
40896
|
* Process input without parent box
|
|
40919
40897
|
*/
|
|
@@ -40938,6 +40916,28 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
|
|
|
40938
40916
|
(0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .gn)([
|
|
40939
40917
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
40940
40918
|
], wrapNodes.prototype, "preprocessInput", null);
|
|
40919
|
+
function checkAloneListLeaf(child, jodit) {
|
|
40920
|
+
let result = child;
|
|
40921
|
+
let next = child;
|
|
40922
|
+
do {
|
|
40923
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(next) &&
|
|
40924
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isLeaf(next) &&
|
|
40925
|
+
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isList(next.parentElement)) {
|
|
40926
|
+
const nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.findNotEmptySibling(next, false);
|
|
40927
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(result, 'ul')) {
|
|
40928
|
+
result.appendChild(next);
|
|
40929
|
+
}
|
|
40930
|
+
else {
|
|
40931
|
+
result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.wrap(next, 'ul', jodit.createInside);
|
|
40932
|
+
}
|
|
40933
|
+
next = nextChild;
|
|
40934
|
+
}
|
|
40935
|
+
else {
|
|
40936
|
+
break;
|
|
40937
|
+
}
|
|
40938
|
+
} while (next);
|
|
40939
|
+
return result;
|
|
40940
|
+
}
|
|
40941
40941
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('wrapNodes', wrapNodes);
|
|
40942
40942
|
|
|
40943
40943
|
|