jodit 4.2.33 → 4.2.35
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 +17 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +29 -19
- 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 +29 -19
- 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 +29 -19
- 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 +29 -19
- 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/164.fat.min.js +1 -1
- package/es5/164.min.js +1 -1
- package/es5/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +29 -19
- 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/style/api/list/toggle-ordered-list.js +3 -1
- package/esm/core/selection/style/api/list/wrap-list.d.ts +1 -1
- package/esm/modules/history/snapshot.d.ts +1 -1
- package/esm/modules/history/snapshot.js +10 -8
- package/esm/plugins/link/link.js +10 -4
- package/package.json +1 -1
- package/types/core/selection/style/api/list/wrap-list.d.ts +1 -1
- package/types/modules/history/snapshot.d.ts +1 -1
package/es2021/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.2.
|
|
4
|
+
* Version: v4.2.35
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1736
1736
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1737
1737
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1738
1738
|
*/
|
|
1739
|
-
const APP_VERSION = "4.2.
|
|
1739
|
+
const APP_VERSION = "4.2.35";
|
|
1740
1740
|
// prettier-ignore
|
|
1741
1741
|
const ES = "es2021";
|
|
1742
1742
|
const IS_ES_MODERN = true;
|
|
@@ -11810,7 +11810,9 @@ function unwrapList(mode, list, li, jodit, cs) {
|
|
|
11810
11810
|
(0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_2__/* .extractSelectedPart */ .y)(list, li, jodit);
|
|
11811
11811
|
void 0;
|
|
11812
11812
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.unwrap(li.parentElement);
|
|
11813
|
-
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter
|
|
11813
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter.toLowerCase() !== 'br'
|
|
11814
|
+
? jodit.o.enter
|
|
11815
|
+
: jodit.createInside.fragment(), jodit.createInside);
|
|
11814
11816
|
}
|
|
11815
11817
|
|
|
11816
11818
|
|
|
@@ -20852,7 +20854,7 @@ class History extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewC
|
|
|
20852
20854
|
/* harmony export */ });
|
|
20853
20855
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
|
|
20854
20856
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17352);
|
|
20855
|
-
/* harmony import */ var
|
|
20857
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55186);
|
|
20856
20858
|
/*!
|
|
20857
20859
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
20858
20860
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -20895,7 +20897,7 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20895
20897
|
for (let j = 0; j < elms.length; j += 1) {
|
|
20896
20898
|
if (previous &&
|
|
20897
20899
|
!this.isIgnoredNode(elms[j]) &&
|
|
20898
|
-
!(
|
|
20900
|
+
!(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(previous) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(elms[j]))) {
|
|
20899
20901
|
count += 1;
|
|
20900
20902
|
}
|
|
20901
20903
|
if (elms[j] === elm) {
|
|
@@ -20909,9 +20911,9 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20909
20911
|
* Calc normal offset in joined text nodes
|
|
20910
20912
|
*/
|
|
20911
20913
|
static strokeOffset(elm, offset) {
|
|
20912
|
-
while (
|
|
20914
|
+
while (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(elm)) {
|
|
20913
20915
|
elm = elm.previousSibling;
|
|
20914
|
-
if (
|
|
20916
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(elm) && elm.nodeValue) {
|
|
20915
20917
|
offset += elm.nodeValue.length;
|
|
20916
20918
|
}
|
|
20917
20919
|
}
|
|
@@ -20922,7 +20924,7 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20922
20924
|
*/
|
|
20923
20925
|
calcHierarchyLadder(elm) {
|
|
20924
20926
|
const counts = [];
|
|
20925
|
-
if (!elm || !elm.parentNode || !
|
|
20927
|
+
if (!elm || !elm.parentNode || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.j.editor, elm)) {
|
|
20926
20928
|
return [];
|
|
20927
20929
|
}
|
|
20928
20930
|
while (elm && elm !== this.j.editor) {
|
|
@@ -20974,10 +20976,12 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20974
20976
|
endOffset: 0
|
|
20975
20977
|
}
|
|
20976
20978
|
};
|
|
20977
|
-
snapshot.html = this.
|
|
20979
|
+
snapshot.html = this.__getCleanedEditorValue(this.j.editor);
|
|
20978
20980
|
const sel = this.j.s.sel;
|
|
20979
20981
|
if (sel && sel.rangeCount) {
|
|
20980
|
-
const range = sel.getRangeAt(0)
|
|
20982
|
+
const range = sel.getRangeAt(0);
|
|
20983
|
+
const startContainer = this.calcHierarchyLadder(range.startContainer);
|
|
20984
|
+
const endContainer = this.calcHierarchyLadder(range.endContainer);
|
|
20981
20985
|
let startOffset = Snapshot.strokeOffset(range.startContainer, range.startOffset), endOffset = Snapshot.strokeOffset(range.endContainer, range.endOffset);
|
|
20982
20986
|
if (!startContainer.length &&
|
|
20983
20987
|
range.startContainer !== this.j.editor) {
|
|
@@ -21004,8 +21008,8 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
21004
21008
|
restore(snapshot) {
|
|
21005
21009
|
this.transaction(() => {
|
|
21006
21010
|
const scroll = this.storeScrollState();
|
|
21007
|
-
const
|
|
21008
|
-
if (
|
|
21011
|
+
const html = this.__getCleanedEditorValue(this.j.editor);
|
|
21012
|
+
if (html !== snapshot.html) {
|
|
21009
21013
|
this.j.value = snapshot.html;
|
|
21010
21014
|
}
|
|
21011
21015
|
this.restoreOnlySelection(snapshot);
|
|
@@ -21049,11 +21053,11 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
21049
21053
|
super.destruct();
|
|
21050
21054
|
}
|
|
21051
21055
|
static isIgnoredNode(node) {
|
|
21052
|
-
return (
|
|
21056
|
+
return (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node) && !node.nodeValue) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTemporary(node);
|
|
21053
21057
|
}
|
|
21054
|
-
|
|
21058
|
+
__getCleanedEditorValue(node) {
|
|
21055
21059
|
const clone = node.cloneNode(true);
|
|
21056
|
-
|
|
21060
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.temporaryList(clone).forEach(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.unwrap);
|
|
21057
21061
|
return clone.innerHTML;
|
|
21058
21062
|
}
|
|
21059
21063
|
}
|
|
@@ -34895,13 +34899,19 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
34895
34899
|
__generateForm(current, close) {
|
|
34896
34900
|
const { jodit } = this;
|
|
34897
34901
|
const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
|
|
34898
|
-
const html = formTemplate(jodit)
|
|
34902
|
+
const html = formTemplate(jodit);
|
|
34903
|
+
const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isString)(html)
|
|
34899
34904
|
? jodit.c.fromHTML(html, {
|
|
34900
34905
|
target_checkbox_box: openInNewTabCheckbox,
|
|
34901
34906
|
nofollow_checkbox_box: noFollowCheckbox
|
|
34902
34907
|
})
|
|
34903
|
-
: html
|
|
34904
|
-
const
|
|
34908
|
+
: html;
|
|
34909
|
+
const htmlForm = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isElement(form) ? form : form.container;
|
|
34910
|
+
const elements = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.refs)(htmlForm);
|
|
34911
|
+
const { insert, unlink, content_input_box } = elements;
|
|
34912
|
+
const { target_checkbox, nofollow_checkbox, url_input } = elements;
|
|
34913
|
+
const currentElement = current;
|
|
34914
|
+
const isImageContent = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isImage(currentElement);
|
|
34905
34915
|
let { content_input } = elements;
|
|
34906
34916
|
const { className_input } = elements, { className_select } = elements;
|
|
34907
34917
|
if (!content_input) {
|
|
@@ -34972,7 +34982,7 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
34972
34982
|
jodit.history.snapshot.restore(snapshot);
|
|
34973
34983
|
const textWasChanged = getSelectionText() !== content_input.value.trim();
|
|
34974
34984
|
const ci = jodit.createInside;
|
|
34975
|
-
if (!link) {
|
|
34985
|
+
if (!link || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isOrContains(jodit.editor, link)) {
|
|
34976
34986
|
if (!jodit.s.isCollapsed()) {
|
|
34977
34987
|
const node = jodit.s.current();
|
|
34978
34988
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(node, 'img')) {
|