@fileverse-dev/ddoc 2.0.6-patch-5 → 2.0.6-patch-6

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.
Files changed (2) hide show
  1. package/dist/index.es.js +26 -21
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -98932,28 +98932,33 @@ const Yg = ({
98932
98932
  const {
98933
98933
  selection: { $head: e, from: n },
98934
98934
  doc: r
98935
- } = t.state, i = e.node(e.depth - 1), o = e.toString().split("/"), a = o.some(
98936
- (c) => c.includes("bulletList_0") || c.includes("orderedList_0") || c.includes("taskList_0")
98935
+ } = t.state, i = e.node(e.depth - 1), s = e.node(e.depth - 2), a = e.toString().split("/"), l = a.some(
98936
+ (u) => u.includes("bulletList_0") || u.includes("orderedList_0") || u.includes("taskList_0")
98937
98937
  );
98938
98938
  if ((i == null ? void 0 : i.type.name) !== "dBlock") {
98939
- let c = !1, u = -1;
98940
- if (r.descendants((v, k) => {
98941
- if (u !== -1) return !1;
98942
- v.type.name === "pageBreak" && (c = !0, u = k);
98943
- }), c)
98939
+ let u = !1, f = -1;
98940
+ if (r.descendants((b, w) => {
98941
+ if (f !== -1) return !1;
98942
+ b.type.name === "pageBreak" && (u = !0, f = w);
98943
+ }), u)
98944
98944
  return !0;
98945
- const d = o.some(
98946
- (v) => v.includes("listItem_0") || v.includes("taskItem_0")
98947
- ) && o.some((v) => v.includes("paragraph_0:0")), p = o.some(
98948
- (v) => v.includes("dBlock_0")
98949
- ) && d && a, m = e.parent.content.size === 0 && o.some((v) => v.includes("paragraph_0:0")) && o.some(
98950
- (v) => v.includes("listItem_0") || v.includes("taskItem_0")
98951
- ) && a && o.length === 4, g = e.node(e.depth - 2).childCount > 1;
98952
- if (m) {
98953
- const v = e.before(e.depth - 2);
98954
- return g ? t.chain().deleteRange({
98955
- from: v + 1,
98956
- to: v + 1 + i.nodeSize
98945
+ const h = a.some(
98946
+ (b) => b.includes("listItem_0") || b.includes("taskItem_0")
98947
+ ) && a.some((b) => b.includes("paragraph_0:0")), p = s && ["bulletList", "orderedList", "taskList"].includes(
98948
+ s.type.name
98949
+ );
98950
+ if (h && p)
98951
+ return t.chain().liftListItem(i.type.name).focus().run();
98952
+ const g = a.some(
98953
+ (b) => b.includes("dBlock_0")
98954
+ ) && h && l, v = e.parent.content.size === 0 && a.some((b) => b.includes("paragraph_0:0")) && a.some(
98955
+ (b) => b.includes("listItem_0") || b.includes("taskItem_0")
98956
+ ) && l && a.length === 4, k = e.node(e.depth - 2).childCount > 1;
98957
+ if (v) {
98958
+ const b = e.before(e.depth - 2);
98959
+ return k ? t.chain().deleteRange({
98960
+ from: b + 1,
98961
+ to: b + 1 + i.nodeSize
98957
98962
  }).insertContentAt(n - 4, {
98958
98963
  type: "dBlock",
98959
98964
  content: [
@@ -98964,7 +98969,7 @@ const Yg = ({
98964
98969
  ]
98965
98970
  }).focus().run() : t.chain().liftListItem("listItem").focus().run();
98966
98971
  }
98967
- if (p && o.length === 4)
98972
+ if (g && a.length === 4)
98968
98973
  return t.chain().liftListItem("listItem").insertContentAt(n - 4, {
98969
98974
  type: "dBlock",
98970
98975
  content: [
@@ -98974,7 +98979,7 @@ const Yg = ({
98974
98979
  ]
98975
98980
  }).focus().run();
98976
98981
  }
98977
- return e.toString().includes("dBlock_0") && e.parent.content.size === 0 && !a ? t.chain().deleteNode("dBlock").focus().run() : !1;
98982
+ return e.toString().includes("dBlock_0") && e.parent.content.size === 0 && !l ? t.chain().deleteNode("dBlock").focus().run() : !1;
98978
98983
  }
98979
98984
  };
98980
98985
  },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "2.0.6-patch-5",
5
+ "version": "2.0.6-patch-6",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {