jodit-pro-react 5.5.85 → 5.5.87
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.
|
@@ -193,7 +193,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
|
|
|
193
193
|
var init_constants = __esm({
|
|
194
194
|
"node_modules/jodit/esm/core/constants.js"() {
|
|
195
195
|
"use strict";
|
|
196
|
-
APP_VERSION = "4.13.
|
|
196
|
+
APP_VERSION = "4.13.24";
|
|
197
197
|
ES = "es2020";
|
|
198
198
|
IS_ES_MODERN = true;
|
|
199
199
|
IS_ES_NEXT = true;
|
|
@@ -17710,7 +17710,7 @@ var WRAP_NODES = /* @__PURE__ */ new Set([
|
|
|
17710
17710
|
]);
|
|
17711
17711
|
function findOrCreateWrapper(commitStyle, font2, jodit) {
|
|
17712
17712
|
if (commitStyle.elementIsBlock) {
|
|
17713
|
-
const box = Dom.up(font2, (node) => Dom.isBlock(node) && !Dom.isTag(node, WRAP_NODES), jodit.editor);
|
|
17713
|
+
const box = Dom.up(font2, (node) => Dom.isBlock(node) && !Dom.isTag(node, WRAP_NODES) && !hasBlockChildren(node), jodit.editor);
|
|
17714
17714
|
if (box) {
|
|
17715
17715
|
return box;
|
|
17716
17716
|
}
|
|
@@ -17719,6 +17719,9 @@ function findOrCreateWrapper(commitStyle, font2, jodit) {
|
|
|
17719
17719
|
attr(font2, "size", null);
|
|
17720
17720
|
return font2;
|
|
17721
17721
|
}
|
|
17722
|
+
function hasBlockChildren(node) {
|
|
17723
|
+
return Array.from(node.childNodes).some((child) => Dom.isBlock(child));
|
|
17724
|
+
}
|
|
17722
17725
|
|
|
17723
17726
|
// node_modules/jodit/esm/core/selection/style/transactions.js
|
|
17724
17727
|
init_constants();
|
|
@@ -17860,10 +17863,15 @@ var transactions = {
|
|
|
17860
17863
|
},
|
|
17861
17864
|
[states.UNWRAP]: {
|
|
17862
17865
|
exec(value) {
|
|
17863
|
-
|
|
17866
|
+
const { element, style, jodit } = value;
|
|
17867
|
+
if (element.attributes.length && Dom.isTag(element, style.element)) {
|
|
17868
|
+
return __spreadProps(__spreadValues({}, value), { next: states.REPLACE_DEFAULT });
|
|
17869
|
+
}
|
|
17870
|
+
const parent = element.parentElement;
|
|
17871
|
+
if (style.elementIsBlock && !style.elementIsDefault && parent && parent !== jodit.editor && Dom.isBlock(parent) && !Dom.isTag(parent, WRAP_NODES)) {
|
|
17864
17872
|
return __spreadProps(__spreadValues({}, value), { next: states.REPLACE_DEFAULT });
|
|
17865
17873
|
}
|
|
17866
|
-
Dom.unwrap(
|
|
17874
|
+
Dom.unwrap(element);
|
|
17867
17875
|
return __spreadProps(__spreadValues({}, value), { mode: UNWRAP, next: states.END });
|
|
17868
17876
|
}
|
|
17869
17877
|
},
|
|
@@ -20485,7 +20493,7 @@ function fillEmptyParagraph(jodit, nodeElm, hadEffect) {
|
|
|
20485
20493
|
init_dom();
|
|
20486
20494
|
function removeEmptyTextNode(jodit, node, hadEffect, arg, argi, currentNode) {
|
|
20487
20495
|
if (Dom.isText(node) && !node.nodeValue) {
|
|
20488
|
-
if (node === currentNode && jodit.s.isCollapsed()) {
|
|
20496
|
+
if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
|
|
20489
20497
|
jodit.s.setCursorAfter(node);
|
|
20490
20498
|
}
|
|
20491
20499
|
Dom.safeRemove(node);
|
|
@@ -20509,7 +20517,7 @@ function removeInvTextNodes(jodit, node, hadEffect, arg, argi, currentNode) {
|
|
|
20509
20517
|
return hadEffect;
|
|
20510
20518
|
}
|
|
20511
20519
|
node.nodeValue = node.nodeValue.replace(INVISIBLE_SPACE_REG_EXP(), "");
|
|
20512
|
-
if (node === currentNode && jodit.s.isCollapsed()) {
|
|
20520
|
+
if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
|
|
20513
20521
|
jodit.s.setCursorAfter(node);
|
|
20514
20522
|
}
|
|
20515
20523
|
if (!node.nodeValue) {
|