@wrongstack/webui 0.73.1 → 0.77.0
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/assets/index-Df1jRLwk.css +1 -0
- package/dist/assets/{index-BH3RI9-8.js → index-H4ofeiKr.js} +27 -27
- package/dist/index.css +23 -0
- package/dist/index.css.map +1 -1
- package/dist/index.html +2 -2
- package/dist/index.js +118 -23
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +27 -0
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +27 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/assets/index-C_0-qbQ-.css +0 -1
package/dist/server/entry.js
CHANGED
|
@@ -2916,6 +2916,33 @@ async function startWebUI(opts = {}) {
|
|
|
2916
2916
|
broadcast(clients, { type: "todos.updated", payload: { todos: [] } });
|
|
2917
2917
|
break;
|
|
2918
2918
|
}
|
|
2919
|
+
case "todos.remove": {
|
|
2920
|
+
const payload = msg.payload;
|
|
2921
|
+
if (!payload) {
|
|
2922
|
+
sendResult(ws, false, "Missing id or index");
|
|
2923
|
+
break;
|
|
2924
|
+
}
|
|
2925
|
+
const { id, index } = payload;
|
|
2926
|
+
let targetIdx = -1;
|
|
2927
|
+
if (typeof id === "string") {
|
|
2928
|
+
targetIdx = context.todos.findIndex((t) => t.id === id);
|
|
2929
|
+
} else if (typeof index === "number" && index > 0) {
|
|
2930
|
+
targetIdx = index - 1;
|
|
2931
|
+
}
|
|
2932
|
+
if (targetIdx < 0 || !context.todos[targetIdx]) {
|
|
2933
|
+
sendResult(ws, false, "Todo not found");
|
|
2934
|
+
break;
|
|
2935
|
+
}
|
|
2936
|
+
const removed = context.todos[targetIdx];
|
|
2937
|
+
const next = [
|
|
2938
|
+
...context.todos.slice(0, targetIdx),
|
|
2939
|
+
...context.todos.slice(targetIdx + 1)
|
|
2940
|
+
];
|
|
2941
|
+
context.state.replaceTodos(next);
|
|
2942
|
+
sendResult(ws, true, `Removed: ${removed.content}`);
|
|
2943
|
+
broadcast(clients, { type: "todos.updated", payload: { todos: next } });
|
|
2944
|
+
break;
|
|
2945
|
+
}
|
|
2919
2946
|
case "plan.get": {
|
|
2920
2947
|
const planPath = context.meta["plan.path"];
|
|
2921
2948
|
if (typeof planPath === "string" && planPath) {
|