@rufous/ui 0.2.53 → 0.2.54
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 +13 -4
- package/dist/main.js +13 -4
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -9592,6 +9592,12 @@ var STATUS_IMAGES = {
|
|
|
9592
9592
|
blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg",
|
|
9593
9593
|
resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg"
|
|
9594
9594
|
};
|
|
9595
|
+
var STATUS_LABELS = {
|
|
9596
|
+
todo: "Todo",
|
|
9597
|
+
working: "Working",
|
|
9598
|
+
blocked: "Blocked",
|
|
9599
|
+
resolved: "Resolved"
|
|
9600
|
+
};
|
|
9595
9601
|
var STATUS_COLORS = {
|
|
9596
9602
|
todo: { border: "#dc2626", bg: "#fff", color: "#dc2626" },
|
|
9597
9603
|
working: { border: "#2563eb", bg: "#eff6ff", color: "#2563eb" },
|
|
@@ -9633,12 +9639,13 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
9633
9639
|
const taskItemType = schema2.nodes.taskItem;
|
|
9634
9640
|
const taskListType = schema2.nodes.taskList;
|
|
9635
9641
|
if (!taskItemType || !taskListType) return false;
|
|
9636
|
-
const
|
|
9642
|
+
const statusText = schema2.text("Todo");
|
|
9643
|
+
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema2.nodes.paragraph.create(null, statusText));
|
|
9637
9644
|
const newTaskList = taskListType.create(null, newTaskItem);
|
|
9638
9645
|
const tr2 = state.tr;
|
|
9639
9646
|
const afterBlock = $from.after($from.depth > 0 ? 1 : 0);
|
|
9640
9647
|
tr2.insert(afterBlock, newTaskList);
|
|
9641
|
-
tr2.setSelection(import_prosemirror_state.TextSelection.near(tr2.doc.resolve(afterBlock +
|
|
9648
|
+
tr2.setSelection(import_prosemirror_state.TextSelection.near(tr2.doc.resolve(afterBlock + 2 + 4)));
|
|
9642
9649
|
this.editor.view.dispatch(tr2);
|
|
9643
9650
|
return true;
|
|
9644
9651
|
}
|
|
@@ -9673,14 +9680,16 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
9673
9680
|
if (afterContent.size > 0) {
|
|
9674
9681
|
tr.delete($from.pos, $from.end());
|
|
9675
9682
|
}
|
|
9676
|
-
const
|
|
9683
|
+
const statusLabel = STATUS_LABELS[status] || STATUS_LABELS.todo;
|
|
9684
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create(null, schema.text(statusLabel));
|
|
9677
9685
|
const newItem = schema.nodes.taskItem.create(
|
|
9678
9686
|
{ status, checked: false },
|
|
9679
9687
|
newPara
|
|
9680
9688
|
);
|
|
9681
9689
|
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
9682
9690
|
tr.insert(insertPos, newItem);
|
|
9683
|
-
|
|
9691
|
+
const cursorAt = afterContent.size > 0 ? insertPos + 2 : insertPos + 2 + statusLabel.length;
|
|
9692
|
+
tr.setSelection(import_prosemirror_state.TextSelection.near(tr.doc.resolve(cursorAt)));
|
|
9684
9693
|
this.editor.view.dispatch(tr);
|
|
9685
9694
|
return true;
|
|
9686
9695
|
},
|
package/dist/main.js
CHANGED
|
@@ -9527,6 +9527,12 @@ var STATUS_IMAGES = {
|
|
|
9527
9527
|
blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg",
|
|
9528
9528
|
resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg"
|
|
9529
9529
|
};
|
|
9530
|
+
var STATUS_LABELS = {
|
|
9531
|
+
todo: "Todo",
|
|
9532
|
+
working: "Working",
|
|
9533
|
+
blocked: "Blocked",
|
|
9534
|
+
resolved: "Resolved"
|
|
9535
|
+
};
|
|
9530
9536
|
var STATUS_COLORS = {
|
|
9531
9537
|
todo: { border: "#dc2626", bg: "#fff", color: "#dc2626" },
|
|
9532
9538
|
working: { border: "#2563eb", bg: "#eff6ff", color: "#2563eb" },
|
|
@@ -9568,12 +9574,13 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
9568
9574
|
const taskItemType = schema2.nodes.taskItem;
|
|
9569
9575
|
const taskListType = schema2.nodes.taskList;
|
|
9570
9576
|
if (!taskItemType || !taskListType) return false;
|
|
9571
|
-
const
|
|
9577
|
+
const statusText = schema2.text("Todo");
|
|
9578
|
+
const newTaskItem = taskItemType.create({ status: "todo", checked: false }, schema2.nodes.paragraph.create(null, statusText));
|
|
9572
9579
|
const newTaskList = taskListType.create(null, newTaskItem);
|
|
9573
9580
|
const tr2 = state.tr;
|
|
9574
9581
|
const afterBlock = $from.after($from.depth > 0 ? 1 : 0);
|
|
9575
9582
|
tr2.insert(afterBlock, newTaskList);
|
|
9576
|
-
tr2.setSelection(TextSelection.near(tr2.doc.resolve(afterBlock +
|
|
9583
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(afterBlock + 2 + 4)));
|
|
9577
9584
|
this.editor.view.dispatch(tr2);
|
|
9578
9585
|
return true;
|
|
9579
9586
|
}
|
|
@@ -9608,14 +9615,16 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
9608
9615
|
if (afterContent.size > 0) {
|
|
9609
9616
|
tr.delete($from.pos, $from.end());
|
|
9610
9617
|
}
|
|
9611
|
-
const
|
|
9618
|
+
const statusLabel = STATUS_LABELS[status] || STATUS_LABELS.todo;
|
|
9619
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create(null, schema.text(statusLabel));
|
|
9612
9620
|
const newItem = schema.nodes.taskItem.create(
|
|
9613
9621
|
{ status, checked: false },
|
|
9614
9622
|
newPara
|
|
9615
9623
|
);
|
|
9616
9624
|
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
9617
9625
|
tr.insert(insertPos, newItem);
|
|
9618
|
-
|
|
9626
|
+
const cursorAt = afterContent.size > 0 ? insertPos + 2 : insertPos + 2 + statusLabel.length;
|
|
9627
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(cursorAt)));
|
|
9619
9628
|
this.editor.view.dispatch(tr);
|
|
9620
9629
|
return true;
|
|
9621
9630
|
},
|