@fileverse-dev/ddoc 2.0.3-patch-7 → 2.0.3-patch-8
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/dist/index.es.js +7 -6
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -98477,10 +98477,10 @@ const By = ({
|
|
98477
98477
|
const {
|
98478
98478
|
selection: { $head: e, from: n, to: r },
|
98479
98479
|
doc: i
|
98480
|
-
} = t.state, a = e.node(e.depth - 1),
|
98480
|
+
} = t.state, a = e.node(e.depth - 1), s = e.toString().split("/"), l = s.some((m) => m.includes("table"));
|
98481
98481
|
if ((a == null ? void 0 : a.type.name) !== "dBlock") {
|
98482
|
-
const m = (a == null ? void 0 : a.type.name) === "listItem" || (a == null ? void 0 : a.type.name) === "taskItem";
|
98483
|
-
return n !== r &&
|
98482
|
+
const m = s.some((b) => b.includes("taskList")), g = (a == null ? void 0 : a.type.name) === "listItem" || (a == null ? void 0 : a.type.name) === "taskItem";
|
98483
|
+
return n !== r && g ? t.chain().deleteSelection().focus().run() : l ? !1 : ((d = a == null ? void 0 : a.lastChild) == null ? void 0 : d.textContent) === "" && ((h = a == null ? void 0 : a.lastChild) == null ? void 0 : h.type.name) === "paragraph" && g ? t.chain().deleteNode(m ? "taskItem" : "listItem").insertContentAt(n, {
|
98484
98484
|
type: "dBlock",
|
98485
98485
|
content: [
|
98486
98486
|
{
|
@@ -98498,20 +98498,21 @@ const By = ({
|
|
98498
98498
|
});
|
98499
98499
|
const f = (p = i.slice(n, c)) == null ? void 0 : p.toJSON().content;
|
98500
98500
|
try {
|
98501
|
-
|
98501
|
+
const m = n + 4;
|
98502
|
+
return ["columns", "heading"].includes(u) ? t.chain().insertContent({
|
98502
98503
|
type: "dBlock",
|
98503
98504
|
content: [
|
98504
98505
|
{
|
98505
98506
|
type: "paragraph"
|
98506
98507
|
}
|
98507
98508
|
]
|
98508
|
-
}).focus().run() : t.chain().insertContentAt(
|
98509
|
+
}).focus(m).run() : t.chain().insertContentAt(
|
98509
98510
|
{ from: n, to: c },
|
98510
98511
|
{
|
98511
98512
|
type: this.name,
|
98512
98513
|
content: f
|
98513
98514
|
}
|
98514
|
-
).focus().run();
|
98515
|
+
).focus(m).run();
|
98515
98516
|
} catch (m) {
|
98516
98517
|
return console.error(`Error inserting content into dBlock node: ${m}`), !1;
|
98517
98518
|
}
|