jodit 4.18.10 → 4.18.11
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 +15 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +5 -5
- package/es2015/jodit.js +256 -71
- package/es2015/jodit.min.js +5 -5
- 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 +5 -5
- package/es2018/jodit.min.js +5 -5
- 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 +6 -6
- package/es2021/jodit.js +253 -71
- package/es2021/jodit.min.js +6 -6
- 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 +6 -6
- package/es2021.en/jodit.js +253 -71
- package/es2021.en/jodit.min.js +6 -6
- 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 +303 -72
- 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 +2 -2
- package/es5/polyfills.js +3 -3
- package/es5/polyfills.min.js +2 -2
- package/esm/core/async/async.js +2 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/size/get-fixed-position-offset.d.ts +4 -2
- package/esm/core/helpers/size/get-fixed-position-offset.js +14 -2
- package/esm/plugins/add-new-line/add-new-line.d.ts +7 -0
- package/esm/plugins/add-new-line/add-new-line.js +45 -0
- package/esm/plugins/backspace/backspace.d.ts +7 -0
- package/esm/plugins/backspace/backspace.js +45 -2
- package/esm/plugins/backspace/cases/check-join-neighbors.js +69 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +3 -1
- package/esm/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
- package/esm/plugins/backspace/cases/check-remove-content-not-editable.js +39 -11
- package/esm/plugins/wrap-nodes/wrap-nodes.js +19 -2
- package/esm/types/async.d.ts +7 -0
- package/package.json +1 -1
- package/types/core/helpers/size/get-fixed-position-offset.d.ts +4 -2
- package/types/plugins/add-new-line/add-new-line.d.ts +7 -0
- package/types/plugins/backspace/backspace.d.ts +7 -0
- package/types/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
- package/types/types/async.d.ts +7 -0
package/es2015/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.11
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1446,7 +1446,8 @@ class Async {
|
|
|
1446
1446
|
this.__requestsIdle.forEach((key)=>this.cancelIdleCallback(key));
|
|
1447
1447
|
this.__requestsRaf.forEach((key)=>this.cancelAnimationFrame(key));
|
|
1448
1448
|
this.__controllers.forEach((controller)=>controller.abort());
|
|
1449
|
-
|
|
1449
|
+
// A labelled timer is kept under its label, so clear by the value
|
|
1450
|
+
this.timers.forEach((timer)=>(0,jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__.clearTimeout)(timer));
|
|
1450
1451
|
this.timers.clear();
|
|
1451
1452
|
this.promisesRejections.forEach((reject)=>reject());
|
|
1452
1453
|
this.promisesRejections.clear();
|
|
@@ -1828,7 +1829,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1828
1829
|
* ```
|
|
1829
1830
|
* @packageDocumentation
|
|
1830
1831
|
* @module constants
|
|
1831
|
-
*/ const APP_VERSION = "4.18.
|
|
1832
|
+
*/ const APP_VERSION = "4.18.11";
|
|
1832
1833
|
// prettier-ignore
|
|
1833
1834
|
const ES = "es2015";
|
|
1834
1835
|
const IS_ES_MODERN = true;
|
|
@@ -7214,8 +7215,10 @@ function normalizeCssValue(key, value) {
|
|
|
7214
7215
|
* ancestor's top-left corner. The returned offset should be subtracted from
|
|
7215
7216
|
* the desired viewport coordinates before applying them.
|
|
7216
7217
|
*
|
|
7217
|
-
*
|
|
7218
|
-
*
|
|
7218
|
+
* Without such an ancestor the containing block is the layout viewport. Its
|
|
7219
|
+
* offset is `{ x: 0, y: 0 }` in most browsers, but WebKit measures client
|
|
7220
|
+
* rects from the visual viewport, so once the page is pinch-zoomed and panned
|
|
7221
|
+
* the layout viewport starts above and to the left of the client origin.
|
|
7219
7222
|
*/ function getFixedPositionOffset(elm) {
|
|
7220
7223
|
var _elm_ownerDocument;
|
|
7221
7224
|
const win = (_elm_ownerDocument = elm.ownerDocument) === null || _elm_ownerDocument === void 0 ? void 0 : _elm_ownerDocument.defaultView;
|
|
@@ -7230,6 +7233,15 @@ function normalizeCssValue(key, value) {
|
|
|
7230
7233
|
}
|
|
7231
7234
|
node = node.parentElement;
|
|
7232
7235
|
}
|
|
7236
|
+
const vv = win === null || win === void 0 ? void 0 : win.visualViewport;
|
|
7237
|
+
// WebKit's `scrollX`/`scrollY` follow the visual viewport too (truncated),
|
|
7238
|
+
// where Blink's and Gecko's follow the layout viewport
|
|
7239
|
+
if (win && vv && (vv.offsetLeft || vv.offsetTop) && Math.abs(vv.pageLeft - win.scrollX) < 1 && Math.abs(vv.pageTop - win.scrollY) < 1) {
|
|
7240
|
+
return {
|
|
7241
|
+
x: -Math.round(vv.offsetLeft),
|
|
7242
|
+
y: -Math.round(vv.offsetTop)
|
|
7243
|
+
};
|
|
7244
|
+
}
|
|
7233
7245
|
return {
|
|
7234
7246
|
x: 0,
|
|
7235
7247
|
y: 0
|
|
@@ -27601,12 +27613,13 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
|
|
|
27601
27613
|
/* unused harmony export addNewLine */
|
|
27602
27614
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
27603
27615
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
27604
|
-
/* harmony import */ var
|
|
27605
|
-
/* harmony import */ var
|
|
27606
|
-
/* harmony import */ var
|
|
27607
|
-
/* harmony import */ var
|
|
27608
|
-
/* harmony import */ var
|
|
27609
|
-
/* harmony import */ var
|
|
27616
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
27617
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
27618
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
27619
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
27620
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
27621
|
+
/* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(60936);
|
|
27622
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10685);
|
|
27610
27623
|
/*!
|
|
27611
27624
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
27612
27625
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -27624,10 +27637,11 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
|
|
|
27624
27637
|
|
|
27625
27638
|
|
|
27626
27639
|
|
|
27640
|
+
|
|
27627
27641
|
const ns = 'addnewline';
|
|
27628
27642
|
/**
|
|
27629
27643
|
* Create helper for adding new paragraph(Jodit.defaultOptions.enter tag) before iframe, table or image
|
|
27630
|
-
*/ class addNewLine extends
|
|
27644
|
+
*/ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Plugin {
|
|
27631
27645
|
__show() {
|
|
27632
27646
|
if (this.j.o.readonly || this.j.isLocked) {
|
|
27633
27647
|
return;
|
|
@@ -27637,8 +27651,8 @@ const ns = 'addnewline';
|
|
|
27637
27651
|
return;
|
|
27638
27652
|
}
|
|
27639
27653
|
this.__isShown = true;
|
|
27640
|
-
|
|
27641
|
-
(0,
|
|
27654
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(this.j.container, this.__line);
|
|
27655
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(this.__line, 'width', this.j.container.clientWidth);
|
|
27642
27656
|
}
|
|
27643
27657
|
onLock(isLocked) {
|
|
27644
27658
|
if (isLocked && this.__isShown) {
|
|
@@ -27676,16 +27690,43 @@ const ns = 'addnewline';
|
|
|
27676
27690
|
editor.editor
|
|
27677
27691
|
], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
|
|
27678
27692
|
}
|
|
27693
|
+
/**
|
|
27694
|
+
* A paragraph holding only an embed has no place for the caret, so the
|
|
27695
|
+
* arrow keys can't get past one that ends the content, or before one that
|
|
27696
|
+
* starts it. When an arrow key leaves the caret where it was and there is
|
|
27697
|
+
* content beyond it, a new line goes there, as when the line is clicked.
|
|
27698
|
+
*/ onArrowKey(e) {
|
|
27699
|
+
const editor = this.j;
|
|
27700
|
+
const forward = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DOWN || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_RIGHT;
|
|
27701
|
+
if (!editor.o.addNewLine || editor.o.readonly || editor.isLocked || e.shiftKey || !(forward || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_UP || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_LEFT) || !editor.s.isCollapsed()) {
|
|
27702
|
+
return;
|
|
27703
|
+
}
|
|
27704
|
+
const { startContainer, startOffset } = editor.s.range;
|
|
27705
|
+
// Once the browser has moved the caret, if it could. With a 0 timeout
|
|
27706
|
+
// Jodit would run this at once, before the browser moves it
|
|
27707
|
+
editor.async.setTimeout(()=>{
|
|
27708
|
+
const { range } = editor.s;
|
|
27709
|
+
const block = jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(startContainer, jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock, editor.editor);
|
|
27710
|
+
if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
|
|
27711
|
+
return;
|
|
27712
|
+
}
|
|
27713
|
+
const p = editor.createInside.element(editor.o.enter);
|
|
27714
|
+
forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
27715
|
+
editor.s.setCursorIn(p);
|
|
27716
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
|
|
27717
|
+
editor.synchronizeValues();
|
|
27718
|
+
}, 1);
|
|
27719
|
+
}
|
|
27679
27720
|
onDblClickEditor(e) {
|
|
27680
27721
|
const editor = this.j;
|
|
27681
27722
|
if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
|
|
27682
|
-
const editorBound = (0,
|
|
27723
|
+
const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
|
|
27683
27724
|
const top = e.pageY - editor.ew.scrollX;
|
|
27684
27725
|
const p = editor.createInside.element(editor.o.enter);
|
|
27685
27726
|
if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
|
|
27686
|
-
|
|
27727
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
27687
27728
|
} else {
|
|
27688
|
-
|
|
27729
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p);
|
|
27689
27730
|
}
|
|
27690
27731
|
editor.s.setCursorIn(p);
|
|
27691
27732
|
editor.synchronizeValues();
|
|
@@ -27699,27 +27740,27 @@ const ns = 'addnewline';
|
|
|
27699
27740
|
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
27700
27741
|
// host, so the lookup must start from the shadow root
|
|
27701
27742
|
let currentElement = ((_editor_o_shadowRoot = editor.o.shadowRoot) !== null && _editor_o_shadowRoot !== void 0 ? _editor_o_shadowRoot : editor.ed).elementFromPoint(e.clientX, e.clientY);
|
|
27702
|
-
if (!
|
|
27743
|
+
if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isHTMLElement(currentElement) || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isOrContains(editor.editor, currentElement)) {
|
|
27703
27744
|
return;
|
|
27704
27745
|
}
|
|
27705
27746
|
if (editor.editor !== currentElement && !this.__isMatchedTag(currentElement)) {
|
|
27706
|
-
currentElement =
|
|
27747
|
+
currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
|
|
27707
27748
|
}
|
|
27708
27749
|
if (!currentElement) {
|
|
27709
27750
|
this.__hide();
|
|
27710
27751
|
return;
|
|
27711
27752
|
}
|
|
27712
27753
|
if (this.__isMatchedTag(currentElement)) {
|
|
27713
|
-
const parentBox =
|
|
27754
|
+
const parentBox = jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.up(currentElement, jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock, editor.editor);
|
|
27714
27755
|
if (parentBox && parentBox !== editor.editor) {
|
|
27715
27756
|
currentElement = parentBox;
|
|
27716
27757
|
}
|
|
27717
27758
|
}
|
|
27718
|
-
const pos = (0,
|
|
27759
|
+
const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(currentElement, this.j);
|
|
27719
27760
|
let top = false;
|
|
27720
27761
|
let { clientY, clientX } = e;
|
|
27721
27762
|
if (this.j.iframe) {
|
|
27722
|
-
const { top, left } = (0,
|
|
27763
|
+
const { top, left } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(this.j.iframe, this.j, true);
|
|
27723
27764
|
clientY += top;
|
|
27724
27765
|
clientX += left;
|
|
27725
27766
|
}
|
|
@@ -27732,8 +27773,8 @@ const ns = 'addnewline';
|
|
|
27732
27773
|
this.__isBeforeContent = false;
|
|
27733
27774
|
}
|
|
27734
27775
|
const isEditor = editor.editor === currentElement;
|
|
27735
|
-
if (top !== false && (isEditor && !this.__isBeforeContent || !isEditor && !(0,
|
|
27736
|
-
(0,
|
|
27776
|
+
if (top !== false && (isEditor && !this.__isBeforeContent || !isEditor && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.call)(this.__isBeforeContent ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prev : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.next, currentElement, this.__canGetFocus, editor.editor))) {
|
|
27777
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(this.__line, 'top', top);
|
|
27737
27778
|
this.__current = currentElement;
|
|
27738
27779
|
this.__show();
|
|
27739
27780
|
this.__line.style.setProperty('--jd-anl-handle-offset', clientX - pos.left - 10 + 'px');
|
|
@@ -27745,7 +27786,7 @@ const ns = 'addnewline';
|
|
|
27745
27786
|
/** @override */ beforeDestruct() {
|
|
27746
27787
|
this.j.async.clearTimeout(this.__timeout);
|
|
27747
27788
|
this.j.e.off(this.__line).off('changePlace', this.__addEventListeners);
|
|
27748
|
-
|
|
27789
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(this.__line);
|
|
27749
27790
|
this.j.e.off([
|
|
27750
27791
|
this.j.ow,
|
|
27751
27792
|
this.j.ew,
|
|
@@ -27753,31 +27794,31 @@ const ns = 'addnewline';
|
|
|
27753
27794
|
], '.' + ns).off(this.j.container, '.' + ns).off('.' + ns);
|
|
27754
27795
|
}
|
|
27755
27796
|
constructor(...args){
|
|
27756
|
-
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__line", this.j.c.fromHTML(`<div role="button" tabindex="-1" title="${this.j.i18n('Break')}" class="jodit-add-new-line"><span>${
|
|
27797
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__line", this.j.c.fromHTML(`<div role="button" tabindex="-1" title="${this.j.i18n('Break')}" class="jodit-add-new-line"><span>${jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Icon.get('enter')}</span></div>`)), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isMatchedTag", (node)=>Boolean(node && this.j.o.addNewLineTagsTriggers.includes(node.nodeName.toLowerCase()))), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__timeout", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isBeforeContent", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__current", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__lineInFocus", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isShown", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideForce", ()=>{
|
|
27757
27798
|
if (!this.__isShown) {
|
|
27758
27799
|
return;
|
|
27759
27800
|
}
|
|
27760
27801
|
this.__isShown = false;
|
|
27761
27802
|
this.j.async.clearTimeout(this.__timeout);
|
|
27762
27803
|
this.__lineInFocus = false;
|
|
27763
|
-
|
|
27804
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(this.__line);
|
|
27764
27805
|
this.__line.style.setProperty('--jd-anl-handle-offset', '0');
|
|
27765
27806
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__canGetFocus", (elm)=>{
|
|
27766
|
-
return elm != null &&
|
|
27807
|
+
return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
|
|
27767
27808
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
|
|
27768
27809
|
const editor = this.j;
|
|
27769
27810
|
const p = editor.createInside.element(editor.o.enter);
|
|
27770
27811
|
if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
|
|
27771
27812
|
if (this.__current === editor.editor) {
|
|
27772
|
-
|
|
27813
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
27773
27814
|
} else {
|
|
27774
|
-
|
|
27815
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.before(this.__current, p);
|
|
27775
27816
|
}
|
|
27776
27817
|
} else {
|
|
27777
|
-
|
|
27818
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p);
|
|
27778
27819
|
}
|
|
27779
27820
|
editor.s.setCursorIn(p);
|
|
27780
|
-
(0,
|
|
27821
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
|
|
27781
27822
|
editor.synchronizeValues();
|
|
27782
27823
|
this.__hideForce();
|
|
27783
27824
|
e.preventDefault();
|
|
@@ -27785,18 +27826,21 @@ const ns = 'addnewline';
|
|
|
27785
27826
|
}
|
|
27786
27827
|
}
|
|
27787
27828
|
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
27788
|
-
(0,
|
|
27829
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':lock')
|
|
27789
27830
|
], addNewLine.prototype, "onLock", null);
|
|
27790
27831
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
27791
|
-
|
|
27832
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
27792
27833
|
], addNewLine.prototype, "__hide", null);
|
|
27793
27834
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
27794
|
-
(0,
|
|
27835
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keydown')
|
|
27836
|
+
], addNewLine.prototype, "onArrowKey", null);
|
|
27837
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
27838
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':dblclick')
|
|
27795
27839
|
], addNewLine.prototype, "onDblClickEditor", null);
|
|
27796
27840
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
27797
|
-
(0,
|
|
27841
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.throttle)((ctx)=>ctx.defaultTimeout)
|
|
27798
27842
|
], addNewLine.prototype, "__onMouseMove", null);
|
|
27799
|
-
|
|
27843
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('addNewLine', addNewLine);
|
|
27800
27844
|
|
|
27801
27845
|
|
|
27802
27846
|
/***/ }),
|
|
@@ -28367,6 +28411,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decor
|
|
|
28367
28411
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33831);
|
|
28368
28412
|
/* harmony import */ var _cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(89827);
|
|
28369
28413
|
/* harmony import */ var _cases__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17523);
|
|
28414
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(15200);
|
|
28370
28415
|
/*!
|
|
28371
28416
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
28372
28417
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -28385,6 +28430,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decor
|
|
|
28385
28430
|
|
|
28386
28431
|
|
|
28387
28432
|
|
|
28433
|
+
|
|
28388
28434
|
class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
28389
28435
|
afterInit(jodit) {
|
|
28390
28436
|
jodit.registerCommand('deleteButton', {
|
|
@@ -28462,14 +28508,50 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
|
28462
28508
|
throw e;
|
|
28463
28509
|
} finally{
|
|
28464
28510
|
jodit.e.fire('backSpaceAfterDelete', backspace, fakeNode);
|
|
28511
|
+
this.moveCaretToTextBefore(fakeNode);
|
|
28465
28512
|
this.safeRemoveEmptyNode(fakeNode);
|
|
28466
28513
|
}
|
|
28467
28514
|
return false;
|
|
28468
28515
|
}
|
|
28516
|
+
/**
|
|
28517
|
+
* The browser types at the end of the text before the caret on its line,
|
|
28518
|
+
* in that text's formatting, but not inside a link. Moving the caret there
|
|
28519
|
+
* too makes a paste and the toolbar agree with what's typed:
|
|
28520
|
+
* `<p>one</p><p><b>|two</b></p>` joins to `<p>one|<b>two</b></p>`
|
|
28521
|
+
*/ moveCaretToTextBefore(fakeNode) {
|
|
28522
|
+
var _ref;
|
|
28523
|
+
var _text_nodeValue;
|
|
28524
|
+
const { jodit } = this;
|
|
28525
|
+
const { range } = jodit.s;
|
|
28526
|
+
// A case may have merged the fake node away (#1722)
|
|
28527
|
+
if (!fakeNode.parentNode) {
|
|
28528
|
+
return;
|
|
28529
|
+
}
|
|
28530
|
+
const around = jodit.ed.createRange();
|
|
28531
|
+
around.selectNode(fakeNode);
|
|
28532
|
+
if (!range.collapsed || !around.isPointInRange(range.startContainer, range.startOffset)) {
|
|
28533
|
+
return;
|
|
28534
|
+
}
|
|
28535
|
+
const text = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.findMostNestedNeighbor)(fakeNode, false, jodit.editor, true);
|
|
28536
|
+
const link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(text, 'a', jodit.editor);
|
|
28537
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(text) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isContentEditable(text, jodit.editor) || link && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(link, fakeNode) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(text, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, jodit.editor) !== jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(fakeNode, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, jodit.editor)) {
|
|
28538
|
+
return;
|
|
28539
|
+
}
|
|
28540
|
+
range.setStart(text, (_ref = (_text_nodeValue = text.nodeValue) === null || _text_nodeValue === void 0 ? void 0 : _text_nodeValue.length) !== null && _ref !== void 0 ? _ref : 0);
|
|
28541
|
+
range.collapse(true);
|
|
28542
|
+
jodit.s.selectRange(range);
|
|
28543
|
+
}
|
|
28469
28544
|
/**
|
|
28470
28545
|
* Remove node and replace cursor position out of it
|
|
28471
28546
|
*/ safeRemoveEmptyNode(fakeNode) {
|
|
28547
|
+
var _fakeNode_nodeValue;
|
|
28472
28548
|
const { range } = this.j.s;
|
|
28549
|
+
// wrap-nodes normalizes the line it wraps, which can merge the text
|
|
28550
|
+
// after the fake node into it: remove only the fake node's own space
|
|
28551
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(fakeNode) && fakeNode.nodeValue !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.INVISIBLE_SPACE && ((_fakeNode_nodeValue = fakeNode.nodeValue) === null || _fakeNode_nodeValue === void 0 ? void 0 : _fakeNode_nodeValue.startsWith(jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.INVISIBLE_SPACE))) {
|
|
28552
|
+
fakeNode.deleteData(0, jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.INVISIBLE_SPACE.length);
|
|
28553
|
+
return;
|
|
28554
|
+
}
|
|
28473
28555
|
if (range.startContainer === fakeNode) {
|
|
28474
28556
|
if (fakeNode.previousSibling) {
|
|
28475
28557
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(fakeNode.previousSibling)) {
|
|
@@ -28543,6 +28625,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28543
28625
|
return false;
|
|
28544
28626
|
}
|
|
28545
28627
|
const sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
|
|
28628
|
+
if (moveInlinesInside(jodit, fakeNode, sibling)) {
|
|
28629
|
+
return joinNeighbors(jodit, fakeNode, backspace, moved);
|
|
28630
|
+
}
|
|
28546
28631
|
// A line break before the cursor is a single unit: remove it instead of
|
|
28547
28632
|
// merging the current element into the (void) `<br>`, which used to move
|
|
28548
28633
|
// the whole element's content into the `<br>` and delete it (#1282).
|
|
@@ -28557,6 +28642,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28557
28642
|
jodit.s.setCursorBefore(fakeNode);
|
|
28558
28643
|
return true;
|
|
28559
28644
|
}
|
|
28645
|
+
// A non-editable sibling is removed by remove-not-editable, never joined
|
|
28646
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(sibling) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, jodit.editor)) {
|
|
28647
|
+
return false;
|
|
28648
|
+
}
|
|
28560
28649
|
const box = findCaretBox(fakeNode, mainClosestBox);
|
|
28561
28650
|
// One pass only: the line now sits beside the next one, so the
|
|
28562
28651
|
// cases below join them. The DOM has changed either way
|
|
@@ -28585,6 +28674,60 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
28585
28674
|
}
|
|
28586
28675
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
|
|
28587
28676
|
}
|
|
28677
|
+
/**
|
|
28678
|
+
* With an inline element round the caret's line or the one it joins moved
|
|
28679
|
+
* inside its blocks, the cases join the lines as they join any two, and its
|
|
28680
|
+
* styles stay with its text. One round both lines is left as it is.
|
|
28681
|
+
*/ function moveInlinesInside(jodit, fakeNode, sibling) {
|
|
28682
|
+
if (!sibling) {
|
|
28683
|
+
return false;
|
|
28684
|
+
}
|
|
28685
|
+
const around = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(fakeNode, (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(node, sibling), jodit.editor);
|
|
28686
|
+
return moveInlineInside(around, jodit.editor) || moveInlineInside(sibling, jodit.editor);
|
|
28687
|
+
}
|
|
28688
|
+
/**
|
|
28689
|
+
* Old content can have an inline element round blocks. This moves it inside
|
|
28690
|
+
* them, and gives the text, images and line breaks beside them a copy of
|
|
28691
|
+
* their own: `<span style="…"><p>one</p><br><p>two</p></span>` becomes
|
|
28692
|
+
* `<p><span style="…">one</span></p><span style="…"><br></span><p><span style="…">two</span></p>`
|
|
28693
|
+
*/ function moveInlineInside(node, root) {
|
|
28694
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node)) {
|
|
28695
|
+
return false;
|
|
28696
|
+
}
|
|
28697
|
+
// Embedded content, such as the `<iframe>` in a video's wrapper, counts
|
|
28698
|
+
// as a block in `Dom.isBlock`, but stays with the text beside it
|
|
28699
|
+
const isBlock = (child)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(child) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NO_EMPTY_TAGS);
|
|
28700
|
+
// The inner one first: `<span><strong><p>one</p></strong></span>`
|
|
28701
|
+
Array.from(node.childNodes).forEach((child)=>moveInlineInside(child, root));
|
|
28702
|
+
const children = Array.from(node.childNodes);
|
|
28703
|
+
if (!children.some(isBlock)) {
|
|
28704
|
+
return false;
|
|
28705
|
+
}
|
|
28706
|
+
let run = null;
|
|
28707
|
+
for (const child of children){
|
|
28708
|
+
if (!isBlock(child)) {
|
|
28709
|
+
// Blank text between blocks stays where it is
|
|
28710
|
+
if (!run && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child)) {
|
|
28711
|
+
run = node.cloneNode(false);
|
|
28712
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(child, run);
|
|
28713
|
+
}
|
|
28714
|
+
run && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(run, child);
|
|
28715
|
+
continue;
|
|
28716
|
+
}
|
|
28717
|
+
run = null;
|
|
28718
|
+
// Nothing goes inside a rule or a non-editable block
|
|
28719
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(child, root)) {
|
|
28720
|
+
continue;
|
|
28721
|
+
}
|
|
28722
|
+
const inner = node.cloneNode(false);
|
|
28723
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(child, inner);
|
|
28724
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(child, inner);
|
|
28725
|
+
// A list or a table: on down to its items or cells
|
|
28726
|
+
moveInlineInside(inner, root);
|
|
28727
|
+
}
|
|
28728
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap(node);
|
|
28729
|
+
return true;
|
|
28730
|
+
}
|
|
28588
28731
|
/**
|
|
28589
28732
|
* The innermost block on the sibling's edge facing the caret, so the
|
|
28590
28733
|
* content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
|
|
@@ -28945,7 +29088,9 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode, stopBeforeSpace = fal
|
|
|
28945
29088
|
while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(sibling)){
|
|
28946
29089
|
sibling = backspace ? sibling === null || sibling === void 0 ? void 0 : sibling.lastChild : sibling === null || sibling === void 0 ? void 0 : sibling.firstChild;
|
|
28947
29090
|
}
|
|
28948
|
-
|
|
29091
|
+
// A block inside an inline element, such as the `<p>` in
|
|
29092
|
+
// `<span><p>…</p></span>`, isn't a char: the join cases handle it
|
|
29093
|
+
if (!sibling || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(sibling)) {
|
|
28949
29094
|
break;
|
|
28950
29095
|
}
|
|
28951
29096
|
if ((_sibling_nodeValue = sibling.nodeValue) === null || _sibling_nodeValue === void 0 ? void 0 : _sibling_nodeValue.length) {
|
|
@@ -29094,6 +29239,7 @@ function isSpace(char) {
|
|
|
29094
29239
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
|
|
29095
29240
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
|
|
29096
29241
|
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42259);
|
|
29242
|
+
/* harmony import */ var _check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26106);
|
|
29097
29243
|
/*!
|
|
29098
29244
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29099
29245
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -29103,23 +29249,48 @@ function isSpace(char) {
|
|
|
29103
29249
|
*/
|
|
29104
29250
|
|
|
29105
29251
|
|
|
29252
|
+
|
|
29106
29253
|
/**
|
|
29107
|
-
* Checks if a non-editable element can be deleted
|
|
29254
|
+
* Checks if a non-editable element can be deleted. A non-editable block goes
|
|
29255
|
+
* whole, and the lines either side of it then join, as the spec's tests do:
|
|
29256
|
+
* `<ul><li>one|</li></ul><div contenteditable="false">x</div><p>two</p>`
|
|
29257
|
+
* gives `<ul><li>one|two</li></ul>`
|
|
29108
29258
|
* @private
|
|
29109
29259
|
*/ function checkRemoveContentNotEditable(jodit, fakeNode, backspace) {
|
|
29110
|
-
let
|
|
29111
|
-
|
|
29112
|
-
|
|
29113
|
-
|
|
29114
|
-
|
|
29115
|
-
|
|
29116
|
-
|
|
29117
|
-
|
|
29118
|
-
(
|
|
29260
|
+
let node = fakeNode;
|
|
29261
|
+
let neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
|
|
29262
|
+
// Past the edges of the blocks the caret is at, but not into a table cell
|
|
29263
|
+
while(!neighbor && node.parentElement && node.parentElement !== jodit.editor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell(node.parentElement)){
|
|
29264
|
+
node = node.parentElement;
|
|
29265
|
+
neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
|
|
29266
|
+
// At the start of a list item, Backspace takes the bullet off first,
|
|
29267
|
+
// unless the item before it is a non-editable one to remove
|
|
29268
|
+
if (backspace && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(node) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(neighbor) && isNotEditable(jodit, neighbor))) {
|
|
29269
|
+
return false;
|
|
29270
|
+
}
|
|
29271
|
+
}
|
|
29272
|
+
if (isNotEditable(jodit, neighbor)) {
|
|
29273
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(neighbor)) {
|
|
29274
|
+
// Backspace after a removed list item leaves the items apart: the
|
|
29275
|
+
// next press takes the bullet off, as for any later item
|
|
29276
|
+
const joinLines = !(backspace && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(neighbor));
|
|
29277
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
|
|
29278
|
+
if (joinLines) {
|
|
29279
|
+
(0,_check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__.checkJoinNeighbors)(jodit, fakeNode, backspace);
|
|
29280
|
+
}
|
|
29281
|
+
} else {
|
|
29282
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before : jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after, neighbor, fakeNode);
|
|
29283
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
|
|
29284
|
+
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__.moveNodeInsideStart)(jodit, fakeNode, backspace);
|
|
29285
|
+
}
|
|
29286
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
|
|
29119
29287
|
return true;
|
|
29120
29288
|
}
|
|
29121
29289
|
return false;
|
|
29122
29290
|
}
|
|
29291
|
+
function isNotEditable(jodit, node) {
|
|
29292
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isContentEditable(node, jodit.editor);
|
|
29293
|
+
}
|
|
29123
29294
|
|
|
29124
29295
|
|
|
29125
29296
|
/***/ }),
|
|
@@ -48896,12 +49067,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
|
|
|
48896
49067
|
"use strict";
|
|
48897
49068
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
48898
49069
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
48899
|
-
/* harmony import */ var
|
|
48900
|
-
/* harmony import */ var
|
|
48901
|
-
/* harmony import */ var
|
|
48902
|
-
/* harmony import */ var
|
|
48903
|
-
/* harmony import */ var
|
|
48904
|
-
/* harmony import */ var
|
|
49070
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
49071
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
49072
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27795);
|
|
49073
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
49074
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85932);
|
|
49075
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
|
|
49076
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(86038);
|
|
48905
49077
|
/*!
|
|
48906
49078
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
48907
49079
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -48918,9 +49090,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
|
|
|
48918
49090
|
|
|
48919
49091
|
|
|
48920
49092
|
|
|
49093
|
+
|
|
48921
49094
|
/**
|
|
48922
49095
|
* Wrap single text nodes in block wrapper
|
|
48923
|
-
*/ class wrapNodes extends
|
|
49096
|
+
*/ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
|
|
48924
49097
|
/** @override **/ afterInit(jodit) {
|
|
48925
49098
|
if (jodit.o.enter.toLowerCase() === 'br') {
|
|
48926
49099
|
return;
|
|
@@ -48949,10 +49122,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
|
|
|
48949
49122
|
}
|
|
48950
49123
|
isChanged = true;
|
|
48951
49124
|
const box = jodit.createInside.element(jodit.o.enter);
|
|
48952
|
-
|
|
48953
|
-
|
|
49125
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(child, box);
|
|
49126
|
+
// `exclude` keeps a <br> from starting a box, but one between loose lines stays with them
|
|
49127
|
+
while(child && (this.isSuitable(child) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(child, 'br'))){
|
|
48954
49128
|
const next = child.nextSibling;
|
|
48955
|
-
|
|
49129
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(box, child);
|
|
48956
49130
|
child = next;
|
|
48957
49131
|
}
|
|
48958
49132
|
box.normalize();
|
|
@@ -48976,8 +49150,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
|
|
|
48976
49150
|
}
|
|
48977
49151
|
const box = jodit.createInside.element(jodit.o.enter);
|
|
48978
49152
|
const br = jodit.createInside.element('br');
|
|
48979
|
-
|
|
48980
|
-
|
|
49153
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(box, br);
|
|
49154
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(jodit.editor, box);
|
|
48981
49155
|
if (jodit.s.isFocused() || jodit.e.current === 'backSpaceAfterDelete') {
|
|
48982
49156
|
jodit.s.setCursorBefore(br);
|
|
48983
49157
|
}
|
|
@@ -48988,30 +49162,41 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
|
|
|
48988
49162
|
* Found Node which should be wrapped
|
|
48989
49163
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isSuitableStart", (n)=>{
|
|
48990
49164
|
var _n_parentNode;
|
|
48991
|
-
return
|
|
49165
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isText(n) && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(n.nodeValue) && (/[^\s]/.test(n.nodeValue) || ((_n_parentNode = n.parentNode) === null || _n_parentNode === void 0 ? void 0 : _n_parentNode.firstChild) === n && this.isSuitable(n.nextSibling)) || this.isNotWrapped(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTemporary(n);
|
|
48992
49166
|
}), /**
|
|
48993
49167
|
* Node should add in a block element
|
|
48994
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isSuitable", (n)=>
|
|
49168
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isSuitable", (n)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isText(n) || this.isNotWrapped(n)), /**
|
|
48995
49169
|
* Some element which needs to append in block
|
|
48996
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isNotWrapped", (n)=>
|
|
49170
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isNotWrapped", (n)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(n) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(n) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(n, this.j.o.wrapNodes.exclude) || holdsBlock(n)));
|
|
48997
49171
|
}
|
|
48998
49172
|
}
|
|
48999
49173
|
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
49000
|
-
|
|
49174
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
49001
49175
|
], wrapNodes.prototype, "postProcessSetEditorValue", null);
|
|
49002
49176
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
49003
|
-
|
|
49177
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
49004
49178
|
], wrapNodes.prototype, "preprocessInput", null);
|
|
49179
|
+
/**
|
|
49180
|
+
* A block can't go in a paragraph, so neither can an element that holds one,
|
|
49181
|
+
* such as a `<span>` round a `<p>`. Embedded content such as an `<iframe>` can.
|
|
49182
|
+
*/ function holdsBlock(elm) {
|
|
49183
|
+
for (const node of jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.eachGen(elm)){
|
|
49184
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(node) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NO_EMPTY_TAGS)) {
|
|
49185
|
+
return true;
|
|
49186
|
+
}
|
|
49187
|
+
}
|
|
49188
|
+
return false;
|
|
49189
|
+
}
|
|
49005
49190
|
function checkAloneListLeaf(child, jodit) {
|
|
49006
49191
|
let result = child;
|
|
49007
49192
|
let next = child;
|
|
49008
49193
|
do {
|
|
49009
|
-
if (
|
|
49010
|
-
const nextChild =
|
|
49011
|
-
if (
|
|
49012
|
-
|
|
49194
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(next) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isLeaf(next) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isList(next.parentElement)) {
|
|
49195
|
+
const nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(next, false);
|
|
49196
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(result, 'ul')) {
|
|
49197
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(result, next);
|
|
49013
49198
|
} else {
|
|
49014
|
-
result =
|
|
49199
|
+
result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(next, 'ul', jodit.createInside);
|
|
49015
49200
|
}
|
|
49016
49201
|
next = nextChild;
|
|
49017
49202
|
} else {
|
|
@@ -49020,7 +49205,7 @@ function checkAloneListLeaf(child, jodit) {
|
|
|
49020
49205
|
}while (next)
|
|
49021
49206
|
return result;
|
|
49022
49207
|
}
|
|
49023
|
-
|
|
49208
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('wrapNodes', wrapNodes);
|
|
49024
49209
|
|
|
49025
49210
|
|
|
49026
49211
|
/***/ }),
|