jodit-pro-react 5.5.86 → 5.5.88

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-SVI4WAJA.mjs";
3
+ } from "./chunk-XKYSA3MW.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -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.23";
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
- if (value.element.attributes.length && Dom.isTag(value.element, value.style.element)) {
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(value.element);
17874
+ Dom.unwrap(element);
17867
17875
  return __spreadProps(__spreadValues({}, value), { mode: UNWRAP, next: states.END });
17868
17876
  }
17869
17877
  },
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-SVI4WAJA.mjs";
5
+ } from "./chunk-XKYSA3MW.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;