jodit 3.19.4 → 3.19.5
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/build/jodit.css +2 -2
- package/build/jodit.es2018.css +1 -1
- package/build/jodit.es2018.en.css +1 -1
- package/build/jodit.es2018.en.js +162 -84
- package/build/jodit.es2018.en.min.js +1 -1
- package/build/jodit.es2018.js +162 -84
- package/build/jodit.es2018.min.js +1 -1
- package/build/jodit.js +162 -84
- package/build/jodit.min.css +1 -1
- package/build/jodit.min.js +1 -1
- package/build/plugins/debug/debug.es2018.en.js +96 -0
- package/build/plugins/debug/debug.es2018.en.min.js +1 -0
- package/build/plugins/debug/debug.es2018.js +96 -0
- package/build/plugins/debug/debug.es2018.min.js +1 -0
- package/build/plugins/debug/debug.js +96 -0
- package/build/plugins/debug/debug.min.js +1 -0
- package/build/plugins/speech-recognize/speech-recognize.css +1 -1
- package/build/plugins/speech-recognize/speech-recognize.es2018.css +1 -1
- package/build/plugins/speech-recognize/speech-recognize.es2018.en.css +1 -1
- package/build/plugins/speech-recognize/speech-recognize.es2018.en.js +1 -1
- package/build/plugins/speech-recognize/speech-recognize.es2018.js +1 -1
- package/build/plugins/speech-recognize/speech-recognize.js +1 -1
- package/build/vdom.css +1 -1
- package/build/vdom.js +1 -1
- package/package.json +1 -1
- package/src/config.ts +2 -0
- package/src/core/dom/dom.test.js +0 -1
- package/src/core/dom/dom.ts +20 -8
- package/src/core/selection/select.ts +15 -5
- package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +5 -1
- package/src/core/selection/style/api/wrap-ordered-list.ts +5 -1
- package/src/core/selection/style/api/wrap-unwrapped-text.ts +1 -1
- package/src/core/view/panel.ts +1 -0
- package/src/core/view/view-with-toolbar.ts +2 -2
- package/src/core/view/view.ts +1 -4
- package/src/jodit.ts +4 -1
- package/src/modules/dialog/dialog.ts +26 -49
- package/src/modules/history/snapshot.ts +10 -1
- package/src/plugins/backspace/backspace.test.js +19 -18
- package/src/plugins/backspace/backspace.ts +10 -4
- package/src/plugins/backspace/cases/check-remove-char.ts +36 -14
- package/src/plugins/backspace/cases/check-remove-unbreakable-element.ts +8 -0
- package/src/plugins/clean-html/clean-html.test.js +240 -164
- package/src/plugins/clean-html/config.ts +10 -2
- package/src/plugins/clean-html/helpers/remove-format/remove-format-for-collapsed-selection.ts +3 -2
- package/src/plugins/clean-html/helpers/remove-format/remove-format-for-selection.ts +2 -2
- package/src/plugins/clean-html/helpers/visitor/filters/index.ts +1 -0
- package/src/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.ts +35 -0
- package/src/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.ts +2 -6
- package/src/plugins/clean-html/helpers/visitor/visit-node-walker.ts +5 -0
- package/src/plugins/debug/debug.ts +68 -0
- package/src/plugins/drag-and-drop-element/drag-and-drop-element.test.js +37 -34
- package/src/plugins/enter/enter.test.js +8 -7
- package/src/plugins/enter/helpers/check-br.ts +11 -1
- package/src/plugins/enter/helpers/split-fragment.ts +1 -0
- package/src/plugins/fullsize/fullsize.test.js +77 -12
- package/src/plugins/fullsize/fullsize.ts +12 -1
- package/src/plugins/line-height/line-height.svg +1 -1
- package/src/plugins/search/search.ts +1 -1
- package/src/plugins/select/config.ts +1 -1
- package/src/plugins/wrap-nodes/wrap-nodes.test.js +15 -4
- package/src/plugins/wrap-nodes/wrap-nodes.ts +29 -12
- package/src/types/view.d.ts +5 -5
- package/types/config.d.ts +1 -0
- package/types/core/dom/dom.d.ts +3 -2
- package/types/core/view/view-with-toolbar.d.ts +2 -2
- package/types/modules/dialog/dialog.d.ts +8 -10
- package/types/modules/history/snapshot.d.ts +1 -0
- package/types/plugins/clean-html/config.d.ts +7 -1
- package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.d.ts +13 -0
- package/types/types/view.d.ts +5 -5
package/build/jodit.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
4
|
-
* Version: v3.19.
|
|
4
|
+
* Version: v3.19.5
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
/*!
|
|
9
9
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
10
10
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
11
|
-
* Version: v3.19.
|
|
11
|
+
* Version: v3.19.5
|
|
12
12
|
* Url: https://xdsoft.net/jodit/
|
|
13
13
|
* License(s): MIT
|
|
14
14
|
*/
|
package/build/jodit.es2018.css
CHANGED
package/build/jodit.es2018.en.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/)
|
|
4
|
-
* Version: v3.19.
|
|
4
|
+
* Version: v3.19.5
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -281,7 +281,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
281
281
|
/***/ 7986:
|
|
282
282
|
/***/ (function(module) {
|
|
283
283
|
|
|
284
|
-
module.exports = "<svg
|
|
284
|
+
module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M5.09668 6.99707H7.17358L4.17358 3.99707L1.17358 6.99707H3.09668V17.0031H1.15881L4.15881 20.0031L7.15881 17.0031H5.09668V6.99707Z\"/> <path d=\"M22.8412 7H8.84119V5H22.8412V7Z\"/> <path d=\"M22.8412 11H8.84119V9H22.8412V11Z\"/> <path d=\"M8.84119 15H22.8412V13H8.84119V15Z\"/> <path d=\"M22.8412 19H8.84119V17H22.8412V19Z\"/> </svg>"
|
|
285
285
|
|
|
286
286
|
/***/ }),
|
|
287
287
|
|
|
@@ -1464,6 +1464,7 @@ var Config = (function () {
|
|
|
1464
1464
|
'dots',
|
|
1465
1465
|
'selectall'
|
|
1466
1466
|
];
|
|
1467
|
+
this.allowCommandsInReadOnly = ['selectall', 'preview', 'print'];
|
|
1467
1468
|
this.toolbarButtonSize = 'middle';
|
|
1468
1469
|
this.allowTabNavigation = false;
|
|
1469
1470
|
this.inline = false;
|
|
@@ -3113,7 +3114,7 @@ var Dom = (function () {
|
|
|
3113
3114
|
tag.appendChild(elm.firstChild);
|
|
3114
3115
|
}
|
|
3115
3116
|
}
|
|
3116
|
-
if (withAttributes) {
|
|
3117
|
+
if (withAttributes && Dom.isElement(elm) && Dom.isElement(tag)) {
|
|
3117
3118
|
(0, helpers_1.toArray)(elm.attributes).forEach(function (attr) {
|
|
3118
3119
|
tag.setAttribute(attr.name, attr.value);
|
|
3119
3120
|
});
|
|
@@ -3381,8 +3382,8 @@ var Dom = (function () {
|
|
|
3381
3382
|
}
|
|
3382
3383
|
return sibling && cond(sibling) ? sibling : null;
|
|
3383
3384
|
};
|
|
3384
|
-
Dom.findNotEmptySibling = function (node,
|
|
3385
|
-
return Dom.findSibling(node,
|
|
3385
|
+
Dom.findNotEmptySibling = function (node, left) {
|
|
3386
|
+
return Dom.findSibling(node, left, function (n) {
|
|
3386
3387
|
var _a;
|
|
3387
3388
|
return (!Dom.isEmptyTextNode(n) &&
|
|
3388
3389
|
Boolean(!Dom.isText(n) || (((_a = n.nodeValue) === null || _a === void 0 ? void 0 : _a.length) && (0, helpers_1.trim)(n.nodeValue))));
|
|
@@ -3517,6 +3518,11 @@ var Dom = (function () {
|
|
|
3517
3518
|
node.parentNode.removeChild(node);
|
|
3518
3519
|
});
|
|
3519
3520
|
};
|
|
3521
|
+
Dom.safeInsertNode = function (range, node) {
|
|
3522
|
+
range.collapsed || range.deleteContents();
|
|
3523
|
+
range.insertNode(node);
|
|
3524
|
+
[node.nextSibling, node.previousSibling].forEach(function (n) { return Dom.isText(n) && !n.nodeValue && Dom.safeRemove(n); });
|
|
3525
|
+
};
|
|
3520
3526
|
Dom.hide = function (node) {
|
|
3521
3527
|
if (!node) {
|
|
3522
3528
|
return;
|
|
@@ -9275,8 +9281,7 @@ var Select = (function () {
|
|
|
9275
9281
|
(_a = range.startContainer.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(node, range.startContainer);
|
|
9276
9282
|
}
|
|
9277
9283
|
else {
|
|
9278
|
-
|
|
9279
|
-
range.insertNode(node);
|
|
9284
|
+
dom_1.Dom.safeInsertNode(range, node);
|
|
9280
9285
|
}
|
|
9281
9286
|
}
|
|
9282
9287
|
else {
|
|
@@ -9514,7 +9519,7 @@ var Select = (function () {
|
|
|
9514
9519
|
fakeNode = this.j.createInside.text(consts.INVISIBLE_SPACE);
|
|
9515
9520
|
inStart ? range.setStartBefore(node) : range.setEndAfter(node);
|
|
9516
9521
|
range.collapse(inStart);
|
|
9517
|
-
|
|
9522
|
+
dom_1.Dom.safeInsertNode(range, fakeNode);
|
|
9518
9523
|
range.selectNode(fakeNode);
|
|
9519
9524
|
}
|
|
9520
9525
|
else {
|
|
@@ -9750,7 +9755,7 @@ var Select = (function () {
|
|
|
9750
9755
|
var br = this.j.createInside.element('br'), prevFake = this.j.createInside.text(constants_1.INVISIBLE_SPACE), nextFake = prevFake.cloneNode();
|
|
9751
9756
|
try {
|
|
9752
9757
|
if (cursorOnTheRight || cursorOnTheLeft) {
|
|
9753
|
-
|
|
9758
|
+
dom_1.Dom.safeInsertNode(range, br);
|
|
9754
9759
|
var clearBR = function (start, getNext) {
|
|
9755
9760
|
var next = getNext(start);
|
|
9756
9761
|
while (next) {
|
|
@@ -9782,8 +9787,13 @@ var Select = (function () {
|
|
|
9782
9787
|
leftRange.setEnd(range.startContainer, range.startOffset);
|
|
9783
9788
|
}
|
|
9784
9789
|
var fragment = leftRange.extractContents();
|
|
9790
|
+
var clearEmpties = function (node) {
|
|
9791
|
+
return dom_1.Dom.each(node, function (node) { return dom_1.Dom.isEmptyTextNode(node) && dom_1.Dom.safeRemove(node); });
|
|
9792
|
+
};
|
|
9785
9793
|
if (currentBox.parentNode) {
|
|
9786
9794
|
try {
|
|
9795
|
+
clearEmpties(fragment);
|
|
9796
|
+
clearEmpties(currentBox);
|
|
9787
9797
|
currentBox.parentNode.insertBefore(fragment, currentBox);
|
|
9788
9798
|
if (cursorOnTheRight && (br === null || br === void 0 ? void 0 : br.parentNode)) {
|
|
9789
9799
|
var range_2 = this.createRange();
|
|
@@ -9823,7 +9833,7 @@ var Select = (function () {
|
|
|
9823
9833
|
var fake = _this.j.createInside.fake();
|
|
9824
9834
|
var r = range.cloneRange();
|
|
9825
9835
|
r.collapse(start);
|
|
9826
|
-
|
|
9836
|
+
dom_1.Dom.safeInsertNode(r, fake);
|
|
9827
9837
|
(0, helpers_2.moveTheNodeAlongTheEdgeOutward)(fake, start, _this.j.editor);
|
|
9828
9838
|
return fake;
|
|
9829
9839
|
};
|
|
@@ -10591,7 +10601,7 @@ function wrapUnwrappedText(style, elm, jodit, getRange) {
|
|
|
10591
10601
|
var fragment = range.extractContents();
|
|
10592
10602
|
var wrapper = ci.element(style.element);
|
|
10593
10603
|
wrapper.appendChild(fragment);
|
|
10594
|
-
|
|
10604
|
+
dom_1.Dom.safeInsertNode(range, wrapper);
|
|
10595
10605
|
if (style.elementIsBlock) {
|
|
10596
10606
|
if (dom_1.Dom.isEmpty(wrapper) &&
|
|
10597
10607
|
!dom_1.Dom.isTag(wrapper.firstElementChild, 'br')) {
|
|
@@ -13344,7 +13354,7 @@ var Panel = (function (_super) {
|
|
|
13344
13354
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
13345
13355
|
}
|
|
13346
13356
|
Panel.prototype.dialog = function (options) {
|
|
13347
|
-
var dialog = new dialog_1.Dialog(tslib_1.__assign({ language: this.o.language, shadowRoot: this.o.shadowRoot, ownerWindow: this.o.ownerWindow, defaultTimeout: this.o.defaultTimeout, theme: this.o.theme }, options));
|
|
13357
|
+
var dialog = new dialog_1.Dialog(tslib_1.__assign({ language: this.o.language, shadowRoot: this.o.shadowRoot, ownerWindow: this.o.ownerWindow, defaultTimeout: this.o.defaultTimeout, theme: this.o.theme, globalFullSize: this.o.globalFullSize }, options));
|
|
13348
13358
|
(0, helpers_1.markOwner)(this, dialog.container);
|
|
13349
13359
|
return dialog.bindDestruct(this);
|
|
13350
13360
|
};
|
|
@@ -13555,7 +13565,7 @@ class View extends _modules__WEBPACK_IMPORTED_MODULE_3__.Component {
|
|
|
13555
13565
|
this.isView = true;
|
|
13556
13566
|
this.mods = {};
|
|
13557
13567
|
this.components = new Set();
|
|
13558
|
-
this.version = "3.19.
|
|
13568
|
+
this.version = "3.19.5";
|
|
13559
13569
|
this.buffer = _storage__WEBPACK_IMPORTED_MODULE_0__.Storage.makeStorage();
|
|
13560
13570
|
this.storage = _storage__WEBPACK_IMPORTED_MODULE_0__.Storage.makeStorage(true, this.componentName);
|
|
13561
13571
|
this.OPTIONS = View.defaultOptions;
|
|
@@ -13627,9 +13637,7 @@ class View extends _modules__WEBPACK_IMPORTED_MODULE_3__.Component {
|
|
|
13627
13637
|
return;
|
|
13628
13638
|
}
|
|
13629
13639
|
this.__isFullSize = isFullSize;
|
|
13630
|
-
|
|
13631
|
-
this.e.fire('toggleFullSize', isFullSize);
|
|
13632
|
-
}
|
|
13640
|
+
this.e.fire('toggleFullSize', isFullSize);
|
|
13633
13641
|
}
|
|
13634
13642
|
get isLocked() {
|
|
13635
13643
|
return this.__whoLocked !== '';
|
|
@@ -13652,10 +13660,10 @@ class View extends _modules__WEBPACK_IMPORTED_MODULE_3__.Component {
|
|
|
13652
13660
|
return this.__isFullSize;
|
|
13653
13661
|
}
|
|
13654
13662
|
getVersion() {
|
|
13655
|
-
return "3.19.
|
|
13663
|
+
return "3.19.5";
|
|
13656
13664
|
}
|
|
13657
13665
|
static getVersion() {
|
|
13658
|
-
return "3.19.
|
|
13666
|
+
return "3.19.5";
|
|
13659
13667
|
}
|
|
13660
13668
|
initOptions(options) {
|
|
13661
13669
|
this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(options || {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(this.options || {}, View.defaultOptions));
|
|
@@ -14221,7 +14229,8 @@ var Jodit = (function (_super) {
|
|
|
14221
14229
|
if (!this.s.isFocused()) {
|
|
14222
14230
|
this.s.focus();
|
|
14223
14231
|
}
|
|
14224
|
-
if (this.o.readonly &&
|
|
14232
|
+
if (this.o.readonly &&
|
|
14233
|
+
!this.o.allowCommandsInReadOnly.includes(command)) {
|
|
14225
14234
|
return;
|
|
14226
14235
|
}
|
|
14227
14236
|
var result;
|
|
@@ -14926,7 +14935,6 @@ config_1.Config.prototype.controls.dialog = {
|
|
|
14926
14935
|
icon: 'cancel',
|
|
14927
14936
|
exec: function (dialog) {
|
|
14928
14937
|
dialog.close();
|
|
14929
|
-
dialog.toggleFullSizeBox(false);
|
|
14930
14938
|
}
|
|
14931
14939
|
}
|
|
14932
14940
|
};
|
|
@@ -14936,7 +14944,6 @@ var Dialog = (function (_super) {
|
|
|
14936
14944
|
var _this = _super.call(this, options) || this;
|
|
14937
14945
|
_this.destroyAfterClose = false;
|
|
14938
14946
|
_this.moved = false;
|
|
14939
|
-
_this.iSetMaximization = false;
|
|
14940
14947
|
_this.resizable = false;
|
|
14941
14948
|
_this.draggable = false;
|
|
14942
14949
|
_this.startX = 0;
|
|
@@ -14984,12 +14991,12 @@ var Dialog = (function (_super) {
|
|
|
14984
14991
|
(0, helpers_1.assert)(dialogbox_footer != null, 'Footer element does not exist');
|
|
14985
14992
|
var dialogbox_toolbar = self.getElm('header-toolbar');
|
|
14986
14993
|
(0, helpers_1.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14994
|
+
_this.dialog = dialog;
|
|
14995
|
+
_this.resizer = resizer;
|
|
14996
|
+
_this.dialogbox_header = dialogbox_header;
|
|
14997
|
+
_this.dialogbox_content = dialogbox_content;
|
|
14998
|
+
_this.dialogbox_footer = dialogbox_footer;
|
|
14999
|
+
_this.dialogbox_toolbar = dialogbox_toolbar;
|
|
14993
15000
|
(0, helpers_1.css)(self.dialog, {
|
|
14994
15001
|
maxWidth: self.options.maxWidth,
|
|
14995
15002
|
minHeight: self.options.minHeight,
|
|
@@ -15204,21 +15211,12 @@ var Dialog = (function (_super) {
|
|
|
15204
15211
|
});
|
|
15205
15212
|
this.container.style.zIndex = (maxZIndex + 1).toString();
|
|
15206
15213
|
};
|
|
15207
|
-
Dialog.prototype.
|
|
15208
|
-
if ((0, helpers_1.isVoid)(
|
|
15209
|
-
|
|
15214
|
+
Dialog.prototype.toggleFullSize = function (isFullSize) {
|
|
15215
|
+
if ((0, helpers_1.isVoid)(isFullSize)) {
|
|
15216
|
+
isFullSize = !this.getMod('fullsize');
|
|
15210
15217
|
}
|
|
15211
|
-
this.setMod('fullsize',
|
|
15212
|
-
|
|
15213
|
-
this.iSetMaximization = condition;
|
|
15214
|
-
return condition;
|
|
15215
|
-
};
|
|
15216
|
-
Dialog.prototype.toggleFullSizeBox = function (condition) {
|
|
15217
|
-
[this.destination, this.destination.parentNode].forEach(function (box) {
|
|
15218
|
-
box &&
|
|
15219
|
-
box.classList &&
|
|
15220
|
-
box.classList.toggle('jodit_fullsize-box_true', condition);
|
|
15221
|
-
});
|
|
15218
|
+
this.setMod('fullsize', isFullSize);
|
|
15219
|
+
_super.prototype.toggleFullSize.call(this, isFullSize);
|
|
15222
15220
|
};
|
|
15223
15221
|
Dialog.prototype.open = function (contentOrClose, titleOrModal, destroyAfterClose, modal) {
|
|
15224
15222
|
global_1.eventEmitter.fire('closeAllPopups hideHelpers');
|
|
@@ -15247,7 +15245,7 @@ var Dialog = (function (_super) {
|
|
|
15247
15245
|
this.setPosition(this.offsetX, this.offsetY);
|
|
15248
15246
|
this.setMaxZIndex();
|
|
15249
15247
|
if (this.o.fullsize) {
|
|
15250
|
-
this.
|
|
15248
|
+
this.toggleFullSize(true);
|
|
15251
15249
|
}
|
|
15252
15250
|
this.e.fire('afterOpen', this);
|
|
15253
15251
|
return this;
|
|
@@ -15257,33 +15255,27 @@ var Dialog = (function (_super) {
|
|
|
15257
15255
|
this.setMod('modal', this.isModal);
|
|
15258
15256
|
return this;
|
|
15259
15257
|
};
|
|
15260
|
-
Dialog.prototype.close = function (
|
|
15261
|
-
var _a, _b;
|
|
15258
|
+
Dialog.prototype.close = function () {
|
|
15262
15259
|
if (this.isDestructed ||
|
|
15263
15260
|
!this.isOpened ||
|
|
15264
15261
|
this.getMod('static') === true) {
|
|
15265
15262
|
return this;
|
|
15266
15263
|
}
|
|
15267
|
-
if (e) {
|
|
15268
|
-
e.stopImmediatePropagation();
|
|
15269
|
-
e.preventDefault();
|
|
15270
|
-
}
|
|
15271
|
-
if (this.e && this.e.fire('beforeClose', this) === false) {
|
|
15264
|
+
if (this.e.fire('beforeClose', this) === false) {
|
|
15272
15265
|
return this;
|
|
15273
15266
|
}
|
|
15274
15267
|
this.setMod('active', false);
|
|
15275
15268
|
this.isOpened = false;
|
|
15276
|
-
this.
|
|
15277
|
-
|
|
15278
|
-
this.maximization(false);
|
|
15269
|
+
if (this.isFullSize) {
|
|
15270
|
+
this.toggleFullSize(false);
|
|
15279
15271
|
}
|
|
15280
15272
|
dom_1.Dom.safeRemove(this.container);
|
|
15281
15273
|
this.removeGlobalResizeListeners();
|
|
15282
15274
|
if (this.destroyAfterClose) {
|
|
15283
15275
|
this.destruct();
|
|
15284
15276
|
}
|
|
15285
|
-
|
|
15286
|
-
|
|
15277
|
+
this.e.fire(this, 'afterClose');
|
|
15278
|
+
this.e.fire(this.ow, 'joditCloseDialog');
|
|
15287
15279
|
return this;
|
|
15288
15280
|
};
|
|
15289
15281
|
Dialog.prototype.buildToolbar = function () {
|
|
@@ -17565,7 +17557,7 @@ var Snapshot = (function (_super) {
|
|
|
17565
17557
|
endOffset: 0
|
|
17566
17558
|
}
|
|
17567
17559
|
};
|
|
17568
|
-
snapshot.html = this.j.getNativeEditorValue();
|
|
17560
|
+
snapshot.html = this.removeJoditSelection(this.j.getNativeEditorValue());
|
|
17569
17561
|
var sel = this.j.s.sel;
|
|
17570
17562
|
if (sel && sel.rangeCount) {
|
|
17571
17563
|
var range = sel.getRangeAt(0), startContainer = this.calcHierarchyLadder(range.startContainer), endContainer = this.calcHierarchyLadder(range.endContainer);
|
|
@@ -17624,6 +17616,9 @@ var Snapshot = (function (_super) {
|
|
|
17624
17616
|
this.isBlocked = false;
|
|
17625
17617
|
_super.prototype.destruct.call(this);
|
|
17626
17618
|
};
|
|
17619
|
+
Snapshot.prototype.removeJoditSelection = function (nativeEditorValue) {
|
|
17620
|
+
return nativeEditorValue.replace(/<span[^>]*jodit-selection_marker[^>]*><\/span>/g, '');
|
|
17621
|
+
};
|
|
17627
17622
|
return Snapshot;
|
|
17628
17623
|
}(component_1.ViewComponent));
|
|
17629
17624
|
exports.Snapshot = Snapshot;
|
|
@@ -21169,14 +21164,17 @@ var backspace = (function (_super) {
|
|
|
21169
21164
|
var range = sel.range;
|
|
21170
21165
|
var fakeNode = jodit.createInside.text(constants_1.INVISIBLE_SPACE);
|
|
21171
21166
|
try {
|
|
21172
|
-
|
|
21167
|
+
dom_1.Dom.safeInsertNode(range, fakeNode);
|
|
21173
21168
|
if (!dom_1.Dom.isOrContains(jodit.editor, fakeNode)) {
|
|
21174
21169
|
return;
|
|
21175
21170
|
}
|
|
21176
21171
|
(0, helpers_2.moveNodeInsideStart)(jodit, fakeNode, backspace);
|
|
21177
21172
|
if (cases_1.cases.some(function (func) {
|
|
21178
|
-
|
|
21179
|
-
func(jodit, fakeNode, backspace, mode)
|
|
21173
|
+
if ((0, helpers_1.isFunction)(func) &&
|
|
21174
|
+
func(jodit, fakeNode, backspace, mode)) {
|
|
21175
|
+
if (false) {}
|
|
21176
|
+
return true;
|
|
21177
|
+
}
|
|
21180
21178
|
})) {
|
|
21181
21179
|
return false;
|
|
21182
21180
|
}
|
|
@@ -21373,6 +21371,18 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
21373
21371
|
var anotherSibling = dom_1.Dom.sibling(fakeNode, !backspace);
|
|
21374
21372
|
var sibling = dom_1.Dom.sibling(fakeNode, backspace), removeNeighbor = null;
|
|
21375
21373
|
var charRemoved = false, removed;
|
|
21374
|
+
var getNextInlineSibling = function (sibling) {
|
|
21375
|
+
var nextSibling = dom_1.Dom.sibling(sibling, backspace);
|
|
21376
|
+
if (!nextSibling &&
|
|
21377
|
+
sibling.parentNode &&
|
|
21378
|
+
sibling.parentNode !== jodit.editor) {
|
|
21379
|
+
nextSibling = (0, helpers_2.findMostNestedNeighbor)(sibling, !backspace, jodit.editor, true);
|
|
21380
|
+
}
|
|
21381
|
+
return nextSibling;
|
|
21382
|
+
};
|
|
21383
|
+
if (!sibling) {
|
|
21384
|
+
sibling = getNextInlineSibling(fakeNode);
|
|
21385
|
+
}
|
|
21376
21386
|
while (sibling && (dom_1.Dom.isText(sibling) || dom_1.Dom.isInlineBlock(sibling))) {
|
|
21377
21387
|
while (dom_1.Dom.isInlineBlock(sibling)) {
|
|
21378
21388
|
sibling = (backspace ? sibling === null || sibling === void 0 ? void 0 : sibling.lastChild : sibling === null || sibling === void 0 ? void 0 : sibling.firstChild);
|
|
@@ -21430,22 +21440,25 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
21430
21440
|
}
|
|
21431
21441
|
break;
|
|
21432
21442
|
}
|
|
21433
|
-
var nextSibling =
|
|
21434
|
-
if (!nextSibling &&
|
|
21435
|
-
sibling.parentNode &&
|
|
21436
|
-
sibling.parentNode !== jodit.editor) {
|
|
21437
|
-
nextSibling = (0, helpers_2.findMostNestedNeighbor)(sibling, !backspace, jodit.editor, true);
|
|
21438
|
-
}
|
|
21443
|
+
var nextSibling = getNextInlineSibling(sibling);
|
|
21439
21444
|
if (removeNeighbor) {
|
|
21440
21445
|
dom_1.Dom.safeRemove(removeNeighbor);
|
|
21441
21446
|
removeNeighbor = null;
|
|
21442
21447
|
}
|
|
21443
21448
|
sibling = nextSibling;
|
|
21444
21449
|
}
|
|
21450
|
+
if (removeNeighbor) {
|
|
21451
|
+
dom_1.Dom.safeRemove(removeNeighbor);
|
|
21452
|
+
removeNeighbor = null;
|
|
21453
|
+
}
|
|
21445
21454
|
if (charRemoved) {
|
|
21446
21455
|
removeEmptyInlineParent(fakeNode);
|
|
21447
21456
|
addBRInsideEmptyBlock(jodit, fakeNode);
|
|
21448
21457
|
jodit.s.setCursorBefore(fakeNode);
|
|
21458
|
+
if (dom_1.Dom.isTag(fakeNode.previousSibling, 'br') &&
|
|
21459
|
+
!dom_1.Dom.findNotEmptySibling(fakeNode, false)) {
|
|
21460
|
+
dom_1.Dom.after(fakeNode, jodit.createInside.element('br'));
|
|
21461
|
+
}
|
|
21449
21462
|
}
|
|
21450
21463
|
return charRemoved;
|
|
21451
21464
|
}
|
|
@@ -21613,6 +21626,10 @@ function checkRemoveUnbreakableElement(jodit, fakeNode, backspace) {
|
|
|
21613
21626
|
if (dom_1.Dom.isElement(neighbor) &&
|
|
21614
21627
|
(dom_1.Dom.isTag(neighbor, constants_1.INSEPARABLE_TAGS) || dom_1.Dom.isEmpty(neighbor))) {
|
|
21615
21628
|
dom_1.Dom.safeRemove(neighbor);
|
|
21629
|
+
if (dom_1.Dom.isTag(neighbor, 'br') &&
|
|
21630
|
+
!dom_1.Dom.findNotEmptySibling(fakeNode, false)) {
|
|
21631
|
+
dom_1.Dom.after(fakeNode, jodit.createInside.element('br'));
|
|
21632
|
+
}
|
|
21616
21633
|
jodit.s.setCursorBefore(fakeNode);
|
|
21617
21634
|
if (dom_1.Dom.isTag(neighbor, 'br')) {
|
|
21618
21635
|
(0, check_remove_empty_parent_1.checkRemoveEmptyParent)(jodit, fakeNode, backspace);
|
|
@@ -22144,7 +22161,8 @@ config_1.Config.prototype.cleanHTML = {
|
|
|
22144
22161
|
denyTags: false,
|
|
22145
22162
|
useIframeSandbox: false,
|
|
22146
22163
|
removeOnError: true,
|
|
22147
|
-
safeJavaScriptLink: true
|
|
22164
|
+
safeJavaScriptLink: true,
|
|
22165
|
+
disableCleanFilter: null
|
|
22148
22166
|
};
|
|
22149
22167
|
config_1.Config.prototype.controls.eraser = {
|
|
22150
22168
|
command: 'removeFormat',
|
|
@@ -22251,8 +22269,9 @@ function removeFormatForCollapsedSelection(jodit, fake) {
|
|
|
22251
22269
|
var fakeNode = fake;
|
|
22252
22270
|
if (!fakeNode) {
|
|
22253
22271
|
fakeNode = jodit.createInside.fake();
|
|
22254
|
-
s.range
|
|
22255
|
-
|
|
22272
|
+
var range = s.range;
|
|
22273
|
+
dom_1.Dom.safeInsertNode(range, fakeNode);
|
|
22274
|
+
range.collapse();
|
|
22256
22275
|
}
|
|
22257
22276
|
var mainInline = dom_1.Dom.furthest(fakeNode, isInlineBlock, jodit.editor);
|
|
22258
22277
|
if (mainInline) {
|
|
@@ -22300,8 +22319,8 @@ function removeFormatForSelection(jodit) {
|
|
|
22300
22319
|
var s = jodit.s, editor = jodit.editor, createInside = jodit.createInside, range = s.range, left = range.cloneRange(), right = range.cloneRange(), fakeLeft = createInside.fake(), fakeRight = createInside.fake();
|
|
22301
22320
|
left.collapse(true);
|
|
22302
22321
|
right.collapse(false);
|
|
22303
|
-
|
|
22304
|
-
|
|
22322
|
+
dom_1.Dom.safeInsertNode(left, fakeLeft);
|
|
22323
|
+
dom_1.Dom.safeInsertNode(right, fakeRight);
|
|
22305
22324
|
range.setStartBefore(fakeLeft);
|
|
22306
22325
|
range.collapse(true);
|
|
22307
22326
|
s.selectRange(range);
|
|
@@ -22425,10 +22444,39 @@ tslib_1.__exportStar(__webpack_require__(20544), exports);
|
|
|
22425
22444
|
tslib_1.__exportStar(__webpack_require__(47913), exports);
|
|
22426
22445
|
tslib_1.__exportStar(__webpack_require__(42954), exports);
|
|
22427
22446
|
tslib_1.__exportStar(__webpack_require__(19070), exports);
|
|
22447
|
+
tslib_1.__exportStar(__webpack_require__(4609), exports);
|
|
22428
22448
|
tslib_1.__exportStar(__webpack_require__(58909), exports);
|
|
22429
22449
|
tslib_1.__exportStar(__webpack_require__(39196), exports);
|
|
22430
22450
|
|
|
22431
22451
|
|
|
22452
|
+
/***/ }),
|
|
22453
|
+
|
|
22454
|
+
/***/ 4609:
|
|
22455
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22456
|
+
|
|
22457
|
+
"use strict";
|
|
22458
|
+
|
|
22459
|
+
/*!
|
|
22460
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
22461
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
22462
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
22463
|
+
*/
|
|
22464
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22465
|
+
exports.removeEmptyTextNode = void 0;
|
|
22466
|
+
var dom_1 = __webpack_require__(43887);
|
|
22467
|
+
function removeEmptyTextNode(jodit, node, hadEffect, arg, argi, currentNode) {
|
|
22468
|
+
if (dom_1.Dom.isText(node) && !node.nodeValue) {
|
|
22469
|
+
if (node === currentNode && jodit.s.isCollapsed()) {
|
|
22470
|
+
jodit.s.setCursorAfter(node);
|
|
22471
|
+
}
|
|
22472
|
+
dom_1.Dom.safeRemove(node);
|
|
22473
|
+
return true;
|
|
22474
|
+
}
|
|
22475
|
+
return hadEffect;
|
|
22476
|
+
}
|
|
22477
|
+
exports.removeEmptyTextNode = removeEmptyTextNode;
|
|
22478
|
+
|
|
22479
|
+
|
|
22432
22480
|
/***/ }),
|
|
22433
22481
|
|
|
22434
22482
|
/***/ 58909:
|
|
@@ -22446,14 +22494,10 @@ exports.removeInvTextNodes = void 0;
|
|
|
22446
22494
|
var constants_1 = __webpack_require__(10063);
|
|
22447
22495
|
var dom_1 = __webpack_require__(43887);
|
|
22448
22496
|
function removeInvTextNodes(jodit, node, hadEffect, arg, argi, currentNode) {
|
|
22449
|
-
if (!currentNode) {
|
|
22450
|
-
return hadEffect;
|
|
22451
|
-
}
|
|
22452
22497
|
if (!dom_1.Dom.isText(node) || node.nodeValue == null) {
|
|
22453
22498
|
return hadEffect;
|
|
22454
22499
|
}
|
|
22455
|
-
if ((0, constants_1.INVISIBLE_SPACE_REG_EXP)().test(node.nodeValue)
|
|
22456
|
-
node.nodeValue.replace((0, constants_1.INVISIBLE_SPACE_REG_EXP)(), '').length !== 0) {
|
|
22500
|
+
if ((0, constants_1.INVISIBLE_SPACE_REG_EXP)().test(node.nodeValue)) {
|
|
22457
22501
|
node.nodeValue = node.nodeValue.replace((0, constants_1.INVISIBLE_SPACE_REG_EXP)(), '');
|
|
22458
22502
|
if (node === currentNode && jodit.s.isCollapsed()) {
|
|
22459
22503
|
jodit.s.setCursorAfter(node);
|
|
@@ -22592,9 +22636,13 @@ var keys = Object.keys(filters);
|
|
|
22592
22636
|
function visitNodeWalker(jodit, nodeElm, allowTags, denyTags, currentSelectionNode) {
|
|
22593
22637
|
var e_1, _a;
|
|
22594
22638
|
var hadEffect = false;
|
|
22639
|
+
var dcf = jodit.o.cleanHTML.disableCleanFilter;
|
|
22595
22640
|
try {
|
|
22596
22641
|
for (var keys_1 = tslib_1.__values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
22597
22642
|
var key = keys_1_1.value;
|
|
22643
|
+
if (dcf && dcf.has(key)) {
|
|
22644
|
+
continue;
|
|
22645
|
+
}
|
|
22598
22646
|
var filter = filters[key];
|
|
22599
22647
|
var tmp = hadEffect;
|
|
22600
22648
|
hadEffect = filter(jodit, nodeElm, hadEffect, allowTags, denyTags, currentSelectionNode);
|
|
@@ -23587,7 +23635,14 @@ function checkBR(jodit, current, shiftKeyPressed) {
|
|
|
23587
23635
|
(shiftKeyPressed && !isMultiLineBlock) ||
|
|
23588
23636
|
(!shiftKeyPressed && isMultiLineBlock)) {
|
|
23589
23637
|
var br = jodit.createInside.element('br');
|
|
23590
|
-
jodit.s.insertNode(br,
|
|
23638
|
+
jodit.s.insertNode(br, false, false);
|
|
23639
|
+
if (!dom_1.Dom.findNotEmptySibling(br, false)) {
|
|
23640
|
+
dom_1.Dom.after(br, br.cloneNode());
|
|
23641
|
+
}
|
|
23642
|
+
var range = jodit.s.range;
|
|
23643
|
+
range.setStartAfter(br);
|
|
23644
|
+
range.collapse(true);
|
|
23645
|
+
jodit.s.selectRange(range);
|
|
23591
23646
|
(0, scroll_into_view_1.scrollIntoViewIfNeeded)(br, jodit.editor, jodit.ed);
|
|
23592
23647
|
return false;
|
|
23593
23648
|
}
|
|
@@ -24386,6 +24441,7 @@ var css_1 = __webpack_require__(56672);
|
|
|
24386
24441
|
var is_jodit_object_1 = __webpack_require__(47442);
|
|
24387
24442
|
var global_1 = __webpack_require__(58299);
|
|
24388
24443
|
__webpack_require__(53022);
|
|
24444
|
+
var fullsizeStack = new Set();
|
|
24389
24445
|
function fullsize(editor) {
|
|
24390
24446
|
editor.registerButton({
|
|
24391
24447
|
name: 'fullsize'
|
|
@@ -24427,7 +24483,13 @@ function fullsize(editor) {
|
|
|
24427
24483
|
editor.toolbarContainer.appendChild(editor.toolbar.container);
|
|
24428
24484
|
(0, css_1.css)(editor.toolbar.container, 'width', 'auto');
|
|
24429
24485
|
}
|
|
24430
|
-
|
|
24486
|
+
enable
|
|
24487
|
+
? fullsizeStack.add(container)
|
|
24488
|
+
: fullsizeStack.delete(container);
|
|
24489
|
+
var shouldToggleGlobalFullsize = editor.o.globalFullSize &&
|
|
24490
|
+
((fullsizeStack.size === 1 && enable) ||
|
|
24491
|
+
(fullsizeStack.size === 0 && !enable));
|
|
24492
|
+
if (shouldToggleGlobalFullsize) {
|
|
24431
24493
|
var node = container.parentNode;
|
|
24432
24494
|
while (node &&
|
|
24433
24495
|
node.nodeType !== Node.DOCUMENT_NODE &&
|
|
@@ -30332,7 +30394,7 @@ var search = (function (_super) {
|
|
|
30332
30394
|
rng.setEnd(bound.endContainer, bound.endOffset);
|
|
30333
30395
|
rng.deleteContents();
|
|
30334
30396
|
textNode = this.j.createInside.text(this.ui.replace);
|
|
30335
|
-
|
|
30397
|
+
dom_1.Dom.safeInsertNode(rng, textNode);
|
|
30336
30398
|
this.j.s.select(textNode);
|
|
30337
30399
|
this.tryScrollToElement(textNode);
|
|
30338
30400
|
this.cache = {};
|
|
@@ -31162,7 +31224,7 @@ global_1.pluginSystem.add('selectCells', selectCells);
|
|
|
31162
31224
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
31163
31225
|
var config_1 = __webpack_require__(27537);
|
|
31164
31226
|
config_1.Config.prototype.select = {
|
|
31165
|
-
normalizeSelectionBeforeCutAndCopy:
|
|
31227
|
+
normalizeSelectionBeforeCutAndCopy: false
|
|
31166
31228
|
};
|
|
31167
31229
|
|
|
31168
31230
|
|
|
@@ -33767,7 +33829,7 @@ var wrapNodes = (function (_super) {
|
|
|
33767
33829
|
}
|
|
33768
33830
|
var child = jodit.editor.firstChild, isChanged = false;
|
|
33769
33831
|
while (child) {
|
|
33770
|
-
this.checkAloneListLeaf(child, jodit);
|
|
33832
|
+
child = this.checkAloneListLeaf(child, jodit);
|
|
33771
33833
|
if (this.isSuitableStart(child)) {
|
|
33772
33834
|
if (!isChanged) {
|
|
33773
33835
|
jodit.s.save();
|
|
@@ -33781,6 +33843,7 @@ var wrapNodes = (function (_super) {
|
|
|
33781
33843
|
child = next;
|
|
33782
33844
|
}
|
|
33783
33845
|
box.normalize();
|
|
33846
|
+
child = box;
|
|
33784
33847
|
}
|
|
33785
33848
|
child = child && child.nextSibling;
|
|
33786
33849
|
}
|
|
@@ -33792,11 +33855,26 @@ var wrapNodes = (function (_super) {
|
|
|
33792
33855
|
}
|
|
33793
33856
|
};
|
|
33794
33857
|
wrapNodes.prototype.checkAloneListLeaf = function (child, jodit) {
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
dom_1.Dom.
|
|
33799
|
-
|
|
33858
|
+
var result = child;
|
|
33859
|
+
var next = child;
|
|
33860
|
+
do {
|
|
33861
|
+
if (dom_1.Dom.isElement(next) &&
|
|
33862
|
+
dom_1.Dom.isTag(next, 'li') &&
|
|
33863
|
+
!dom_1.Dom.isTag(next.parentElement, ['ul', 'ol'])) {
|
|
33864
|
+
var nextChild = dom_1.Dom.findNotEmptySibling(next, false);
|
|
33865
|
+
if (dom_1.Dom.isTag(result, 'ul')) {
|
|
33866
|
+
result.appendChild(next);
|
|
33867
|
+
}
|
|
33868
|
+
else {
|
|
33869
|
+
result = dom_1.Dom.wrap(next, 'ul', jodit.createInside);
|
|
33870
|
+
}
|
|
33871
|
+
next = nextChild;
|
|
33872
|
+
}
|
|
33873
|
+
else {
|
|
33874
|
+
break;
|
|
33875
|
+
}
|
|
33876
|
+
} while (next);
|
|
33877
|
+
return result;
|
|
33800
33878
|
};
|
|
33801
33879
|
tslib_1.__decorate([
|
|
33802
33880
|
decorators_1.autobind
|