jodit 4.18.9 → 4.18.10
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 +3 -3
- package/es2015/jodit.js +77 -2
- package/es2015/jodit.min.js +3 -3
- 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.fat.min.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.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 +3 -3
- package/es2021/jodit.js +77 -2
- package/es2021/jodit.min.js +3 -3
- 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 +3 -3
- package/es2021.en/jodit.js +77 -2
- package/es2021.en/jodit.min.js +3 -3
- 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/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +77 -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/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/plugins/backspace/cases/check-join-neighbors.js +92 -0
- package/package.json +1 -1
package/es2021.en/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.18.
|
|
4
|
+
* Version: v4.18.10
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1822,7 +1822,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1822
1822
|
* ```
|
|
1823
1823
|
* @packageDocumentation
|
|
1824
1824
|
* @module constants
|
|
1825
|
-
*/ const APP_VERSION = "4.18.
|
|
1825
|
+
*/ const APP_VERSION = "4.18.10";
|
|
1826
1826
|
// prettier-ignore
|
|
1827
1827
|
const ES = "es2021";
|
|
1828
1828
|
const IS_ES_MODERN = true;
|
|
@@ -28223,6 +28223,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28223
28223
|
* Check if two separate elements can be connected
|
|
28224
28224
|
* @private
|
|
28225
28225
|
*/ function checkJoinNeighbors(jodit, fakeNode, backspace) {
|
|
28226
|
+
return joinNeighbors(jodit, fakeNode, backspace, false);
|
|
28227
|
+
}
|
|
28228
|
+
/**
|
|
28229
|
+
* `moved` is set on the one re-entrant pass after `moveToNextLine`
|
|
28230
|
+
*/ function joinNeighbors(jodit, fakeNode, backspace, moved) {
|
|
28226
28231
|
if (checkJoinBareText(jodit, fakeNode, backspace)) {
|
|
28227
28232
|
return true;
|
|
28228
28233
|
}
|
|
@@ -28253,6 +28258,14 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28253
28258
|
return true;
|
|
28254
28259
|
}
|
|
28255
28260
|
const box = findCaretBox(fakeNode, mainClosestBox);
|
|
28261
|
+
// One pass only: the line now sits beside the next one, so the
|
|
28262
|
+
// cases below join them. The DOM has changed either way
|
|
28263
|
+
if (!moved && sibling && moveToNextLine(jodit, fakeNode, box, sibling, backspace)) {
|
|
28264
|
+
if (!joinNeighbors(jodit, fakeNode, backspace, true)) {
|
|
28265
|
+
jodit.s.setCursorBefore(fakeNode);
|
|
28266
|
+
}
|
|
28267
|
+
return true;
|
|
28268
|
+
}
|
|
28256
28269
|
if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || checkJoinInlineSibling(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
|
|
28257
28270
|
jodit.s.setCursorBefore(fakeNode);
|
|
28258
28271
|
return true;
|
|
@@ -28304,6 +28317,68 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28304
28317
|
});
|
|
28305
28318
|
return cells.length ? cells[backspace ? cells.length - 1 : 0] : null;
|
|
28306
28319
|
}
|
|
28320
|
+
/**
|
|
28321
|
+
* On Delete, Word joins two lines where the next one is, inside or outside
|
|
28322
|
+
* its box or quote, and the joined line keeps the caret line's kind, list item
|
|
28323
|
+
* or paragraph. Two paragraphs already join that way. When either line is a
|
|
28324
|
+
* list item, this moves the caret's line beside the next one, and the usual
|
|
28325
|
+
* cases then join them: `<p>one|</p><div><ul><li>two</li></ul></div>` becomes
|
|
28326
|
+
* `<div><p>one|</p><ul><li>two</li></ul></div>`
|
|
28327
|
+
* @private
|
|
28328
|
+
*/ function moveToNextLine(jodit, fakeNode, box, sibling, backspace) {
|
|
28329
|
+
if (backspace || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, 'table') || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, jodit.editor)) {
|
|
28330
|
+
return false;
|
|
28331
|
+
}
|
|
28332
|
+
const line = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, box, true);
|
|
28333
|
+
const next = findEdgeBlock(sibling, false, jodit.editor);
|
|
28334
|
+
if (!line || !next || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(next, jodit.editor) || !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(line) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(next)) || // A paragraph inside a list item is left as it is
|
|
28335
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(line.parentElement) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(next.parentElement) || boxOf(line) === boxOf(next)) {
|
|
28336
|
+
return false;
|
|
28337
|
+
}
|
|
28338
|
+
const from = line.parentElement;
|
|
28339
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(line) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(next)) {
|
|
28340
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(next, line);
|
|
28341
|
+
} else if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(line)) {
|
|
28342
|
+
// A list item keeps its bullet, in a list of its own
|
|
28343
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(next, ownList(line));
|
|
28344
|
+
} else {
|
|
28345
|
+
// A paragraph can't go inside a list, so it goes in front of it
|
|
28346
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(next.parentElement, line);
|
|
28347
|
+
}
|
|
28348
|
+
let remove = from;
|
|
28349
|
+
while(remove && remove !== jodit.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(remove)){
|
|
28350
|
+
const parent = remove.parentElement;
|
|
28351
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(remove);
|
|
28352
|
+
remove = parent;
|
|
28353
|
+
}
|
|
28354
|
+
return true;
|
|
28355
|
+
}
|
|
28356
|
+
/**
|
|
28357
|
+
* The box or quote a line is in, past its lists
|
|
28358
|
+
*/ function boxOf(line) {
|
|
28359
|
+
let box = line.parentElement;
|
|
28360
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(box) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(box)){
|
|
28361
|
+
box = box.parentElement;
|
|
28362
|
+
}
|
|
28363
|
+
return box;
|
|
28364
|
+
}
|
|
28365
|
+
/**
|
|
28366
|
+
* Moves a list item into a list of its own, which carries on its numbering
|
|
28367
|
+
*/ function ownList(item) {
|
|
28368
|
+
const list = item.parentElement;
|
|
28369
|
+
const own = list.cloneNode(false);
|
|
28370
|
+
const index = Array.from(list.children).indexOf(item);
|
|
28371
|
+
if (index) {
|
|
28372
|
+
// Two lists cannot share one id
|
|
28373
|
+
own.removeAttribute('id');
|
|
28374
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(list, 'ol')) {
|
|
28375
|
+
const start = parseInt(list.getAttribute('start') || '1', 10) || 1;
|
|
28376
|
+
own.setAttribute('start', String(start + index));
|
|
28377
|
+
}
|
|
28378
|
+
}
|
|
28379
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(own, item);
|
|
28380
|
+
return own;
|
|
28381
|
+
}
|
|
28307
28382
|
/**
|
|
28308
28383
|
* Delete at the edge of a list pulls the next line up to the caret, as the
|
|
28309
28384
|
* browsers do, instead of moving the caret's line into the next block:
|