dsh-workbench-tasks 5.2.6 → 5.2.26

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,152 @@ 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
+ var single = props.mode === "single";
86
+ var onPick = typeof props.onPick === "function" ? props.onPick : onToggle;
87
+ function toggle(id) {
88
+ if (disabled) return;
89
+ onToggle(id);
90
+ }
91
+ function scroll(e) {
92
+ if (disabled || loading || !hasMore || !onLoadMore) return;
93
+ if (nearBottom(e.currentTarget)) onLoadMore();
94
+ }
95
+ var head = h(
96
+ "div",
97
+ { className: "wbck-head" },
98
+ h("span", { className: "wbck-grow" }, title + (total ? " \xB7 " + total : "")),
99
+ !single && selected.length ? h("span", { className: "wbck-sel" }, selectedText + " " + selected.length) : null,
100
+ !single && (selected.length || query) ? h("button", {
101
+ type: "button",
102
+ className: "wbck-clear",
103
+ title: clearText,
104
+ disabled,
105
+ onClick: function() {
106
+ if (disabled) return;
107
+ onClear();
108
+ }
109
+ }, clearText) : null
110
+ );
111
+ var body;
112
+ if (!items.length) {
113
+ body = h("div", { className: "wbck-note", role: "status" }, loading ? loadingText : query ? noMatchText : emptyText);
114
+ } else {
115
+ body = items.map(function(x) {
116
+ var on = selected.indexOf(String(x.id)) >= 0;
117
+ if (single) {
118
+ return h(
119
+ "button",
120
+ {
121
+ key: x.id,
122
+ type: "button",
123
+ role: "radio",
124
+ "aria-checked": on ? "true" : "false",
125
+ className: "wbck-opt" + (on ? " is-on" : ""),
126
+ disabled,
127
+ onClick: function() {
128
+ if (disabled) return;
129
+ onPick(x.id);
130
+ }
131
+ },
132
+ h("span", { className: "wbck-nm", title: x.name }, x.name),
133
+ x.meta ? h("span", { className: "wbck-meta" }, x.meta) : null
134
+ );
135
+ }
136
+ return h(
137
+ "label",
138
+ { key: x.id, className: "wbck-opt" + (on ? " is-on" : "") },
139
+ h("input", {
140
+ type: "checkbox",
141
+ checked: on,
142
+ disabled,
143
+ onChange: function() {
144
+ toggle(x.id);
145
+ }
146
+ }),
147
+ h("span", { className: "wbck-nm", title: x.name }, x.name),
148
+ x.meta ? h("span", { className: "wbck-meta" }, x.meta) : null
149
+ );
150
+ });
151
+ var more = loading ? loadingText : hasMore ? "" : noMoreText;
152
+ if (more) body = body.concat([h("div", { key: "__more", className: "wbck-more", role: "status" }, more)]);
153
+ }
154
+ return h(
155
+ "div",
156
+ { className: "wbck", "data-role": "checklist" },
157
+ h(
158
+ "div",
159
+ { className: "wbck-search" },
160
+ h("input", {
161
+ type: "search",
162
+ autoFocus: props.autoFocus !== false,
163
+ className: "wbck-input",
164
+ placeholder: searchPlaceholder,
165
+ "aria-label": searchPlaceholder,
166
+ value: query,
167
+ disabled,
168
+ onChange: function(e) {
169
+ onQuery(e.target.value);
170
+ }
171
+ })
172
+ ),
173
+ props.beforeHead || null,
174
+ head,
175
+ h("div", {
176
+ className: "wbck-list",
177
+ onScroll: scroll,
178
+ role: single ? "radiogroup" : void 0,
179
+ "aria-label": single ? props.groupLabel || searchPlaceholder : void 0,
180
+ "aria-busy": loading ? "true" : "false"
181
+ }, body)
182
+ );
183
+ }
184
+ module2.exports = FilterChecklist;
185
+ module2.exports.nearBottom = nearBottom;
186
+ }
187
+ });
188
+
49
189
  // packages/addons/tasks/client/ui/tagfilter.cjs
50
190
  var require_tagfilter = __commonJS({
51
191
  "packages/addons/tasks/client/ui/tagfilter.cjs"(exports2, module2) {
52
192
  var React = require("react");
53
193
  var h = React.createElement;
194
+ var FilterChecklist = require_filter_checklist();
54
195
  module2.exports = function TagFilter(props) {
55
196
  var api = props.api;
56
197
  var t = props.t;
@@ -99,6 +240,16 @@ var require_tagfilter = __commonJS({
99
240
  clearTimeout(timer);
100
241
  };
101
242
  }, [open, query, load, props.reloadKey]);
243
+ React.useEffect(function() {
244
+ if (!open) return void 0;
245
+ function onKey(e) {
246
+ if (e.key === "Escape") setOpen(false);
247
+ }
248
+ document.addEventListener("keydown", onKey);
249
+ return function() {
250
+ document.removeEventListener("keydown", onKey);
251
+ };
252
+ }, [open]);
102
253
  React.useEffect(function() {
103
254
  api.call("tasks.tagOptions", { pageSize: 1 }).then(function(r) {
104
255
  if (r && r.ok) setAvailable(!!(r.result && r.result.available));
@@ -127,74 +278,47 @@ var require_tagfilter = __commonJS({
127
278
  open ? h(
128
279
  "div",
129
280
  { 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() {
281
+ h(FilterChecklist, {
282
+ beforeHead: ids.length ? h(
283
+ "div",
284
+ { className: "wbt-tagsel" },
285
+ h("div", { className: "wbt-tagmenu-head" }, h("span", null, t.tagSelected + " " + ids.length), h("span", { className: "wbt-grow" })),
286
+ h("div", { className: "wbt-tagsel-list" }, ids.map(function(id) {
287
+ return h(
288
+ "button",
289
+ { key: id, className: "wbt-tagselitem", title: t.tagRemove, onClick: function() {
290
+ toggle(id);
291
+ } },
292
+ h("span", { className: "wbt-tagnm" }, names[String(id)] || "#" + id),
293
+ h("span", { className: "wbt-tagx" }, "\xD7")
294
+ );
295
+ }))
296
+ ) : null,
297
+ items: opts.tags.map(function(x) {
298
+ return { id: x.id, name: x.name, meta: x.total };
299
+ }),
300
+ selected: ids,
301
+ onToggle: toggle,
302
+ query,
303
+ onQuery: setQuery,
304
+ title: t.allTags,
305
+ total: opts.total,
306
+ clearText: t.clear,
307
+ onClear: function() {
170
308
  onChange([]);
171
309
  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
310
  },
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
- )
311
+ searchPlaceholder: t.tagSearchPlaceholder,
312
+ loading,
313
+ hasMore: opts.hasMore,
314
+ onLoadMore: function() {
315
+ load(query, (opts.pageNumber || 1) + 1, true);
316
+ },
317
+ emptyText: t.noTags,
318
+ noMatchText: t.tagNoMatch,
319
+ loadingText: t.loadingMore,
320
+ noMoreText: t.noMore
321
+ })
198
322
  ) : null
199
323
  );
200
324
  };
@@ -346,11 +470,557 @@ var require_workspacefilter = __commonJS({
346
470
  }
347
471
  });
348
472
 
473
+ // packages/addons/lib/date-picker.cjs
474
+ var require_date_picker = __commonJS({
475
+ "packages/addons/lib/date-picker.cjs"(exports2, module2) {
476
+ "use strict";
477
+ var ReactDefault = require("react");
478
+ var MONTH_EN = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
479
+ function pad(n) {
480
+ return String(n).padStart(2, "0");
481
+ }
482
+ function todayISO() {
483
+ var d = /* @__PURE__ */ new Date();
484
+ return d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate());
485
+ }
486
+ function validDate(value) {
487
+ if (!value) return false;
488
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
489
+ var d = /* @__PURE__ */ new Date(value + "T00:00:00Z");
490
+ return isFinite(d.getTime()) && d.toISOString().slice(0, 10) === value && value.slice(0, 4) !== "0000";
491
+ }
492
+ function toUTC(iso) {
493
+ return /* @__PURE__ */ new Date(iso + "T00:00:00Z");
494
+ }
495
+ function shiftDate(iso, days) {
496
+ var d = toUTC(iso);
497
+ d.setUTCDate(d.getUTCDate() + days);
498
+ return d.toISOString().slice(0, 10);
499
+ }
500
+ function shiftMonth(month, delta) {
501
+ var d = toUTC(month + "-01");
502
+ d.setUTCMonth(d.getUTCMonth() + delta);
503
+ return d.toISOString().slice(0, 7);
504
+ }
505
+ function monthKey(iso) {
506
+ return (iso || todayISO()).slice(0, 7);
507
+ }
508
+ function monthLabel(month, en) {
509
+ return en ? month.slice(0, 4) + "-" + month.slice(5) : month.slice(0, 4) + "\u5E74" + Number(month.slice(5)) + "\u6708";
510
+ }
511
+ function daysInMonth(month) {
512
+ return new Date(Date.UTC(Number(month.slice(0, 4)), Number(month.slice(5)), 0)).getUTCDate();
513
+ }
514
+ function normalizeRange(value) {
515
+ var from = value && validDate(value.from) ? value.from : "";
516
+ var to = value && validDate(value.to) ? value.to : "";
517
+ if (from && to && from > to) return { from: to, to: from, swapped: true };
518
+ return { from, to, swapped: false };
519
+ }
520
+ function clampDay(iso, min, max) {
521
+ if (min && iso < min) return false;
522
+ if (max && iso > max) return false;
523
+ return true;
524
+ }
525
+ function ctx(props) {
526
+ var R = props && props.React || ReactDefault;
527
+ return { R, h: props && props.h || R.createElement };
528
+ }
529
+ function usePopover(R, open, setOpen, root) {
530
+ R.useEffect(function() {
531
+ if (!open) return void 0;
532
+ function onDoc(ev) {
533
+ if (root.current && !root.current.contains(ev.target)) setOpen(false);
534
+ }
535
+ function onKey(ev) {
536
+ if (ev.key === "Escape") setOpen(false);
537
+ }
538
+ if (typeof document !== "undefined" && typeof document.addEventListener === "function") {
539
+ document.addEventListener("mousedown", onDoc);
540
+ document.addEventListener("keydown", onKey);
541
+ return function() {
542
+ document.removeEventListener("mousedown", onDoc);
543
+ document.removeEventListener("keydown", onKey);
544
+ };
545
+ }
546
+ return void 0;
547
+ }, [open]);
548
+ }
549
+ function Calendar(props) {
550
+ var h = props.h, p = props.prefix, en = props.lang === "en";
551
+ var month = props.month, cells = [];
552
+ var offset = toUTC(month + "-01").getUTCDay();
553
+ var count = daysInMonth(month);
554
+ var i;
555
+ for (i = 0; i < offset; i++) cells.push(h("span", { key: "e" + i, "aria-hidden": "true" }));
556
+ for (i = 1; i <= count; i++) {
557
+ var day = month + "-" + pad(i);
558
+ var disabled = !clampDay(day, props.min, props.max);
559
+ var selected = props.isSelected ? props.isSelected(day) : false;
560
+ var between = props.isBetween ? props.isBetween(day) : false;
561
+ cells.push(h("button", {
562
+ key: day,
563
+ type: "button",
564
+ disabled,
565
+ "data-day": day,
566
+ "aria-label": day,
567
+ "aria-pressed": selected,
568
+ "aria-current": day === todayISO() ? "date" : void 0,
569
+ className: p + "-dp-day" + (selected ? " is-on" : "") + (between ? " is-between" : "") + (day === todayISO() ? " is-today" : ""),
570
+ onClick: props.onPick.bind(null, day),
571
+ onKeyDown: function(ev) {
572
+ var delta = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 }[ev.key];
573
+ if (!delta) return;
574
+ ev.preventDefault();
575
+ var next = shiftDate(ev.currentTarget.getAttribute("data-day"), delta);
576
+ if (clampDay(next, props.min, props.max)) props.onMove(monthKey(next), next);
577
+ }
578
+ }, i));
579
+ }
580
+ return h(
581
+ "div",
582
+ { className: p + "-dp-cal", role: "group", "aria-label": en ? "Calendar" : "\u65E5\u5386" },
583
+ h(
584
+ "div",
585
+ { className: p + "-dp-head" },
586
+ h("button", { type: "button", className: p + "-dp-nav", "aria-label": en ? "Previous month" : "\u4E0A\u4E2A\u6708", onClick: function() {
587
+ props.onMove(shiftMonth(month, -1), "");
588
+ } }, "\u2039"),
589
+ h("strong", { className: p + "-dp-title", "aria-live": "polite" }, monthLabel(month, en)),
590
+ h("button", { type: "button", className: p + "-dp-nav", "aria-label": en ? "Next month" : "\u4E0B\u4E2A\u6708", onClick: function() {
591
+ props.onMove(shiftMonth(month, 1), "");
592
+ } }, "\u203A")
593
+ ),
594
+ h(
595
+ "div",
596
+ { className: p + "-dp-weekdays", "aria-hidden": "true" },
597
+ (en ? ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] : ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"]).map(function(w) {
598
+ return h("span", { key: w }, w);
599
+ })
600
+ ),
601
+ h("div", { className: p + "-dp-grid" }, cells)
602
+ );
603
+ }
604
+ function DatePicker(props) {
605
+ var c = ctx(props), R = c.R, h = c.h;
606
+ var p = props.prefix, en = props.lang === "en";
607
+ var value = validDate(props.value) ? props.value : "";
608
+ var openS = R.useState(!!props.defaultOpen), open = openS[0], setOpen = openS[1];
609
+ var monthS = R.useState(monthKey(value || props.max || todayISO())), month = monthS[0], setMonth = monthS[1];
610
+ var root = R.useRef(null);
611
+ usePopover(R, open, setOpen, root);
612
+ function pick(day) {
613
+ if (props.onChange) props.onChange(day);
614
+ setOpen(false);
615
+ }
616
+ function toggle() {
617
+ setMonth(monthKey(validDate(props.value) ? props.value : props.max || todayISO()));
618
+ setOpen(!open);
619
+ }
620
+ return h(
621
+ "div",
622
+ { className: p + "-dp" + (props.className ? " " + props.className : ""), ref: root },
623
+ h(
624
+ "div",
625
+ { className: p + "-dp-field" },
626
+ h(
627
+ "button",
628
+ {
629
+ type: "button",
630
+ className: p + "-dp-trigger",
631
+ disabled: !!props.disabled,
632
+ "aria-haspopup": "dialog",
633
+ "aria-expanded": open,
634
+ "aria-label": (props.label ? props.label + ": " : "") + (value || props.placeholder || (en ? "Pick a date" : "\u9009\u62E9\u65E5\u671F")),
635
+ onClick: toggle
636
+ },
637
+ h("span", { className: p + "-dp-glyph", "aria-hidden": "true" }),
638
+ h("span", { className: p + "-dp-value" + (value ? "" : " is-empty") }, value || props.placeholder || (en ? "Pick a date" : "\u9009\u62E9\u65E5\u671F"))
639
+ ),
640
+ value && !props.disabled && props.clearable !== false ? h("button", { type: "button", className: p + "-dp-clear", "aria-label": en ? "Clear date" : "\u6E05\u9664\u65E5\u671F", onClick: function() {
641
+ if (props.onChange) props.onChange("");
642
+ } }, "\xD7") : null
643
+ ),
644
+ open ? h(
645
+ "div",
646
+ { className: p + "-dp-pop", role: "dialog", "aria-modal": "false", "aria-label": props.label || (en ? "Pick a date" : "\u9009\u62E9\u65E5\u671F") },
647
+ h(Calendar, { h, prefix: p, lang: props.lang, month, min: props.min, max: props.max, onMove: function(m) {
648
+ setMonth(m);
649
+ }, isSelected: function(d) {
650
+ return d === value;
651
+ }, onPick: pick }),
652
+ h(
653
+ "div",
654
+ { className: p + "-dp-foot" },
655
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
656
+ pick(todayISO());
657
+ } }, en ? "Today" : "\u4ECA\u5929"),
658
+ props.min || props.max ? h("span", { className: p + "-dp-hint" }, [props.min, props.max].filter(Boolean).join(" \u2014 ")) : null
659
+ )
660
+ ) : null
661
+ );
662
+ }
663
+ function RangePicker(props) {
664
+ var c = ctx(props), R = c.R, h = c.h;
665
+ var p = props.prefix, en = props.lang === "en";
666
+ var range = normalizeRange(props.value);
667
+ var from = range.from, to = range.to;
668
+ var openS = R.useState(!!props.defaultOpen), open = openS[0], setOpen = openS[1];
669
+ var startS = R.useState(""), start = startS[0], setStart = startS[1];
670
+ var monthS = R.useState(monthKey(from || to || props.max || todayISO())), month = monthS[0], setMonth = monthS[1];
671
+ var root = R.useRef(null);
672
+ usePopover(R, open, setOpen, root);
673
+ function apply(next) {
674
+ if (typeof props.onChange === "function") props.onChange(normalizeRange(next));
675
+ setStart("");
676
+ setOpen(false);
677
+ }
678
+ function pick(day) {
679
+ if (!start) {
680
+ setStart(day);
681
+ return;
682
+ }
683
+ apply({ from: start, to: day });
684
+ }
685
+ function toggle() {
686
+ setStart("");
687
+ setMonth(monthKey(from || to || props.max || todayISO()));
688
+ setOpen(!open);
689
+ }
690
+ var summary = from && to ? from + " \u2014 " + to : from ? from + (en ? " onward" : " \u8D77") : to ? (en ? "Until " : "\u622A\u81F3 ") + to : props.placeholder || (en ? "Choose date range" : "\u9009\u62E9\u65E5\u671F\u8303\u56F4");
691
+ return h(
692
+ "div",
693
+ { className: p + "-dr" + (props.className ? " " + props.className : ""), ref: root },
694
+ h(
695
+ "div",
696
+ { className: p + "-dp-field" },
697
+ h(
698
+ "button",
699
+ {
700
+ type: "button",
701
+ className: p + "-dp-trigger",
702
+ "aria-haspopup": "dialog",
703
+ "aria-expanded": open,
704
+ "aria-label": (props.label || (en ? "Date range" : "\u65E5\u671F\u8303\u56F4")) + ": " + summary,
705
+ onClick: toggle
706
+ },
707
+ h("span", { className: p + "-dp-glyph", "aria-hidden": "true" }),
708
+ h("span", { className: p + "-dp-value" + (from || to ? "" : " is-empty") }, summary)
709
+ ),
710
+ (from || to) && props.clearable !== false ? h("button", { type: "button", className: p + "-dp-clear", "aria-label": en ? "Clear range" : "\u6E05\u9664\u8303\u56F4", onClick: function() {
711
+ apply({ from: "", to: "" });
712
+ } }, "\xD7") : null
713
+ ),
714
+ open ? h(
715
+ "div",
716
+ { className: p + "-dp-pop", role: "dialog", "aria-modal": "false", "aria-label": props.label || (en ? "Date range" : "\u65E5\u671F\u8303\u56F4") },
717
+ h(Calendar, {
718
+ h,
719
+ prefix: p,
720
+ lang: props.lang,
721
+ month,
722
+ min: props.min,
723
+ max: props.max,
724
+ onMove: function(m) {
725
+ setMonth(m);
726
+ },
727
+ isSelected: function(d) {
728
+ return start ? d === start : d === from || d === to;
729
+ },
730
+ isBetween: function(d) {
731
+ return start ? start < d && d < (to || "") : !!(from && to && d > from && d < to);
732
+ },
733
+ onPick: pick
734
+ }),
735
+ h(
736
+ "p",
737
+ { className: p + "-dp-hint", role: "status" },
738
+ start ? en ? "Start " + start + " \xB7 pick the end date" : "\u8D77\u59CB " + start + " \xB7 \u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F" : en ? "Pick start, then end date" : "\u5148\u9009\u5F00\u59CB\u65E5\u671F\uFF0C\u518D\u9009\u7ED3\u675F\u65E5\u671F"
739
+ ),
740
+ start ? h(
741
+ "div",
742
+ { className: p + "-dp-acts" },
743
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
744
+ apply({ from: start, to: "" });
745
+ } }, en ? "Only start" : "\u4EC5\u8D77\u59CB\u65E5\u671F"),
746
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
747
+ apply({ from: "", to: start });
748
+ } }, en ? "Only end" : "\u4EC5\u622A\u6B62\u65E5\u671F")
749
+ ) : null,
750
+ h(
751
+ "div",
752
+ { className: p + "-dp-foot" },
753
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
754
+ setOpen(false);
755
+ setStart("");
756
+ } }, en ? "Cancel" : "\u53D6\u6D88")
757
+ )
758
+ ) : null
759
+ );
760
+ }
761
+ function MonthPicker(props) {
762
+ var c = ctx(props), R = c.R, h = c.h;
763
+ var p = props.prefix, en = props.lang === "en";
764
+ var value = /^\d{4}-\d{2}$/.test(props.value || "") ? props.value : "";
765
+ var base = value || monthKey(props.max || todayISO());
766
+ var openS = R.useState(!!props.defaultOpen), open = openS[0], setOpen = openS[1];
767
+ var yearS = R.useState(Number(base.slice(0, 4))), year = yearS[0], setYear = yearS[1];
768
+ var root = R.useRef(null);
769
+ usePopover(R, open, setOpen, root);
770
+ function pick(month) {
771
+ if (props.onChange) props.onChange(month);
772
+ setOpen(false);
773
+ }
774
+ var months = [];
775
+ for (var m = 1; m <= 12; m++) {
776
+ var key = year + "-" + pad(m);
777
+ months.push(h("button", {
778
+ key,
779
+ type: "button",
780
+ "data-month": key,
781
+ "aria-pressed": key === value,
782
+ className: p + "-dp-day" + (key === value ? " is-on" : "") + (key === monthKey(todayISO()) ? " is-today" : ""),
783
+ onClick: pick.bind(null, key)
784
+ }, en ? MONTH_EN[m - 1] : m + "\u6708"));
785
+ }
786
+ return h(
787
+ "div",
788
+ { className: p + "-dp" + (props.className ? " " + props.className : ""), ref: root },
789
+ h(
790
+ "div",
791
+ { className: p + "-dp-field" },
792
+ h(
793
+ "button",
794
+ {
795
+ type: "button",
796
+ className: p + "-dp-trigger",
797
+ "aria-haspopup": "dialog",
798
+ "aria-expanded": open,
799
+ "aria-label": (props.label || (en ? "Pick a month" : "\u9009\u62E9\u6708\u4EFD")) + ": " + (value ? monthLabel(value, en) : ""),
800
+ onClick: function() {
801
+ setYear(Number((value || base).slice(0, 4)));
802
+ setOpen(!open);
803
+ }
804
+ },
805
+ h("span", { className: p + "-dp-glyph", "aria-hidden": "true" }),
806
+ h("span", { className: p + "-dp-value" + (value ? "" : " is-empty") }, value ? monthLabel(value, en) : props.placeholder || (en ? "Pick a month" : "\u9009\u62E9\u6708\u4EFD"))
807
+ ),
808
+ value && props.clearable !== false ? h("button", { type: "button", className: p + "-dp-clear", "aria-label": en ? "Clear month" : "\u6E05\u9664\u6708\u4EFD", onClick: function() {
809
+ if (props.onChange) props.onChange("");
810
+ } }, "\xD7") : null
811
+ ),
812
+ open ? h(
813
+ "div",
814
+ { className: p + "-dp-pop is-months", role: "dialog", "aria-modal": "false", "aria-label": props.label || (en ? "Pick a month" : "\u9009\u62E9\u6708\u4EFD") },
815
+ h(
816
+ "div",
817
+ { className: p + "-dp-head" },
818
+ h("button", { type: "button", className: p + "-dp-nav", "aria-label": en ? "Previous year" : "\u4E0A\u4E00\u5E74", onClick: function() {
819
+ setYear(year - 1);
820
+ } }, "\u2039"),
821
+ h("strong", { className: p + "-dp-title", "aria-live": "polite" }, en ? String(year) : year + "\u5E74"),
822
+ h("button", { type: "button", className: p + "-dp-nav", "aria-label": en ? "Next year" : "\u4E0B\u4E00\u5E74", onClick: function() {
823
+ setYear(year + 1);
824
+ } }, "\u203A")
825
+ ),
826
+ h("div", { className: p + "-dp-months" }, months),
827
+ h(
828
+ "div",
829
+ { className: p + "-dp-foot" },
830
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
831
+ pick(monthKey(todayISO()));
832
+ } }, en ? "This month" : "\u672C\u6708"),
833
+ h("button", { type: "button", className: p + "-dp-link", onClick: function() {
834
+ setOpen(false);
835
+ } }, en ? "Cancel" : "\u53D6\u6D88")
836
+ )
837
+ ) : null
838
+ );
839
+ }
840
+ function InlineCalendar(props) {
841
+ var c = ctx(props), R = c.R, h = c.h;
842
+ var p = props.prefix;
843
+ var value = validDate(props.value) ? props.value : "";
844
+ var monthS = R.useState(monthKey(props.month || value || props.max || todayISO())), month = monthS[0], setMonth = monthS[1];
845
+ return h(
846
+ "div",
847
+ { className: p + "-dp is-inline" },
848
+ h(Calendar, {
849
+ h,
850
+ prefix: p,
851
+ lang: props.lang,
852
+ month,
853
+ min: props.min,
854
+ max: props.max,
855
+ onMove: function(m) {
856
+ setMonth(m);
857
+ if (props.onMonthChange) props.onMonthChange(m);
858
+ },
859
+ isSelected: function(d) {
860
+ return d === value;
861
+ },
862
+ isBetween: props.isBetween,
863
+ onPick: function(d) {
864
+ if (props.onChange) props.onChange(d);
865
+ }
866
+ }),
867
+ props.footer ? h("div", { className: p + "-dp-foot" }, props.footer) : null
868
+ );
869
+ }
870
+ module2.exports = {
871
+ DatePicker,
872
+ RangePicker,
873
+ MonthPicker,
874
+ InlineCalendar,
875
+ todayISO,
876
+ validDate,
877
+ shiftDate,
878
+ shiftMonth,
879
+ normalizeRange,
880
+ monthLabel,
881
+ daysInMonth
882
+ };
883
+ }
884
+ });
885
+
886
+ // packages/addons/lib/date-picker-styles.cjs
887
+ var require_date_picker_styles = __commonJS({
888
+ "packages/addons/lib/date-picker-styles.cjs"(exports2, module2) {
889
+ "use strict";
890
+ module2.exports = function datePickerStyles(prefix) {
891
+ var p = String(prefix || "wb");
892
+ return [
893
+ ".{p}-dp,.{p}-dr{position:relative;min-width:0}",
894
+ ".{p}-dp-field{display:flex;align-items:center;gap:6px;min-width:0}",
895
+ ".{p}-dp-trigger{display:flex;align-items:center;gap:8px;min-width:0;width:100%;padding:8px 10px;border:1px solid var(--wb-border);border-radius:8px;background:var(--wb-surface);color:var(--wb-text,inherit);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s}",
896
+ ".{p}-dp-trigger:hover{border-color:var(--wb-accent)}",
897
+ ".{p}-dp-trigger:focus-visible{outline:2px solid var(--wb-accent);outline-offset:1px}",
898
+ ".{p}-dp-trigger[disabled]{opacity:.55;cursor:not-allowed}",
899
+ ".{p}-dp-glyph{width:13px;height:13px;flex:none;border:1.5px solid currentColor;border-radius:3px;position:relative;opacity:.72}",
900
+ '.{p}-dp-glyph::before{content:"";position:absolute;left:-1.5px;right:-1.5px;top:3px;border-top:1.5px solid currentColor}',
901
+ '.{p}-dp-glyph::after{content:"";position:absolute;left:3px;top:-3px;width:1.5px;height:3px;background:currentColor;box-shadow:4px 0 currentColor}',
902
+ ".{p}-dp-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}",
903
+ ".{p}-dp-value.is-empty{color:var(--wb-muted)}",
904
+ ".{p}-dp-clear{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:color-mix(in srgb,var(--wb-muted) 14%,transparent);color:var(--wb-muted);font:inherit;line-height:1;cursor:pointer}",
905
+ ".{p}-dp-clear:hover{color:var(--wb-danger);background:color-mix(in srgb,var(--wb-danger) 16%,transparent)}",
906
+ ".{p}-dp-pop{position:absolute;z-index:40;top:calc(100% + 6px);left:0;width:272px;padding:10px;border:1px solid var(--wb-border);border-radius:12px;background:var(--wb-card);box-shadow:0 16px 40px color-mix(in srgb,var(--wb-text,var(--wb-border)) 18%,transparent);animation:{p}-dp-in .14s ease-out}",
907
+ ".{p}-dp-head{display:flex;align-items:center;gap:6px;margin-bottom:8px}",
908
+ ".{p}-dp-title{flex:1;text-align:center;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}",
909
+ ".{p}-dp-nav{width:26px;height:26px;padding:0;border:1px solid var(--wb-border);border-radius:7px;background:transparent;color:inherit;font:inherit;line-height:1;cursor:pointer}",
910
+ ".{p}-dp-nav:hover{border-color:var(--wb-accent);color:var(--wb-accent)}",
911
+ ".{p}-dp-weekdays,.{p}-dp-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px}",
912
+ ".{p}-dp-weekdays{margin-bottom:4px;font-size:11px;color:var(--wb-muted);text-align:center}",
913
+ ".{p}-dp-day{min-width:0;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:inherit;font:inherit;font-variant-numeric:tabular-nums;cursor:pointer}",
914
+ ".{p}-dp-day:hover{background:color-mix(in srgb,var(--wb-accent) 12%,transparent)}",
915
+ ".{p}-dp-day.is-between{background:color-mix(in srgb,var(--wb-accent) 16%,transparent);border-radius:0}",
916
+ ".{p}-dp-day.is-today{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--wb-accent) 55%,transparent)}",
917
+ ".{p}-dp-day.is-on{background:var(--wb-accent);color:var(--wb-on-accent,inherit);font-weight:600}",
918
+ ".{p}-dp-day:disabled{opacity:.35;cursor:not-allowed}",
919
+ ".{p}-dp-day:focus-visible{outline:2px solid var(--wb-accent);outline-offset:-2px}",
920
+ ".{p}-dp-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid var(--wb-line)}",
921
+ ".{p}-dp-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}",
922
+ ".{p}-dp-link{padding:4px 8px;border:0;border-radius:6px;background:color-mix(in srgb,var(--wb-muted) 12%,transparent);color:inherit;font:inherit;font-size:12px;cursor:pointer}",
923
+ ".{p}-dp-link:hover{background:color-mix(in srgb,var(--wb-accent) 16%,transparent);color:var(--wb-accent)}",
924
+ ".{p}-dp-hint{margin:6px 0 0;font-size:11px;color:var(--wb-muted)}",
925
+ ".{p}-dp-pop.is-months{width:248px}",
926
+ ".{p}-dp-months{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:6px}",
927
+ ".{p}-dp-months .{p}-dp-day{height:34px}",
928
+ "@keyframes {p}-dp-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}"
929
+ ].join("\n").replace(/\{p\}/g, p);
930
+ };
931
+ }
932
+ });
933
+
934
+ // packages/addons/tasks/client/stats/trend-interaction.cjs
935
+ var require_trend_interaction = __commonJS({
936
+ "packages/addons/tasks/client/stats/trend-interaction.cjs"(exports2, module2) {
937
+ function isVisible(hidden, key) {
938
+ return !(hidden && hidden[key]);
939
+ }
940
+ function visibleSeries(series, hidden) {
941
+ return (series || []).filter(function(s) {
942
+ return s && isVisible(hidden, s.key);
943
+ });
944
+ }
945
+ function rangeMax(data, series, hidden) {
946
+ if (!data || !data.length) return 1;
947
+ var list = visibleSeries(series, hidden);
948
+ var max = 1;
949
+ (data || []).forEach(function(d) {
950
+ list.forEach(function(s) {
951
+ max = Math.max(max, Number(d[s.key] || 0));
952
+ });
953
+ });
954
+ return Math.ceil(max * 1.15) || 1;
955
+ }
956
+ function toggle(hidden, series, key) {
957
+ var next = Object.assign({}, hidden);
958
+ if (isVisible(hidden, key)) {
959
+ if (visibleSeries(series, hidden).length <= 1) return { hidden, blocked: true };
960
+ next[key] = true;
961
+ } else {
962
+ delete next[key];
963
+ }
964
+ return { hidden: next, blocked: false };
965
+ }
966
+ function indexAt(ratio, length) {
967
+ if (!length) return 0;
968
+ var i = Math.round(Number(ratio) * (length - 1));
969
+ if (!isFinite(i)) return 0;
970
+ return Math.min(length - 1, Math.max(0, i));
971
+ }
972
+ function moveIndex(index, delta, length) {
973
+ if (!length) return 0;
974
+ if (index === null || index === void 0 || index < 0) return delta > 0 ? 0 : length - 1;
975
+ return Math.min(length - 1, Math.max(0, index + delta));
976
+ }
977
+ function tipAnchor(ratio, plotLeftPct, plotWidthPct) {
978
+ var r = Math.min(1, Math.max(0, Number(ratio) || 0));
979
+ var left = plotLeftPct + r * plotWidthPct;
980
+ var flip = left > 72 ? "right" : left < 18 ? "left" : "center";
981
+ return { left: Math.round(left * 100) / 100, flip };
982
+ }
983
+ function tipTransform(flip) {
984
+ if (flip === "right") return "translateX(-100%)";
985
+ if (flip === "left") return "translateX(0)";
986
+ return "translateX(-50%)";
987
+ }
988
+ function tipRows(data, series, hidden, index) {
989
+ var row = (data || [])[index];
990
+ if (!row) return [];
991
+ return visibleSeries(series, hidden).map(function(s) {
992
+ return { key: s.key, label: s.label, color: s.color, value: Number(row[s.key] || 0) };
993
+ });
994
+ }
995
+ function summaryText(data, series, hidden, sep) {
996
+ var list = visibleSeries(series, hidden);
997
+ return list.map(function(s) {
998
+ return s.label + " " + (data || []).reduce(function(n, d) {
999
+ return n + Number(d[s.key] || 0);
1000
+ }, 0);
1001
+ }).join(sep || "\uFF0C");
1002
+ }
1003
+ module2.exports = {
1004
+ isVisible,
1005
+ visibleSeries,
1006
+ rangeMax,
1007
+ toggle,
1008
+ indexAt,
1009
+ moveIndex,
1010
+ tipAnchor,
1011
+ tipTransform,
1012
+ tipRows,
1013
+ summaryText
1014
+ };
1015
+ }
1016
+ });
1017
+
349
1018
  // packages/addons/tasks/client/stats/charts.cjs
350
1019
  var require_charts = __commonJS({
351
1020
  "packages/addons/tasks/client/stats/charts.cjs"(exports2, module2) {
352
1021
  var React = require("react");
353
1022
  var h = React.createElement;
1023
+ var DP = require_date_picker();
354
1024
  var COLORS = [
355
1025
  "var(--dsw-alias-state-business-primary, #4f6ef7)",
356
1026
  "var(--dsw-alias-state-success-primary, #2f9e6e)",
@@ -363,13 +1033,12 @@ var require_charts = __commonJS({
363
1033
  function css(prefix) {
364
1034
  return [
365
1035
  ".@-table-link{border:0;padding:0;background:none;font:inherit;color:var(--dsw-alias-brand-primary,#4f6ef7);text-align:left;cursor:pointer}.@-table-link:hover{text-decoration:underline}.@-table-link:focus-visible{outline:2px solid currentColor;outline-offset:3px}.@-recent-difficulty{white-space:nowrap}.@-recent-reason{opacity:.65}",
366
- ".@-stats{display:flex;flex-direction:column;gap:14px;padding:4px 2px 24px;color:var(--dsw-alias-label-primary,#1f2329)}",
1036
+ ".@-stats{display:flex;flex-direction:column;gap:18px;padding:4px 2px 24px;color:var(--dsw-alias-label-primary,#1f2329)}",
367
1037
  ".@-stoolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",
368
1038
  ".@-seg{display:inline-flex;border:1px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:9px;overflow:hidden;background:var(--dsw-alias-bg-layer-1,#fff)}",
369
1039
  ".@-seg button{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-secondary,#646a73);font-size:12px;padding:6px 10px;cursor:pointer;white-space:nowrap}",
370
1040
  ".@-seg button.@-on{background:var(--dsw-alias-brand-primary,#4f6ef7);color:var(--dsw-alias-label-primary-inverted,#fff)}",
371
- ".@-range{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:9px;padding:2px 6px;background:var(--dsw-alias-bg-layer-1,#fff)}",
372
- ".@-range:focus-within{border-color:var(--dsw-alias-brand-primary,#4f6ef7)}",
1041
+ ".@-range{display:inline-flex;align-items:center;gap:4px}",
373
1042
  ".@-date{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-secondary,#646a73);font-family:inherit;font-size:12px;padding:4px 2px;width:116px;outline:none}",
374
1043
  ".@-date::-webkit-calendar-picker-indicator{opacity:.55;cursor:pointer}",
375
1044
  ".@-dash{color:var(--dsw-alias-label-tertiary,#8f959e);font-size:12px}",
@@ -379,21 +1048,43 @@ var require_charts = __commonJS({
379
1048
  ".@-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
1049
  ".@-ghost:hover{border-color:var(--dsw-alias-brand-primary,#4f6ef7);color:var(--dsw-alias-brand-primary,#4f6ef7)}",
381
1050
  ".@-muted{color:var(--dsw-alias-label-tertiary,#8f959e);font-size:12px}",
1051
+ // 难度分布的口径切换:轻量 tablist,视觉上与页首时间范围分段保持一致。
1052
+ ".@-dims{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 8px}",
1053
+ ".@-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}",
1054
+ ".@-dims button:hover{background:var(--dsw-alias-bg-skeleton,#f2f3f5);opacity:1}",
1055
+ ".@-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}",
1056
+ ".@-dims button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:1px}",
382
1057
  ".@-sgrid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px}",
1058
+ // 分区容器:把 12 栅格切成「一眼看清 → 结构 → 风险 → 排行 → 明细」几段,
1059
+ // 每段自己一条标题带,卡片之间仍按 span 排;段与段之间用更大的间距制造阅读停顿。
1060
+ ".@-sect{grid-column:span 12;display:flex;flex-direction:column;gap:8px;min-width:0}",
1061
+ ".@-sect-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding:2px 2px 0}",
1062
+ ".@-sect-title{margin:0;font-size:13px;font-weight:650;letter-spacing:.2px;color:var(--dsw-alias-label-primary,#1f2329)}",
1063
+ ".@-sect-note{font-size:11px;color:var(--dsw-alias-label-tertiary,#8f959e)}",
1064
+ ".@-sect-body{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px;min-width:0}",
383
1065
  ".@-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
1066
  ".@-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}",
385
1067
  ".@-chead{display:flex;align-items:baseline;gap:8px;margin-bottom:10px;flex-wrap:wrap}",
386
1068
  ".@-ctitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary,#1f2329)}",
387
1069
  ".@-cnote{font-size:11px;color:var(--dsw-alias-label-tertiary,#8f959e)}",
388
1070
  ".@-kpis{grid-column:span 12;display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}",
1071
+ // 核心指标与次级指标分两行:核心 4 张给足字号,次级 4 张收紧,避免 8 张 KPI 抢同一层的视觉重量。
1072
+ ".@-kpis-main{grid-template-columns:repeat(4,minmax(0,1fr))}",
1073
+ ".@-kpis-sub{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}",
1074
+ ".@-kpi-lg{padding:14px 16px}",
1075
+ ".@-kpi-lg .@-kpi-v{font-size:30px}",
1076
+ ".@-kpi-sm{padding:9px 12px}",
1077
+ ".@-kpi-sm .@-kpi-l{font-size:11.5px}",
1078
+ ".@-kpi-sm .@-kpi-v{font-size:19px}",
1079
+ ".@-kpi-sm .@-kpi-h{font-size:10.5px;margin-top:1px}",
389
1080
  ".@-kpi{background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:12px;padding:12px 14px;min-width:0}",
390
1081
  ".@-kpi-l{font-size:12px;color:var(--dsw-alias-label-tertiary,#8f959e);display:flex;align-items:center;gap:6px}",
391
1082
  ".@-kpi-v{font-size:26px;line-height:1.25;font-weight:650;margin-top:4px;font-variant-numeric:tabular-nums}",
392
1083
  ".@-kpi-u{font-size:12px;font-weight:400;color:var(--dsw-alias-label-tertiary,#8f959e);margin-left:3px}",
393
1084
  ".@-kpi-h{font-size:11px;color:var(--dsw-alias-label-tertiary,#8f959e);margin-top:3px}",
394
- ".@-kpi.@-danger .@-kpi-v{color:var(--dsw-alias-state-error-primary,#d9534f)}",
395
- ".@-kpi.@-warn .@-kpi-v{color:var(--dsw-alias-state-warn-primary,#d99100)}",
396
- ".@-kpi.@-ok .@-kpi-v{color:var(--dsw-alias-state-success-primary,#2f9e6e)}",
1085
+ ".@-kpi.@-kpi-tone-danger .@-kpi-v{color:var(--dsw-alias-state-error-primary,#d9534f)}",
1086
+ ".@-kpi.@-kpi-tone-warn .@-kpi-v{color:var(--dsw-alias-state-warn-primary,#d99100)}",
1087
+ ".@-kpi.@-kpi-tone-ok .@-kpi-v{color:var(--dsw-alias-state-success-primary,#2f9e6e)}",
397
1088
  ".@-donut{display:flex;align-items:center;gap:16px;flex-wrap:wrap}",
398
1089
  ".@-donut svg{flex:0 0 auto}",
399
1090
  ".@-legend{display:flex;flex-direction:column;gap:7px;min-width:120px;flex:1}",
@@ -422,6 +1113,21 @@ var require_charts = __commonJS({
422
1113
  ".@-hbar-link:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
423
1114
  ".@-trend{width:100%;height:auto;display:block}",
424
1115
  ".@-tlegend{display:flex;gap:14px;flex-wrap:wrap;margin-top:6px;font-size:11px;color:var(--dsw-alias-label-tertiary,#8f959e)}",
1116
+ ".@-trend-wrap{position:relative}",
1117
+ ".@-trend-box{position:relative;border-radius:10px}",
1118
+ ".@-trend-box:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
1119
+ ".@-trend-tip{position:absolute;top:4px;z-index:3;pointer-events:none;display:flex;flex-direction:column;gap:2px;min-width:104px;padding:6px 8px;border:1px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:8px;background:var(--dsw-alias-bg-layer-1,#fff);box-shadow:0 6px 20px color-mix(in srgb,var(--dsw-alias-label-primary,#1f2329) 16%,transparent);font-size:11px;color:var(--dsw-alias-label-primary,#1f2329)}",
1120
+ ".@-tip-day{font-size:11.5px;margin-bottom:2px}",
1121
+ ".@-tip-row{display:flex;align-items:center;gap:6px;white-space:nowrap}",
1122
+ ".@-tip-name{color:var(--dsw-alias-label-secondary,#646a73)}",
1123
+ ".@-tip-row b{margin-left:auto;font-variant-numeric:tabular-nums}",
1124
+ ".@-tlegend-item{display:inline-flex;align-items:center;gap:5px;appearance:none;border:0;background:none;padding:2px 0;font:inherit;font-size:11px;color:inherit;cursor:pointer;border-radius:4px}",
1125
+ ".@-tlegend-item:hover:not(:disabled){color:var(--dsw-alias-label-primary,#1f2329)}",
1126
+ ".@-tlegend-item[aria-pressed=false]{opacity:.45}",
1127
+ ".@-tlegend-item[aria-pressed=false] .@-dot{background:transparent;border:1px solid currentColor}",
1128
+ ".@-tlegend-item:disabled{cursor:default}",
1129
+ ".@-tlegend-item:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
1130
+ ".@-dot-off{width:8px;height:8px;border-radius:50%;border:1px solid;flex:0 0 auto}",
425
1131
  ".@-table-scroll{max-width:100%;overflow-x:auto}.@-table{width:100%;border-collapse:collapse;font-size:12px}",
426
1132
  ".@-table th{text-align:left;font-weight:500;color:var(--dsw-alias-label-tertiary,#8f959e);padding:6px 8px;border-bottom:1px solid var(--dsw-alias-border-l2,#e5e6eb);white-space:nowrap}",
427
1133
  ".@-table td{padding:7px 8px;border-bottom:1px solid var(--dsw-alias-border-l1,#f2f3f5);color:var(--dsw-alias-label-secondary,#646a73);vertical-align:top}",
@@ -429,12 +1135,13 @@ var require_charts = __commonJS({
429
1135
  ".@-table th.@-num,.@-table td.@-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}",
430
1136
  ".@-empty{padding:26px 8px;text-align:center;color:var(--dsw-alias-label-tertiary,#8f959e);font-size:12px}",
431
1137
  ".@-err{display:flex;align-items:center;gap:10px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#d9534f) 8%,transparent);border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary,#d9534f) 30%,transparent);color:var(--dsw-alias-state-error-primary,#d9534f);border-radius:10px;padding:10px 12px;font-size:12px}",
432
- ".@-warn{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary,#d99100);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary,#d99100);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary,#d99100) 6%,transparent)}",
1138
+ ".@-warnbar{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary,#d99100);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary,#d99100);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary,#d99100) 6%,transparent)}",
433
1139
  ".@-sk{height:14px;border-radius:6px;background:var(--dsw-alias-bg-skeleton,#f2f3f5);margin:7px 0;animation:@-pulse 1.2s ease-in-out infinite}",
434
1140
  "@keyframes @-pulse{0%,100%{opacity:.55}50%{opacity:1}}",
435
- "@media (max-width:900px){.@-scard{grid-column:span 12}.@-span-3,.@-span-4,.@-span-6,.@-span-8{grid-column:span 12}.@-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}",
436
- "@media (max-width:600px){.@-stats{padding-bottom:16px}.@-hist{height:130px}.@-kpi-v{font-size:22px}}",
437
- "@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}"
1141
+ "@media (max-width:900px){.@-scard{grid-column:span 12}.@-span-3,.@-span-4,.@-span-6,.@-span-8{grid-column:span 12}.@-kpis,.@-kpis-main,.@-kpis-sub{grid-template-columns:repeat(2,minmax(0,1fr))}}",
1142
+ "@media (max-width:600px){.@-stats{padding-bottom:16px;gap:14px}.@-hist{height:130px}.@-kpi-v{font-size:22px}.@-kpi-lg .@-kpi-v{font-size:24px}.@-kpi-sm .@-kpi-v{font-size:18px}}",
1143
+ "@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}",
1144
+ require_date_picker_styles()(prefix)
438
1145
  ].join("\n").replace(/@-/g, prefix + "-");
439
1146
  }
440
1147
  function makeCharts(prefix) {
@@ -488,11 +1195,31 @@ var require_charts = __commonJS({
488
1195
  props.children
489
1196
  );
490
1197
  }
1198
+ function Section(props) {
1199
+ var body = props.children || [];
1200
+ var list = Array.isArray(body) ? body.filter(function(n) {
1201
+ return n !== null && n !== void 0 && n !== false;
1202
+ }) : body;
1203
+ if (Array.isArray(list) && !list.length) return null;
1204
+ return h(
1205
+ "section",
1206
+ { className: prefix + "-sect", "aria-label": props.title },
1207
+ h(
1208
+ "div",
1209
+ { className: prefix + "-sect-head" },
1210
+ h("h2", { className: prefix + "-sect-title" }, props.title),
1211
+ props.note ? h("span", { className: prefix + "-sect-note" }, props.note) : null,
1212
+ props.right ? h("span", { className: prefix + "-sect-note", style: { marginLeft: "auto" } }, props.right) : null
1213
+ ),
1214
+ h("div", { className: prefix + "-sect-body" }, list)
1215
+ );
1216
+ }
491
1217
  function Kpi(props) {
492
- var tone = props.tone ? " " + prefix + "-" + props.tone : "";
1218
+ var tone = props.tone ? " " + prefix + "-kpi-tone-" + props.tone : "";
1219
+ var size = props.size === "lg" || props.size === "sm" ? " " + prefix + "-kpi-" + props.size : "";
493
1220
  return h(
494
1221
  "div",
495
- { className: prefix + "-kpi" + tone },
1222
+ { className: prefix + "-kpi" + size + tone },
496
1223
  h("div", { className: prefix + "-kpi-l" }, props.label),
497
1224
  h(
498
1225
  "div",
@@ -599,13 +1326,13 @@ var require_charts = __commonJS({
599
1326
  var height = props.height || 200;
600
1327
  var left = 30, right = 10, top = 12, bottom = 24;
601
1328
  var pw = width - left - right, ph = height - top - bottom;
602
- var max = 1;
603
- data.forEach(function(d) {
604
- series.forEach(function(s) {
605
- max = Math.max(max, Number(d[s.key] || 0));
606
- });
607
- });
608
- max = Math.ceil(max * 1.15) || 1;
1329
+ var ix = require_trend_interaction();
1330
+ var hiddenS = React.useState({});
1331
+ var activeS = React.useState(null);
1332
+ var hidden = hiddenS[0];
1333
+ var active = activeS[0];
1334
+ var visible = ix.visibleSeries(series, hidden);
1335
+ var max = ix.rangeMax(data, series, hidden);
609
1336
  function x(i2) {
610
1337
  return left + (data.length <= 1 ? pw / 2 : i2 / (data.length - 1) * pw);
611
1338
  }
@@ -620,52 +1347,135 @@ var require_charts = __commonJS({
620
1347
  for (var i = 0; i < data.length; i += step) labelIdx.push(i);
621
1348
  if (labelIdx[labelIdx.length - 1] !== data.length - 1) labelIdx.push(data.length - 1);
622
1349
  }
623
- var aria = series.map(function(s) {
624
- return s.label + " " + data.reduce(function(n, d) {
625
- return n + Number(d[s.key] || 0);
626
- }, 0);
627
- }).join("\uFF0C");
1350
+ var aria = ix.summaryText(data, series, hidden, "\uFF0C");
1351
+ var band = data.length > 1 ? pw / (data.length - 1) : pw;
1352
+ function bandBox(i2) {
1353
+ var bx = Math.max(left, x(i2) - band / 2);
1354
+ return { x: bx, width: Math.max(1, Math.min(width - right, x(i2) + band / 2) - bx) };
1355
+ }
1356
+ var tipLeftPct = left / width * 100, tipWidthPct = pw / width * 100;
1357
+ var activeRow = active !== null && data[active] ? data[active] : null;
1358
+ var anchor = activeRow ? ix.tipAnchor((x(active) - left) / pw, tipLeftPct, tipWidthPct) : null;
1359
+ var tip = activeRow ? h(
1360
+ "div",
1361
+ {
1362
+ className: prefix + "-trend-tip",
1363
+ style: { left: anchor.left + "%", transform: ix.tipTransform(anchor.flip) }
1364
+ },
1365
+ h("b", { className: prefix + "-tip-day" }, String(activeRow.bucket)),
1366
+ ix.tipRows(data, series, hidden, active).map(function(r) {
1367
+ return h(
1368
+ "span",
1369
+ { key: r.key, className: prefix + "-tip-row" },
1370
+ h("span", { className: prefix + "-dot", style: { background: r.color } }),
1371
+ h("span", { className: prefix + "-tip-name" }, r.label),
1372
+ h("b", null, num(props.lang, r.value))
1373
+ );
1374
+ })
1375
+ ) : null;
628
1376
  return h(
629
1377
  "div",
630
- null,
1378
+ { className: prefix + "-trend-wrap" },
631
1379
  h(
632
- "svg",
633
- { className: prefix + "-trend", viewBox: "0 0 " + width + " " + height, role: "img", "aria-label": props.aria || aria },
634
- ticks.map(function(v, i2) {
635
- return h(
636
- "g",
637
- { key: "t" + i2 },
638
- h("line", { x1: left, x2: width - right, y1: y(v), y2: y(v), stroke: "var(--dsw-alias-border-l1,#f2f3f5)", strokeWidth: 1 }),
639
- h("text", { x: left - 5, y: y(v) + 3, textAnchor: "end", fontSize: 9, fill: "var(--dsw-alias-label-tertiary,#8f959e)" }, num(props.lang, v))
640
- );
641
- }),
642
- series.map(function(s, si) {
643
- var pts = data.map(function(d, i2) {
644
- return x(i2) + "," + y(d[s.key]);
645
- }).join(" ");
646
- return h(
647
- "g",
648
- { key: s.key },
649
- h("polyline", { points: pts, fill: "none", stroke: s.color || COLORS[si % COLORS.length], strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round" }),
650
- data.map(function(d, i2) {
651
- if (data.length > 40 && i2 % 3 !== 0) return null;
652
- return h(
653
- "circle",
654
- { key: i2, cx: x(i2), cy: y(d[s.key]), r: 2.4, fill: s.color || COLORS[si % COLORS.length] },
655
- h("title", null, d.bucket + "\uFF1A" + s.label + " " + (d[s.key] || 0))
656
- );
657
- })
658
- );
659
- }),
660
- 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));
662
- })
1380
+ "div",
1381
+ {
1382
+ className: prefix + "-trend-box",
1383
+ role: "group",
1384
+ tabIndex: 0,
1385
+ "aria-label": props.aria || aria,
1386
+ onMouseLeave: function() {
1387
+ activeS[1](null);
1388
+ },
1389
+ onBlur: function() {
1390
+ activeS[1](null);
1391
+ },
1392
+ onKeyDown: function(e) {
1393
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
1394
+ e.preventDefault();
1395
+ activeS[1](ix.moveIndex(active, e.key === "ArrowRight" ? 1 : -1, data.length));
1396
+ } else if (e.key === "Escape") {
1397
+ activeS[1](null);
1398
+ }
1399
+ }
1400
+ },
1401
+ h(
1402
+ "svg",
1403
+ { className: prefix + "-trend", viewBox: "0 0 " + width + " " + height, "aria-hidden": "true" },
1404
+ ticks.map(function(v, i2) {
1405
+ return h(
1406
+ "g",
1407
+ { key: "t" + i2 },
1408
+ h("line", { x1: left, x2: width - right, y1: y(v), y2: y(v), stroke: "var(--dsw-alias-border-l1,#f2f3f5)", strokeWidth: 1 }),
1409
+ h("text", { x: left - 5, y: y(v) + 3, textAnchor: "end", fontSize: 9, fill: "var(--dsw-alias-label-tertiary,#8f959e)" }, num(props.lang, v))
1410
+ );
1411
+ }),
1412
+ activeRow ? h("line", {
1413
+ className: prefix + "-trend-guide",
1414
+ x1: x(active),
1415
+ x2: x(active),
1416
+ y1: top,
1417
+ y2: top + ph,
1418
+ stroke: "var(--dsw-alias-border-l2,#c9cdd4)",
1419
+ strokeWidth: 1,
1420
+ strokeDasharray: "3 3"
1421
+ }) : null,
1422
+ visible.map(function(s, si) {
1423
+ var pts = data.map(function(d, i2) {
1424
+ return x(i2) + "," + y(d[s.key]);
1425
+ }).join(" ");
1426
+ return h(
1427
+ "g",
1428
+ { key: s.key },
1429
+ h("polyline", { points: pts, fill: "none", stroke: s.color || COLORS[si % COLORS.length], strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round" }),
1430
+ data.map(function(d, i2) {
1431
+ if (data.length > 40 && i2 % 3 !== 0 && i2 !== active) return null;
1432
+ return h("circle", { key: i2, cx: x(i2), cy: y(d[s.key]), r: i2 === active ? 4 : 2.4, fill: s.color || COLORS[si % COLORS.length] });
1433
+ })
1434
+ );
1435
+ }),
1436
+ labelIdx.map(function(i2) {
1437
+ var textAnchor = i2 === data.length - 1 ? "end" : "middle";
1438
+ return h("text", { key: "x" + i2, x: x(i2), y: height - 6, textAnchor, fontSize: 9, fill: "var(--dsw-alias-label-tertiary,#8f959e)" }, String(data[i2].bucket).slice(5));
1439
+ }),
1440
+ data.map(function(d, i2) {
1441
+ var box = bandBox(i2);
1442
+ return h("rect", {
1443
+ key: "h" + i2,
1444
+ x: box.x,
1445
+ y: top,
1446
+ width: box.width,
1447
+ height: ph + 8,
1448
+ fill: "transparent",
1449
+ style: { cursor: "crosshair" },
1450
+ onMouseEnter: function() {
1451
+ activeS[1](i2);
1452
+ },
1453
+ onTouchStart: function() {
1454
+ activeS[1](i2);
1455
+ }
1456
+ });
1457
+ })
1458
+ ),
1459
+ tip
663
1460
  ),
664
1461
  h("div", { className: prefix + "-tlegend" }, series.map(function(s, i2) {
1462
+ var on = ix.isVisible(hidden, s.key);
1463
+ var last = on && ix.visibleSeries(series, hidden).length <= 1;
665
1464
  return h(
666
- "span",
667
- { key: s.key, style: { display: "inline-flex", alignItems: "center", gap: 5 } },
668
- h("span", { className: prefix + "-dot", style: { background: s.color || COLORS[i2 % COLORS.length] } }),
1465
+ "button",
1466
+ {
1467
+ key: s.key,
1468
+ type: "button",
1469
+ className: prefix + "-tlegend-item",
1470
+ "aria-pressed": on ? "true" : "false",
1471
+ disabled: last,
1472
+ title: last ? props.lang === "en" ? "At least one series stays visible" : "\u81F3\u5C11\u8981\u4FDD\u7559\u4E00\u6761\u66F2\u7EBF" : void 0,
1473
+ onClick: function() {
1474
+ var r = ix.toggle(hidden, series, s.key);
1475
+ if (!r.blocked) hiddenS[1](r.hidden);
1476
+ }
1477
+ },
1478
+ h("span", { className: prefix + "-dot" + (on ? "" : " " + prefix + "-dot-off"), style: on ? { background: s.color || COLORS[i2 % COLORS.length] } : { borderColor: s.color || COLORS[i2 % COLORS.length] } }),
669
1479
  s.label
670
1480
  );
671
1481
  }))
@@ -733,16 +1543,6 @@ var require_charts = __commonJS({
733
1543
  var custom = props.custom || null;
734
1544
  var from = custom && custom.from ? custom.from : "";
735
1545
  var to = custom && custom.to ? custom.to : "";
736
- function setDate(key, value, input) {
737
- if (input && input.validity && input.validity.badInput) {
738
- if (props.onInvalidInput) props.onInvalidInput();
739
- return;
740
- }
741
- if (typeof props.onCustomChange !== "function") return;
742
- var next = { from, to };
743
- next[key] = value;
744
- props.onCustomChange(next);
745
- }
746
1546
  return h(
747
1547
  "div",
748
1548
  { className: prefix + "-stoolbar" },
@@ -760,28 +1560,18 @@ var require_charts = __commonJS({
760
1560
  h(
761
1561
  "div",
762
1562
  { className: prefix + "-range", role: "group", "aria-label": props.customAria || "\u81EA\u5B9A\u4E49\u65E5\u671F\u8303\u56F4" },
763
- h("input", {
764
- type: "date",
765
- className: prefix + "-date",
766
- value: from,
767
- max: to && (!props.today || to < props.today) ? to : props.today || void 0,
768
- "aria-label": props.fromLabel || "\u8D77\u59CB\u65E5\u671F",
769
- title: props.fromLabel || "\u8D77\u59CB\u65E5\u671F",
770
- onChange: function(e) {
771
- setDate("from", e.target.value, e.target);
772
- }
773
- }),
774
- h("span", { className: prefix + "-dash", "aria-hidden": "true" }, "\u2013"),
775
- h("input", {
776
- type: "date",
777
- className: prefix + "-date",
778
- value: to,
779
- min: from || void 0,
1563
+ h(DP.RangePicker, {
1564
+ React,
1565
+ h,
1566
+ prefix,
1567
+ lang: props.lang,
1568
+ label: props.customAria || "\u81EA\u5B9A\u4E49\u65E5\u671F\u8303\u56F4",
1569
+ value: { from, to },
780
1570
  max: props.today || void 0,
781
- "aria-label": props.toLabel || "\u7EC8\u6B62\u65E5\u671F",
782
- title: props.toLabel || "\u7EC8\u6B62\u65E5\u671F",
783
- onChange: function(e) {
784
- setDate("to", e.target.value, e.target);
1571
+ clearable: false,
1572
+ onChange: function(next) {
1573
+ if (typeof props.onCustomChange !== "function") return;
1574
+ props.onCustomChange({ from: next.from, to: next.to });
785
1575
  }
786
1576
  }),
787
1577
  from || to ? h("button", {
@@ -846,11 +1636,12 @@ var require_charts = __commonJS({
846
1636
  function Warnings(props) {
847
1637
  var items = props.items || [];
848
1638
  if (!items.length) return null;
849
- return h("div", { className: prefix + "-warn", role: "status" }, items.map(function(w) {
1639
+ return h("div", { className: prefix + "-warnbar", role: "status" }, items.map(function(w) {
850
1640
  return w.message;
851
1641
  }).join("\uFF1B"));
852
1642
  }
853
1643
  return {
1644
+ Section,
854
1645
  Card,
855
1646
  Kpi,
856
1647
  Donut,
@@ -1426,15 +2217,42 @@ var require_config = __commonJS({
1426
2217
  }
1427
2218
  });
1428
2219
 
2220
+ // packages/addons/tasks/client/stats/task-link.cjs
2221
+ var require_task_link = __commonJS({
2222
+ "packages/addons/tasks/client/stats/task-link.cjs"(exports2, module2) {
2223
+ var React = require("react");
2224
+ var h = React.createElement;
2225
+ module2.exports = function taskTitle(lang, onNavigate) {
2226
+ var en = lang === "en";
2227
+ return function(row) {
2228
+ var title = row.title == null ? "" : String(row.title);
2229
+ var id = row.id == null ? "" : String(row.id);
2230
+ if (!id || typeof onNavigate !== "function") return title;
2231
+ return h("button", {
2232
+ type: "button",
2233
+ className: "wbt-table-link",
2234
+ "data-task-id": id,
2235
+ "aria-label": (en ? "Search by task ID: " : "\u6309\u4EFB\u52A1 ID \u68C0\u7D22\uFF1A") + id,
2236
+ title: en ? "Search by task ID: " + id : "\u6309\u4EFB\u52A1 ID \u68C0\u7D22\uFF1A" + id,
2237
+ onClick: function() {
2238
+ onNavigate("tasks", { taskId: id });
2239
+ }
2240
+ }, title);
2241
+ };
2242
+ };
2243
+ }
2244
+ });
2245
+
1429
2246
  // packages/addons/tasks/client/item/recent-columns.cjs
1430
2247
  var require_recent_columns = __commonJS({
1431
2248
  "packages/addons/tasks/client/item/recent-columns.cjs"(exports2, module2) {
1432
2249
  var React = require("react");
1433
2250
  var h = React.createElement;
2251
+ var taskTitle = require_task_link();
1434
2252
  module2.exports = function recentColumns(t, lang, onNavigate) {
1435
2253
  var en = lang === "en";
1436
2254
  return [
1437
- { key: "title", label: t.colTitle },
2255
+ { key: "title", label: t.colTitle, render: taskTitle(lang, onNavigate) },
1438
2256
  { key: "difficulty", label: en ? "Difficulty" : "\u96BE\u5EA6", render: function(row) {
1439
2257
  var n = Number(row.difficulty);
1440
2258
  if (!(n > 0)) return "\u2014";
@@ -1501,11 +2319,12 @@ var require_ranking_name = __commonJS({
1501
2319
  // packages/addons/tasks/client/stats/heatmap-model.cjs
1502
2320
  var require_heatmap_model = __commonJS({
1503
2321
  "packages/addons/tasks/client/stats/heatmap-model.cjs"(exports2, module2) {
1504
- var TYPES = ["done", "publish", "shutdown", "claimed"];
2322
+ var FILTER_TYPES = ["done", "publish", "shutdown", "claimed"];
2323
+ var TYPES = FILTER_TYPES.concat(["target"]);
1505
2324
  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
2325
  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" }
2326
+ 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" },
2327
+ 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
2328
  };
1510
2329
  function localDay(d) {
1511
2330
  return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
@@ -1540,16 +2359,93 @@ var require_heatmap_model = __commonJS({
1540
2359
  }
1541
2360
  function activityParams(params) {
1542
2361
  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" };
2362
+ return { activityDate: params.activityDate, activityType: FILTER_TYPES.indexOf(params.activityType) >= 0 ? params.activityType : "done" };
1544
2363
  }
1545
- module2.exports = { TYPES, LEVELS, COPY, legendLabel, localDay, calendar, level, count, background, label, activityParams };
2364
+ module2.exports = { TYPES, FILTER_TYPES, LEVELS, COPY, legendLabel, localDay, calendar, level, count, background, label, activityParams };
1546
2365
  }
1547
2366
  });
1548
2367
 
1549
2368
  // packages/addons/tasks/client/stats/heatmap-styles.cjs
1550
2369
  var require_heatmap_styles = __commonJS({
1551
2370
  "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}}";
2371
+ module2.exports = [
2372
+ ".wbt-heatmap{",
2373
+ // 作为统计页「活动与趋势」分区的一员时占满一行;脱离栅格容器时该声明无副作用。
2374
+ "grid-column:span 12;",
2375
+ "--hm-gap:3px;",
2376
+ "--hm-hue-done:var(--wb-ok,#18a058);",
2377
+ "--hm-hue-publish:var(--wbt-accent,var(--wb-accent,#11a89b));",
2378
+ "--hm-hue-shutdown:var(--wb-danger,#e5484d);",
2379
+ "--hm-hue-claimed:var(--wb-warn,#d48806);",
2380
+ // 目标是计划口径,用中性灰蓝,弱于四类彩色事件;灰阶在浅底上对比度低,
2381
+ // 四档取 26/42/58/74%(比四类事件更高),保证与空白格、与相邻档都能分辨。
2382
+ "--hm-hue-target:var(--wb-muted,#8b8f96);",
2383
+ "--hm-surface:var(--wbt-surface,color-mix(in oklab,currentColor 4%,transparent));",
2384
+ "--hm-empty:color-mix(in oklab,var(--wbt-line,color-mix(in oklab,currentColor 18%,transparent)) 55%,var(--hm-surface));",
2385
+ "--hm-done-1:color-mix(in oklab,var(--hm-hue-done) 14%,var(--hm-surface));",
2386
+ "--hm-done-2:color-mix(in oklab,var(--hm-hue-done) 26%,var(--hm-surface));",
2387
+ "--hm-done-3:color-mix(in oklab,var(--hm-hue-done) 38%,var(--hm-surface));",
2388
+ "--hm-done-4:color-mix(in oklab,var(--hm-hue-done) 52%,var(--hm-surface));",
2389
+ "--hm-publish-1:color-mix(in oklab,var(--hm-hue-publish) 14%,var(--hm-surface));",
2390
+ "--hm-publish-2:color-mix(in oklab,var(--hm-hue-publish) 26%,var(--hm-surface));",
2391
+ "--hm-publish-3:color-mix(in oklab,var(--hm-hue-publish) 38%,var(--hm-surface));",
2392
+ "--hm-publish-4:color-mix(in oklab,var(--hm-hue-publish) 52%,var(--hm-surface));",
2393
+ "--hm-shutdown-1:color-mix(in oklab,var(--hm-hue-shutdown) 14%,var(--hm-surface));",
2394
+ "--hm-shutdown-2:color-mix(in oklab,var(--hm-hue-shutdown) 26%,var(--hm-surface));",
2395
+ "--hm-shutdown-3:color-mix(in oklab,var(--hm-hue-shutdown) 38%,var(--hm-surface));",
2396
+ "--hm-shutdown-4:color-mix(in oklab,var(--hm-hue-shutdown) 52%,var(--hm-surface));",
2397
+ "--hm-claimed-1:color-mix(in oklab,var(--hm-hue-claimed) 14%,var(--hm-surface));",
2398
+ "--hm-claimed-2:color-mix(in oklab,var(--hm-hue-claimed) 26%,var(--hm-surface));",
2399
+ "--hm-claimed-3:color-mix(in oklab,var(--hm-hue-claimed) 38%,var(--hm-surface));",
2400
+ "--hm-claimed-4:color-mix(in oklab,var(--hm-hue-claimed) 52%,var(--hm-surface));",
2401
+ "--hm-target-1:color-mix(in oklab,var(--hm-hue-target) 26%,var(--hm-surface));",
2402
+ "--hm-target-2:color-mix(in oklab,var(--hm-hue-target) 42%,var(--hm-surface));",
2403
+ "--hm-target-3:color-mix(in oklab,var(--hm-hue-target) 58%,var(--hm-surface));",
2404
+ "--hm-target-4:color-mix(in oklab,var(--hm-hue-target) 74%,var(--hm-surface));",
2405
+ // 四档都保留正文色:最深档只混到 52%,深色主题里前景文字对比度仍 ≥4.7,浅色主题 ≥7。
2406
+ "--hm-fg-1:currentColor;--hm-fg-2:currentColor;--hm-fg-3:currentColor;--hm-fg-4:currentColor;",
2407
+ "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}",
2408
+ ".wbt-hm-head,.wbt-hm-legend{display:flex;align-items:center;gap:10px;flex-wrap:wrap}",
2409
+ ".wbt-hm-head{justify-content:space-between;margin-bottom:16px}",
2410
+ ".wbt-hm-head h3{margin:0;font-size:14px}",
2411
+ ".wbt-hm-years{display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums}",
2412
+ ".wbt-heatmap button{font:inherit;color:inherit}",
2413
+ ".wbt-hm-control{border:1px solid color-mix(in oklab,currentColor 20%,transparent);background:transparent;border-radius:5px;cursor:pointer;padding:4px 8px}",
2414
+ ".wbt-hm-control[role=tab]{border:0;outline:none;box-shadow:none}",
2415
+ ".wbt-hm-control[role=tab]:hover{background:color-mix(in oklab,currentColor 6%,transparent)}",
2416
+ ".wbt-hm-control[aria-selected=true]{font-weight:700;background:color-mix(in oklab,currentColor 10%,transparent)}",
2417
+ ".wbt-hm-control[role=tab]:focus-visible{outline:2px solid var(--hm-hue-publish);outline-offset:2px}",
2418
+ // 铺满:格子宽度按容器等分,格子之间固定 --hm-gap,既不右侧留白也不把方块拉扁。
2419
+ ".wbt-hm-scroll{overflow-x:auto;padding:3px 0;max-width:100%;container-type:inline-size}",
2420
+ ".wbt-hm-layout{display:flex;gap:8px;align-items:stretch;min-width:0}",
2421
+ ".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}",
2422
+ ".wbt-hm-body{flex:1 1 auto;min-width:min-content}",
2423
+ ".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}",
2424
+ ".wbt-hm-months span{white-space:nowrap}",
2425
+ ".wbt-hm-grid{display:grid;grid-template-columns:repeat(var(--hm-weeks),minmax(14px,1fr));gap:var(--hm-gap)}",
2426
+ ".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}",
2427
+ '.wbt-hm-day[data-level="1"]{color:var(--hm-fg-1)}',
2428
+ '.wbt-hm-day[data-level="2"]{color:var(--hm-fg-2)}',
2429
+ '.wbt-hm-day[data-level="3"]{color:var(--hm-fg-3)}',
2430
+ '.wbt-hm-day[data-level="4"]{color:var(--hm-fg-4)}',
2431
+ ".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}",
2432
+ ".wbt-hm-day[aria-disabled=true]{cursor:default}",
2433
+ ".wbt-hm-day{outline:none}",
2434
+ ".wbt-hm-day:focus-visible{outline:2px solid var(--hm-hue-publish);outline-offset:1px}",
2435
+ ".wbt-hm-day:hover{filter:brightness(.94)}",
2436
+ ".wbt-heatmap .wbt-hm-future{opacity:.4}",
2437
+ ".wbt-hm-legend{margin-top:14px}",
2438
+ ".wbt-hm-swatch{display:inline-block;width:12px;height:12px;border-radius:2px;vertical-align:-2px;margin-right:5px}",
2439
+ ".wbt-hm-types{display:flex;align-items:center;gap:10px}",
2440
+ ".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}",
2441
+ ".wbt-hm-intensity-label{color:color-mix(in oklab,currentColor 70%,transparent)}",
2442
+ ".wbt-hm-intensity-item{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}",
2443
+ ".wbt-hm-intensity-item .wbt-hm-swatch{flex:none;margin:0}",
2444
+ ".wbt-hm-summary{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}",
2445
+ ".wbt-hm-state{padding:28px 8px;text-align:center}",
2446
+ ".wbt-hm-skeleton{height:152px;border-radius:3px;background:repeating-linear-gradient(90deg,var(--hm-empty) 0 14px,transparent 14px 17px);opacity:.55}",
2447
+ "@media(prefers-reduced-motion:reduce){.wbt-heatmap *{animation:none!important;transition:none!important}}"
2448
+ ].join("");
1553
2449
  }
1554
2450
  });
1555
2451
 
@@ -1646,16 +2542,20 @@ var require_heatmap = __commonJS({
1646
2542
  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
2543
  })),
1648
2544
  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 : "");
2545
+ var day = byDate[d.date] || {}, future = d.date > today, n = future ? 0 : model.count(day, type), enabled = !future && n > 0;
2546
+ var clickable = enabled && type !== "target";
2547
+ var text = !future && n > 0 ? n >= 100 ? "99+" : String(n) : "";
2548
+ var title = model.label(d.date, day, t, type) + (future ? " \xB7 " + t.future : !n ? " \xB7 " + t.none : "");
1651
2549
  return h("button", {
1652
2550
  key: d.date,
1653
2551
  type: "button",
1654
2552
  className: "wbt-hm-day" + (future ? " wbt-hm-future" : ""),
1655
2553
  "data-date": d.date,
2554
+ "data-level": future ? 0 : n ? model.level(n) : 0,
2555
+ "data-type": type,
1656
2556
  title,
1657
2557
  "aria-label": title,
1658
- "aria-disabled": !enabled,
2558
+ "aria-disabled": !clickable,
1659
2559
  style: { gridColumn: d.column, gridRow: d.row, background: future ? "var(--hm-empty)" : model.background(day, type) },
1660
2560
  onMouseEnter: function() {
1661
2561
  setTip(title);
@@ -1670,9 +2570,9 @@ var require_heatmap = __commonJS({
1670
2570
  setTip("");
1671
2571
  },
1672
2572
  onClick: function() {
1673
- if (enabled && props.onNavigate) props.onNavigate("tasks", { activityDate: d.date, activityType: type });
2573
+ if (clickable && props.onNavigate) props.onNavigate("tasks", { activityDate: d.date, activityType: type });
1674
2574
  }
1675
- });
2575
+ }, text ? h("span", { className: "wbt-hm-num", "aria-hidden": true }, text) : null);
1676
2576
  }))
1677
2577
  )
1678
2578
  ))
@@ -1702,8 +2602,9 @@ var require_heatmap = __commonJS({
1702
2602
  setTip("");
1703
2603
  } }, h("span", { className: "wbt-hm-swatch", style: { background: "var(--hm-" + k + "-4)" }, "aria-hidden": true }), t[k]);
1704
2604
  })),
1705
- ready && h("span", { className: "wbt-hm-summary", "aria-live": "polite" }, tip || t.total + " \xB7 " + total),
2605
+ ready && h("span", { className: "wbt-hm-summary", "aria-live": "polite" }, tip || (type === "target" ? t.targetTotal : t.total) + " \xB7 " + total),
1706
2606
  type === "claimed" && h("span", { className: "wbt-hm-intensity-label" }, t.claimedNote),
2607
+ type === "target" && h("span", { className: "wbt-hm-intensity-label" }, t.targetNote),
1707
2608
  h(
1708
2609
  "div",
1709
2610
  { className: "wbt-hm-intensity", role: "img", "aria-label": model.legendLabel(lang) },
@@ -1733,7 +2634,7 @@ var require_today = __commonJS({
1733
2634
  zh: { title: "\u4ECA\u65E5", published: "\u4ECA\u65E5\u53D1\u5E03", claimed: "\u4ECA\u65E5\u63A5\u53D6", done: "\u4ECA\u65E5\u5B8C\u6210", shutdown: "\u4ECA\u65E5\u5173\u95ED", average: "\u5E73\u5747\u96BE\u5EA6", sample: "\u6837\u672C\u6570", noSample: "\u65E0\u6837\u672C", clock: "\u4EE5\u670D\u52A1\u7AEF\u5F53\u524D\u65F6\u95F4\u4E3A\u51C6" },
1734
2635
  en: { title: "Today", published: "Published today", claimed: "Claimed today", done: "Completed today", shutdown: "Closed today", average: "Avg difficulty", sample: "samples", noSample: "No samples", clock: "Based on the server's current time" }
1735
2636
  };
1736
- var css = ".wbt-today{margin:12px 0}";
2637
+ var css = ".wbt-today{margin:12px 0;grid-column:span 12}";
1737
2638
  function Today(props) {
1738
2639
  var data = props.today;
1739
2640
  if (!data || typeof data !== "object") return null;
@@ -2046,7 +2947,7 @@ var require_timeline_section = __commonJS({
2046
2947
  // packages/addons/tasks/client/stats/list-state.cjs
2047
2948
  var require_list_state = __commonJS({
2048
2949
  "packages/addons/tasks/client/stats/list-state.cjs"(exports2, module2) {
2049
- var LISTS = ["overdue", "recentPublish", "recentDone", "recentShutdown"];
2950
+ var LISTS = ["overdue", "recentPublish", "recentDone", "recentShutdown", "recentClaimed"];
2050
2951
  var COPY = {
2051
2952
  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
2953
  en: 'Stats API did not return the "{key}" list; frontend and backend versions may differ. Restart the plugin service and retry.'
@@ -2075,6 +2976,7 @@ var require_stats = __commonJS({
2075
2976
  var charts = require_charts();
2076
2977
  var configView = require_config();
2077
2978
  var recentColumns = require_recent_columns();
2979
+ var taskTitle = require_task_link();
2078
2980
  var rankingName = require_ranking_name();
2079
2981
  var Heatmap = require_heatmap();
2080
2982
  var Today = require_today();
@@ -2088,6 +2990,18 @@ var require_stats = __commonJS({
2088
2990
  range90: "\u8FD1 90 \u5929",
2089
2991
  range365: "\u8FD1 1 \u5E74",
2090
2992
  rangeAll: "\u5168\u90E8",
2993
+ secToday: "\u4ECA\u65E5",
2994
+ secTodayNote: "\u670D\u52A1\u7AEF\u5F53\u65E5\u5FEB\u7167\uFF0C\u4E0D\u968F\u4E0A\u65B9\u65F6\u95F4\u8303\u56F4\u53D8\u5316",
2995
+ secHealth: "\u603B\u4F53\u5065\u5EB7\u5EA6",
2996
+ secHealthNote: "\u5B58\u91CF\u53E3\u5F84\uFF1B\u300C\u8303\u56F4\u5185\u300D\u4E24\u9879\u8DDF\u968F\u65F6\u95F4\u8303\u56F4",
2997
+ secActivity: "\u6D3B\u52A8\u4E0E\u8D8B\u52BF",
2998
+ secActivityNote: "\u4E8B\u4EF6\u8D8B\u52BF\u8DDF\u968F\u65F6\u95F4\u8303\u56F4\uFF0C\u5E74\u5EA6\u6D3B\u52A8\u8986\u76D6\u6574\u5E74",
2999
+ secDist: "\u5206\u5E03",
3000
+ secDistNote: "\u5F53\u524D\u5B58\u91CF\u7ED3\u6784\uFF0C\u70B9\u67F1\u5F62\u53EF\u4E0B\u94BB\u5230\u8BB0\u5F55\u9875",
3001
+ secRisk: "\u98CE\u9669",
3002
+ secRiskNote: "\u5F53\u524D\u5B58\u91CF\uFF1B\u8D26\u9F84\u4E0E\u6E05\u5355\u540C\u4E00\u53E3\u5F84",
3003
+ secRank: "\u6392\u884C",
3004
+ secRankNote: "\u6309\u4EFB\u52A1\u8868 / \u4EFB\u52A1\u7EC4 / \u5DE5\u4F5C\u533A\u805A\u5408",
2091
3005
  refresh: "\u5237\u65B0",
2092
3006
  asOf: "\u622A\u81F3",
2093
3007
  retry: "\u91CD\u8BD5",
@@ -2111,8 +3025,12 @@ var require_stats = __commonJS({
2111
3025
  inRange: "\u8303\u56F4\u5185",
2112
3026
  ofTotal: "\u5360\u603B\u91CF",
2113
3027
  ofActive: "\u5360\u5DF2\u5F00\u542F",
2114
- trend: "\u65B0\u589E / \u5B8C\u6210 / \u5230\u671F\u8D8B\u52BF",
2115
- trendNote: "\u6309\u81EA\u7136\u65E5 / \u5468 / \u6708\u5206\u6876",
3028
+ eventTrend: "\u4E8B\u4EF6\u8D8B\u52BF",
3029
+ 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",
3030
+ publish: "\u53D1\u5E03",
3031
+ target: "\u76EE\u6807",
3032
+ evShutdown: "\u5173\u95ED",
3033
+ evClaimed: "\u63A5\u53D6",
2116
3034
  created: "\u65B0\u589E",
2117
3035
  done: "\u5B8C\u6210",
2118
3036
  due: "\u5230\u671F",
@@ -2125,6 +3043,13 @@ var require_stats = __commonJS({
2125
3043
  difficultyNote: "\u5F53\u524D\u5B58\u91CF\uFF1B\u5305\u542B\u672A\u8BBE\u7F6E",
2126
3044
  difficultyMissing: "\u672A\u586B\u96BE\u5EA6 {n} \u6761",
2127
3045
  difficultyMissingLink: "\u67E5\u770B\u5E76\u8865\u9F50\u96BE\u5EA6",
3046
+ difficultyDimension: "\u96BE\u5EA6\u5206\u5E03\u53E3\u5F84",
3047
+ dimAll: "\u5168\u90E8",
3048
+ dimDone: "\u5B8C\u6210",
3049
+ dimPublish: "\u53D1\u5E03",
3050
+ dimClaimed: "\u63A5\u53D6",
3051
+ dimShutdown: "\u5173\u95ED",
3052
+ difficultyNoteRange: "\u5E74\u5EA6\u6D3B\u52A8\u53E3\u5F84 {from} ~ {to}\uFF1B\u5305\u542B\u672A\u8BBE\u7F6E",
2128
3053
  aging: "\u903E\u671F\u8D26\u9F84",
2129
3054
  agingNote: "\u5F53\u524D\u903E\u671F\u4EFB\u52A1",
2130
3055
  overdueList: "\u903E\u671F\u6E05\u5355",
@@ -2148,6 +3073,12 @@ var require_stats = __commonJS({
2148
3073
  colTarget: "\u8BA1\u5212\u5B8C\u6210",
2149
3074
  colAge: "\u903E\u671F\u5929\u6570",
2150
3075
  colTable: "\u4EFB\u52A1\u8868",
3076
+ recentTasks: "\u6700\u8FD1\u4EFB\u52A1",
3077
+ recentTasksNote: "\u5207\u6362\u7EF4\u5EA6\u67E5\u770B\u6700\u8FD1\u53D1\u5E03 / \u5B8C\u6210 / \u5173\u95ED / \u63A5\u53D6\u7684\u4EFB\u52A1",
3078
+ recentTabPublish: "\u6700\u8FD1\u53D1\u5E03",
3079
+ recentTabDone: "\u6700\u8FD1\u5B8C\u6210",
3080
+ recentTabShutdown: "\u6700\u8FD1\u5173\u95ED",
3081
+ recentTabClaimed: "\u6700\u8FD1\u63A5\u53D6",
2151
3082
  recentPublish: "\u6700\u8FD1\u53D1\u5E03",
2152
3083
  recentPublishNote: "\u6309\u53D1\u5E03\u65E5\u671F\u5012\u5E8F",
2153
3084
  noRecentPublish: "\u8FD8\u6CA1\u6709\u53D1\u5E03\u7684\u4EFB\u52A1",
@@ -2158,6 +3089,7 @@ var require_stats = __commonJS({
2158
3089
  colDate: "\u65E5\u671F",
2159
3090
  noRecentDone: "\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1",
2160
3091
  noRecentShutdown: "\u8FD8\u6CA1\u6709\u5DF2\u5173\u95ED\u7684\u4EFB\u52A1",
3092
+ 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
3093
  noOverdue: "\u6CA1\u6709\u903E\u671F\u4EFB\u52A1",
2162
3094
  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
3095
  open: "\u5DF2\u5F00\u542F",
@@ -2172,6 +3104,18 @@ var require_stats = __commonJS({
2172
3104
  range90: "90 days",
2173
3105
  range365: "1 year",
2174
3106
  rangeAll: "All",
3107
+ secToday: "Today",
3108
+ secTodayNote: "Server-side snapshot for today; the range above does not affect it",
3109
+ secHealth: "Health",
3110
+ secHealthNote: "Current stock; the two in-range figures follow the range above",
3111
+ secActivity: "Activity & trend",
3112
+ secActivityNote: "The event trend follows the range; annual activity covers the whole year",
3113
+ secDist: "Distribution",
3114
+ secDistNote: "Current stock; click a bar to list matching tasks",
3115
+ secRisk: "Risk",
3116
+ secRiskNote: "Current stock; aging and the overdue list share one scope",
3117
+ secRank: "Rankings",
3118
+ secRankNote: "Grouped by task table / group / workspace",
2175
3119
  refresh: "Refresh",
2176
3120
  asOf: "As of",
2177
3121
  retry: "Retry",
@@ -2195,8 +3139,12 @@ var require_stats = __commonJS({
2195
3139
  inRange: "In range",
2196
3140
  ofTotal: "of total",
2197
3141
  ofActive: "of active",
2198
- trend: "Created / done / due trend",
2199
- trendNote: "Bucketed by day / week / month",
3142
+ eventTrend: "Event trend",
3143
+ eventTrendNote: "Same scope as annual activity; bucketed by day / week / month, target by planned date",
3144
+ publish: "Published",
3145
+ target: "Target",
3146
+ evShutdown: "Closed",
3147
+ evClaimed: "Claimed",
2200
3148
  created: "Created",
2201
3149
  done: "Done",
2202
3150
  due: "Due",
@@ -2209,6 +3157,13 @@ var require_stats = __commonJS({
2209
3157
  difficultyNote: "Current; includes unset",
2210
3158
  difficultyMissing: "{n} tasks without difficulty",
2211
3159
  difficultyMissingLink: "Review missing difficulty",
3160
+ difficultyDimension: "Difficulty scope",
3161
+ dimAll: "All",
3162
+ dimDone: "Done",
3163
+ dimPublish: "Published",
3164
+ dimClaimed: "Claimed",
3165
+ dimShutdown: "Closed",
3166
+ difficultyNoteRange: "Annual activity scope {from} ~ {to}; includes unset",
2212
3167
  aging: "Overdue aging",
2213
3168
  agingNote: "Current overdue",
2214
3169
  overdueList: "Overdue list",
@@ -2232,6 +3187,12 @@ var require_stats = __commonJS({
2232
3187
  colTarget: "Target",
2233
3188
  colAge: "Days late",
2234
3189
  colTable: "Table",
3190
+ recentTasks: "Recent tasks",
3191
+ recentTasksNote: "Switch the dimension: recently published / completed / closed / claimed",
3192
+ recentTabPublish: "Published",
3193
+ recentTabDone: "Completed",
3194
+ recentTabShutdown: "Closed",
3195
+ recentTabClaimed: "Claimed",
2235
3196
  recentPublish: "Recently published",
2236
3197
  recentPublishNote: "Newest publication first",
2237
3198
  noRecentPublish: "No published tasks yet",
@@ -2242,6 +3203,7 @@ var require_stats = __commonJS({
2242
3203
  colDate: "Date",
2243
3204
  noRecentDone: "No completed tasks yet",
2244
3205
  noRecentShutdown: "No closed tasks yet",
3206
+ noRecentClaimed: "No claimed tasks yet (claim time is only recorded after 5.2.15)",
2245
3207
  noOverdue: "No overdue tasks",
2246
3208
  noData: "No tasks yet. Create one in Tasks and the summary appears here.",
2247
3209
  open: "Active",
@@ -2267,7 +3229,7 @@ var require_stats = __commonJS({
2267
3229
  onNavigate("tasks", { priorityMin: n, priorityMax: n });
2268
3230
  };
2269
3231
  }
2270
- function difficultyPicker(onNavigate) {
3232
+ function difficultyPicker(onNavigate, dimension, range) {
2271
3233
  if (typeof onNavigate !== "function") return null;
2272
3234
  return function(bin) {
2273
3235
  var key = bin && bin.key;
@@ -2277,10 +3239,19 @@ var require_stats = __commonJS({
2277
3239
  }
2278
3240
  var n = Number(key);
2279
3241
  if (!(n >= 0.5 && n <= 5)) return;
2280
- onNavigate("tasks", { difficultyMin: n, difficultyMax: n });
3242
+ if (!dimension || dimension === "all") {
3243
+ onNavigate("tasks", { difficultyMin: n, difficultyMax: n });
3244
+ return;
3245
+ }
3246
+ var params = { filterRoot: true, difficultyMin: n, difficultyMax: n };
3247
+ if (range && range.from && range.to) {
3248
+ params[dimension + "From"] = range.from;
3249
+ params[dimension + "To"] = range.to;
3250
+ }
3251
+ onNavigate("tasks", params);
2281
3252
  };
2282
3253
  }
2283
- var CFG_FALLBACK = { "stats.range": "30d", "stats.top": 10, "stats.showKpi": true, "stats.recentPublishLimit": 10, "stats.recentDoneLimit": 10, "stats.recentShutdownLimit": 10 };
3254
+ 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
3255
  function TasksStatsView(props) {
2285
3256
  var lang = props.lang === "en" ? "en" : "zh";
2286
3257
  var cfg = configView.useConfig(props.api, CFG_FALLBACK);
@@ -2307,6 +3278,10 @@ var require_stats = __commonJS({
2307
3278
  }, []);
2308
3279
  var rangePair = React.useState(cfgRange);
2309
3280
  var range = rangePair[0], setRange = rangePair[1];
3281
+ var dimPair = React.useState("all");
3282
+ var dimension = dimPair[0], setDimension = dimPair[1];
3283
+ var recentPair = React.useState("publish");
3284
+ var recentType = recentPair[0], setRecentType = recentPair[1];
2310
3285
  var dataPair = React.useState(null);
2311
3286
  var data = dataPair[0], setData = dataPair[1];
2312
3287
  var errPair = React.useState("");
@@ -2340,10 +3315,12 @@ var require_stats = __commonJS({
2340
3315
  var id = ++req.current;
2341
3316
  if (!silent) setLoading(true);
2342
3317
  var args = {
3318
+ dimension,
2343
3319
  top: cfgTop,
2344
3320
  recentPublishLimit: cfgLimit("stats.recentPublishLimit"),
2345
3321
  recentDoneLimit: cfgLimit("stats.recentDoneLimit"),
2346
- recentShutdownLimit: cfgLimit("stats.recentShutdownLimit")
3322
+ recentShutdownLimit: cfgLimit("stats.recentShutdownLimit"),
3323
+ recentClaimedLimit: cfgLimit("stats.recentClaimedLimit")
2347
3324
  };
2348
3325
  if (customOk) {
2349
3326
  args.from = customFrom;
@@ -2363,7 +3340,7 @@ var require_stats = __commonJS({
2363
3340
  }).then(function() {
2364
3341
  if (id === req.current) setLoading(false);
2365
3342
  });
2366
- }, [api, range, customOk, customFrom, customTo, cfgTop, cfg]);
3343
+ }, [api, range, dimension, customOk, customFrom, customTo, cfgTop, cfg]);
2367
3344
  React.useEffect(function() {
2368
3345
  if (props.active !== false) load(true);
2369
3346
  }, [load, props.active]);
@@ -2400,42 +3377,68 @@ var require_stats = __commonJS({
2400
3377
  return { key, label: t["range" + (key === "all" ? "All" : key.replace("d", ""))] };
2401
3378
  });
2402
3379
  var children = [];
3380
+ var totals = data ? data.totals || {} : {};
3381
+ var rates = data ? data.rates || {} : {};
3382
+ var b = data ? data.breakdowns || {} : {};
2403
3383
  if (!data && loading) children.push(h(ch.Skeleton, { key: "sk" }));
2404
3384
  if (!data && !loading && err) {
2405
3385
  children.push(h(ch.Card, { key: "err", span: 12 }, h(ch.Empty, { text: t.loadFail })));
2406
3386
  }
2407
3387
  if (data) {
2408
- var totals = data.totals || {};
2409
- var rates = data.rates || {};
2410
- var b = data.breakdowns || {};
2411
3388
  children.push(h(
2412
- "div",
2413
- { key: "kpi", className: "wbt-kpis" },
2414
- h(ch.Kpi, { label: t.total, value: totals.total, hint: t.current, lang }),
2415
- h(ch.Kpi, { label: t.active, value: totals.active, hint: t.ofTotal + " " + ch.pct(totals.total ? totals.active / totals.total : 0), lang }),
2416
- h(ch.Kpi, { label: t.overdue, value: totals.overdue, hint: t.ofActive + " " + ch.pct(rates.overdue), tone: totals.overdue > 0 ? "danger" : "", lang }),
2417
- h(ch.Kpi, { label: t.completion, value: ch.pct(rates.completion), hint: totals.done + " / " + totals.total, tone: "ok", lang }),
2418
- h(ch.Kpi, { label: t.dueToday, value: totals.dueToday, hint: t.current, tone: totals.dueToday > 0 ? "warn" : "", lang }),
2419
- h(ch.Kpi, { label: t.dueNext7, value: totals.dueNext7, hint: t.current, lang }),
2420
- h(ch.Kpi, { label: t.newInRange, value: totals.newInRange, hint: t.inRange, lang }),
2421
- h(ch.Kpi, { label: t.avgCycle, value: rates.avgCycleDays === null || rates.avgCycleDays === void 0 ? "\u2014" : rates.avgCycleDays, unit: t.days, hint: t.inRange, lang })
3389
+ ch.Section,
3390
+ { key: "today", title: t.secToday, note: t.secTodayNote },
3391
+ data.today ? h(Today, { today: data.today, lang }) : null
2422
3392
  ));
2423
- if (totals.total === 0) {
2424
- children.push(h(ch.Card, { key: "empty", span: 12 }, h(ch.Empty, { text: t.noData })));
2425
- } else {
2426
- children.push(h(
3393
+ }
3394
+ if (data && totals.total === 0) {
3395
+ children.push(h(ch.Card, { key: "empty", span: 12 }, h(ch.Empty, { text: t.noData })));
3396
+ }
3397
+ if (data && totals.total > 0) {
3398
+ if (cfg["stats.showKpi"] !== false) {
3399
+ children.push(h(ch.Section, { key: "health", title: t.secHealth, note: t.secHealthNote }, [
3400
+ h(
3401
+ "div",
3402
+ { key: "kpiMain", className: "wbt-kpis wbt-kpis-main" },
3403
+ h(ch.Kpi, { label: t.total, value: totals.total, hint: t.current, size: "lg", lang }),
3404
+ h(ch.Kpi, { label: t.active, value: totals.active, hint: t.ofTotal + " " + ch.pct(totals.total ? totals.active / totals.total : 0), size: "lg", lang }),
3405
+ h(ch.Kpi, { label: t.overdue, value: totals.overdue, hint: t.ofActive + " " + ch.pct(rates.overdue), tone: totals.overdue > 0 ? "danger" : "", size: "lg", lang }),
3406
+ h(ch.Kpi, { label: t.completion, value: ch.pct(rates.completion), hint: totals.done + " / " + totals.total, tone: "ok", size: "lg", lang })
3407
+ ),
3408
+ h(
3409
+ "div",
3410
+ { key: "kpiSub", className: "wbt-kpis wbt-kpis-sub" },
3411
+ h(ch.Kpi, { label: t.dueToday, value: totals.dueToday, hint: t.current, tone: totals.dueToday > 0 ? "warn" : "", size: "sm", lang }),
3412
+ h(ch.Kpi, { label: t.dueNext7, value: totals.dueNext7, hint: t.current, size: "sm", lang }),
3413
+ h(ch.Kpi, { label: t.newInRange, value: totals.newInRange, hint: t.inRange, size: "sm", lang }),
3414
+ h(ch.Kpi, { label: t.avgCycle, value: rates.avgCycleDays === null || rates.avgCycleDays === void 0 ? "\u2014" : rates.avgCycleDays, unit: t.days, hint: t.inRange, size: "sm", lang })
3415
+ )
3416
+ ]));
3417
+ }
3418
+ var activity = [];
3419
+ if (sectionOn("eventTrend")) {
3420
+ activity.push(h(
2427
3421
  ch.Card,
2428
- { key: "trend", span: 8, title: t.trend, note: t.trendNote },
3422
+ { key: "eventTrend", span: 12, title: t.eventTrend, note: t.eventTrendNote },
2429
3423
  h(ch.Trend, {
2430
- data: data.trend || [],
3424
+ data: data.eventTrend || [],
2431
3425
  lang,
3426
+ // 顺序按用户要求:发布 → 目标 → 接取 → 关闭 → 完成;
3427
+ // 颜色跟着含义走不跟着位置走(换序不换色),否则读者要重新认一遍颜色。
2432
3428
  series: [
2433
- { key: "created", label: t.created, color: ch.colors[0] },
2434
- { key: "done", label: t.done, color: ch.colors[1] },
2435
- { key: "due", label: t.due, color: ch.colors[2] }
3429
+ { key: "publish", label: t.publish, color: ch.colors[0] },
3430
+ { key: "target", label: t.target, color: ch.colors[5] },
3431
+ { key: "claimed", label: t.evClaimed, color: ch.colors[2] },
3432
+ { key: "shutdown", label: t.evShutdown, color: ch.colors[3] },
3433
+ { key: "done", label: t.done, color: ch.colors[1] }
2436
3434
  ]
2437
3435
  })
2438
3436
  ));
3437
+ }
3438
+ activity.push(h(Heatmap, { key: "heatmap", api, lang, active: props.active, onNavigate: props.onNavigate }));
3439
+ children.push(h(ch.Section, { key: "activity", title: t.secActivity, note: t.secActivityNote }, activity));
3440
+ var dist = [];
3441
+ if (sectionOn("status")) {
2439
3442
  var statusData = (b.status || []).filter(function(s) {
2440
3443
  return Object.prototype.hasOwnProperty.call(ch.statusColors, s.key);
2441
3444
  }).map(function(s) {
@@ -2444,7 +3447,7 @@ var require_stats = __commonJS({
2444
3447
  var statusTotal = statusData.reduce(function(sum, s) {
2445
3448
  return sum + Number(s.count || 0);
2446
3449
  }, 0);
2447
- children.push(h(
3450
+ dist.push(h(
2448
3451
  ch.Card,
2449
3452
  { key: "status", span: 4, title: t.status, note: t.statusNote },
2450
3453
  h(ch.Donut, {
@@ -2457,20 +3460,43 @@ var require_stats = __commonJS({
2457
3460
  }).join("; ")
2458
3461
  })
2459
3462
  ));
2460
- children.push(h(
3463
+ }
3464
+ if (sectionOn("priority")) {
3465
+ dist.push(h(
2461
3466
  ch.Card,
2462
- { key: "priority", span: 6, title: t.priority, note: t.priorityNote },
3467
+ { key: "priority", span: 4, title: t.priority, note: t.priorityNote },
2463
3468
  h(ch.Histogram, { data: visibleBins(b.priority), lang, color: ch.colors[0], onSelect: priorityPicker(props.onNavigate), selectHint: lang === "en" ? "click to list" : "\u70B9\u51FB\u67E5\u770B\u4EFB\u52A1" })
2464
3469
  ));
3470
+ }
3471
+ if (sectionOn("difficulty")) {
2465
3472
  var missingBin = (b.difficulty || []).find(function(bin) {
2466
3473
  return bin.key === "unset";
2467
3474
  });
2468
- children.push(h(
3475
+ var dims = [["all", t.dimAll], ["done", t.dimDone], ["publish", t.dimPublish], ["claimed", t.dimClaimed], ["shutdown", t.dimShutdown]];
3476
+ var rangeBox = data.range || {};
3477
+ var diffNote = dimension === "all" ? t.difficultyNote : t.difficultyNoteRange.replace("{from}", String(rangeBox.from || "")).replace("{to}", String(rangeBox.to || ""));
3478
+ dist.push(h(
2469
3479
  ch.Card,
2470
- { key: "difficulty", span: 6, title: t.difficulty, note: t.difficultyNote },
3480
+ { key: "difficulty", span: 4, title: t.difficulty, note: diffNote },
3481
+ h(
3482
+ "div",
3483
+ { className: "wbt-dims", role: "tablist", "aria-label": t.difficultyDimension },
3484
+ dims.map(function(item) {
3485
+ return h("button", {
3486
+ key: item[0],
3487
+ type: "button",
3488
+ role: "tab",
3489
+ className: "wbt-dims-tab",
3490
+ "aria-selected": dimension === item[0],
3491
+ onClick: function() {
3492
+ setDimension(item[0]);
3493
+ }
3494
+ }, item[1]);
3495
+ })
3496
+ ),
2471
3497
  h(ch.Histogram, { data: (b.difficulty || []).map(function(bin) {
2472
3498
  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" }),
3499
+ }), 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
3500
  h(
2475
3501
  "p",
2476
3502
  null,
@@ -2481,26 +3507,36 @@ var require_stats = __commonJS({
2481
3507
  } }, t.difficultyMissingLink) : null
2482
3508
  )
2483
3509
  ));
2484
- children.push(h(
3510
+ }
3511
+ children.push(h(ch.Section, { key: "distribution", title: t.secDist, note: t.secDistNote }, dist));
3512
+ var risk = [];
3513
+ if (sectionOn("aging")) {
3514
+ risk.push(h(
2485
3515
  ch.Card,
2486
3516
  { key: "aging", span: 6, title: t.aging, note: t.agingNote },
2487
3517
  h(ch.Histogram, { data: data.aging || [], lang, color: ch.colors[2] })
2488
3518
  ));
2489
- children.push(h(
3519
+ }
3520
+ if (sectionOn("overdue")) {
3521
+ risk.push(h(
2490
3522
  ch.Card,
2491
3523
  { key: "overdue", span: 6, title: t.overdueList, note: t.overdueNote },
2492
3524
  h(ch.DataTable, listProps(data, "overdue", lang, {
2493
3525
  lang,
2494
3526
  empty: t.noOverdue,
2495
3527
  columns: [
2496
- { key: "title", label: t.colTitle },
3528
+ { key: "title", label: t.colTitle, render: taskTitle(lang, props.onNavigate) },
2497
3529
  { key: "targetDate", label: t.colTarget },
2498
3530
  { key: "daysOverdue", label: t.colAge, num: true },
2499
3531
  { key: "tableTitle", label: t.colTable }
2500
3532
  ]
2501
3533
  }))
2502
3534
  ));
2503
- children.push(h(
3535
+ }
3536
+ children.push(h(ch.Section, { key: "risk", title: t.secRisk, note: t.secRiskNote }, risk));
3537
+ var rank = [];
3538
+ if (sectionOn("tables")) {
3539
+ rank.push(h(
2504
3540
  ch.Card,
2505
3541
  { key: "tables", span: 6, title: t.tables, note: t.tablesNote },
2506
3542
  h(ch.DataTable, {
@@ -2517,7 +3553,9 @@ var require_stats = __commonJS({
2517
3553
  ]
2518
3554
  })
2519
3555
  ));
2520
- children.push(h(
3556
+ }
3557
+ if (sectionOn("groups")) {
3558
+ rank.push(h(
2521
3559
  ch.Card,
2522
3560
  { key: "groups", span: 6, title: t.groups, note: t.groupsNote },
2523
3561
  h(ch.DataTable, {
@@ -2534,14 +3572,16 @@ var require_stats = __commonJS({
2534
3572
  ]
2535
3573
  })
2536
3574
  ));
3575
+ }
3576
+ if (sectionOn("workspaces")) {
2537
3577
  var wsRows = (data.rankings && data.rankings.workspaces || []).slice();
2538
3578
  var noneRow = data.rankings && data.rankings.noWorkspace;
2539
3579
  if (noneRow && (wsRows.length || noneRow.total > 0)) {
2540
3580
  wsRows.push(Object.assign({}, noneRow, { title: t.noWorkspaceRow }));
2541
3581
  }
2542
- children.push(h(
3582
+ rank.push(h(
2543
3583
  ch.Card,
2544
- { key: "workspaces", span: 6, title: t.workspaces, note: t.workspacesNote },
3584
+ { key: "workspaces", span: 12, title: t.workspaces, note: t.workspacesNote },
2545
3585
  h(ch.DataTable, {
2546
3586
  rows: wsRows,
2547
3587
  lang,
@@ -2557,37 +3597,50 @@ var require_stats = __commonJS({
2557
3597
  ]
2558
3598
  })
2559
3599
  ));
3600
+ }
3601
+ children.push(h(ch.Section, { key: "rank", title: t.secRank, note: t.secRankNote }, rank));
3602
+ if (sectionOn("timeline")) {
2560
3603
  children.push(h(TimelineSection, { key: "timeline", api, lang, active: props.active, ch }));
3604
+ }
3605
+ if (sectionOn("recent")) {
2561
3606
  var recentCols = recentColumns(t, lang, props.onNavigate);
3607
+ var recentTabs = [
3608
+ ["publish", t.recentTabPublish, "recentPublish", t.noRecentPublish],
3609
+ ["done", t.recentTabDone, "recentDone", t.noRecentDone],
3610
+ ["shutdown", t.recentTabShutdown, "recentShutdown", t.noRecentShutdown],
3611
+ ["claimed", t.recentTabClaimed, "recentClaimed", t.noRecentClaimed]
3612
+ ];
3613
+ var recentTab = recentTabs[0];
3614
+ recentTabs.forEach(function(item) {
3615
+ if (item[0] === recentType) recentTab = item;
3616
+ });
2562
3617
  children.push(h(
2563
3618
  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 }))
3619
+ { key: "recent", span: 12, title: t.recentTasks, note: t.recentTasksNote },
3620
+ h(
3621
+ "div",
3622
+ { className: "wbt-dims", role: "tablist", "aria-label": t.recentTasks },
3623
+ recentTabs.map(function(item) {
3624
+ return h("button", {
3625
+ key: item[0],
3626
+ type: "button",
3627
+ role: "tab",
3628
+ className: "wbt-dims-tab",
3629
+ "aria-selected": recentType === item[0],
3630
+ onClick: function() {
3631
+ setRecentType(item[0]);
3632
+ }
3633
+ }, item[1]);
3634
+ })
3635
+ ),
3636
+ h(ch.DataTable, listProps(data, recentTab[2], lang, { lang, empty: recentTab[3], columns: recentCols }))
2576
3637
  ));
2577
3638
  }
2578
- children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
2579
3639
  }
2580
- children = children.filter(function(node) {
2581
- var k = node && node.key;
2582
- if (!k || k === "sk" || k === "err" || k === "warn" || k === "empty") return true;
2583
- if (k === "kpi") return cfg["stats.showKpi"] !== false;
2584
- return sectionOn(k);
2585
- });
3640
+ if (data) children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
2586
3641
  return h(
2587
3642
  "div",
2588
3643
  { className: "wbt-stats" },
2589
- h(Today, { today: data && data.today, lang }),
2590
- h(Heatmap, { api, lang, active: props.active, onNavigate: props.onNavigate }),
2591
3644
  h(ch.RangeSwitch, {
2592
3645
  options,
2593
3646
  value: customFrom || customTo ? null : range,
@@ -3027,7 +4080,9 @@ var require_data_view = __commonJS({
3027
4080
  }
3028
4081
  function loadTables() {
3029
4082
  setLoadingTables(true);
3030
- Promise.resolve(api.call(DOMAIN + ".dataTables")).then(function(r) {
4083
+ Promise.resolve((options.tablesLoader || function(a) {
4084
+ return a.call(DOMAIN + ".dataTables");
4085
+ })(api)).then(function(r) {
3031
4086
  if (r && r.ok === false) throw new Error(r && r.error || t.loadFail);
3032
4087
  var body = unwrap(r);
3033
4088
  if (!body || !Array.isArray(body.tables)) throw new Error(t.loadFail);
@@ -3092,7 +4147,9 @@ var require_data_view = __commonJS({
3092
4147
  if (sort) args.sort = sort;
3093
4148
  if (search) args.search = search;
3094
4149
  if (Object.keys(filters).length) args.filters = filters;
3095
- Promise.resolve(api.call(DOMAIN + ".dataQuery", args)).then(function(r) {
4150
+ Promise.resolve((options.query || function(a, q) {
4151
+ return a.call(DOMAIN + ".dataQuery", q);
4152
+ })(api, args)).then(function(r) {
3096
4153
  if (req !== reqRef.current) return;
3097
4154
  if (r && r.ok === false) throw new Error(r && r.error || t.queryFail);
3098
4155
  var body = unwrap(r);
@@ -3474,7 +4531,7 @@ var require_data_view = __commonJS({
3474
4531
  }
3475
4532
  }
3476
4533
  }),
3477
- h("span", null, fmt(t.queryTime, { n: data ? data.queryMs : 0 }))
4534
+ data && data.queryMs !== void 0 ? h("span", null, fmt(t.queryTime, { n: data.queryMs })) : null
3478
4535
  );
3479
4536
  }
3480
4537
  if (!tables && loadingTables && options.Skeleton) return h(options.Skeleton, { lang, label: t.loading });
@@ -3510,7 +4567,7 @@ var require_data_view = __commonJS({
3510
4567
  "span",
3511
4568
  { className: P + "-stabname" },
3512
4569
  h("span", null, tableLabel(tb)),
3513
- h("span", { className: P + "-sidecount" }, String(tb.count))
4570
+ h("span", { className: P + "-sidecount" }, tb.count === void 0 || tb.count === null ? "" : String(tb.count))
3514
4571
  ),
3515
4572
  h("span", { className: P + "-sidetable" }, tb.name)
3516
4573
  );
@@ -3537,7 +4594,7 @@ var require_data_view = __commonJS({
3537
4594
  h(
3538
4595
  "div",
3539
4596
  { className: P + "-sub" },
3540
- current ? fmt(t.rowCount, { n: current.count }) : "",
4597
+ current && data && data.total !== void 0 ? fmt(t.rowCount, { n: data.total }) : "",
3541
4598
  current && current.deletedCount ? " \xB7 " + fmt(t.deletedCount, { n: current.deletedCount }) : "",
3542
4599
  " \xB7 " + t.subtitle
3543
4600
  )
@@ -3735,8 +4792,21 @@ var require_action_schema_style = __commonJS({
3735
4792
  "." + P + " select:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:1px}",
3736
4793
  "." + P + "-list{display:flex;flex-direction:column;gap:8px}",
3737
4794
  "." + P + "-card{border:1px solid var(--wb-border,#e3e5e9);border-radius:10px;padding:10px 12px;background:var(--wb-surface,var(--dsw-alias-bg-layer-1,transparent));display:flex;flex-direction:column;gap:8px;min-width:0}",
3738
- "." + P + "-cardhead{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",
3739
- "." + P + "-cardhead code{font-weight:640}",
4795
+ "." + P + "-cardhead{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px}",
4796
+ "." + P + "-cardmeta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;min-height:24px}",
4797
+ "." + P + "-cardhead code{font-weight:640;overflow-wrap:anywhere;min-width:0}",
4798
+ "." + P + "-hintline{margin:0;color:var(--dsw-alias-label-tertiary,inherit);font-size:11.5px;line-height:1.5}",
4799
+ "." + P + "-toggle{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 2px;border:0;background:transparent;font:inherit;font-size:11.5px;color:var(--wb-muted);cursor:pointer}",
4800
+ "." + P + "-track{display:inline-flex;align-items:center;box-sizing:border-box;width:30px;height:18px;padding:2px;border:1px solid var(--wb-muted);border-radius:999px;background:var(--wb-surface);color:var(--wb-muted)}",
4801
+ "." + P + "-track::before{content:'';width:12px;height:12px;border-radius:50%;background:currentColor;transition:transform .15s ease}",
4802
+ "." + P + "-toggle[aria-checked=true] ." + P + "-track{background:var(--wb-accent);border-color:var(--wb-accent);color:var(--wb-card)}",
4803
+ "." + P + "-toggle[aria-checked=true] ." + P + "-track::before{transform:translateX(12px)}",
4804
+ "." + P + "-toggle:hover:not(:disabled) ." + P + "-track{outline:1px solid var(--wb-accent)}",
4805
+ "." + P + "-toggle:focus-visible{outline:2px solid var(--wb-accent);outline-offset:2px}",
4806
+ "." + P + "-toggle:disabled{opacity:.6;cursor:progress}",
4807
+ "@media(prefers-reduced-motion:reduce){." + P + "-track::before{transition:none}}",
4808
+ // 安全约束(不可放开):用警示色描边,和可切换的开关区分开。
4809
+ "." + P + "-locked{border-color:var(--wb-warn,#b7791f);color:var(--wb-warn,#b7791f)}",
3740
4810
  "." + P + "-desc{margin:0;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55;font-size:12.5px}",
3741
4811
  // 搜索命中:用品牌色透明度叠加而不是写死浅色,深浅主题都可读;继承文字颜色、不覆盖 ::selection。
3742
4812
  "." + P + " mark." + P + "-hit{background:color-mix(in oklab,var(--dsw-alias-brand-primary,#4f6ef7) 22%,transparent);color:inherit;border-radius:2px;padding:0;font:inherit;box-decoration-break:clone;-webkit-box-decoration-break:clone}",
@@ -3788,6 +4858,15 @@ var require_action_schema_view = __commonJS({
3788
4858
  zh: {
3789
4859
  title: "Action",
3790
4860
  hint: "\u8FD0\u884C\u65F6\u6CE8\u518C \xB7 \u53EA\u8BFB",
4861
+ switchHint: "agent \u5F00\u5173\u843D\u672C\u673A\u3001\u5373\u6539\u5373\u751F\u6548\uFF1B\u754C\u9762\u64CD\u4F5C\u4E0D\u53D7\u5F71\u54CD\u3002",
4862
+ hostHint: "\u5BBF\u4E3B action \u7684 agent \u5F00\u5173\uFF1B\u6807\u300C\u4EC5\u754C\u9762 \xB7 \u5B89\u5168\u7EA6\u675F\u300D\u7684\u4E0D\u53EF\u653E\u5F00\u3002",
4863
+ agentSwitch: "agent \u53EF\u7528",
4864
+ agentLocked: "\u4EC5\u754C\u9762 \xB7 \u5B89\u5168\u7EA6\u675F",
4865
+ agentLockedHint: "\u8BE5 action \u53EA\u80FD\u5728\u754C\u9762\u6267\u884C\uFF08\u5B89\u5168\u7EA6\u675F\uFF09\uFF0Cagent \u5F00\u5173\u4E0D\u53EF\u653E\u5F00",
4866
+ agentSaving: "\u4FDD\u5B58\u4E2D\u2026",
4867
+ agentOnToast: "\u5DF2\u5141\u8BB8 agent \u8C03\u7528",
4868
+ agentOffToast: "\u5DF2\u7981\u6B62 agent \u8C03\u7528",
4869
+ agentFail: "\u5207\u6362 agent \u5F00\u5173\u5931\u8D25",
3791
4870
  domain: "\u57DF",
3792
4871
  versionLabel: "\u7248\u672C",
3793
4872
  shell: "\u5BBF\u4E3B",
@@ -3833,6 +4912,15 @@ var require_action_schema_view = __commonJS({
3833
4912
  en: {
3834
4913
  title: "Actions",
3835
4914
  hint: "runtime registry \xB7 read-only",
4915
+ switchHint: "The agent switch is stored locally and applies immediately; UI actions are unaffected.",
4916
+ hostHint: "Agent switch for host actions; items marked UI-only (security) cannot be opened up.",
4917
+ agentSwitch: "Agent callable",
4918
+ agentLocked: "UI only \xB7 security",
4919
+ agentLockedHint: "This action can only run from the UI (security constraint); the agent switch cannot be opened",
4920
+ agentSaving: "Saving\u2026",
4921
+ agentOnToast: "Agent calls allowed",
4922
+ agentOffToast: "Agent calls blocked",
4923
+ agentFail: "Failed to change the agent switch",
3836
4924
  domain: "Domain",
3837
4925
  versionLabel: "Version",
3838
4926
  shell: "Host",
@@ -3945,7 +5033,9 @@ var require_action_schema_view = __commonJS({
3945
5033
  }
3946
5034
  module2.exports = function createActionSchemaView(options) {
3947
5035
  var raw = String(options.domain || "");
3948
- var DOMAIN = raw.indexOf("wb-addon-") === 0 ? raw : "wb-addon-" + raw;
5036
+ var SOURCE = options.source === "actions.list" ? "actions.list" : "actionSchema";
5037
+ var DOMAIN = SOURCE === "actions.list" ? raw : raw.indexOf("wb-addon-") === 0 ? raw : "wb-addon-" + raw;
5038
+ var LIST_DOMAIN = options.listDomain ? String(options.listDomain) : DOMAIN;
3949
5039
  var prefix = options.prefix;
3950
5040
  var P = prefix + "-as";
3951
5041
  var Icon2 = options.Icon || null;
@@ -3989,6 +5079,8 @@ var require_action_schema_view = __commonJS({
3989
5079
  var typePick = typeState[0], setTypePick = typeState[1];
3990
5080
  var toastState = React.useState("");
3991
5081
  var toast = toastState[0], setToast = toastState[1];
5082
+ var savingState = React.useState("");
5083
+ var saving = savingState[0], setSaving = savingState[1];
3992
5084
  React.useEffect(function() {
3993
5085
  injectCss();
3994
5086
  }, []);
@@ -3997,9 +5089,10 @@ var require_action_schema_view = __commonJS({
3997
5089
  setLoading(true);
3998
5090
  setErr("");
3999
5091
  var pending;
4000
- var actionName = DOMAIN.replace(/^wb-addon-/, "") + ".actionSchema";
5092
+ var actionName = SOURCE === "actions.list" ? "actions.list" : DOMAIN.replace(/^wb-addon-/, "") + ".actionSchema";
5093
+ var callArgs = SOURCE === "actions.list" ? { detail: true, domain: LIST_DOMAIN } : void 0;
4001
5094
  if (api && typeof api.call === "function") {
4002
- pending = Promise.resolve(api.call(actionName)).then(function(r) {
5095
+ pending = Promise.resolve(api.call(actionName, callArgs)).then(function(r) {
4003
5096
  if (r && r.ok === false) return r;
4004
5097
  return r && r.result || r;
4005
5098
  });
@@ -4039,6 +5132,39 @@ var require_action_schema_view = __commonJS({
4039
5132
  plainCopy(text);
4040
5133
  done();
4041
5134
  }
5135
+ function setAgent(action, next) {
5136
+ var name = action.name;
5137
+ setSaving(name);
5138
+ setToast("");
5139
+ var fail = function(e) {
5140
+ setSaving("");
5141
+ setToast(t.agentFail + "\uFF1A" + String(e && e.message || e || ""));
5142
+ };
5143
+ var done = function(r) {
5144
+ setSaving("");
5145
+ var payload = r && typeof r === "object" && Object.prototype.hasOwnProperty.call(r, "result") ? r.result : r;
5146
+ if (r && r.ok === false) {
5147
+ setToast(t.agentFail + "\uFF1A" + String(r.error || r.text || ""));
5148
+ return;
5149
+ }
5150
+ var value = payload && typeof payload.agentEnabled === "boolean" ? payload.agentEnabled : next;
5151
+ setSnap(function(prev) {
5152
+ if (!prev || !Array.isArray(prev.actions)) return prev;
5153
+ return Object.assign({}, prev, {
5154
+ actions: prev.actions.map(function(a) {
5155
+ if (!a || a.name !== name) return a;
5156
+ return Object.assign({}, a, { agentEnabled: value });
5157
+ })
5158
+ });
5159
+ });
5160
+ setToast(value ? t.agentOnToast : t.agentOffToast);
5161
+ };
5162
+ if (!api || typeof api.call !== "function") {
5163
+ fail(new Error("no call api"));
5164
+ return;
5165
+ }
5166
+ Promise.resolve(api.call("actions.setAgentAccess", { action: name, agentEnabled: next })).then(done, fail);
5167
+ }
4042
5168
  var all = snap && Array.isArray(snap.actions) ? snap.actions.filter(function(a) {
4043
5169
  return a && a.domain === DOMAIN;
4044
5170
  }) : [];
@@ -4087,6 +5213,35 @@ var require_action_schema_view = __commonJS({
4087
5213
  h("td", null, Highlight.hit(row.description, kw))
4088
5214
  );
4089
5215
  }
5216
+ function agentSwitch(action) {
5217
+ if (action.agentLocked === true) {
5218
+ return h("span", {
5219
+ className: P + "-badge " + P + "-locked",
5220
+ title: t.agentLockedHint,
5221
+ "data-agent-locked": action.name
5222
+ }, t.agentLocked);
5223
+ }
5224
+ if (typeof action.agentEnabled !== "boolean") return null;
5225
+ var busy = saving === action.name;
5226
+ return h(
5227
+ "button",
5228
+ {
5229
+ className: P + "-toggle",
5230
+ "data-agent-row": action.name,
5231
+ type: "button",
5232
+ role: "switch",
5233
+ "aria-checked": action.agentEnabled,
5234
+ disabled: busy,
5235
+ "data-agent-toggle": action.name,
5236
+ "aria-label": t.agentSwitch + " \xB7 " + action.name,
5237
+ onClick: function() {
5238
+ setAgent(action, !action.agentEnabled);
5239
+ }
5240
+ },
5241
+ h("span", { className: P + "-track", "aria-hidden": true }),
5242
+ h("span", null, busy ? t.agentSaving : t.agentSwitch)
5243
+ );
5244
+ }
4090
5245
  function card(action) {
4091
5246
  var rows = paramRows(action);
4092
5247
  var examples = Array.isArray(action.examples) ? action.examples : [];
@@ -4096,12 +5251,16 @@ var require_action_schema_view = __commonJS({
4096
5251
  h(
4097
5252
  "div",
4098
5253
  { className: P + "-cardhead" },
4099
- h("code", { className: P + "-mono" }, Highlight.hit(action.name, kw)),
4100
- h("span", { className: P + "-badge" }, action.domain),
4101
- h("span", { className: P + "-badge" }, rows.length ? t.paramCount(rows.length) : t.noParams),
4102
- rows.some(function(row) {
4103
- return row.required;
4104
- }) ? h("span", { className: P + "-badge " + P + "-req" }, t.required) : null
5254
+ h(
5255
+ "div",
5256
+ { className: P + "-cardmeta" },
5257
+ h("code", { className: P + "-mono" }, Highlight.hit(action.name, kw)),
5258
+ h("span", { className: P + "-badge" }, rows.length ? t.paramCount(rows.length) : t.noParams),
5259
+ rows.some(function(row) {
5260
+ return row.required;
5261
+ }) ? h("span", { className: P + "-badge " + P + "-req" }, t.required) : null
5262
+ ),
5263
+ agentSwitch(action)
4105
5264
  ),
4106
5265
  action.description ? h("p", { className: P + "-desc" }, Highlight.hit(action.description, kw)) : null,
4107
5266
  rows.length ? h(
@@ -4178,6 +5337,7 @@ var require_action_schema_view = __commonJS({
4178
5337
  h("span", { className: P + "-badge" }, t.count(visible.length, all.length)),
4179
5338
  h("span", { className: P + "-none" }, t.hint)
4180
5339
  ),
5340
+ h("p", { className: P + "-hintline" }, SOURCE === "actions.list" ? t.hostHint : t.switchHint),
4181
5341
  snap ? h(
4182
5342
  "div",
4183
5343
  { className: P + "-toolbar" },
@@ -4269,7 +5429,7 @@ var require_copy = __commonJS({
4269
5429
  timelineSearch: "\u641C\u7D22\u65F6\u95F4\u7EBF\u6807\u9898\u6216\u63CF\u8FF0",
4270
5430
  timelineSearchButton: "\u641C\u7D22",
4271
5431
  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",
5432
+ timelineOrder: "\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217\uFF0C\u70B9\u51FB\u4EFB\u52A1\u6253\u5F00\u9884\u89C8",
4273
5433
  timelineSearchEmpty: "\u6CA1\u6709\u627E\u5230\u5305\u542B \u201C{query}\u201D \u7684\u65F6\u95F4\u7EBF",
4274
5434
  timelineEmpty: "\u6682\u65E0\u65F6\u95F4\u7EBF\uFF0C\u53EF\u70B9\u51FB\u201C\u65B0\u5EFA\u65F6\u95F4\u7EBF\u201D\u624B\u52A8\u5EFA\u7ACB\u3002",
4275
5435
  timelineOpen: "\u5F00\u542F",
@@ -4281,19 +5441,21 @@ var require_copy = __commonJS({
4281
5441
  timelinePreview: "\u9884\u89C8\u5408\u5E76",
4282
5442
  timelinePreviewCount: "\u5C06\u79FB\u52A8 {n} \u6761\u4EFB\u52A1\u5230\u76EE\u6807\u65F6\u95F4\u7EBF\u3002",
4283
5443
  timelineConfirm: "\u786E\u8BA4\u5408\u5E76",
5444
+ previewLabel: "\u4EFB\u52A1\u9884\u89C8",
5445
+ previewUntitled: "\u672A\u547D\u540D\u4EFB\u52A1",
5446
+ previewOpen: "\u70B9\u51FB\u9884\u89C8\u4EFB\u52A1",
5447
+ previewHint: "\u53EA\u8BFB\u9884\u89C8\uFF1B\u9700\u8981\u4FEE\u6539\u8BF7\u70B9\u4E0B\u65B9\u300C\u7F16\u8F91\u4EFB\u52A1\u300D\u3002",
4284
5448
  bodyModeToggle: bodyCopy.zh.bodyModeToggle,
4285
5449
  bodyMode: "\u63CF\u8FF0\u4E0E\u611F\u53D7\u663E\u793A\u6A21\u5F0F",
4286
5450
  markdown: "Markdown \u6E32\u67D3",
4287
5451
  plainText: "\u7EAF\u6587\u672C",
4288
5452
  bodyModeLocal: "\u5DF2\u5728\u5F53\u524D\u6D4F\u89C8\u5668\u5207\u6362\uFF0C\u914D\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF1A",
4289
5453
  title: "\u4EFB\u52A1",
4290
- search: "\u641C\u7D22\u6807\u9898 / \u63CF\u8FF0 / \u611F\u53D7",
5454
+ search: "\u641C\u7D22\u6807\u9898 / \u63CF\u8FF0 / \u611F\u53D7 / \u4EFB\u52A1 ID",
4291
5455
  newTask: "\u65B0\u5EFA\u4EFB\u52A1",
4292
5456
  tree: "\u4EFB\u52A1\u6811",
4293
5457
  select: "\u9009\u62E9",
4294
5458
  cancelSelect: "\u9000\u51FA\u9009\u62E9",
4295
- list: "\u5217\u8868",
4296
- card: "\u5361\u7247",
4297
5459
  all: "\u5168\u90E8",
4298
5460
  empty: "\u8FD9\u4E2A\u89C6\u56FE\u8FD8\u6CA1\u6709\u4EFB\u52A1",
4299
5461
  loading: "\u52A0\u8F7D\u4E2D\u2026",
@@ -4302,6 +5464,7 @@ var require_copy = __commonJS({
4302
5464
  cancel: "\u53D6\u6D88",
4303
5465
  create: "\u521B\u5EFA",
4304
5466
  close: "\u5173\u95ED",
5467
+ taskId: "\u4EFB\u52A1 ID",
4305
5468
  addGroup: "\u65B0\u5EFA\u7EC4",
4306
5469
  addTable: "\u65B0\u5EFA\u8868",
4307
5470
  rename: "\u91CD\u547D\u540D",
@@ -4433,7 +5596,7 @@ var require_copy = __commonJS({
4433
5596
  timelineSearch: "Search timeline titles or descriptions",
4434
5597
  timelineSearchButton: "Search",
4435
5598
  timelineMembers: "Member tasks",
4436
- timelineOrder: "Oldest publication first. Click a task to open details.",
5599
+ timelineOrder: "Oldest publication first. Click a task to open a preview.",
4437
5600
  timelineSearchEmpty: "No timelines contain \u201C{query}\u201D.",
4438
5601
  timelineEmpty: "No timelines yet. Use New timeline to create one manually.",
4439
5602
  timelineOpen: "Open",
@@ -4445,19 +5608,21 @@ var require_copy = __commonJS({
4445
5608
  timelinePreview: "Preview merge",
4446
5609
  timelinePreviewCount: "{n} tasks will move into the target timeline.",
4447
5610
  timelineConfirm: "Confirm merge",
5611
+ previewLabel: "Task preview",
5612
+ previewUntitled: "Untitled task",
5613
+ previewOpen: "Click to preview task",
5614
+ previewHint: "Read-only preview. Use Edit task below to make changes.",
4448
5615
  bodyModeToggle: bodyCopy.en.bodyModeToggle,
4449
5616
  bodyMode: "Description and reflection display mode",
4450
5617
  markdown: "Render Markdown",
4451
5618
  plainText: "Plain text",
4452
5619
  bodyModeLocal: "Changed in this browser; could not save config:",
4453
5620
  title: "Tasks",
4454
- search: "Search title / description / feeling",
5621
+ search: "Search title / description / feeling / task ID",
4455
5622
  newTask: "New task",
4456
5623
  tree: "Task tree",
4457
5624
  select: "Select",
4458
5625
  cancelSelect: "Exit select",
4459
- list: "List",
4460
- card: "Cards",
4461
5626
  all: "All",
4462
5627
  empty: "No tasks in this view",
4463
5628
  loading: "Loading\u2026",
@@ -4466,6 +5631,7 @@ var require_copy = __commonJS({
4466
5631
  cancel: "Cancel",
4467
5632
  create: "Create",
4468
5633
  close: "Close",
5634
+ taskId: "Task ID",
4469
5635
  addGroup: "New group",
4470
5636
  addTable: "New table",
4471
5637
  rename: "Rename",
@@ -6696,6 +7862,13 @@ var require_description = __commonJS({
6696
7862
  var React = require("react");
6697
7863
  var h = React.createElement;
6698
7864
  var Body = require_markdown().createBody(React);
7865
+ var bodies = typeof WeakMap === "function" ? /* @__PURE__ */ new WeakMap() : null;
7866
+ function bodyFor(Highlight) {
7867
+ if (!Highlight) return Body;
7868
+ if (!bodies) return require_markdown().createBody(React, Highlight);
7869
+ if (!bodies.has(Highlight)) bodies.set(Highlight, require_markdown().createBody(React, Highlight));
7870
+ return bodies.get(Highlight);
7871
+ }
6699
7872
  var BodyMode = require_body_toggle()(React);
6700
7873
  var copy = require_body_copy();
6701
7874
  var Code = (init_code_2(), __toCommonJS(code_2_exports)).default;
@@ -6714,6 +7887,7 @@ var require_description = __commonJS({
6714
7887
  var mode = React.useState(props.bodyMode === "text" ? "text" : "markdown");
6715
7888
  var labelId = require_body_id()(React) + "-desc", t = copy[props.lang === "en" ? "en" : "zh"];
6716
7889
  var text = props.text == null ? "" : String(props.text);
7890
+ var DescBody = bodyFor(props.Highlight);
6717
7891
  var expanded = React.useState(false), overflow = React.useState(false), ref = React.useRef(null);
6718
7892
  React.useEffect(function() {
6719
7893
  expanded[1](false);
@@ -6747,7 +7921,7 @@ var require_description = __commonJS({
6747
7921
  h(
6748
7922
  "div",
6749
7923
  { ref, className: "wb-desc-text" + (expanded[0] ? "" : " wb-desc-clamped") },
6750
- h(Body, { text, mode: mode[0] })
7924
+ h(DescBody, { text, mode: mode[0], keyword: props.keyword })
6751
7925
  ),
6752
7926
  overflow[0] || expanded[0] ? h("button", {
6753
7927
  type: "button",
@@ -6764,6 +7938,41 @@ var require_description = __commonJS({
6764
7938
  }
6765
7939
  });
6766
7940
 
7941
+ // packages/addons/lib/filter-checklist-styles.cjs
7942
+ var require_filter_checklist_styles = __commonJS({
7943
+ "packages/addons/lib/filter-checklist-styles.cjs"(exports2, module2) {
7944
+ "use strict";
7945
+ module2.exports = [
7946
+ ".wbck{display:flex;flex-direction:column;min-width:0}",
7947
+ ".wbck-search{padding:0 0 6px}",
7948
+ ".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}",
7949
+ ".wbck-input:focus-visible{outline:2px solid var(--wb-accent);outline-offset:1px}",
7950
+ ".wbck-input:disabled{opacity:.6;cursor:not-allowed}",
7951
+ ".wbck-head{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--wb-muted);padding:2px 4px 7px}",
7952
+ ".wbck-grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7953
+ ".wbck-sel{flex:none;color:var(--wb-accent)}",
7954
+ ".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}",
7955
+ ".wbck-clear:hover:enabled{opacity:1;background:color-mix(in srgb, currentColor 8%, transparent)}",
7956
+ ".wbck-clear:focus-visible{outline:2px solid var(--wb-accent);outline-offset:1px}",
7957
+ ".wbck-clear:disabled{opacity:.4;cursor:not-allowed}",
7958
+ ".wbck-list{max-height:220px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--wb-border);border-radius:10px;padding:2px}",
7959
+ ".wbck-opt{display:flex;align-items:center;gap:7px;padding:6px;border-radius:6px;font-size:12.5px;cursor:pointer}",
7960
+ ".wbck-opt:hover{background:color-mix(in srgb, currentColor 7%, transparent)}",
7961
+ ".wbck-opt.is-on{background:color-mix(in srgb, var(--wb-accent) 10%, transparent)}",
7962
+ ".wbck-opt input{margin:0;flex:none;accent-color:var(--wb-accent)}",
7963
+ // 单选变体用 button 渲染(role="radio"),这里把浏览器默认按钮样式清掉,视觉与多选行一致。
7964
+ '.wbck-opt[role="radio"]{appearance:none;width:100%;box-sizing:border-box;border:0;background:transparent;color:inherit;font:inherit;text-align:left}',
7965
+ '.wbck-opt[role="radio"]:disabled{opacity:.55;cursor:not-allowed}',
7966
+ '.wbck-opt[role="radio"]:focus-visible{outline:2px solid var(--wb-accent);outline-offset:-2px}',
7967
+ ".wbck-nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7968
+ ".wbck-meta{margin-left:auto;flex:none;font-size:11.5px;color:var(--wb-muted)}",
7969
+ ".wbck-note{font-size:12px;color:var(--wb-muted);padding:8px 6px}",
7970
+ ".wbck-more{font-size:11px;color:var(--wb-muted);text-align:center;padding:6px 0 2px;opacity:.8}",
7971
+ "@media (max-width:760px){.wbck-list{max-height:200px}}"
7972
+ ];
7973
+ }
7974
+ });
7975
+
6767
7976
  // packages/addons/tasks/client/ui/styles.cjs
6768
7977
  var require_styles = __commonJS({
6769
7978
  "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
@@ -6784,7 +7993,6 @@ var require_styles = __commonJS({
6784
7993
  ".wbt-grow{flex:1;min-width:0}",
6785
7994
  ".wbt-btn{border:1px solid var(--wbt-line);background:var(--wbt-surface);color:inherit;border-radius:var(--wb-radius-sm);padding:6px 11px;font-size:12.5px;cursor:pointer;white-space:nowrap;line-height:1.3;display:inline-flex;align-items:center;gap:5px}",
6786
7995
  ".wbt-svg{display:block;flex:none}",
6787
- ".wbt-publication-filter{min-width:0;max-width:100%}",
6788
7996
  ".wbt-btn:hover{border-color:var(--wbt-accent)}",
6789
7997
  ".wbt-btn.primary{background:var(--wbt-accent);border-color:var(--wbt-accent);color:var(--dsw-alias-label-primary-inverted,#fff);font-weight:600}",
6790
7998
  ".wbt-btn.ghost{background:transparent}",
@@ -6801,7 +8009,6 @@ var require_styles = __commonJS({
6801
8009
  ".wbt-limit-row{display:flex;flex-direction:column;gap:4px;min-width:0}.wbt-limit-head{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;min-width:0}.wbt-limit-hint{margin:0;font-size:11.5px;line-height:1.6;opacity:.65;overflow-wrap:anywhere}.wbt-limit-head>strong{font-weight:560;font-size:12.5px;flex:none}.wbt-limit-fields{display:flex;align-items:center;gap:4px;min-width:0}.wbt-limit-fields input{flex:1 1 0;width:0;min-width:0;box-sizing:border-box;text-align:center;padding-left:6px;padding-right:6px}.wbt-limit-fields .wbt-limit-input{background-color:var(--wbt-surface);border:1px solid var(--wbt-line);border-radius:8px;padding:6px 4px;font-size:13px;color:inherit;font-variant-numeric:tabular-nums;-moz-appearance:textfield;appearance:textfield}.wbt-limit-fields .wbt-limit-input:focus{border-color:var(--wbt-accent);outline:none;box-shadow:0 0 0 3px color-mix(in oklab,var(--wbt-accent) 18%,transparent)}.wbt-limit-fields .wbt-limit-input::-webkit-outer-spin-button,.wbt-limit-fields .wbt-limit-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.wbt-limit-fields>span{flex:none;opacity:.55;font-size:11.5px}.wbt-limit-clear{flex:none;padding:2px 6px;line-height:1.2}.wbt-limit-unit{font-size:11px;opacity:.55;overflow-wrap:anywhere;min-width:0}",
6802
8010
  ".wbt-presets{gap:6px}.wbt-preset-list{display:flex;flex-wrap:wrap;gap:6px}.wbt-preset{padding:4px 9px;border:1px solid var(--wbt-line);border-radius:999px;background:var(--wbt-surface);color:inherit;font-size:12px;line-height:1.5;white-space:normal}.wbt-preset:hover{border-color:var(--wbt-accent)}.wbt-preset.active{background:var(--wbt-accent);border-color:var(--wbt-accent);color:#fff}.wbt-preset:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:2px}.wbt-target-group{gap:8px}",
6803
8011
  ".wbt-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 8px}.wbt-status-grid .wbt-check{min-width:0;overflow-wrap:anywhere}.wbt-pathrow>.wbt-sum{flex:none;white-space:nowrap}",
6804
- ".wbt-publication-filter{width:100%}.wbt-range-entry{display:flex;gap:4px;align-items:center}.wbt-range-trigger{width:100%;min-width:0;text-align:left;white-space:normal}.wbt-range-trigger span{min-width:0;overflow-wrap:anywhere}.wbt-range-calendar{margin-top:8px;padding:6px;border:1px solid var(--wbt-line);border-radius:8px;background:var(--wbt-bg)}.wbt-range-month{display:flex;gap:4px;align-items:center;margin-bottom:8px}.wbt-range-month input{width:100%;min-width:0;padding:4px;border:1px solid var(--wbt-line);border-radius:4px;background:var(--wbt-bg);color:inherit}.wbt-range-month .wbt-btn{padding:4px 7px}.wbt-range-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;margin:8px 0}.wbt-range-weekday{text-align:center;font-size:11px;opacity:.7}.wbt-range-day{min-width:0;padding:6px 0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;cursor:pointer}.wbt-range-day.between{background:color-mix(in srgb,var(--wbt-accent) 18%,transparent)}.wbt-range-day:hover{box-shadow:inset 0 0 0 1px var(--wbt-accent)}.wbt-range-day.selected{background:var(--wbt-accent);color:#fff}.wbt-range-day:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:1px}.wbt-range-actions{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}",
6805
8012
  ".wbt-nav{display:flex;flex-direction:column;gap:2px;flex:0 0 138px;width:138px;padding:3px 0;border-right:1px solid var(--wbt-line)}",
6806
8013
  ".wbt-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;border:1px solid var(--wbt-line);border-radius:10px;background:var(--wbt-surface);overflow:hidden}.wbt-list-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px;scrollbar-gutter:stable}.wbt-content>.wbt-pager{flex:none;margin:0;padding:8px 10px;border-top:1px solid var(--wbt-line)}",
6807
8014
  ".wbt-nav-sep{height:1px;background:var(--wbt-line);margin:5px 9px;opacity:.7}",
@@ -6821,6 +8028,8 @@ var require_styles = __commonJS({
6821
8028
  ".wbt-item.closed{opacity:.62}",
6822
8029
  ".wbt-item.closed .wbt-title{text-decoration:line-through}",
6823
8030
  ".wbt-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}",
8031
+ ".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}",
8032
+ ".wbt-item-id:hover{opacity:.8}",
6824
8033
  ".wbt-chead{display:flex;align-items:flex-start;gap:10px;min-width:0}",
6825
8034
  ".wbt-line1{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap;flex:1 1 auto}",
6826
8035
  ".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 +8061,29 @@ var require_styles = __commonJS({
6852
8061
  ".wbt-wschip button:hover{opacity:1}",
6853
8062
  ".wbt-wschip-ro{opacity:.85;background:transparent}",
6854
8063
  ".wbt-wsfilter{width:100%}",
8064
+ ".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}",
8065
+ ".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}",
8066
+ ".wbt-wsopt:hover{background:color-mix(in oklab,var(--wbt-accent) 7%,transparent)}",
8067
+ ".wbt-wsopt.on{background:color-mix(in oklab,var(--wbt-accent) 11%,transparent);border-color:color-mix(in oklab,var(--wbt-accent) 40%,transparent)}",
8068
+ ".wbt-wsopt:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:-2px}",
8069
+ ".wbt-wsopt-title{display:flex;align-items:center;gap:6px;min-width:0;font-size:12.5px;font-weight:560;line-height:1.35}",
8070
+ ".wbt-wsopt-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
8071
+ ".wbt-wsopt-check{flex:none;font-size:11px;font-weight:700;color:var(--wbt-accent)}",
8072
+ ".wbt-wsopt-meta{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px;opacity:.55;line-height:1.3}",
8073
+ ".wbt-wsopt-count{flex:none;font-variant-numeric:tabular-nums}",
8074
+ ".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}",
8075
+ ".wbt-wsrow{display:flex;align-items:center;gap:6px;min-width:0}",
8076
+ ".wbt-wsrow .wbt-input{flex:1 1 auto;min-width:0}",
8077
+ ".wbt-wsrow .wbt-btn{flex:none}",
8078
+ ".wbt-wscreate{display:flex;flex-direction:column;gap:5px;min-width:0}",
8079
+ ".wbt-wscreate .wbt-input{width:100%;box-sizing:border-box}",
8080
+ ".wbt-hint{font-size:11.5px;opacity:.62;line-height:1.5;overflow-wrap:anywhere}",
6855
8081
  ".wbt-muted-link{opacity:.7;text-decoration-style:dashed}",
6856
8082
  ".wbt-wsmenu .wbt-tagopt{padding:5px 6px}",
6857
8083
  ".wbt-wsmenu .wbt-wsnone{border-top:1px dashed var(--wbt-line);margin-top:4px;padding-top:7px}",
6858
8084
  ".wbt-ws-group .wbt-check{min-width:0;overflow-wrap:anywhere}",
6859
8085
  ".wbt-ws-select{display:flex;flex-direction:column;gap:6px;min-width:0}",
6860
8086
  ".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
8087
  ".wbt-tagfilter{position:relative;display:flex;align-items:center;gap:5px;min-width:0}",
6865
8088
  ".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
8089
  ".wbt-tagsearch{padding:0 0 6px}",
@@ -6872,7 +8095,6 @@ var require_styles = __commonJS({
6872
8095
  ".wbt-tagx{opacity:.7;font-size:12px;line-height:1}",
6873
8096
  ".wbt-taglist{max-height:236px;overflow:auto;overscroll-behavior:contain}",
6874
8097
  ".wbt-tagmore{font-size:11px;opacity:.5;text-align:center;padding:6px 0 2px}",
6875
- ".wbt-card .wbt-metazone{row-gap:3px}",
6876
8098
  ".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
8099
  ".wbt-tagmenu-head{display:flex;align-items:center;gap:6px;font-size:11px;opacity:.6;padding:2px 4px 7px}",
6878
8100
  ".wbt-tagopt{display:flex;align-items:center;gap:7px;padding:6px;border-radius:6px;cursor:pointer;font-size:12.5px}",
@@ -6898,9 +8120,6 @@ var require_styles = __commonJS({
6898
8120
  ".wbt-ops .wbt-act-done:hover{background:color-mix(in oklab,var(--dsw-alias-state-success-primary,#2f9e44) 16%,transparent)}",
6899
8121
  ".wbt-ops .wbt-act-close{color:var(--dsw-alias-state-error-primary,#b4434a)}",
6900
8122
  ".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
8123
  ".wbt-empty{border:1px dashed var(--wbt-line);border-radius:11px;padding:34px 12px;text-align:center;opacity:.5;font-size:12.5px}",
6905
8124
  ".wbt-err{font-size:12.5px;color:var(--dsw-alias-state-error-primary,#e5484d);line-height:1.5}",
6906
8125
  ".wbt-pager{display:flex;gap:8px;align-items:center;justify-content:flex-end;font-size:12px;opacity:.8;flex-wrap:wrap}",
@@ -6957,6 +8176,15 @@ var require_styles = __commonJS({
6957
8176
  ".wbt-field.full{grid-column:1 / -1}",
6958
8177
  ".wbt-field>span{opacity:.62;font-size:11.5px}",
6959
8178
  ".wbt-modal-foot{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:2px}",
8179
+ // 预览面板:只让内容区滚动,头部标题与右上角 × 固定不动(滚动壳限定在 .wbt-preview,不影响其它弹窗)。
8180
+ ".wbt-preview{overflow:hidden}",
8181
+ ".wbt-preview-head{flex:none}",
8182
+ ".wbt-preview-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:color-mix(in oklab,var(--wbt-line) 85%,transparent) transparent}",
8183
+ ".wbt-preview-body::-webkit-scrollbar{width:10px;height:10px}",
8184
+ ".wbt-preview-body::-webkit-scrollbar-track{background:transparent}",
8185
+ ".wbt-preview-body::-webkit-scrollbar-thumb{background-color:color-mix(in oklab,var(--wbt-line) 78%,transparent);border-radius:999px;border:3px solid transparent;background-clip:content-box}",
8186
+ ".wbt-preview-body::-webkit-scrollbar-thumb:hover{background-color:color-mix(in oklab,var(--wbt-line) 100%,transparent)}",
8187
+ ".wbt-preview-body::-webkit-scrollbar-corner{background:transparent}",
6960
8188
  ".wbt-timeline{display:flex;flex-direction:column;gap:0;margin:2px 0}",
6961
8189
  ".wbt-tl-item{display:flex;gap:9px;min-height:40px}",
6962
8190
  ".wbt-tl-rail{width:12px;display:flex;flex-direction:column;align-items:center;flex:none}",
@@ -7005,9 +8233,8 @@ var require_styles = __commonJS({
7005
8233
  ".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted,#fff);background:var(--dsw-alias-state-error-primary,#e5484d);border-color:transparent}",
7006
8234
  "@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
8235
  "@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
8236
  "@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");
8237
+ ].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt")).join("\n");
7011
8238
  }
7012
8239
  });
7013
8240
 
@@ -7146,7 +8373,7 @@ var require_task_item = __commonJS({
7146
8373
  h("span", { className: "wbt-badge " + st.cls, children: stName }),
7147
8374
  titleNode
7148
8375
  );
7149
- var opsNode = h("div", { className: cx("wbt-ops", props.card && "wbt-ops-block"), key: "ops" }, ops);
8376
+ var opsNode = h("div", { className: "wbt-ops", key: "ops" }, ops);
7150
8377
  var tagBlock = tagNodes.length ? h("div", { className: "wbt-tags", key: "tags" }, tagNodes) : null;
7151
8378
  var wsList = Array.isArray(task.workspaces) ? task.workspaces : [];
7152
8379
  var wsBlock = wsList.length ? h("div", { className: "wbt-wschips", key: "workspaces" }, wsList.map(function(w) {
@@ -7155,20 +8382,28 @@ var require_task_item = __commonJS({
7155
8382
  var metaBlock = meta.length ? h("div", { className: "wbt-foot", key: "meta" }, h("div", { className: "wbt-meta" }, meta)) : null;
7156
8383
  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
8384
  var metaZone = tagBlock || wsBlock || metaBlock || pathBlock ? h("div", { className: "wbt-metazone", key: "metazone" }, tagBlock, wsBlock, metaBlock, pathBlock) : null;
8385
+ var idNode = String(task.id || "") ? h("div", {
8386
+ className: "wbt-item-id",
8387
+ key: "taskid",
8388
+ title: String(task.id),
8389
+ onClick: function(e) {
8390
+ e.stopPropagation();
8391
+ }
8392
+ }, t.taskId + " \xB7 " + String(task.id)) : null;
7158
8393
  return h(
7159
8394
  "div",
7160
- { className: cx("wbt-item", props.card && "wbt-card", String(task.status) === "1" && "closed") },
8395
+ { className: cx("wbt-item", String(task.status) === "1" && "closed") },
7161
8396
  props.selectionMode ? h("input", { type: "checkbox", className: "wbt-check", checked: !!props.checked, onChange: function() {
7162
8397
  props.onCheck(task.id);
7163
8398
  } }) : null,
7164
8399
  h(
7165
8400
  "div",
7166
8401
  { className: "wbt-main" },
7167
- h("div", { className: "wbt-chead" }, line1, props.card ? null : opsNode),
8402
+ h("div", { className: "wbt-chead" }, line1, opsNode),
7168
8403
  metaZone,
7169
- props.card ? opsNode : null,
7170
8404
  descNode,
7171
- reviewNode
8405
+ reviewNode,
8406
+ idNode
7172
8407
  )
7173
8408
  );
7174
8409
  }
@@ -7191,6 +8426,7 @@ var require_timeline_copy = __commonJS({
7191
8426
  "\u5C55\u5F00\u63CF\u8FF0": "Expand description",
7192
8427
  "\u6536\u8D77\u63CF\u8FF0": "Collapse description",
7193
8428
  "\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217": "Oldest publication first",
8429
+ "\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217\uFF0C\u70B9\u51FB\u4EFB\u52A1\u6253\u5F00\u9884\u89C8": "Oldest publication first. Click a task to open a preview.",
7194
8430
  "\u65B0\u5EFA\u65F6\u95F4\u7EBF\u6216\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF\uFF0C\u5C06\u76F8\u5173\u4EFB\u52A1\u96C6\u4E2D\u67E5\u770B\u3002": "Create or choose a timeline to view related tasks together.",
7195
8431
  "\u5176\u4ED6\u65F6\u95F4\u7EBF": "Other timelines",
7196
8432
  "\u8BF7\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF\uFF1B\u65E0\u5339\u914D\u65F6\u53EF\u65B0\u5EFA": "Choose a timeline, or create one if there is no match",
@@ -7521,7 +8757,7 @@ var require_workspace_select = __commonJS({
7521
8757
  h(
7522
8758
  "div",
7523
8759
  { className: "wbt-wsrow" },
7524
- h("input", { className: "wbt-input", value: query, placeholder: t("search"), onChange: function(e) {
8760
+ h("input", { className: "wbt-input", value: query, placeholder: t("search"), "aria-label": t("search"), onChange: function(e) {
7525
8761
  setQuery(e.target.value);
7526
8762
  } }),
7527
8763
  h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
@@ -7541,8 +8777,18 @@ var require_workspace_select = __commonJS({
7541
8777
  { type: "button", role: "option", key: id, "aria-selected": on, className: "wbt-wsopt" + (on ? " on" : ""), title: w.dir || "", onClick: function() {
7542
8778
  toggle(id);
7543
8779
  } },
7544
- h("span", { className: "wbt-wsopt-title" }, w.title || id),
7545
- h("span", { className: "wbt-wsopt-meta" }, (w.taskCount || 0) + " \xB7 " + (w.dir || "\u2014"))
8780
+ h(
8781
+ "span",
8782
+ { className: "wbt-wsopt-title" },
8783
+ h("span", { className: "wbt-wsopt-name" }, w.title || id),
8784
+ on ? h("span", { className: "wbt-wsopt-check", "aria-hidden": true }, "\u2713") : null
8785
+ ),
8786
+ h(
8787
+ "span",
8788
+ { className: "wbt-wsopt-meta" },
8789
+ h("span", { className: "wbt-wsopt-count" }, String(w.taskCount || 0)),
8790
+ w.dir ? h("code", { title: w.dir }, w.dir) : h("span", null, "\u2014")
8791
+ )
7546
8792
  );
7547
8793
  })
7548
8794
  ),
@@ -7975,6 +9221,7 @@ var require_create_modal = __commonJS({
7975
9221
  var WorkspaceSelect = require_workspace_select()(React).WorkspaceSelect;
7976
9222
  var difficultyField = require_difficulty_field()(React);
7977
9223
  var ownership = require_ownership(), fields = require_ownership_fields()(React);
9224
+ var DP = require_date_picker();
7978
9225
  var allTables = deps.allTables, tagNames = deps.tagNames, splitTags = deps.splitTags;
7979
9226
  var today = deps.today, addDays = deps.addDays, hostHasAddon = deps.hostHasAddon;
7980
9227
  function CreateModal(props) {
@@ -8166,20 +9413,20 @@ var require_create_modal = __commonJS({
8166
9413
  set("priority", e.target.value);
8167
9414
  } })),
8168
9415
  fields({ form, set, setMany, tree: props.tree, recommended: props.defaultTableId || origin && origin.tableId }),
8169
- h("label", { className: "wbt-field" }, h("span", null, t.publishDate), h("input", { className: "wbt-input", type: "date", value: form.publishDate, onChange: function(e) {
8170
- set("publishDate", e.target.value);
9416
+ h("label", { className: "wbt-field" }, h("span", null, t.publishDate), h(DP.DatePicker, { React, h, prefix: "wbt", lang: props.lang, label: t.publishDate, value: form.publishDate, onChange: function(next) {
9417
+ set("publishDate", next);
8171
9418
  } })),
8172
- h("label", { className: "wbt-field" }, h("span", null, t.targetDate), h("input", { className: "wbt-input", type: "date", value: form.targetDate, onChange: function(e) {
8173
- set("targetDate", e.target.value);
9419
+ h("label", { className: "wbt-field" }, h("span", null, t.targetDate), h(DP.DatePicker, { React, h, prefix: "wbt", lang: props.lang, label: t.targetDate, value: form.targetDate, onChange: function(next) {
9420
+ set("targetDate", next);
8174
9421
  } })),
8175
- source !== "2" && form.status === "2" ? h("label", { className: "wbt-field" }, h("span", null, t.doneDate), h("input", { className: "wbt-input", type: "date", value: form.doneDate, onChange: function(e) {
8176
- set("doneDate", e.target.value);
9422
+ source !== "2" && form.status === "2" ? h("label", { className: "wbt-field" }, h("span", null, t.doneDate), h(DP.DatePicker, { React, h, prefix: "wbt", lang: props.lang, label: t.doneDate, value: form.doneDate, onChange: function(next) {
9423
+ set("doneDate", next);
8177
9424
  } })) : null,
8178
9425
  difficultyField(t, form.difficulty, function(value) {
8179
9426
  set("difficulty", value);
8180
9427
  }, "wbt-create-difficulty"),
8181
- source !== "2" && form.status === "1" ? h("label", { className: "wbt-field" }, h("span", null, t.shutdownDate), h("input", { className: "wbt-input", type: "date", value: form.shutdownDate, onChange: function(e) {
8182
- set("shutdownDate", e.target.value);
9428
+ source !== "2" && form.status === "1" ? h("label", { className: "wbt-field" }, h("span", null, t.shutdownDate), h(DP.DatePicker, { React, h, prefix: "wbt", lang: props.lang, label: t.shutdownDate, value: form.shutdownDate, onChange: function(next) {
9429
+ set("shutdownDate", next);
8183
9430
  } })) : null
8184
9431
  ),
8185
9432
  priorityError ? h("div", { id: "wbt-create-priority-error", className: "wbt-err", role: "alert" }, priorityError) : null,
@@ -8209,12 +9456,13 @@ var require_timeline_member_rows = __commonJS({
8209
9456
  return h("ol", { className: "wbt-timeline-members" }, (props.rows || []).map(function(task) {
8210
9457
  var status = statusInfo(task.status), title = task.title || (lang === "en" ? "Untitled task" : "\u672A\u547D\u540D\u4EFB\u52A1");
8211
9458
  var remove = lang === "en" ? "Remove from timeline: " + title : "\u4ECE\u65F6\u95F4\u7EBF\u79FB\u51FA\uFF1A" + title;
9459
+ var open = lang === "en" ? "Click to preview task: " : "\u70B9\u51FB\u9884\u89C8\u4EFB\u52A1\uFF1A";
8212
9460
  return h(
8213
9461
  "li",
8214
9462
  { key: task.id, className: "wbt-timeline-member-row" },
8215
9463
  h("time", { className: "wbt-timeline-date", dateTime: task.publishDate || void 0 }, task.publishDate || "\u2014"),
8216
9464
  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) {
9465
+ h("button", { type: "button", className: "wbt-timeline-member", title, "aria-label": open + title + " \xB7 " + (task.publishDate || "") + " \xB7 " + status[lang], onClick: function(event) {
8218
9466
  if (props.onOpen) props.onOpen(task, event);
8219
9467
  } }, title),
8220
9468
  h("span", { className: "wbt-badge " + status.cls }, status[lang]),
@@ -8346,6 +9594,11 @@ var require_task_timeline_modal = __commonJS({
8346
9594
  cancelled = true;
8347
9595
  };
8348
9596
  }, [p.api, p.task.id, revision]);
9597
+ React.useEffect(function() {
9598
+ if (p.refreshKey) setRevision(function(n) {
9599
+ return n + 1;
9600
+ });
9601
+ }, [p.refreshKey]);
8349
9602
  function change(action, args) {
8350
9603
  if (busy || pending.current) return;
8351
9604
  pending.current = true;
@@ -8445,7 +9698,7 @@ var require_task_timeline_modal = __commonJS({
8445
9698
  h(
8446
9699
  "div",
8447
9700
  { className: "wbt-timeline-pager" },
8448
- h("span", null, tr("\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217")),
9701
+ h("span", null, tr("\u6309\u53D1\u5E03\u65F6\u95F4\u6B63\u5E8F\u6392\u5217\uFF0C\u70B9\u51FB\u4EFB\u52A1\u6253\u5F00\u9884\u89C8")),
8449
9702
  h("button", { type: "button", className: "wbt-btn", disabled: busy || page <= 1, onClick: function() {
8450
9703
  setPage(page - 1);
8451
9704
  } }, tr("\u4E0A\u4E00\u9875")),
@@ -8517,6 +9770,7 @@ var require_edit_modal = __commonJS({
8517
9770
  var difficultyField = require_difficulty_field()(React);
8518
9771
  var WorkspaceSelect = require_workspace_select()(React).WorkspaceSelect;
8519
9772
  var ownership = require_ownership(), fields = require_ownership_fields()(React);
9773
+ var DP = require_date_picker();
8520
9774
  function EditModal(props) {
8521
9775
  var t = props.t;
8522
9776
  var task = props.task;
@@ -8661,8 +9915,8 @@ var require_edit_modal = __commonJS({
8661
9915
  "label",
8662
9916
  { className: "wbt-field" },
8663
9917
  h("span", null, t.targetDate),
8664
- h("input", { className: "wbt-input", type: "date", value: form.targetDate, onChange: function(e) {
8665
- set("targetDate", e.target.value);
9918
+ h(DP.DatePicker, { React, h, prefix: "wbt", lang: props.lang, label: t.targetDate, value: form.targetDate, onChange: function(next) {
9919
+ set("targetDate", next);
8666
9920
  } })
8667
9921
  ) : null,
8668
9922
  canPriority ? h(
@@ -8779,147 +10033,35 @@ var require_date_filter = __commonJS({
8779
10033
  "packages/addons/tasks/client/ui/date-filter.cjs"(exports2, module2) {
8780
10034
  var React = require("react");
8781
10035
  var h = React.createElement;
8782
- var Icon2 = require_icons().Icon;
8783
- function validDate(value) {
8784
- if (!value) return true;
8785
- if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
8786
- var d = /* @__PURE__ */ new Date(value + "T00:00:00Z");
8787
- return isFinite(d.getTime()) && d.toISOString().slice(0, 10) === value && value.slice(0, 4) !== "0000";
8788
- }
8789
- function normalize(value) {
8790
- var from = value.from || "", to = value.to || "";
8791
- if (!validDate(from) || !validDate(to)) return null;
8792
- return from && to && from > to ? { from: to, to: from, swapped: true } : { from, to, swapped: false };
8793
- }
8794
- function today() {
8795
- var d = /* @__PURE__ */ new Date();
8796
- return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
8797
- }
8798
- function shift(date, days) {
8799
- var d = /* @__PURE__ */ new Date(date + "T00:00:00Z");
8800
- d.setUTCDate(d.getUTCDate() + days);
8801
- return d.toISOString().slice(0, 10);
8802
- }
10036
+ var DP = require_date_picker();
10037
+ var NAMES = {
10038
+ zh: { publish: "\u53D1\u5E03", done: "\u5B8C\u6210", shutdown: "\u5173\u95ED", target: "\u76EE\u6807" },
10039
+ en: { publish: "Publication", done: "Completion", shutdown: "Closure", target: "Target" }
10040
+ };
8803
10041
  function DateFilter(props) {
8804
- var en = props.lang === "en", value = props.value;
8805
- var names = en ? { publish: "Publication", done: "Completion", shutdown: "Closure", target: "Target" } : { publish: "\u53D1\u5E03", done: "\u5B8C\u6210", shutdown: "\u5173\u95ED", target: "\u76EE\u6807" };
8806
- var name = names[props.kind] || names.publish, title = name + (en ? " date range" : "\u65F6\u95F4\u8303\u56F4");
8807
- var openS = React.useState(false), open = openS[0], setOpen = openS[1];
8808
- var startS = React.useState(""), start = startS[0], setStart = startS[1];
8809
- var monthS = React.useState((value.from || value.to || today()).slice(0, 7)), month = monthS[0], setMonth = monthS[1];
8810
- var focusS = React.useState(""), focus = focusS[0], setFocus = focusS[1];
8811
- var root = React.useRef(null), trigger = React.useRef(null), id = React.useId();
8812
- React.useEffect(function() {
8813
- if (open && focus && root.current) {
8814
- var b = root.current.querySelector('[data-day="' + focus + '"]');
8815
- if (b) b.focus();
8816
- }
8817
- }, [open, focus, month]);
8818
- function close() {
8819
- setOpen(false);
8820
- setStart("");
8821
- if (trigger.current) trigger.current.focus();
8822
- }
8823
- function apply(next) {
8824
- var result = normalize(next);
8825
- if (result) {
8826
- props.onChange(result);
8827
- close();
10042
+ var en = props.lang === "en";
10043
+ var names = en ? NAMES.en : NAMES.zh;
10044
+ var name = names[props.kind] || names.publish;
10045
+ return h(DP.RangePicker, {
10046
+ React,
10047
+ h,
10048
+ prefix: "wbt",
10049
+ lang: props.lang,
10050
+ label: name + (en ? " date range" : "\u65F6\u95F4\u8303\u56F4"),
10051
+ placeholder: en ? "Choose date range" : "\u9009\u62E9\u65E5\u671F\u8303\u56F4",
10052
+ value: props.value || { from: "", to: "" },
10053
+ onChange: function(next) {
10054
+ props.onChange({ from: next.from, to: next.to });
8828
10055
  }
8829
- }
8830
- function pick(day2) {
8831
- if (!start) setStart(day2);
8832
- else apply({ from: start, to: day2 });
8833
- }
8834
- function moveMonth(delta) {
8835
- var d = /* @__PURE__ */ new Date(month + "-01T00:00:00Z");
8836
- d.setUTCMonth(d.getUTCMonth() + delta);
8837
- var next = d.toISOString().slice(0, 7);
8838
- if (/^\d{4}-\d{2}$/.test(next) && next.slice(0, 4) !== "0000") setMonth(next);
8839
- }
8840
- function keyDay(e, day2) {
8841
- var delta = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 }[e.key];
8842
- if (delta) {
8843
- e.preventDefault();
8844
- var next = shift(day2, delta);
8845
- if (validDate(next)) {
8846
- setMonth(next.slice(0, 7));
8847
- setFocus(next);
8848
- }
8849
- }
8850
- }
8851
- var first = month + "-01", offset = (/* @__PURE__ */ new Date(first + "T00:00:00Z")).getUTCDay();
8852
- var count = new Date(Number(month.slice(0, 4)), Number(month.slice(5)), 0).getDate(), cells = [];
8853
- for (var i = 0; i < offset; i++) cells.push(h("span", { key: "empty" + i, "aria-hidden": true }));
8854
- for (var n = 1; n <= count; n++) {
8855
- var day = month + "-" + String(n).padStart(2, "0"), endpoint = start ? day === start : day === value.from || day === value.to;
8856
- var inside = !start && value.from && value.to && day > value.from && day < value.to;
8857
- cells.push(h("button", {
8858
- key: day,
8859
- type: "button",
8860
- "data-day": day,
8861
- "aria-label": day,
8862
- "aria-pressed": !!endpoint,
8863
- "aria-current": day === today() ? "date" : void 0,
8864
- className: "wbt-range-day" + (endpoint ? " selected" : "") + (inside ? " between" : ""),
8865
- onClick: pick.bind(null, day),
8866
- onKeyDown: function(d, e) {
8867
- keyDay(e, d);
8868
- }.bind(null, day)
8869
- }, n));
8870
- }
8871
- var summary = value.from && value.to ? value.from + " \u2014 " + value.to : value.from ? value.from + (en ? " onward" : " \u8D77") : value.to ? (en ? "Until " : "\u622A\u81F3 ") + value.to : en ? "Choose date range" : "\u9009\u62E9\u65E5\u671F\u8303\u56F4";
8872
- return h(
8873
- "div",
8874
- { className: "wbt-publication-filter", ref: root, onKeyDown: function(e) {
8875
- if (e.key === "Escape" && open) {
8876
- e.stopPropagation();
8877
- close();
8878
- }
8879
- } },
8880
- h(
8881
- "div",
8882
- { className: "wbt-range-entry" },
8883
- h("button", { ref: trigger, type: "button", className: "wbt-btn wbt-range-trigger", "aria-label": title + ": " + summary, "aria-expanded": open, "aria-controls": id, onClick: function() {
8884
- setStart("");
8885
- setFocus("");
8886
- setMonth((value.from || value.to || today()).slice(0, 7));
8887
- setOpen(!open);
8888
- } }, h(Icon2, { name: "calendar" }), h("span", null, summary)),
8889
- value.from || value.to ? h("button", { type: "button", className: "wbt-date-clear", "aria-label": en ? "Clear time range" : "\u6E05\u9664\u65F6\u95F4\u8303\u56F4", onClick: function() {
8890
- apply({ from: "", to: "" });
8891
- } }, "\xD7") : null
8892
- ),
8893
- open ? h(
8894
- "div",
8895
- { id, className: "wbt-range-calendar", role: "group", "aria-label": title },
8896
- h(
8897
- "div",
8898
- { className: "wbt-range-month" },
8899
- h("button", { type: "button", className: "wbt-btn ghost", "aria-label": en ? "Previous month" : "\u4E0A\u4E2A\u6708", onClick: function() {
8900
- moveMonth(-1);
8901
- } }, "\u2039"),
8902
- h("input", { type: "month", value: month, min: "0001-01", max: "9999-12", "aria-label": en ? "Calendar month" : "\u65E5\u5386\u6708\u4EFD", onChange: function(e) {
8903
- if (validDate(e.target.value + "-01")) setMonth(e.target.value);
8904
- } }),
8905
- h("button", { type: "button", className: "wbt-btn ghost", "aria-label": en ? "Next month" : "\u4E0B\u4E2A\u6708", onClick: function() {
8906
- moveMonth(1);
8907
- } }, "\u203A")
8908
- ),
8909
- h("p", { className: "wbt-mhint", role: "status" }, start ? (en ? "Start: " : "\u8D77\u59CB\uFF1A") + start + (en ? " \xB7 Choose end date" : " \xB7 \u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F") : en ? "Choose start, then end date" : "\u5148\u9009\u5F00\u59CB\u65E5\u671F\uFF0C\u518D\u9009\u7ED3\u675F\u65E5\u671F"),
8910
- h("div", { className: "wbt-range-grid" }, (en ? ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] : ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"]).map(function(x) {
8911
- return h("span", { key: x, className: "wbt-range-weekday", "aria-hidden": true }, x);
8912
- }), cells),
8913
- start ? h("div", { className: "wbt-range-actions" }, h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
8914
- apply({ from: start, to: "" });
8915
- } }, en ? "From this date" : "\u4EC5\u8D77\u59CB\u65E5\u671F"), h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
8916
- apply({ from: "", to: start });
8917
- } }, en ? "Until this date" : "\u4EC5\u622A\u6B62\u65E5\u671F")) : null,
8918
- h("button", { type: "button", className: "wbt-btn ghost", onClick: close }, en ? "Cancel" : "\u53D6\u6D88")
8919
- ) : null
8920
- );
10056
+ });
8921
10057
  }
8922
- module2.exports = { DateFilter, normalize, validDate, today, shift };
10058
+ module2.exports = {
10059
+ DateFilter,
10060
+ normalize: DP.normalizeRange,
10061
+ validDate: DP.validDate,
10062
+ today: DP.todayISO,
10063
+ shift: DP.shiftDate
10064
+ };
8923
10065
  }
8924
10066
  });
8925
10067
 
@@ -9087,6 +10229,11 @@ var require_task_filter_model = __commonJS({
9087
10229
  if (!result && max) return null;
9088
10230
  return result ? result.value : next;
9089
10231
  }
10232
+ function taskNavigation(params) {
10233
+ if (!params || typeof params.taskId !== "string") return null;
10234
+ var id = params.taskId.trim();
10235
+ return /^[A-Za-z0-9_-]{1,64}$/.test(id) ? id : null;
10236
+ }
9090
10237
  function navigation(params) {
9091
10238
  if (!params) return null;
9092
10239
  var value;
@@ -9167,6 +10314,7 @@ var require_task_filter_model = __commonJS({
9167
10314
  presetValue,
9168
10315
  activePreset,
9169
10316
  navigation,
10317
+ taskNavigation,
9170
10318
  save,
9171
10319
  load
9172
10320
  };
@@ -9432,12 +10580,82 @@ var require_selection_bar = __commonJS({
9432
10580
  }
9433
10581
  });
9434
10582
 
10583
+ // packages/addons/tasks/client/modals/task-preview.cjs
10584
+ var require_task_preview = __commonJS({
10585
+ "packages/addons/tasks/client/modals/task-preview.cjs"(exports2, module2) {
10586
+ "use strict";
10587
+ module2.exports = function createTaskPreview(React, TaskItem) {
10588
+ var h = React.createElement;
10589
+ function TaskPreview(props) {
10590
+ var t = props.t, task = props.task;
10591
+ var titleId = "wbt-preview-title";
10592
+ function onKey(e) {
10593
+ if (e.key === "Escape") {
10594
+ e.preventDefault();
10595
+ e.stopPropagation();
10596
+ props.onClose();
10597
+ return;
10598
+ }
10599
+ if (e.key !== "Tab") return;
10600
+ var mask = e.currentTarget;
10601
+ var box = mask && mask.querySelector ? mask.querySelector('[role="dialog"]') : null;
10602
+ if (!box) return;
10603
+ var nodes = Array.from(box.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href],[tabindex="0"]')).filter(function(node) {
10604
+ return node.getClientRects().length > 0;
10605
+ });
10606
+ var first = nodes[0], last = nodes[nodes.length - 1];
10607
+ if (!first) {
10608
+ e.preventDefault();
10609
+ if (box.focus) box.focus();
10610
+ } else if (e.shiftKey && (document.activeElement === first || document.activeElement === box)) {
10611
+ e.preventDefault();
10612
+ last.focus();
10613
+ } else if (!e.shiftKey && document.activeElement === last) {
10614
+ e.preventDefault();
10615
+ first.focus();
10616
+ }
10617
+ }
10618
+ return h(
10619
+ "div",
10620
+ {
10621
+ className: "wbt-modal-mask",
10622
+ onKeyDownCapture: onKey,
10623
+ onMouseDown: function(e) {
10624
+ if (e.target === e.currentTarget) props.onClose();
10625
+ }
10626
+ },
10627
+ h(
10628
+ "div",
10629
+ {
10630
+ tabIndex: -1,
10631
+ className: "wbt-modal wide wbt-preview",
10632
+ role: "dialog",
10633
+ "aria-modal": "true",
10634
+ "aria-labelledby": titleId,
10635
+ "aria-label": t.previewLabel
10636
+ },
10637
+ h(
10638
+ "div",
10639
+ { className: "wbt-modal-head wbt-preview-head" },
10640
+ h("h3", { id: titleId }, String(task.title || "").trim() || t.previewUntitled),
10641
+ h("button", { type: "button", className: "wbt-icon", title: t.close, "aria-label": t.close, autoFocus: true, onClick: props.onClose }, "\xD7")
10642
+ ),
10643
+ h("div", { className: "wbt-preview-body" }, h(TaskItem, props.cardProps))
10644
+ )
10645
+ );
10646
+ }
10647
+ return TaskPreview;
10648
+ };
10649
+ }
10650
+ });
10651
+
9435
10652
  // packages/addons/tasks/client/views/tasks-view.cjs
9436
10653
  var require_tasks_view = __commonJS({
9437
10654
  "packages/addons/tasks/client/views/tasks-view.cjs"(exports2, module2) {
9438
10655
  module2.exports = function createTasksView(deps) {
9439
10656
  var React = deps.React, configView = deps.configView, CFG_FALLBACK = deps.CFG_FALLBACK, COPY = deps.COPY, injectCss = deps.injectCss, allTables = deps.allTables, findFirstTable = deps.findFirstTable, treeWalk = deps.treeWalk, treeFlat = deps.treeFlat, cx = deps.cx, Icon2 = deps.Icon, TaskItem = deps.TaskItem, PathCrumbs = deps.PathCrumbs, TagFilter = deps.TagFilter, TreeNode = deps.TreeNode, CreateModal = deps.CreateModal, TimelineModal = deps.TimelineModal, NodeModal = deps.NodeModal, EditModal = deps.EditModal, DoneModal = deps.DoneModal, BatchModal = deps.BatchModal;
9440
10657
  var h = React.createElement, filters = require_task_filter_model(), renderFilters = require_task_filter_panel(), claimBatch = require_claim_batch(), renderSelectionBar = require_selection_bar();
10658
+ var TaskPreview = require_task_preview()(React, TaskItem);
9441
10659
  function TasksView(props) {
9442
10660
  var lang = props.lang === "en" ? "en" : "zh";
9443
10661
  var cfg = configView.useConfig(props.api, CFG_FALLBACK);
@@ -9462,6 +10680,7 @@ var require_tasks_view = __commonJS({
9462
10680
  var api = props.api;
9463
10681
  var cfg = props.cfg || {};
9464
10682
  var activityNavigation = filters.navigation(props.viewParams);
10683
+ var taskNavigation = filters.taskNavigation(props.viewParams);
9465
10684
  var tableNavigation = !activityNavigation && props.viewParams && props.viewParams.tableId;
9466
10685
  var groupNavigation = !activityNavigation && !tableNavigation && props.viewParams && props.viewParams.groupId;
9467
10686
  var nodeNavigation = tableNavigation || groupNavigation;
@@ -9476,16 +10695,16 @@ var require_tasks_view = __commonJS({
9476
10695
  var expS = React.useState(/* @__PURE__ */ new Set());
9477
10696
  var expanded = expS[0], setExpanded = expS[1];
9478
10697
  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 });
10698
+ 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
10699
  var target = targetS[0], setTarget = targetS[1];
9481
10700
  var pathS = React.useState([]);
9482
10701
  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);
10702
+ var storedFilters = taskNavigation ? null : filters.load(props.viewParams);
10703
+ var initialMissing = taskNavigation ? false : storedFilters ? storedFilters.missing : !activityNavigation && !nodeNavigation && !!(props.viewParams && props.viewParams.difficultyMissing === true);
9485
10704
  var missingS = React.useState(initialMissing);
9486
10705
  var difficultyMissing = missingS[0], setDifficultyMissing = missingS[1];
9487
10706
  var defaultPreset = filters.presetValue(cfg["ui.defaultPreset"]);
9488
- var filterState = React.useState(storedFilters && storedFilters.value || activityNavigation || defaultPreset || filters.empty());
10707
+ var filterState = React.useState(taskNavigation ? filters.empty() : storedFilters && storedFilters.value || activityNavigation || defaultPreset || filters.empty());
9489
10708
  var filterValue = filterState[0], setFilterValue = filterState[1];
9490
10709
  React.useEffect(function() {
9491
10710
  filters.save(filterValue, difficultyMissing, props.viewParams);
@@ -9493,13 +10712,11 @@ var require_tasks_view = __commonJS({
9493
10712
  var panelState = React.useState(false), panelOpen = panelState[0], setPanelOpen = panelState[1];
9494
10713
  var hintState = React.useState(""), filterHint = hintState[0], setFilterHint = hintState[1];
9495
10714
  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("");
10715
+ var searchS = React.useState(taskNavigation || "");
9499
10716
  var searchDraft = searchS[0], setSearchDraft = searchS[1];
9500
10717
  var tqS = React.useState("");
9501
10718
  var treeQuery = tqS[0], setTreeQuery = tqS[1];
9502
- var titleS = React.useState("");
10719
+ var titleS = React.useState(taskNavigation || "");
9503
10720
  var titleKey = titleS[0], setTitleKey = titleS[1];
9504
10721
  var tagReloadS = React.useState(0);
9505
10722
  var tagReload = tagReloadS[0], setTagReload = tagReloadS[1];
@@ -9537,6 +10754,11 @@ var require_tasks_view = __commonJS({
9537
10754
  var doneTask = doneS[0], setDoneTask = doneS[1];
9538
10755
  var editTaskS = React.useState(null);
9539
10756
  var editTask = editTaskS[0], setEditTask = editTaskS[1];
10757
+ var timelinePreviewS = React.useState(null);
10758
+ var timelinePreview = timelinePreviewS[0], setTimelinePreview = timelinePreviewS[1];
10759
+ var timelineTrigger = React.useRef(null);
10760
+ var timelineReloadS = React.useState(0);
10761
+ var timelineReload = timelineReloadS[0], setTimelineReload = timelineReloadS[1];
9540
10762
  var editS = React.useState(null);
9541
10763
  var edit = editS[0], setEdit = editS[1];
9542
10764
  var nodeModalS = React.useState(null);
@@ -9553,7 +10775,20 @@ var require_tasks_view = __commonJS({
9553
10775
  React.useEffect(function() {
9554
10776
  if (initialNavigation.current) {
9555
10777
  initialNavigation.current = false;
9556
- if (storedFilters) return;
10778
+ if (storedFilters || taskNavigation) return;
10779
+ }
10780
+ if (taskNavigation) {
10781
+ setSearchDraft(taskNavigation);
10782
+ setTitleKey(taskNavigation);
10783
+ setFilterValue(filters.empty());
10784
+ setTarget({ groupId: "1", tableId: null });
10785
+ setDifficultyMissing(false);
10786
+ setFilterHint("");
10787
+ setFilterTagIds([]);
10788
+ setPageNumber(1);
10789
+ setSelectedIds(/* @__PURE__ */ new Set());
10790
+ setSelectionMode(false);
10791
+ return;
9557
10792
  }
9558
10793
  if (!activityNavigation && !nodeNavigation) return;
9559
10794
  setFilterValue(activityNavigation || defaultPreset || filters.empty());
@@ -9753,6 +10988,40 @@ var require_tasks_view = __commonJS({
9753
10988
  } else say(r && r.error || "delete failed");
9754
10989
  });
9755
10990
  }
10991
+ function openTimelinePreview(member, event) {
10992
+ timelineTrigger.current = event && event.currentTarget || timelineTrigger.current;
10993
+ api.call("tasks.get", { id: member.id }).then(function(r) {
10994
+ if (r && r.ok && r.result && r.result.task) return r.result.task;
10995
+ return member;
10996
+ }).catch(function() {
10997
+ return member;
10998
+ }).then(function(task) {
10999
+ if (task) setTimelinePreview(task);
11000
+ });
11001
+ }
11002
+ function closeTimelinePreview() {
11003
+ setTimelinePreview(null);
11004
+ var trigger = timelineTrigger.current;
11005
+ timelineTrigger.current = null;
11006
+ if (trigger && trigger.isConnected) trigger.focus({ preventScroll: true });
11007
+ }
11008
+ function bumpTimeline() {
11009
+ setTimelineReload(function(n) {
11010
+ return n + 1;
11011
+ });
11012
+ }
11013
+ function deletePreviewTask(task) {
11014
+ if (cfgConfirm && !window.confirm(t.deleteTaskConfirm)) return;
11015
+ api.call("tasks.delete", { id: task.id }).then(function(r) {
11016
+ if (r && r.ok) {
11017
+ closeTimelinePreview();
11018
+ refreshList();
11019
+ refreshTagNav();
11020
+ bumpTimeline();
11021
+ say(t.deleted);
11022
+ } else say(r && r.error || "delete failed");
11023
+ });
11024
+ }
9756
11025
  function batchDelete() {
9757
11026
  var ids = Array.from(selectedIds);
9758
11027
  if (!ids.length) return;
@@ -9988,13 +11257,12 @@ var require_tasks_view = __commonJS({
9988
11257
  }
9989
11258
  }), t.difficultyMissing)
9990
11259
  });
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) {
11260
+ 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
11261
  return h(TaskItem, {
9993
11262
  key: task.id,
9994
11263
  task,
9995
11264
  t,
9996
11265
  lang: props.lang,
9997
- card: view === "card",
9998
11266
  keyword: titleKey.trim(),
9999
11267
  bodyMode: cfg["ui.bodyMode"],
10000
11268
  selectionMode,
@@ -10054,10 +11322,7 @@ var require_tasks_view = __commonJS({
10054
11322
  } }, h(Icon2, { name: "select", size: 13 }), selectionMode ? t.cancelSelect : t.select),
10055
11323
  h("button", { className: "wbt-btn primary", onClick: function() {
10056
11324
  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)
11325
+ } }, h(Icon2, { name: "plus", size: 14 }), t.newTask)
10061
11326
  ),
10062
11327
  curDesc ? h("div", { className: "wbt-tabledesc", title: curDesc }, curDesc.length > 220 ? curDesc.slice(0, 220) + "\u2026" : curDesc) : null,
10063
11328
  h(
@@ -10212,6 +11477,7 @@ var require_tasks_view = __commonJS({
10212
11477
  setCreateState(null);
10213
11478
  refreshList();
10214
11479
  refreshTree();
11480
+ bumpTimeline();
10215
11481
  say(require_ownership().receipt(result));
10216
11482
  }
10217
11483
  }) : null,
@@ -10221,23 +11487,64 @@ var require_tasks_view = __commonJS({
10221
11487
  api,
10222
11488
  task: timelineTask,
10223
11489
  onChanged: refreshList,
11490
+ refreshKey: timelineReload,
10224
11491
  onClose: function() {
10225
11492
  setTimelineTask(null);
11493
+ setTimelinePreview(null);
10226
11494
  },
10227
- onOpen: function(member) {
10228
- api.call("tasks.get", { id: member.id }).then(function(r) {
10229
- if (!r || !r.ok) throw Error(r && r.error || t.fail);
10230
- setTimelineTask(null);
10231
- setEditTask(r.result.task);
10232
- }).catch(function(err) {
10233
- say(String(err.message || err));
10234
- });
10235
- },
11495
+ // 成员行只开只读预览;预览里的「编辑」才进编辑面板。
11496
+ onOpen: openTimelinePreview,
10236
11497
  onCreateTimeline: function(originTask) {
10237
11498
  setTimelineTask(null);
11499
+ setTimelinePreview(null);
10238
11500
  setCreateState({ source: "1", originTask, defaultTableId: originTask.tableId });
10239
11501
  }
10240
11502
  }) : null,
11503
+ timelineTask && timelinePreview ? h(TaskPreview, {
11504
+ key: "preview-" + timelinePreview.id,
11505
+ t,
11506
+ task: timelinePreview,
11507
+ onClose: closeTimelinePreview,
11508
+ cardProps: {
11509
+ task: timelinePreview,
11510
+ t,
11511
+ lang: props.lang,
11512
+ keyword: "",
11513
+ bodyMode: cfg["ui.bodyMode"],
11514
+ update: function(task, patch) {
11515
+ api.call("tasks.update", Object.assign({ id: task.id }, patch)).then(function(r) {
11516
+ if (!r || !r.ok) {
11517
+ say(r && r.error || "update failed");
11518
+ return;
11519
+ }
11520
+ return api.call("tasks.get", { id: task.id }).then(function(next) {
11521
+ if (next && next.ok && next.result && next.result.task) setTimelinePreview(next.result.task);
11522
+ refreshList();
11523
+ bumpTimeline();
11524
+ });
11525
+ }).catch(function(e) {
11526
+ say(String(e && e.message || e));
11527
+ });
11528
+ },
11529
+ onEdit: function(task) {
11530
+ closeTimelinePreview();
11531
+ setEditTask(task);
11532
+ },
11533
+ onDone: function(task) {
11534
+ closeTimelinePreview();
11535
+ setDoneTask(task);
11536
+ },
11537
+ onRestart: function(task) {
11538
+ closeTimelinePreview();
11539
+ setCreateState({ source: "2", originTask: task });
11540
+ },
11541
+ onTimeline: function(task) {
11542
+ closeTimelinePreview();
11543
+ setTimelineTask(task);
11544
+ },
11545
+ onDelete: deletePreviewTask
11546
+ }
11547
+ }) : null,
10241
11548
  nodeModal ? h(NodeModal, {
10242
11549
  key: "node-" + (nodeModal.node ? nodeModal.node.id : "new"),
10243
11550
  t,
@@ -10263,6 +11570,7 @@ var require_tasks_view = __commonJS({
10263
11570
  onSaved: function(result) {
10264
11571
  setEditTask(null);
10265
11572
  refreshList();
11573
+ bumpTimeline();
10266
11574
  say(require_ownership().receipt(result));
10267
11575
  }
10268
11576
  }) : null,
@@ -10277,6 +11585,7 @@ var require_tasks_view = __commonJS({
10277
11585
  onDone: function() {
10278
11586
  setDoneTask(null);
10279
11587
  refreshList();
11588
+ bumpTimeline();
10280
11589
  say(t.doneSuccess);
10281
11590
  },
10282
11591
  onError: function(e) {
@@ -10458,6 +11767,8 @@ var require_timeline_view = __commonJS({
10458
11767
  var Merge = require_timeline_merge()(React);
10459
11768
  var CSS = require_timeline_styles();
10460
11769
  var MemberRows = require_timeline_member_rows()(React, deps.statusInfo);
11770
+ var TaskPreview = require_task_preview()(React, deps.TaskItem);
11771
+ var receipts = require_ownership();
10461
11772
  var splitTitle = require_timeline_title();
10462
11773
  var Highlight = require_highlight2()(React);
10463
11774
  function result(r) {
@@ -10509,6 +11820,12 @@ var require_timeline_view = __commonJS({
10509
11820
  var addS = React.useState(false), adding = addS[0], setAdding = addS[1];
10510
11821
  var deleteS = React.useState(false), deleting = deleteS[0], setDeleting = deleteS[1];
10511
11822
  var writeS = React.useState(false), writing = writeS[0], setWriting = writeS[1];
11823
+ var editS = React.useState(null), editTask = editS[0], setEditTask = editS[1];
11824
+ var doneS = React.useState(null), doneTask = doneS[0], setDoneTask = doneS[1];
11825
+ var timelineS = React.useState(null), timelineTask = timelineS[0], setTimelineTask = timelineS[1];
11826
+ var createS = React.useState(null), createState = createS[0], setCreateState = createS[1];
11827
+ var toastS = React.useState(""), toast = toastS[0], setToast = toastS[1];
11828
+ var cfg = deps.configView.useConfig(api, deps.CFG_FALLBACK).values;
10512
11829
  React.useEffect(function() {
10513
11830
  deps.injectCss();
10514
11831
  }, []);
@@ -10571,7 +11888,7 @@ var require_timeline_view = __commonJS({
10571
11888
  };
10572
11889
  }, [api, activeKey, memberPage, refresh]);
10573
11890
  React.useEffect(function() {
10574
- if (!detail) return;
11891
+ if (!editTask && !createState) return;
10575
11892
  var cancelled = false;
10576
11893
  api.call("taskNodes.tree", {}).then(result).then(function(r) {
10577
11894
  if (!cancelled) setTree(Array.isArray(r) ? r : []);
@@ -10580,7 +11897,16 @@ var require_timeline_view = __commonJS({
10580
11897
  return function() {
10581
11898
  cancelled = true;
10582
11899
  };
10583
- }, [api, !!detail]);
11900
+ }, [api, !!editTask, !!createState]);
11901
+ React.useEffect(function() {
11902
+ if (!toast) return;
11903
+ var timer = setTimeout(function() {
11904
+ setToast("");
11905
+ }, 2600);
11906
+ return function() {
11907
+ clearTimeout(timer);
11908
+ };
11909
+ }, [toast]);
10584
11910
  function reload() {
10585
11911
  setRefresh(function(n) {
10586
11912
  return n + 1;
@@ -10622,6 +11948,47 @@ var require_timeline_view = __commonJS({
10622
11948
  setDetail(null);
10623
11949
  if (detailTrigger.current) detailTrigger.current.focus({ preventScroll: true });
10624
11950
  }
11951
+ function openPreview(member) {
11952
+ api.call("tasks.get", { id: member.id }).then(function(r) {
11953
+ setDetail(r && r.ok && r.result && r.result.task ? r.result.task : member);
11954
+ }).catch(function() {
11955
+ setDetail(member);
11956
+ });
11957
+ }
11958
+ function say(message) {
11959
+ setToast(String(message || ""));
11960
+ }
11961
+ function refreshDetail(id) {
11962
+ api.call("tasks.get", { id }).then(result).then(function(r) {
11963
+ setDetail(function(old) {
11964
+ return old && String(old.id) === String(id) ? r.task : old;
11965
+ });
11966
+ }).catch(function() {
11967
+ });
11968
+ }
11969
+ function updateTask(task, patch) {
11970
+ api.call("tasks.update", Object.assign({ id: task.id }, patch)).then(result).then(function() {
11971
+ refreshDetail(task.id);
11972
+ createdRef.current = active;
11973
+ reload();
11974
+ }).catch(function(e) {
11975
+ say(String(e && e.message || e));
11976
+ });
11977
+ }
11978
+ function removeTask(task) {
11979
+ if (cfg["ui.confirmDelete"] !== false && !window.confirm(t.deleteTaskConfirm)) return;
11980
+ api.call("tasks.delete", { id: task.id }).then(result).then(function() {
11981
+ setDetail(null);
11982
+ say(t.deleted);
11983
+ createdRef.current = active;
11984
+ reload();
11985
+ }).catch(function(e) {
11986
+ say(String(e && e.message || e));
11987
+ });
11988
+ }
11989
+ function savedTask(result2) {
11990
+ if (result2) say(receipts.receipt(result2));
11991
+ }
10625
11992
  function closeMerge() {
10626
11993
  setMerge(false);
10627
11994
  if (mergeButton.current) mergeButton.current.focus({ preventScroll: true });
@@ -10810,10 +12177,119 @@ var require_timeline_view = __commonJS({
10810
12177
  setMulti(false);
10811
12178
  reload();
10812
12179
  } }) : 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
12180
+ editTask ? h(deps.EditModal, {
12181
+ key: "edit-" + editTask.id,
12182
+ api,
12183
+ t,
12184
+ lang,
12185
+ task: editTask,
12186
+ tree,
12187
+ onClose: function() {
12188
+ setEditTask(null);
12189
+ },
12190
+ onSaved: function(result2) {
12191
+ var id = editTask.id;
12192
+ setEditTask(null);
12193
+ savedTask(result2);
12194
+ refreshDetail(id);
12195
+ createdRef.current = active;
12196
+ reload();
12197
+ }
12198
+ }) : null,
12199
+ doneTask ? h(deps.DoneModal, {
12200
+ key: "done-" + doneTask.id,
12201
+ t,
12202
+ api,
12203
+ task: doneTask,
12204
+ onClose: function() {
12205
+ setDoneTask(null);
12206
+ },
12207
+ onDone: function() {
12208
+ setDoneTask(null);
12209
+ closeDetail();
12210
+ say(t.doneSuccess);
12211
+ createdRef.current = active;
12212
+ reload();
12213
+ },
12214
+ onError: function(e) {
12215
+ setDoneTask(null);
12216
+ say(String(e));
12217
+ }
12218
+ }) : null,
12219
+ timelineTask ? h(deps.TimelineModal, {
12220
+ key: "tl-" + timelineTask.id,
12221
+ t,
12222
+ api,
12223
+ task: timelineTask,
12224
+ onChanged: reload,
12225
+ refreshKey: refresh,
12226
+ onClose: function() {
12227
+ setTimelineTask(null);
12228
+ setDetail(null);
12229
+ },
12230
+ // 弹窗里的成员行同样只开预览:弹窗保持挂载,页码与滚动不丢。
12231
+ onOpen: function(member, e) {
12232
+ detailTrigger.current = e && e.currentTarget;
12233
+ openPreview(member);
12234
+ },
12235
+ onCreateTimeline: function(originTask) {
12236
+ setTimelineTask(null);
12237
+ setDetail(null);
12238
+ setCreateState({ source: "1", originTask, defaultTableId: originTask.tableId });
12239
+ }
12240
+ }) : null,
12241
+ // 预览渲染在时间线弹窗之后,叠在它上面:Esc 只关预览,弹窗与分页原样保留。
12242
+ detail && !editTask ? h(TaskPreview, {
12243
+ key: "preview-" + detail.id,
12244
+ t,
12245
+ task: detail,
12246
+ onClose: closeDetail,
12247
+ cardProps: {
12248
+ task: detail,
12249
+ t,
12250
+ lang,
12251
+ keyword: "",
12252
+ bodyMode: cfg["ui.bodyMode"],
12253
+ update: updateTask,
12254
+ onEdit: function(task) {
12255
+ closeDetail();
12256
+ setEditTask(task);
12257
+ },
12258
+ onDone: function(task) {
12259
+ closeDetail();
12260
+ setDoneTask(task);
12261
+ },
12262
+ onRestart: function(task) {
12263
+ closeDetail();
12264
+ setCreateState({ source: "2", originTask: task });
12265
+ },
12266
+ onTimeline: function(task) {
12267
+ closeDetail();
12268
+ setTimelineTask(task);
12269
+ },
12270
+ onDelete: removeTask
12271
+ }
12272
+ }) : null,
12273
+ createState ? h(deps.CreateModal, {
12274
+ key: (createState.source || "0") + "-" + (createState.originTask && createState.originTask.id || ""),
12275
+ t,
12276
+ api,
12277
+ tree,
12278
+ source: createState.source,
12279
+ originTask: createState.originTask,
12280
+ defaultTableId: createState.defaultTableId,
12281
+ defaults: { priority: cfg["form.defaultPriority"], difficulty: cfg["form.defaultDifficulty"], targetOffset: cfg["form.defaultTargetOffset"] },
12282
+ onClose: function() {
12283
+ setCreateState(null);
12284
+ },
12285
+ onCreated: function(result2) {
12286
+ setCreateState(null);
12287
+ savedTask(result2);
12288
+ createdRef.current = active;
12289
+ reload();
12290
+ }
12291
+ }) : null,
12292
+ toast ? h("div", { className: "wbt-toast" }, toast) : null
10817
12293
  );
10818
12294
  }
10819
12295
  return TimelineView;
@@ -10821,6 +12297,32 @@ var require_timeline_view = __commonJS({
10821
12297
  }
10822
12298
  });
10823
12299
 
12300
+ // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs
12301
+ var list_checks_exports = {};
12302
+ __export(list_checks_exports, {
12303
+ __iconData: () => __iconData35,
12304
+ default: () => ListChecks
12305
+ });
12306
+ var __iconData35, ListChecks;
12307
+ var init_list_checks = __esm({
12308
+ "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs"() {
12309
+ init_createLucideIcon();
12310
+ __iconData35 = {
12311
+ name: "list-checks",
12312
+ size: 24,
12313
+ node: [
12314
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
12315
+ ["path", { d: "M13 12h8", key: "h98zly" }],
12316
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
12317
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
12318
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
12319
+ ]
12320
+ };
12321
+ __iconData35.node;
12322
+ ListChecks = createLucideIcon(__iconData35);
12323
+ }
12324
+ });
12325
+
10824
12326
  // packages/addons/tasks/client/client.src.cjs
10825
12327
  (function() {
10826
12328
  "use strict";
@@ -11272,7 +12774,6 @@ var require_timeline_view = __commonJS({
11272
12774
  var EditModal = require_edit_modal()(React, statusInfo, stars);
11273
12775
  var BatchModal = require_batch_modal()(React, cx, Icon2);
11274
12776
  var CFG_FALLBACK = {
11275
- "ui.listView": "list",
11276
12777
  "ui.expandDepth": 2,
11277
12778
  "ui.confirmDelete": true,
11278
12779
  "ui.defaultPreset": "",
@@ -11287,13 +12788,15 @@ var require_timeline_view = __commonJS({
11287
12788
  "stats.recentPublishLimit": 10,
11288
12789
  "stats.recentDoneLimit": 10,
11289
12790
  "stats.recentShutdownLimit": 10,
11290
- "stats.sections": ["trend", "status", "priority", "difficulty", "aging", "overdue", "tables", "groups", "workspaces", "recentPublish", "recentDone", "recentShutdown"]
12791
+ "stats.recentClaimedLimit": 10,
12792
+ "stats.sections": ["eventTrend", "trend", "status", "priority", "difficulty", "aging", "overdue", "tables", "groups", "workspaces", "recent"]
11291
12793
  };
11292
12794
  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 });
12795
+ var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
11294
12796
  host.registerAddon({
11295
12797
  id: "wb-addon-tasks",
11296
- version: "5.2.6",
12798
+ version: "5.2.26",
12799
+ icon: (init_list_checks(), __toCommonJS(list_checks_exports)).default,
11297
12800
  views: [
11298
12801
  { id: "stats", icon: tabIcon("chart"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: statsView.TasksStatsView, keepAlive: true },
11299
12802
  { id: "tasks", icon: tabIcon("list"), title: { zh: "\u8BB0\u5F55", en: "Records" }, component: TasksView },