@rufous/ui 0.2.5 → 0.2.52
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/main.cjs +36 -20
- package/dist/main.js +36 -20
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -41709,28 +41709,27 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
41709
41709
|
}
|
|
41710
41710
|
if (taskDepth === -1) {
|
|
41711
41711
|
if (this.editor.storage.taskTodoEnabled === true) {
|
|
41712
|
-
const
|
|
41713
|
-
const taskItemType =
|
|
41714
|
-
const taskListType =
|
|
41712
|
+
const schema2 = state.schema;
|
|
41713
|
+
const taskItemType = schema2.nodes.taskItem;
|
|
41714
|
+
const taskListType = schema2.nodes.taskList;
|
|
41715
41715
|
if (!taskItemType || !taskListType) return false;
|
|
41716
|
-
const
|
|
41717
|
-
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema.nodes.paragraph.create(null, statusText));
|
|
41716
|
+
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema2.nodes.paragraph.create());
|
|
41718
41717
|
const newTaskList = taskListType.create(null, newTaskItem);
|
|
41719
|
-
const
|
|
41718
|
+
const tr2 = state.tr;
|
|
41720
41719
|
const afterBlock = $from.after($from.depth > 0 ? 1 : 0);
|
|
41721
|
-
|
|
41722
|
-
|
|
41723
|
-
this.editor.view.dispatch(
|
|
41720
|
+
tr2.insert(afterBlock, newTaskList);
|
|
41721
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(afterBlock + 1)));
|
|
41722
|
+
this.editor.view.dispatch(tr2);
|
|
41724
41723
|
return true;
|
|
41725
41724
|
}
|
|
41726
41725
|
return false;
|
|
41727
41726
|
}
|
|
41728
41727
|
if (this.editor.storage.taskTodoEnabled === false) {
|
|
41729
|
-
const
|
|
41730
|
-
const
|
|
41731
|
-
const
|
|
41732
|
-
if (
|
|
41733
|
-
|
|
41728
|
+
const afterContent2 = $from.parent.content.cut($from.parentOffset);
|
|
41729
|
+
const schema2 = state.schema;
|
|
41730
|
+
const tr2 = state.tr;
|
|
41731
|
+
if (afterContent2.size > 0) {
|
|
41732
|
+
tr2.delete($from.pos, $from.end());
|
|
41734
41733
|
}
|
|
41735
41734
|
let taskListDepth = -1;
|
|
41736
41735
|
for (let d = taskDepth - 1; d >= 0; d--) {
|
|
@@ -41739,14 +41738,31 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
41739
41738
|
break;
|
|
41740
41739
|
}
|
|
41741
41740
|
}
|
|
41742
|
-
const
|
|
41743
|
-
const
|
|
41744
|
-
|
|
41745
|
-
|
|
41746
|
-
this.editor.view.dispatch(
|
|
41741
|
+
const insertPos2 = taskListDepth !== -1 ? tr2.mapping.map($from.after(taskListDepth)) : tr2.mapping.map($from.after(taskDepth));
|
|
41742
|
+
const newPara2 = afterContent2.size > 0 ? schema2.nodes.paragraph.create(null, afterContent2) : schema2.nodes.paragraph.create();
|
|
41743
|
+
tr2.insert(insertPos2, newPara2);
|
|
41744
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(insertPos2 + 1)));
|
|
41745
|
+
this.editor.view.dispatch(tr2);
|
|
41747
41746
|
return true;
|
|
41748
41747
|
}
|
|
41749
|
-
|
|
41748
|
+
const taskNode = $from.node(taskDepth);
|
|
41749
|
+
const status = taskNode.attrs.status || "todo";
|
|
41750
|
+
const schema = state.schema;
|
|
41751
|
+
const tr = state.tr;
|
|
41752
|
+
const afterContent = $from.parent.content.cut($from.parentOffset);
|
|
41753
|
+
if (afterContent.size > 0) {
|
|
41754
|
+
tr.delete($from.pos, $from.end());
|
|
41755
|
+
}
|
|
41756
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create();
|
|
41757
|
+
const newItem = schema.nodes.taskItem.create(
|
|
41758
|
+
{ status, checked: false },
|
|
41759
|
+
newPara
|
|
41760
|
+
);
|
|
41761
|
+
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
41762
|
+
tr.insert(insertPos, newItem);
|
|
41763
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(insertPos + 1)));
|
|
41764
|
+
this.editor.view.dispatch(tr);
|
|
41765
|
+
return true;
|
|
41750
41766
|
},
|
|
41751
41767
|
Backspace: () => {
|
|
41752
41768
|
const { state } = this.editor;
|
package/dist/main.js
CHANGED
|
@@ -13039,28 +13039,27 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
13039
13039
|
}
|
|
13040
13040
|
if (taskDepth === -1) {
|
|
13041
13041
|
if (this.editor.storage.taskTodoEnabled === true) {
|
|
13042
|
-
const
|
|
13043
|
-
const taskItemType =
|
|
13044
|
-
const taskListType =
|
|
13042
|
+
const schema2 = state.schema;
|
|
13043
|
+
const taskItemType = schema2.nodes.taskItem;
|
|
13044
|
+
const taskListType = schema2.nodes.taskList;
|
|
13045
13045
|
if (!taskItemType || !taskListType) return false;
|
|
13046
|
-
const
|
|
13047
|
-
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema.nodes.paragraph.create(null, statusText));
|
|
13046
|
+
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema2.nodes.paragraph.create());
|
|
13048
13047
|
const newTaskList = taskListType.create(null, newTaskItem);
|
|
13049
|
-
const
|
|
13048
|
+
const tr2 = state.tr;
|
|
13050
13049
|
const afterBlock = $from.after($from.depth > 0 ? 1 : 0);
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
this.editor.view.dispatch(
|
|
13050
|
+
tr2.insert(afterBlock, newTaskList);
|
|
13051
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(afterBlock + 1)));
|
|
13052
|
+
this.editor.view.dispatch(tr2);
|
|
13054
13053
|
return true;
|
|
13055
13054
|
}
|
|
13056
13055
|
return false;
|
|
13057
13056
|
}
|
|
13058
13057
|
if (this.editor.storage.taskTodoEnabled === false) {
|
|
13059
|
-
const
|
|
13060
|
-
const
|
|
13061
|
-
const
|
|
13062
|
-
if (
|
|
13063
|
-
|
|
13058
|
+
const afterContent2 = $from.parent.content.cut($from.parentOffset);
|
|
13059
|
+
const schema2 = state.schema;
|
|
13060
|
+
const tr2 = state.tr;
|
|
13061
|
+
if (afterContent2.size > 0) {
|
|
13062
|
+
tr2.delete($from.pos, $from.end());
|
|
13064
13063
|
}
|
|
13065
13064
|
let taskListDepth = -1;
|
|
13066
13065
|
for (let d = taskDepth - 1; d >= 0; d--) {
|
|
@@ -13069,14 +13068,31 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
13069
13068
|
break;
|
|
13070
13069
|
}
|
|
13071
13070
|
}
|
|
13072
|
-
const
|
|
13073
|
-
const
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
this.editor.view.dispatch(
|
|
13071
|
+
const insertPos2 = taskListDepth !== -1 ? tr2.mapping.map($from.after(taskListDepth)) : tr2.mapping.map($from.after(taskDepth));
|
|
13072
|
+
const newPara2 = afterContent2.size > 0 ? schema2.nodes.paragraph.create(null, afterContent2) : schema2.nodes.paragraph.create();
|
|
13073
|
+
tr2.insert(insertPos2, newPara2);
|
|
13074
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(insertPos2 + 1)));
|
|
13075
|
+
this.editor.view.dispatch(tr2);
|
|
13077
13076
|
return true;
|
|
13078
13077
|
}
|
|
13079
|
-
|
|
13078
|
+
const taskNode = $from.node(taskDepth);
|
|
13079
|
+
const status = taskNode.attrs.status || "todo";
|
|
13080
|
+
const schema = state.schema;
|
|
13081
|
+
const tr = state.tr;
|
|
13082
|
+
const afterContent = $from.parent.content.cut($from.parentOffset);
|
|
13083
|
+
if (afterContent.size > 0) {
|
|
13084
|
+
tr.delete($from.pos, $from.end());
|
|
13085
|
+
}
|
|
13086
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create();
|
|
13087
|
+
const newItem = schema.nodes.taskItem.create(
|
|
13088
|
+
{ status, checked: false },
|
|
13089
|
+
newPara
|
|
13090
|
+
);
|
|
13091
|
+
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
13092
|
+
tr.insert(insertPos, newItem);
|
|
13093
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(insertPos + 1)));
|
|
13094
|
+
this.editor.view.dispatch(tr);
|
|
13095
|
+
return true;
|
|
13080
13096
|
},
|
|
13081
13097
|
Backspace: () => {
|
|
13082
13098
|
const { state } = this.editor;
|