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

Sign up to get free protection for your applications and to get access to all the features.
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
  },
@@ -136085,19 +136090,41 @@ const imt = sn.create({
136085
136090
  const n = () => {
136086
136091
  t.commands.unsetPageBreak(), e();
136087
136092
  };
136088
- return /* @__PURE__ */ z.jsx(
136093
+ return /* @__PURE__ */ z.jsxs(
136089
136094
  E2,
136090
136095
  {
136091
136096
  as: "div",
136092
- className: _t("flex opacity-0 hover:opacity-100 transition-opacity duration-200 w-full h-full justify-center items-center"),
136093
- children: /* @__PURE__ */ z.jsx(Ld, { sideOffset: 5, position: "bottom", text: "Remove page breaker", children: /* @__PURE__ */ z.jsx(
136094
- Ke,
136095
- {
136096
- name: "PageBreakRemove",
136097
- onClick: n,
136098
- className: "text-[#77818A] cursor-pointer"
136099
- }
136100
- ) })
136097
+ className: _t(
136098
+ "flex relative opacity-0 hover:opacity-100 transition-opacity duration-200 w-full h-full justify-center items-center"
136099
+ ),
136100
+ children: [
136101
+ /* @__PURE__ */ z.jsx("div", { className: "absolute top-[-15px] left-0 right-0 h-4", children: /* @__PURE__ */ z.jsx(
136102
+ "div",
136103
+ {
136104
+ className: "absolute inset-0 border-b-1 border-transparent",
136105
+ style: {
136106
+ background: "linear-gradient(to bottom, transparent, #FFDF0A33)"
136107
+ }
136108
+ }
136109
+ ) }),
136110
+ /* @__PURE__ */ z.jsx(Ld, { sideOffset: 5, position: "bottom", text: "Remove page breaker", children: /* @__PURE__ */ z.jsx(
136111
+ Ke,
136112
+ {
136113
+ name: "PageBreakRemove",
136114
+ onClick: n,
136115
+ className: "text-[#77818A] cursor-pointer"
136116
+ }
136117
+ ) }),
136118
+ /* @__PURE__ */ z.jsx("div", { className: "absolute bottom-[-15px] left-0 right-0 h-4", children: /* @__PURE__ */ z.jsx(
136119
+ "div",
136120
+ {
136121
+ className: "absolute inset-0 border-b-1 border-transparent",
136122
+ style: {
136123
+ background: "linear-gradient(to bottom, #FFDF0A33, transparent)"
136124
+ }
136125
+ }
136126
+ ) })
136127
+ ]
136101
136128
  }
136102
136129
  );
136103
136130
  }, dmt = zt.create({