@rufous/ui 0.1.98 → 0.1.99
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 +10 -2
- package/dist/main.js +10 -2
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -41672,6 +41672,12 @@ var STATUS_IMAGES = {
|
|
|
41672
41672
|
blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg",
|
|
41673
41673
|
resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg"
|
|
41674
41674
|
};
|
|
41675
|
+
var STATUS_LABELS = {
|
|
41676
|
+
todo: "Todo",
|
|
41677
|
+
working: "Working",
|
|
41678
|
+
blocked: "Blocked",
|
|
41679
|
+
resolved: "Resolved"
|
|
41680
|
+
};
|
|
41675
41681
|
var STATUS_COLORS = {
|
|
41676
41682
|
todo: { border: "#dc2626", bg: "#fff", color: "#dc2626" },
|
|
41677
41683
|
working: { border: "#2563eb", bg: "#eff6ff", color: "#2563eb" },
|
|
@@ -41715,14 +41721,16 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
41715
41721
|
if (afterContent.size > 0) {
|
|
41716
41722
|
tr.delete(cursorPos, paraEnd);
|
|
41717
41723
|
}
|
|
41718
|
-
const
|
|
41724
|
+
const statusLabel = STATUS_LABELS[status] || STATUS_LABELS.todo;
|
|
41725
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create(null, schema.text(statusLabel));
|
|
41719
41726
|
const newItem = schema.nodes.taskItem.create(
|
|
41720
41727
|
{ status, checked: false },
|
|
41721
41728
|
newPara
|
|
41722
41729
|
);
|
|
41723
41730
|
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
41724
41731
|
tr.insert(insertPos, newItem);
|
|
41725
|
-
|
|
41732
|
+
const textLen = afterContent.size > 0 ? 0 : statusLabel.length;
|
|
41733
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(insertPos + 2 + textLen)));
|
|
41726
41734
|
this.editor.view.dispatch(tr);
|
|
41727
41735
|
return true;
|
|
41728
41736
|
},
|
package/dist/main.js
CHANGED
|
@@ -13002,6 +13002,12 @@ var STATUS_IMAGES = {
|
|
|
13002
13002
|
blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg",
|
|
13003
13003
|
resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg"
|
|
13004
13004
|
};
|
|
13005
|
+
var STATUS_LABELS = {
|
|
13006
|
+
todo: "Todo",
|
|
13007
|
+
working: "Working",
|
|
13008
|
+
blocked: "Blocked",
|
|
13009
|
+
resolved: "Resolved"
|
|
13010
|
+
};
|
|
13005
13011
|
var STATUS_COLORS = {
|
|
13006
13012
|
todo: { border: "#dc2626", bg: "#fff", color: "#dc2626" },
|
|
13007
13013
|
working: { border: "#2563eb", bg: "#eff6ff", color: "#2563eb" },
|
|
@@ -13045,14 +13051,16 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
13045
13051
|
if (afterContent.size > 0) {
|
|
13046
13052
|
tr.delete(cursorPos, paraEnd);
|
|
13047
13053
|
}
|
|
13048
|
-
const
|
|
13054
|
+
const statusLabel = STATUS_LABELS[status] || STATUS_LABELS.todo;
|
|
13055
|
+
const newPara = afterContent.size > 0 ? schema.nodes.paragraph.create(null, afterContent) : schema.nodes.paragraph.create(null, schema.text(statusLabel));
|
|
13049
13056
|
const newItem = schema.nodes.taskItem.create(
|
|
13050
13057
|
{ status, checked: false },
|
|
13051
13058
|
newPara
|
|
13052
13059
|
);
|
|
13053
13060
|
const insertPos = tr.mapping.map($from.after(taskDepth));
|
|
13054
13061
|
tr.insert(insertPos, newItem);
|
|
13055
|
-
|
|
13062
|
+
const textLen = afterContent.size > 0 ? 0 : statusLabel.length;
|
|
13063
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(insertPos + 2 + textLen)));
|
|
13056
13064
|
this.editor.view.dispatch(tr);
|
|
13057
13065
|
return true;
|
|
13058
13066
|
},
|