dsh-workbench-tasks 5.2.33 → 5.2.40

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.
Files changed (3) hide show
  1. package/lib/client.js +1659 -476
  2. package/lib/index.js +5 -1
  3. package/package.json +4 -4
package/lib/client.js CHANGED
@@ -2316,11 +2316,262 @@ var require_charts = __commonJS({
2316
2316
  }
2317
2317
  });
2318
2318
 
2319
+ // packages/addons/lib/switch.cjs
2320
+ var require_switch = __commonJS({
2321
+ "packages/addons/lib/switch.cjs"(exports2, module2) {
2322
+ "use strict";
2323
+ var SWITCH_STYLES = [
2324
+ ".wbctl-switch{display:inline-flex;align-items:center;gap:7px;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
2325
+ ".wbctl-switch-track{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:34px;height:20px;padding:2px;border-radius:999px;background:color-mix(in oklab,currentColor 22%,transparent);transition:background .16s ease;flex:none}",
2326
+ ".wbctl-switch-knob{display:block;width:16px;height:16px;border-radius:50%;background:var(--wb-card,#fff);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .16s ease}",
2327
+ ".wbctl-switch[aria-checked=true]{color:var(--wb-accent,#2563eb)}",
2328
+ ".wbctl-switch[aria-checked=true] .wbctl-switch-track{background:var(--wb-accent,#2563eb)}",
2329
+ ".wbctl-switch[aria-checked=true] .wbctl-switch-knob{transform:translateX(14px)}",
2330
+ ".wbctl-switch:hover:not(:disabled) .wbctl-switch-track{outline:1px solid var(--wb-accent,#2563eb)}",
2331
+ ".wbctl-switch:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
2332
+ ".wbctl-switch:disabled{opacity:.45;cursor:not-allowed}",
2333
+ ".wbctl-switch-text{white-space:nowrap}",
2334
+ "@media (prefers-reduced-motion:reduce){.wbctl-switch-track,.wbctl-switch-knob{transition:none}}"
2335
+ ];
2336
+ function Switch(props) {
2337
+ var h = props.h;
2338
+ var on = props.checked === true || props.checked === "true";
2339
+ var disabled = !!props.disabled;
2340
+ var text = props.label;
2341
+ if (props.showState) text = on ? props.onText || "\u5F00" : props.offText || "\u5173";
2342
+ return h(
2343
+ "button",
2344
+ {
2345
+ type: "button",
2346
+ role: "switch",
2347
+ "aria-checked": on ? "true" : "false",
2348
+ className: "wbctl-switch" + (props.className ? " " + props.className : ""),
2349
+ disabled,
2350
+ title: props.title,
2351
+ "aria-label": text ? void 0 : props.ariaLabel,
2352
+ onClick: function(e) {
2353
+ e.preventDefault();
2354
+ if (disabled) return;
2355
+ if (typeof props.onChange === "function") props.onChange(!on);
2356
+ }
2357
+ },
2358
+ h(
2359
+ "span",
2360
+ { className: "wbctl-switch-track", "aria-hidden": "true" },
2361
+ h("span", { className: "wbctl-switch-knob" })
2362
+ ),
2363
+ text ? h("span", { className: "wbctl-switch-text" }, text) : null
2364
+ );
2365
+ }
2366
+ module2.exports = { Switch, styles: SWITCH_STYLES };
2367
+ }
2368
+ });
2369
+
2370
+ // packages/addons/lib/number-field.cjs
2371
+ var require_number_field = __commonJS({
2372
+ "packages/addons/lib/number-field.cjs"(exports2, module2) {
2373
+ "use strict";
2374
+ var React = require("react");
2375
+ var NUM = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;
2376
+ var TEXT = {
2377
+ zh: {
2378
+ required: "\u8BF7\u586B\u5199\u6570\u5B57",
2379
+ invalid: "\u8BF7\u8F93\u5165\u6570\u5B57",
2380
+ integer: "\u9700\u8981\u662F\u6574\u6570",
2381
+ min: "\u4E0D\u80FD\u5C0F\u4E8E {min}",
2382
+ max: "\u4E0D\u80FD\u5927\u4E8E {max}",
2383
+ range: "\u9700\u8981\u5728 {min}\u2013{max} \u4E4B\u95F4",
2384
+ step: "\u9700\u8981\u662F {step} \u7684\u500D\u6570",
2385
+ unit: "\u5355\u4F4D"
2386
+ },
2387
+ en: {
2388
+ required: "Please enter a number",
2389
+ invalid: "Please enter a number",
2390
+ integer: "Must be a whole number",
2391
+ min: "Must be at least {min}",
2392
+ max: "Must be at most {max}",
2393
+ range: "Must be between {min} and {max}",
2394
+ step: "Must be a multiple of {step}",
2395
+ unit: "unit"
2396
+ }
2397
+ };
2398
+ function messages(lang) {
2399
+ return lang === "en" ? TEXT.en : TEXT.zh;
2400
+ }
2401
+ function fill(text, vars) {
2402
+ return String(text).replace(/\{(\w+)\}/g, function(m, key) {
2403
+ return vars && vars[key] !== void 0 ? String(vars[key]) : m;
2404
+ });
2405
+ }
2406
+ function validateNumber(raw, opts) {
2407
+ var o = opts || {};
2408
+ var M = messages(o.lang);
2409
+ var text = raw === null || raw === void 0 ? "" : String(raw).trim();
2410
+ if (text === "") {
2411
+ return o.allowEmpty ? { ok: true, value: null, error: "" } : { ok: false, value: null, error: M.required };
2412
+ }
2413
+ if (!NUM.test(text)) return { ok: false, value: null, error: M.invalid };
2414
+ var n = Number(text);
2415
+ if (!isFinite(n)) return { ok: false, value: null, error: M.invalid };
2416
+ if (o.integer && Math.round(n) !== n) return { ok: false, value: null, error: M.integer };
2417
+ var hasMin = o.min !== void 0 && o.min !== null && o.min !== "";
2418
+ var hasMax = o.max !== void 0 && o.max !== null && o.max !== "";
2419
+ if (hasMin && hasMax && n >= o.min && n <= o.max) {
2420
+ } else if (hasMin && hasMax) {
2421
+ return { ok: false, value: null, error: fill(M.range, { min: o.min, max: o.max }) };
2422
+ } else if (hasMin && n < o.min) {
2423
+ return { ok: false, value: null, error: fill(M.min, { min: o.min }) };
2424
+ } else if (hasMax && n > o.max) {
2425
+ return { ok: false, value: null, error: fill(M.max, { max: o.max }) };
2426
+ }
2427
+ if (o.step && Number(o.step) > 0) {
2428
+ var q = n / Number(o.step);
2429
+ if (Math.abs(q - Math.round(q)) > 1e-9) {
2430
+ return { ok: false, value: null, error: fill(M.step, { step: o.step }) };
2431
+ }
2432
+ }
2433
+ return { ok: true, value: n, error: "" };
2434
+ }
2435
+ function rangeHint(opts, lang) {
2436
+ var o = opts || {};
2437
+ var M = messages(lang);
2438
+ var en = lang === "en";
2439
+ var hasMin = o.min !== void 0 && o.min !== null && o.min !== "";
2440
+ var hasMax = o.max !== void 0 && o.max !== null && o.max !== "";
2441
+ var parts = [];
2442
+ if (hasMin && hasMax) parts.push(String(o.min) + "\u2013" + String(o.max));
2443
+ else if (hasMin) parts.push((en ? "\u2265 " : "\u2265 ") + String(o.min));
2444
+ else if (hasMax) parts.push((en ? "\u2264 " : "\u2264 ") + String(o.max));
2445
+ if (o.integer) parts.push(en ? "whole numbers" : "\u6574\u6570");
2446
+ else if (o.step && Number(o.step) > 0) parts.push((en ? "step " : "\u6B65\u957F ") + String(o.step));
2447
+ return parts.join(en ? ", " : "\uFF0C");
2448
+ }
2449
+ function NumberField(props) {
2450
+ var h = props.h || React.createElement;
2451
+ var lang = props.lang;
2452
+ var M = messages(lang);
2453
+ var text = props.value === null || props.value === void 0 ? "" : String(props.value);
2454
+ var draftS = React.useState(text);
2455
+ var draft = draftS[0];
2456
+ var setDraft = draftS[1];
2457
+ var focusS = React.useState(false);
2458
+ var focused = focusS[0];
2459
+ var setFocused = focusS[1];
2460
+ var errS = React.useState("");
2461
+ var err = errS[0];
2462
+ var setErr = errS[1];
2463
+ var lastRef = React.useRef(text);
2464
+ var skipBlurRef = React.useRef(false);
2465
+ React.useEffect(
2466
+ function() {
2467
+ if (focused) return;
2468
+ if (lastRef.current === text) return;
2469
+ lastRef.current = text;
2470
+ setDraft(text);
2471
+ setErr("");
2472
+ },
2473
+ [text, focused]
2474
+ );
2475
+ function commit(raw) {
2476
+ var r = validateNumber(raw, props);
2477
+ if (!r.ok) {
2478
+ setErr(r.error);
2479
+ if (typeof props.onValidChange === "function") props.onValidChange(false, r.error);
2480
+ return false;
2481
+ }
2482
+ setErr("");
2483
+ if (typeof props.onValidChange === "function") props.onValidChange(true, "");
2484
+ var cur = props.value === null || props.value === void 0 ? null : Number(props.value);
2485
+ if (r.value !== cur) {
2486
+ lastRef.current = r.value === null ? "" : String(r.value);
2487
+ if (typeof props.onCommit === "function") props.onCommit(r.value);
2488
+ }
2489
+ return true;
2490
+ }
2491
+ var hint = props.hint !== void 0 ? props.hint : rangeHint(props, lang);
2492
+ var shown = props.hint === false ? "" : hint;
2493
+ return h(
2494
+ "span",
2495
+ { className: "wbctl-num" + (props.wide ? " is-wide" : "") + (props.className ? " " + props.className : "") },
2496
+ h(
2497
+ "span",
2498
+ { className: "wbctl-num-box" },
2499
+ h("input", {
2500
+ className: "wbctl-num-input" + (err ? " is-invalid" : ""),
2501
+ type: "text",
2502
+ inputMode: props.integer || Number(props.step) === 1 ? "numeric" : "decimal",
2503
+ value: draft,
2504
+ disabled: !!props.disabled,
2505
+ placeholder: props.placeholder,
2506
+ title: props.title,
2507
+ "aria-label": props.ariaLabel,
2508
+ "aria-invalid": err ? "true" : void 0,
2509
+ onFocus: function() {
2510
+ setFocused(true);
2511
+ },
2512
+ onChange: function(e) {
2513
+ setDraft(e.target.value);
2514
+ if (err) setErr("");
2515
+ if (typeof props.onDraft === "function") props.onDraft(e.target.value);
2516
+ },
2517
+ onBlur: function() {
2518
+ setFocused(false);
2519
+ if (skipBlurRef.current) {
2520
+ skipBlurRef.current = false;
2521
+ return;
2522
+ }
2523
+ commit(draft);
2524
+ },
2525
+ onKeyDown: function(e) {
2526
+ if (e.key === "Enter") {
2527
+ e.preventDefault();
2528
+ if (e.target && e.target.blur) e.target.blur();
2529
+ } else if (e.key === "Escape") {
2530
+ e.preventDefault();
2531
+ skipBlurRef.current = true;
2532
+ setDraft(text);
2533
+ setErr("");
2534
+ if (e.target && e.target.blur) e.target.blur();
2535
+ }
2536
+ }
2537
+ }),
2538
+ props.unit ? h("span", { className: "wbctl-num-unit" }, props.unit) : null
2539
+ ),
2540
+ err ? h("span", { className: "wbctl-num-err", role: "alert" }, err) : shown ? h("span", { className: "wbctl-num-hint" }, shown) : null
2541
+ );
2542
+ }
2543
+ var NUMBER_STYLES = [
2544
+ ".wbctl-num{display:inline-flex;flex-direction:column;gap:3px;min-width:0;max-width:100%}",
2545
+ ".wbctl-num.is-wide{display:flex;width:100%}",
2546
+ ".wbctl-num-box{display:inline-flex;align-items:center;gap:6px;min-width:0}",
2547
+ ".wbctl-num-input{box-sizing:border-box;width:96px;min-width:0;padding:6px 9px;border:1px solid var(--wb-line,rgba(127,127,127,.35));border-radius:6px;background:var(--wb-surface,var(--wb-card,transparent));color:inherit;font:inherit;font-size:13px;font-variant-numeric:tabular-nums;transition:border-color .14s ease,outline-color .14s ease}",
2548
+ ".wbctl-num-input:hover:not(:disabled){border-color:var(--wb-border,var(--wb-line))}",
2549
+ ".wbctl-num-input:focus{outline:2px solid color-mix(in oklab,var(--wb-accent,#2563eb) 55%,transparent);outline-offset:1px;border-color:var(--wb-accent,#2563eb)}",
2550
+ ".wbctl-num-input.is-invalid{border-color:var(--wb-danger,#dc2626)}",
2551
+ ".wbctl-num-input.is-invalid:focus{outline-color:color-mix(in oklab,var(--wb-danger,#dc2626) 55%,transparent)}",
2552
+ ".wbctl-num-input:disabled{opacity:.5;cursor:not-allowed}",
2553
+ ".wbctl-num-unit{color:var(--wb-muted,inherit);font-size:12px;white-space:nowrap}",
2554
+ ".wbctl-num-hint{color:var(--wb-muted,inherit);font-size:11px;line-height:1.4}",
2555
+ ".wbctl-num-err{color:var(--wb-danger,#dc2626);font-size:11px;line-height:1.4}",
2556
+ "@media (prefers-reduced-motion:reduce){.wbctl-num-input{transition:none}}"
2557
+ ];
2558
+ module2.exports = {
2559
+ NumberField,
2560
+ validateNumber,
2561
+ rangeHint,
2562
+ messages,
2563
+ styles: NUMBER_STYLES
2564
+ };
2565
+ }
2566
+ });
2567
+
2319
2568
  // packages/addons/tasks/client/views/config.cjs
2320
2569
  var require_config = __commonJS({
2321
2570
  "packages/addons/tasks/client/views/config.cjs"(exports2, module2) {
2322
2571
  var React = require("react");
2323
2572
  var h = React.createElement;
2573
+ var SW = require_switch();
2574
+ var NF = require_number_field();
2324
2575
  var DOMAIN = "tasks";
2325
2576
  var PREFIX = "wbt";
2326
2577
  var COPY = {
@@ -2395,13 +2646,6 @@ var require_config = __commonJS({
2395
2646
  ".__P__-cfg-select:focus,.__P__-cfg-input:focus{border-color:var(--dsw-alias-brand-primary,currentColor);box-shadow:0 0 0 3px color-mix(in oklab,var(--dsw-alias-brand-primary,currentColor) 14%,transparent)}",
2396
2647
  ".__P__-cfg-select{min-width:152px;padding-right:10px}",
2397
2648
  ".__P__-cfg-input{width:132px}",
2398
- ".__P__-cfg-switch{position:relative;display:inline-flex;align-items:center;gap:9px;cursor:pointer;font-size:12.5px;color:var(--cfg-muted);user-select:none}",
2399
- ".__P__-cfg-switch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}",
2400
- ".__P__-cfg-track{position:relative;width:38px;height:22px;border-radius:999px;background:color-mix(in oklab,currentColor 18%,transparent);transition:background .16s ease;flex:none}",
2401
- ".__P__-cfg-track::after{content:'';position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:var(--dsw-alias-label-primary,currentColor);transition:transform .16s ease,background .16s ease}",
2402
- ".__P__-cfg-switch input:checked+.__P__-cfg-track{background:var(--dsw-alias-brand-primary,currentColor)}",
2403
- ".__P__-cfg-switch input:checked+.__P__-cfg-track::after{transform:translateX(16px);background:var(--dsw-alias-label-primary-inverted,var(--dsw-alias-bg-base))}",
2404
- ".__P__-cfg-switch input:focus-visible+.__P__-cfg-track{outline:2px solid var(--dsw-alias-brand-primary,currentColor);outline-offset:2px}",
2405
2649
  ".__P__-cfg-multi{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;max-width:100%}",
2406
2650
  ".__P__-cfg-multi label{position:relative;display:inline-flex;align-items:center;padding:5px 11px;border:1px solid var(--cfg-line);border-radius:999px;font-size:12px;color:var(--cfg-muted);cursor:pointer;line-height:1.4;transition:color .12s ease,border-color .12s ease,background .12s ease}",
2407
2651
  ".__P__-cfg-multi label:hover{background:var(--cfg-hover);color:var(--dsw-alias-label-primary,inherit)}",
@@ -2426,8 +2670,8 @@ var require_config = __commonJS({
2426
2670
  ".__P__-cfg-empty{border:1px dashed var(--cfg-line);border-radius:14px;padding:40px 16px;text-align:center;font-size:12.5px;color:var(--cfg-muted)}",
2427
2671
  ".__P__-cfg-error{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid color-mix(in oklab,var(--dsw-alias-state-error-primary,currentColor) 32%,var(--cfg-line));border-radius:10px;padding:10px 13px;color:var(--dsw-alias-state-error-primary,inherit);font-size:12.5px;line-height:1.5}",
2428
2672
  "@media (max-width:820px){.__P__-cfg-row{grid-template-columns:1fr;gap:10px;padding:13px 16px}.__P__-cfg-control{justify-content:flex-start}.__P__-cfg-multi{justify-content:flex-start}.__P__-cfg-gtitle{padding:11px 16px}}",
2429
- "@media (prefers-reduced-motion:reduce){.__P__-cfg-track,.__P__-cfg-track::after,.__P__-cfg-sk{animation:none;transition:none}}"
2430
- ].join("\n").split("__P__").join(PREFIX);
2673
+ "@media (prefers-reduced-motion:reduce){.__P__-cfg-sk{animation:none;transition:none}}"
2674
+ ].concat(SW.styles).concat(NF.styles).join("\n").split("__P__").join(PREFIX);
2431
2675
  function injectCss() {
2432
2676
  if (typeof document === "undefined") return;
2433
2677
  var old = document.getElementById("wb-addon-" + DOMAIN + "-config-css");
@@ -2510,8 +2754,6 @@ var require_config = __commonJS({
2510
2754
  var notice = noticeS[0], setNotice = noticeS[1];
2511
2755
  var savingS = React.useState("");
2512
2756
  var savingId = savingS[0], setSavingId = savingS[1];
2513
- var draftsS = React.useState({});
2514
- var drafts = draftsS[0], setDrafts = draftsS[1];
2515
2757
  var busyS = React.useState(false);
2516
2758
  var busy = busyS[0], setBusy = busyS[1];
2517
2759
  var requestLock = React.useRef(false), mounted = React.useRef(true);
@@ -2626,40 +2868,21 @@ var require_config = __commonJS({
2626
2868
  setNotice({ id: "", text: String(e && e.message || e), error: true });
2627
2869
  }).finally(release);
2628
2870
  }
2629
- function commitDraft(item) {
2630
- if (requestLock.current) return;
2631
- var raw = drafts[item.id];
2632
- if (raw === void 0) return;
2633
- var next = String(raw).trim();
2634
- setDrafts(function(prev) {
2635
- var copy = Object.assign({}, prev);
2636
- delete copy[item.id];
2637
- return copy;
2638
- });
2639
- if (next === "") return;
2640
- var value = Number(next);
2641
- if (!Number.isFinite(value)) return;
2642
- if (sameValue(value, state.values[item.id])) return;
2643
- save(item.id, value);
2644
- }
2645
2871
  function renderControl(item) {
2646
2872
  var value = state.values[item.id];
2647
2873
  var label = lang === "en" ? item.en : item.zh;
2648
2874
  if (item.type === "bool") {
2649
- return h(
2650
- "label",
2651
- { className: PREFIX + "-cfg-switch" },
2652
- h("input", {
2653
- type: "checkbox",
2654
- disabled: locked,
2655
- checked: value === true,
2656
- onChange: function(e) {
2657
- save(item.id, e.target.checked);
2658
- }
2659
- }),
2660
- h("span", { className: PREFIX + "-cfg-track", "aria-hidden": "true" }),
2661
- h("span", { className: PREFIX + "-cfg-switchstate" }, value === true ? t.on : t.off)
2662
- );
2875
+ return h(SW.Switch, {
2876
+ h,
2877
+ checked: value === true,
2878
+ disabled: locked,
2879
+ showState: true,
2880
+ onText: t.on,
2881
+ offText: t.off,
2882
+ onChange: function(next) {
2883
+ save(item.id, next);
2884
+ }
2885
+ });
2663
2886
  }
2664
2887
  if (item.type === "enum") {
2665
2888
  return h("select", {
@@ -2677,31 +2900,17 @@ var require_config = __commonJS({
2677
2900
  }));
2678
2901
  }
2679
2902
  if (item.type === "int") {
2680
- var draft = drafts[item.id] !== void 0 ? drafts[item.id] : String(value);
2681
- return h("input", {
2682
- className: PREFIX + "-cfg-input",
2683
- disabled: locked,
2684
- type: "number",
2685
- value: draft,
2903
+ return h(NF.NumberField, {
2904
+ h,
2905
+ lang,
2906
+ value: value === void 0 ? "" : value,
2686
2907
  min: item.min,
2687
2908
  max: item.max,
2688
- "aria-label": label,
2689
- onChange: function(e) {
2690
- var v = e.target.value;
2691
- setDrafts(function(prev) {
2692
- var c = Object.assign({}, prev);
2693
- c[item.id] = v;
2694
- return c;
2695
- });
2696
- },
2697
- onBlur: function() {
2698
- commitDraft(item);
2699
- },
2700
- onKeyDown: function(e) {
2701
- if (e.key === "Enter") {
2702
- e.preventDefault();
2703
- commitDraft(item);
2704
- }
2909
+ integer: true,
2910
+ disabled: locked,
2911
+ ariaLabel: label,
2912
+ onCommit: function(next) {
2913
+ save(item.id, next);
2705
2914
  }
2706
2915
  });
2707
2916
  }
@@ -4514,13 +4723,6 @@ var require_data_style = __commonJS({
4514
4723
  "." + P + "-search input:focus{border-color:var(--dsw-alias-brand-primary,currentColor);box-shadow:0 0 0 3px color-mix(in oklab,var(--dsw-alias-brand-primary,currentColor) 14%,transparent)}",
4515
4724
  "." + P + "-select{border:1px solid var(--cfg-line);background:var(--dsw-alias-bg-base,transparent);color:inherit;border-radius:9px;padding:7px 10px;font:inherit;font-size:12px;outline:none}",
4516
4725
  "." + P + "-select:focus{border-color:var(--dsw-alias-brand-primary,currentColor);box-shadow:0 0 0 3px color-mix(in oklab,var(--dsw-alias-brand-primary,currentColor) 14%,transparent)}",
4517
- "." + P + "-switch{position:relative;display:inline-flex;align-items:center;gap:7px;cursor:pointer;font-size:12px;color:var(--cfg-muted);user-select:none;padding:4px 2px}",
4518
- "." + P + "-switch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}",
4519
- "." + P + "-track{position:relative;width:34px;height:20px;border-radius:999px;background:color-mix(in oklab,currentColor 18%,transparent);transition:background .16s ease;flex:none}",
4520
- "." + P + "-track::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--dsw-alias-label-primary,currentColor);transition:transform .16s ease,background .16s ease}",
4521
- "." + P + "-switch input:checked+." + P + "-track{background:var(--dsw-alias-brand-primary,currentColor)}",
4522
- "." + P + "-switch input:checked+." + P + "-track::after{transform:translateX(14px);background:var(--dsw-alias-label-primary-inverted,var(--dsw-alias-bg-base))}",
4523
- "." + P + "-switch input:focus-visible+." + P + "-track{outline:2px solid var(--dsw-alias-brand-primary,currentColor);outline-offset:2px}",
4524
4726
  "." + P + "-btn{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--cfg-line);background:transparent;color:var(--cfg-muted);border-radius:8px;padding:6px 10px;font:inherit;font-size:11.5px;cursor:pointer;white-space:nowrap;transition:background .12s ease,color .12s ease}",
4525
4727
  "." + P + "-btn:hover{background:var(--cfg-hover);color:var(--dsw-alias-label-primary,inherit)}",
4526
4728
  "." + P + "-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,currentColor);outline-offset:2px}",
@@ -4549,8 +4751,8 @@ var require_data_style = __commonJS({
4549
4751
  "." + P + "-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:2px;font-size:11.5px;color:var(--cfg-muted)}",
4550
4752
  "." + P + "-grow{flex:1}",
4551
4753
  "." + P + "-pageinfo{font-variant-numeric:tabular-nums}",
4552
- "." + P + "-jump{width:56px;border:1px solid var(--cfg-line);background:var(--dsw-alias-bg-base,transparent);color:inherit;border-radius:7px;padding:4px 7px;font:inherit;font-size:11.5px;text-align:right;outline:none}",
4553
- "." + P + "-jump:focus{border-color:var(--dsw-alias-brand-primary,currentColor)}",
4754
+ "." + P + "-jump .wbctl-num-input{width:56px;padding:4px 7px;font-size:11.5px;text-align:right}",
4755
+ "." + P + "-jump .wbctl-num-hint{display:none}",
4554
4756
  "." + P + "-empty{border:1px dashed var(--cfg-line);border-radius:11px;padding:44px 16px;text-align:center;font-size:12.5px;color:var(--cfg-muted)}",
4555
4757
  "." + P + "-err{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid color-mix(in oklab,var(--dsw-alias-state-error-primary,currentColor) 32%,var(--cfg-line));border-radius:10px;padding:9px 12px;color:var(--dsw-alias-state-error-primary,inherit);font-size:12px;line-height:1.5}",
4556
4758
  "." + P + "-skwrap{display:flex;flex-direction:column;gap:1px;padding:2px}",
@@ -4588,7 +4790,7 @@ var require_data_style = __commonJS({
4588
4790
  "." + P + "-images img{width:36px;height:36px;object-fit:cover;border-radius:5px}",
4589
4791
  "." + P + "-gallery{display:flex;flex-direction:column;gap:12px;overflow:auto;flex:1}",
4590
4792
  "." + P + "-gallery img{width:100%;height:auto;object-fit:contain;border-radius:8px}"
4591
- ].join("\n");
4793
+ ].concat(require_switch().styles).concat(require_number_field().styles).join("\n");
4592
4794
  if (DOMAIN === "storage") {
4593
4795
  var buttons = "." + P + " :is(button)";
4594
4796
  CSS += buttons + "{border:none;background:var(--wb-btn-bg);min-height:var(--wb-btn-size-sm);min-width:var(--wb-btn-size-sm)}" + buttons + ":enabled:hover{background:var(--wb-btn-hover-bg)}" + buttons + ":enabled:active{background:var(--wb-btn-active-bg)}" + buttons + ":disabled{background:var(--wb-btn-bg);color:var(--cfg-muted)}" + buttons + ":focus-visible{outline:var(--wb-btn-focus);outline-offset:var(--wb-btn-focus-offset)}." + P + "-fcell:has(button) input{padding-right:34px}";
@@ -4616,8 +4818,10 @@ var require_data_view = __commonJS({
4616
4818
  "packages/addons/lib/data-view.cjs"(exports2, module2) {
4617
4819
  "use strict";
4618
4820
  var React = require("react");
4821
+ var NF = require_number_field();
4619
4822
  var h = React.createElement;
4620
4823
  var COPY = require_data_copy();
4824
+ var SW = require_switch();
4621
4825
  module2.exports = function createDataView(options) {
4622
4826
  var DOMAIN = options.domain;
4623
4827
  function icon(name) {
@@ -5171,17 +5375,18 @@ var require_data_view = __commonJS({
5171
5375
  h("button", { type: "button", className: P + "-btn", disabled: !data || page >= pages, onClick: function() {
5172
5376
  setPage(Math.min(pages, page + 1));
5173
5377
  } }, t.next + " \u203A"),
5174
- h("input", {
5378
+ h(NF.NumberField, {
5379
+ h,
5380
+ lang,
5175
5381
  className: P + "-jump",
5176
- type: "number",
5382
+ value: page,
5177
5383
  min: 1,
5178
5384
  max: pages,
5179
- "aria-label": t.jump,
5180
- onKeyDown: function(e) {
5181
- if (e.key === "Enter") {
5182
- var n = Math.floor(Number(e.target.value));
5183
- if (n >= 1) setPage(Math.min(pages, n));
5184
- }
5385
+ integer: true,
5386
+ ariaLabel: t.jump,
5387
+ hint: false,
5388
+ onCommit: function(next) {
5389
+ if (next !== null) setPage(next);
5185
5390
  }
5186
5391
  }),
5187
5392
  data && data.queryMs !== void 0 ? h("span", null, fmt(t.queryTime, { n: data.queryMs })) : null
@@ -5278,25 +5483,23 @@ var require_data_view = __commonJS({
5278
5483
  }
5279
5484
  })
5280
5485
  ),
5281
- h(
5282
- "label",
5283
- { className: P + "-switch" },
5284
- h("input", { type: "checkbox", checked: includeDeleted, onChange: function(e) {
5285
- setIncludeDeleted(e.target.checked);
5486
+ h(SW.Switch, {
5487
+ h,
5488
+ checked: includeDeleted,
5489
+ label: t.includeDeleted,
5490
+ onChange: function(next) {
5491
+ setIncludeDeleted(next);
5286
5492
  setPage(1);
5287
- } }),
5288
- h("span", { className: P + "-track" }),
5289
- h("span", null, t.includeDeleted)
5290
- ),
5291
- h(
5292
- "label",
5293
- { className: P + "-switch" },
5294
- h("input", { type: "checkbox", checked: showSystem, onChange: function(e) {
5295
- setShowSystem(e.target.checked);
5296
- } }),
5297
- h("span", { className: P + "-track" }),
5298
- h("span", null, t.showSystem)
5299
- ),
5493
+ }
5494
+ }),
5495
+ h(SW.Switch, {
5496
+ h,
5497
+ checked: showSystem,
5498
+ label: t.showSystem,
5499
+ onChange: function(next) {
5500
+ setShowSystem(next);
5501
+ }
5502
+ }),
5300
5503
  h("span", { className: P + "-grow" }),
5301
5504
  h(
5302
5505
  "label",
@@ -5449,16 +5652,13 @@ var require_action_schema_style = __commonJS({
5449
5652
  "." + P + "-cardmeta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;min-height:24px}",
5450
5653
  "." + P + "-cardhead code{font-weight:640;overflow-wrap:anywhere;min-width:0}",
5451
5654
  "." + P + "-hintline{margin:0;color:var(--dsw-alias-label-tertiary,inherit);font-size:11.5px;line-height:1.5}",
5452
- "." + 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}",
5453
- "." + 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)}",
5454
- "." + P + "-track::before{content:'';width:12px;height:12px;border-radius:50%;background:currentColor;transition:transform .15s ease}",
5455
- "." + P + "-toggle[aria-checked=true] ." + P + "-track{background:var(--wb-accent);border-color:var(--wb-accent);color:var(--wb-card)}",
5456
- "." + P + "-toggle[aria-checked=true] ." + P + "-track::before{transform:translateX(12px)}",
5457
- "." + P + "-toggle:hover:not(:disabled) ." + P + "-track{outline:1px solid var(--wb-accent)}",
5458
- "." + P + "-toggle:focus-visible{outline:2px solid var(--wb-accent);outline-offset:2px}",
5459
- "." + P + "-toggle:disabled{opacity:.6;cursor:progress}",
5460
- "@media(prefers-reduced-motion:reduce){." + P + "-track::before{transition:none}}",
5461
- // 安全约束(不可放开):用警示色描边,和可切换的开关区分开。
5655
+ "." + P + "-origins{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}",
5656
+ "." + P + "-origins-label{font-size:11px;color:var(--wb-muted);white-space:nowrap}",
5657
+ "." + P + "-origin{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--wb-muted);cursor:pointer;user-select:none}",
5658
+ // 该 action 本身不支持的来源:整项置灰、不可点,示意「不是没开,是开不了」。
5659
+ "." + P + "-origin-off{opacity:.55;cursor:not-allowed}",
5660
+ "." + P + "-origin input[type=checkbox]{width:13px;height:13px;margin:0;accent-color:var(--wb-accent);cursor:inherit}",
5661
+ "." + P + "-origin input[type=checkbox]:focus-visible{outline:2px solid var(--wb-accent);outline-offset:2px}",
5462
5662
  "." + P + "-locked{border-color:var(--wb-warn,#b7791f);color:var(--wb-warn,#b7791f)}",
5463
5663
  "." + P + "-desc{margin:0;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55;font-size:12.5px}",
5464
5664
  // 搜索命中:用品牌色透明度叠加而不是写死浅色,深浅主题都可读;继承文字颜色、不覆盖 ::selection。
@@ -5511,15 +5711,20 @@ var require_action_schema_view = __commonJS({
5511
5711
  zh: {
5512
5712
  title: "Action",
5513
5713
  hint: "\u8FD0\u884C\u65F6\u6CE8\u518C \xB7 \u53EA\u8BFB",
5514
- switchHint: "agent \u5F00\u5173\u843D\u672C\u673A\u3001\u5373\u6539\u5373\u751F\u6548\uFF1B\u754C\u9762\u64CD\u4F5C\u4E0D\u53D7\u5F71\u54CD\u3002",
5515
- 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",
5516
- agentSwitch: "agent \u53EF\u7528",
5517
- agentLocked: "\u4EC5\u754C\u9762 \xB7 \u5B89\u5168\u7EA6\u675F",
5518
- agentLockedHint: "\u8BE5 action \u53EA\u80FD\u5728\u754C\u9762\u6267\u884C\uFF08\u5B89\u5168\u7EA6\u675F\uFF09\uFF0Cagent \u5F00\u5173\u4E0D\u53EF\u653E\u5F00",
5519
- agentSaving: "\u4FDD\u5B58\u4E2D\u2026",
5520
- agentOnToast: "\u5DF2\u5141\u8BB8 agent \u8C03\u7528",
5521
- agentOffToast: "\u5DF2\u7981\u6B62 agent \u8C03\u7528",
5522
- agentFail: "\u5207\u6362 agent \u5F00\u5173\u5931\u8D25",
5714
+ switchHint: "\u5141\u8BB8\u6765\u6E90\u843D\u672C\u673A\u3001\u5373\u6539\u5373\u751F\u6548\uFF1A\u52FE\u4E0A\u7684\u6765\u6E90\u624D\u80FD\u8C03\u7528\u8BE5 action\uFF0C\u5176\u4F59\u4F1A\u88AB ACTION_ORIGIN_DENIED \u62E6\u4E0B\u3002",
5715
+ hostHint: "\u5BBF\u4E3B action \u7684\u5141\u8BB8\u6765\u6E90\uFF1B\u6807\u300C\u6765\u6E90\u56FA\u5B9A\u300D\u7684\u4E0D\u53EF\u4FEE\u6539\u3002",
5716
+ originsLabel: "\u5141\u8BB8\u6765\u6E90",
5717
+ originUi: "\u754C\u9762",
5718
+ originPlugin: "\u63D2\u4EF6",
5719
+ originAgent: "agent",
5720
+ originSync: "\u540C\u6B65",
5721
+ originsSaving: "\u4FDD\u5B58\u4E2D\u2026",
5722
+ originsToast: "\u5DF2\u66F4\u65B0\u5141\u8BB8\u6765\u6E90",
5723
+ originsFail: "\u66F4\u65B0\u5141\u8BB8\u6765\u6E90\u5931\u8D25",
5724
+ originsEmpty: "\u81F3\u5C11\u8981\u4FDD\u7559\u4E00\u4E2A\u6765\u6E90",
5725
+ originsUnsupported: "\u8BE5 action \u672C\u8EAB\u4E0D\u652F\u6301\u8FD9\u4E2A\u6765\u6E90",
5726
+ originsPinned: "\u6765\u6E90\u56FA\u5B9A",
5727
+ originsPinnedHint: "\u8BE5 action \u7684\u5141\u8BB8\u6765\u6E90\u88AB\u56FA\u5B9A\uFF08\u5B89\u5168\u7EA6\u675F\uFF09\uFF0C\u4E0D\u80FD\u4FEE\u6539",
5523
5728
  domain: "\u57DF",
5524
5729
  versionLabel: "\u7248\u672C",
5525
5730
  shell: "\u5BBF\u4E3B",
@@ -5533,6 +5738,8 @@ var require_action_schema_view = __commonJS({
5533
5738
  onlyOptional: "\u65E0\u5FC5\u586B\u9879",
5534
5739
  filterType: "\u53C2\u6570\u7C7B\u578B",
5535
5740
  allTypes: "\u5168\u90E8\u7C7B\u578B",
5741
+ filterOrigin: "\u5141\u8BB8\u6765\u6E90",
5742
+ allOrigins: "\u5168\u90E8\u6765\u6E90",
5536
5743
  colName: "\u53C2\u6570",
5537
5744
  colType: "\u7C7B\u578B",
5538
5745
  colReq: "\u5FC5\u586B",
@@ -5565,15 +5772,22 @@ var require_action_schema_view = __commonJS({
5565
5772
  en: {
5566
5773
  title: "Actions",
5567
5774
  hint: "runtime registry \xB7 read-only",
5568
- switchHint: "The agent switch is stored locally and applies immediately; UI actions are unaffected.",
5569
- hostHint: "Agent switch for host actions; items marked UI-only (security) cannot be opened up.",
5570
- agentSwitch: "Agent callable",
5571
- agentLocked: "UI only \xB7 security",
5572
- agentLockedHint: "This action can only run from the UI (security constraint); the agent switch cannot be opened",
5573
- agentSaving: "Saving\u2026",
5574
- agentOnToast: "Agent calls allowed",
5575
- agentOffToast: "Agent calls blocked",
5576
- agentFail: "Failed to change the agent switch",
5775
+ switchHint: "Allowed origins are stored locally and apply immediately: only checked origins may call the action; others get ACTION_ORIGIN_DENIED.",
5776
+ hostHint: "Allowed origins for host actions; items marked pinned cannot be changed.",
5777
+ originsLabel: "Origins",
5778
+ originUi: "UI",
5779
+ originPlugin: "Plugin",
5780
+ originAgent: "Agent",
5781
+ originSync: "Sync",
5782
+ originsSaving: "Saving\u2026",
5783
+ originsToast: "Allowed origins updated",
5784
+ originsFail: "Failed to update allowed origins",
5785
+ originsEmpty: "Keep at least one origin",
5786
+ originsUnsupported: "This action does not support this origin",
5787
+ originsPinned: "Pinned",
5788
+ originsPinnedHint: "Allowed origins are pinned for this action (security constraint) and cannot be changed",
5789
+ originsDefaultOn: "Allowed by default",
5790
+ originsDefaultOff: "Off by default, can be enabled",
5577
5791
  domain: "Domain",
5578
5792
  versionLabel: "Version",
5579
5793
  shell: "Host",
@@ -5587,6 +5801,8 @@ var require_action_schema_view = __commonJS({
5587
5801
  onlyOptional: "No required",
5588
5802
  filterType: "Param type",
5589
5803
  allTypes: "All types",
5804
+ filterOrigin: "Origins",
5805
+ allOrigins: "All origins",
5590
5806
  colName: "Param",
5591
5807
  colType: "Type",
5592
5808
  colReq: "Required",
@@ -5730,6 +5946,8 @@ var require_action_schema_view = __commonJS({
5730
5946
  var reqMode = reqState[0], setReqMode = reqState[1];
5731
5947
  var typeState = React.useState("");
5732
5948
  var typePick = typeState[0], setTypePick = typeState[1];
5949
+ var originFilterState = React.useState("");
5950
+ var originPick = originFilterState[0], setOriginPick = originFilterState[1];
5733
5951
  var toastState = React.useState("");
5734
5952
  var toast = toastState[0], setToast = toastState[1];
5735
5953
  var savingState = React.useState("");
@@ -5785,38 +6003,53 @@ var require_action_schema_view = __commonJS({
5785
6003
  plainCopy(text);
5786
6004
  done();
5787
6005
  }
5788
- function setAgent(action, next) {
6006
+ var ORIGINS = ["ui", "plugin", "agent", "sync"];
6007
+ var originText = { ui: t.originUi, plugin: t.originPlugin, agent: t.originAgent, sync: t.originSync };
6008
+ function setOrigins(action, origin) {
5789
6009
  var name = action.name;
6010
+ var current = Array.isArray(action.origins) ? action.origins.slice() : [];
6011
+ var index = current.indexOf(origin);
6012
+ var next = index >= 0 ? current.filter(function(o) {
6013
+ return o !== origin;
6014
+ }) : current.concat([origin]);
6015
+ if (next.length === 0) {
6016
+ setToast(t.originsEmpty);
6017
+ return;
6018
+ }
6019
+ next = ORIGINS.filter(function(o) {
6020
+ return next.indexOf(o) >= 0;
6021
+ });
5790
6022
  setSaving(name);
5791
6023
  setToast("");
5792
6024
  var fail = function(e) {
5793
6025
  setSaving("");
5794
- setToast(t.agentFail + "\uFF1A" + String(e && e.message || e || ""));
6026
+ setToast(t.originsFail + "\uFF1A" + String(e && e.message || e || ""));
5795
6027
  };
5796
6028
  var done = function(r) {
5797
6029
  setSaving("");
5798
6030
  var payload = r && typeof r === "object" && Object.prototype.hasOwnProperty.call(r, "result") ? r.result : r;
5799
6031
  if (r && r.ok === false) {
5800
- setToast(t.agentFail + "\uFF1A" + String(r.error || r.text || ""));
6032
+ setToast(t.originsFail + "\uFF1A" + String(r.error || r.text || ""));
5801
6033
  return;
5802
6034
  }
5803
- var value = payload && typeof payload.agentEnabled === "boolean" ? payload.agentEnabled : next;
6035
+ var value = payload && Array.isArray(payload.origins) ? payload.origins : next;
6036
+ var source = payload && typeof payload.source === "string" ? payload.source : action.originsSource;
5804
6037
  setSnap(function(prev) {
5805
6038
  if (!prev || !Array.isArray(prev.actions)) return prev;
5806
6039
  return Object.assign({}, prev, {
5807
6040
  actions: prev.actions.map(function(a) {
5808
6041
  if (!a || a.name !== name) return a;
5809
- return Object.assign({}, a, { agentEnabled: value });
6042
+ return Object.assign({}, a, { origins: value, originsSource: source });
5810
6043
  })
5811
6044
  });
5812
6045
  });
5813
- setToast(value ? t.agentOnToast : t.agentOffToast);
6046
+ setToast(t.originsToast);
5814
6047
  };
5815
6048
  if (!api || typeof api.call !== "function") {
5816
6049
  fail(new Error("no call api"));
5817
6050
  return;
5818
6051
  }
5819
- Promise.resolve(api.call("actions.setAgentAccess", { action: name, agentEnabled: next })).then(done, fail);
6052
+ Promise.resolve(api.call("actions.setActionOrigins", { action: name, origins: next })).then(done, fail);
5820
6053
  }
5821
6054
  var all = snap && Array.isArray(snap.actions) ? snap.actions.filter(function(a) {
5822
6055
  return a && a.domain === DOMAIN;
@@ -5851,6 +6084,7 @@ var require_action_schema_view = __commonJS({
5851
6084
  if (typePick && !rows.some(function(row) {
5852
6085
  return row.types.indexOf(typePick) >= 0;
5853
6086
  })) return false;
6087
+ if (originPick && (!Array.isArray(a.origins) || a.origins.indexOf(originPick) < 0)) return false;
5854
6088
  return true;
5855
6089
  });
5856
6090
  function paramRow(row) {
@@ -5866,33 +6100,45 @@ var require_action_schema_view = __commonJS({
5866
6100
  h("td", null, Highlight.hit(row.description, kw))
5867
6101
  );
5868
6102
  }
5869
- function agentSwitch(action) {
5870
- if (action.agentLocked === true) {
5871
- return h("span", {
5872
- className: P + "-badge " + P + "-locked",
5873
- title: t.agentLockedHint,
5874
- "data-agent-locked": action.name
5875
- }, t.agentLocked);
6103
+ function originsChips(action) {
6104
+ if (!Array.isArray(action.origins)) return null;
6105
+ if (action.originsSource === "invalid") {
6106
+ return h("span", { className: P + "-badge " + P + "-locked", title: t.originsPinnedHint, "data-origins-invalid": action.name }, t.originsPinned);
5876
6107
  }
5877
- if (typeof action.agentEnabled !== "boolean") return null;
5878
6108
  var busy = saving === action.name;
6109
+ var pinned = action.name === "actions.setActionOrigins";
6110
+ var supported = Array.isArray(action.originsDeclared) ? action.originsDeclared : action.origins;
5879
6111
  return h(
5880
- "button",
5881
- {
5882
- className: P + "-toggle",
5883
- "data-agent-row": action.name,
5884
- type: "button",
5885
- role: "switch",
5886
- "aria-checked": action.agentEnabled,
5887
- disabled: busy,
5888
- "data-agent-toggle": action.name,
5889
- "aria-label": t.agentSwitch + " \xB7 " + action.name,
5890
- onClick: function() {
5891
- setAgent(action, !action.agentEnabled);
5892
- }
5893
- },
5894
- h("span", { className: P + "-track", "aria-hidden": true }),
5895
- h("span", null, busy ? t.agentSaving : t.agentSwitch)
6112
+ "div",
6113
+ { className: P + "-origins", "data-origins-row": action.name },
6114
+ h("span", { className: P + "-origins-label" }, t.originsLabel),
6115
+ ORIGINS.map(function(origin) {
6116
+ var on = action.origins.indexOf(origin) >= 0;
6117
+ var allowed = supported.indexOf(origin) >= 0;
6118
+ var preset = Array.isArray(action.originsDefault) ? action.originsDefault : supported;
6119
+ var byDefault = preset.indexOf(origin) >= 0;
6120
+ return h(
6121
+ "label",
6122
+ {
6123
+ key: origin,
6124
+ className: P + "-origin" + (allowed ? "" : " " + P + "-origin-off"),
6125
+ title: pinned ? t.originsPinnedHint : !allowed ? t.originsUnsupported : originText[origin] + " \xB7 " + action.name + " \xB7 " + (byDefault ? t.originsDefaultOn : t.originsDefaultOff)
6126
+ },
6127
+ h("input", {
6128
+ type: "checkbox",
6129
+ checked: on,
6130
+ disabled: busy || pinned || !allowed,
6131
+ "data-origin": origin,
6132
+ "data-origin-row": action.name,
6133
+ "data-origin-supported": allowed ? "1" : "0",
6134
+ onChange: function() {
6135
+ setOrigins(action, origin);
6136
+ }
6137
+ }),
6138
+ h("span", null, originText[origin])
6139
+ );
6140
+ }),
6141
+ busy ? h("span", { className: P + "-origins-label" }, t.originsSaving) : null
5896
6142
  );
5897
6143
  }
5898
6144
  function card(action) {
@@ -5913,7 +6159,7 @@ var require_action_schema_view = __commonJS({
5913
6159
  return row.required;
5914
6160
  }) ? h("span", { className: P + "-badge " + P + "-req" }, t.required) : null
5915
6161
  ),
5916
- agentSwitch(action)
6162
+ originsChips(action)
5917
6163
  ),
5918
6164
  action.description ? h("p", { className: P + "-desc" }, Highlight.hit(action.description, kw)) : null,
5919
6165
  rows.length ? h(
@@ -6036,6 +6282,21 @@ var require_action_schema_view = __commonJS({
6036
6282
  return h("option", { value: name, key: name }, name);
6037
6283
  })
6038
6284
  )
6285
+ ),
6286
+ h(
6287
+ "label",
6288
+ { className: P + "-none" },
6289
+ t.filterOrigin + " ",
6290
+ h(
6291
+ "select",
6292
+ { value: originPick, "aria-label": t.filterOrigin, "data-origin-filter": "", onChange: function(e) {
6293
+ setOriginPick(e.target.value);
6294
+ } },
6295
+ h("option", { value: "" }, t.allOrigins),
6296
+ ORIGINS.map(function(origin) {
6297
+ return h("option", { value: origin, key: origin }, originText[origin]);
6298
+ })
6299
+ )
6039
6300
  )
6040
6301
  ) : null,
6041
6302
  body,
@@ -6118,6 +6379,27 @@ var require_copy = __commonJS({
6118
6379
  create: "\u521B\u5EFA",
6119
6380
  close: "\u5173\u95ED",
6120
6381
  taskId: "\u4EFB\u52A1 ID",
6382
+ stepContent: "\u5185\u5BB9",
6383
+ stepContentHint: "\u6807\u9898\u3001\u63CF\u8FF0\u4E0E\u8BA1\u5212",
6384
+ stepTags: "\u6807\u7B7E",
6385
+ stepTagsHint: "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E\uFF0C\u6216\u8F93\u5165\u65B0\u6807\u7B7E\u56DE\u8F66\u6DFB\u52A0",
6386
+ stepTable: "\u4EFB\u52A1\u8868",
6387
+ stepTableHint: "\u9009\u62E9\u4EFB\u52A1\u5F52\u5230\u54EA\u5F20\u8868",
6388
+ stepTimeline: "\u65F6\u95F4\u7EBF",
6389
+ stepTimelineHint: "\u5173\u8054\u73B0\u6709\u65F6\u95F4\u7EBF\u6216\u65B0\u5EFA",
6390
+ stepWorkspace: "\u5DE5\u4F5C\u533A",
6391
+ stepWorkspaceHint: "\u5173\u8054\u5230\u5DE5\u4F5C\u533A\uFF08\u53EF\u9009\uFF09",
6392
+ stepConfirm: "\u786E\u8BA4",
6393
+ stepConfirmHint: "\u6838\u5BF9\u540E\u521B\u5EFA",
6394
+ stepBelong: "\u5F52\u5C5E",
6395
+ stepBelongHint: "\u65F6\u95F4\u7EBF\u3001\u5DE5\u4F5C\u533A\u4E0E\u4EFB\u52A1\u8868",
6396
+ stepPlan: "\u8BA1\u5212",
6397
+ stepPlanHint: "\u72B6\u6001\u3001\u4F18\u5148\u7EA7\u4E0E\u65E5\u671F",
6398
+ confirmHint: "\u786E\u8BA4\u65E0\u8BEF\u540E\u70B9\u300C\u521B\u5EFA\u300D\uFF1B\u521B\u5EFA\u540E\u4ECD\u53EF\u7F16\u8F91\u6807\u9898\u3001\u63CF\u8FF0\u4E0E\u5F52\u5C5E\u3002",
6399
+ createSteps: "\u521B\u5EFA\u6B65\u9AA4",
6400
+ nextStep: "\u4E0B\u4E00\u6B65",
6401
+ prevStep: "\u4E0A\u4E00\u6B65",
6402
+ workspace: "\u5DE5\u4F5C\u533A",
6121
6403
  addGroup: "\u65B0\u5EFA\u7EC4",
6122
6404
  addTable: "\u65B0\u5EFA\u8868",
6123
6405
  rename: "\u91CD\u547D\u540D",
@@ -6129,7 +6411,6 @@ var require_copy = __commonJS({
6129
6411
  nodeDescPh: "\u5199\u6E05\u8FD9\u5F20\u8868\u662F\u505A\u4EC0\u4E48\u7684\uFF0C\u4EE5\u540E\u53EF\u6309\u63CF\u8FF0\u5173\u952E\u8BCD\u68C0\u7D22\u5B9A\u4F4D",
6130
6412
  needName: "\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
6131
6413
  nodeDescSave: "\u63CF\u8FF0\u5DF2\u4FDD\u5B58",
6132
- editTitle: "\u7F16\u8F91\u4EFB\u52A1",
6133
6414
  deleteConfirm: "\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A\u8282\u70B9\u53CA\u5176\u5B50\u6811\uFF1F\u5B50\u6811\u4E2D\u7684\u4EFB\u52A1\u4F1A\u88AB\u8F6F\u5220\u9664\u3002",
6134
6415
  deleteTaskConfirm: "\u786E\u5B9A\u5220\u9664\u8FD9\u6761\u4EFB\u52A1\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002",
6135
6416
  batchDelete: "\u6279\u91CF\u5220\u9664",
@@ -6157,6 +6438,10 @@ var require_copy = __commonJS({
6157
6438
  noMore: "\u6CA1\u6709\u66F4\u591A",
6158
6439
  tagSelected: "\u5DF2\u9009",
6159
6440
  tagRemove: "\u79FB\u9664",
6441
+ tagSearchExisting: "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E",
6442
+ tagNewPlaceholder: "\u65B0\u5EFA\u6807\u7B7E\uFF0C\u56DE\u8F66\u6DFB\u52A0\uFF0C\u591A\u4E2A\u7528\u9017\u53F7\u5206\u9694",
6443
+ tagAdd: "\u6DFB\u52A0",
6444
+ tagNoPick: "\u8FD8\u6CA1\u6709\u9009\u6807\u7B7E\uFF0C\u4ECE\u4E0B\u9762\u70B9\u4E00\u4E2A\u6216\u76F4\u63A5\u8F93\u5165\u65B0\u6807\u7B7E\u540D",
6160
6445
  workspaceFilter: "\u5DE5\u4F5C\u533A\u7B5B\u9009",
6161
6446
  allWorkspaces: "\u5168\u90E8\u5DE5\u4F5C\u533A",
6162
6447
  noWorkspaces: "\u6682\u65E0\u5DE5\u4F5C\u533A",
@@ -6285,6 +6570,27 @@ var require_copy = __commonJS({
6285
6570
  create: "Create",
6286
6571
  close: "Close",
6287
6572
  taskId: "Task ID",
6573
+ stepContent: "Content",
6574
+ stepContentHint: "Title, description, schedule",
6575
+ stepTags: "Tags",
6576
+ stepTagsHint: "Search existing tags, or type a new one and press Enter",
6577
+ stepTable: "Table",
6578
+ stepTableHint: "Pick the table this task belongs to",
6579
+ stepTimeline: "Timeline",
6580
+ stepTimelineHint: "Attach to an existing timeline or create one",
6581
+ stepWorkspace: "Workspace",
6582
+ stepWorkspaceHint: "Link to a workspace (optional)",
6583
+ stepConfirm: "Review",
6584
+ stepConfirmHint: "Check before creating",
6585
+ stepBelong: "Placement",
6586
+ stepBelongHint: "Timeline, workspace, table",
6587
+ stepPlan: "Schedule",
6588
+ stepPlanHint: "Status, priority, dates",
6589
+ confirmHint: "Review the summary, then Create. Title, description and placement stay editable afterwards.",
6590
+ createSteps: "Create steps",
6591
+ nextStep: "Next",
6592
+ prevStep: "Back",
6593
+ workspace: "Workspace",
6288
6594
  addGroup: "New group",
6289
6595
  addTable: "New table",
6290
6596
  rename: "Rename",
@@ -6296,7 +6602,6 @@ var require_copy = __commonJS({
6296
6602
  nodeDescPh: "Say what this table is for; agents can find it by description keywords",
6297
6603
  needName: "Name is required",
6298
6604
  nodeDescSave: "Description saved",
6299
- editTitle: "Edit task",
6300
6605
  deleteConfirm: "Delete this node and its subtree? Tasks under it will be soft-deleted.",
6301
6606
  deleteTaskConfirm: "Delete this task? This cannot be undone.",
6302
6607
  batchDelete: "Delete",
@@ -6324,6 +6629,10 @@ var require_copy = __commonJS({
6324
6629
  noMore: "No more",
6325
6630
  tagSelected: "Selected",
6326
6631
  tagRemove: "Remove",
6632
+ tagSearchExisting: "Search existing tags",
6633
+ tagNewPlaceholder: "New tag \u2014 press Enter to add, comma for several",
6634
+ tagAdd: "Add",
6635
+ tagNoPick: "No tags picked yet \u2014 click one below or type a new name",
6327
6636
  workspaceFilter: "Filter by workspace",
6328
6637
  allWorkspaces: "All workspaces",
6329
6638
  noWorkspaces: "No workspaces",
@@ -7192,17 +7501,43 @@ var init_list = __esm({
7192
7501
  }
7193
7502
  });
7194
7503
 
7504
+ // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs
7505
+ var list_checks_exports = {};
7506
+ __export(list_checks_exports, {
7507
+ __iconData: () => __iconData19,
7508
+ default: () => ListChecks
7509
+ });
7510
+ var __iconData19, ListChecks;
7511
+ var init_list_checks = __esm({
7512
+ "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs"() {
7513
+ init_createLucideIcon();
7514
+ __iconData19 = {
7515
+ name: "list-checks",
7516
+ size: 24,
7517
+ node: [
7518
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
7519
+ ["path", { d: "M13 12h8", key: "h98zly" }],
7520
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
7521
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
7522
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
7523
+ ]
7524
+ };
7525
+ __iconData19.node;
7526
+ ListChecks = createLucideIcon(__iconData19);
7527
+ }
7528
+ });
7529
+
7195
7530
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-check-big.mjs
7196
7531
  var square_check_big_exports = {};
7197
7532
  __export(square_check_big_exports, {
7198
- __iconData: () => __iconData19,
7533
+ __iconData: () => __iconData20,
7199
7534
  default: () => SquareCheckBig
7200
7535
  });
7201
- var __iconData19, SquareCheckBig;
7536
+ var __iconData20, SquareCheckBig;
7202
7537
  var init_square_check_big = __esm({
7203
7538
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-check-big.mjs"() {
7204
7539
  init_createLucideIcon();
7205
- __iconData19 = {
7540
+ __iconData20 = {
7206
7541
  name: "square-check-big",
7207
7542
  size: 24,
7208
7543
  node: [
@@ -7214,62 +7549,62 @@ var init_square_check_big = __esm({
7214
7549
  ],
7215
7550
  aliases: ["check-square"]
7216
7551
  };
7217
- __iconData19.node;
7218
- SquareCheckBig = createLucideIcon(__iconData19);
7552
+ __iconData20.node;
7553
+ SquareCheckBig = createLucideIcon(__iconData20);
7219
7554
  }
7220
7555
  });
7221
7556
 
7222
7557
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-left.mjs
7223
7558
  var chevron_left_exports = {};
7224
7559
  __export(chevron_left_exports, {
7225
- __iconData: () => __iconData20,
7560
+ __iconData: () => __iconData21,
7226
7561
  default: () => ChevronLeft
7227
7562
  });
7228
- var __iconData20, ChevronLeft;
7563
+ var __iconData21, ChevronLeft;
7229
7564
  var init_chevron_left = __esm({
7230
7565
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-left.mjs"() {
7231
7566
  init_createLucideIcon();
7232
- __iconData20 = {
7567
+ __iconData21 = {
7233
7568
  name: "chevron-left",
7234
7569
  size: 24,
7235
7570
  node: [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]]
7236
7571
  };
7237
- __iconData20.node;
7238
- ChevronLeft = createLucideIcon(__iconData20);
7572
+ __iconData21.node;
7573
+ ChevronLeft = createLucideIcon(__iconData21);
7239
7574
  }
7240
7575
  });
7241
7576
 
7242
7577
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs
7243
7578
  var chevron_right_exports = {};
7244
7579
  __export(chevron_right_exports, {
7245
- __iconData: () => __iconData21,
7580
+ __iconData: () => __iconData22,
7246
7581
  default: () => ChevronRight
7247
7582
  });
7248
- var __iconData21, ChevronRight;
7583
+ var __iconData22, ChevronRight;
7249
7584
  var init_chevron_right = __esm({
7250
7585
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs"() {
7251
7586
  init_createLucideIcon();
7252
- __iconData21 = {
7587
+ __iconData22 = {
7253
7588
  name: "chevron-right",
7254
7589
  size: 24,
7255
7590
  node: [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]]
7256
7591
  };
7257
- __iconData21.node;
7258
- ChevronRight = createLucideIcon(__iconData21);
7592
+ __iconData22.node;
7593
+ ChevronRight = createLucideIcon(__iconData22);
7259
7594
  }
7260
7595
  });
7261
7596
 
7262
7597
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder.mjs
7263
7598
  var folder_exports = {};
7264
7599
  __export(folder_exports, {
7265
- __iconData: () => __iconData22,
7600
+ __iconData: () => __iconData23,
7266
7601
  default: () => Folder
7267
7602
  });
7268
- var __iconData22, Folder;
7603
+ var __iconData23, Folder;
7269
7604
  var init_folder = __esm({
7270
7605
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder.mjs"() {
7271
7606
  init_createLucideIcon();
7272
- __iconData22 = {
7607
+ __iconData23 = {
7273
7608
  name: "folder",
7274
7609
  size: 24,
7275
7610
  node: [
@@ -7282,22 +7617,22 @@ var init_folder = __esm({
7282
7617
  ]
7283
7618
  ]
7284
7619
  };
7285
- __iconData22.node;
7286
- Folder = createLucideIcon(__iconData22);
7620
+ __iconData23.node;
7621
+ Folder = createLucideIcon(__iconData23);
7287
7622
  }
7288
7623
  });
7289
7624
 
7290
7625
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-open.mjs
7291
7626
  var folder_open_exports = {};
7292
7627
  __export(folder_open_exports, {
7293
- __iconData: () => __iconData23,
7628
+ __iconData: () => __iconData24,
7294
7629
  default: () => FolderOpen
7295
7630
  });
7296
- var __iconData23, FolderOpen;
7631
+ var __iconData24, FolderOpen;
7297
7632
  var init_folder_open = __esm({
7298
7633
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-open.mjs"() {
7299
7634
  init_createLucideIcon();
7300
- __iconData23 = {
7635
+ __iconData24 = {
7301
7636
  name: "folder-open",
7302
7637
  size: 24,
7303
7638
  node: [
@@ -7310,22 +7645,22 @@ var init_folder_open = __esm({
7310
7645
  ]
7311
7646
  ]
7312
7647
  };
7313
- __iconData23.node;
7314
- FolderOpen = createLucideIcon(__iconData23);
7648
+ __iconData24.node;
7649
+ FolderOpen = createLucideIcon(__iconData24);
7315
7650
  }
7316
7651
  });
7317
7652
 
7318
7653
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table-2.mjs
7319
7654
  var table_2_exports = {};
7320
7655
  __export(table_2_exports, {
7321
- __iconData: () => __iconData24,
7656
+ __iconData: () => __iconData25,
7322
7657
  default: () => Table2
7323
7658
  });
7324
- var __iconData24, Table2;
7659
+ var __iconData25, Table2;
7325
7660
  var init_table_2 = __esm({
7326
7661
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table-2.mjs"() {
7327
7662
  init_createLucideIcon();
7328
- __iconData24 = {
7663
+ __iconData25 = {
7329
7664
  name: "table-2",
7330
7665
  size: 24,
7331
7666
  node: [
@@ -7334,22 +7669,22 @@ var init_table_2 = __esm({
7334
7669
  ["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }]
7335
7670
  ]
7336
7671
  };
7337
- __iconData24.node;
7338
- Table2 = createLucideIcon(__iconData24);
7672
+ __iconData25.node;
7673
+ Table2 = createLucideIcon(__iconData25);
7339
7674
  }
7340
7675
  });
7341
7676
 
7342
7677
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/house.mjs
7343
7678
  var house_exports = {};
7344
7679
  __export(house_exports, {
7345
- __iconData: () => __iconData25,
7680
+ __iconData: () => __iconData26,
7346
7681
  default: () => House
7347
7682
  });
7348
- var __iconData25, House;
7683
+ var __iconData26, House;
7349
7684
  var init_house = __esm({
7350
7685
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/house.mjs"() {
7351
7686
  init_createLucideIcon();
7352
- __iconData25 = {
7687
+ __iconData26 = {
7353
7688
  name: "house",
7354
7689
  size: 24,
7355
7690
  node: [
@@ -7364,22 +7699,22 @@ var init_house = __esm({
7364
7699
  ],
7365
7700
  aliases: ["home"]
7366
7701
  };
7367
- __iconData25.node;
7368
- House = createLucideIcon(__iconData25);
7702
+ __iconData26.node;
7703
+ House = createLucideIcon(__iconData26);
7369
7704
  }
7370
7705
  });
7371
7706
 
7372
7707
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-plus.mjs
7373
7708
  var folder_plus_exports = {};
7374
7709
  __export(folder_plus_exports, {
7375
- __iconData: () => __iconData26,
7710
+ __iconData: () => __iconData27,
7376
7711
  default: () => FolderPlus
7377
7712
  });
7378
- var __iconData26, FolderPlus;
7713
+ var __iconData27, FolderPlus;
7379
7714
  var init_folder_plus = __esm({
7380
7715
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-plus.mjs"() {
7381
7716
  init_createLucideIcon();
7382
- __iconData26 = {
7717
+ __iconData27 = {
7383
7718
  name: "folder-plus",
7384
7719
  size: 24,
7385
7720
  node: [
@@ -7394,22 +7729,22 @@ var init_folder_plus = __esm({
7394
7729
  ]
7395
7730
  ]
7396
7731
  };
7397
- __iconData26.node;
7398
- FolderPlus = createLucideIcon(__iconData26);
7732
+ __iconData27.node;
7733
+ FolderPlus = createLucideIcon(__iconData27);
7399
7734
  }
7400
7735
  });
7401
7736
 
7402
7737
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-plus.mjs
7403
7738
  var file_plus_exports = {};
7404
7739
  __export(file_plus_exports, {
7405
- __iconData: () => __iconData27,
7740
+ __iconData: () => __iconData28,
7406
7741
  default: () => FilePlus
7407
7742
  });
7408
- var __iconData27, FilePlus;
7743
+ var __iconData28, FilePlus;
7409
7744
  var init_file_plus = __esm({
7410
7745
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-plus.mjs"() {
7411
7746
  init_createLucideIcon();
7412
- __iconData27 = {
7747
+ __iconData28 = {
7413
7748
  name: "file-plus",
7414
7749
  size: 24,
7415
7750
  node: [
@@ -7425,22 +7760,22 @@ var init_file_plus = __esm({
7425
7760
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
7426
7761
  ]
7427
7762
  };
7428
- __iconData27.node;
7429
- FilePlus = createLucideIcon(__iconData27);
7763
+ __iconData28.node;
7764
+ FilePlus = createLucideIcon(__iconData28);
7430
7765
  }
7431
7766
  });
7432
7767
 
7433
7768
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/pencil.mjs
7434
7769
  var pencil_exports = {};
7435
7770
  __export(pencil_exports, {
7436
- __iconData: () => __iconData28,
7771
+ __iconData: () => __iconData29,
7437
7772
  default: () => Pencil
7438
7773
  });
7439
- var __iconData28, Pencil;
7774
+ var __iconData29, Pencil;
7440
7775
  var init_pencil = __esm({
7441
7776
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/pencil.mjs"() {
7442
7777
  init_createLucideIcon();
7443
- __iconData28 = {
7778
+ __iconData29 = {
7444
7779
  name: "pencil",
7445
7780
  size: 24,
7446
7781
  node: [
@@ -7454,17 +7789,17 @@ var init_pencil = __esm({
7454
7789
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
7455
7790
  ]
7456
7791
  };
7457
- __iconData28.node;
7458
- Pencil = createLucideIcon(__iconData28);
7792
+ __iconData29.node;
7793
+ Pencil = createLucideIcon(__iconData29);
7459
7794
  }
7460
7795
  });
7461
7796
 
7462
7797
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash.mjs
7463
- var __iconData29, Trash;
7798
+ var __iconData30, Trash;
7464
7799
  var init_trash = __esm({
7465
7800
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash.mjs"() {
7466
7801
  init_createLucideIcon();
7467
- __iconData29 = {
7802
+ __iconData30 = {
7468
7803
  name: "trash",
7469
7804
  size: 24,
7470
7805
  node: [
@@ -7476,8 +7811,8 @@ var init_trash = __esm({
7476
7811
  ],
7477
7812
  aliases: ["trash-2"]
7478
7813
  };
7479
- __iconData29.node;
7480
- Trash = createLucideIcon(__iconData29);
7814
+ __iconData30.node;
7815
+ Trash = createLucideIcon(__iconData30);
7481
7816
  }
7482
7817
  });
7483
7818
 
@@ -7495,14 +7830,14 @@ var init_trash_2 = __esm({
7495
7830
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/x.mjs
7496
7831
  var x_exports = {};
7497
7832
  __export(x_exports, {
7498
- __iconData: () => __iconData30,
7833
+ __iconData: () => __iconData31,
7499
7834
  default: () => X
7500
7835
  });
7501
- var __iconData30, X;
7836
+ var __iconData31, X;
7502
7837
  var init_x = __esm({
7503
7838
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/x.mjs"() {
7504
7839
  init_createLucideIcon();
7505
- __iconData30 = {
7840
+ __iconData31 = {
7506
7841
  name: "x",
7507
7842
  size: 24,
7508
7843
  node: [
@@ -7510,42 +7845,42 @@ var init_x = __esm({
7510
7845
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
7511
7846
  ]
7512
7847
  };
7513
- __iconData30.node;
7514
- X = createLucideIcon(__iconData30);
7848
+ __iconData31.node;
7849
+ X = createLucideIcon(__iconData31);
7515
7850
  }
7516
7851
  });
7517
7852
 
7518
7853
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-down.mjs
7519
7854
  var chevron_down_exports = {};
7520
7855
  __export(chevron_down_exports, {
7521
- __iconData: () => __iconData31,
7856
+ __iconData: () => __iconData32,
7522
7857
  default: () => ChevronDown
7523
7858
  });
7524
- var __iconData31, ChevronDown;
7859
+ var __iconData32, ChevronDown;
7525
7860
  var init_chevron_down = __esm({
7526
7861
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-down.mjs"() {
7527
7862
  init_createLucideIcon();
7528
- __iconData31 = {
7863
+ __iconData32 = {
7529
7864
  name: "chevron-down",
7530
7865
  size: 24,
7531
7866
  node: [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]
7532
7867
  };
7533
- __iconData31.node;
7534
- ChevronDown = createLucideIcon(__iconData31);
7868
+ __iconData32.node;
7869
+ ChevronDown = createLucideIcon(__iconData32);
7535
7870
  }
7536
7871
  });
7537
7872
 
7538
7873
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/tag.mjs
7539
7874
  var tag_exports = {};
7540
7875
  __export(tag_exports, {
7541
- __iconData: () => __iconData32,
7876
+ __iconData: () => __iconData33,
7542
7877
  default: () => Tag
7543
7878
  });
7544
- var __iconData32, Tag;
7879
+ var __iconData33, Tag;
7545
7880
  var init_tag = __esm({
7546
7881
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/tag.mjs"() {
7547
7882
  init_createLucideIcon();
7548
- __iconData32 = {
7883
+ __iconData33 = {
7549
7884
  name: "tag",
7550
7885
  size: 24,
7551
7886
  node: [
@@ -7559,22 +7894,22 @@ var init_tag = __esm({
7559
7894
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
7560
7895
  ]
7561
7896
  };
7562
- __iconData32.node;
7563
- Tag = createLucideIcon(__iconData32);
7897
+ __iconData33.node;
7898
+ Tag = createLucideIcon(__iconData33);
7564
7899
  }
7565
7900
  });
7566
7901
 
7567
7902
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/clock.mjs
7568
7903
  var clock_exports = {};
7569
7904
  __export(clock_exports, {
7570
- __iconData: () => __iconData33,
7905
+ __iconData: () => __iconData34,
7571
7906
  default: () => Clock
7572
7907
  });
7573
- var __iconData33, Clock;
7908
+ var __iconData34, Clock;
7574
7909
  var init_clock = __esm({
7575
7910
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/clock.mjs"() {
7576
7911
  init_createLucideIcon();
7577
- __iconData33 = {
7912
+ __iconData34 = {
7578
7913
  name: "clock",
7579
7914
  size: 24,
7580
7915
  node: [
@@ -7582,22 +7917,22 @@ var init_clock = __esm({
7582
7917
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
7583
7918
  ]
7584
7919
  };
7585
- __iconData33.node;
7586
- Clock = createLucideIcon(__iconData33);
7920
+ __iconData34.node;
7921
+ Clock = createLucideIcon(__iconData34);
7587
7922
  }
7588
7923
  });
7589
7924
 
7590
7925
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.mjs
7591
7926
  var refresh_cw_exports = {};
7592
7927
  __export(refresh_cw_exports, {
7593
- __iconData: () => __iconData34,
7928
+ __iconData: () => __iconData35,
7594
7929
  default: () => RefreshCw
7595
7930
  });
7596
- var __iconData34, RefreshCw;
7931
+ var __iconData35, RefreshCw;
7597
7932
  var init_refresh_cw = __esm({
7598
7933
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.mjs"() {
7599
7934
  init_createLucideIcon();
7600
- __iconData34 = {
7935
+ __iconData35 = {
7601
7936
  name: "refresh-cw",
7602
7937
  size: 24,
7603
7938
  node: [
@@ -7607,8 +7942,8 @@ var init_refresh_cw = __esm({
7607
7942
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
7608
7943
  ]
7609
7944
  };
7610
- __iconData34.node;
7611
- RefreshCw = createLucideIcon(__iconData34);
7945
+ __iconData35.node;
7946
+ RefreshCw = createLucideIcon(__iconData35);
7612
7947
  }
7613
7948
  });
7614
7949
 
@@ -7636,6 +7971,7 @@ var require_icons2 = __commonJS({
7636
7971
  search: (init_search(), __toCommonJS(search_exports)).default,
7637
7972
  grid: (init_layout_grid(), __toCommonJS(layout_grid_exports)).default,
7638
7973
  list: (init_list(), __toCommonJS(list_exports)).default,
7974
+ "list-checks": (init_list_checks(), __toCommonJS(list_checks_exports)).default,
7639
7975
  select: (init_square_check_big(), __toCommonJS(square_check_big_exports)).default,
7640
7976
  left: (init_chevron_left(), __toCommonJS(chevron_left_exports)).default,
7641
7977
  right: (init_chevron_right(), __toCommonJS(chevron_right_exports)).default,
@@ -7652,6 +7988,7 @@ var require_icons2 = __commonJS({
7652
7988
  tag: (init_tag(), __toCommonJS(tag_exports)).default,
7653
7989
  clock: (init_clock(), __toCommonJS(clock_exports)).default,
7654
7990
  refresh: (init_refresh_cw(), __toCommonJS(refresh_cw_exports)).default
7991
+ // 「原邮件」回链:从邮件建出来的任务要能跳回去看一眼原文。
7655
7992
  }, {});
7656
7993
  module2.exports = { ICONS: set.ICONS, Icon: set.Icon };
7657
7994
  }
@@ -7690,8 +8027,9 @@ var require_overlay = __commonJS({
7690
8027
  var autoFocusDialog = opts.autoFocusDialog !== false;
7691
8028
  var focusableSelector = opts.focusableSelector || FOCUSABLE;
7692
8029
  function Modal(props) {
7693
- var ref = React.useRef(null);
7694
- React.useEffect(function() {
8030
+ var R = props.React || React;
8031
+ var ref = R.useRef(null);
8032
+ R.useEffect(function() {
7695
8033
  var previous = typeof document !== "undefined" ? document.activeElement : null;
7696
8034
  var focusIt = props.autoFocus !== void 0 ? props.autoFocus : autoFocusDialog;
7697
8035
  if (focusIt && ref.current) ref.current.focus();
@@ -8763,12 +9101,311 @@ var require_filter_checklist_styles = __commonJS({
8763
9101
  }
8764
9102
  });
8765
9103
 
8766
- // packages/addons/tasks/client/ui/styles.cjs
8767
- var require_styles = __commonJS({
8768
- "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
9104
+ // packages/addons/lib/stepper.cjs
9105
+ var require_stepper = __commonJS({
9106
+ "packages/addons/lib/stepper.cjs"(exports2, module2) {
8769
9107
  "use strict";
8770
- module2.exports = [
8771
- ".wbt-crumb{min-width:0;max-width:100%}.wbt-crumb button{min-width:0;max-width:100%;overflow-wrap:anywhere}.wbt-path button span{min-width:0;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}.wbt-modal{box-sizing:border-box}.wbt-field>span,.wbt-ownership-preview{overflow-wrap:anywhere}.wbt-tn .wbt-input{max-width:100%;box-sizing:border-box}.wbt-table-picker .wbt-bpick{box-sizing:border-box}",
9108
+ function stepState(index, current, maxVisited) {
9109
+ if (index === current) return "current";
9110
+ if (index < current) return "done";
9111
+ if (index <= maxVisited) return "visited";
9112
+ return "todo";
9113
+ }
9114
+ function Steps(props) {
9115
+ var h = props.h;
9116
+ var steps = props.steps || [];
9117
+ var current = props.current || 0;
9118
+ var maxVisited = props.maxVisited === void 0 ? current : props.maxVisited;
9119
+ var invalid = props.invalid || {};
9120
+ var disabled = !!props.disabled;
9121
+ var label = props.label || "\u6B65\u9AA4";
9122
+ return h(
9123
+ "nav",
9124
+ { className: "wbctl-steps" + (props.className ? " " + props.className : ""), "aria-label": label },
9125
+ h(
9126
+ "ol",
9127
+ { className: "wbctl-step-list" },
9128
+ steps.map(function(step, index) {
9129
+ var state = stepState(index, current, maxVisited);
9130
+ var canJump = !disabled && typeof props.onJump === "function" && state !== "current" && state !== "todo";
9131
+ var isInvalid = !!invalid[index] || !!invalid[step.key];
9132
+ return h(
9133
+ "li",
9134
+ { key: step.key || index, className: "wbctl-step-item" },
9135
+ h(
9136
+ "button",
9137
+ {
9138
+ type: "button",
9139
+ className: "wbctl-step",
9140
+ "data-state": state,
9141
+ "data-invalid": isInvalid ? "true" : null,
9142
+ "aria-current": state === "current" ? "step" : void 0,
9143
+ "aria-label": index + 1 + " \xB7 " + step.label + (state === "done" ? "\uFF08\u5DF2\u5B8C\u6210\uFF09" : ""),
9144
+ disabled: disabled || state === "todo",
9145
+ title: step.hint || "",
9146
+ onClick: function() {
9147
+ if (canJump) props.onJump(index);
9148
+ }
9149
+ },
9150
+ h("span", { className: "wbctl-step-index", "aria-hidden": "true" }, state === "done" ? "\u2713" : String(index + 1)),
9151
+ h("span", { className: "wbctl-step-label" }, step.label),
9152
+ step.hint ? h("span", { className: "wbctl-step-hint" }, step.hint) : null,
9153
+ step.optional ? h("span", { className: "wbctl-step-opt" }, "\u53EF\u9009") : null
9154
+ )
9155
+ );
9156
+ })
9157
+ )
9158
+ );
9159
+ }
9160
+ var STYLES = [
9161
+ ".wbctl-steps{display:block;min-width:0}",
9162
+ ".wbctl-step-list{display:flex;align-items:stretch;gap:6px;list-style:none;margin:0 0 14px;padding:0;min-width:0}",
9163
+ ".wbctl-step-item{display:flex;flex:1 1 0;min-width:0}",
9164
+ ".wbctl-step{display:flex;align-items:center;gap:7px;flex:1 1 auto;min-width:0;padding:7px 9px;border:1px solid var(--wb-line,var(--wb-border));border-radius:10px;background:transparent;color:var(--wb-muted,inherit);font:inherit;font-size:12px;line-height:1.35;text-align:left;cursor:default;transition:background .14s ease,border-color .14s ease,color .14s ease}",
9165
+ ".wbctl-step[data-state=done],.wbctl-step[data-state=visited]{color:inherit;cursor:pointer}",
9166
+ ".wbctl-step[data-state=done]{border-color:color-mix(in oklab,var(--wb-ok,var(--wb-accent,#2563eb)) 36%,var(--wb-border))}",
9167
+ ".wbctl-step[data-state=current]{border-color:color-mix(in oklab,var(--wb-accent,#2563eb) 58%,var(--wb-border));background:color-mix(in oklab,var(--wb-accent,#2563eb) 8%,transparent);color:inherit;font-weight:600}",
9168
+ ".wbctl-step[data-state=visited]:hover,.wbctl-step[data-state=done]:hover{background:color-mix(in oklab,currentColor 7%,transparent)}",
9169
+ ".wbctl-step[data-invalid=true]{border-color:var(--wb-danger,#d33)}",
9170
+ ".wbctl-step:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
9171
+ ".wbctl-step:disabled{cursor:default;opacity:.72}",
9172
+ ".wbctl-step-index{display:inline-flex;align-items:center;justify-content:center;flex:none;width:20px;height:20px;border-radius:50%;font-size:11px;font-variant-numeric:tabular-nums;background:color-mix(in oklab,currentColor 15%,transparent)}",
9173
+ ".wbctl-step[data-state=current] .wbctl-step-index{background:var(--wb-accent,#2563eb);color:var(--wb-on-accent,#fff)}",
9174
+ ".wbctl-step[data-state=done] .wbctl-step-index{background:color-mix(in oklab,var(--wb-ok,var(--wb-accent,#2563eb)) 20%,transparent);color:var(--wb-ok,var(--wb-accent,#2563eb))}",
9175
+ ".wbctl-step-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
9176
+ ".wbctl-step-hint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
9177
+ ".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
9178
+ "@media (max-width:760px){.wbctl-step{padding:6px 7px;font-size:11.5px}.wbctl-step-hint,.wbctl-step-opt{display:none}.wbctl-step-index{width:18px;height:18px;font-size:10px}}",
9179
+ "@media (max-width:520px){.wbctl-step-list{gap:4px}.wbctl-step-label{white-space:normal}.wbctl-step{gap:5px}}",
9180
+ "@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
9181
+ ];
9182
+ module2.exports = { Steps, stepState, styles: STYLES };
9183
+ }
9184
+ });
9185
+
9186
+ // packages/addons/lib/staged-dialog.cjs
9187
+ var require_staged_dialog = __commonJS({
9188
+ "packages/addons/lib/staged-dialog.cjs"(exports2, module2) {
9189
+ "use strict";
9190
+ var defaultReact = require("react");
9191
+ var overlayFactory = require_overlay();
9192
+ var stepper = require_stepper();
9193
+ function validateStep(step) {
9194
+ if (!step || typeof step.validate !== "function") return "";
9195
+ var message = step.validate();
9196
+ return message ? String(message) : "";
9197
+ }
9198
+ function firstFailing(steps) {
9199
+ var list = steps || [];
9200
+ for (var i = 0; i < list.length; i += 1) {
9201
+ var message = validateStep(list[i]);
9202
+ if (message) return { index: i, key: list[i] && list[i].key, message };
9203
+ }
9204
+ return null;
9205
+ }
9206
+ function createStagedDialog(options) {
9207
+ var opts = options || {};
9208
+ var React = opts.React || defaultReact;
9209
+ var h = React.createElement;
9210
+ var dialogClass = ((opts.dialogClass || "") + " wbctl-dialog").trim();
9211
+ var Overlay = overlayFactory(
9212
+ Object.assign({}, opts, {
9213
+ React,
9214
+ dialogClass,
9215
+ // 首焦点由外壳送进对话框,字段由 focusStep 负责,避免打开瞬间落进第一个输入框。
9216
+ autoFocusDialog: opts.autoFocusDialog !== false
9217
+ })
9218
+ );
9219
+ function StagedDialog(props) {
9220
+ var R = props.React || React;
9221
+ var steps = props.steps || [];
9222
+ var count = steps.length;
9223
+ var busy = !!props.submitting || !!props.busy;
9224
+ var indexState = R.useState(props.initialStep || 0);
9225
+ var rawIndex = indexState[0];
9226
+ var setIndex = indexState[1];
9227
+ var index = count === 0 ? 0 : Math.min(Math.max(rawIndex, 0), count - 1);
9228
+ var visitedState = R.useState(props.initialStep || 0);
9229
+ var maxVisited = count === 0 ? 0 : Math.min(Math.max(visitedState[0], index), count - 1);
9230
+ var setMaxVisited = visitedState[1];
9231
+ var errorState = R.useState("");
9232
+ var stepError = errorState[0];
9233
+ var setStepError = errorState[1];
9234
+ var invalidState = R.useState({});
9235
+ var invalid = invalidState[0];
9236
+ var setInvalid = invalidState[1];
9237
+ var bodyRef = R.useRef(null);
9238
+ var mounted = R.useRef(true);
9239
+ function runValidate(step) {
9240
+ return validateStep(step);
9241
+ }
9242
+ function markInvalid(i, bad) {
9243
+ setInvalid(function(prev) {
9244
+ var next2 = Object.assign({}, prev);
9245
+ if (bad) next2[i] = true;
9246
+ else delete next2[i];
9247
+ return next2;
9248
+ });
9249
+ }
9250
+ function focusBody() {
9251
+ var el = bodyRef.current;
9252
+ if (el && typeof el.focus === "function") el.focus();
9253
+ }
9254
+ R.useEffect(
9255
+ function() {
9256
+ if (!mounted.current) return;
9257
+ focusBody();
9258
+ },
9259
+ [index]
9260
+ );
9261
+ R.useEffect(function() {
9262
+ mounted.current = true;
9263
+ return function() {
9264
+ mounted.current = false;
9265
+ };
9266
+ }, []);
9267
+ function goTo(i) {
9268
+ if (busy || i < 0 || i >= count) return;
9269
+ setIndex(i);
9270
+ if (i > maxVisited) setMaxVisited(i);
9271
+ setStepError("");
9272
+ }
9273
+ function fail(i, message) {
9274
+ markInvalid(i, true);
9275
+ goTo(i);
9276
+ setStepError(message);
9277
+ focusBody();
9278
+ }
9279
+ function next() {
9280
+ if (busy) return;
9281
+ var message = runValidate(steps[index]);
9282
+ if (message) {
9283
+ fail(index, message);
9284
+ return;
9285
+ }
9286
+ markInvalid(index, false);
9287
+ goTo(Math.min(index + 1, count - 1));
9288
+ }
9289
+ function back() {
9290
+ if (busy || index === 0) return;
9291
+ goTo(index - 1);
9292
+ }
9293
+ function jump(i) {
9294
+ if (busy || i > maxVisited) return;
9295
+ goTo(i);
9296
+ }
9297
+ function submit() {
9298
+ if (busy) return;
9299
+ var bad = firstFailing(steps);
9300
+ if (bad) {
9301
+ fail(bad.index, bad.message);
9302
+ return;
9303
+ }
9304
+ for (var i = 0; i < count; i++) markInvalid(i, false);
9305
+ setStepError("");
9306
+ if (typeof props.onSubmit === "function") props.onSubmit();
9307
+ }
9308
+ function cancel() {
9309
+ if (busy) return;
9310
+ if (typeof props.onClose === "function") props.onClose();
9311
+ }
9312
+ var current = steps[index];
9313
+ var isLast = index >= count - 1;
9314
+ var saveText = props.submitText || "\u4FDD\u5B58";
9315
+ var shownError = stepError || props.error || "";
9316
+ return h(
9317
+ Overlay,
9318
+ props,
9319
+ count > 1 ? h(stepper.Steps, {
9320
+ h,
9321
+ steps: steps.map(function(step) {
9322
+ return { key: step.key, label: step.label, hint: step.hint, optional: step.optional };
9323
+ }),
9324
+ current: index,
9325
+ maxVisited,
9326
+ onJump: jump,
9327
+ invalid,
9328
+ disabled: busy,
9329
+ label: props.stepsLabel || "\u521B\u5EFA\u6B65\u9AA4"
9330
+ }) : null,
9331
+ h(
9332
+ "div",
9333
+ {
9334
+ className: "wbctl-dialog-body" + (props.bodyClassName ? " " + props.bodyClassName : ""),
9335
+ ref: bodyRef,
9336
+ tabIndex: -1
9337
+ },
9338
+ current ? current.render(h, props) : null
9339
+ ),
9340
+ props.footerExtra || null,
9341
+ shownError ? h("div", { className: "wbctl-dialog-err", role: "alert" }, shownError) : null,
9342
+ h(
9343
+ "div",
9344
+ { className: "wbctl-dialog-foot" },
9345
+ count > 1 ? h("span", { className: "wbctl-dialog-progress" }, index + 1 + " / " + count) : null,
9346
+ props.footerNote ? h("span", { className: "wbctl-dialog-note" }, props.footerNote) : null,
9347
+ h("span", { className: "wbctl-dialog-spacer" }),
9348
+ index > 0 ? h(
9349
+ "button",
9350
+ { type: "button", className: "wbctl-btn", onClick: back, disabled: busy },
9351
+ props.backText || "\u4E0A\u4E00\u6B65"
9352
+ ) : null,
9353
+ h("button", { type: "button", className: "wbctl-btn", onClick: cancel, disabled: busy }, props.cancelText || "\u53D6\u6D88"),
9354
+ h(
9355
+ "button",
9356
+ {
9357
+ type: "button",
9358
+ className: "wbctl-btn wbctl-btn-p",
9359
+ onClick: isLast ? submit : next,
9360
+ // submitDisabled 只作用于末步的保存:插件据此把「结构性不合法」(JSON 语法、无可选 action)
9361
+ // 提前反映成禁用态,避免用户点到保存才被弹回第一步。
9362
+ disabled: busy || isLast && !!props.submitDisabled
9363
+ },
9364
+ busy ? saveText + "\u4E2D\u2026" : isLast ? saveText : props.nextText || "\u4E0B\u4E00\u6B65"
9365
+ )
9366
+ )
9367
+ );
9368
+ }
9369
+ StagedDialog.displayName = opts.displayName || "StagedDialog";
9370
+ return StagedDialog;
9371
+ }
9372
+ var STYLES = [
9373
+ // 宽表单:内容多时给足横向空间,窄屏留 16px 边距后铺满。
9374
+ ".wbctl-dialog{width:min(880px,calc(100vw - 32px));max-height:min(92vh,760px);display:flex;flex-direction:column;overflow:hidden}",
9375
+ ".wbctl-dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px 2px 10px;outline:none}",
9376
+ ".wbctl-dialog-body:focus-visible{outline:none}",
9377
+ ".wbctl-dialog-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-top:10px;margin-top:10px;border-top:1px solid var(--wb-line,var(--wb-border))}",
9378
+ ".wbctl-dialog-progress{font-size:11.5px;color:var(--wb-muted,#666);font-variant-numeric:tabular-nums}",
9379
+ ".wbctl-dialog-note{font-size:11.5px;color:var(--wb-muted,#666);min-width:0}",
9380
+ ".wbctl-dialog-spacer{flex:1 1 auto}",
9381
+ ".wbctl-dialog-err{margin-top:8px;padding:7px 10px;border-radius:8px;border:1px solid color-mix(in oklab,var(--wb-danger,#d33) 45%,transparent);background:color-mix(in oklab,var(--wb-danger,#d33) 8%,transparent);color:var(--wb-danger,#d33);font-size:12px}",
9382
+ ".wbctl-btn{padding:6px 14px;border:1px solid var(--wb-border,#d0d5dd);border-radius:8px;background:var(--wb-card,#fff);color:inherit;font:inherit;font-size:12.5px;cursor:pointer}",
9383
+ ".wbctl-btn:hover:not(:disabled){background:color-mix(in oklab,currentColor 7%,transparent)}",
9384
+ ".wbctl-btn:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
9385
+ ".wbctl-btn:disabled{opacity:.55;cursor:default}",
9386
+ ".wbctl-btn.wbctl-btn-p{background:var(--wb-accent,#2563eb);border-color:transparent;color:var(--wb-on-accent,#fff)}",
9387
+ ".wbctl-btn.wbctl-btn-p:hover:not(:disabled){background:color-mix(in oklab,var(--wb-accent,#2563eb) 86%,#000)}",
9388
+ // 确认步:键值对清单,各插件共用,避免再各写一套只读摘要。\n ".wbctl-review{display:flex;flex-direction:column;border:1px solid var(--wb-line,var(--wb-border));border-radius:10px;overflow:hidden}",\n ".wbctl-review-row{display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px;padding:8px 12px;font-size:12.5px;background:var(--wb-surface,transparent)}",\n ".wbctl-review-row+.wbctl-review-row{border-top:1px solid var(--wb-line,var(--wb-border))}",\n ".wbctl-review-k{color:var(--wb-muted,inherit);font-size:11.5px;line-height:1.6}",\n ".wbctl-review-v{min-width:0;word-break:break-word;line-height:1.6}",\n ".wbctl-note{margin:10px 0 0;font-size:11.5px;color:var(--wb-muted,inherit)}",\n // 两列字段布局:内容多的弹窗不再单列拉长,窄屏回落单列。
9389
+ ".wbctl-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}",
9390
+ ".wbctl-form>.full{grid-column:1/-1}",
9391
+ "@media (max-width:760px){.wbctl-dialog{width:calc(100vw - 16px);max-height:94vh}.wbctl-form{grid-template-columns:1fr}.wbctl-form>.full{grid-column:auto}}",
9392
+ "@media (prefers-reduced-motion:reduce){.wbctl-btn{transition:none}}"
9393
+ ];
9394
+ module2.exports = {
9395
+ createStagedDialog,
9396
+ validateStep,
9397
+ firstFailing,
9398
+ styles: STYLES
9399
+ };
9400
+ }
9401
+ });
9402
+
9403
+ // packages/addons/tasks/client/ui/styles.cjs
9404
+ var require_styles = __commonJS({
9405
+ "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
9406
+ "use strict";
9407
+ module2.exports = [
9408
+ ".wbt-crumb{min-width:0;max-width:100%}.wbt-crumb button{min-width:0;max-width:100%;overflow-wrap:anywhere}.wbt-path button span{min-width:0;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}.wbt-modal{box-sizing:border-box}.wbt-field>span,.wbt-ownership-preview{overflow-wrap:anywhere}.wbt-tn .wbt-input{max-width:100%;box-sizing:border-box}.wbt-table-picker .wbt-bpick{box-sizing:border-box}",
8772
9409
  ".wbt-date-clear{border:0;background:transparent;color:inherit;padding:5px;cursor:pointer;border-radius:4px}.wbt-date-clear:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:1px}",
8773
9410
  ".wbt-body-section{margin-top:5px}.wbt-body-section .wbt-desc,.wbt-body-section .wbt-review{margin-top:0}",
8774
9411
  ".wbt-root{--wbt-hit-bg:#ffe4e6;--wbt-hit-fg:#881337}.wbt-root mark.wbt-hit{background:var(--wbt-hit-bg);color:var(--wbt-hit-fg);border-radius:2px;padding:0;font:inherit;box-decoration-break:clone;-webkit-box-decoration-break:clone}",
@@ -8796,7 +9433,7 @@ var require_styles = __commonJS({
8796
9433
  ".wbt-body{display:flex;gap:14px;align-items:stretch;min-height:0;flex:1;overflow:hidden}",
8797
9434
  ".wbt-filter-panel{flex:0 0 248px;width:248px;min-width:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--wbt-line);border-radius:10px;background:var(--wbt-bg);box-sizing:border-box;padding:12px}",
8798
9435
  ".wbt-filter-content{display:flex;flex-direction:column;gap:12px}.wbt-filter-toggle{display:none}.wbt-filter-group{display:flex;flex-direction:column;gap:8px;min-width:0;margin:0;padding:10px 0;border:0;border-bottom:1px solid var(--wbt-line)}.wbt-filter-group legend{font-weight:600;padding:0}.wbt-filter-search{display:flex;gap:4px}.wbt-filter-search input{width:100%;min-width:0}.wbt-filter-panel .wbt-check{white-space:normal}.wbt-filter-panel .wbt-tagmenu{position:static;width:100%;box-sizing:border-box;max-height:240px}.wbt-filter-panel .wbt-tagfilter{flex-wrap:wrap}.wbt-filter-panel input:disabled{opacity:.45;cursor:not-allowed}.wbt-filter-panel .wbt-mhint{margin:0;line-height:1.6}.wbt-filter-panel .wbt-field input{width:100%;box-sizing:border-box}",
8799
- ".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}",
9436
+ ".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:flex-start;gap:4px;min-width:0}.wbt-limit-fields .wbctl-num{flex:1 1 0;min-width:0;width:0}.wbt-limit-fields .wbctl-num-box{width:100%}.wbt-limit-fields .wbctl-num-input{width:100%;box-sizing:border-box;text-align:center;padding:6px 4px;border-radius:8px;border-color:var(--wbt-line);background-color:var(--wbt-surface)}.wbt-limit-fields>span{flex:none;opacity:.55;font-size:11.5px}.wbt-limit-fields .wbt-limit-join{padding-top:7px}.wbt-limit-fields .wbt-limit-clear{margin-top:1px}.wbt-limit-clear{flex:none;padding:2px 6px;line-height:1.2}.wbt-limit-fields .wbctl-num-err{overflow-wrap:anywhere}.wbt-limit-unit{font-size:11px;opacity:.55;overflow-wrap:anywhere;min-width:0}",
8800
9437
  ".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}",
8801
9438
  ".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}",
8802
9439
  ".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)}",
@@ -8971,7 +9608,16 @@ var require_styles = __commonJS({
8971
9608
  ".wbt-create-tl .wbt-timeline-picker{display:flex;flex-direction:column;gap:6px;min-width:0}",
8972
9609
  ".wbt-create-tl .wbt-picker-list{max-height:180px;scrollbar-gutter:stable}",
8973
9610
  ".wbt-create-tl .wbt-timeline-pager{margin-top:4px;font-size:11.5px}",
8974
- ".wbt-field>span{opacity:.62;font-size:11.5px}",
9611
+ // 标签步:已选 chip + 共享勾选清单 + 新标签输入,清单限高内部滚动。
9612
+ ".wbt-tagpick{display:flex;flex-direction:column;gap:8px;min-width:0}",
9613
+ ".wbt-tagchips{display:flex;flex-wrap:wrap;gap:6px}",
9614
+ ".wbt-tagchip{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border:1px solid var(--wbt-line);border-radius:999px;background:color-mix(in oklab,var(--wbt-accent) 10%,transparent);color:inherit;font:inherit;font-size:12px;cursor:pointer}",
9615
+ ".wbt-tagchip:hover{border-color:var(--wbt-accent)}",
9616
+ ".wbt-tagchip-x{opacity:.55;font-size:12px}",
9617
+ ".wbt-tagpick .wbck-list{max-height:220px}",
9618
+ ".wbt-tagnew{display:flex;gap:8px;align-items:center}",
9619
+ ".wbt-tagnew .wbt-input{flex:1;min-width:0}",
9620
+ ".wbt-field>span{opacity:.62;font-size:11.5px}.wbt-field>span.wbctl-num{opacity:1;font-size:12px;align-self:stretch}.wbt-field .wbt-difficulty-num{width:110px}",
8975
9621
  ".wbt-modal-foot{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:2px}",
8976
9622
  // 预览面板:只让内容区滚动,头部标题与右上角 × 固定不动(滚动壳限定在 .wbt-preview,不影响其它弹窗)。
8977
9623
  ".wbt-preview{overflow:hidden}",
@@ -9030,8 +9676,23 @@ var require_styles = __commonJS({
9030
9676
  ".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted,#fff);background:var(--dsw-alias-state-error-primary,#e5484d);border-color:transparent}",
9031
9677
  "@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}}",
9032
9678
  "@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}}",
9033
- "@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}}"
9034
- ].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt")).join("\n");
9679
+ "@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}}",
9680
+ // ── 插槽贡献:渲染在别的插件的界面里(如邮件详情动作条) ──
9681
+ // 那里没有 .wbt-root,--wbt-* 变量不存在,所以每个变量都带主题变量兜底。
9682
+ ".wbt-metazone:empty{display:none}",
9683
+ ".wbtx-slot{position:relative;display:inline-flex;align-items:center;gap:6px}",
9684
+ ".wbtx-slot-btn{font-size:12.5px;white-space:nowrap}",
9685
+ ".wbtx-slot-btn[aria-expanded=true]{border-color:var(--wbt-accent,var(--wb-accent));color:var(--wbt-accent,var(--wb-accent))}",
9686
+ ".wbtx-slot-panel{position:absolute;top:calc(100% + 6px);right:0;z-index:40;display:flex;flex-direction:column;gap:8px;width:264px;padding:10px;border-radius:10px;border:1px solid var(--wbt-line,var(--wb-border));background:var(--dsw-alias-bg-layer-1,var(--wb-card,transparent));box-shadow:0 12px 28px color-mix(in oklab,var(--wbt-line,var(--wb-border)) 60%,transparent);text-align:left}",
9687
+ ".wbtx-slot-row{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--wbt-muted,var(--wb-muted))}",
9688
+ ".wbtx-slot-input{width:100%;box-sizing:border-box;font-size:12.5px}",
9689
+ ".wbtx-slot-muted{font-size:12px;color:var(--wbt-muted,var(--wb-muted))}",
9690
+ ".wbtx-slot-foot{display:flex;justify-content:flex-end;gap:8px}",
9691
+ ".wbtx-slot-done{display:inline-flex;align-items:center;gap:8px;font-size:12px}",
9692
+ ".wbtx-slot-note{color:var(--wbt-muted,var(--wb-muted))}",
9693
+ ".wbtx-slot-link{border:0;background:transparent;padding:0;font:inherit;font-size:12px;color:var(--wbt-accent,var(--wb-accent));cursor:pointer;text-decoration:underline}",
9694
+ ".wbt-mailback{font-size:11.5px;padding:2px 7px}"
9695
+ ].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt"), require_switch().styles, require_number_field().styles, require_stepper().styles, require_staged_dialog().styles).join("\n");
9035
9696
  }
9036
9697
  });
9037
9698
 
@@ -9048,12 +9709,12 @@ var require_timeline_styles = __commonJS({
9048
9709
  ".wbt-timeline-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}",
9049
9710
  ".wbt-timeline-columns{display:grid;grid-template-columns:minmax(240px,32%) minmax(0,1fr);gap:12px;align-items:start}",
9050
9711
  ".wbt-timeline-left,.wbt-timeline-right{min-width:0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);padding:12px}",
9051
- ".wbt-timeline-single{display:flex;align-items:center;gap:8px;margin:0;font-size:13px;white-space:nowrap}.wbt-timeline-search input{min-width:0;flex:1}",
9712
+ ".wbt-timeline-search input{min-width:0;flex:1}",
9052
9713
  ".wbt-timeline-list{max-height:840px;overflow:auto;overscroll-behavior:contain}.wbt-timeline-left>.wbt-timeline-list,.wbt-timeline-left>.wbt-err{margin-top:2px}.wbt-timeline-view .wbt-timeline-option{position:relative;box-sizing:border-box;min-height:56px;padding:10px 12px;border:0;border-bottom:1px solid var(--wbt-line);border-radius:var(--wb-radius-sm,6px);display:flex;flex-direction:column;gap:4px;cursor:pointer;color:inherit;background:transparent;background-image:none}",
9053
9714
  ".wbt-timeline-option-title{display:flex;gap:8px;align-items:center;min-width:0}.wbt-timeline-option-title strong{font-size:13px;font-weight:560;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.wbt-timeline-option>span{font-size:11.5px;opacity:.6;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}",
9054
9715
  ".wbt-timeline-option>.wbt-timeline-excerpt{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",
9055
9716
  ".wbt-timeline-view .wbt-timeline-option.current{box-shadow:inset 3px 0 var(--wbt-accent),inset 0 0 0 1px var(--wbt-line);background:color-mix(in oklab,var(--wbt-accent) 8%,transparent);background-image:none}.wbt-timeline-view .wbt-timeline-option:hover{background:color-mix(in oklab,var(--wbt-accent) 12%,transparent)}",
9056
- ".wbt-timeline-option:focus-visible,.wbt-timeline-view button:focus-visible,.wbt-timeline-modal button:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:2px}.wbt-timeline-option input[type=checkbox],.wbt-timeline-single input{appearance:auto;width:15px;height:15px;flex:none;accent-color:var(--wbt-accent)}",
9717
+ ".wbt-timeline-option:focus-visible,.wbt-timeline-view button:focus-visible,.wbt-timeline-modal button:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:2px}.wbt-timeline-option input[type=checkbox]{appearance:auto;width:15px;height:15px;flex:none;accent-color:var(--wbt-accent)}",
9057
9718
  ".wbt-timeline-pager{justify-content:space-between;font-size:12px;margin-top:12px}.wbt-timeline-right h3,.wbt-timeline-summary h4{font-size:15px;font-weight:600;margin:0 0 8px;overflow-wrap:anywhere}.wbt-timeline-eyebrow{font-size:11.5px;opacity:.55;margin-bottom:4px;overflow-wrap:anywhere}",
9058
9719
  ".wbt-timeline-summary{min-width:0}.wbt-timeline-desc{max-height:64px;overflow:hidden;margin:0 0 8px;white-space:pre-wrap;overflow-wrap:anywhere}.wbt-timeline-actions{margin:8px 0}.wbt-timeline-actions>.wbt-act-del{margin-left:auto}",
9059
9720
  ".wbt-timeline-right>.wbt-timeline-members{min-height:0;max-height:65vh;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}",
@@ -9071,6 +9732,27 @@ var require_timeline_styles = __commonJS({
9071
9732
  }
9072
9733
  });
9073
9734
 
9735
+ // packages/addons/tasks/client/ui/inject-css.cjs
9736
+ var require_inject_css = __commonJS({
9737
+ "packages/addons/tasks/client/ui/inject-css.cjs"(exports2, module2) {
9738
+ "use strict";
9739
+ var CSS = require_styles() + "\n" + require_timeline_styles();
9740
+ module2.exports = function injectTasksCss() {
9741
+ if (typeof document === "undefined") return;
9742
+ var old = document.getElementById("wb-addon-tasks-v2-css");
9743
+ if (old) {
9744
+ old.textContent = CSS;
9745
+ return;
9746
+ }
9747
+ var s = document.createElement("style");
9748
+ s.id = "wb-addon-tasks-v2-css";
9749
+ s.setAttribute("data-wb-addon", "wb-addon-tasks");
9750
+ s.textContent = CSS;
9751
+ document.head.appendChild(s);
9752
+ };
9753
+ }
9754
+ });
9755
+
9074
9756
  // packages/addons/tasks/client/ui/highlight.cjs
9075
9757
  var require_highlight2 = __commonJS({
9076
9758
  "packages/addons/tasks/client/ui/highlight.cjs"(exports2, module2) {
@@ -9093,6 +9775,7 @@ var require_task_item = __commonJS({
9093
9775
  var statusInfo = deps.statusInfo, stars = deps.stars, pClass = deps.pClass;
9094
9776
  var today = deps.today, daysBetween = deps.daysBetween, cx = deps.cx;
9095
9777
  var Icon2 = deps.Icon, Countdown = deps.Countdown, PathCrumbs = deps.PathCrumbs;
9778
+ var Slot = deps.Slot;
9096
9779
  function TaskItem(props) {
9097
9780
  var t = props.t;
9098
9781
  var initialMode = props.bodyMode === "text" ? "text" : "markdown";
@@ -9208,13 +9891,25 @@ var require_task_item = __commonJS({
9208
9891
  );
9209
9892
  var opsNode = h("div", { className: "wbt-ops", key: "ops" }, ops);
9210
9893
  var tagBlock = tagNodes.length ? h("div", { className: "wbt-tags", key: "tags" }, tagNodes) : null;
9894
+ var sourceBlock = h(Slot, {
9895
+ slot: "item.actions",
9896
+ ownerId: "wb-addon-tasks",
9897
+ lang: props.lang,
9898
+ key: "source",
9899
+ item: {
9900
+ kind: "task",
9901
+ id: String(task.id || ""),
9902
+ title: String(task.title || ""),
9903
+ description: String(task.description || "")
9904
+ }
9905
+ });
9211
9906
  var wsList = Array.isArray(task.workspaces) ? task.workspaces : [];
9212
9907
  var wsBlock = wsList.length ? h("div", { className: "wbt-wschips", key: "workspaces" }, wsList.map(function(w) {
9213
9908
  return h("span", { className: "wbt-wschip wbt-wschip-ro", key: String(w.id), title: w.dir || "" }, (w.dir ? "" : "\u25E6 ") + (w.title || w.id));
9214
9909
  })) : null;
9215
9910
  var metaBlock = meta.length ? h("div", { className: "wbt-foot", key: "meta" }, h("div", { className: "wbt-meta" }, meta)) : null;
9216
9911
  var pathBlock = task.path && task.path.length ? h("div", { className: "wbt-taskpath", key: "path" }, h(PathCrumbs, { path: task.path, t, onPick: props.onPathPick })) : null;
9217
- var metaZone = tagBlock || wsBlock || metaBlock || pathBlock ? h("div", { className: "wbt-metazone", key: "metazone" }, tagBlock, wsBlock, metaBlock, pathBlock) : null;
9912
+ var metaZone = tagBlock || sourceBlock || wsBlock || metaBlock || pathBlock ? h("div", { className: "wbt-metazone", key: "metazone" }, tagBlock, sourceBlock, wsBlock, metaBlock, pathBlock) : null;
9218
9913
  var idNode = String(task.id || "") ? h("div", {
9219
9914
  className: "wbt-item-id",
9220
9915
  key: "taskid",
@@ -9333,35 +10028,45 @@ var require_timeline_controls = __commonJS({
9333
10028
  });
9334
10029
  function Picker(p) {
9335
10030
  var tr = require_timeline_copy()(p.t);
10031
+ var PAGE_SIZE = 20;
9336
10032
  var ds = React.useState({ records: [], total: 0 }), data = ds[0], setData = ds[1];
9337
10033
  var ps = React.useState(1), page = ps[0], setPage = ps[1];
9338
10034
  var qs = React.useState(""), query = qs[0], setQuery = qs[1];
9339
10035
  var es = React.useState(""), error = es[0], setError = es[1];
9340
10036
  var bs = React.useState(false), busy = bs[0], setBusy = bs[1];
10037
+ var ms = React.useState(false), more = ms[0], setMore = ms[1];
9341
10038
  var rs = React.useState(0), retry = rs[0], setRetry = rs[1];
9342
10039
  var as = React.useState(-1), active = as[0], setActive = as[1];
9343
10040
  var list = React.useRef(null);
10041
+ var loading = React.useRef(false);
9344
10042
  React.useEffect(function() {
9345
- var cancelled = false;
9346
- setBusy(true);
10043
+ var cancelled = false, first = page <= 1;
10044
+ if (first) setBusy(true);
10045
+ else setMore(true);
9347
10046
  setError("");
9348
- p.api.call("tasks.timelines", { includeSingletons: true, titleKey: query, pageNumber: page, pageSize: 20 }).then(result).then(function(r) {
9349
- if (!cancelled) {
9350
- setData(r);
9351
- setActive(-1);
9352
- setBusy(false);
9353
- }
10047
+ loading.current = true;
10048
+ p.api.call("tasks.timelines", { includeSingletons: true, titleKey: query, pageNumber: page, pageSize: PAGE_SIZE }).then(result).then(function(r) {
10049
+ if (cancelled) return;
10050
+ loading.current = false;
10051
+ setData(function(prev) {
10052
+ if (first) return r;
10053
+ return { records: (prev.records || []).concat(r.records || []), total: r.total };
10054
+ });
10055
+ setActive(-1);
10056
+ setBusy(false);
10057
+ setMore(false);
9354
10058
  }).catch(function(e) {
9355
- if (!cancelled) {
9356
- setError(String(e.message || e));
9357
- setBusy(false);
9358
- }
10059
+ if (cancelled) return;
10060
+ loading.current = false;
10061
+ setError(String(e.message || e));
10062
+ setBusy(false);
10063
+ setMore(false);
9359
10064
  });
9360
10065
  return function() {
9361
10066
  cancelled = true;
9362
10067
  };
9363
10068
  }, [p.api, page, query, retry]);
9364
- var rows = data.records || [], pages = Math.max(1, Math.ceil(data.total / 20));
10069
+ var rows = data.records || [], pages = Math.max(1, Math.ceil(data.total / PAGE_SIZE));
9365
10070
  function choose(row) {
9366
10071
  if (row) p.onChange(row.timelineId || row.timelineKey, row.title || "");
9367
10072
  }
@@ -9380,11 +10085,21 @@ var require_timeline_controls = __commonJS({
9380
10085
  var nodes = list.current ? list.current.querySelectorAll('[role="option"]') : [];
9381
10086
  return Array.prototype.indexOf.call(nodes, document.activeElement);
9382
10087
  }
10088
+ function loadMore() {
10089
+ if (loading.current || busy || more || page >= pages) return;
10090
+ setPage(page + 1);
10091
+ }
10092
+ function onScroll(e) {
10093
+ var el = e.currentTarget;
10094
+ if (!el || !el.scrollHeight) return;
10095
+ if (el.scrollTop + el.clientHeight >= el.scrollHeight - 48) loadMore();
10096
+ }
9383
10097
  function onKeyDown(e) {
9384
10098
  var base = focusedIndex() >= 0 ? focusedIndex() : active;
9385
10099
  if (e.key === "ArrowDown") {
9386
10100
  e.preventDefault();
9387
10101
  move(base + 1);
10102
+ loadMore();
9388
10103
  } else if (e.key === "ArrowUp") {
9389
10104
  e.preventDefault();
9390
10105
  move(base <= 0 ? 0 : base - 1);
@@ -9394,6 +10109,7 @@ var require_timeline_controls = __commonJS({
9394
10109
  } else if (e.key === "End") {
9395
10110
  e.preventDefault();
9396
10111
  move(rows.length - 1);
10112
+ loadMore();
9397
10113
  } else if (e.key === "Enter") {
9398
10114
  if (document.activeElement && document.activeElement.getAttribute("role") === "option") return;
9399
10115
  e.preventDefault();
@@ -9407,15 +10123,20 @@ var require_timeline_controls = __commonJS({
9407
10123
  "label",
9408
10124
  { className: "wbt-field" },
9409
10125
  tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"),
9410
- h("input", { className: "wbt-input", "aria-label": tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"), value: query, onChange: function(e) {
9411
- setQuery(e.target.value);
9412
- setPage(1);
9413
- } })
10126
+ h("input", {
10127
+ className: "wbt-input",
10128
+ "aria-label": tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"),
10129
+ value: query,
10130
+ onChange: function(e) {
10131
+ setQuery(e.target.value);
10132
+ setPage(1);
10133
+ }
10134
+ })
9414
10135
  ),
9415
10136
  h("div", { className: "wbt-picker-selected", role: "status" }, p.value ? tr("\u5DF2\u9009\u65F6\u95F4\u7EBF") + "\uFF1A" + (p.title || p.value) : tr("\u5C1A\u672A\u9009\u62E9\u65F6\u95F4\u7EBF")),
9416
10137
  h(
9417
10138
  "div",
9418
- { ref: list, className: "wbt-picker-list", role: "listbox", "aria-label": tr("\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF"), "aria-busy": busy ? "true" : "false", onKeyDown },
10139
+ { ref: list, className: "wbt-picker-list", role: "listbox", "aria-label": tr("\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF"), "aria-busy": busy ? "true" : "false", onKeyDown, onScroll },
9419
10140
  busy ? h("p", { className: "wbt-picker-note" }, tr("\u52A0\u8F7D\u4E2D\u2026")) : null,
9420
10141
  error ? h("div", { className: "wbt-picker-note wbt-err", role: "alert" }, error, h("button", { type: "button", className: "wbt-btn", onClick: function() {
9421
10142
  setRetry(retry + 1);
@@ -9433,18 +10154,9 @@ var require_timeline_controls = __commonJS({
9433
10154
  h("span", { className: "wbt-picker-opt-title" }, row.title || tr("\u672A\u547D\u540D\u65F6\u95F4\u7EBF")),
9434
10155
  h("span", { className: "wbt-picker-opt-count" }, row.taskCount + tr(" \u4E2A\u4EFB\u52A1"))
9435
10156
  );
9436
- }) : null
9437
- ),
9438
- h(
9439
- "div",
9440
- { className: "wbt-timeline-pager" },
9441
- h("button", { type: "button", className: "wbt-btn", disabled: busy || page <= 1, onClick: function() {
9442
- setPage(page - 1);
9443
- } }, tr("\u4E0A\u4E00\u9875")),
9444
- h("span", null, page + " / " + pages),
9445
- h("button", { type: "button", className: "wbt-btn", disabled: busy || page >= pages, onClick: function() {
9446
- setPage(page + 1);
9447
- } }, tr("\u4E0B\u4E00\u9875"))
10157
+ }) : null,
10158
+ more ? h("p", { className: "wbt-picker-note" }, tr("\u52A0\u8F7D\u66F4\u591A\u2026")) : null,
10159
+ !busy && !error && rows.length && page >= pages ? h("p", { className: "wbt-picker-note" }, tr("\u5DF2\u5230\u6700\u540E\u4E00\u6761")) : null
9448
10160
  )
9449
10161
  );
9450
10162
  }
@@ -9672,32 +10384,37 @@ var require_workspace_select = __commonJS({
9672
10384
  var require_difficulty_field = __commonJS({
9673
10385
  "packages/addons/tasks/client/item/difficulty-field.cjs"(exports2, module2) {
9674
10386
  "use strict";
10387
+ var NF = require_number_field();
9675
10388
  module2.exports = function(React) {
9676
10389
  var h = React.createElement;
9677
- return function difficultyField(t, value, onChange, id) {
10390
+ return function difficultyField(t, value, onChange, id, lang) {
9678
10391
  var n = Number(value) || 0, full = Math.floor(n), half = n - full >= 0.5;
9679
10392
  var stars = "\u2605".repeat(full) + (half ? "\u2BEA" : "") + "\u2606".repeat(Math.max(0, 5 - full - (half ? 1 : 0)));
9680
10393
  return h(
9681
10394
  "div",
9682
10395
  { className: "wbt-field full" },
9683
- h("label", { htmlFor: id }, t.difficulty + " (0\u20135)"),
10396
+ h("span", { className: "wbt-field-label" }, t.difficulty + " (0\u20135)"),
9684
10397
  h(
9685
10398
  "div",
9686
10399
  { className: "wbt-row" },
9687
- h("input", {
9688
- id,
9689
- className: "wbt-input",
9690
- type: "number",
10400
+ h(NF.NumberField, {
10401
+ h,
10402
+ lang,
10403
+ value,
9691
10404
  min: 0,
9692
10405
  max: 5,
9693
10406
  step: 0.5,
9694
- "aria-label": t.difficulty,
9695
- "aria-describedby": id + "-hint",
10407
+ allowEmpty: true,
10408
+ ariaLabel: t.difficulty,
9696
10409
  placeholder: t.difficultyUnsetHint,
9697
- value,
9698
- onChange: function(e) {
9699
- var raw = e.target.value;
9700
- onChange(raw === "" ? "" : Math.max(0, Math.min(5, Number(raw) || 0)));
10410
+ hint: false,
10411
+ className: "wbt-difficulty-num",
10412
+ // 键入期同步草稿,让 ★ 预览即时更新;提交只在失焦/回车且合法时发生。
10413
+ onDraft: function(raw) {
10414
+ onChange(raw);
10415
+ },
10416
+ onCommit: function(next) {
10417
+ onChange(next === null ? "" : String(next));
9701
10418
  }
9702
10419
  }),
9703
10420
  h("span", { className: "wbt-stars", "aria-hidden": true }, n > 0 ? stars : t.difficultyUnset),
@@ -9928,48 +10645,33 @@ var require_ownership_fields = __commonJS({
9928
10645
  "use strict";
9929
10646
  var limits = require_limits();
9930
10647
  var ownership = require_ownership();
10648
+ var SW = require_switch();
9931
10649
  module2.exports = function(React) {
9932
10650
  var h = React.createElement;
9933
10651
  var Picker = require_table_picker()(React);
9934
10652
  function Selection(props) {
9935
- var state = React.useState(false), open = state[0], setOpen = state[1], trigger = React.useRef(null);
9936
10653
  var chosen = ownership.tables(props.tree).find(function(x) {
9937
10654
  return x.id === props.form.tableId;
9938
10655
  });
9939
- function close() {
9940
- setOpen(false);
9941
- if (trigger.current) trigger.current.focus();
9942
- }
9943
10656
  return h(
9944
10657
  "div",
9945
10658
  null,
9946
10659
  h("div", { className: "wbt-picker-detail" }, props.edit ? "\u5F53\u524D\u5F52\u5C5E\uFF1A" + props.current : "\u76EE\u6807\u4EFB\u52A1\u8868 *"),
9947
- h("button", {
9948
- ref: trigger,
9949
- type: "button",
9950
- className: "wbt-btn",
9951
- disabled: !!props.form.newPath,
9952
- "aria-expanded": open,
9953
- onClick: function() {
9954
- setOpen(!open);
9955
- }
9956
- }, props.edit ? "\u66F4\u6362\u4EFB\u52A1\u8868" : "\u9009\u62E9\u76EE\u6807\u4EFB\u52A1\u8868"),
9957
- open && !props.form.newPath ? h(Picker, {
10660
+ props.form.newPath ? null : h(Picker, {
9958
10661
  tree: props.tree,
9959
10662
  value: props.form.tableId,
9960
10663
  recommended: props.recommended,
10664
+ onClose: null,
9961
10665
  onChange: function(id) {
9962
10666
  props.set("tableId", props.edit && id === String(props.currentId) ? "" : id);
9963
- },
9964
- onClose: close
9965
- }) : null,
10667
+ }
10668
+ }),
9966
10669
  chosen ? h(
9967
10670
  "div",
9968
10671
  { className: "wbt-picker-detail", role: "status" },
9969
10672
  (props.edit ? "\u5C06\u79FB\u52A8\u5230\uFF1A" : "\u5DF2\u9009\u62E9\uFF1A") + chosen.path,
9970
10673
  props.edit ? h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
9971
10674
  props.set("tableId", "");
9972
- close();
9973
10675
  } }, "\u64A4\u9500\uFF0C\u4FDD\u7559\u539F\u4F4D") : null
9974
10676
  ) : h("div", { className: "wbt-mhint" }, props.edit ? "\u672A\u66F4\u6362\uFF0C\u4FDD\u7559\u5F53\u524D\u5F52\u5C5E\u3002" : props.form.newPath ? "\u8BF7\u786E\u8BA4\u65B0\u5EFA\u8DEF\u5F84\u3002" : "\u8BF7\u5148\u9009\u62E9\u76EE\u6807\u4EFB\u52A1\u8868\uFF0C\u518D\u786E\u8BA4\u63D0\u4EA4\u3002")
9975
10677
  );
@@ -9981,14 +10683,14 @@ var require_ownership_fields = __commonJS({
9981
10683
  "div",
9982
10684
  { className: "wbt-field full" },
9983
10685
  h(Selection, { form, set, tree: props.tree, recommended: props.recommended, edit: props.edit, current: props.current, currentId: props.currentId }),
9984
- !props.edit ? h("label", { className: "wbt-check" }, h("input", {
9985
- type: "checkbox",
9986
- "aria-label": "\u6CA1\u6709\u5408\u9002\u7684\u8868\uFF1F\u65B0\u5EFA\u8282\u70B9",
10686
+ !props.edit ? h(SW.Switch, {
10687
+ h,
9987
10688
  checked: !!form.newPath,
9988
- onChange: function(e) {
9989
- props.setMany({ newPath: e.target.checked, tableId: "", confirmed: false });
10689
+ label: "\u6CA1\u6709\u5408\u9002\u7684\u8868\uFF1F\u65B0\u5EFA\u8282\u70B9",
10690
+ onChange: function(next) {
10691
+ props.setMany({ newPath: next, tableId: "", confirmed: false });
9990
10692
  }
9991
- }), "\u6CA1\u6709\u5408\u9002\u7684\u8868\uFF1F\u65B0\u5EFA\u8282\u70B9") : null,
10693
+ }) : null,
9992
10694
  form.newPath ? h(
9993
10695
  "div",
9994
10696
  null,
@@ -10021,15 +10723,15 @@ var require_ownership_fields = __commonJS({
10021
10723
  );
10022
10724
  }),
10023
10725
  plan.error ? h("div", { className: "wbt-err", role: "alert" }, plan.error) : null,
10024
- h("label", { className: "wbt-check" }, h("input", {
10025
- type: "checkbox",
10026
- "aria-label": "\u786E\u8BA4\u65B0\u5EFA\u8DEF\u5F84",
10726
+ h(SW.Switch, {
10727
+ h,
10027
10728
  checked: !!form.confirmed,
10028
10729
  disabled: !!plan.error,
10029
- onChange: function(e) {
10030
- set("confirmed", e.target.checked);
10730
+ label: "\u786E\u8BA4\u4EE5\u4E0A\u8DEF\u5F84\u4E0E\u804C\u8D23\uFF0C\u968F\u4EFB\u52A1\u4E00\u8D77\u63D0\u4EA4",
10731
+ onChange: function(next) {
10732
+ set("confirmed", next);
10031
10733
  }
10032
- }), "\u786E\u8BA4\u4EE5\u4E0A\u8DEF\u5F84\u4E0E\u804C\u8D23\uFF0C\u968F\u4EFB\u52A1\u4E00\u8D77\u63D0\u4EA4")
10734
+ })
10033
10735
  ) : null
10034
10736
  );
10035
10737
  };
@@ -10040,16 +10742,15 @@ var require_ownership_fields = __commonJS({
10040
10742
  // packages/addons/tasks/client/modals/create-modal.cjs
10041
10743
  var require_create_modal = __commonJS({
10042
10744
  "packages/addons/tasks/client/modals/create-modal.cjs"(exports2, module2) {
10745
+ var NF = require_number_field();
10746
+ var staged = require_staged_dialog();
10747
+ var FilterChecklist = require_filter_checklist();
10043
10748
  function initialPriority(source, origin, fallback) {
10044
10749
  var original = Number(origin && origin.priority);
10045
10750
  if (source === "2" && Number.isInteger(original) && original >= 1 && original <= 10) return original;
10046
10751
  var n = Number(fallback);
10047
10752
  return Number.isFinite(n) ? Math.min(10, Math.max(1, Math.floor(n))) : 1;
10048
10753
  }
10049
- function clampInputPriority(value) {
10050
- if (String(value).trim() === "" || Number(value) === 0 || !Number.isFinite(Number(value))) return value;
10051
- return Math.min(10, Math.max(1, Math.floor(Number(value))));
10052
- }
10053
10754
  function validatePriority(value, source, t) {
10054
10755
  var n = Number(value);
10055
10756
  return String(value).trim() !== "" && Number.isInteger(n) && n >= 1 && n <= 10 ? "" : source === "2" ? t.restartPriorityError : t.activePriorityError;
@@ -10063,6 +10764,35 @@ var require_create_modal = __commonJS({
10063
10764
  var DP = require_date_picker();
10064
10765
  var allTables = deps.allTables, tagNames = deps.tagNames, splitTags = deps.splitTags;
10065
10766
  var today = deps.today, addDays = deps.addDays, hostHasAddon = deps.hostHasAddon;
10767
+ var StagedDialog = staged.createStagedDialog({
10768
+ React,
10769
+ tag: "div",
10770
+ displayName: "TaskCreateDialog",
10771
+ maskClass: "wbt-modal-mask",
10772
+ dialogClass: "wbt-modal",
10773
+ header: function(p) {
10774
+ return h(
10775
+ "div",
10776
+ { className: "wbt-modal-head" },
10777
+ h("h3", null, p.title),
10778
+ h("button", { type: "button", className: "wbt-icon", disabled: !!p.submitting, onClick: p.onClose, "aria-label": p.closeLabel }, "\xD7")
10779
+ );
10780
+ },
10781
+ closeOnEscape: function(p) {
10782
+ return !p.submitting;
10783
+ },
10784
+ closeOnMask: function(p) {
10785
+ return !p.submitting;
10786
+ },
10787
+ // 表选择器内部自己用 Esc 收面板,别把它一起关掉。
10788
+ onKeyDown: function(e) {
10789
+ if (e.key === "Escape" && e.target && e.target.closest && e.target.closest(".wbt-table-picker")) {
10790
+ e.stopPropagation();
10791
+ return true;
10792
+ }
10793
+ return false;
10794
+ }
10795
+ });
10066
10796
  function CreateModal(props) {
10067
10797
  var t = props.t, tr = require_timeline_copy()(props.t);
10068
10798
  var source = String(props.source || "0");
@@ -10102,14 +10832,9 @@ var require_create_modal = __commonJS({
10102
10832
  function requestClose() {
10103
10833
  if (!submission.pending) props.onClose();
10104
10834
  }
10105
- function onModalKey(e) {
10106
- if (e.key !== "Escape" || e.target && e.target.closest && e.target.closest(".wbt-table-picker")) return;
10107
- e.preventDefault();
10108
- e.stopPropagation();
10109
- requestClose();
10110
- }
10111
10835
  var active = source === "2" || form.status === "0";
10112
10836
  var priorityError = active ? validatePriority(form.priority, source, t) : "";
10837
+ var difficultyCheck = NF.validateNumber(form.difficulty, { min: 0, max: 5, step: 0.5, allowEmpty: true, lang: props.lang });
10113
10838
  var plan = ownership.preview(props.tree, form.tablePath, form.pathDescriptions);
10114
10839
  var targetValid = form.newPath ? !plan.error && form.confirmed : tables.some(function(x) {
10115
10840
  return x.id === form.tableId;
@@ -10131,7 +10856,7 @@ var require_create_modal = __commonJS({
10131
10856
  }
10132
10857
  function set(k, v) {
10133
10858
  var next = Object.assign({}, form);
10134
- next[k] = k === "priority" ? clampInputPriority(v) : v;
10859
+ next[k] = v;
10135
10860
  setForm(next);
10136
10861
  }
10137
10862
  function failed(message) {
@@ -10148,6 +10873,10 @@ var require_create_modal = __commonJS({
10148
10873
  }
10149
10874
  function submit() {
10150
10875
  if (priorityError || isBusy || submission.pending) return;
10876
+ if (!difficultyCheck.ok) {
10877
+ setError(difficultyCheck.error);
10878
+ return;
10879
+ }
10151
10880
  if (source === "2" && !(origin && origin.timelineId)) {
10152
10881
  setError(tr("\u8BF7\u5148\u624B\u52A8\u5EFA\u7ACB\u5E76\u5173\u8054\u65F6\u95F4\u7EBF\uFF0C\u518D\u91CD\u542F"));
10153
10882
  return;
@@ -10177,7 +10906,7 @@ var require_create_modal = __commonJS({
10177
10906
  tags: splitTags(form.tags),
10178
10907
  status: source === "2" ? "0" : String(form.status),
10179
10908
  priority: active ? Number(form.priority) : 0,
10180
- difficulty: Number(form.difficulty) || 0,
10909
+ difficulty: difficultyCheck.value || 0,
10181
10910
  publishDate: form.publishDate,
10182
10911
  targetDate: form.targetDate,
10183
10912
  source: source === "2" ? "2" : form.timelineId ? "1" : "0"
@@ -10209,7 +10938,7 @@ var require_create_modal = __commonJS({
10209
10938
  });
10210
10939
  }
10211
10940
  var title = source === "2" ? t.restartTitle : source === "1" ? tr("\u5411\u5DF2\u6709\u65F6\u95F4\u7EBF\u6DFB\u52A0\u4EFB\u52A1") : t.newTask;
10212
- var timelineSection = source !== "2" ? h(
10941
+ var timelineSection = h(
10213
10942
  "div",
10214
10943
  { className: "wbt-create-tl full" },
10215
10944
  h(
@@ -10221,80 +10950,538 @@ var require_create_modal = __commonJS({
10221
10950
  h(TimelinePicker, { api: props.api, t, value: form.timelineId, onChange: function(value) {
10222
10951
  set("timelineId", value);
10223
10952
  }, disabled: isBusy })
10224
- ) : null;
10225
- return h(
10226
- "div",
10227
- { className: "wbt-modal-mask", onKeyDownCapture: onModalKey, onMouseDown: function(e) {
10228
- if (e.target === e.currentTarget) requestClose();
10229
- } },
10230
- h(
10953
+ );
10954
+ function stepContent(h2) {
10955
+ return h2(
10231
10956
  "div",
10232
- { className: "wbt-modal" },
10233
- h("div", { className: "wbt-modal-head" }, h("h3", null, title), h("button", { className: "wbt-icon", disabled: isBusy, onClick: requestClose }, "\xD7")),
10234
- source === "2" ? h("div", { className: "wbt-mhint" }, t.restartPriorityHint) : null,
10235
- source !== "0" && origin ? h("div", { className: "wbt-mhint" }, "\u6765\u6E90\uFF1A" + (origin.title || origin.id) + (source === "2" ? tr(" \xB7 \u81EA\u52A8\u7EE7\u627F\u539F\u65F6\u95F4\u7EBF") : "")) : null,
10236
- source === "2" && !(origin && origin.timelineId) ? h("p", { className: "wbt-err", role: "alert" }, tr("\u8BF7\u5148\u624B\u52A8\u5EFA\u7ACB\u5E76\u5173\u8054\u65F6\u95F4\u7EBF\uFF0C\u518D\u91CD\u542F")) : null,
10237
- h(
10957
+ { className: "wbctl-form" },
10958
+ origin ? h2(
10238
10959
  "div",
10239
- { className: "wbt-form" },
10240
- h("label", { className: "wbt-field full" }, h("span", null, t.titleField + " *"), h("input", { className: "wbt-input", value: form.title, onChange: function(e) {
10960
+ { className: "wbt-mhint full" },
10961
+ "\u6765\u6E90\uFF1A" + (origin.title || origin.id) + (source === "2" ? tr(" \xB7 \u81EA\u52A8\u7EE7\u627F\u539F\u65F6\u95F4\u7EBF") : "")
10962
+ ) : null,
10963
+ h2(
10964
+ "label",
10965
+ { className: "wbt-field full" },
10966
+ h2("span", null, t.titleField + " *"),
10967
+ h2("input", { className: "wbt-input", value: form.title, onChange: function(e) {
10241
10968
  set("title", e.target.value);
10242
- }, autoFocus: true })),
10243
- h("label", { className: "wbt-field full" }, h("span", null, t.desc), h("textarea", { className: "wbt-textarea", rows: 2, value: form.description, onChange: function(e) {
10969
+ } })
10970
+ ),
10971
+ h2(
10972
+ "label",
10973
+ { className: "wbt-field full" },
10974
+ h2("span", null, t.desc),
10975
+ h2("textarea", { className: "wbt-textarea", rows: 3, value: form.description, onChange: function(e) {
10244
10976
  set("description", e.target.value);
10245
- } })),
10246
- hostHasAddon("wb-addon-tags") ? h("label", { className: "wbt-field full" }, h("span", null, t.tags), h("input", { className: "wbt-input", value: form.tags, placeholder: t.tagPlaceholder, onChange: function(e) {
10247
- set("tags", e.target.value);
10248
- } })) : null,
10249
- timelineSection,
10250
- h(WorkspaceSelect, { api: props.api, lang: props.lang, value: form.workspaceIds, onChange: function(ids) {
10251
- set("workspaceIds", ids);
10252
- } }),
10253
- h("label", { className: "wbt-field" }, h("span", null, t.status), h(
10977
+ } })
10978
+ ),
10979
+ source === "2" ? h2("div", { className: "wbt-mhint full" }, t.restartPriorityHint) : null,
10980
+ h2(
10981
+ "label",
10982
+ { className: "wbt-field" },
10983
+ h2("span", null, t.status),
10984
+ h2(
10254
10985
  "select",
10255
10986
  { className: "wbt-select", value: source === "2" ? "0" : form.status, disabled: source === "2", onChange: function(e) {
10256
10987
  set("status", e.target.value);
10257
10988
  } },
10258
- h("option", { value: "0" }, "\u5DF2\u5F00\u542F"),
10259
- h("option", { value: "2" }, "\u5DF2\u5B8C\u6210"),
10260
- h("option", { value: "1" }, "\u5DF2\u5173\u95ED")
10261
- )),
10262
- h("label", { className: "wbt-field" }, h("span", null, t.priority + "\uFF081\u201310\uFF09"), h("input", { className: "wbt-input", type: "number", min: 1, max: 10, step: 1, disabled: !active, "aria-invalid": !!priorityError, "aria-describedby": priorityError ? "wbt-create-priority-error" : void 0, value: form.priority, onChange: function(e) {
10263
- set("priority", e.target.value);
10264
- } })),
10265
- fields({ form, set, setMany, tree: props.tree, recommended: props.defaultTableId || origin && origin.tableId }),
10266
- 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) {
10989
+ h2("option", { value: "0" }, "\u5DF2\u5F00\u542F"),
10990
+ h2("option", { value: "2" }, "\u5DF2\u5B8C\u6210"),
10991
+ h2("option", { value: "1" }, "\u5DF2\u5173\u95ED")
10992
+ )
10993
+ ),
10994
+ h2(
10995
+ "div",
10996
+ { className: "wbt-field" },
10997
+ h2("span", { className: "wbt-field-label" }, t.priority + "\uFF081\u201310\uFF09"),
10998
+ h2(NF.NumberField, {
10999
+ h: h2,
11000
+ lang: props.lang,
11001
+ value: form.priority,
11002
+ min: 1,
11003
+ max: 10,
11004
+ integer: true,
11005
+ disabled: !active,
11006
+ hint: false,
11007
+ ariaLabel: t.priority,
11008
+ // 键入即写入草稿;合法性由下面的 priorityError 实时判定,绝不回写夹取后的值。
11009
+ onDraft: function(raw) {
11010
+ set("priority", raw);
11011
+ },
11012
+ onCommit: function(next) {
11013
+ set("priority", String(next));
11014
+ }
11015
+ })
11016
+ ),
11017
+ priorityError ? h2("div", { className: "wbt-err full", role: "alert" }, priorityError) : null,
11018
+ difficultyField(t, form.difficulty, function(value) {
11019
+ set("difficulty", value);
11020
+ }, "wbt-create-difficulty", props.lang),
11021
+ h2(
11022
+ "label",
11023
+ { className: "wbt-field" },
11024
+ h2("span", null, t.publishDate),
11025
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.publishDate, value: form.publishDate, onChange: function(next) {
10267
11026
  set("publishDate", next);
10268
- } })),
10269
- 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) {
11027
+ } })
11028
+ ),
11029
+ h2(
11030
+ "label",
11031
+ { className: "wbt-field" },
11032
+ h2("span", null, t.targetDate),
11033
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.targetDate, value: form.targetDate, onChange: function(next) {
10270
11034
  set("targetDate", next);
10271
- } })),
10272
- 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) {
11035
+ } })
11036
+ ),
11037
+ source !== "2" && form.status === "2" ? h2(
11038
+ "label",
11039
+ { className: "wbt-field" },
11040
+ h2("span", null, t.doneDate),
11041
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.doneDate, value: form.doneDate, onChange: function(next) {
10273
11042
  set("doneDate", next);
10274
- } })) : null,
10275
- difficultyField(t, form.difficulty, function(value) {
10276
- set("difficulty", value);
10277
- }, "wbt-create-difficulty"),
10278
- 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) {
11043
+ } })
11044
+ ) : null,
11045
+ source !== "2" && form.status === "1" ? h2(
11046
+ "label",
11047
+ { className: "wbt-field" },
11048
+ h2("span", null, t.shutdownDate),
11049
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.shutdownDate, value: form.shutdownDate, onChange: function(next) {
10279
11050
  set("shutdownDate", next);
10280
- } })) : null
10281
- ),
10282
- priorityError ? h("div", { id: "wbt-create-priority-error", className: "wbt-err", role: "alert" }, priorityError) : null,
10283
- error ? h("div", { className: "wbt-err" }, error) : null,
10284
- h(
11051
+ } })
11052
+ ) : null
11053
+ );
11054
+ }
11055
+ function TagPicker(p2) {
11056
+ var h2 = p2.h;
11057
+ var names = splitTags(p2.value);
11058
+ var qs = React.useState(""), query = qs[0], setQuery = qs[1];
11059
+ var rs = React.useState([]), rows = rs[0], setRows = rs[1];
11060
+ var ts = React.useState(0), total = ts[0], setTotal = ts[1];
11061
+ var ps = React.useState(1), page = ps[0], setPage = ps[1];
11062
+ var hs = React.useState(false), hasMore = hs[0], setHasMore = hs[1];
11063
+ var ls = React.useState(false), loading = ls[0], setLoading = ls[1];
11064
+ var ds = React.useState(""), draft = ds[0], setDraft = ds[1];
11065
+ var seq = React.useRef(0);
11066
+ React.useEffect(function() {
11067
+ var mine = ++seq.current;
11068
+ setLoading(true);
11069
+ var timer = setTimeout(function() {
11070
+ p2.api.call("tasks.tagOptions", { query, pageNumber: 1, pageSize: 30 }).then(function(r) {
11071
+ if (mine !== seq.current) return;
11072
+ var out = r && r.ok ? r.result : {};
11073
+ var list = out.tags || [];
11074
+ setRows(list);
11075
+ setTotal(out.total || list.length);
11076
+ setPage(1);
11077
+ setHasMore(!!out.hasMore);
11078
+ setLoading(false);
11079
+ }).catch(function() {
11080
+ if (mine !== seq.current) return;
11081
+ setRows([]);
11082
+ setTotal(0);
11083
+ setHasMore(false);
11084
+ setLoading(false);
11085
+ });
11086
+ }, 200);
11087
+ return function() {
11088
+ clearTimeout(timer);
11089
+ };
11090
+ }, [p2.api, query]);
11091
+ function loadMore() {
11092
+ if (loading || !hasMore) return;
11093
+ var mine = seq.current, next = page + 1;
11094
+ setLoading(true);
11095
+ p2.api.call("tasks.tagOptions", { query, pageNumber: next, pageSize: 30 }).then(function(r) {
11096
+ if (mine !== seq.current) return;
11097
+ var out = r && r.ok ? r.result : {};
11098
+ setRows(rows.concat(out.tags || []));
11099
+ setPage(next);
11100
+ setHasMore(!!out.hasMore);
11101
+ setLoading(false);
11102
+ }).catch(function() {
11103
+ if (mine === seq.current) setLoading(false);
11104
+ });
11105
+ }
11106
+ function emit(next) {
11107
+ p2.onChange(next.join(", "));
11108
+ }
11109
+ function toggle(name) {
11110
+ emit(names.indexOf(name) >= 0 ? names.filter(function(x) {
11111
+ return x !== name;
11112
+ }) : names.concat([name]));
11113
+ }
11114
+ function toggleId(id) {
11115
+ var row = rows.filter(function(x) {
11116
+ return String(x.id) === String(id);
11117
+ })[0];
11118
+ if (row) toggle(String(row.name));
11119
+ }
11120
+ function addDraft() {
11121
+ var parts = splitTags(draft);
11122
+ if (!parts.length) return;
11123
+ var next = names.slice();
11124
+ parts.forEach(function(name2) {
11125
+ if (next.indexOf(name2) < 0) next.push(name2);
11126
+ });
11127
+ emit(next);
11128
+ setDraft("");
11129
+ }
11130
+ var selectedIds = rows.filter(function(x) {
11131
+ return names.indexOf(String(x.name)) >= 0;
11132
+ }).map(function(x) {
11133
+ return String(x.id);
11134
+ });
11135
+ return h2(
11136
+ "div",
11137
+ { className: "wbt-tagpick" },
11138
+ names.length ? h2("div", { className: "wbt-tagchips", role: "group", "aria-label": t.tagSelected }, names.map(function(name2) {
11139
+ return h2(
11140
+ "button",
11141
+ { key: name2, type: "button", className: "wbt-tagchip", title: t.tagRemove, onClick: function() {
11142
+ toggle(name2);
11143
+ } },
11144
+ h2("span", null, name2),
11145
+ h2("span", { className: "wbt-tagchip-x", "aria-hidden": true }, "\xD7")
11146
+ );
11147
+ })) : h2("p", { className: "wbctl-note" }, t.tagNoPick),
11148
+ h2(FilterChecklist, {
11149
+ items: rows.map(function(x) {
11150
+ return { id: String(x.id), name: x.name, meta: x.total };
11151
+ }),
11152
+ selected: selectedIds,
11153
+ onToggle: toggleId,
11154
+ onClear: function() {
11155
+ emit([]);
11156
+ },
11157
+ query,
11158
+ onQuery: setQuery,
11159
+ loading,
11160
+ hasMore,
11161
+ onLoadMore: loadMore,
11162
+ total,
11163
+ title: t.allTags || "\u5168\u90E8\u6807\u7B7E",
11164
+ selectedText: t.tagSelected || "\u5DF2\u9009",
11165
+ clearText: t.clear || "\u6E05\u7A7A",
11166
+ searchPlaceholder: t.tagSearchExisting || "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E",
11167
+ emptyText: t.noTags || "\u6682\u65E0\u6807\u7B7E",
11168
+ noMatchText: t.tagNoMatch || "\u6CA1\u6709\u5339\u914D\u7684\u6807\u7B7E",
11169
+ loadingText: t.loadingMore || "\u52A0\u8F7D\u4E2D\u2026",
11170
+ noMoreText: t.noMore || "\u6CA1\u6709\u66F4\u591A",
11171
+ autoFocus: false
11172
+ }),
11173
+ h2(
10285
11174
  "div",
10286
- { className: "wbt-modal-foot" },
10287
- h("button", { className: "wbt-btn ghost", disabled: isBusy, onClick: requestClose }, t.cancel),
10288
- h("button", { className: "wbt-btn primary", disabled: isBusy || !!priorityError || !targetValid || source === "2" && !(origin && origin.timelineId), onClick: submit }, isBusy ? "\u2026" : t.create)
11175
+ { className: "wbt-tagnew" },
11176
+ h2("input", {
11177
+ className: "wbt-input",
11178
+ value: draft,
11179
+ placeholder: t.tagNewPlaceholder,
11180
+ "aria-label": t.tagNewPlaceholder,
11181
+ onChange: function(e) {
11182
+ setDraft(e.target.value);
11183
+ },
11184
+ onKeyDown: function(e) {
11185
+ if (e.key === "Enter") {
11186
+ e.preventDefault();
11187
+ addDraft();
11188
+ }
11189
+ }
11190
+ }),
11191
+ h2("button", { type: "button", className: "wbt-btn", disabled: !splitTags(draft).length, onClick: addDraft }, t.tagAdd || "\u6DFB\u52A0")
10289
11192
  )
10290
- )
10291
- );
11193
+ );
11194
+ }
11195
+ function stepTags(h2) {
11196
+ return h2(
11197
+ "div",
11198
+ { className: "wbctl-form" },
11199
+ h2("div", { className: "full" }, h2(TagPicker, { h: h2, api: props.api, t, value: form.tags, onChange: function(next) {
11200
+ set("tags", next);
11201
+ } }))
11202
+ );
11203
+ }
11204
+ function stepTable(h2) {
11205
+ return h2(
11206
+ "div",
11207
+ { className: "wbctl-form" },
11208
+ h2(
11209
+ "div",
11210
+ { className: "full" },
11211
+ fields({ form, set, setMany, tree: props.tree, recommended: props.defaultTableId || origin && origin.tableId })
11212
+ )
11213
+ );
11214
+ }
11215
+ function stepTimeline(h2) {
11216
+ if (source === "2") {
11217
+ return h2(
11218
+ "div",
11219
+ { className: "wbctl-form" },
11220
+ h2("p", { className: "wbt-mhint full" }, tr("\u7EE7\u627F\u6765\u6E90\u4EFB\u52A1\u7684\u65F6\u95F4\u7EBF")),
11221
+ !(origin && origin.timelineId) ? h2("p", { className: "wbt-err full", role: "alert" }, tr("\u8BF7\u5148\u624B\u52A8\u5EFA\u7ACB\u5E76\u5173\u8054\u65F6\u95F4\u7EBF\uFF0C\u518D\u91CD\u542F")) : null
11222
+ );
11223
+ }
11224
+ return h2("div", { className: "wbctl-form" }, timelineSection);
11225
+ }
11226
+ function stepWorkspace(h2) {
11227
+ return h2(
11228
+ "div",
11229
+ { className: "wbctl-form" },
11230
+ h2(WorkspaceSelect, { api: props.api, lang: props.lang, value: form.workspaceIds, onChange: function(ids) {
11231
+ set("workspaceIds", ids);
11232
+ } })
11233
+ );
11234
+ }
11235
+ var steps = [
11236
+ {
11237
+ key: "content",
11238
+ label: t.stepContent,
11239
+ hint: t.stepContentHint,
11240
+ render: stepContent,
11241
+ validate: function() {
11242
+ if (!String(form.title).trim()) return t.needTitle;
11243
+ if (priorityError) return priorityError;
11244
+ if (!difficultyCheck.ok) return difficultyCheck.error;
11245
+ if (!form.publishDate || !form.targetDate) return t.needDate;
11246
+ return "";
11247
+ }
11248
+ }
11249
+ ];
11250
+ if (hostHasAddon("wb-addon-tags")) {
11251
+ steps.push({ key: "tags", label: t.stepTags, hint: t.stepTagsHint, render: stepTags });
11252
+ }
11253
+ steps.push({
11254
+ key: "table",
11255
+ label: t.stepTable,
11256
+ hint: t.stepTableHint,
11257
+ render: stepTable,
11258
+ validate: function() {
11259
+ return targetValid ? "" : form.newPath ? plan.error || "\u8BF7\u786E\u8BA4\u65B0\u5EFA\u8DEF\u5F84" : t.needTable;
11260
+ }
11261
+ });
11262
+ steps.push({
11263
+ key: "timeline",
11264
+ label: t.stepTimeline,
11265
+ hint: t.stepTimelineHint,
11266
+ render: stepTimeline,
11267
+ validate: function() {
11268
+ if (source === "2" && !(origin && origin.timelineId)) return tr("\u8BF7\u5148\u624B\u52A8\u5EFA\u7ACB\u5E76\u5173\u8054\u65F6\u95F4\u7EBF\uFF0C\u518D\u91CD\u542F");
11269
+ if (source === "1" && !form.timelineId) return tr("\u8BF7\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF");
11270
+ return "";
11271
+ }
11272
+ });
11273
+ steps.push({ key: "workspace", label: t.stepWorkspace, hint: t.stepWorkspaceHint, render: stepWorkspace });
11274
+ return h(StagedDialog, {
11275
+ title,
11276
+ closeLabel: t.cancel,
11277
+ steps,
11278
+ submitting: isBusy,
11279
+ error,
11280
+ onClose: requestClose,
11281
+ onSubmit: submit,
11282
+ submitText: t.create,
11283
+ cancelText: t.cancel,
11284
+ nextText: t.nextStep || "\u4E0B\u4E00\u6B65",
11285
+ backText: t.prevStep || "\u4E0A\u4E00\u6B65",
11286
+ stepsLabel: t.createSteps || "\u521B\u5EFA\u6B65\u9AA4"
11287
+ });
10292
11288
  }
10293
11289
  return CreateModal;
10294
11290
  };
10295
11291
  }
10296
11292
  });
10297
11293
 
11294
+ // packages/addons/tasks/client/views/slot-task-from-message.cjs
11295
+ var require_slot_task_from_message = __commonJS({
11296
+ "packages/addons/tasks/client/views/slot-task-from-message.cjs"(exports2, module2) {
11297
+ "use strict";
11298
+ module2.exports = function(deps) {
11299
+ var React = deps.React;
11300
+ var h = React.createElement;
11301
+ var Icon2 = deps.Icon;
11302
+ var injectCss = deps.injectCss;
11303
+ var KIND = "mail.message";
11304
+ function flattenTables(nodes, out) {
11305
+ var list = out || [];
11306
+ (nodes || []).forEach(function(node) {
11307
+ if (!node) return;
11308
+ if (String(node.type) === "1") list.push({ id: String(node.id), name: String(node.name || node.path || node.id) });
11309
+ if (node.children && node.children.length) flattenTables(node.children, list);
11310
+ });
11311
+ return list;
11312
+ }
11313
+ function defaultTitle(item, en) {
11314
+ var subject = String(item && item.title || "").trim();
11315
+ if (subject) return subject;
11316
+ return en ? "Follow up: (no subject)" : "\u8DDF\u8FDB\uFF1A\uFF08\u65E0\u4E3B\u9898\uFF09";
11317
+ }
11318
+ function buildDescription(item, en) {
11319
+ var lines = [en ? "Created from a mail message." : "\u7531\u90AE\u4EF6\u521B\u5EFA\u3002"];
11320
+ if (item.subtitle) lines.push((en ? "From: " : "\u53D1\u4EF6\u4EBA\uFF1A") + item.subtitle);
11321
+ if (item.title) lines.push((en ? "Subject: " : "\u4E3B\u9898\uFF1A") + item.title);
11322
+ lines.push((en ? "Source mail: " : "\u6765\u6E90\u90AE\u4EF6\uFF1A") + "wb-mail:" + item.id);
11323
+ return lines.join("\n");
11324
+ }
11325
+ return function TaskFromMessage(props) {
11326
+ React.useEffect(function() {
11327
+ injectCss();
11328
+ }, []);
11329
+ var item = props.item;
11330
+ var en = props.lang === "en";
11331
+ var api = props.api;
11332
+ var open = React.useState(false);
11333
+ var tables = React.useState(null);
11334
+ var tableId = React.useState("");
11335
+ var title = React.useState("");
11336
+ var busy = React.useState(false);
11337
+ var error = React.useState("");
11338
+ var created = React.useState(null);
11339
+ if (!item || item.kind !== KIND || !item.id) return null;
11340
+ function loadTables() {
11341
+ if (tables[0] !== null) return;
11342
+ tables[1](void 0);
11343
+ api.call("taskNodes.tree").then(function(r) {
11344
+ if (!r || !r.ok) throw new Error(r && r.error || "tree load failed");
11345
+ var list = flattenTables(Array.isArray(r.result) ? r.result : []);
11346
+ tables[1](list);
11347
+ if (list.length === 1) tableId[1](list[0].id);
11348
+ }).catch(function(e) {
11349
+ tables[1]([]);
11350
+ error[1](String(e && e.message || e));
11351
+ });
11352
+ }
11353
+ function toggle() {
11354
+ if (!open[0]) {
11355
+ title[1](defaultTitle(item, en));
11356
+ loadTables();
11357
+ }
11358
+ open[1](!open[0]);
11359
+ }
11360
+ function submit() {
11361
+ if (busy[0]) return;
11362
+ var name = String(title[0] || "").trim();
11363
+ if (!name) {
11364
+ error[1](en ? "Title is required" : "\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");
11365
+ return;
11366
+ }
11367
+ if (!tableId[0]) {
11368
+ error[1](en ? "Pick a target table" : "\u8BF7\u9009\u62E9\u76EE\u6807\u8868");
11369
+ return;
11370
+ }
11371
+ busy[1](true);
11372
+ error[1]("");
11373
+ api.call("tasks.create", {
11374
+ title: name,
11375
+ description: buildDescription(item, en),
11376
+ tableId: tableId[0],
11377
+ dedupeKey: KIND + ":" + item.id
11378
+ }).then(function(r) {
11379
+ if (!r || !r.ok) throw new Error(r && r.error || "create failed");
11380
+ created[1](r.result || {});
11381
+ open[1](false);
11382
+ }).catch(function(e) {
11383
+ error[1](String(e && e.message || e));
11384
+ }).finally(function() {
11385
+ busy[1](false);
11386
+ });
11387
+ }
11388
+ if (created[0]) {
11389
+ var task = created[0];
11390
+ var shortId = String(task.id || "").slice(0, 8);
11391
+ return h(
11392
+ "span",
11393
+ { className: "wbtx-slot-done" },
11394
+ h("span", { className: "wbtx-slot-note" }, (en ? "Task created" : "\u5DF2\u5EFA\u4EFB\u52A1") + (shortId ? " \xB7 " + shortId : "")),
11395
+ h("button", {
11396
+ type: "button",
11397
+ className: "wbtx-slot-link",
11398
+ onClick: function(e) {
11399
+ e.stopPropagation();
11400
+ props.onNavigate("tasks");
11401
+ }
11402
+ }, en ? "Open tasks" : "\u53BB\u4EFB\u52A1\u9875")
11403
+ );
11404
+ }
11405
+ var loading = tables[0] === void 0;
11406
+ var options = Array.isArray(tables[0]) ? tables[0] : [];
11407
+ return h(
11408
+ "span",
11409
+ { className: "wbtx-slot" },
11410
+ h("button", {
11411
+ type: "button",
11412
+ className: "wbt-btn wbtx-slot-btn",
11413
+ "aria-expanded": !!open[0],
11414
+ disabled: busy[0],
11415
+ title: en ? "Create a task from this message" : "\u628A\u8FD9\u5C01\u90AE\u4EF6\u53D8\u6210\u4EFB\u52A1",
11416
+ onClick: function(e) {
11417
+ e.stopPropagation();
11418
+ toggle();
11419
+ }
11420
+ }, h(Icon2, { name: "plus", size: 13 }), en ? "New task" : "\u5EFA\u4EFB\u52A1"),
11421
+ open[0] ? h(
11422
+ "span",
11423
+ { className: "wbtx-slot-panel" },
11424
+ h(
11425
+ "label",
11426
+ { className: "wbtx-slot-row" },
11427
+ h("span", null, en ? "Title" : "\u6807\u9898"),
11428
+ h("input", {
11429
+ className: "wbt-input wbtx-slot-input",
11430
+ value: title[0],
11431
+ autoFocus: true,
11432
+ onChange: function(e) {
11433
+ title[1](e.target.value);
11434
+ },
11435
+ onKeyDown: function(e) {
11436
+ if (e.key === "Enter") {
11437
+ e.preventDefault();
11438
+ submit();
11439
+ }
11440
+ if (e.key === "Escape") open[1](false);
11441
+ }
11442
+ })
11443
+ ),
11444
+ h(
11445
+ "label",
11446
+ { className: "wbtx-slot-row" },
11447
+ h("span", null, en ? "Table" : "\u76EE\u6807\u8868"),
11448
+ loading ? h("span", { className: "wbtx-slot-muted" }, en ? "Loading\u2026" : "\u8BFB\u53D6\u4E2D\u2026") : options.length ? h("select", {
11449
+ className: "wbt-input wbtx-slot-input",
11450
+ value: tableId[0],
11451
+ onChange: function(e) {
11452
+ tableId[1](e.target.value);
11453
+ }
11454
+ }, [h("option", { key: "", value: "" }, en ? "Pick a table" : "\u9009\u62E9\u76EE\u6807\u8868")].concat(
11455
+ options.map(function(o) {
11456
+ return h("option", { key: o.id, value: o.id }, o.name);
11457
+ })
11458
+ )) : h("span", { className: "wbtx-slot-muted" }, en ? "No task table yet" : "\u8FD8\u6CA1\u6709\u4EFB\u52A1\u8868")
11459
+ ),
11460
+ error[0] ? h("span", { className: "wbt-err", role: "alert" }, error[0]) : null,
11461
+ h(
11462
+ "span",
11463
+ { className: "wbtx-slot-foot" },
11464
+ h("button", { type: "button", className: "wbt-btn ghost", onClick: function(e) {
11465
+ e.stopPropagation();
11466
+ open[1](false);
11467
+ } }, en ? "Cancel" : "\u53D6\u6D88"),
11468
+ h("button", {
11469
+ type: "button",
11470
+ className: "wbt-btn primary",
11471
+ disabled: busy[0] || loading || !options.length,
11472
+ onClick: function(e) {
11473
+ e.stopPropagation();
11474
+ submit();
11475
+ }
11476
+ }, busy[0] ? "\u2026" : en ? "Create" : "\u521B\u5EFA")
11477
+ )
11478
+ ) : null
11479
+ );
11480
+ };
11481
+ };
11482
+ }
11483
+ });
11484
+
10298
11485
  // packages/addons/tasks/client/timeline/timeline-member-rows.cjs
10299
11486
  var require_timeline_member_rows = __commonJS({
10300
11487
  "packages/addons/tasks/client/timeline/timeline-member-rows.cjs"(exports2, module2) {
@@ -10578,6 +11765,7 @@ var require_task_timeline_modal = __commonJS({
10578
11765
  var require_edit_modal = __commonJS({
10579
11766
  "packages/addons/tasks/client/modals/edit-modal.cjs"(exports2, module2) {
10580
11767
  "use strict";
11768
+ var NF = require_number_field();
10581
11769
  module2.exports = function createEditModal(React, statusInfo, stars) {
10582
11770
  var h = React.createElement;
10583
11771
  var difficultyField = require_difficulty_field()(React);
@@ -10641,12 +11829,22 @@ var require_edit_modal = __commonJS({
10641
11829
  });
10642
11830
  }
10643
11831
  var titleOk = String(form.title).trim().length > 0;
11832
+ var priorityCheck = canPriority ? NF.validateNumber(form.priority, { min: String(task.status) === "1" ? 0 : 1, max: 10, integer: true, lang: props.lang }) : { ok: true, value: 0, error: "" };
11833
+ var difficultyCheck = NF.validateNumber(form.difficulty, { min: 0, max: 5, step: 0.5, allowEmpty: true, lang: props.lang });
10644
11834
  function submit() {
10645
11835
  if (isBusy || submission.pending) return;
10646
11836
  if (!titleOk) {
10647
11837
  setErr(t.needTitle);
10648
11838
  return;
10649
11839
  }
11840
+ if (!priorityCheck.ok) {
11841
+ setErr(priorityCheck.error);
11842
+ return;
11843
+ }
11844
+ if (!difficultyCheck.ok) {
11845
+ setErr(difficultyCheck.error);
11846
+ return;
11847
+ }
10650
11848
  var patch = { id: task.id, title: String(form.title).trim(), description: String(form.description || "") };
10651
11849
  if (form.tableId && form.tableId !== String(task.tableId || "")) {
10652
11850
  if (!ownership.tables(props.tree).some(function(x) {
@@ -10658,13 +11856,10 @@ var require_edit_modal = __commonJS({
10658
11856
  patch.tableId = form.tableId;
10659
11857
  }
10660
11858
  if (canPriority) {
10661
- var p = Math.round(Number(form.priority));
10662
- if (!isFinite(p)) p = 1;
10663
- if (!Number.isFinite(p)) p = 0;
10664
- patch.priority = Math.max(1, Math.min(10, p));
11859
+ patch.priority = priorityCheck.value;
10665
11860
  if (String(form.targetDate || "").trim()) patch.targetDate = String(form.targetDate).trim();
10666
11861
  }
10667
- patch.difficulty = Math.max(0, Math.min(5, Number(form.difficulty) || 0));
11862
+ patch.difficulty = difficultyCheck.value || 0;
10668
11863
  patch.workspaceIds = (form.workspaceIds || []).slice();
10669
11864
  if (String(form.review) !== String(task.review || "")) patch.review = String(form.review);
10670
11865
  submission.pending = true;
@@ -10733,16 +11928,30 @@ var require_edit_modal = __commonJS({
10733
11928
  } })
10734
11929
  ) : null,
10735
11930
  canPriority ? h(
10736
- "label",
11931
+ "div",
10737
11932
  { className: "wbt-field" },
10738
- h("span", null, t.priority + "\uFF081\u201310\uFF09"),
10739
- h("input", { className: "wbt-input", type: "number", min: 1, max: 10, step: 1, value: form.priority, onChange: function(e) {
10740
- set("priority", e.target.value);
10741
- } })
11933
+ h("span", { className: "wbt-field-label" }, t.priority + "\uFF081\u201310\uFF09"),
11934
+ h(NF.NumberField, {
11935
+ h,
11936
+ lang: props.lang,
11937
+ value: form.priority,
11938
+ min: 1,
11939
+ max: 10,
11940
+ integer: true,
11941
+ hint: false,
11942
+ ariaLabel: t.priority,
11943
+ // 键入即写草稿,合法性交给 priorityCheck(保存按钮据此禁用),绝不夹取。
11944
+ onDraft: function(raw) {
11945
+ set("priority", raw);
11946
+ },
11947
+ onCommit: function(next) {
11948
+ set("priority", String(next));
11949
+ }
11950
+ })
10742
11951
  ) : null,
10743
11952
  difficultyField(t, form.difficulty, function(value) {
10744
11953
  set("difficulty", value);
10745
- }, "wbt-edit-difficulty"),
11954
+ }, "wbt-edit-difficulty", props.lang),
10746
11955
  h(WorkspaceSelect, { api: props.api, lang: props.lang, value: form.workspaceIds, onChange: function(ids) {
10747
11956
  set("workspaceIds", ids);
10748
11957
  } }),
@@ -10751,7 +11960,7 @@ var require_edit_modal = __commonJS({
10751
11960
  "div",
10752
11961
  { className: "wbt-modal-foot" },
10753
11962
  h("button", { className: "wbt-btn ghost", disabled: isBusy, onClick: requestClose }, t.cancel),
10754
- h("button", { className: "wbt-btn primary", disabled: isBusy || !titleOk, onClick: submit }, isBusy ? "\u2026" : t.save)
11963
+ h("button", { className: "wbt-btn primary", disabled: isBusy || !titleOk || !priorityCheck.ok || !difficultyCheck.ok, onClick: submit }, isBusy ? "\u2026" : t.save)
10755
11964
  )
10756
11965
  )
10757
11966
  );
@@ -11141,43 +12350,7 @@ var require_task_filter_panel = __commonJS({
11141
12350
  var model = require_task_filter_model();
11142
12351
  var DateFilter = require_date_filter().DateFilter;
11143
12352
  var WorkspaceFilter = require_workspacefilter();
11144
- function NumberInput(p) {
11145
- var React = p.React, draftState = React.useState(String(p.value)), draft = draftState[0], setDraft = draftState[1];
11146
- React.useEffect(function() {
11147
- setDraft(String(p.value));
11148
- }, [p.value]);
11149
- function commit(node) {
11150
- var result = p.commit(node.validity && node.validity.badInput ? "invalid" : draft);
11151
- setDraft(result === void 0 ? String(p.value) : result);
11152
- }
11153
- return React.createElement("input", {
11154
- type: "number",
11155
- className: "wbt-input wbt-limit-input",
11156
- min: p.min,
11157
- max: p.max,
11158
- step: p.step,
11159
- inputMode: p.step === 1 ? "numeric" : "decimal",
11160
- value: draft,
11161
- "aria-label": p.label,
11162
- placeholder: p.placeholder,
11163
- onChange: function(e) {
11164
- setDraft(e.target.value);
11165
- },
11166
- onBlur: function(e) {
11167
- commit(e.currentTarget);
11168
- },
11169
- onKeyDown: function(e) {
11170
- if (e.key === "Enter") {
11171
- e.preventDefault();
11172
- e.currentTarget.blur();
11173
- }
11174
- if (e.key === "Escape") {
11175
- e.preventDefault();
11176
- setDraft(String(p.value));
11177
- }
11178
- }
11179
- });
11180
- }
12353
+ var NF = require_number_field();
11181
12354
  module2.exports = function renderFilterPanel(React, p) {
11182
12355
  var h = React.createElement, en = p.lang === "en", value = p.value;
11183
12356
  var title = en ? "Filters" : "\u7B5B\u9009";
@@ -11207,7 +12380,8 @@ var require_task_filter_panel = __commonJS({
11207
12380
  p.onHint(hints.join(" \xB7 "));
11208
12381
  change(result.value);
11209
12382
  }
11210
- function setLimit(key, end, text) {
12383
+ function setLimit(key, end, next) {
12384
+ var text = next === null || next === void 0 ? "" : String(next);
11211
12385
  var result = model.limit(value, key, end, text);
11212
12386
  if (!result) {
11213
12387
  p.onHint(en ? key === "difficulty" ? "Difficulty takes 0.5 steps from 0 to 5" : "Priority takes whole numbers 0\u201310" : key === "difficulty" ? "\u96BE\u5EA6\u4EC5\u63A5\u53D7 0\u20135 \u4E4B\u95F4\u7684\u534A\u6863\u6570\u503C" : "\u4F18\u5148\u7EA7\u4EC5\u63A5\u53D7 0\u201310 \u7684\u6574\u6570");
@@ -11219,15 +12393,28 @@ var require_task_filter_panel = __commonJS({
11219
12393
  p.onHint(hints.join(" \xB7 "));
11220
12394
  if (result.clearsMissing && p.onMissingChange) p.onMissingChange(false);
11221
12395
  change(result.value);
11222
- return result.value[key][end];
11223
12396
  }
11224
12397
  function limitRow(key, label) {
11225
12398
  var box = value[key], spec = model.limits[key];
11226
12399
  function field(end) {
11227
12400
  var labelText = en ? (end === "min" ? "Minimum " : "Maximum ") + label : (end === "min" ? "\u6700\u4F4E" : "\u6700\u9AD8") + label;
11228
- return h(NumberInput, { React, value: box[end], min: spec.min, max: spec.max, step: spec.step, label: labelText, placeholder: String(end === "min" ? spec.min : spec.max), commit: function(text) {
11229
- return setLimit(key, end, text);
11230
- } });
12401
+ return h(NF.NumberField, {
12402
+ h,
12403
+ lang: p.lang,
12404
+ value: box[end],
12405
+ min: spec.min,
12406
+ max: spec.max,
12407
+ step: spec.step,
12408
+ integer: spec.step === 1,
12409
+ allowEmpty: true,
12410
+ hint: false,
12411
+ className: "wbt-limit-field",
12412
+ ariaLabel: labelText,
12413
+ placeholder: String(end === "min" ? spec.min : spec.max),
12414
+ onCommit: function(next) {
12415
+ setLimit(key, end, next);
12416
+ }
12417
+ });
11231
12418
  }
11232
12419
  function clear() {
11233
12420
  p.onHint("");
@@ -11435,6 +12622,7 @@ var require_tasks_view = __commonJS({
11435
12622
  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;
11436
12623
  var h = React.createElement, filters = require_task_filter_model(), renderFilters = require_task_filter_panel(), claimBatch = require_claim_batch(), renderSelectionBar = require_selection_bar();
11437
12624
  var TaskPreview = require_task_preview()(React, TaskItem);
12625
+ var SW = require_switch();
11438
12626
  function TasksView(props) {
11439
12627
  var lang = props.lang === "en" ? "en" : "zh";
11440
12628
  var cfg = configView.useConfig(props.api, CFG_FALLBACK);
@@ -12025,16 +13213,16 @@ var require_tasks_view = __commonJS({
12025
13213
  api,
12026
13214
  t,
12027
13215
  Icon: Icon2,
12028
- missing: h("label", { className: "wbt-check" }, h("input", {
12029
- type: "checkbox",
12030
- checked: difficultyMissing,
12031
- onChange: function(e) {
12032
- var next = e.target.checked;
13216
+ missing: h(SW.Switch, {
13217
+ h,
13218
+ checked: !!difficultyMissing,
13219
+ label: t.difficultyMissing,
13220
+ onChange: function(next) {
12033
13221
  setDifficultyMissing(next);
12034
13222
  if (next) setFilterValue(filters.clearDifficulty(filterValue));
12035
13223
  setPageNumber(1);
12036
13224
  }
12037
- }), t.difficultyMissing)
13225
+ })
12038
13226
  });
12039
13227
  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) {
12040
13228
  return h(TaskItem, {
@@ -12358,6 +13546,7 @@ var require_tasks_view = __commonJS({
12358
13546
  t,
12359
13547
  api,
12360
13548
  task: doneTask,
13549
+ lang: props.lang,
12361
13550
  onClose: function() {
12362
13551
  setDoneTask(null);
12363
13552
  },
@@ -12551,6 +13740,7 @@ var require_timeline_view = __commonJS({
12551
13740
  var receipts = require_ownership();
12552
13741
  var splitTitle = require_timeline_title();
12553
13742
  var Highlight = require_highlight2()(React);
13743
+ var SW = require_switch();
12554
13744
  function result(r) {
12555
13745
  if (!r || !r.ok) throw new Error(r && r.error || "Request failed");
12556
13746
  return r.result;
@@ -12789,10 +13979,10 @@ var require_timeline_view = __commonJS({
12789
13979
  } }),
12790
13980
  h("button", { className: "wbt-btn", type: "submit" }, t.timelineSearchButton)
12791
13981
  ),
12792
- h("label", { className: "wbt-timeline-single" }, h("input", { type: "checkbox", "aria-label": t.timelineSingletons, checked: single, onChange: function(e) {
12793
- setSingle(e.target.checked);
13982
+ h(SW.Switch, { h, checked: !!single, label: t.timelineSingletons, onChange: function(next) {
13983
+ setSingle(next);
12794
13984
  setPage(1);
12795
- } }), t.timelineSingletons)
13985
+ } })
12796
13986
  ),
12797
13987
  h(
12798
13988
  "div",
@@ -13146,20 +14336,7 @@ var require_timeline_view = __commonJS({
13146
14336
  title: over ? "\u5DF2\u8D85\u8FC7\u8BA1\u5212\u5B8C\u6210\u65F6\u95F4" : "\u8DDD\u8BA1\u5212\u5B8C\u6210"
13147
14337
  }, h(Icon2, { name: "clock", size: 11 }), h("span", { className: "wbt-cd-num" }, text));
13148
14338
  }
13149
- var CSS = require_styles() + "\n" + require_timeline_styles();
13150
- function injectCss() {
13151
- if (typeof document === "undefined") return;
13152
- var old = document.getElementById("wb-addon-tasks-v2-css");
13153
- if (old) {
13154
- old.textContent = CSS;
13155
- return;
13156
- }
13157
- var s = document.createElement("style");
13158
- s.id = "wb-addon-tasks-v2-css";
13159
- s.setAttribute("data-wb-addon", "wb-addon-tasks");
13160
- s.textContent = CSS;
13161
- document.head.appendChild(s);
13162
- }
14339
+ var injectCss = require_inject_css();
13163
14340
  function cx() {
13164
14341
  return Array.prototype.filter.call(arguments, Boolean).join(" ");
13165
14342
  }
@@ -13283,7 +14460,9 @@ var require_timeline_view = __commonJS({
13283
14460
  cx,
13284
14461
  Icon: Icon2,
13285
14462
  Countdown,
13286
- PathCrumbs
14463
+ PathCrumbs,
14464
+ // 任务详情也开 item.actions 落点:来源插件把「回到原处」挂进来。
14465
+ Slot: host.Slot
13287
14466
  });
13288
14467
  function TreeNode(props) {
13289
14468
  var node = props.node;
@@ -13475,6 +14654,7 @@ var require_timeline_view = __commonJS({
13475
14654
  );
13476
14655
  }
13477
14656
  var CreateModal = require_create_modal()({ React, allTables, tagNames, splitTags, today, addDays, hostHasAddon });
14657
+ var slotTaskFromMessage = require_slot_task_from_message()({ React, Icon: Icon2, injectCss });
13478
14658
  var TimelineModal = require_task_timeline_modal()(React, statusInfo);
13479
14659
  function DoneModal(props) {
13480
14660
  var t = props.t;
@@ -13494,7 +14674,7 @@ var require_timeline_view = __commonJS({
13494
14674
  { className: "wbt-modal", style: { width: "420px" } },
13495
14675
  h("div", { className: "wbt-modal-head" }, h("h3", null, t.complete + " \xB7 " + props.task.title), h("button", { className: "wbt-icon", onClick: props.onClose }, "\xD7")),
13496
14676
  h("div", { className: "wbt-mhint" }, t.difficultyHint),
13497
- require_difficulty_field()(React)(t, value, setValue, "wbt-done-difficulty"),
14677
+ require_difficulty_field()(React)(t, value, setValue, "wbt-done-difficulty", props.lang),
13498
14678
  h(
13499
14679
  "label",
13500
14680
  { className: "wbt-field", style: { marginTop: "12px" } },
@@ -13544,8 +14724,11 @@ var require_timeline_view = __commonJS({
13544
14724
  var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
13545
14725
  host.registerAddon({
13546
14726
  id: "wb-addon-tasks",
13547
- version: "5.2.33",
14727
+ version: "5.2.40",
13548
14728
  icon: ICONS["list-checks"],
14729
+ // 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
14730
+ // 不会在邮件里留一个渲染即报错的孤儿按钮。
14731
+ slots: [{ slot: "item.actions", id: "tasks.create-from-mail", order: 100, component: slotTaskFromMessage }],
13549
14732
  views: [
13550
14733
  { id: "stats", icon: tabIcon("chart"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: statsView.TasksStatsView, keepAlive: true },
13551
14734
  { id: "tasks", icon: tabIcon("list"), title: { zh: "\u8BB0\u5F55", en: "Records" }, component: TasksView },