dsh-workbench-tasks 5.2.6 → 5.2.20

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/lib/client.js CHANGED
@@ -46,11 +46,129 @@ var require_limits = __commonJS({
46
46
  }
47
47
  });
48
48
 
49
+ // packages/addons/lib/filter-checklist.cjs
50
+ var require_filter_checklist = __commonJS({
51
+ "packages/addons/lib/filter-checklist.cjs"(exports2, module2) {
52
+ "use strict";
53
+ var React = require("react");
54
+ var h = React.createElement;
55
+ var NEAR = 24;
56
+ function nearBottom(el, threshold) {
57
+ if (!el) return false;
58
+ var gap = Number(threshold);
59
+ if (!isFinite(gap) || gap < 0) gap = NEAR;
60
+ return el.scrollTop + el.clientHeight >= el.scrollHeight - gap;
61
+ }
62
+ function FilterChecklist(props) {
63
+ var items = props.items || [];
64
+ var selected = props.selected || [];
65
+ var disabled = props.disabled === true;
66
+ var loading = props.loading === true;
67
+ var hasMore = props.hasMore === true;
68
+ var query = props.query || "";
69
+ var total = typeof props.total === "number" ? props.total : items.length;
70
+ var title = props.title || "\u5168\u90E8";
71
+ var selectedText = props.selectedText || "\u5DF2\u9009";
72
+ var clearText = props.clearText || "\u6E05\u7A7A";
73
+ var searchPlaceholder = props.searchPlaceholder || "\u641C\u7D22";
74
+ var emptyText = props.emptyText || "\u6682\u65E0\u6570\u636E";
75
+ var noMatchText = props.noMatchText || "\u6CA1\u6709\u5339\u914D\u9879";
76
+ var loadingText = props.loadingText || "\u52A0\u8F7D\u4E2D\u2026";
77
+ var noMoreText = typeof props.noMoreText === "string" ? props.noMoreText : "\u6CA1\u6709\u66F4\u591A";
78
+ var onToggle = props.onToggle || function() {
79
+ };
80
+ var onQuery = props.onQuery || function() {
81
+ };
82
+ var onLoadMore = props.onLoadMore;
83
+ var onClear = props.onClear || function() {
84
+ };
85
+ function toggle(id) {
86
+ if (disabled) return;
87
+ onToggle(id);
88
+ }
89
+ function scroll(e) {
90
+ if (disabled || loading || !hasMore || !onLoadMore) return;
91
+ if (nearBottom(e.currentTarget)) onLoadMore();
92
+ }
93
+ var head = h(
94
+ "div",
95
+ { className: "wbck-head" },
96
+ h("span", { className: "wbck-grow" }, title + (total ? " \xB7 " + total : "")),
97
+ selected.length ? h("span", { className: "wbck-sel" }, selectedText + " " + selected.length) : null,
98
+ selected.length || query ? h("button", {
99
+ type: "button",
100
+ className: "wbck-clear",
101
+ title: clearText,
102
+ disabled,
103
+ onClick: function() {
104
+ if (disabled) return;
105
+ onClear();
106
+ }
107
+ }, clearText) : null
108
+ );
109
+ var body;
110
+ if (!items.length) {
111
+ body = h("div", { className: "wbck-note", role: "status" }, loading ? loadingText : query ? noMatchText : emptyText);
112
+ } else {
113
+ body = items.map(function(x) {
114
+ var on = selected.indexOf(String(x.id)) >= 0;
115
+ return h(
116
+ "label",
117
+ { key: x.id, className: "wbck-opt" + (on ? " is-on" : "") },
118
+ h("input", {
119
+ type: "checkbox",
120
+ checked: on,
121
+ disabled,
122
+ onChange: function() {
123
+ toggle(x.id);
124
+ }
125
+ }),
126
+ h("span", { className: "wbck-nm", title: x.name }, x.name),
127
+ x.meta ? h("span", { className: "wbck-meta" }, x.meta) : null
128
+ );
129
+ });
130
+ var more = loading ? loadingText : hasMore ? "" : noMoreText;
131
+ if (more) body = body.concat([h("div", { key: "__more", className: "wbck-more", role: "status" }, more)]);
132
+ }
133
+ return h(
134
+ "div",
135
+ { className: "wbck", "data-role": "checklist" },
136
+ h(
137
+ "div",
138
+ { className: "wbck-search" },
139
+ h("input", {
140
+ type: "search",
141
+ autoFocus: props.autoFocus !== false,
142
+ className: "wbck-input",
143
+ placeholder: searchPlaceholder,
144
+ "aria-label": searchPlaceholder,
145
+ value: query,
146
+ disabled,
147
+ onChange: function(e) {
148
+ onQuery(e.target.value);
149
+ }
150
+ })
151
+ ),
152
+ props.beforeHead || null,
153
+ head,
154
+ h("div", {
155
+ className: "wbck-list",
156
+ onScroll: scroll,
157
+ "aria-busy": loading ? "true" : "false"
158
+ }, body)
159
+ );
160
+ }
161
+ module2.exports = FilterChecklist;
162
+ module2.exports.nearBottom = nearBottom;
163
+ }
164
+ });
165
+
49
166
  // packages/addons/tasks/client/ui/tagfilter.cjs
50
167
  var require_tagfilter = __commonJS({
51
168
  "packages/addons/tasks/client/ui/tagfilter.cjs"(exports2, module2) {
52
169
  var React = require("react");
53
170
  var h = React.createElement;
171
+ var FilterChecklist = require_filter_checklist();
54
172
  module2.exports = function TagFilter(props) {
55
173
  var api = props.api;
56
174
  var t = props.t;
@@ -99,6 +217,16 @@ var require_tagfilter = __commonJS({
99
217
  clearTimeout(timer);
100
218
  };
101
219
  }, [open, query, load, props.reloadKey]);
220
+ React.useEffect(function() {
221
+ if (!open) return void 0;
222
+ function onKey(e) {
223
+ if (e.key === "Escape") setOpen(false);
224
+ }
225
+ document.addEventListener("keydown", onKey);
226
+ return function() {
227
+ document.removeEventListener("keydown", onKey);
228
+ };
229
+ }, [open]);
102
230
  React.useEffect(function() {
103
231
  api.call("tasks.tagOptions", { pageSize: 1 }).then(function(r) {
104
232
  if (r && r.ok) setAvailable(!!(r.result && r.result.available));
@@ -127,74 +255,47 @@ var require_tagfilter = __commonJS({
127
255
  open ? h(
128
256
  "div",
129
257
  { className: "wbt-tagmenu", role: "menu" },
130
- h(
131
- "div",
132
- { className: "wbt-tagsearch" },
133
- h("input", {
134
- className: "wbt-input",
135
- autoFocus: true,
136
- placeholder: t.tagSearchPlaceholder,
137
- value: query,
138
- onChange: function(e) {
139
- setQuery(e.target.value);
140
- },
141
- onKeyDown: function(e) {
142
- if (e.key === "Escape") {
143
- e.stopPropagation();
144
- setOpen(false);
145
- }
146
- }
147
- })
148
- ),
149
- ids.length ? h(
150
- "div",
151
- { className: "wbt-tagsel" },
152
- h("div", { className: "wbt-tagmenu-head" }, h("span", null, t.tagSelected + " " + ids.length), h("span", { className: "wbt-grow" })),
153
- h("div", { className: "wbt-tagsel-list" }, ids.map(function(id) {
154
- return h(
155
- "button",
156
- { key: id, className: "wbt-tagselitem", title: t.tagRemove, onClick: function() {
157
- toggle(id);
158
- } },
159
- h("span", { className: "wbt-tagnm" }, names[String(id)] || "#" + id),
160
- h("span", { className: "wbt-tagx" }, "\xD7")
161
- );
162
- }))
163
- ) : null,
164
- h(
165
- "div",
166
- { className: "wbt-tagmenu-head" },
167
- h("span", null, t.allTags + (opts.total ? " \xB7 " + opts.total : "")),
168
- h("span", { className: "wbt-grow" }),
169
- h("button", { className: "wbt-mini", onClick: function() {
258
+ h(FilterChecklist, {
259
+ beforeHead: ids.length ? h(
260
+ "div",
261
+ { className: "wbt-tagsel" },
262
+ h("div", { className: "wbt-tagmenu-head" }, h("span", null, t.tagSelected + " " + ids.length), h("span", { className: "wbt-grow" })),
263
+ h("div", { className: "wbt-tagsel-list" }, ids.map(function(id) {
264
+ return h(
265
+ "button",
266
+ { key: id, className: "wbt-tagselitem", title: t.tagRemove, onClick: function() {
267
+ toggle(id);
268
+ } },
269
+ h("span", { className: "wbt-tagnm" }, names[String(id)] || "#" + id),
270
+ h("span", { className: "wbt-tagx" }, "\xD7")
271
+ );
272
+ }))
273
+ ) : null,
274
+ items: opts.tags.map(function(x) {
275
+ return { id: x.id, name: x.name, meta: x.total };
276
+ }),
277
+ selected: ids,
278
+ onToggle: toggle,
279
+ query,
280
+ onQuery: setQuery,
281
+ title: t.allTags,
282
+ total: opts.total,
283
+ clearText: t.clear,
284
+ onClear: function() {
170
285
  onChange([]);
171
286
  setQuery("");
172
- } }, t.clear)
173
- ),
174
- h(
175
- "div",
176
- {
177
- className: "wbt-taglist",
178
- onScroll: function(e) {
179
- var el = e.currentTarget;
180
- if (!opts.hasMore || loading) return;
181
- if (el.scrollTop + el.clientHeight >= el.scrollHeight - 24) load(query, (opts.pageNumber || 1) + 1, true);
182
- }
183
287
  },
184
- opts.tags.length ? opts.tags.map(function(x) {
185
- var on = ids.indexOf(String(x.id)) >= 0;
186
- return h(
187
- "label",
188
- { key: x.id, className: "wbt-tagopt" },
189
- h("input", { type: "checkbox", checked: on, onChange: function() {
190
- toggle(x.id);
191
- } }),
192
- h("span", { className: "wbt-tagnm" }, x.name),
193
- h("span", { className: "wbt-tagcnt" }, x.total)
194
- );
195
- }) : h("div", { className: "wbt-note" }, loading ? t.loadingMore : query ? t.tagNoMatch : t.noTags),
196
- opts.tags.length ? h("div", { className: "wbt-tagmore" }, loading ? t.loadingMore : opts.hasMore ? "" : t.noMore) : null
197
- )
288
+ searchPlaceholder: t.tagSearchPlaceholder,
289
+ loading,
290
+ hasMore: opts.hasMore,
291
+ onLoadMore: function() {
292
+ load(query, (opts.pageNumber || 1) + 1, true);
293
+ },
294
+ emptyText: t.noTags,
295
+ noMatchText: t.tagNoMatch,
296
+ loadingText: t.loadingMore,
297
+ noMoreText: t.noMore
298
+ })
198
299
  ) : null
199
300
  );
200
301
  };
@@ -379,6 +480,12 @@ var require_charts = __commonJS({
379
480
  ".@-ghost{appearance:none;border:1px solid var(--dsw-alias-border-l2,#e5e6eb);background:var(--dsw-alias-bg-layer-1,#fff);color:var(--dsw-alias-label-secondary,#646a73);border-radius:8px;font-size:12px;padding:6px 10px;cursor:pointer}",
380
481
  ".@-ghost:hover{border-color:var(--dsw-alias-brand-primary,#4f6ef7);color:var(--dsw-alias-brand-primary,#4f6ef7)}",
381
482
  ".@-muted{color:var(--dsw-alias-label-tertiary,#8f959e);font-size:12px}",
483
+ // 难度分布的口径切换:轻量 tablist,视觉上与页首时间范围分段保持一致。
484
+ ".@-dims{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 8px}",
485
+ ".@-dims button{appearance:none;border:1px solid transparent;background:transparent;color:inherit;font:inherit;font-size:11.5px;padding:3px 8px;border-radius:6px;cursor:pointer;opacity:.7;white-space:nowrap}",
486
+ ".@-dims button:hover{background:var(--dsw-alias-bg-skeleton,#f2f3f5);opacity:1}",
487
+ ".@-dims button[aria-selected=true]{border-color:var(--dsw-alias-border-l2,#e5e6eb);background:var(--dsw-alias-bg-skeleton,#f2f3f5);font-weight:600;opacity:1}",
488
+ ".@-dims button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:1px}",
382
489
  ".@-sgrid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px}",
383
490
  ".@-scard{grid-column:span 6;min-width:0;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:12px;padding:14px 16px}",
384
491
  ".@-span-3{grid-column:span 3}.@-span-4{grid-column:span 4}.@-span-6{grid-column:span 6}.@-span-8{grid-column:span 8}.@-span-12{grid-column:span 12}",
@@ -658,7 +765,8 @@ var require_charts = __commonJS({
658
765
  );
659
766
  }),
660
767
  labelIdx.map(function(i2) {
661
- return h("text", { key: "x" + i2, x: x(i2), y: height - 6, textAnchor: "middle", fontSize: 9, fill: "var(--dsw-alias-label-tertiary,#8f959e)" }, String(data[i2].bucket).slice(5));
768
+ var anchor = i2 === data.length - 1 ? "end" : "middle";
769
+ return h("text", { key: "x" + i2, x: x(i2), y: height - 6, textAnchor: anchor, fontSize: 9, fill: "var(--dsw-alias-label-tertiary,#8f959e)" }, String(data[i2].bucket).slice(5));
662
770
  })
663
771
  ),
664
772
  h("div", { className: prefix + "-tlegend" }, series.map(function(s, i2) {
@@ -1426,15 +1534,42 @@ var require_config = __commonJS({
1426
1534
  }
1427
1535
  });
1428
1536
 
1537
+ // packages/addons/tasks/client/stats/task-link.cjs
1538
+ var require_task_link = __commonJS({
1539
+ "packages/addons/tasks/client/stats/task-link.cjs"(exports2, module2) {
1540
+ var React = require("react");
1541
+ var h = React.createElement;
1542
+ module2.exports = function taskTitle(lang, onNavigate) {
1543
+ var en = lang === "en";
1544
+ return function(row) {
1545
+ var title = row.title == null ? "" : String(row.title);
1546
+ var id = row.id == null ? "" : String(row.id);
1547
+ if (!id || typeof onNavigate !== "function") return title;
1548
+ return h("button", {
1549
+ type: "button",
1550
+ className: "wbt-table-link",
1551
+ "data-task-id": id,
1552
+ "aria-label": (en ? "Search by task ID: " : "\u6309\u4EFB\u52A1 ID \u68C0\u7D22\uFF1A") + id,
1553
+ title: en ? "Search by task ID: " + id : "\u6309\u4EFB\u52A1 ID \u68C0\u7D22\uFF1A" + id,
1554
+ onClick: function() {
1555
+ onNavigate("tasks", { taskId: id });
1556
+ }
1557
+ }, title);
1558
+ };
1559
+ };
1560
+ }
1561
+ });
1562
+
1429
1563
  // packages/addons/tasks/client/item/recent-columns.cjs
1430
1564
  var require_recent_columns = __commonJS({
1431
1565
  "packages/addons/tasks/client/item/recent-columns.cjs"(exports2, module2) {
1432
1566
  var React = require("react");
1433
1567
  var h = React.createElement;
1568
+ var taskTitle = require_task_link();
1434
1569
  module2.exports = function recentColumns(t, lang, onNavigate) {
1435
1570
  var en = lang === "en";
1436
1571
  return [
1437
- { key: "title", label: t.colTitle },
1572
+ { key: "title", label: t.colTitle, render: taskTitle(lang, onNavigate) },
1438
1573
  { key: "difficulty", label: en ? "Difficulty" : "\u96BE\u5EA6", render: function(row) {
1439
1574
  var n = Number(row.difficulty);
1440
1575
  if (!(n > 0)) return "\u2014";
@@ -1501,11 +1636,12 @@ var require_ranking_name = __commonJS({
1501
1636
  // packages/addons/tasks/client/stats/heatmap-model.cjs
1502
1637
  var require_heatmap_model = __commonJS({
1503
1638
  "packages/addons/tasks/client/stats/heatmap-model.cjs"(exports2, module2) {
1504
- var TYPES = ["done", "publish", "shutdown", "claimed"];
1639
+ var FILTER_TYPES = ["done", "publish", "shutdown", "claimed"];
1640
+ var TYPES = FILTER_TYPES.concat(["target"]);
1505
1641
  var LEVELS = [{ min: 1, max: 1, label: "1" }, { min: 2, max: 3, label: "2\u20133" }, { min: 4, max: 6, label: "4\u20136" }, { min: 7, max: null, label: "7+" }];
1506
1642
  var COPY = {
1507
- zh: { title: "\u5E74\u5EA6\u6D3B\u52A8", previous: "\u4E0A\u4E00\u5E74", next: "\u4E0B\u4E00\u5E74", done: "\u5B8C\u6210", publish: "\u53D1\u5E03", shutdown: "\u5173\u95ED", claimed: "\u63A5\u53D6", empty: { done: "\u672C\u5E74\u5EA6\u6CA1\u6709\u5B8C\u6210\u8BB0\u5F55", publish: "\u672C\u5E74\u5EA6\u6CA1\u6709\u53D1\u5E03\u8BB0\u5F55", shutdown: "\u672C\u5E74\u5EA6\u6CA1\u6709\u5173\u95ED\u8BB0\u5F55", claimed: "\u672C\u5E74\u5EA6\u6CA1\u6709\u63A5\u53D6\u8BB0\u5F55" }, loading: "\u6B63\u5728\u52A0\u8F7D\u5E74\u5EA6\u6D3B\u52A8", error: "\u5E74\u5EA6\u6D3B\u52A8\u52A0\u8F7D\u5931\u8D25", retry: "\u91CD\u8BD5", future: "\u672A\u6765\u65E5\u671F", none: "\u65E0\u6D3B\u52A8", clear: "\u6E05\u9664\u6D3B\u52A8\u7B5B\u9009", filter: "\u6D3B\u52A8\u7B5B\u9009", total: "\u6D3B\u52A8\u603B\u6570", dailyCount: "\u6BCF\u65E5\u6B21\u6570", weekdays: ["\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u65E5"], claimedNote: "\u5DF2\u63A5\u53D6/\u5DF2\u5B8C\u6210\u4EFB\u52A1\uFF1B\u5386\u53F2\u4EFB\u52A1\u672A\u8BB0\u5F55\u63A5\u53D6\u65F6\u95F4\uFF0C\u6309\u53D1\u5E03\u65E5\u671F\u8BA1" },
1508
- en: { title: "Annual task activity", previous: "Previous year", next: "Next year", done: "Done", publish: "Published", shutdown: "Closed", claimed: "Claimed", empty: { done: "No completed tasks this year", publish: "No published tasks this year", shutdown: "No closed tasks this year", claimed: "No claimed tasks this year" }, loading: "Loading annual activity", error: "Could not load annual activity", retry: "Retry", future: "Future date", none: "No activity", clear: "Clear activity filter", filter: "Activity filter", total: "Total events", dailyCount: "Daily count", weekdays: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], claimedNote: "claimed or completed tasks; historical tasks without a claim time use the publish date" }
1643
+ zh: { title: "\u5E74\u5EA6\u6D3B\u52A8", previous: "\u4E0A\u4E00\u5E74", next: "\u4E0B\u4E00\u5E74", done: "\u5B8C\u6210", publish: "\u53D1\u5E03", shutdown: "\u5173\u95ED", claimed: "\u63A5\u53D6", target: "\u76EE\u6807", empty: { done: "\u672C\u5E74\u5EA6\u6CA1\u6709\u5B8C\u6210\u8BB0\u5F55", publish: "\u672C\u5E74\u5EA6\u6CA1\u6709\u53D1\u5E03\u8BB0\u5F55", shutdown: "\u672C\u5E74\u5EA6\u6CA1\u6709\u5173\u95ED\u8BB0\u5F55", claimed: "\u672C\u5E74\u5EA6\u6CA1\u6709\u63A5\u53D6\u8BB0\u5F55", target: "\u672C\u5E74\u5EA6\u6CA1\u6709\u76EE\u6807\u8BA1\u5212" }, loading: "\u6B63\u5728\u52A0\u8F7D\u5E74\u5EA6\u6D3B\u52A8", error: "\u5E74\u5EA6\u6D3B\u52A8\u52A0\u8F7D\u5931\u8D25", retry: "\u91CD\u8BD5", future: "\u672A\u6765\u65E5\u671F", none: "\u65E0\u6D3B\u52A8", clear: "\u6E05\u9664\u6D3B\u52A8\u7B5B\u9009", filter: "\u6D3B\u52A8\u7B5B\u9009", total: "\u6D3B\u52A8\u603B\u6570", dailyCount: "\u6BCF\u65E5\u6B21\u6570", weekdays: ["\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u65E5"], claimedNote: "\u5DF2\u63A5\u53D6/\u5DF2\u5B8C\u6210\u4EFB\u52A1\uFF1B\u5386\u53F2\u4EFB\u52A1\u672A\u8BB0\u5F55\u63A5\u53D6\u65F6\u95F4\uFF0C\u6309\u53D1\u5E03\u65E5\u671F\u8BA1", targetNote: "\u6309\u76EE\u6807\u8BA1\u5212\u65E5\u671F\u7EDF\u8BA1\uFF0C\u5C5E\u4E8E\u8BA1\u5212\u53E3\u5F84\uFF0C\u4E0D\u8BA1\u5165\u6D3B\u52A8\u603B\u6570", targetTotal: "\u76EE\u6807\u603B\u6570" },
1644
+ en: { title: "Annual task activity", previous: "Previous year", next: "Next year", done: "Done", publish: "Published", shutdown: "Closed", claimed: "Claimed", target: "Target", empty: { done: "No completed tasks this year", publish: "No published tasks this year", shutdown: "No closed tasks this year", claimed: "No claimed tasks this year", target: "No target dates this year" }, loading: "Loading annual activity", error: "Could not load annual activity", retry: "Retry", future: "Future date", none: "No activity", clear: "Clear activity filter", filter: "Activity filter", total: "Total events", dailyCount: "Daily count", weekdays: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], claimedNote: "claimed or completed tasks; historical tasks without a claim time use the publish date", targetNote: "counted by target plan date; planning scope, not included in total events", targetTotal: "Planned" }
1509
1645
  };
1510
1646
  function localDay(d) {
1511
1647
  return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
@@ -1540,16 +1676,91 @@ var require_heatmap_model = __commonJS({
1540
1676
  }
1541
1677
  function activityParams(params) {
1542
1678
  if (!params || !/^\d{4}-\d{2}-\d{2}$/.test(params.activityDate || "")) return null;
1543
- return { activityDate: params.activityDate, activityType: TYPES.indexOf(params.activityType) >= 0 ? params.activityType : "done" };
1679
+ return { activityDate: params.activityDate, activityType: FILTER_TYPES.indexOf(params.activityType) >= 0 ? params.activityType : "done" };
1544
1680
  }
1545
- module2.exports = { TYPES, LEVELS, COPY, legendLabel, localDay, calendar, level, count, background, label, activityParams };
1681
+ module2.exports = { TYPES, FILTER_TYPES, LEVELS, COPY, legendLabel, localDay, calendar, level, count, background, label, activityParams };
1546
1682
  }
1547
1683
  });
1548
1684
 
1549
1685
  // packages/addons/tasks/client/stats/heatmap-styles.cjs
1550
1686
  var require_heatmap_styles = __commonJS({
1551
1687
  "packages/addons/tasks/client/stats/heatmap-styles.cjs"(exports2, module2) {
1552
- module2.exports = ".wbt-heatmap{--hm-empty:#e9ecef;--hm-done-1:#d3f0d7;--hm-done-2:#91d69c;--hm-done-3:#51b566;--hm-done-4:#2f9e44;--hm-publish-1:#d5e7f8;--hm-publish-2:#96bee6;--hm-publish-3:#568fc7;--hm-publish-4:#2b6cb0;--hm-shutdown-1:#fbdada;--hm-shutdown-2:#f1a0a0;--hm-shutdown-3:#df6262;--hm-shutdown-4:#c92a2a;--hm-claimed-1:#ffedd5;--hm-claimed-2:#fdba74;--hm-claimed-3:#f89a3c;--hm-claimed-4:#d9600d;min-width:0;max-width:100%;border:1px solid color-mix(in srgb,currentColor 15%,transparent);border-radius:12px;padding:16px;margin-bottom:16px;color:inherit;font-size:12px;box-sizing:border-box}.wbt-hm-head,.wbt-hm-legend{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.wbt-hm-head{justify-content:space-between;margin-bottom:16px}.wbt-hm-head h3{margin:0;font-size:14px}.wbt-hm-years{display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums}.wbt-heatmap button{font:inherit;color:inherit}.wbt-hm-control{border:1px solid color-mix(in srgb,currentColor 20%,transparent);background:transparent;border-radius:5px;cursor:pointer;padding:4px 8px}.wbt-hm-control[role=tab]{border:0;outline:none;box-shadow:none}.wbt-hm-control[role=tab]:hover{background:color-mix(in srgb,currentColor 6%,transparent)}.wbt-hm-control[aria-selected=true]{font-weight:700;background:color-mix(in srgb,currentColor 10%,transparent)}.wbt-hm-control[role=tab]:focus-visible{outline:2px solid #568fc7;outline-offset:2px}.wbt-hm-scroll{overflow-x:auto;padding:3px;max-width:100%}.wbt-hm-layout{display:flex;gap:8px;min-width:max-content}.wbt-hm-weekdays{display:grid;grid-template-rows:repeat(7,12px);gap:3px;padding-top:22px;font-size:10px;line-height:12px;opacity:.65}.wbt-hm-body{flex:1;min-width:0}.wbt-hm-months{display:grid;grid-template-columns:repeat(var(--hm-weeks),12px);column-gap:3px;height:22px;font-size:10px}.wbt-hm-months span{white-space:nowrap}.wbt-hm-grid{display:grid;grid-template-columns:repeat(var(--hm-weeks),12px);grid-template-rows:repeat(7,12px);gap:3px}.wbt-hm-day{border:0;border-radius:2px;width:12px;height:12px;padding:0;cursor:pointer}.wbt-hm-day[aria-disabled=true]{cursor:default}.wbt-hm-day{outline:none}.wbt-hm-day:focus-visible{outline:2px solid #568fc7;outline-offset:1px}.wbt-hm-day:hover{filter:brightness(.92)}.wbt-hm-future{opacity:.4}.wbt-hm-legend{margin-top:14px}.wbt-hm-swatch{display:inline-block;width:12px;height:12px;border-radius:2px;vertical-align:-2px;margin-right:5px}.wbt-hm-types{display:flex;align-items:center;gap:10px}.wbt-hm-intensity{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-inline-start:1px solid color-mix(in srgb,currentColor 20%,transparent);padding-inline-start:12px;font-size:11px}.wbt-hm-intensity-label{color:color-mix(in srgb,currentColor 70%,transparent)}.wbt-hm-intensity-item{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.wbt-hm-intensity-item .wbt-hm-swatch{flex:none;margin:0}.wbt-hm-summary{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.wbt-hm-state{padding:28px 8px;text-align:center}.wbt-hm-skeleton{height:102px;border-radius:3px;background:repeating-linear-gradient(90deg,var(--hm-empty) 0 12px,transparent 12px 15px);opacity:.55}.dark .wbt-heatmap,[data-theme=dark] .wbt-heatmap,:root[style*='color-scheme:dark'] .wbt-heatmap,:root[style*='color-scheme: dark'] .wbt-heatmap,[data-color-scheme=dark] .wbt-heatmap{--hm-empty:#303740;--hm-done-1:#21452b;--hm-done-2:#2f7440;--hm-done-3:#46a75c;--hm-done-4:#72d38a;--hm-publish-1:#223e5c;--hm-publish-2:#326496;--hm-publish-3:#508ecb;--hm-publish-4:#85baf0;--hm-shutdown-1:#58292b;--hm-shutdown-2:#914146;--hm-shutdown-3:#c95c63;--hm-shutdown-4:#f58e93;--hm-claimed-1:#4a2f14;--hm-claimed-2:#7a4a16;--hm-claimed-3:#b06d1c;--hm-claimed-4:#e6952f;}@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not([data-color-scheme=light]):not([style*='color-scheme:light']):not([style*='color-scheme: light']) .wbt-heatmap{--hm-empty:#303740;--hm-done-1:#21452b;--hm-done-2:#2f7440;--hm-done-3:#46a75c;--hm-done-4:#72d38a;--hm-publish-1:#223e5c;--hm-publish-2:#326496;--hm-publish-3:#508ecb;--hm-publish-4:#85baf0;--hm-shutdown-1:#58292b;--hm-shutdown-2:#914146;--hm-shutdown-3:#c95c63;--hm-shutdown-4:#f58e93;--hm-claimed-1:#4a2f14;--hm-claimed-2:#7a4a16;--hm-claimed-3:#b06d1c;--hm-claimed-4:#e6952f;}}@media(min-width:1200px){.wbt-hm-layout{min-width:0}.wbt-hm-months,.wbt-hm-grid{grid-template-columns:repeat(var(--hm-weeks),minmax(12px,1fr))}.wbt-hm-day{width:12px}}@media(prefers-reduced-motion:reduce){.wbt-heatmap *{animation:none!important;transition:none!important}}";
1688
+ module2.exports = [
1689
+ ".wbt-heatmap{",
1690
+ "--hm-gap:3px;",
1691
+ "--hm-hue-done:var(--wb-ok,#18a058);",
1692
+ "--hm-hue-publish:var(--wbt-accent,var(--wb-accent,#11a89b));",
1693
+ "--hm-hue-shutdown:var(--wb-danger,#e5484d);",
1694
+ "--hm-hue-claimed:var(--wb-warn,#d48806);",
1695
+ // 目标是计划口径,用中性灰蓝,弱于四类彩色事件;灰阶在浅底上对比度低,
1696
+ // 四档取 26/42/58/74%(比四类事件更高),保证与空白格、与相邻档都能分辨。
1697
+ "--hm-hue-target:var(--wb-muted,#8b8f96);",
1698
+ "--hm-surface:var(--wbt-surface,color-mix(in oklab,currentColor 4%,transparent));",
1699
+ "--hm-empty:color-mix(in oklab,var(--wbt-line,color-mix(in oklab,currentColor 18%,transparent)) 55%,var(--hm-surface));",
1700
+ "--hm-done-1:color-mix(in oklab,var(--hm-hue-done) 14%,var(--hm-surface));",
1701
+ "--hm-done-2:color-mix(in oklab,var(--hm-hue-done) 26%,var(--hm-surface));",
1702
+ "--hm-done-3:color-mix(in oklab,var(--hm-hue-done) 38%,var(--hm-surface));",
1703
+ "--hm-done-4:color-mix(in oklab,var(--hm-hue-done) 52%,var(--hm-surface));",
1704
+ "--hm-publish-1:color-mix(in oklab,var(--hm-hue-publish) 14%,var(--hm-surface));",
1705
+ "--hm-publish-2:color-mix(in oklab,var(--hm-hue-publish) 26%,var(--hm-surface));",
1706
+ "--hm-publish-3:color-mix(in oklab,var(--hm-hue-publish) 38%,var(--hm-surface));",
1707
+ "--hm-publish-4:color-mix(in oklab,var(--hm-hue-publish) 52%,var(--hm-surface));",
1708
+ "--hm-shutdown-1:color-mix(in oklab,var(--hm-hue-shutdown) 14%,var(--hm-surface));",
1709
+ "--hm-shutdown-2:color-mix(in oklab,var(--hm-hue-shutdown) 26%,var(--hm-surface));",
1710
+ "--hm-shutdown-3:color-mix(in oklab,var(--hm-hue-shutdown) 38%,var(--hm-surface));",
1711
+ "--hm-shutdown-4:color-mix(in oklab,var(--hm-hue-shutdown) 52%,var(--hm-surface));",
1712
+ "--hm-claimed-1:color-mix(in oklab,var(--hm-hue-claimed) 14%,var(--hm-surface));",
1713
+ "--hm-claimed-2:color-mix(in oklab,var(--hm-hue-claimed) 26%,var(--hm-surface));",
1714
+ "--hm-claimed-3:color-mix(in oklab,var(--hm-hue-claimed) 38%,var(--hm-surface));",
1715
+ "--hm-claimed-4:color-mix(in oklab,var(--hm-hue-claimed) 52%,var(--hm-surface));",
1716
+ "--hm-target-1:color-mix(in oklab,var(--hm-hue-target) 26%,var(--hm-surface));",
1717
+ "--hm-target-2:color-mix(in oklab,var(--hm-hue-target) 42%,var(--hm-surface));",
1718
+ "--hm-target-3:color-mix(in oklab,var(--hm-hue-target) 58%,var(--hm-surface));",
1719
+ "--hm-target-4:color-mix(in oklab,var(--hm-hue-target) 74%,var(--hm-surface));",
1720
+ // 四档都保留正文色:最深档只混到 52%,深色主题里前景文字对比度仍 ≥4.7,浅色主题 ≥7。
1721
+ "--hm-fg-1:currentColor;--hm-fg-2:currentColor;--hm-fg-3:currentColor;--hm-fg-4:currentColor;",
1722
+ "min-width:0;max-width:100%;border:1px solid var(--wbt-line,color-mix(in oklab,currentColor 15%,transparent));border-radius:12px;padding:16px;margin-bottom:16px;color:inherit;font-size:12px;box-sizing:border-box}",
1723
+ ".wbt-hm-head,.wbt-hm-legend{display:flex;align-items:center;gap:10px;flex-wrap:wrap}",
1724
+ ".wbt-hm-head{justify-content:space-between;margin-bottom:16px}",
1725
+ ".wbt-hm-head h3{margin:0;font-size:14px}",
1726
+ ".wbt-hm-years{display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums}",
1727
+ ".wbt-heatmap button{font:inherit;color:inherit}",
1728
+ ".wbt-hm-control{border:1px solid color-mix(in oklab,currentColor 20%,transparent);background:transparent;border-radius:5px;cursor:pointer;padding:4px 8px}",
1729
+ ".wbt-hm-control[role=tab]{border:0;outline:none;box-shadow:none}",
1730
+ ".wbt-hm-control[role=tab]:hover{background:color-mix(in oklab,currentColor 6%,transparent)}",
1731
+ ".wbt-hm-control[aria-selected=true]{font-weight:700;background:color-mix(in oklab,currentColor 10%,transparent)}",
1732
+ ".wbt-hm-control[role=tab]:focus-visible{outline:2px solid var(--hm-hue-publish);outline-offset:2px}",
1733
+ // 铺满:格子宽度按容器等分,格子之间固定 --hm-gap,既不右侧留白也不把方块拉扁。
1734
+ ".wbt-hm-scroll{overflow-x:auto;padding:3px 0;max-width:100%;container-type:inline-size}",
1735
+ ".wbt-hm-layout{display:flex;gap:8px;align-items:stretch;min-width:0}",
1736
+ ".wbt-hm-weekdays{display:grid;grid-template-rows:repeat(7,1fr);gap:var(--hm-gap);padding-top:22px;font-size:10px;line-height:1;opacity:.65;align-items:center;justify-items:center}",
1737
+ ".wbt-hm-body{flex:1 1 auto;min-width:min-content}",
1738
+ ".wbt-hm-months{display:grid;grid-template-columns:repeat(var(--hm-weeks),minmax(14px,1fr));column-gap:var(--hm-gap);height:22px;font-size:10px;line-height:1}",
1739
+ ".wbt-hm-months span{white-space:nowrap}",
1740
+ ".wbt-hm-grid{display:grid;grid-template-columns:repeat(var(--hm-weeks),minmax(14px,1fr));gap:var(--hm-gap)}",
1741
+ ".wbt-heatmap .wbt-hm-day{border:0;border-radius:3px;width:100%;height:auto;aspect-ratio:1;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;font-size:10px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums}",
1742
+ '.wbt-hm-day[data-level="1"]{color:var(--hm-fg-1)}',
1743
+ '.wbt-hm-day[data-level="2"]{color:var(--hm-fg-2)}',
1744
+ '.wbt-hm-day[data-level="3"]{color:var(--hm-fg-3)}',
1745
+ '.wbt-hm-day[data-level="4"]{color:var(--hm-fg-4)}',
1746
+ ".wbt-heatmap .wbt-hm-num{font-size:clamp(7px,1cqw,11px);font-weight:600;line-height:1;font-variant-numeric:tabular-nums;pointer-events:none}",
1747
+ ".wbt-hm-day[aria-disabled=true]{cursor:default}",
1748
+ ".wbt-hm-day{outline:none}",
1749
+ ".wbt-hm-day:focus-visible{outline:2px solid var(--hm-hue-publish);outline-offset:1px}",
1750
+ ".wbt-hm-day:hover{filter:brightness(.94)}",
1751
+ ".wbt-heatmap .wbt-hm-future{opacity:.4}",
1752
+ ".wbt-hm-legend{margin-top:14px}",
1753
+ ".wbt-hm-swatch{display:inline-block;width:12px;height:12px;border-radius:2px;vertical-align:-2px;margin-right:5px}",
1754
+ ".wbt-hm-types{display:flex;align-items:center;gap:10px}",
1755
+ ".wbt-hm-intensity{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-inline-start:1px solid color-mix(in oklab,currentColor 20%,transparent);padding-inline-start:12px;font-size:11px}",
1756
+ ".wbt-hm-intensity-label{color:color-mix(in oklab,currentColor 70%,transparent)}",
1757
+ ".wbt-hm-intensity-item{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}",
1758
+ ".wbt-hm-intensity-item .wbt-hm-swatch{flex:none;margin:0}",
1759
+ ".wbt-hm-summary{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}",
1760
+ ".wbt-hm-state{padding:28px 8px;text-align:center}",
1761
+ ".wbt-hm-skeleton{height:152px;border-radius:3px;background:repeating-linear-gradient(90deg,var(--hm-empty) 0 14px,transparent 14px 17px);opacity:.55}",
1762
+ "@media(prefers-reduced-motion:reduce){.wbt-heatmap *{animation:none!important;transition:none!important}}"
1763
+ ].join("");
1553
1764
  }
1554
1765
  });
1555
1766
 
@@ -1646,16 +1857,20 @@ var require_heatmap = __commonJS({
1646
1857
  return h("span", { key: d.date, style: { gridColumn: d.column } }, new Date(Date.UTC(year, d.month, 1)).toLocaleString(lang === "en" ? "en-US" : "zh-CN", { month: "short", timeZone: "UTC" }));
1647
1858
  })),
1648
1859
  h("div", { className: "wbt-hm-grid" }, geometry.days.map(function(d) {
1649
- var day = byDate[d.date] || {}, future = d.date > today, enabled = !future && model.count(day, type) > 0;
1650
- var title = model.label(d.date, day, t, type) + (future ? " \xB7 " + t.future : !model.count(day, type) ? " \xB7 " + t.none : "");
1860
+ var day = byDate[d.date] || {}, future = d.date > today, n = future ? 0 : model.count(day, type), enabled = !future && n > 0;
1861
+ var clickable = enabled && type !== "target";
1862
+ var text = !future && n > 0 ? n >= 100 ? "99+" : String(n) : "";
1863
+ var title = model.label(d.date, day, t, type) + (future ? " \xB7 " + t.future : !n ? " \xB7 " + t.none : "");
1651
1864
  return h("button", {
1652
1865
  key: d.date,
1653
1866
  type: "button",
1654
1867
  className: "wbt-hm-day" + (future ? " wbt-hm-future" : ""),
1655
1868
  "data-date": d.date,
1869
+ "data-level": future ? 0 : n ? model.level(n) : 0,
1870
+ "data-type": type,
1656
1871
  title,
1657
1872
  "aria-label": title,
1658
- "aria-disabled": !enabled,
1873
+ "aria-disabled": !clickable,
1659
1874
  style: { gridColumn: d.column, gridRow: d.row, background: future ? "var(--hm-empty)" : model.background(day, type) },
1660
1875
  onMouseEnter: function() {
1661
1876
  setTip(title);
@@ -1670,9 +1885,9 @@ var require_heatmap = __commonJS({
1670
1885
  setTip("");
1671
1886
  },
1672
1887
  onClick: function() {
1673
- if (enabled && props.onNavigate) props.onNavigate("tasks", { activityDate: d.date, activityType: type });
1888
+ if (clickable && props.onNavigate) props.onNavigate("tasks", { activityDate: d.date, activityType: type });
1674
1889
  }
1675
- });
1890
+ }, text ? h("span", { className: "wbt-hm-num", "aria-hidden": true }, text) : null);
1676
1891
  }))
1677
1892
  )
1678
1893
  ))
@@ -1702,8 +1917,9 @@ var require_heatmap = __commonJS({
1702
1917
  setTip("");
1703
1918
  } }, h("span", { className: "wbt-hm-swatch", style: { background: "var(--hm-" + k + "-4)" }, "aria-hidden": true }), t[k]);
1704
1919
  })),
1705
- ready && h("span", { className: "wbt-hm-summary", "aria-live": "polite" }, tip || t.total + " \xB7 " + total),
1920
+ ready && h("span", { className: "wbt-hm-summary", "aria-live": "polite" }, tip || (type === "target" ? t.targetTotal : t.total) + " \xB7 " + total),
1706
1921
  type === "claimed" && h("span", { className: "wbt-hm-intensity-label" }, t.claimedNote),
1922
+ type === "target" && h("span", { className: "wbt-hm-intensity-label" }, t.targetNote),
1707
1923
  h(
1708
1924
  "div",
1709
1925
  { className: "wbt-hm-intensity", role: "img", "aria-label": model.legendLabel(lang) },
@@ -2046,7 +2262,7 @@ var require_timeline_section = __commonJS({
2046
2262
  // packages/addons/tasks/client/stats/list-state.cjs
2047
2263
  var require_list_state = __commonJS({
2048
2264
  "packages/addons/tasks/client/stats/list-state.cjs"(exports2, module2) {
2049
- var LISTS = ["overdue", "recentPublish", "recentDone", "recentShutdown"];
2265
+ var LISTS = ["overdue", "recentPublish", "recentDone", "recentShutdown", "recentClaimed"];
2050
2266
  var COPY = {
2051
2267
  zh: "\u7EDF\u8BA1\u63A5\u53E3\u672A\u8FD4\u56DE\u300C{key}\u300D\u6E05\u5355\uFF0C\u524D\u540E\u7AEF\u7248\u672C\u53EF\u80FD\u4E0D\u4E00\u81F4\uFF1B\u8BF7\u91CD\u542F\u63D2\u4EF6\u670D\u52A1\u540E\u91CD\u8BD5",
2052
2268
  en: 'Stats API did not return the "{key}" list; frontend and backend versions may differ. Restart the plugin service and retry.'
@@ -2075,6 +2291,7 @@ var require_stats = __commonJS({
2075
2291
  var charts = require_charts();
2076
2292
  var configView = require_config();
2077
2293
  var recentColumns = require_recent_columns();
2294
+ var taskTitle = require_task_link();
2078
2295
  var rankingName = require_ranking_name();
2079
2296
  var Heatmap = require_heatmap();
2080
2297
  var Today = require_today();
@@ -2113,6 +2330,12 @@ var require_stats = __commonJS({
2113
2330
  ofActive: "\u5360\u5DF2\u5F00\u542F",
2114
2331
  trend: "\u65B0\u589E / \u5B8C\u6210 / \u5230\u671F\u8D8B\u52BF",
2115
2332
  trendNote: "\u6309\u81EA\u7136\u65E5 / \u5468 / \u6708\u5206\u6876",
2333
+ eventTrend: "\u4E8B\u4EF6\u8D8B\u52BF",
2334
+ eventTrendNote: "\u4E0E\u5E74\u5EA6\u6D3B\u52A8\u540C\u53E3\u5F84\uFF1B\u6309\u65E5 / \u5468 / \u6708\u5206\u6876\uFF0C\u76EE\u6807\u6309\u8BA1\u5212\u5B8C\u6210\u65E5\u671F\u7EDF\u8BA1",
2335
+ publish: "\u53D1\u5E03",
2336
+ target: "\u76EE\u6807",
2337
+ evShutdown: "\u5173\u95ED",
2338
+ evClaimed: "\u63A5\u53D6",
2116
2339
  created: "\u65B0\u589E",
2117
2340
  done: "\u5B8C\u6210",
2118
2341
  due: "\u5230\u671F",
@@ -2125,6 +2348,13 @@ var require_stats = __commonJS({
2125
2348
  difficultyNote: "\u5F53\u524D\u5B58\u91CF\uFF1B\u5305\u542B\u672A\u8BBE\u7F6E",
2126
2349
  difficultyMissing: "\u672A\u586B\u96BE\u5EA6 {n} \u6761",
2127
2350
  difficultyMissingLink: "\u67E5\u770B\u5E76\u8865\u9F50\u96BE\u5EA6",
2351
+ difficultyDimension: "\u96BE\u5EA6\u5206\u5E03\u53E3\u5F84",
2352
+ dimAll: "\u5168\u90E8",
2353
+ dimDone: "\u5B8C\u6210",
2354
+ dimPublish: "\u53D1\u5E03",
2355
+ dimClaimed: "\u63A5\u53D6",
2356
+ dimShutdown: "\u5173\u95ED",
2357
+ difficultyNoteRange: "\u5E74\u5EA6\u6D3B\u52A8\u53E3\u5F84 {from} ~ {to}\uFF1B\u5305\u542B\u672A\u8BBE\u7F6E",
2128
2358
  aging: "\u903E\u671F\u8D26\u9F84",
2129
2359
  agingNote: "\u5F53\u524D\u903E\u671F\u4EFB\u52A1",
2130
2360
  overdueList: "\u903E\u671F\u6E05\u5355",
@@ -2148,6 +2378,12 @@ var require_stats = __commonJS({
2148
2378
  colTarget: "\u8BA1\u5212\u5B8C\u6210",
2149
2379
  colAge: "\u903E\u671F\u5929\u6570",
2150
2380
  colTable: "\u4EFB\u52A1\u8868",
2381
+ recentTasks: "\u6700\u8FD1\u4EFB\u52A1",
2382
+ recentTasksNote: "\u5207\u6362\u7EF4\u5EA6\u67E5\u770B\u6700\u8FD1\u53D1\u5E03 / \u5B8C\u6210 / \u5173\u95ED / \u63A5\u53D6\u7684\u4EFB\u52A1",
2383
+ recentTabPublish: "\u6700\u8FD1\u53D1\u5E03",
2384
+ recentTabDone: "\u6700\u8FD1\u5B8C\u6210",
2385
+ recentTabShutdown: "\u6700\u8FD1\u5173\u95ED",
2386
+ recentTabClaimed: "\u6700\u8FD1\u63A5\u53D6",
2151
2387
  recentPublish: "\u6700\u8FD1\u53D1\u5E03",
2152
2388
  recentPublishNote: "\u6309\u53D1\u5E03\u65E5\u671F\u5012\u5E8F",
2153
2389
  noRecentPublish: "\u8FD8\u6CA1\u6709\u53D1\u5E03\u7684\u4EFB\u52A1",
@@ -2158,6 +2394,7 @@ var require_stats = __commonJS({
2158
2394
  colDate: "\u65E5\u671F",
2159
2395
  noRecentDone: "\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1",
2160
2396
  noRecentShutdown: "\u8FD8\u6CA1\u6709\u5DF2\u5173\u95ED\u7684\u4EFB\u52A1",
2397
+ noRecentClaimed: "\u8FD8\u6CA1\u6709\u5DF2\u63A5\u53D6\u7684\u4EFB\u52A1\uFF08\u63A5\u53D6\u65F6\u95F4\u53EA\u8BB0\u5F55 5.2.15 \u4E4B\u540E\u7684\u64CD\u4F5C\uFF09",
2161
2398
  noOverdue: "\u6CA1\u6709\u903E\u671F\u4EFB\u52A1",
2162
2399
  noData: "\u8FD8\u6CA1\u6709\u4EFB\u52A1\u3002\u5728\u300C\u8BB0\u5F55\u300D\u91CC\u521B\u5EFA\u540E\uFF0C\u8FD9\u91CC\u4F1A\u81EA\u52A8\u6C47\u603B",
2163
2400
  open: "\u5DF2\u5F00\u542F",
@@ -2197,6 +2434,12 @@ var require_stats = __commonJS({
2197
2434
  ofActive: "of active",
2198
2435
  trend: "Created / done / due trend",
2199
2436
  trendNote: "Bucketed by day / week / month",
2437
+ eventTrend: "Event trend",
2438
+ eventTrendNote: "Same scope as annual activity; bucketed by day / week / month, target by planned date",
2439
+ publish: "Published",
2440
+ target: "Target",
2441
+ evShutdown: "Closed",
2442
+ evClaimed: "Claimed",
2200
2443
  created: "Created",
2201
2444
  done: "Done",
2202
2445
  due: "Due",
@@ -2209,6 +2452,13 @@ var require_stats = __commonJS({
2209
2452
  difficultyNote: "Current; includes unset",
2210
2453
  difficultyMissing: "{n} tasks without difficulty",
2211
2454
  difficultyMissingLink: "Review missing difficulty",
2455
+ difficultyDimension: "Difficulty scope",
2456
+ dimAll: "All",
2457
+ dimDone: "Done",
2458
+ dimPublish: "Published",
2459
+ dimClaimed: "Claimed",
2460
+ dimShutdown: "Closed",
2461
+ difficultyNoteRange: "Annual activity scope {from} ~ {to}; includes unset",
2212
2462
  aging: "Overdue aging",
2213
2463
  agingNote: "Current overdue",
2214
2464
  overdueList: "Overdue list",
@@ -2232,6 +2482,12 @@ var require_stats = __commonJS({
2232
2482
  colTarget: "Target",
2233
2483
  colAge: "Days late",
2234
2484
  colTable: "Table",
2485
+ recentTasks: "Recent tasks",
2486
+ recentTasksNote: "Switch the dimension: recently published / completed / closed / claimed",
2487
+ recentTabPublish: "Published",
2488
+ recentTabDone: "Completed",
2489
+ recentTabShutdown: "Closed",
2490
+ recentTabClaimed: "Claimed",
2235
2491
  recentPublish: "Recently published",
2236
2492
  recentPublishNote: "Newest publication first",
2237
2493
  noRecentPublish: "No published tasks yet",
@@ -2242,6 +2498,7 @@ var require_stats = __commonJS({
2242
2498
  colDate: "Date",
2243
2499
  noRecentDone: "No completed tasks yet",
2244
2500
  noRecentShutdown: "No closed tasks yet",
2501
+ noRecentClaimed: "No claimed tasks yet (claim time is only recorded after 5.2.15)",
2245
2502
  noOverdue: "No overdue tasks",
2246
2503
  noData: "No tasks yet. Create one in Tasks and the summary appears here.",
2247
2504
  open: "Active",
@@ -2267,7 +2524,7 @@ var require_stats = __commonJS({
2267
2524
  onNavigate("tasks", { priorityMin: n, priorityMax: n });
2268
2525
  };
2269
2526
  }
2270
- function difficultyPicker(onNavigate) {
2527
+ function difficultyPicker(onNavigate, dimension, range) {
2271
2528
  if (typeof onNavigate !== "function") return null;
2272
2529
  return function(bin) {
2273
2530
  var key = bin && bin.key;
@@ -2277,10 +2534,19 @@ var require_stats = __commonJS({
2277
2534
  }
2278
2535
  var n = Number(key);
2279
2536
  if (!(n >= 0.5 && n <= 5)) return;
2280
- onNavigate("tasks", { difficultyMin: n, difficultyMax: n });
2537
+ if (!dimension || dimension === "all") {
2538
+ onNavigate("tasks", { difficultyMin: n, difficultyMax: n });
2539
+ return;
2540
+ }
2541
+ var params = { filterRoot: true, difficultyMin: n, difficultyMax: n };
2542
+ if (range && range.from && range.to) {
2543
+ params[dimension + "From"] = range.from;
2544
+ params[dimension + "To"] = range.to;
2545
+ }
2546
+ onNavigate("tasks", params);
2281
2547
  };
2282
2548
  }
2283
- var CFG_FALLBACK = { "stats.range": "30d", "stats.top": 10, "stats.showKpi": true, "stats.recentPublishLimit": 10, "stats.recentDoneLimit": 10, "stats.recentShutdownLimit": 10 };
2549
+ var CFG_FALLBACK = { "stats.range": "30d", "stats.top": 10, "stats.showKpi": true, "stats.recentPublishLimit": 10, "stats.recentDoneLimit": 10, "stats.recentShutdownLimit": 10, "stats.recentClaimedLimit": 10 };
2284
2550
  function TasksStatsView(props) {
2285
2551
  var lang = props.lang === "en" ? "en" : "zh";
2286
2552
  var cfg = configView.useConfig(props.api, CFG_FALLBACK);
@@ -2307,6 +2573,10 @@ var require_stats = __commonJS({
2307
2573
  }, []);
2308
2574
  var rangePair = React.useState(cfgRange);
2309
2575
  var range = rangePair[0], setRange = rangePair[1];
2576
+ var dimPair = React.useState("all");
2577
+ var dimension = dimPair[0], setDimension = dimPair[1];
2578
+ var recentPair = React.useState("publish");
2579
+ var recentType = recentPair[0], setRecentType = recentPair[1];
2310
2580
  var dataPair = React.useState(null);
2311
2581
  var data = dataPair[0], setData = dataPair[1];
2312
2582
  var errPair = React.useState("");
@@ -2340,10 +2610,12 @@ var require_stats = __commonJS({
2340
2610
  var id = ++req.current;
2341
2611
  if (!silent) setLoading(true);
2342
2612
  var args = {
2613
+ dimension,
2343
2614
  top: cfgTop,
2344
2615
  recentPublishLimit: cfgLimit("stats.recentPublishLimit"),
2345
2616
  recentDoneLimit: cfgLimit("stats.recentDoneLimit"),
2346
- recentShutdownLimit: cfgLimit("stats.recentShutdownLimit")
2617
+ recentShutdownLimit: cfgLimit("stats.recentShutdownLimit"),
2618
+ recentClaimedLimit: cfgLimit("stats.recentClaimedLimit")
2347
2619
  };
2348
2620
  if (customOk) {
2349
2621
  args.from = customFrom;
@@ -2363,7 +2635,7 @@ var require_stats = __commonJS({
2363
2635
  }).then(function() {
2364
2636
  if (id === req.current) setLoading(false);
2365
2637
  });
2366
- }, [api, range, customOk, customFrom, customTo, cfgTop, cfg]);
2638
+ }, [api, range, dimension, customOk, customFrom, customTo, cfgTop, cfg]);
2367
2639
  React.useEffect(function() {
2368
2640
  if (props.active !== false) load(true);
2369
2641
  }, [load, props.active]);
@@ -2423,6 +2695,21 @@ var require_stats = __commonJS({
2423
2695
  if (totals.total === 0) {
2424
2696
  children.push(h(ch.Card, { key: "empty", span: 12 }, h(ch.Empty, { text: t.noData })));
2425
2697
  } else {
2698
+ children.push(h(
2699
+ ch.Card,
2700
+ { key: "eventTrend", span: 12, title: t.eventTrend, note: t.eventTrendNote },
2701
+ h(ch.Trend, {
2702
+ data: data.eventTrend || [],
2703
+ lang,
2704
+ series: [
2705
+ { key: "publish", label: t.publish, color: ch.colors[0] },
2706
+ { key: "target", label: t.target, color: ch.colors[5] },
2707
+ { key: "done", label: t.done, color: ch.colors[1] },
2708
+ { key: "shutdown", label: t.evShutdown, color: ch.colors[3] },
2709
+ { key: "claimed", label: t.evClaimed, color: ch.colors[2] }
2710
+ ]
2711
+ })
2712
+ ));
2426
2713
  children.push(h(
2427
2714
  ch.Card,
2428
2715
  { key: "trend", span: 8, title: t.trend, note: t.trendNote },
@@ -2465,12 +2752,31 @@ var require_stats = __commonJS({
2465
2752
  var missingBin = (b.difficulty || []).find(function(bin) {
2466
2753
  return bin.key === "unset";
2467
2754
  });
2755
+ var dims = [["all", t.dimAll], ["done", t.dimDone], ["publish", t.dimPublish], ["claimed", t.dimClaimed], ["shutdown", t.dimShutdown]];
2756
+ var rangeBox = data.range || {};
2757
+ var diffNote = dimension === "all" ? t.difficultyNote : t.difficultyNoteRange.replace("{from}", String(rangeBox.from || "")).replace("{to}", String(rangeBox.to || ""));
2468
2758
  children.push(h(
2469
2759
  ch.Card,
2470
- { key: "difficulty", span: 6, title: t.difficulty, note: t.difficultyNote },
2760
+ { key: "difficulty", span: 6, title: t.difficulty, note: diffNote },
2761
+ h(
2762
+ "div",
2763
+ { className: "wbt-dims", role: "tablist", "aria-label": t.difficultyDimension },
2764
+ dims.map(function(item) {
2765
+ return h("button", {
2766
+ key: item[0],
2767
+ type: "button",
2768
+ role: "tab",
2769
+ className: "wbt-dims-tab",
2770
+ "aria-selected": dimension === item[0],
2771
+ onClick: function() {
2772
+ setDimension(item[0]);
2773
+ }
2774
+ }, item[1]);
2775
+ })
2776
+ ),
2471
2777
  h(ch.Histogram, { data: (b.difficulty || []).map(function(bin) {
2472
2778
  return bin.key === "unset" ? Object.assign({}, bin, { label: lang === "en" ? "Unset" : "\u672A\u8BBE\u7F6E" }) : bin;
2473
- }), lang, color: ch.colors[4], onSelect: difficultyPicker(props.onNavigate), selectHint: lang === "en" ? "click to list" : "\u70B9\u51FB\u67E5\u770B\u4EFB\u52A1" }),
2779
+ }), lang, color: ch.colors[4], onSelect: difficultyPicker(props.onNavigate, dimension, dims.length ? data.range || null : null), selectHint: lang === "en" ? "click to list" : "\u70B9\u51FB\u67E5\u770B\u4EFB\u52A1" }),
2474
2780
  h(
2475
2781
  "p",
2476
2782
  null,
@@ -2493,7 +2799,7 @@ var require_stats = __commonJS({
2493
2799
  lang,
2494
2800
  empty: t.noOverdue,
2495
2801
  columns: [
2496
- { key: "title", label: t.colTitle },
2802
+ { key: "title", label: t.colTitle, render: taskTitle(lang, props.onNavigate) },
2497
2803
  { key: "targetDate", label: t.colTarget },
2498
2804
  { key: "daysOverdue", label: t.colAge, num: true },
2499
2805
  { key: "tableTitle", label: t.colTable }
@@ -2559,20 +2865,36 @@ var require_stats = __commonJS({
2559
2865
  ));
2560
2866
  children.push(h(TimelineSection, { key: "timeline", api, lang, active: props.active, ch }));
2561
2867
  var recentCols = recentColumns(t, lang, props.onNavigate);
2868
+ var recentTabs = [
2869
+ ["publish", t.recentTabPublish, "recentPublish", t.noRecentPublish],
2870
+ ["done", t.recentTabDone, "recentDone", t.noRecentDone],
2871
+ ["shutdown", t.recentTabShutdown, "recentShutdown", t.noRecentShutdown],
2872
+ ["claimed", t.recentTabClaimed, "recentClaimed", t.noRecentClaimed]
2873
+ ];
2874
+ var recentTab = recentTabs[0];
2875
+ recentTabs.forEach(function(item) {
2876
+ if (item[0] === recentType) recentTab = item;
2877
+ });
2562
2878
  children.push(h(
2563
2879
  ch.Card,
2564
- { key: "recentPublish", span: 4, title: t.recentPublish, note: t.recentPublishNote },
2565
- h(ch.DataTable, listProps(data, "recentPublish", lang, { lang, empty: t.noRecentPublish, columns: recentCols }))
2566
- ));
2567
- children.push(h(
2568
- ch.Card,
2569
- { key: "recentDone", span: 4, title: t.recentDone, note: t.recentDoneNote },
2570
- h(ch.DataTable, listProps(data, "recentDone", lang, { lang, empty: t.noRecentDone, columns: recentCols }))
2571
- ));
2572
- children.push(h(
2573
- ch.Card,
2574
- { key: "recentShutdown", span: 4, title: t.recentShutdown, note: t.recentShutdownNote },
2575
- h(ch.DataTable, listProps(data, "recentShutdown", lang, { lang, empty: t.noRecentShutdown, columns: recentCols }))
2880
+ { key: "recent", span: 12, title: t.recentTasks, note: t.recentTasksNote },
2881
+ h(
2882
+ "div",
2883
+ { className: "wbt-dims", role: "tablist", "aria-label": t.recentTasks },
2884
+ recentTabs.map(function(item) {
2885
+ return h("button", {
2886
+ key: item[0],
2887
+ type: "button",
2888
+ role: "tab",
2889
+ className: "wbt-dims-tab",
2890
+ "aria-selected": recentType === item[0],
2891
+ onClick: function() {
2892
+ setRecentType(item[0]);
2893
+ }
2894
+ }, item[1]);
2895
+ })
2896
+ ),
2897
+ h(ch.DataTable, listProps(data, recentTab[2], lang, { lang, empty: recentTab[3], columns: recentCols }))
2576
2898
  ));
2577
2899
  }
2578
2900
  children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
@@ -3027,7 +3349,9 @@ var require_data_view = __commonJS({
3027
3349
  }
3028
3350
  function loadTables() {
3029
3351
  setLoadingTables(true);
3030
- Promise.resolve(api.call(DOMAIN + ".dataTables")).then(function(r) {
3352
+ Promise.resolve((options.tablesLoader || function(a) {
3353
+ return a.call(DOMAIN + ".dataTables");
3354
+ })(api)).then(function(r) {
3031
3355
  if (r && r.ok === false) throw new Error(r && r.error || t.loadFail);
3032
3356
  var body = unwrap(r);
3033
3357
  if (!body || !Array.isArray(body.tables)) throw new Error(t.loadFail);
@@ -3092,7 +3416,9 @@ var require_data_view = __commonJS({
3092
3416
  if (sort) args.sort = sort;
3093
3417
  if (search) args.search = search;
3094
3418
  if (Object.keys(filters).length) args.filters = filters;
3095
- Promise.resolve(api.call(DOMAIN + ".dataQuery", args)).then(function(r) {
3419
+ Promise.resolve((options.query || function(a, q) {
3420
+ return a.call(DOMAIN + ".dataQuery", q);
3421
+ })(api, args)).then(function(r) {
3096
3422
  if (req !== reqRef.current) return;
3097
3423
  if (r && r.ok === false) throw new Error(r && r.error || t.queryFail);
3098
3424
  var body = unwrap(r);
@@ -3474,7 +3800,7 @@ var require_data_view = __commonJS({
3474
3800
  }
3475
3801
  }
3476
3802
  }),
3477
- h("span", null, fmt(t.queryTime, { n: data ? data.queryMs : 0 }))
3803
+ data && data.queryMs !== void 0 ? h("span", null, fmt(t.queryTime, { n: data.queryMs })) : null
3478
3804
  );
3479
3805
  }
3480
3806
  if (!tables && loadingTables && options.Skeleton) return h(options.Skeleton, { lang, label: t.loading });
@@ -3510,7 +3836,7 @@ var require_data_view = __commonJS({
3510
3836
  "span",
3511
3837
  { className: P + "-stabname" },
3512
3838
  h("span", null, tableLabel(tb)),
3513
- h("span", { className: P + "-sidecount" }, String(tb.count))
3839
+ h("span", { className: P + "-sidecount" }, tb.count === void 0 || tb.count === null ? "" : String(tb.count))
3514
3840
  ),
3515
3841
  h("span", { className: P + "-sidetable" }, tb.name)
3516
3842
  );
@@ -3537,7 +3863,7 @@ var require_data_view = __commonJS({
3537
3863
  h(
3538
3864
  "div",
3539
3865
  { className: P + "-sub" },
3540
- current ? fmt(t.rowCount, { n: current.count }) : "",
3866
+ current && data && data.total !== void 0 ? fmt(t.rowCount, { n: data.total }) : "",
3541
3867
  current && current.deletedCount ? " \xB7 " + fmt(t.deletedCount, { n: current.deletedCount }) : "",
3542
3868
  " \xB7 " + t.subtitle
3543
3869
  )
@@ -4097,7 +4423,7 @@ var require_action_schema_view = __commonJS({
4097
4423
  "div",
4098
4424
  { className: P + "-cardhead" },
4099
4425
  h("code", { className: P + "-mono" }, Highlight.hit(action.name, kw)),
4100
- h("span", { className: P + "-badge" }, action.domain),
4426
+ // 域名在页头已展示一次,卡片内不再重复(所有条目必然同域,见 visible 过滤)。
4101
4427
  h("span", { className: P + "-badge" }, rows.length ? t.paramCount(rows.length) : t.noParams),
4102
4428
  rows.some(function(row) {
4103
4429
  return row.required;
@@ -4269,7 +4595,7 @@ var require_copy = __commonJS({
4269
4595
  timelineSearch: "\u641C\u7D22\u65F6\u95F4\u7EBF\u6807\u9898\u6216\u63CF\u8FF0",
4270
4596
  timelineSearchButton: "\u641C\u7D22",
4271
4597
  timelineMembers: "\u6210\u5458\u4EFB\u52A1",
4272
- timelineOrder: "\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217\uFF0C\u70B9\u51FB\u4EFB\u52A1\u6253\u5F00\u8BE6\u60C5",
4598
+ timelineOrder: "\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217\uFF0C\u70B9\u51FB\u4EFB\u52A1\u6253\u5F00\u9884\u89C8",
4273
4599
  timelineSearchEmpty: "\u6CA1\u6709\u627E\u5230\u5305\u542B \u201C{query}\u201D \u7684\u65F6\u95F4\u7EBF",
4274
4600
  timelineEmpty: "\u6682\u65E0\u65F6\u95F4\u7EBF\uFF0C\u53EF\u70B9\u51FB\u201C\u65B0\u5EFA\u65F6\u95F4\u7EBF\u201D\u624B\u52A8\u5EFA\u7ACB\u3002",
4275
4601
  timelineOpen: "\u5F00\u542F",
@@ -4281,19 +4607,21 @@ var require_copy = __commonJS({
4281
4607
  timelinePreview: "\u9884\u89C8\u5408\u5E76",
4282
4608
  timelinePreviewCount: "\u5C06\u79FB\u52A8 {n} \u6761\u4EFB\u52A1\u5230\u76EE\u6807\u65F6\u95F4\u7EBF\u3002",
4283
4609
  timelineConfirm: "\u786E\u8BA4\u5408\u5E76",
4610
+ previewLabel: "\u4EFB\u52A1\u9884\u89C8",
4611
+ previewUntitled: "\u672A\u547D\u540D\u4EFB\u52A1",
4612
+ previewOpen: "\u70B9\u51FB\u9884\u89C8\u4EFB\u52A1",
4613
+ previewHint: "\u53EA\u8BFB\u9884\u89C8\uFF1B\u9700\u8981\u4FEE\u6539\u8BF7\u70B9\u4E0B\u65B9\u300C\u7F16\u8F91\u4EFB\u52A1\u300D\u3002",
4284
4614
  bodyModeToggle: bodyCopy.zh.bodyModeToggle,
4285
4615
  bodyMode: "\u63CF\u8FF0\u4E0E\u611F\u53D7\u663E\u793A\u6A21\u5F0F",
4286
4616
  markdown: "Markdown \u6E32\u67D3",
4287
4617
  plainText: "\u7EAF\u6587\u672C",
4288
4618
  bodyModeLocal: "\u5DF2\u5728\u5F53\u524D\u6D4F\u89C8\u5668\u5207\u6362\uFF0C\u914D\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF1A",
4289
4619
  title: "\u4EFB\u52A1",
4290
- search: "\u641C\u7D22\u6807\u9898 / \u63CF\u8FF0 / \u611F\u53D7",
4620
+ search: "\u641C\u7D22\u6807\u9898 / \u63CF\u8FF0 / \u611F\u53D7 / \u4EFB\u52A1 ID",
4291
4621
  newTask: "\u65B0\u5EFA\u4EFB\u52A1",
4292
4622
  tree: "\u4EFB\u52A1\u6811",
4293
4623
  select: "\u9009\u62E9",
4294
4624
  cancelSelect: "\u9000\u51FA\u9009\u62E9",
4295
- list: "\u5217\u8868",
4296
- card: "\u5361\u7247",
4297
4625
  all: "\u5168\u90E8",
4298
4626
  empty: "\u8FD9\u4E2A\u89C6\u56FE\u8FD8\u6CA1\u6709\u4EFB\u52A1",
4299
4627
  loading: "\u52A0\u8F7D\u4E2D\u2026",
@@ -4302,6 +4630,7 @@ var require_copy = __commonJS({
4302
4630
  cancel: "\u53D6\u6D88",
4303
4631
  create: "\u521B\u5EFA",
4304
4632
  close: "\u5173\u95ED",
4633
+ taskId: "\u4EFB\u52A1 ID",
4305
4634
  addGroup: "\u65B0\u5EFA\u7EC4",
4306
4635
  addTable: "\u65B0\u5EFA\u8868",
4307
4636
  rename: "\u91CD\u547D\u540D",
@@ -4433,7 +4762,7 @@ var require_copy = __commonJS({
4433
4762
  timelineSearch: "Search timeline titles or descriptions",
4434
4763
  timelineSearchButton: "Search",
4435
4764
  timelineMembers: "Member tasks",
4436
- timelineOrder: "Oldest publication first. Click a task to open details.",
4765
+ timelineOrder: "Oldest publication first. Click a task to open a preview.",
4437
4766
  timelineSearchEmpty: "No timelines contain \u201C{query}\u201D.",
4438
4767
  timelineEmpty: "No timelines yet. Use New timeline to create one manually.",
4439
4768
  timelineOpen: "Open",
@@ -4445,19 +4774,21 @@ var require_copy = __commonJS({
4445
4774
  timelinePreview: "Preview merge",
4446
4775
  timelinePreviewCount: "{n} tasks will move into the target timeline.",
4447
4776
  timelineConfirm: "Confirm merge",
4777
+ previewLabel: "Task preview",
4778
+ previewUntitled: "Untitled task",
4779
+ previewOpen: "Click to preview task",
4780
+ previewHint: "Read-only preview. Use Edit task below to make changes.",
4448
4781
  bodyModeToggle: bodyCopy.en.bodyModeToggle,
4449
4782
  bodyMode: "Description and reflection display mode",
4450
4783
  markdown: "Render Markdown",
4451
4784
  plainText: "Plain text",
4452
4785
  bodyModeLocal: "Changed in this browser; could not save config:",
4453
4786
  title: "Tasks",
4454
- search: "Search title / description / feeling",
4787
+ search: "Search title / description / feeling / task ID",
4455
4788
  newTask: "New task",
4456
4789
  tree: "Task tree",
4457
4790
  select: "Select",
4458
4791
  cancelSelect: "Exit select",
4459
- list: "List",
4460
- card: "Cards",
4461
4792
  all: "All",
4462
4793
  empty: "No tasks in this view",
4463
4794
  loading: "Loading\u2026",
@@ -4466,6 +4797,7 @@ var require_copy = __commonJS({
4466
4797
  cancel: "Cancel",
4467
4798
  create: "Create",
4468
4799
  close: "Close",
4800
+ taskId: "Task ID",
4469
4801
  addGroup: "New group",
4470
4802
  addTable: "New table",
4471
4803
  rename: "Rename",
@@ -6696,6 +7028,13 @@ var require_description = __commonJS({
6696
7028
  var React = require("react");
6697
7029
  var h = React.createElement;
6698
7030
  var Body = require_markdown().createBody(React);
7031
+ var bodies = typeof WeakMap === "function" ? /* @__PURE__ */ new WeakMap() : null;
7032
+ function bodyFor(Highlight) {
7033
+ if (!Highlight) return Body;
7034
+ if (!bodies) return require_markdown().createBody(React, Highlight);
7035
+ if (!bodies.has(Highlight)) bodies.set(Highlight, require_markdown().createBody(React, Highlight));
7036
+ return bodies.get(Highlight);
7037
+ }
6699
7038
  var BodyMode = require_body_toggle()(React);
6700
7039
  var copy = require_body_copy();
6701
7040
  var Code = (init_code_2(), __toCommonJS(code_2_exports)).default;
@@ -6714,6 +7053,7 @@ var require_description = __commonJS({
6714
7053
  var mode = React.useState(props.bodyMode === "text" ? "text" : "markdown");
6715
7054
  var labelId = require_body_id()(React) + "-desc", t = copy[props.lang === "en" ? "en" : "zh"];
6716
7055
  var text = props.text == null ? "" : String(props.text);
7056
+ var DescBody = bodyFor(props.Highlight);
6717
7057
  var expanded = React.useState(false), overflow = React.useState(false), ref = React.useRef(null);
6718
7058
  React.useEffect(function() {
6719
7059
  expanded[1](false);
@@ -6747,7 +7087,7 @@ var require_description = __commonJS({
6747
7087
  h(
6748
7088
  "div",
6749
7089
  { ref, className: "wb-desc-text" + (expanded[0] ? "" : " wb-desc-clamped") },
6750
- h(Body, { text, mode: mode[0] })
7090
+ h(DescBody, { text, mode: mode[0], keyword: props.keyword })
6751
7091
  ),
6752
7092
  overflow[0] || expanded[0] ? h("button", {
6753
7093
  type: "button",
@@ -6764,6 +7104,37 @@ var require_description = __commonJS({
6764
7104
  }
6765
7105
  });
6766
7106
 
7107
+ // packages/addons/lib/filter-checklist-styles.cjs
7108
+ var require_filter_checklist_styles = __commonJS({
7109
+ "packages/addons/lib/filter-checklist-styles.cjs"(exports2, module2) {
7110
+ "use strict";
7111
+ module2.exports = [
7112
+ ".wbck{display:flex;flex-direction:column;min-width:0}",
7113
+ ".wbck-search{padding:0 0 6px}",
7114
+ ".wbck-input{width:100%;box-sizing:border-box;font:inherit;font-size:12.5px;padding:6px 9px;border:1px solid var(--wb-border);border-radius:8px;background:var(--wb-surface);color:inherit}",
7115
+ ".wbck-input:focus-visible{outline:2px solid var(--wb-accent);outline-offset:1px}",
7116
+ ".wbck-input:disabled{opacity:.6;cursor:not-allowed}",
7117
+ ".wbck-head{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--wb-muted);padding:2px 4px 7px}",
7118
+ ".wbck-grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7119
+ ".wbck-sel{flex:none;color:var(--wb-accent)}",
7120
+ ".wbck-clear{appearance:none;flex:none;border:0;background:transparent;color:inherit;border-radius:4px;margin:0;padding:3px 5px;font:inherit;font-size:11.5px;line-height:1;cursor:pointer;opacity:.75}",
7121
+ ".wbck-clear:hover:enabled{opacity:1;background:color-mix(in srgb, currentColor 8%, transparent)}",
7122
+ ".wbck-clear:focus-visible{outline:2px solid var(--wb-accent);outline-offset:1px}",
7123
+ ".wbck-clear:disabled{opacity:.4;cursor:not-allowed}",
7124
+ ".wbck-list{max-height:220px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--wb-border);border-radius:10px;padding:2px}",
7125
+ ".wbck-opt{display:flex;align-items:center;gap:7px;padding:6px;border-radius:6px;font-size:12.5px;cursor:pointer}",
7126
+ ".wbck-opt:hover{background:color-mix(in srgb, currentColor 7%, transparent)}",
7127
+ ".wbck-opt.is-on{background:color-mix(in srgb, var(--wb-accent) 10%, transparent)}",
7128
+ ".wbck-opt input{margin:0;flex:none;accent-color:var(--wb-accent)}",
7129
+ ".wbck-nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7130
+ ".wbck-meta{margin-left:auto;flex:none;font-size:11.5px;color:var(--wb-muted)}",
7131
+ ".wbck-note{font-size:12px;color:var(--wb-muted);padding:8px 6px}",
7132
+ ".wbck-more{font-size:11px;color:var(--wb-muted);text-align:center;padding:6px 0 2px;opacity:.8}",
7133
+ "@media (max-width:760px){.wbck-list{max-height:200px}}"
7134
+ ];
7135
+ }
7136
+ });
7137
+
6767
7138
  // packages/addons/tasks/client/ui/styles.cjs
6768
7139
  var require_styles = __commonJS({
6769
7140
  "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
@@ -6821,6 +7192,8 @@ var require_styles = __commonJS({
6821
7192
  ".wbt-item.closed{opacity:.62}",
6822
7193
  ".wbt-item.closed .wbt-title{text-decoration:line-through}",
6823
7194
  ".wbt-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}",
7195
+ ".wbt-item-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.4;letter-spacing:.2px;opacity:.55;color:inherit;user-select:text;-webkit-user-select:text;overflow-wrap:anywhere;word-break:break-all;border-top:1px dashed color-mix(in oklab,var(--wbt-line) 80%,transparent);margin-top:2px;padding-top:5px;cursor:text}",
7196
+ ".wbt-item-id:hover{opacity:.8}",
6824
7197
  ".wbt-chead{display:flex;align-items:flex-start;gap:10px;min-width:0}",
6825
7198
  ".wbt-line1{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap;flex:1 1 auto}",
6826
7199
  ".wbt-title{font-weight:620;font-size:14px;line-height:1.38;letter-spacing:.1px;word-break:break-word;overflow-wrap:anywhere;max-width:100%}",
@@ -6852,15 +7225,29 @@ var require_styles = __commonJS({
6852
7225
  ".wbt-wschip button:hover{opacity:1}",
6853
7226
  ".wbt-wschip-ro{opacity:.85;background:transparent}",
6854
7227
  ".wbt-wsfilter{width:100%}",
7228
+ ".wbt-wslist{display:flex;flex-direction:column;gap:1px;max-height:200px;overflow:auto;border:1px solid var(--wbt-line);border-radius:8px;padding:4px;background:var(--wbt-bg);box-sizing:border-box;min-width:0}",
7229
+ ".wbt-wsopt{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;border:1px solid transparent;background:transparent;color:inherit;font:inherit;padding:5px 8px;border-radius:6px;cursor:pointer;min-width:0;box-sizing:border-box}",
7230
+ ".wbt-wsopt:hover{background:color-mix(in oklab,var(--wbt-accent) 7%,transparent)}",
7231
+ ".wbt-wsopt.on{background:color-mix(in oklab,var(--wbt-accent) 11%,transparent);border-color:color-mix(in oklab,var(--wbt-accent) 40%,transparent)}",
7232
+ ".wbt-wsopt:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:-2px}",
7233
+ ".wbt-wsopt-title{display:flex;align-items:center;gap:6px;min-width:0;font-size:12.5px;font-weight:560;line-height:1.35}",
7234
+ ".wbt-wsopt-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7235
+ ".wbt-wsopt-check{flex:none;font-size:11px;font-weight:700;color:var(--wbt-accent)}",
7236
+ ".wbt-wsopt-meta{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px;opacity:.55;line-height:1.3}",
7237
+ ".wbt-wsopt-count{flex:none;font-variant-numeric:tabular-nums}",
7238
+ ".wbt-wsopt-meta code{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;background:color-mix(in oklab,currentColor 8%,transparent);border-radius:4px;padding:0 4px}",
7239
+ ".wbt-wsrow{display:flex;align-items:center;gap:6px;min-width:0}",
7240
+ ".wbt-wsrow .wbt-input{flex:1 1 auto;min-width:0}",
7241
+ ".wbt-wsrow .wbt-btn{flex:none}",
7242
+ ".wbt-wscreate{display:flex;flex-direction:column;gap:5px;min-width:0}",
7243
+ ".wbt-wscreate .wbt-input{width:100%;box-sizing:border-box}",
7244
+ ".wbt-hint{font-size:11.5px;opacity:.62;line-height:1.5;overflow-wrap:anywhere}",
6855
7245
  ".wbt-muted-link{opacity:.7;text-decoration-style:dashed}",
6856
7246
  ".wbt-wsmenu .wbt-tagopt{padding:5px 6px}",
6857
7247
  ".wbt-wsmenu .wbt-wsnone{border-top:1px dashed var(--wbt-line);margin-top:4px;padding-top:7px}",
6858
7248
  ".wbt-ws-group .wbt-check{min-width:0;overflow-wrap:anywhere}",
6859
7249
  ".wbt-ws-select{display:flex;flex-direction:column;gap:6px;min-width:0}",
6860
7250
  ".wbt-ws-select .wbt-picker-list{max-height:180px}",
6861
- ".wbt-ops-block{width:100%;min-width:0;justify-content:flex-start;flex-wrap:wrap;padding-top:2px;margin-top:2px}",
6862
- ".wbt-card .wbt-chead{row-gap:0}",
6863
- ".wbt-card .wbt-metazone .wbt-meta{row-gap:2px}",
6864
7251
  ".wbt-tagfilter{position:relative;display:flex;align-items:center;gap:5px;min-width:0}",
6865
7252
  ".wbt-tagfilter .wbt-btn.on{border-color:var(--wbt-accent);color:var(--wbt-accent);background:color-mix(in oklab,var(--wbt-accent) 12%,transparent)}",
6866
7253
  ".wbt-tagsearch{padding:0 0 6px}",
@@ -6872,7 +7259,6 @@ var require_styles = __commonJS({
6872
7259
  ".wbt-tagx{opacity:.7;font-size:12px;line-height:1}",
6873
7260
  ".wbt-taglist{max-height:236px;overflow:auto;overscroll-behavior:contain}",
6874
7261
  ".wbt-tagmore{font-size:11px;opacity:.5;text-align:center;padding:6px 0 2px}",
6875
- ".wbt-card .wbt-metazone{row-gap:3px}",
6876
7262
  ".wbt-tagmenu{position:absolute;z-index:60;top:calc(100% + 6px);right:0;width:236px;max-height:320px;overflow:auto;padding:8px;border-radius:10px;border:1px solid var(--wbt-line);box-shadow:0 14px 34px rgba(26,20,12,.2);background-color:var(--wbt-bg);background-image:linear-gradient(var(--wbt-bg),var(--wbt-bg)),linear-gradient(var(--wbt-bg),var(--wbt-bg));-webkit-backdrop-filter:blur(24px) saturate(1.4);backdrop-filter:blur(24px) saturate(1.4)}",
6877
7263
  ".wbt-tagmenu-head{display:flex;align-items:center;gap:6px;font-size:11px;opacity:.6;padding:2px 4px 7px}",
6878
7264
  ".wbt-tagopt{display:flex;align-items:center;gap:7px;padding:6px;border-radius:6px;cursor:pointer;font-size:12.5px}",
@@ -6898,9 +7284,6 @@ var require_styles = __commonJS({
6898
7284
  ".wbt-ops .wbt-act-done:hover{background:color-mix(in oklab,var(--dsw-alias-state-success-primary,#2f9e44) 16%,transparent)}",
6899
7285
  ".wbt-ops .wbt-act-close{color:var(--dsw-alias-state-error-primary,#b4434a)}",
6900
7286
  ".wbt-ops .wbt-act-close:hover{background:color-mix(in oklab,var(--dsw-alias-state-error-primary,#e5484d) 10%,transparent)}",
6901
- ".wbt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr));gap:9px;min-width:0;max-width:100%}",
6902
- ".wbt-card .wbt-main,.wbt-card .wbt-chead,.wbt-card .wbt-line1{width:100%;min-width:0;max-width:100%}",
6903
- ".wbt-card{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-height:150px;width:100%;min-width:0;max-width:100%;box-sizing:border-box;overflow:hidden}",
6904
7287
  ".wbt-empty{border:1px dashed var(--wbt-line);border-radius:11px;padding:34px 12px;text-align:center;opacity:.5;font-size:12.5px}",
6905
7288
  ".wbt-err{font-size:12.5px;color:var(--dsw-alias-state-error-primary,#e5484d);line-height:1.5}",
6906
7289
  ".wbt-pager{display:flex;gap:8px;align-items:center;justify-content:flex-end;font-size:12px;opacity:.8;flex-wrap:wrap}",
@@ -7005,9 +7388,8 @@ var require_styles = __commonJS({
7005
7388
  ".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted,#fff);background:var(--dsw-alias-state-error-primary,#e5484d);border-color:transparent}",
7006
7389
  "@media (max-width:760px){.wbt-body{flex-direction:column;gap:8px}.wbt-nav{flex-direction:row;width:100%;flex:0 0 auto;overflow-x:auto;border-right:none;border-bottom:1px solid var(--wbt-line);padding:0 0 6px}.wbt-tab{width:auto;white-space:nowrap;padding:6px 9px}.wbt-tab.on{box-shadow:inset 0 -2px 0 var(--wbt-accent)}.wbt-nav-sep{width:1px;height:18px;flex:none;margin:auto 4px}.wbt-tree-slot{flex:0 0 auto;width:auto;margin-right:0}.wbt-pathrow .wbt-search{flex:1 1 160px;max-width:none}}",
7007
7390
  "@media (max-width:760px){.wbt-filter-panel{width:100%;flex:0 0 auto;padding:8px;max-height:40%}.wbt-filter-toggle{display:inline-flex}.wbt-filter-panel:not(.expanded) .wbt-filter-content{display:none}.wbt-filter-panel.expanded .wbt-filter-content{padding-top:10px}.wbt-content{width:100%;box-sizing:border-box}}",
7008
- "@media (max-width:420px){.wbt-grid{grid-template-columns:1fr}}",
7009
7391
  "@media (max-width:640px){.wbt-form{grid-template-columns:1fr}.wbt-drawer{width:94vw}.wbt-search{width:100%}.wbt-item{padding:9px}.wbt-ops{width:100%;justify-content:flex-end}}"
7010
- ].join("\n");
7392
+ ].concat(require_filter_checklist_styles()).join("\n");
7011
7393
  }
7012
7394
  });
7013
7395
 
@@ -7146,7 +7528,7 @@ var require_task_item = __commonJS({
7146
7528
  h("span", { className: "wbt-badge " + st.cls, children: stName }),
7147
7529
  titleNode
7148
7530
  );
7149
- var opsNode = h("div", { className: cx("wbt-ops", props.card && "wbt-ops-block"), key: "ops" }, ops);
7531
+ var opsNode = h("div", { className: "wbt-ops", key: "ops" }, ops);
7150
7532
  var tagBlock = tagNodes.length ? h("div", { className: "wbt-tags", key: "tags" }, tagNodes) : null;
7151
7533
  var wsList = Array.isArray(task.workspaces) ? task.workspaces : [];
7152
7534
  var wsBlock = wsList.length ? h("div", { className: "wbt-wschips", key: "workspaces" }, wsList.map(function(w) {
@@ -7155,20 +7537,28 @@ var require_task_item = __commonJS({
7155
7537
  var metaBlock = meta.length ? h("div", { className: "wbt-foot", key: "meta" }, h("div", { className: "wbt-meta" }, meta)) : null;
7156
7538
  var pathBlock = task.path && task.path.length ? h("div", { className: "wbt-taskpath", key: "path" }, h(PathCrumbs, { path: task.path, t, onPick: props.onPathPick })) : null;
7157
7539
  var metaZone = tagBlock || wsBlock || metaBlock || pathBlock ? h("div", { className: "wbt-metazone", key: "metazone" }, tagBlock, wsBlock, metaBlock, pathBlock) : null;
7540
+ var idNode = String(task.id || "") ? h("div", {
7541
+ className: "wbt-item-id",
7542
+ key: "taskid",
7543
+ title: String(task.id),
7544
+ onClick: function(e) {
7545
+ e.stopPropagation();
7546
+ }
7547
+ }, t.taskId + " \xB7 " + String(task.id)) : null;
7158
7548
  return h(
7159
7549
  "div",
7160
- { className: cx("wbt-item", props.card && "wbt-card", String(task.status) === "1" && "closed") },
7550
+ { className: cx("wbt-item", String(task.status) === "1" && "closed") },
7161
7551
  props.selectionMode ? h("input", { type: "checkbox", className: "wbt-check", checked: !!props.checked, onChange: function() {
7162
7552
  props.onCheck(task.id);
7163
7553
  } }) : null,
7164
7554
  h(
7165
7555
  "div",
7166
7556
  { className: "wbt-main" },
7167
- h("div", { className: "wbt-chead" }, line1, props.card ? null : opsNode),
7557
+ h("div", { className: "wbt-chead" }, line1, opsNode),
7168
7558
  metaZone,
7169
- props.card ? opsNode : null,
7170
7559
  descNode,
7171
- reviewNode
7560
+ reviewNode,
7561
+ idNode
7172
7562
  )
7173
7563
  );
7174
7564
  }
@@ -7521,7 +7911,7 @@ var require_workspace_select = __commonJS({
7521
7911
  h(
7522
7912
  "div",
7523
7913
  { className: "wbt-wsrow" },
7524
- h("input", { className: "wbt-input", value: query, placeholder: t("search"), onChange: function(e) {
7914
+ h("input", { className: "wbt-input", value: query, placeholder: t("search"), "aria-label": t("search"), onChange: function(e) {
7525
7915
  setQuery(e.target.value);
7526
7916
  } }),
7527
7917
  h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
@@ -7541,8 +7931,18 @@ var require_workspace_select = __commonJS({
7541
7931
  { type: "button", role: "option", key: id, "aria-selected": on, className: "wbt-wsopt" + (on ? " on" : ""), title: w.dir || "", onClick: function() {
7542
7932
  toggle(id);
7543
7933
  } },
7544
- h("span", { className: "wbt-wsopt-title" }, w.title || id),
7545
- h("span", { className: "wbt-wsopt-meta" }, (w.taskCount || 0) + " \xB7 " + (w.dir || "\u2014"))
7934
+ h(
7935
+ "span",
7936
+ { className: "wbt-wsopt-title" },
7937
+ h("span", { className: "wbt-wsopt-name" }, w.title || id),
7938
+ on ? h("span", { className: "wbt-wsopt-check", "aria-hidden": true }, "\u2713") : null
7939
+ ),
7940
+ h(
7941
+ "span",
7942
+ { className: "wbt-wsopt-meta" },
7943
+ h("span", { className: "wbt-wsopt-count" }, String(w.taskCount || 0)),
7944
+ w.dir ? h("code", { title: w.dir }, w.dir) : h("span", null, "\u2014")
7945
+ )
7546
7946
  );
7547
7947
  })
7548
7948
  ),
@@ -8209,12 +8609,13 @@ var require_timeline_member_rows = __commonJS({
8209
8609
  return h("ol", { className: "wbt-timeline-members" }, (props.rows || []).map(function(task) {
8210
8610
  var status = statusInfo(task.status), title = task.title || (lang === "en" ? "Untitled task" : "\u672A\u547D\u540D\u4EFB\u52A1");
8211
8611
  var remove = lang === "en" ? "Remove from timeline: " + title : "\u4ECE\u65F6\u95F4\u7EBF\u79FB\u51FA\uFF1A" + title;
8612
+ var open = lang === "en" ? "Click to preview task: " : "\u70B9\u51FB\u9884\u89C8\u4EFB\u52A1\uFF1A";
8212
8613
  return h(
8213
8614
  "li",
8214
8615
  { key: task.id, className: "wbt-timeline-member-row" },
8215
8616
  h("time", { className: "wbt-timeline-date", dateTime: task.publishDate || void 0 }, task.publishDate || "\u2014"),
8216
8617
  h("span", { className: "wbt-timeline-node", "aria-hidden": true }),
8217
- h("button", { type: "button", className: "wbt-timeline-member", title, "aria-label": title + " \xB7 " + (task.publishDate || "") + " \xB7 " + status[lang], onClick: function(event) {
8618
+ h("button", { type: "button", className: "wbt-timeline-member", title, "aria-label": open + title + " \xB7 " + (task.publishDate || "") + " \xB7 " + status[lang], onClick: function(event) {
8218
8619
  if (props.onOpen) props.onOpen(task, event);
8219
8620
  } }, title),
8220
8621
  h("span", { className: "wbt-badge " + status.cls }, status[lang]),
@@ -9087,6 +9488,11 @@ var require_task_filter_model = __commonJS({
9087
9488
  if (!result && max) return null;
9088
9489
  return result ? result.value : next;
9089
9490
  }
9491
+ function taskNavigation(params) {
9492
+ if (!params || typeof params.taskId !== "string") return null;
9493
+ var id = params.taskId.trim();
9494
+ return /^[A-Za-z0-9_-]{1,64}$/.test(id) ? id : null;
9495
+ }
9090
9496
  function navigation(params) {
9091
9497
  if (!params) return null;
9092
9498
  var value;
@@ -9167,6 +9573,7 @@ var require_task_filter_model = __commonJS({
9167
9573
  presetValue,
9168
9574
  activePreset,
9169
9575
  navigation,
9576
+ taskNavigation,
9170
9577
  save,
9171
9578
  load
9172
9579
  };
@@ -9462,6 +9869,7 @@ var require_tasks_view = __commonJS({
9462
9869
  var api = props.api;
9463
9870
  var cfg = props.cfg || {};
9464
9871
  var activityNavigation = filters.navigation(props.viewParams);
9872
+ var taskNavigation = filters.taskNavigation(props.viewParams);
9465
9873
  var tableNavigation = !activityNavigation && props.viewParams && props.viewParams.tableId;
9466
9874
  var groupNavigation = !activityNavigation && !tableNavigation && props.viewParams && props.viewParams.groupId;
9467
9875
  var nodeNavigation = tableNavigation || groupNavigation;
@@ -9476,16 +9884,16 @@ var require_tasks_view = __commonJS({
9476
9884
  var expS = React.useState(/* @__PURE__ */ new Set());
9477
9885
  var expanded = expS[0], setExpanded = expS[1];
9478
9886
  var expInitRef = React.useRef(false);
9479
- var targetS = React.useState(tableNavigation ? { tableId: String(tableNavigation), groupId: props.viewParams.groupId } : { groupId: groupNavigation ? String(groupNavigation) : "1", tableId: null });
9887
+ var targetS = React.useState(taskNavigation ? { groupId: "1", tableId: null } : tableNavigation ? { tableId: String(tableNavigation), groupId: props.viewParams.groupId } : { groupId: groupNavigation ? String(groupNavigation) : "1", tableId: null });
9480
9888
  var target = targetS[0], setTarget = targetS[1];
9481
9889
  var pathS = React.useState([]);
9482
9890
  var currentPath = pathS[0], setCurrentPath = pathS[1];
9483
- var storedFilters = filters.load(props.viewParams);
9484
- var initialMissing = storedFilters ? storedFilters.missing : !activityNavigation && !nodeNavigation && !!(props.viewParams && props.viewParams.difficultyMissing === true);
9891
+ var storedFilters = taskNavigation ? null : filters.load(props.viewParams);
9892
+ var initialMissing = taskNavigation ? false : storedFilters ? storedFilters.missing : !activityNavigation && !nodeNavigation && !!(props.viewParams && props.viewParams.difficultyMissing === true);
9485
9893
  var missingS = React.useState(initialMissing);
9486
9894
  var difficultyMissing = missingS[0], setDifficultyMissing = missingS[1];
9487
9895
  var defaultPreset = filters.presetValue(cfg["ui.defaultPreset"]);
9488
- var filterState = React.useState(storedFilters && storedFilters.value || activityNavigation || defaultPreset || filters.empty());
9896
+ var filterState = React.useState(taskNavigation ? filters.empty() : storedFilters && storedFilters.value || activityNavigation || defaultPreset || filters.empty());
9489
9897
  var filterValue = filterState[0], setFilterValue = filterState[1];
9490
9898
  React.useEffect(function() {
9491
9899
  filters.save(filterValue, difficultyMissing, props.viewParams);
@@ -9493,13 +9901,11 @@ var require_tasks_view = __commonJS({
9493
9901
  var panelState = React.useState(false), panelOpen = panelState[0], setPanelOpen = panelState[1];
9494
9902
  var hintState = React.useState(""), filterHint = hintState[0], setFilterHint = hintState[1];
9495
9903
  var panelId = React.useId();
9496
- var viewS = React.useState(!nodeNavigation && cfg["ui.listView"] === "card" ? "card" : "list");
9497
- var view = viewS[0], setView = viewS[1];
9498
- var searchS = React.useState("");
9904
+ var searchS = React.useState(taskNavigation || "");
9499
9905
  var searchDraft = searchS[0], setSearchDraft = searchS[1];
9500
9906
  var tqS = React.useState("");
9501
9907
  var treeQuery = tqS[0], setTreeQuery = tqS[1];
9502
- var titleS = React.useState("");
9908
+ var titleS = React.useState(taskNavigation || "");
9503
9909
  var titleKey = titleS[0], setTitleKey = titleS[1];
9504
9910
  var tagReloadS = React.useState(0);
9505
9911
  var tagReload = tagReloadS[0], setTagReload = tagReloadS[1];
@@ -9553,7 +9959,20 @@ var require_tasks_view = __commonJS({
9553
9959
  React.useEffect(function() {
9554
9960
  if (initialNavigation.current) {
9555
9961
  initialNavigation.current = false;
9556
- if (storedFilters) return;
9962
+ if (storedFilters || taskNavigation) return;
9963
+ }
9964
+ if (taskNavigation) {
9965
+ setSearchDraft(taskNavigation);
9966
+ setTitleKey(taskNavigation);
9967
+ setFilterValue(filters.empty());
9968
+ setTarget({ groupId: "1", tableId: null });
9969
+ setDifficultyMissing(false);
9970
+ setFilterHint("");
9971
+ setFilterTagIds([]);
9972
+ setPageNumber(1);
9973
+ setSelectedIds(/* @__PURE__ */ new Set());
9974
+ setSelectionMode(false);
9975
+ return;
9557
9976
  }
9558
9977
  if (!activityNavigation && !nodeNavigation) return;
9559
9978
  setFilterValue(activityNavigation || defaultPreset || filters.empty());
@@ -9988,13 +10407,12 @@ var require_tasks_view = __commonJS({
9988
10407
  }
9989
10408
  }), t.difficultyMissing)
9990
10409
  });
9991
- var listBody = loading ? h("div", { className: "wbt-empty" }, t.loading) : error ? h("div", { className: "wbt-err" }, t.error + error) : data.records.length === 0 ? h("div", { className: "wbt-empty" }, t.empty) : h("div", { className: view === "card" ? "wbt-grid" : "wbt-list" }, data.records.map(function(task) {
10410
+ var listBody = loading ? h("div", { className: "wbt-empty" }, t.loading) : error ? h("div", { className: "wbt-err" }, t.error + error) : data.records.length === 0 ? h("div", { className: "wbt-empty" }, t.empty) : h("div", { className: "wbt-list" }, data.records.map(function(task) {
9992
10411
  return h(TaskItem, {
9993
10412
  key: task.id,
9994
10413
  task,
9995
10414
  t,
9996
10415
  lang: props.lang,
9997
- card: view === "card",
9998
10416
  keyword: titleKey.trim(),
9999
10417
  bodyMode: cfg["ui.bodyMode"],
10000
10418
  selectionMode,
@@ -10054,10 +10472,7 @@ var require_tasks_view = __commonJS({
10054
10472
  } }, h(Icon2, { name: "select", size: 13 }), selectionMode ? t.cancelSelect : t.select),
10055
10473
  h("button", { className: "wbt-btn primary", onClick: function() {
10056
10474
  setCreateState({ source: "0", originTask: null, defaultTableId: target.tableId });
10057
- } }, h(Icon2, { name: "plus", size: 14 }), t.newTask),
10058
- h("button", { className: "wbt-btn ghost", onClick: function() {
10059
- setView(view === "list" ? "card" : "list");
10060
- } }, h(Icon2, { name: view === "list" ? "grid" : "list", size: 13 }), view === "list" ? t.card : t.list)
10475
+ } }, h(Icon2, { name: "plus", size: 14 }), t.newTask)
10061
10476
  ),
10062
10477
  curDesc ? h("div", { className: "wbt-tabledesc", title: curDesc }, curDesc.length > 220 ? curDesc.slice(0, 220) + "\u2026" : curDesc) : null,
10063
10478
  h(
@@ -10448,6 +10863,59 @@ var require_timeline_merge = __commonJS({
10448
10863
  }
10449
10864
  });
10450
10865
 
10866
+ // packages/addons/tasks/client/modals/task-preview.cjs
10867
+ var require_task_preview = __commonJS({
10868
+ "packages/addons/tasks/client/modals/task-preview.cjs"(exports2, module2) {
10869
+ "use strict";
10870
+ module2.exports = function createTaskPreview(React, TaskItem) {
10871
+ var h = React.createElement;
10872
+ function TaskPreview(props) {
10873
+ var t = props.t, task = props.task;
10874
+ var titleId = "wbt-preview-title";
10875
+ function onKey(e) {
10876
+ if (e.key !== "Escape") return;
10877
+ e.preventDefault();
10878
+ e.stopPropagation();
10879
+ props.onClose();
10880
+ }
10881
+ return h(
10882
+ "div",
10883
+ {
10884
+ className: "wbt-modal-mask",
10885
+ onKeyDownCapture: onKey,
10886
+ onMouseDown: function(e) {
10887
+ if (e.target === e.currentTarget) props.onClose();
10888
+ }
10889
+ },
10890
+ h(
10891
+ "div",
10892
+ {
10893
+ className: "wbt-modal wide wbt-preview",
10894
+ role: "dialog",
10895
+ "aria-modal": "true",
10896
+ "aria-labelledby": titleId,
10897
+ "aria-label": t.previewLabel
10898
+ },
10899
+ h(
10900
+ "div",
10901
+ { className: "wbt-modal-head" },
10902
+ h("h3", { id: titleId }, String(task.title || "").trim() || t.previewUntitled),
10903
+ h("button", { type: "button", className: "wbt-icon", title: t.close, "aria-label": t.close, onClick: props.onClose }, "\xD7")
10904
+ ),
10905
+ h("div", { className: "wbt-preview-body" }, h(TaskItem, props.cardProps)),
10906
+ h(
10907
+ "div",
10908
+ { className: "wbt-modal-foot" },
10909
+ h("button", { type: "button", className: "wbt-btn ghost", autoFocus: true, onClick: props.onClose }, t.close)
10910
+ )
10911
+ )
10912
+ );
10913
+ }
10914
+ return TaskPreview;
10915
+ };
10916
+ }
10917
+ });
10918
+
10451
10919
  // packages/addons/tasks/client/views/timeline-view.cjs
10452
10920
  var require_timeline_view = __commonJS({
10453
10921
  "packages/addons/tasks/client/views/timeline-view.cjs"(exports2, module2) {
@@ -10458,6 +10926,8 @@ var require_timeline_view = __commonJS({
10458
10926
  var Merge = require_timeline_merge()(React);
10459
10927
  var CSS = require_timeline_styles();
10460
10928
  var MemberRows = require_timeline_member_rows()(React, deps.statusInfo);
10929
+ var TaskPreview = require_task_preview()(React, deps.TaskItem);
10930
+ var receipts = require_ownership();
10461
10931
  var splitTitle = require_timeline_title();
10462
10932
  var Highlight = require_highlight2()(React);
10463
10933
  function result(r) {
@@ -10509,6 +10979,12 @@ var require_timeline_view = __commonJS({
10509
10979
  var addS = React.useState(false), adding = addS[0], setAdding = addS[1];
10510
10980
  var deleteS = React.useState(false), deleting = deleteS[0], setDeleting = deleteS[1];
10511
10981
  var writeS = React.useState(false), writing = writeS[0], setWriting = writeS[1];
10982
+ var editS = React.useState(null), editTask = editS[0], setEditTask = editS[1];
10983
+ var doneS = React.useState(null), doneTask = doneS[0], setDoneTask = doneS[1];
10984
+ var timelineS = React.useState(null), timelineTask = timelineS[0], setTimelineTask = timelineS[1];
10985
+ var createS = React.useState(null), createState = createS[0], setCreateState = createS[1];
10986
+ var toastS = React.useState(""), toast = toastS[0], setToast = toastS[1];
10987
+ var cfg = deps.configView.useConfig(api, deps.CFG_FALLBACK).values;
10512
10988
  React.useEffect(function() {
10513
10989
  deps.injectCss();
10514
10990
  }, []);
@@ -10571,7 +11047,7 @@ var require_timeline_view = __commonJS({
10571
11047
  };
10572
11048
  }, [api, activeKey, memberPage, refresh]);
10573
11049
  React.useEffect(function() {
10574
- if (!detail) return;
11050
+ if (!editTask && !createState) return;
10575
11051
  var cancelled = false;
10576
11052
  api.call("taskNodes.tree", {}).then(result).then(function(r) {
10577
11053
  if (!cancelled) setTree(Array.isArray(r) ? r : []);
@@ -10580,7 +11056,16 @@ var require_timeline_view = __commonJS({
10580
11056
  return function() {
10581
11057
  cancelled = true;
10582
11058
  };
10583
- }, [api, !!detail]);
11059
+ }, [api, !!editTask, !!createState]);
11060
+ React.useEffect(function() {
11061
+ if (!toast) return;
11062
+ var timer = setTimeout(function() {
11063
+ setToast("");
11064
+ }, 2600);
11065
+ return function() {
11066
+ clearTimeout(timer);
11067
+ };
11068
+ }, [toast]);
10584
11069
  function reload() {
10585
11070
  setRefresh(function(n) {
10586
11071
  return n + 1;
@@ -10622,6 +11107,40 @@ var require_timeline_view = __commonJS({
10622
11107
  setDetail(null);
10623
11108
  if (detailTrigger.current) detailTrigger.current.focus({ preventScroll: true });
10624
11109
  }
11110
+ function say(message) {
11111
+ setToast(String(message || ""));
11112
+ }
11113
+ function refreshDetail(id) {
11114
+ api.call("tasks.get", { id }).then(result).then(function(r) {
11115
+ setDetail(function(old) {
11116
+ return old && String(old.id) === String(id) ? r.task : old;
11117
+ });
11118
+ }).catch(function() {
11119
+ });
11120
+ }
11121
+ function updateTask(task, patch) {
11122
+ api.call("tasks.update", Object.assign({ id: task.id }, patch)).then(result).then(function() {
11123
+ refreshDetail(task.id);
11124
+ createdRef.current = active;
11125
+ reload();
11126
+ }).catch(function(e) {
11127
+ say(String(e && e.message || e));
11128
+ });
11129
+ }
11130
+ function removeTask(task) {
11131
+ if (cfg["ui.confirmDelete"] !== false && !window.confirm(t.deleteTaskConfirm)) return;
11132
+ api.call("tasks.delete", { id: task.id }).then(result).then(function() {
11133
+ setDetail(null);
11134
+ say(t.deleted);
11135
+ createdRef.current = active;
11136
+ reload();
11137
+ }).catch(function(e) {
11138
+ say(String(e && e.message || e));
11139
+ });
11140
+ }
11141
+ function savedTask(result2) {
11142
+ if (result2) say(receipts.receipt(result2));
11143
+ }
10625
11144
  function closeMerge() {
10626
11145
  setMerge(false);
10627
11146
  if (mergeButton.current) mergeButton.current.focus({ preventScroll: true });
@@ -10810,10 +11329,114 @@ var require_timeline_view = __commonJS({
10810
11329
  setMulti(false);
10811
11330
  reload();
10812
11331
  } }) : null,
10813
- detail ? h(deps.EditModal, { key: detail.id, api, t, lang, task: detail, tree, onClose: closeDetail, onSaved: function() {
10814
- closeDetail();
10815
- reload();
10816
- } }) : null
11332
+ detail && !editTask ? h(TaskPreview, {
11333
+ key: "preview-" + detail.id,
11334
+ t,
11335
+ task: detail,
11336
+ onClose: closeDetail,
11337
+ cardProps: {
11338
+ task: detail,
11339
+ t,
11340
+ lang,
11341
+ keyword: "",
11342
+ bodyMode: cfg["ui.bodyMode"],
11343
+ update: updateTask,
11344
+ onEdit: function(task) {
11345
+ setEditTask(task);
11346
+ },
11347
+ onDone: function(task) {
11348
+ setDoneTask(task);
11349
+ },
11350
+ onRestart: function(task) {
11351
+ setCreateState({ source: "2", originTask: task });
11352
+ },
11353
+ onTimeline: function(task) {
11354
+ setTimelineTask(task);
11355
+ },
11356
+ onDelete: removeTask
11357
+ }
11358
+ }) : null,
11359
+ editTask ? h(deps.EditModal, {
11360
+ key: "edit-" + editTask.id,
11361
+ api,
11362
+ t,
11363
+ lang,
11364
+ task: editTask,
11365
+ tree,
11366
+ onClose: function() {
11367
+ setEditTask(null);
11368
+ },
11369
+ onSaved: function(result2) {
11370
+ var id = editTask.id;
11371
+ setEditTask(null);
11372
+ savedTask(result2);
11373
+ refreshDetail(id);
11374
+ createdRef.current = active;
11375
+ reload();
11376
+ }
11377
+ }) : null,
11378
+ doneTask ? h(deps.DoneModal, {
11379
+ key: "done-" + doneTask.id,
11380
+ t,
11381
+ api,
11382
+ task: doneTask,
11383
+ onClose: function() {
11384
+ setDoneTask(null);
11385
+ },
11386
+ onDone: function() {
11387
+ setDoneTask(null);
11388
+ closeDetail();
11389
+ say(t.doneSuccess);
11390
+ createdRef.current = active;
11391
+ reload();
11392
+ },
11393
+ onError: function(e) {
11394
+ setDoneTask(null);
11395
+ say(String(e));
11396
+ }
11397
+ }) : null,
11398
+ timelineTask ? h(deps.TimelineModal, {
11399
+ key: "tl-" + timelineTask.id,
11400
+ t,
11401
+ api,
11402
+ task: timelineTask,
11403
+ onChanged: reload,
11404
+ onClose: function() {
11405
+ setTimelineTask(null);
11406
+ },
11407
+ onOpen: function(member) {
11408
+ api.call("tasks.get", { id: member.id }).then(result).then(function(r) {
11409
+ setTimelineTask(null);
11410
+ setEditTask(r.task);
11411
+ }).catch(function(e) {
11412
+ say(String(e && e.message || e));
11413
+ });
11414
+ },
11415
+ onCreateTimeline: function(originTask) {
11416
+ setTimelineTask(null);
11417
+ setCreateState({ source: "1", originTask, defaultTableId: originTask.tableId });
11418
+ }
11419
+ }) : null,
11420
+ createState ? h(deps.CreateModal, {
11421
+ key: (createState.source || "0") + "-" + (createState.originTask && createState.originTask.id || ""),
11422
+ t,
11423
+ api,
11424
+ tree,
11425
+ source: createState.source,
11426
+ originTask: createState.originTask,
11427
+ defaultTableId: createState.defaultTableId,
11428
+ defaults: { priority: cfg["form.defaultPriority"], difficulty: cfg["form.defaultDifficulty"], targetOffset: cfg["form.defaultTargetOffset"] },
11429
+ onClose: function() {
11430
+ setCreateState(null);
11431
+ },
11432
+ onCreated: function(result2) {
11433
+ setCreateState(null);
11434
+ savedTask(result2);
11435
+ createdRef.current = active;
11436
+ reload();
11437
+ }
11438
+ }) : null,
11439
+ toast ? h("div", { className: "wbt-toast" }, toast) : null
10817
11440
  );
10818
11441
  }
10819
11442
  return TimelineView;
@@ -10821,6 +11444,32 @@ var require_timeline_view = __commonJS({
10821
11444
  }
10822
11445
  });
10823
11446
 
11447
+ // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs
11448
+ var list_checks_exports = {};
11449
+ __export(list_checks_exports, {
11450
+ __iconData: () => __iconData35,
11451
+ default: () => ListChecks
11452
+ });
11453
+ var __iconData35, ListChecks;
11454
+ var init_list_checks = __esm({
11455
+ "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs"() {
11456
+ init_createLucideIcon();
11457
+ __iconData35 = {
11458
+ name: "list-checks",
11459
+ size: 24,
11460
+ node: [
11461
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
11462
+ ["path", { d: "M13 12h8", key: "h98zly" }],
11463
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
11464
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
11465
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
11466
+ ]
11467
+ };
11468
+ __iconData35.node;
11469
+ ListChecks = createLucideIcon(__iconData35);
11470
+ }
11471
+ });
11472
+
10824
11473
  // packages/addons/tasks/client/client.src.cjs
10825
11474
  (function() {
10826
11475
  "use strict";
@@ -11272,7 +11921,6 @@ var require_timeline_view = __commonJS({
11272
11921
  var EditModal = require_edit_modal()(React, statusInfo, stars);
11273
11922
  var BatchModal = require_batch_modal()(React, cx, Icon2);
11274
11923
  var CFG_FALLBACK = {
11275
- "ui.listView": "list",
11276
11924
  "ui.expandDepth": 2,
11277
11925
  "ui.confirmDelete": true,
11278
11926
  "ui.defaultPreset": "",
@@ -11287,13 +11935,15 @@ var require_timeline_view = __commonJS({
11287
11935
  "stats.recentPublishLimit": 10,
11288
11936
  "stats.recentDoneLimit": 10,
11289
11937
  "stats.recentShutdownLimit": 10,
11290
- "stats.sections": ["trend", "status", "priority", "difficulty", "aging", "overdue", "tables", "groups", "workspaces", "recentPublish", "recentDone", "recentShutdown"]
11938
+ "stats.recentClaimedLimit": 10,
11939
+ "stats.sections": ["eventTrend", "trend", "status", "priority", "difficulty", "aging", "overdue", "tables", "groups", "workspaces", "recent"]
11291
11940
  };
11292
11941
  var TasksView = require_tasks_view()({ React, configView, CFG_FALLBACK, COPY, injectCss, allTables, findFirstTable, treeWalk, treeFlat, cx, Icon: Icon2, TaskItem, PathCrumbs, TagFilter, WorkspaceFilter, TreeNode, CreateModal, TimelineModal, NodeModal, EditModal, DoneModal, BatchModal });
11293
- var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, EditModal });
11942
+ var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
11294
11943
  host.registerAddon({
11295
11944
  id: "wb-addon-tasks",
11296
- version: "5.2.6",
11945
+ version: "5.2.20",
11946
+ icon: (init_list_checks(), __toCommonJS(list_checks_exports)).default,
11297
11947
  views: [
11298
11948
  { id: "stats", icon: tabIcon("chart"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: statsView.TasksStatsView, keepAlive: true },
11299
11949
  { id: "tasks", icon: tabIcon("list"), title: { zh: "\u8BB0\u5F55", en: "Records" }, component: TasksView },