dsh-workbench-tasks 5.2.35 → 5.2.41

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 +1212 -407
  2. package/lib/index.js +1 -1
  3. package/package.json +2 -2
package/lib/client.js CHANGED
@@ -186,13 +186,266 @@ var require_filter_checklist = __commonJS({
186
186
  }
187
187
  });
188
188
 
189
+ // packages/addons/lib/search-picker.cjs
190
+ var require_search_picker = __commonJS({
191
+ "packages/addons/lib/search-picker.cjs"(exports2, module2) {
192
+ "use strict";
193
+ var React = require("react");
194
+ var h = React.createElement;
195
+ var FilterChecklist = require_filter_checklist();
196
+ var DEFAULT_TEXTS = {
197
+ all: "\u5168\u90E8",
198
+ selected: "\u5DF2\u9009",
199
+ clear: "\u6E05\u7A7A",
200
+ searchPlaceholder: "\u641C\u7D22",
201
+ empty: "\u6682\u65E0\u6570\u636E",
202
+ noMatch: "\u6CA1\u6709\u5339\u914D\u9879",
203
+ loading: "\u52A0\u8F7D\u4E2D\u2026",
204
+ noMore: "\u6CA1\u6709\u66F4\u591A"
205
+ };
206
+ function asText(x) {
207
+ return String(x == null ? "" : x).toLowerCase();
208
+ }
209
+ function filterLocal(items, query) {
210
+ var q = String(query || "").trim();
211
+ if (!q) return items;
212
+ var needle = asText(q);
213
+ return items.filter(function(x) {
214
+ return asText(x.name).indexOf(needle) >= 0 || asText(x.meta).indexOf(needle) >= 0;
215
+ });
216
+ }
217
+ function useRemoteSource(conf) {
218
+ var RT = conf.React || React;
219
+ var open = conf.open;
220
+ var query = conf.query;
221
+ var fetchPage = conf.fetchPage;
222
+ var pageSize = conf.pageSize;
223
+ var debounce = conf.debounce;
224
+ var dedupe = conf.dedupe;
225
+ var mapPage = conf.mapPage;
226
+ var reloadKey = conf.reloadKey;
227
+ var rowsS = RT.useState([]);
228
+ var totalS = RT.useState(0);
229
+ var pageS = RT.useState(0);
230
+ var moreS = RT.useState(false);
231
+ var loadS = RT.useState(false);
232
+ var seq = RT.useRef ? RT.useRef(0) : { current: 0 };
233
+ function load(q, pageNumber, append) {
234
+ var mine = ++seq.current;
235
+ loadS[1](true);
236
+ return Promise.resolve(fetchPage(q, pageNumber)).then(function(raw) {
237
+ if (mine !== seq.current) return;
238
+ loadS[1](false);
239
+ var next = mapPage ? mapPage(raw, pageNumber) : raw || {};
240
+ var list = next.rows || [];
241
+ rowsS[1](function(prev) {
242
+ if (!append) return list;
243
+ var joined = dedupe === false ? prev.concat(list) : prev.concat(list);
244
+ if (dedupe === false) return joined;
245
+ var seen = {};
246
+ return joined.filter(function(x) {
247
+ var key = String(x.id);
248
+ if (seen[key]) return false;
249
+ seen[key] = true;
250
+ return true;
251
+ });
252
+ });
253
+ totalS[1](typeof next.total === "number" ? next.total : list.length);
254
+ pageS[1](next.page || pageNumber);
255
+ moreS[1](!!next.hasMore);
256
+ }).catch(function() {
257
+ if (mine === seq.current) loadS[1](false);
258
+ });
259
+ }
260
+ RT.useEffect(
261
+ function() {
262
+ if (!open) return void 0;
263
+ var timer = setTimeout(
264
+ function() {
265
+ load(query, 1, false);
266
+ },
267
+ query ? debounce : 0
268
+ );
269
+ return function() {
270
+ clearTimeout(timer);
271
+ };
272
+ },
273
+ [open, query, reloadKey]
274
+ );
275
+ return {
276
+ rows: rowsS[0],
277
+ total: totalS[0],
278
+ page: pageS[0],
279
+ hasMore: moreS[0],
280
+ loading: loadS[0],
281
+ loadQuery: load,
282
+ reset: function() {
283
+ seq.current += 1;
284
+ rowsS[1]([]);
285
+ totalS[1](0);
286
+ pageS[1](0);
287
+ moreS[1](false);
288
+ loadS[1](false);
289
+ }
290
+ };
291
+ }
292
+ function SearchPicker(props) {
293
+ var RT = props.React || React;
294
+ var texts = Object.assign({}, DEFAULT_TEXTS, props.texts || {});
295
+ var classes = props.classes || {};
296
+ var mode = props.mode === "single" ? "single" : "multi";
297
+ var disabled = props.disabled === true;
298
+ var selected = (props.selected || []).map(String);
299
+ var items = props.items || null;
300
+ var fetchPage = props.fetchPage || null;
301
+ var pageSize = props.pageSize || 20;
302
+ var debounce = props.debounce === void 0 ? 200 : props.debounce;
303
+ var allItems = items || [];
304
+ var openS = RT.useState(false);
305
+ var open = openS[0];
306
+ var queryS = RT.useState("");
307
+ var query = queryS[0];
308
+ var boxRef = RT.useRef ? RT.useRef(null) : { current: null };
309
+ var remote = fetchPage ? useRemoteSource({
310
+ React: RT,
311
+ open,
312
+ query,
313
+ fetchPage,
314
+ pageSize,
315
+ debounce,
316
+ dedupe: props.dedupe,
317
+ mapPage: props.mapPage,
318
+ reloadKey: props.reloadKey
319
+ }) : null;
320
+ var rows = remote ? remote.rows : filterLocal(allItems, query);
321
+ var loading = remote ? remote.loading : false;
322
+ var total = remote ? remote.total : rows.length;
323
+ var hasMore = remote ? remote.hasMore : false;
324
+ RT.useEffect(function() {
325
+ if (!open || typeof document === "undefined") return void 0;
326
+ function onDown(e) {
327
+ var box = boxRef.current;
328
+ if (box && !box.contains(e.target)) openS[1](false);
329
+ }
330
+ function onKey(e) {
331
+ if (e.key === "Escape") openS[1](false);
332
+ }
333
+ document.addEventListener("mousedown", onDown);
334
+ document.addEventListener("keydown", onKey);
335
+ return function() {
336
+ document.removeEventListener("mousedown", onDown);
337
+ document.removeEventListener("keydown", onKey);
338
+ };
339
+ }, [open]);
340
+ function commit(next) {
341
+ if (props.onChange) props.onChange(next);
342
+ }
343
+ function toggle(id) {
344
+ if (disabled) return;
345
+ var key = String(id);
346
+ if (mode === "single") {
347
+ openS[1](false);
348
+ if (props.onPick) props.onPick(key, rowOf(key));
349
+ commit([key]);
350
+ return;
351
+ }
352
+ var next = selected.slice();
353
+ var i = next.indexOf(key);
354
+ if (i >= 0) next.splice(i, 1);
355
+ else next.push(key);
356
+ commit(next);
357
+ }
358
+ function rowOf(id) {
359
+ var hit = rows.filter(function(x) {
360
+ return String(x.id) === String(id);
361
+ })[0];
362
+ if (hit) return hit;
363
+ return (allItems || []).filter(function(x) {
364
+ return String(x.id) === String(id);
365
+ })[0] || null;
366
+ }
367
+ var label = props.label || texts.all;
368
+ var caret = props.caret === void 0 ? "\u25BE" : props.caret;
369
+ var count = selected.length;
370
+ var chips = props.renderSelected ? props.renderSelected({ ids: selected, toggle, nameOf: props.nameOf || rowOf, texts }) : null;
371
+ return h(
372
+ "div",
373
+ { className: classes.root, ref: boxRef },
374
+ h(
375
+ "button",
376
+ {
377
+ type: "button",
378
+ className: classes.btn + (count ? " " + (classes.btnOn || "is-on") : ""),
379
+ "aria-haspopup": "dialog",
380
+ "aria-expanded": open ? "true" : "false",
381
+ disabled,
382
+ onClick: function(e) {
383
+ if (props.stopPropagation) e.stopPropagation();
384
+ openS[1](!open);
385
+ }
386
+ },
387
+ props.icon ? props.icon : null,
388
+ label + (count ? " \xB7 " + count : ""),
389
+ typeof caret === "function" ? caret : caret
390
+ ),
391
+ chips,
392
+ open ? h(
393
+ "div",
394
+ {
395
+ className: classes.menu,
396
+ role: props.menuRole,
397
+ style: props.menuStyle,
398
+ onClick: props.stopPropagation ? function(e) {
399
+ e.stopPropagation();
400
+ } : void 0
401
+ },
402
+ h(FilterChecklist, {
403
+ mode,
404
+ items: rows,
405
+ selected,
406
+ onToggle: toggle,
407
+ onPick: toggle,
408
+ query,
409
+ onQuery: queryS[1],
410
+ title: props.title || label,
411
+ total,
412
+ selectedText: texts.selected,
413
+ clearText: texts.clear,
414
+ onClear: function() {
415
+ commit([]);
416
+ queryS[1]("");
417
+ },
418
+ searchPlaceholder: texts.searchPlaceholder,
419
+ loading,
420
+ hasMore,
421
+ onLoadMore: remote ? function() {
422
+ remote.loadQuery(query, (remote.page || 1) + 1, true);
423
+ } : void 0,
424
+ emptyText: texts.empty,
425
+ noMatchText: texts.noMatch,
426
+ loadingText: texts.loading,
427
+ noMoreText: texts.noMore,
428
+ groupLabel: props.title || label,
429
+ autoFocus: props.autoFocus,
430
+ beforeHead: props.beforeHead || null
431
+ }),
432
+ props.footer || null
433
+ ) : null
434
+ );
435
+ }
436
+ module2.exports = SearchPicker;
437
+ module2.exports.filterLocal = filterLocal;
438
+ module2.exports.DEFAULT_TEXTS = DEFAULT_TEXTS;
439
+ }
440
+ });
441
+
189
442
  // packages/addons/lib/tag-filter.cjs
190
443
  var require_tag_filter = __commonJS({
191
444
  "packages/addons/lib/tag-filter.cjs"(exports2, module2) {
192
445
  "use strict";
193
446
  var React = require("react");
194
447
  var h = React.createElement;
195
- var FilterChecklist = require_filter_checklist();
448
+ var SearchPicker = require_search_picker();
196
449
  module2.exports = function createTagFilter(options) {
197
450
  var conf = options || {};
198
451
  var classes = conf.classes || {};
@@ -228,99 +481,26 @@ var require_tag_filter = __commonJS({
228
481
  var ids = props.ids || [];
229
482
  var onChange = props.onChange || function() {
230
483
  };
231
- var t = text(props);
232
- var availS = React.useState(true);
233
- var openS = React.useState(false);
234
- var open = openS[0];
235
- var setOpen = openS[1];
236
- var queryS = React.useState("");
237
- var query = queryS[0];
238
- var setQuery = queryS[1];
239
- var rowsS = React.useState([]);
240
- var rows = rowsS[0];
241
- var setRows = rowsS[1];
242
- var totalS = React.useState(0);
243
- var total = totalS[0];
244
- var setTotal = totalS[1];
245
- var pageS = React.useState(0);
246
- var page = pageS[0];
247
- var setPage = pageS[1];
248
- var hasMoreS = React.useState(false);
249
- var hasMore = hasMoreS[0];
250
- var setHasMore = hasMoreS[1];
251
- var loadingS = React.useState(false);
252
- var loading = loadingS[0];
253
- var setLoading = loadingS[1];
484
+ var tx = text(props);
254
485
  var namesS = React.useState({});
255
486
  var names = namesS[0];
256
- var setNames = namesS[1];
257
- var seq = React.useRef(0);
258
- var load = React.useCallback(
259
- function(q, pageNumber, append) {
260
- var mine = ++seq.current;
261
- setLoading(true);
262
- return api.call(conf.action, { text: q || "", pageNumber, pageSize }).then(function(r) {
263
- if (mine !== seq.current) return;
264
- setLoading(false);
265
- if (!r || !r.ok) return;
266
- var next = mapPage(r.result || {}, pageNumber);
267
- setRows(function(prev) {
268
- if (!append) return next.rows;
269
- if (!dedupe) return prev.concat(next.rows);
270
- var seen = {};
271
- var out = [];
272
- prev.concat(next.rows).forEach(function(x) {
273
- var key = String(x.id);
274
- if (seen[key]) return;
275
- seen[key] = true;
276
- out.push(x);
277
- });
278
- return out;
279
- });
280
- setTotal(next.total);
281
- setPage(next.page);
282
- setHasMore(next.hasMore);
283
- setNames(function(prev) {
284
- var map = Object.assign({}, prev);
285
- next.rows.forEach(function(x) {
286
- map[String(x.id)] = x.name;
287
- });
288
- return map;
289
- });
290
- }).catch(function() {
291
- if (mine === seq.current) setLoading(false);
292
- });
293
- },
294
- [api]
295
- );
296
- React.useEffect(
297
- function() {
298
- if (!open) return void 0;
299
- var timer = setTimeout(
300
- function() {
301
- load(query, 1, false);
302
- },
303
- query ? debounce : 0
304
- );
305
- return function() {
306
- clearTimeout(timer);
307
- };
308
- },
309
- [open, query, load, props.reloadKey]
310
- );
311
- React.useEffect(
312
- function() {
313
- if (!conf.probe) return;
314
- api.call(conf.probe.action || conf.action, conf.probe.args || {}).then(function(r) {
315
- if (r && r.ok) availS[1](!!(conf.probe.available && conf.probe.available(r.result)));
316
- }).catch(function() {
487
+ function mergeNames(rows) {
488
+ if (!rows || !rows.length) return;
489
+ namesS[1](function(prev) {
490
+ var next = Object.assign({}, prev);
491
+ var changed = false;
492
+ rows.forEach(function(x) {
493
+ if (next[String(x.id)] !== x.name) {
494
+ next[String(x.id)] = x.name;
495
+ changed = true;
496
+ }
317
497
  });
318
- },
319
- [api]
320
- );
498
+ return changed ? next : prev;
499
+ });
500
+ }
321
501
  React.useEffect(
322
502
  function() {
323
- if (!open || !ids.length || !conf.names) return;
503
+ if (!ids.length || !conf.names) return;
324
504
  var wanted = ids.filter(function(id) {
325
505
  return !names[String(id)];
326
506
  });
@@ -328,99 +508,65 @@ var require_tag_filter = __commonJS({
328
508
  var args = conf.names.args ? conf.names.args(wanted) : { ids: wanted };
329
509
  api.call(conf.names.action, args).then(function(r) {
330
510
  if (!r || !r.ok) return;
331
- var map = {};
332
- (r.result && r.result.records || []).forEach(function(x) {
333
- map[String(x.id)] = x.name;
334
- });
335
- if (!Object.keys(map).length) return;
336
- setNames(function(prev) {
337
- return Object.assign({}, prev, map);
338
- });
511
+ mergeNames(r.result && r.result.records || []);
339
512
  }).catch(function() {
340
513
  });
341
514
  },
342
- [open, ids.join(",")]
343
- );
344
- React.useEffect(
345
- function() {
346
- if (!open) return void 0;
347
- function onKey(e) {
348
- if (e.key === "Escape") setOpen(false);
349
- }
350
- document.addEventListener("keydown", onKey);
351
- return function() {
352
- document.removeEventListener("keydown", onKey);
353
- };
354
- },
355
- [open]
515
+ [ids.join(",")]
356
516
  );
357
- function toggle(id) {
358
- var key = String(id);
359
- var next = ids.slice();
360
- var i = next.indexOf(key);
361
- if (i >= 0) next.splice(i, 1);
362
- else next.push(key);
363
- onChange(next);
517
+ function fetchPage(q, pageNumber) {
518
+ return api.call(conf.action, { text: q || "", pageNumber, pageSize }).then(function(r) {
519
+ if (!r || !r.ok) return { rows: [], total: 0, page: pageNumber, hasMore: false };
520
+ var next = mapPage(r.result || {}, pageNumber);
521
+ mergeNames(next.rows);
522
+ return { rows: items(next.rows), total: next.total, page: next.page, hasMore: next.hasMore };
523
+ });
524
+ }
525
+ function nameOf(id) {
526
+ return names[String(id)] || String(id).slice(0, 6);
364
527
  }
365
528
  if (!enabled(props)) return null;
366
- var caretNode = typeof caret === "function" ? caret(props, t) : caret;
367
- var selectedNode = renderSelected ? renderSelected({ ids, names, toggle, text: t, classes, h }) : null;
368
- return h(
369
- "div",
370
- { className: classes.root },
371
- h(
372
- "button",
373
- {
374
- type: "button",
375
- className: classes.btn + (ids.length ? " " + (classes.btnOn || "on") : ""),
376
- "aria-expanded": open ? "true" : "false",
377
- onClick: function(e) {
378
- if (conf.stopPropagation) e.stopPropagation();
379
- setOpen(!open);
380
- }
381
- },
382
- icon(props, "tag", 13),
383
- t.label + (ids.length ? " \xB7 " + ids.length : ""),
384
- caretNode
385
- ),
386
- open ? h(
387
- "div",
388
- {
389
- className: classes.menu,
390
- role: conf.menuRole,
391
- style: conf.menuStyle,
392
- onClick: conf.stopPropagation ? function(e) {
393
- e.stopPropagation();
394
- } : void 0
395
- },
396
- h(FilterChecklist, {
397
- beforeHead: selectedNode,
398
- items: items(rows),
399
- selected: ids,
400
- onToggle: toggle,
401
- query,
402
- onQuery: setQuery,
403
- title: t.all,
404
- total,
405
- selectedText: t.selected,
406
- clearText: t.clear,
407
- onClear: function() {
408
- onChange([]);
409
- setQuery("");
410
- },
411
- searchPlaceholder: t.searchPlaceholder,
412
- loading,
413
- hasMore,
414
- onLoadMore: function() {
415
- load(query, (page || 1) + 1, true);
416
- },
417
- emptyText: t.empty,
418
- noMatchText: t.noMatch,
419
- loadingText: t.loading,
420
- noMoreText: t.noMore
421
- })
422
- ) : null
423
- );
529
+ return h(SearchPicker, {
530
+ h,
531
+ React,
532
+ mode: "multi",
533
+ label: tx.label,
534
+ title: tx.all,
535
+ fetchPage,
536
+ pageSize,
537
+ debounce,
538
+ dedupe,
539
+ classes,
540
+ menuRole: conf.menuRole,
541
+ menuStyle: conf.menuStyle,
542
+ stopPropagation: conf.stopPropagation,
543
+ reloadKey: props.reloadKey,
544
+ texts: {
545
+ all: tx.all,
546
+ selected: tx.selected,
547
+ clear: tx.clear,
548
+ searchPlaceholder: tx.searchPlaceholder,
549
+ empty: tx.empty,
550
+ noMatch: tx.noMatch,
551
+ loading: tx.loading,
552
+ noMore: tx.noMore
553
+ },
554
+ icon: icon(props, "tag", 13),
555
+ caret: typeof caret === "function" ? caret(props) : caret,
556
+ selected: ids,
557
+ onChange,
558
+ nameOf,
559
+ renderSelected: renderSelected ? function(ctx) {
560
+ return renderSelected({
561
+ ids: ctx.ids,
562
+ names,
563
+ toggle: ctx.toggle,
564
+ text: tx,
565
+ classes,
566
+ h
567
+ });
568
+ } : null
569
+ });
424
570
  };
425
571
  };
426
572
  }
@@ -6379,6 +6525,27 @@ var require_copy = __commonJS({
6379
6525
  create: "\u521B\u5EFA",
6380
6526
  close: "\u5173\u95ED",
6381
6527
  taskId: "\u4EFB\u52A1 ID",
6528
+ stepContent: "\u5185\u5BB9",
6529
+ stepContentHint: "\u6807\u9898\u3001\u63CF\u8FF0\u4E0E\u8BA1\u5212",
6530
+ stepTags: "\u6807\u7B7E",
6531
+ stepTagsHint: "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E\uFF0C\u6216\u8F93\u5165\u65B0\u6807\u7B7E\u56DE\u8F66\u6DFB\u52A0",
6532
+ stepTable: "\u4EFB\u52A1\u8868",
6533
+ stepTableHint: "\u9009\u62E9\u4EFB\u52A1\u5F52\u5230\u54EA\u5F20\u8868",
6534
+ stepTimeline: "\u65F6\u95F4\u7EBF",
6535
+ stepTimelineHint: "\u5173\u8054\u73B0\u6709\u65F6\u95F4\u7EBF\u6216\u65B0\u5EFA",
6536
+ stepWorkspace: "\u5DE5\u4F5C\u533A",
6537
+ stepWorkspaceHint: "\u5173\u8054\u5230\u5DE5\u4F5C\u533A\uFF08\u53EF\u9009\uFF09",
6538
+ stepConfirm: "\u786E\u8BA4",
6539
+ stepConfirmHint: "\u6838\u5BF9\u540E\u521B\u5EFA",
6540
+ stepBelong: "\u5F52\u5C5E",
6541
+ stepBelongHint: "\u65F6\u95F4\u7EBF\u3001\u5DE5\u4F5C\u533A\u4E0E\u4EFB\u52A1\u8868",
6542
+ stepPlan: "\u8BA1\u5212",
6543
+ stepPlanHint: "\u72B6\u6001\u3001\u4F18\u5148\u7EA7\u4E0E\u65E5\u671F",
6544
+ 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",
6545
+ createSteps: "\u521B\u5EFA\u6B65\u9AA4",
6546
+ nextStep: "\u4E0B\u4E00\u6B65",
6547
+ prevStep: "\u4E0A\u4E00\u6B65",
6548
+ workspace: "\u5DE5\u4F5C\u533A",
6382
6549
  addGroup: "\u65B0\u5EFA\u7EC4",
6383
6550
  addTable: "\u65B0\u5EFA\u8868",
6384
6551
  rename: "\u91CD\u547D\u540D",
@@ -6417,6 +6584,10 @@ var require_copy = __commonJS({
6417
6584
  noMore: "\u6CA1\u6709\u66F4\u591A",
6418
6585
  tagSelected: "\u5DF2\u9009",
6419
6586
  tagRemove: "\u79FB\u9664",
6587
+ tagSearchExisting: "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E",
6588
+ tagNewPlaceholder: "\u65B0\u5EFA\u6807\u7B7E\uFF0C\u56DE\u8F66\u6DFB\u52A0\uFF0C\u591A\u4E2A\u7528\u9017\u53F7\u5206\u9694",
6589
+ tagAdd: "\u6DFB\u52A0",
6590
+ tagNoPick: "\u8FD8\u6CA1\u6709\u9009\u6807\u7B7E\uFF0C\u4ECE\u4E0B\u9762\u70B9\u4E00\u4E2A\u6216\u76F4\u63A5\u8F93\u5165\u65B0\u6807\u7B7E\u540D",
6420
6591
  workspaceFilter: "\u5DE5\u4F5C\u533A\u7B5B\u9009",
6421
6592
  allWorkspaces: "\u5168\u90E8\u5DE5\u4F5C\u533A",
6422
6593
  noWorkspaces: "\u6682\u65E0\u5DE5\u4F5C\u533A",
@@ -6545,6 +6716,27 @@ var require_copy = __commonJS({
6545
6716
  create: "Create",
6546
6717
  close: "Close",
6547
6718
  taskId: "Task ID",
6719
+ stepContent: "Content",
6720
+ stepContentHint: "Title, description, schedule",
6721
+ stepTags: "Tags",
6722
+ stepTagsHint: "Search existing tags, or type a new one and press Enter",
6723
+ stepTable: "Table",
6724
+ stepTableHint: "Pick the table this task belongs to",
6725
+ stepTimeline: "Timeline",
6726
+ stepTimelineHint: "Attach to an existing timeline or create one",
6727
+ stepWorkspace: "Workspace",
6728
+ stepWorkspaceHint: "Link to a workspace (optional)",
6729
+ stepConfirm: "Review",
6730
+ stepConfirmHint: "Check before creating",
6731
+ stepBelong: "Placement",
6732
+ stepBelongHint: "Timeline, workspace, table",
6733
+ stepPlan: "Schedule",
6734
+ stepPlanHint: "Status, priority, dates",
6735
+ confirmHint: "Review the summary, then Create. Title, description and placement stay editable afterwards.",
6736
+ createSteps: "Create steps",
6737
+ nextStep: "Next",
6738
+ prevStep: "Back",
6739
+ workspace: "Workspace",
6548
6740
  addGroup: "New group",
6549
6741
  addTable: "New table",
6550
6742
  rename: "Rename",
@@ -6583,6 +6775,10 @@ var require_copy = __commonJS({
6583
6775
  noMore: "No more",
6584
6776
  tagSelected: "Selected",
6585
6777
  tagRemove: "Remove",
6778
+ tagSearchExisting: "Search existing tags",
6779
+ tagNewPlaceholder: "New tag \u2014 press Enter to add, comma for several",
6780
+ tagAdd: "Add",
6781
+ tagNoPick: "No tags picked yet \u2014 click one below or type a new name",
6586
6782
  workspaceFilter: "Filter by workspace",
6587
6783
  allWorkspaces: "All workspaces",
6588
6784
  noWorkspaces: "No workspaces",
@@ -7451,17 +7647,43 @@ var init_list = __esm({
7451
7647
  }
7452
7648
  });
7453
7649
 
7650
+ // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs
7651
+ var list_checks_exports = {};
7652
+ __export(list_checks_exports, {
7653
+ __iconData: () => __iconData19,
7654
+ default: () => ListChecks
7655
+ });
7656
+ var __iconData19, ListChecks;
7657
+ var init_list_checks = __esm({
7658
+ "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.mjs"() {
7659
+ init_createLucideIcon();
7660
+ __iconData19 = {
7661
+ name: "list-checks",
7662
+ size: 24,
7663
+ node: [
7664
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
7665
+ ["path", { d: "M13 12h8", key: "h98zly" }],
7666
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
7667
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
7668
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
7669
+ ]
7670
+ };
7671
+ __iconData19.node;
7672
+ ListChecks = createLucideIcon(__iconData19);
7673
+ }
7674
+ });
7675
+
7454
7676
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-check-big.mjs
7455
7677
  var square_check_big_exports = {};
7456
7678
  __export(square_check_big_exports, {
7457
- __iconData: () => __iconData19,
7679
+ __iconData: () => __iconData20,
7458
7680
  default: () => SquareCheckBig
7459
7681
  });
7460
- var __iconData19, SquareCheckBig;
7682
+ var __iconData20, SquareCheckBig;
7461
7683
  var init_square_check_big = __esm({
7462
7684
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/square-check-big.mjs"() {
7463
7685
  init_createLucideIcon();
7464
- __iconData19 = {
7686
+ __iconData20 = {
7465
7687
  name: "square-check-big",
7466
7688
  size: 24,
7467
7689
  node: [
@@ -7473,62 +7695,62 @@ var init_square_check_big = __esm({
7473
7695
  ],
7474
7696
  aliases: ["check-square"]
7475
7697
  };
7476
- __iconData19.node;
7477
- SquareCheckBig = createLucideIcon(__iconData19);
7698
+ __iconData20.node;
7699
+ SquareCheckBig = createLucideIcon(__iconData20);
7478
7700
  }
7479
7701
  });
7480
7702
 
7481
7703
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-left.mjs
7482
7704
  var chevron_left_exports = {};
7483
7705
  __export(chevron_left_exports, {
7484
- __iconData: () => __iconData20,
7706
+ __iconData: () => __iconData21,
7485
7707
  default: () => ChevronLeft
7486
7708
  });
7487
- var __iconData20, ChevronLeft;
7709
+ var __iconData21, ChevronLeft;
7488
7710
  var init_chevron_left = __esm({
7489
7711
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-left.mjs"() {
7490
7712
  init_createLucideIcon();
7491
- __iconData20 = {
7713
+ __iconData21 = {
7492
7714
  name: "chevron-left",
7493
7715
  size: 24,
7494
7716
  node: [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]]
7495
7717
  };
7496
- __iconData20.node;
7497
- ChevronLeft = createLucideIcon(__iconData20);
7718
+ __iconData21.node;
7719
+ ChevronLeft = createLucideIcon(__iconData21);
7498
7720
  }
7499
7721
  });
7500
7722
 
7501
7723
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs
7502
7724
  var chevron_right_exports = {};
7503
7725
  __export(chevron_right_exports, {
7504
- __iconData: () => __iconData21,
7726
+ __iconData: () => __iconData22,
7505
7727
  default: () => ChevronRight
7506
7728
  });
7507
- var __iconData21, ChevronRight;
7729
+ var __iconData22, ChevronRight;
7508
7730
  var init_chevron_right = __esm({
7509
7731
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs"() {
7510
7732
  init_createLucideIcon();
7511
- __iconData21 = {
7733
+ __iconData22 = {
7512
7734
  name: "chevron-right",
7513
7735
  size: 24,
7514
7736
  node: [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]]
7515
7737
  };
7516
- __iconData21.node;
7517
- ChevronRight = createLucideIcon(__iconData21);
7738
+ __iconData22.node;
7739
+ ChevronRight = createLucideIcon(__iconData22);
7518
7740
  }
7519
7741
  });
7520
7742
 
7521
7743
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder.mjs
7522
7744
  var folder_exports = {};
7523
7745
  __export(folder_exports, {
7524
- __iconData: () => __iconData22,
7746
+ __iconData: () => __iconData23,
7525
7747
  default: () => Folder
7526
7748
  });
7527
- var __iconData22, Folder;
7749
+ var __iconData23, Folder;
7528
7750
  var init_folder = __esm({
7529
7751
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder.mjs"() {
7530
7752
  init_createLucideIcon();
7531
- __iconData22 = {
7753
+ __iconData23 = {
7532
7754
  name: "folder",
7533
7755
  size: 24,
7534
7756
  node: [
@@ -7541,22 +7763,22 @@ var init_folder = __esm({
7541
7763
  ]
7542
7764
  ]
7543
7765
  };
7544
- __iconData22.node;
7545
- Folder = createLucideIcon(__iconData22);
7766
+ __iconData23.node;
7767
+ Folder = createLucideIcon(__iconData23);
7546
7768
  }
7547
7769
  });
7548
7770
 
7549
7771
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-open.mjs
7550
7772
  var folder_open_exports = {};
7551
7773
  __export(folder_open_exports, {
7552
- __iconData: () => __iconData23,
7774
+ __iconData: () => __iconData24,
7553
7775
  default: () => FolderOpen
7554
7776
  });
7555
- var __iconData23, FolderOpen;
7777
+ var __iconData24, FolderOpen;
7556
7778
  var init_folder_open = __esm({
7557
7779
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-open.mjs"() {
7558
7780
  init_createLucideIcon();
7559
- __iconData23 = {
7781
+ __iconData24 = {
7560
7782
  name: "folder-open",
7561
7783
  size: 24,
7562
7784
  node: [
@@ -7569,22 +7791,22 @@ var init_folder_open = __esm({
7569
7791
  ]
7570
7792
  ]
7571
7793
  };
7572
- __iconData23.node;
7573
- FolderOpen = createLucideIcon(__iconData23);
7794
+ __iconData24.node;
7795
+ FolderOpen = createLucideIcon(__iconData24);
7574
7796
  }
7575
7797
  });
7576
7798
 
7577
7799
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table-2.mjs
7578
7800
  var table_2_exports = {};
7579
7801
  __export(table_2_exports, {
7580
- __iconData: () => __iconData24,
7802
+ __iconData: () => __iconData25,
7581
7803
  default: () => Table2
7582
7804
  });
7583
- var __iconData24, Table2;
7805
+ var __iconData25, Table2;
7584
7806
  var init_table_2 = __esm({
7585
7807
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table-2.mjs"() {
7586
7808
  init_createLucideIcon();
7587
- __iconData24 = {
7809
+ __iconData25 = {
7588
7810
  name: "table-2",
7589
7811
  size: 24,
7590
7812
  node: [
@@ -7593,22 +7815,22 @@ var init_table_2 = __esm({
7593
7815
  ["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }]
7594
7816
  ]
7595
7817
  };
7596
- __iconData24.node;
7597
- Table2 = createLucideIcon(__iconData24);
7818
+ __iconData25.node;
7819
+ Table2 = createLucideIcon(__iconData25);
7598
7820
  }
7599
7821
  });
7600
7822
 
7601
7823
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/house.mjs
7602
7824
  var house_exports = {};
7603
7825
  __export(house_exports, {
7604
- __iconData: () => __iconData25,
7826
+ __iconData: () => __iconData26,
7605
7827
  default: () => House
7606
7828
  });
7607
- var __iconData25, House;
7829
+ var __iconData26, House;
7608
7830
  var init_house = __esm({
7609
7831
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/house.mjs"() {
7610
7832
  init_createLucideIcon();
7611
- __iconData25 = {
7833
+ __iconData26 = {
7612
7834
  name: "house",
7613
7835
  size: 24,
7614
7836
  node: [
@@ -7623,22 +7845,22 @@ var init_house = __esm({
7623
7845
  ],
7624
7846
  aliases: ["home"]
7625
7847
  };
7626
- __iconData25.node;
7627
- House = createLucideIcon(__iconData25);
7848
+ __iconData26.node;
7849
+ House = createLucideIcon(__iconData26);
7628
7850
  }
7629
7851
  });
7630
7852
 
7631
7853
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-plus.mjs
7632
7854
  var folder_plus_exports = {};
7633
7855
  __export(folder_plus_exports, {
7634
- __iconData: () => __iconData26,
7856
+ __iconData: () => __iconData27,
7635
7857
  default: () => FolderPlus
7636
7858
  });
7637
- var __iconData26, FolderPlus;
7859
+ var __iconData27, FolderPlus;
7638
7860
  var init_folder_plus = __esm({
7639
7861
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/folder-plus.mjs"() {
7640
7862
  init_createLucideIcon();
7641
- __iconData26 = {
7863
+ __iconData27 = {
7642
7864
  name: "folder-plus",
7643
7865
  size: 24,
7644
7866
  node: [
@@ -7653,22 +7875,22 @@ var init_folder_plus = __esm({
7653
7875
  ]
7654
7876
  ]
7655
7877
  };
7656
- __iconData26.node;
7657
- FolderPlus = createLucideIcon(__iconData26);
7878
+ __iconData27.node;
7879
+ FolderPlus = createLucideIcon(__iconData27);
7658
7880
  }
7659
7881
  });
7660
7882
 
7661
7883
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-plus.mjs
7662
7884
  var file_plus_exports = {};
7663
7885
  __export(file_plus_exports, {
7664
- __iconData: () => __iconData27,
7886
+ __iconData: () => __iconData28,
7665
7887
  default: () => FilePlus
7666
7888
  });
7667
- var __iconData27, FilePlus;
7889
+ var __iconData28, FilePlus;
7668
7890
  var init_file_plus = __esm({
7669
7891
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-plus.mjs"() {
7670
7892
  init_createLucideIcon();
7671
- __iconData27 = {
7893
+ __iconData28 = {
7672
7894
  name: "file-plus",
7673
7895
  size: 24,
7674
7896
  node: [
@@ -7684,22 +7906,22 @@ var init_file_plus = __esm({
7684
7906
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
7685
7907
  ]
7686
7908
  };
7687
- __iconData27.node;
7688
- FilePlus = createLucideIcon(__iconData27);
7909
+ __iconData28.node;
7910
+ FilePlus = createLucideIcon(__iconData28);
7689
7911
  }
7690
7912
  });
7691
7913
 
7692
7914
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/pencil.mjs
7693
7915
  var pencil_exports = {};
7694
7916
  __export(pencil_exports, {
7695
- __iconData: () => __iconData28,
7917
+ __iconData: () => __iconData29,
7696
7918
  default: () => Pencil
7697
7919
  });
7698
- var __iconData28, Pencil;
7920
+ var __iconData29, Pencil;
7699
7921
  var init_pencil = __esm({
7700
7922
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/pencil.mjs"() {
7701
7923
  init_createLucideIcon();
7702
- __iconData28 = {
7924
+ __iconData29 = {
7703
7925
  name: "pencil",
7704
7926
  size: 24,
7705
7927
  node: [
@@ -7713,17 +7935,17 @@ var init_pencil = __esm({
7713
7935
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
7714
7936
  ]
7715
7937
  };
7716
- __iconData28.node;
7717
- Pencil = createLucideIcon(__iconData28);
7938
+ __iconData29.node;
7939
+ Pencil = createLucideIcon(__iconData29);
7718
7940
  }
7719
7941
  });
7720
7942
 
7721
7943
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash.mjs
7722
- var __iconData29, Trash;
7944
+ var __iconData30, Trash;
7723
7945
  var init_trash = __esm({
7724
7946
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash.mjs"() {
7725
7947
  init_createLucideIcon();
7726
- __iconData29 = {
7948
+ __iconData30 = {
7727
7949
  name: "trash",
7728
7950
  size: 24,
7729
7951
  node: [
@@ -7735,8 +7957,8 @@ var init_trash = __esm({
7735
7957
  ],
7736
7958
  aliases: ["trash-2"]
7737
7959
  };
7738
- __iconData29.node;
7739
- Trash = createLucideIcon(__iconData29);
7960
+ __iconData30.node;
7961
+ Trash = createLucideIcon(__iconData30);
7740
7962
  }
7741
7963
  });
7742
7964
 
@@ -7754,14 +7976,14 @@ var init_trash_2 = __esm({
7754
7976
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/x.mjs
7755
7977
  var x_exports = {};
7756
7978
  __export(x_exports, {
7757
- __iconData: () => __iconData30,
7979
+ __iconData: () => __iconData31,
7758
7980
  default: () => X
7759
7981
  });
7760
- var __iconData30, X;
7982
+ var __iconData31, X;
7761
7983
  var init_x = __esm({
7762
7984
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/x.mjs"() {
7763
7985
  init_createLucideIcon();
7764
- __iconData30 = {
7986
+ __iconData31 = {
7765
7987
  name: "x",
7766
7988
  size: 24,
7767
7989
  node: [
@@ -7769,42 +7991,42 @@ var init_x = __esm({
7769
7991
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
7770
7992
  ]
7771
7993
  };
7772
- __iconData30.node;
7773
- X = createLucideIcon(__iconData30);
7994
+ __iconData31.node;
7995
+ X = createLucideIcon(__iconData31);
7774
7996
  }
7775
7997
  });
7776
7998
 
7777
7999
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-down.mjs
7778
8000
  var chevron_down_exports = {};
7779
8001
  __export(chevron_down_exports, {
7780
- __iconData: () => __iconData31,
8002
+ __iconData: () => __iconData32,
7781
8003
  default: () => ChevronDown
7782
8004
  });
7783
- var __iconData31, ChevronDown;
8005
+ var __iconData32, ChevronDown;
7784
8006
  var init_chevron_down = __esm({
7785
8007
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/chevron-down.mjs"() {
7786
8008
  init_createLucideIcon();
7787
- __iconData31 = {
8009
+ __iconData32 = {
7788
8010
  name: "chevron-down",
7789
8011
  size: 24,
7790
8012
  node: [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]
7791
8013
  };
7792
- __iconData31.node;
7793
- ChevronDown = createLucideIcon(__iconData31);
8014
+ __iconData32.node;
8015
+ ChevronDown = createLucideIcon(__iconData32);
7794
8016
  }
7795
8017
  });
7796
8018
 
7797
8019
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/tag.mjs
7798
8020
  var tag_exports = {};
7799
8021
  __export(tag_exports, {
7800
- __iconData: () => __iconData32,
8022
+ __iconData: () => __iconData33,
7801
8023
  default: () => Tag
7802
8024
  });
7803
- var __iconData32, Tag;
8025
+ var __iconData33, Tag;
7804
8026
  var init_tag = __esm({
7805
8027
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/tag.mjs"() {
7806
8028
  init_createLucideIcon();
7807
- __iconData32 = {
8029
+ __iconData33 = {
7808
8030
  name: "tag",
7809
8031
  size: 24,
7810
8032
  node: [
@@ -7818,22 +8040,22 @@ var init_tag = __esm({
7818
8040
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
7819
8041
  ]
7820
8042
  };
7821
- __iconData32.node;
7822
- Tag = createLucideIcon(__iconData32);
8043
+ __iconData33.node;
8044
+ Tag = createLucideIcon(__iconData33);
7823
8045
  }
7824
8046
  });
7825
8047
 
7826
8048
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/clock.mjs
7827
8049
  var clock_exports = {};
7828
8050
  __export(clock_exports, {
7829
- __iconData: () => __iconData33,
8051
+ __iconData: () => __iconData34,
7830
8052
  default: () => Clock
7831
8053
  });
7832
- var __iconData33, Clock;
8054
+ var __iconData34, Clock;
7833
8055
  var init_clock = __esm({
7834
8056
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/clock.mjs"() {
7835
8057
  init_createLucideIcon();
7836
- __iconData33 = {
8058
+ __iconData34 = {
7837
8059
  name: "clock",
7838
8060
  size: 24,
7839
8061
  node: [
@@ -7841,22 +8063,22 @@ var init_clock = __esm({
7841
8063
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
7842
8064
  ]
7843
8065
  };
7844
- __iconData33.node;
7845
- Clock = createLucideIcon(__iconData33);
8066
+ __iconData34.node;
8067
+ Clock = createLucideIcon(__iconData34);
7846
8068
  }
7847
8069
  });
7848
8070
 
7849
8071
  // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.mjs
7850
8072
  var refresh_cw_exports = {};
7851
8073
  __export(refresh_cw_exports, {
7852
- __iconData: () => __iconData34,
8074
+ __iconData: () => __iconData35,
7853
8075
  default: () => RefreshCw
7854
8076
  });
7855
- var __iconData34, RefreshCw;
8077
+ var __iconData35, RefreshCw;
7856
8078
  var init_refresh_cw = __esm({
7857
8079
  "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.mjs"() {
7858
8080
  init_createLucideIcon();
7859
- __iconData34 = {
8081
+ __iconData35 = {
7860
8082
  name: "refresh-cw",
7861
8083
  size: 24,
7862
8084
  node: [
@@ -7866,8 +8088,8 @@ var init_refresh_cw = __esm({
7866
8088
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
7867
8089
  ]
7868
8090
  };
7869
- __iconData34.node;
7870
- RefreshCw = createLucideIcon(__iconData34);
8091
+ __iconData35.node;
8092
+ RefreshCw = createLucideIcon(__iconData35);
7871
8093
  }
7872
8094
  });
7873
8095
 
@@ -7895,6 +8117,7 @@ var require_icons2 = __commonJS({
7895
8117
  search: (init_search(), __toCommonJS(search_exports)).default,
7896
8118
  grid: (init_layout_grid(), __toCommonJS(layout_grid_exports)).default,
7897
8119
  list: (init_list(), __toCommonJS(list_exports)).default,
8120
+ "list-checks": (init_list_checks(), __toCommonJS(list_checks_exports)).default,
7898
8121
  select: (init_square_check_big(), __toCommonJS(square_check_big_exports)).default,
7899
8122
  left: (init_chevron_left(), __toCommonJS(chevron_left_exports)).default,
7900
8123
  right: (init_chevron_right(), __toCommonJS(chevron_right_exports)).default,
@@ -7950,8 +8173,9 @@ var require_overlay = __commonJS({
7950
8173
  var autoFocusDialog = opts.autoFocusDialog !== false;
7951
8174
  var focusableSelector = opts.focusableSelector || FOCUSABLE;
7952
8175
  function Modal(props) {
7953
- var ref = React.useRef(null);
7954
- React.useEffect(function() {
8176
+ var R = props.React || React;
8177
+ var ref = R.useRef(null);
8178
+ R.useEffect(function() {
7955
8179
  var previous = typeof document !== "undefined" ? document.activeElement : null;
7956
8180
  var focusIt = props.autoFocus !== void 0 ? props.autoFocus : autoFocusDialog;
7957
8181
  if (focusIt && ref.current) ref.current.focus();
@@ -9023,24 +9247,323 @@ var require_filter_checklist_styles = __commonJS({
9023
9247
  }
9024
9248
  });
9025
9249
 
9026
- // packages/addons/tasks/client/ui/styles.cjs
9027
- var require_styles = __commonJS({
9028
- "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
9250
+ // packages/addons/lib/stepper.cjs
9251
+ var require_stepper = __commonJS({
9252
+ "packages/addons/lib/stepper.cjs"(exports2, module2) {
9029
9253
  "use strict";
9030
- module2.exports = [
9031
- ".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}",
9032
- ".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}",
9033
- ".wbt-body-section{margin-top:5px}.wbt-body-section .wbt-desc,.wbt-body-section .wbt-review{margin-top:0}",
9034
- ".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}",
9035
- ".wbt-root .wbt-item.closed:has(mark.wbt-hit){opacity:1}",
9036
- ".wbt-root{--wbt-line:var(--wb-border);--wbt-surface:var(--dsw-alias-bg-layer-1,color-mix(in oklab,currentColor 4%,transparent));--wbt-bg:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,#fff));--wbt-accent:var(--dsw-alias-brand-primary,#11a89b);display:flex;flex-direction:column;gap:10px;min-height:0;color:inherit;font-size:13px}",
9037
- // 只接管当前可见任务视图的高度链;其他插件和统计页继续使用宿主页面滚动。
9038
- ".wb-immersive-main:has(> .wb-inner > [data-view-id=tasks]:not([hidden]) .wbt-root){overflow:hidden;display:flex;flex-direction:column}",
9039
- ".wb-immersive-main > .wb-inner:has(> [data-view-id=tasks]:not([hidden]) .wbt-root){flex:1;min-height:0;overflow:hidden}",
9040
- ".wb-immersive-main > .wb-inner > [data-view-id=tasks]:not([hidden]):has(.wbt-root){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}",
9041
- ".wbt-root{flex:1;overflow:hidden}.wbt-pathrow{flex:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 0 2px}.wbt-tabledesc{flex:none;max-height:64px;overflow:auto}",
9042
- ".wbt-tree-slot{flex:0 0 auto;display:flex;align-items:center}",
9043
- ".wbt-grow{flex:1;min-width:0}",
9254
+ function stepState(index, current, maxVisited) {
9255
+ if (index === current) return "current";
9256
+ if (index < current) return "done";
9257
+ if (index <= maxVisited) return "visited";
9258
+ return "todo";
9259
+ }
9260
+ function Steps(props) {
9261
+ var h = props.h;
9262
+ var steps = props.steps || [];
9263
+ var current = props.current || 0;
9264
+ var maxVisited = props.maxVisited === void 0 ? current : props.maxVisited;
9265
+ var invalid = props.invalid || {};
9266
+ var disabled = !!props.disabled;
9267
+ var label = props.label || "\u6B65\u9AA4";
9268
+ return h(
9269
+ "nav",
9270
+ { className: "wbctl-steps" + (props.className ? " " + props.className : ""), "aria-label": label },
9271
+ h(
9272
+ "ol",
9273
+ { className: "wbctl-step-list" },
9274
+ steps.map(function(step, index) {
9275
+ var state = stepState(index, current, maxVisited);
9276
+ var canJump = !disabled && typeof props.onJump === "function" && state !== "current" && state !== "todo";
9277
+ var isInvalid = !!invalid[index] || !!invalid[step.key];
9278
+ return h(
9279
+ "li",
9280
+ { key: step.key || index, className: "wbctl-step-item" },
9281
+ h(
9282
+ "button",
9283
+ {
9284
+ type: "button",
9285
+ className: "wbctl-step",
9286
+ "data-state": state,
9287
+ "data-invalid": isInvalid ? "true" : null,
9288
+ "aria-current": state === "current" ? "step" : void 0,
9289
+ "aria-label": index + 1 + " \xB7 " + step.label + (state === "done" ? "\uFF08\u5DF2\u5B8C\u6210\uFF09" : ""),
9290
+ disabled: disabled || state === "todo",
9291
+ title: step.hint || "",
9292
+ onClick: function() {
9293
+ if (canJump) props.onJump(index);
9294
+ }
9295
+ },
9296
+ h("span", { className: "wbctl-step-index", "aria-hidden": "true" }, state === "done" ? "\u2713" : String(index + 1)),
9297
+ h("span", { className: "wbctl-step-label" }, step.label),
9298
+ step.hint ? h("span", { className: "wbctl-step-hint" }, step.hint) : null,
9299
+ step.optional ? h("span", { className: "wbctl-step-opt" }, "\u53EF\u9009") : null
9300
+ )
9301
+ );
9302
+ })
9303
+ )
9304
+ );
9305
+ }
9306
+ var STYLES = [
9307
+ ".wbctl-steps{display:block;min-width:0}",
9308
+ ".wbctl-step-list{display:flex;align-items:stretch;gap:6px;list-style:none;margin:0 0 14px;padding:0;min-width:0}",
9309
+ ".wbctl-step-item{display:flex;flex:1 1 0;min-width:0}",
9310
+ ".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}",
9311
+ ".wbctl-step[data-state=done],.wbctl-step[data-state=visited]{color:inherit;cursor:pointer}",
9312
+ ".wbctl-step[data-state=done]{border-color:color-mix(in oklab,var(--wb-ok,var(--wb-accent,#2563eb)) 36%,var(--wb-border))}",
9313
+ ".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}",
9314
+ ".wbctl-step[data-state=visited]:hover,.wbctl-step[data-state=done]:hover{background:color-mix(in oklab,currentColor 7%,transparent)}",
9315
+ ".wbctl-step[data-invalid=true]{border-color:var(--wb-danger,#d33)}",
9316
+ ".wbctl-step:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
9317
+ ".wbctl-step:disabled{cursor:default;opacity:.72}",
9318
+ ".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)}",
9319
+ ".wbctl-step[data-state=current] .wbctl-step-index{background:var(--wb-accent,#2563eb);color:var(--wb-on-accent,#fff)}",
9320
+ ".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))}",
9321
+ ".wbctl-step-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
9322
+ ".wbctl-step-hint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
9323
+ ".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
9324
+ "@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}}",
9325
+ "@media (max-width:520px){.wbctl-step-list{gap:4px}.wbctl-step-label{white-space:normal}.wbctl-step{gap:5px}}",
9326
+ "@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
9327
+ ];
9328
+ module2.exports = { Steps, stepState, styles: STYLES };
9329
+ }
9330
+ });
9331
+
9332
+ // packages/addons/lib/staged-dialog.cjs
9333
+ var require_staged_dialog = __commonJS({
9334
+ "packages/addons/lib/staged-dialog.cjs"(exports2, module2) {
9335
+ "use strict";
9336
+ var defaultReact = require("react");
9337
+ var overlayFactory = require_overlay();
9338
+ var stepper = require_stepper();
9339
+ function validateStep(step) {
9340
+ if (!step || typeof step.validate !== "function") return "";
9341
+ var message = step.validate();
9342
+ return message ? String(message) : "";
9343
+ }
9344
+ function firstFailing(steps) {
9345
+ var list = steps || [];
9346
+ for (var i = 0; i < list.length; i += 1) {
9347
+ var message = validateStep(list[i]);
9348
+ if (message) return { index: i, key: list[i] && list[i].key, message };
9349
+ }
9350
+ return null;
9351
+ }
9352
+ function createStagedDialog(options) {
9353
+ var opts = options || {};
9354
+ var React = opts.React || defaultReact;
9355
+ var h = React.createElement;
9356
+ var dialogClass = ((opts.dialogClass || "") + " wbctl-dialog").trim();
9357
+ var Overlay = overlayFactory(
9358
+ Object.assign({}, opts, {
9359
+ React,
9360
+ dialogClass,
9361
+ // 首焦点由外壳送进对话框,字段由 focusStep 负责,避免打开瞬间落进第一个输入框。
9362
+ autoFocusDialog: opts.autoFocusDialog !== false
9363
+ })
9364
+ );
9365
+ function StagedDialog(props) {
9366
+ var R = props.React || React;
9367
+ var steps = props.steps || [];
9368
+ var count = steps.length;
9369
+ var busy = !!props.submitting || !!props.busy;
9370
+ var indexState = R.useState(props.initialStep || 0);
9371
+ var rawIndex = indexState[0];
9372
+ var setIndex = indexState[1];
9373
+ var index = count === 0 ? 0 : Math.min(Math.max(rawIndex, 0), count - 1);
9374
+ var visitedState = R.useState(props.initialStep || 0);
9375
+ var maxVisited = count === 0 ? 0 : Math.min(Math.max(visitedState[0], index), count - 1);
9376
+ var setMaxVisited = visitedState[1];
9377
+ var errorState = R.useState("");
9378
+ var stepError = errorState[0];
9379
+ var setStepError = errorState[1];
9380
+ var invalidState = R.useState({});
9381
+ var invalid = invalidState[0];
9382
+ var setInvalid = invalidState[1];
9383
+ var bodyRef = R.useRef(null);
9384
+ var mounted = R.useRef(true);
9385
+ function runValidate(step) {
9386
+ return validateStep(step);
9387
+ }
9388
+ function markInvalid(i, bad) {
9389
+ setInvalid(function(prev) {
9390
+ var next2 = Object.assign({}, prev);
9391
+ if (bad) next2[i] = true;
9392
+ else delete next2[i];
9393
+ return next2;
9394
+ });
9395
+ }
9396
+ function focusBody() {
9397
+ var el = bodyRef.current;
9398
+ if (el && typeof el.focus === "function") el.focus();
9399
+ }
9400
+ R.useEffect(
9401
+ function() {
9402
+ if (!mounted.current) return;
9403
+ focusBody();
9404
+ },
9405
+ [index]
9406
+ );
9407
+ R.useEffect(function() {
9408
+ mounted.current = true;
9409
+ return function() {
9410
+ mounted.current = false;
9411
+ };
9412
+ }, []);
9413
+ function goTo(i) {
9414
+ if (busy || i < 0 || i >= count) return;
9415
+ setIndex(i);
9416
+ if (i > maxVisited) setMaxVisited(i);
9417
+ setStepError("");
9418
+ }
9419
+ function fail(i, message) {
9420
+ markInvalid(i, true);
9421
+ goTo(i);
9422
+ setStepError(message);
9423
+ focusBody();
9424
+ }
9425
+ function next() {
9426
+ if (busy) return;
9427
+ var message = runValidate(steps[index]);
9428
+ if (message) {
9429
+ fail(index, message);
9430
+ return;
9431
+ }
9432
+ markInvalid(index, false);
9433
+ goTo(Math.min(index + 1, count - 1));
9434
+ }
9435
+ function back() {
9436
+ if (busy || index === 0) return;
9437
+ goTo(index - 1);
9438
+ }
9439
+ function jump(i) {
9440
+ if (busy || i > maxVisited) return;
9441
+ goTo(i);
9442
+ }
9443
+ function submit() {
9444
+ if (busy) return;
9445
+ var bad = firstFailing(steps);
9446
+ if (bad) {
9447
+ fail(bad.index, bad.message);
9448
+ return;
9449
+ }
9450
+ for (var i = 0; i < count; i++) markInvalid(i, false);
9451
+ setStepError("");
9452
+ if (typeof props.onSubmit === "function") props.onSubmit();
9453
+ }
9454
+ function cancel() {
9455
+ if (busy) return;
9456
+ if (typeof props.onClose === "function") props.onClose();
9457
+ }
9458
+ var current = steps[index];
9459
+ var isLast = index >= count - 1;
9460
+ var saveText = props.submitText || "\u4FDD\u5B58";
9461
+ var shownError = stepError || props.error || "";
9462
+ return h(
9463
+ Overlay,
9464
+ props,
9465
+ count > 1 ? h(stepper.Steps, {
9466
+ h,
9467
+ steps: steps.map(function(step) {
9468
+ return { key: step.key, label: step.label, hint: step.hint, optional: step.optional };
9469
+ }),
9470
+ current: index,
9471
+ maxVisited,
9472
+ onJump: jump,
9473
+ invalid,
9474
+ disabled: busy,
9475
+ label: props.stepsLabel || "\u521B\u5EFA\u6B65\u9AA4"
9476
+ }) : null,
9477
+ h(
9478
+ "div",
9479
+ {
9480
+ className: "wbctl-dialog-body" + (props.bodyClassName ? " " + props.bodyClassName : ""),
9481
+ ref: bodyRef,
9482
+ tabIndex: -1
9483
+ },
9484
+ current ? current.render(h, props) : null
9485
+ ),
9486
+ props.footerExtra || null,
9487
+ shownError ? h("div", { className: "wbctl-dialog-err", role: "alert" }, shownError) : null,
9488
+ h(
9489
+ "div",
9490
+ { className: "wbctl-dialog-foot" },
9491
+ count > 1 ? h("span", { className: "wbctl-dialog-progress" }, index + 1 + " / " + count) : null,
9492
+ props.footerNote ? h("span", { className: "wbctl-dialog-note" }, props.footerNote) : null,
9493
+ h("span", { className: "wbctl-dialog-spacer" }),
9494
+ index > 0 ? h(
9495
+ "button",
9496
+ { type: "button", className: "wbctl-btn", onClick: back, disabled: busy },
9497
+ props.backText || "\u4E0A\u4E00\u6B65"
9498
+ ) : null,
9499
+ h("button", { type: "button", className: "wbctl-btn", onClick: cancel, disabled: busy }, props.cancelText || "\u53D6\u6D88"),
9500
+ h(
9501
+ "button",
9502
+ {
9503
+ type: "button",
9504
+ className: "wbctl-btn wbctl-btn-p",
9505
+ onClick: isLast ? submit : next,
9506
+ // submitDisabled 只作用于末步的保存:插件据此把「结构性不合法」(JSON 语法、无可选 action)
9507
+ // 提前反映成禁用态,避免用户点到保存才被弹回第一步。
9508
+ disabled: busy || isLast && !!props.submitDisabled
9509
+ },
9510
+ busy ? saveText + "\u4E2D\u2026" : isLast ? saveText : props.nextText || "\u4E0B\u4E00\u6B65"
9511
+ )
9512
+ )
9513
+ );
9514
+ }
9515
+ StagedDialog.displayName = opts.displayName || "StagedDialog";
9516
+ return StagedDialog;
9517
+ }
9518
+ var STYLES = [
9519
+ // 宽表单:内容多时给足横向空间,窄屏留 16px 边距后铺满。
9520
+ ".wbctl-dialog{width:min(880px,calc(100vw - 32px));max-height:min(92vh,760px);display:flex;flex-direction:column;overflow:hidden}",
9521
+ ".wbctl-dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px 2px 10px;outline:none}",
9522
+ ".wbctl-dialog-body:focus-visible{outline:none}",
9523
+ ".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))}",
9524
+ ".wbctl-dialog-progress{font-size:11.5px;color:var(--wb-muted,#666);font-variant-numeric:tabular-nums}",
9525
+ ".wbctl-dialog-note{font-size:11.5px;color:var(--wb-muted,#666);min-width:0}",
9526
+ ".wbctl-dialog-spacer{flex:1 1 auto}",
9527
+ ".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}",
9528
+ ".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}",
9529
+ ".wbctl-btn:hover:not(:disabled){background:color-mix(in oklab,currentColor 7%,transparent)}",
9530
+ ".wbctl-btn:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
9531
+ ".wbctl-btn:disabled{opacity:.55;cursor:default}",
9532
+ ".wbctl-btn.wbctl-btn-p{background:var(--wb-accent,#2563eb);border-color:transparent;color:var(--wb-on-accent,#fff)}",
9533
+ ".wbctl-btn.wbctl-btn-p:hover:not(:disabled){background:color-mix(in oklab,var(--wb-accent,#2563eb) 86%,#000)}",
9534
+ // 确认步:键值对清单,各插件共用,避免再各写一套只读摘要。\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 // 两列字段布局:内容多的弹窗不再单列拉长,窄屏回落单列。
9535
+ ".wbctl-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}",
9536
+ ".wbctl-form>.full{grid-column:1/-1}",
9537
+ "@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}}",
9538
+ "@media (prefers-reduced-motion:reduce){.wbctl-btn{transition:none}}"
9539
+ ];
9540
+ module2.exports = {
9541
+ createStagedDialog,
9542
+ validateStep,
9543
+ firstFailing,
9544
+ styles: STYLES
9545
+ };
9546
+ }
9547
+ });
9548
+
9549
+ // packages/addons/tasks/client/ui/styles.cjs
9550
+ var require_styles = __commonJS({
9551
+ "packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
9552
+ "use strict";
9553
+ module2.exports = [
9554
+ ".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}",
9555
+ ".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}",
9556
+ ".wbt-body-section{margin-top:5px}.wbt-body-section .wbt-desc,.wbt-body-section .wbt-review{margin-top:0}",
9557
+ ".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}",
9558
+ ".wbt-root .wbt-item.closed:has(mark.wbt-hit){opacity:1}",
9559
+ ".wbt-root{--wbt-line:var(--wb-border);--wbt-surface:var(--dsw-alias-bg-layer-1,color-mix(in oklab,currentColor 4%,transparent));--wbt-bg:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,#fff));--wbt-accent:var(--dsw-alias-brand-primary,#11a89b);display:flex;flex-direction:column;gap:10px;min-height:0;color:inherit;font-size:13px}",
9560
+ // 只接管当前可见任务视图的高度链;其他插件和统计页继续使用宿主页面滚动。
9561
+ ".wb-immersive-main:has(> .wb-inner > [data-view-id=tasks]:not([hidden]) .wbt-root){overflow:hidden;display:flex;flex-direction:column}",
9562
+ ".wb-immersive-main > .wb-inner:has(> [data-view-id=tasks]:not([hidden]) .wbt-root){flex:1;min-height:0;overflow:hidden}",
9563
+ ".wb-immersive-main > .wb-inner > [data-view-id=tasks]:not([hidden]):has(.wbt-root){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}",
9564
+ ".wbt-root{flex:1;overflow:hidden}.wbt-pathrow{flex:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 0 2px}.wbt-tabledesc{flex:none;max-height:64px;overflow:auto}",
9565
+ ".wbt-tree-slot{flex:0 0 auto;display:flex;align-items:center}",
9566
+ ".wbt-grow{flex:1;min-width:0}",
9044
9567
  ".wbt-btn{border:1px solid var(--wbt-line);background:var(--wbt-surface);color:inherit;border-radius:var(--wb-radius-sm);padding:6px 11px;font-size:12.5px;cursor:pointer;white-space:nowrap;line-height:1.3;display:inline-flex;align-items:center;gap:5px}",
9045
9568
  ".wbt-svg{display:block;flex:none}",
9046
9569
  ".wbt-btn:hover{border-color:var(--wbt-accent)}",
@@ -9231,6 +9754,15 @@ var require_styles = __commonJS({
9231
9754
  ".wbt-create-tl .wbt-timeline-picker{display:flex;flex-direction:column;gap:6px;min-width:0}",
9232
9755
  ".wbt-create-tl .wbt-picker-list{max-height:180px;scrollbar-gutter:stable}",
9233
9756
  ".wbt-create-tl .wbt-timeline-pager{margin-top:4px;font-size:11.5px}",
9757
+ // 标签步:已选 chip + 共享勾选清单 + 新标签输入,清单限高内部滚动。
9758
+ ".wbt-tagpick{display:flex;flex-direction:column;gap:8px;min-width:0}",
9759
+ ".wbt-tagchips{display:flex;flex-wrap:wrap;gap:6px}",
9760
+ ".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}",
9761
+ ".wbt-tagchip:hover{border-color:var(--wbt-accent)}",
9762
+ ".wbt-tagchip-x{opacity:.55;font-size:12px}",
9763
+ ".wbt-tagpick .wbck-list{max-height:220px}",
9764
+ ".wbt-tagnew{display:flex;gap:8px;align-items:center}",
9765
+ ".wbt-tagnew .wbt-input{flex:1;min-width:0}",
9234
9766
  ".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}",
9235
9767
  ".wbt-modal-foot{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:2px}",
9236
9768
  // 预览面板:只让内容区滚动,头部标题与右上角 × 固定不动(滚动壳限定在 .wbt-preview,不影响其它弹窗)。
@@ -9306,7 +9838,7 @@ var require_styles = __commonJS({
9306
9838
  ".wbtx-slot-note{color:var(--wbt-muted,var(--wb-muted))}",
9307
9839
  ".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}",
9308
9840
  ".wbt-mailback{font-size:11.5px;padding:2px 7px}"
9309
- ].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt"), require_switch().styles, require_number_field().styles).join("\n");
9841
+ ].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");
9310
9842
  }
9311
9843
  });
9312
9844
 
@@ -9642,35 +10174,45 @@ var require_timeline_controls = __commonJS({
9642
10174
  });
9643
10175
  function Picker(p) {
9644
10176
  var tr = require_timeline_copy()(p.t);
10177
+ var PAGE_SIZE = 20;
9645
10178
  var ds = React.useState({ records: [], total: 0 }), data = ds[0], setData = ds[1];
9646
10179
  var ps = React.useState(1), page = ps[0], setPage = ps[1];
9647
10180
  var qs = React.useState(""), query = qs[0], setQuery = qs[1];
9648
10181
  var es = React.useState(""), error = es[0], setError = es[1];
9649
10182
  var bs = React.useState(false), busy = bs[0], setBusy = bs[1];
10183
+ var ms = React.useState(false), more = ms[0], setMore = ms[1];
9650
10184
  var rs = React.useState(0), retry = rs[0], setRetry = rs[1];
9651
10185
  var as = React.useState(-1), active = as[0], setActive = as[1];
9652
10186
  var list = React.useRef(null);
10187
+ var loading = React.useRef(false);
9653
10188
  React.useEffect(function() {
9654
- var cancelled = false;
9655
- setBusy(true);
10189
+ var cancelled = false, first = page <= 1;
10190
+ if (first) setBusy(true);
10191
+ else setMore(true);
9656
10192
  setError("");
9657
- p.api.call("tasks.timelines", { includeSingletons: true, titleKey: query, pageNumber: page, pageSize: 20 }).then(result).then(function(r) {
9658
- if (!cancelled) {
9659
- setData(r);
9660
- setActive(-1);
9661
- setBusy(false);
9662
- }
10193
+ loading.current = true;
10194
+ p.api.call("tasks.timelines", { includeSingletons: true, titleKey: query, pageNumber: page, pageSize: PAGE_SIZE }).then(result).then(function(r) {
10195
+ if (cancelled) return;
10196
+ loading.current = false;
10197
+ setData(function(prev) {
10198
+ if (first) return r;
10199
+ return { records: (prev.records || []).concat(r.records || []), total: r.total };
10200
+ });
10201
+ setActive(-1);
10202
+ setBusy(false);
10203
+ setMore(false);
9663
10204
  }).catch(function(e) {
9664
- if (!cancelled) {
9665
- setError(String(e.message || e));
9666
- setBusy(false);
9667
- }
10205
+ if (cancelled) return;
10206
+ loading.current = false;
10207
+ setError(String(e.message || e));
10208
+ setBusy(false);
10209
+ setMore(false);
9668
10210
  });
9669
10211
  return function() {
9670
10212
  cancelled = true;
9671
10213
  };
9672
10214
  }, [p.api, page, query, retry]);
9673
- var rows = data.records || [], pages = Math.max(1, Math.ceil(data.total / 20));
10215
+ var rows = data.records || [], pages = Math.max(1, Math.ceil(data.total / PAGE_SIZE));
9674
10216
  function choose(row) {
9675
10217
  if (row) p.onChange(row.timelineId || row.timelineKey, row.title || "");
9676
10218
  }
@@ -9689,11 +10231,21 @@ var require_timeline_controls = __commonJS({
9689
10231
  var nodes = list.current ? list.current.querySelectorAll('[role="option"]') : [];
9690
10232
  return Array.prototype.indexOf.call(nodes, document.activeElement);
9691
10233
  }
10234
+ function loadMore() {
10235
+ if (loading.current || busy || more || page >= pages) return;
10236
+ setPage(page + 1);
10237
+ }
10238
+ function onScroll(e) {
10239
+ var el = e.currentTarget;
10240
+ if (!el || !el.scrollHeight) return;
10241
+ if (el.scrollTop + el.clientHeight >= el.scrollHeight - 48) loadMore();
10242
+ }
9692
10243
  function onKeyDown(e) {
9693
10244
  var base = focusedIndex() >= 0 ? focusedIndex() : active;
9694
10245
  if (e.key === "ArrowDown") {
9695
10246
  e.preventDefault();
9696
10247
  move(base + 1);
10248
+ loadMore();
9697
10249
  } else if (e.key === "ArrowUp") {
9698
10250
  e.preventDefault();
9699
10251
  move(base <= 0 ? 0 : base - 1);
@@ -9703,6 +10255,7 @@ var require_timeline_controls = __commonJS({
9703
10255
  } else if (e.key === "End") {
9704
10256
  e.preventDefault();
9705
10257
  move(rows.length - 1);
10258
+ loadMore();
9706
10259
  } else if (e.key === "Enter") {
9707
10260
  if (document.activeElement && document.activeElement.getAttribute("role") === "option") return;
9708
10261
  e.preventDefault();
@@ -9716,15 +10269,20 @@ var require_timeline_controls = __commonJS({
9716
10269
  "label",
9717
10270
  { className: "wbt-field" },
9718
10271
  tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"),
9719
- h("input", { className: "wbt-input", "aria-label": tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"), value: query, onChange: function(e) {
9720
- setQuery(e.target.value);
9721
- setPage(1);
9722
- } })
10272
+ h("input", {
10273
+ className: "wbt-input",
10274
+ "aria-label": tr("\u641C\u7D22\u5DF2\u6709\u65F6\u95F4\u7EBF"),
10275
+ value: query,
10276
+ onChange: function(e) {
10277
+ setQuery(e.target.value);
10278
+ setPage(1);
10279
+ }
10280
+ })
9723
10281
  ),
9724
10282
  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")),
9725
10283
  h(
9726
10284
  "div",
9727
- { ref: list, className: "wbt-picker-list", role: "listbox", "aria-label": tr("\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF"), "aria-busy": busy ? "true" : "false", onKeyDown },
10285
+ { 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 },
9728
10286
  busy ? h("p", { className: "wbt-picker-note" }, tr("\u52A0\u8F7D\u4E2D\u2026")) : null,
9729
10287
  error ? h("div", { className: "wbt-picker-note wbt-err", role: "alert" }, error, h("button", { type: "button", className: "wbt-btn", onClick: function() {
9730
10288
  setRetry(retry + 1);
@@ -9742,18 +10300,9 @@ var require_timeline_controls = __commonJS({
9742
10300
  h("span", { className: "wbt-picker-opt-title" }, row.title || tr("\u672A\u547D\u540D\u65F6\u95F4\u7EBF")),
9743
10301
  h("span", { className: "wbt-picker-opt-count" }, row.taskCount + tr(" \u4E2A\u4EFB\u52A1"))
9744
10302
  );
9745
- }) : null
9746
- ),
9747
- h(
9748
- "div",
9749
- { className: "wbt-timeline-pager" },
9750
- h("button", { type: "button", className: "wbt-btn", disabled: busy || page <= 1, onClick: function() {
9751
- setPage(page - 1);
9752
- } }, tr("\u4E0A\u4E00\u9875")),
9753
- h("span", null, page + " / " + pages),
9754
- h("button", { type: "button", className: "wbt-btn", disabled: busy || page >= pages, onClick: function() {
9755
- setPage(page + 1);
9756
- } }, tr("\u4E0B\u4E00\u9875"))
10303
+ }) : null,
10304
+ more ? h("p", { className: "wbt-picker-note" }, tr("\u52A0\u8F7D\u66F4\u591A\u2026")) : null,
10305
+ !busy && !error && rows.length && page >= pages ? h("p", { className: "wbt-picker-note" }, tr("\u5DF2\u5230\u6700\u540E\u4E00\u6761")) : null
9757
10306
  )
9758
10307
  );
9759
10308
  }
@@ -10247,44 +10796,28 @@ var require_ownership_fields = __commonJS({
10247
10796
  var h = React.createElement;
10248
10797
  var Picker = require_table_picker()(React);
10249
10798
  function Selection(props) {
10250
- var state = React.useState(false), open = state[0], setOpen = state[1], trigger = React.useRef(null);
10251
10799
  var chosen = ownership.tables(props.tree).find(function(x) {
10252
10800
  return x.id === props.form.tableId;
10253
10801
  });
10254
- function close() {
10255
- setOpen(false);
10256
- if (trigger.current) trigger.current.focus();
10257
- }
10258
10802
  return h(
10259
10803
  "div",
10260
10804
  null,
10261
10805
  h("div", { className: "wbt-picker-detail" }, props.edit ? "\u5F53\u524D\u5F52\u5C5E\uFF1A" + props.current : "\u76EE\u6807\u4EFB\u52A1\u8868 *"),
10262
- h("button", {
10263
- ref: trigger,
10264
- type: "button",
10265
- className: "wbt-btn",
10266
- disabled: !!props.form.newPath,
10267
- "aria-expanded": open,
10268
- onClick: function() {
10269
- setOpen(!open);
10270
- }
10271
- }, props.edit ? "\u66F4\u6362\u4EFB\u52A1\u8868" : "\u9009\u62E9\u76EE\u6807\u4EFB\u52A1\u8868"),
10272
- open && !props.form.newPath ? h(Picker, {
10806
+ props.form.newPath ? null : h(Picker, {
10273
10807
  tree: props.tree,
10274
10808
  value: props.form.tableId,
10275
10809
  recommended: props.recommended,
10810
+ onClose: null,
10276
10811
  onChange: function(id) {
10277
10812
  props.set("tableId", props.edit && id === String(props.currentId) ? "" : id);
10278
- },
10279
- onClose: close
10280
- }) : null,
10813
+ }
10814
+ }),
10281
10815
  chosen ? h(
10282
10816
  "div",
10283
10817
  { className: "wbt-picker-detail", role: "status" },
10284
10818
  (props.edit ? "\u5C06\u79FB\u52A8\u5230\uFF1A" : "\u5DF2\u9009\u62E9\uFF1A") + chosen.path,
10285
10819
  props.edit ? h("button", { type: "button", className: "wbt-btn ghost", onClick: function() {
10286
10820
  props.set("tableId", "");
10287
- close();
10288
10821
  } }, "\u64A4\u9500\uFF0C\u4FDD\u7559\u539F\u4F4D") : null
10289
10822
  ) : 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")
10290
10823
  );
@@ -10356,6 +10889,8 @@ var require_ownership_fields = __commonJS({
10356
10889
  var require_create_modal = __commonJS({
10357
10890
  "packages/addons/tasks/client/modals/create-modal.cjs"(exports2, module2) {
10358
10891
  var NF = require_number_field();
10892
+ var staged = require_staged_dialog();
10893
+ var FilterChecklist = require_filter_checklist();
10359
10894
  function initialPriority(source, origin, fallback) {
10360
10895
  var original = Number(origin && origin.priority);
10361
10896
  if (source === "2" && Number.isInteger(original) && original >= 1 && original <= 10) return original;
@@ -10375,6 +10910,35 @@ var require_create_modal = __commonJS({
10375
10910
  var DP = require_date_picker();
10376
10911
  var allTables = deps.allTables, tagNames = deps.tagNames, splitTags = deps.splitTags;
10377
10912
  var today = deps.today, addDays = deps.addDays, hostHasAddon = deps.hostHasAddon;
10913
+ var StagedDialog = staged.createStagedDialog({
10914
+ React,
10915
+ tag: "div",
10916
+ displayName: "TaskCreateDialog",
10917
+ maskClass: "wbt-modal-mask",
10918
+ dialogClass: "wbt-modal",
10919
+ header: function(p) {
10920
+ return h(
10921
+ "div",
10922
+ { className: "wbt-modal-head" },
10923
+ h("h3", null, p.title),
10924
+ h("button", { type: "button", className: "wbt-icon", disabled: !!p.submitting, onClick: p.onClose, "aria-label": p.closeLabel }, "\xD7")
10925
+ );
10926
+ },
10927
+ closeOnEscape: function(p) {
10928
+ return !p.submitting;
10929
+ },
10930
+ closeOnMask: function(p) {
10931
+ return !p.submitting;
10932
+ },
10933
+ // 表选择器内部自己用 Esc 收面板,别把它一起关掉。
10934
+ onKeyDown: function(e) {
10935
+ if (e.key === "Escape" && e.target && e.target.closest && e.target.closest(".wbt-table-picker")) {
10936
+ e.stopPropagation();
10937
+ return true;
10938
+ }
10939
+ return false;
10940
+ }
10941
+ });
10378
10942
  function CreateModal(props) {
10379
10943
  var t = props.t, tr = require_timeline_copy()(props.t);
10380
10944
  var source = String(props.source || "0");
@@ -10414,12 +10978,6 @@ var require_create_modal = __commonJS({
10414
10978
  function requestClose() {
10415
10979
  if (!submission.pending) props.onClose();
10416
10980
  }
10417
- function onModalKey(e) {
10418
- if (e.key !== "Escape" || e.target && e.target.closest && e.target.closest(".wbt-table-picker")) return;
10419
- e.preventDefault();
10420
- e.stopPropagation();
10421
- requestClose();
10422
- }
10423
10981
  var active = source === "2" || form.status === "0";
10424
10982
  var priorityError = active ? validatePriority(form.priority, source, t) : "";
10425
10983
  var difficultyCheck = NF.validateNumber(form.difficulty, { min: 0, max: 5, step: 0.5, allowEmpty: true, lang: props.lang });
@@ -10526,7 +11084,7 @@ var require_create_modal = __commonJS({
10526
11084
  });
10527
11085
  }
10528
11086
  var title = source === "2" ? t.restartTitle : source === "1" ? tr("\u5411\u5DF2\u6709\u65F6\u95F4\u7EBF\u6DFB\u52A0\u4EFB\u52A1") : t.newTask;
10529
- var timelineSection = source !== "2" ? h(
11087
+ var timelineSection = h(
10530
11088
  "div",
10531
11089
  { className: "wbt-create-tl full" },
10532
11090
  h(
@@ -10538,94 +11096,341 @@ var require_create_modal = __commonJS({
10538
11096
  h(TimelinePicker, { api: props.api, t, value: form.timelineId, onChange: function(value) {
10539
11097
  set("timelineId", value);
10540
11098
  }, disabled: isBusy })
10541
- ) : null;
10542
- return h(
10543
- "div",
10544
- { className: "wbt-modal-mask", onKeyDownCapture: onModalKey, onMouseDown: function(e) {
10545
- if (e.target === e.currentTarget) requestClose();
10546
- } },
10547
- h(
11099
+ );
11100
+ function stepContent(h2) {
11101
+ return h2(
10548
11102
  "div",
10549
- { className: "wbt-modal" },
10550
- h("div", { className: "wbt-modal-head" }, h("h3", null, title), h("button", { className: "wbt-icon", disabled: isBusy, onClick: requestClose }, "\xD7")),
10551
- source === "2" ? h("div", { className: "wbt-mhint" }, t.restartPriorityHint) : null,
10552
- 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,
10553
- 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,
10554
- h(
11103
+ { className: "wbctl-form" },
11104
+ origin ? h2(
10555
11105
  "div",
10556
- { className: "wbt-form" },
10557
- h("label", { className: "wbt-field full" }, h("span", null, t.titleField + " *"), h("input", { className: "wbt-input", value: form.title, onChange: function(e) {
11106
+ { className: "wbt-mhint full" },
11107
+ "\u6765\u6E90\uFF1A" + (origin.title || origin.id) + (source === "2" ? tr(" \xB7 \u81EA\u52A8\u7EE7\u627F\u539F\u65F6\u95F4\u7EBF") : "")
11108
+ ) : null,
11109
+ h2(
11110
+ "label",
11111
+ { className: "wbt-field full" },
11112
+ h2("span", null, t.titleField + " *"),
11113
+ h2("input", { className: "wbt-input", value: form.title, onChange: function(e) {
10558
11114
  set("title", e.target.value);
10559
- }, autoFocus: true })),
10560
- h("label", { className: "wbt-field full" }, h("span", null, t.desc), h("textarea", { className: "wbt-textarea", rows: 2, value: form.description, onChange: function(e) {
11115
+ } })
11116
+ ),
11117
+ h2(
11118
+ "label",
11119
+ { className: "wbt-field full" },
11120
+ h2("span", null, t.desc),
11121
+ h2("textarea", { className: "wbt-textarea", rows: 3, value: form.description, onChange: function(e) {
10561
11122
  set("description", e.target.value);
10562
- } })),
10563
- 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) {
10564
- set("tags", e.target.value);
10565
- } })) : null,
10566
- timelineSection,
10567
- h(WorkspaceSelect, { api: props.api, lang: props.lang, value: form.workspaceIds, onChange: function(ids) {
10568
- set("workspaceIds", ids);
10569
- } }),
10570
- h("label", { className: "wbt-field" }, h("span", null, t.status), h(
11123
+ } })
11124
+ ),
11125
+ source === "2" ? h2("div", { className: "wbt-mhint full" }, t.restartPriorityHint) : null,
11126
+ h2(
11127
+ "label",
11128
+ { className: "wbt-field" },
11129
+ h2("span", null, t.status),
11130
+ h2(
10571
11131
  "select",
10572
11132
  { className: "wbt-select", value: source === "2" ? "0" : form.status, disabled: source === "2", onChange: function(e) {
10573
11133
  set("status", e.target.value);
10574
11134
  } },
10575
- h("option", { value: "0" }, "\u5DF2\u5F00\u542F"),
10576
- h("option", { value: "2" }, "\u5DF2\u5B8C\u6210"),
10577
- h("option", { value: "1" }, "\u5DF2\u5173\u95ED")
10578
- )),
10579
- h(
10580
- "div",
10581
- { className: "wbt-field" },
10582
- h("span", { className: "wbt-field-label" }, t.priority + "\uFF081\u201310\uFF09"),
10583
- h(NF.NumberField, {
10584
- h,
10585
- lang: props.lang,
10586
- value: form.priority,
10587
- min: 1,
10588
- max: 10,
10589
- integer: true,
10590
- disabled: !active,
10591
- hint: false,
10592
- ariaLabel: t.priority,
10593
- // 键入即写入草稿;合法性由下面的 priorityError 实时判定,绝不回写夹取后的值。
10594
- onDraft: function(raw) {
10595
- set("priority", raw);
10596
- },
10597
- onCommit: function(next) {
10598
- set("priority", String(next));
10599
- }
10600
- })
10601
- ),
10602
- fields({ form, set, setMany, tree: props.tree, recommended: props.defaultTableId || origin && origin.tableId }),
10603
- 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) {
11135
+ h2("option", { value: "0" }, "\u5DF2\u5F00\u542F"),
11136
+ h2("option", { value: "2" }, "\u5DF2\u5B8C\u6210"),
11137
+ h2("option", { value: "1" }, "\u5DF2\u5173\u95ED")
11138
+ )
11139
+ ),
11140
+ h2(
11141
+ "div",
11142
+ { className: "wbt-field" },
11143
+ h2("span", { className: "wbt-field-label" }, t.priority + "\uFF081\u201310\uFF09"),
11144
+ h2(NF.NumberField, {
11145
+ h: h2,
11146
+ lang: props.lang,
11147
+ value: form.priority,
11148
+ min: 1,
11149
+ max: 10,
11150
+ integer: true,
11151
+ disabled: !active,
11152
+ hint: false,
11153
+ ariaLabel: t.priority,
11154
+ // 键入即写入草稿;合法性由下面的 priorityError 实时判定,绝不回写夹取后的值。
11155
+ onDraft: function(raw) {
11156
+ set("priority", raw);
11157
+ },
11158
+ onCommit: function(next) {
11159
+ set("priority", String(next));
11160
+ }
11161
+ })
11162
+ ),
11163
+ priorityError ? h2("div", { className: "wbt-err full", role: "alert" }, priorityError) : null,
11164
+ difficultyField(t, form.difficulty, function(value) {
11165
+ set("difficulty", value);
11166
+ }, "wbt-create-difficulty", props.lang),
11167
+ h2(
11168
+ "label",
11169
+ { className: "wbt-field" },
11170
+ h2("span", null, t.publishDate),
11171
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.publishDate, value: form.publishDate, onChange: function(next) {
10604
11172
  set("publishDate", next);
10605
- } })),
10606
- 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) {
11173
+ } })
11174
+ ),
11175
+ h2(
11176
+ "label",
11177
+ { className: "wbt-field" },
11178
+ h2("span", null, t.targetDate),
11179
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.targetDate, value: form.targetDate, onChange: function(next) {
10607
11180
  set("targetDate", next);
10608
- } })),
10609
- 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) {
11181
+ } })
11182
+ ),
11183
+ source !== "2" && form.status === "2" ? h2(
11184
+ "label",
11185
+ { className: "wbt-field" },
11186
+ h2("span", null, t.doneDate),
11187
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.doneDate, value: form.doneDate, onChange: function(next) {
10610
11188
  set("doneDate", next);
10611
- } })) : null,
10612
- difficultyField(t, form.difficulty, function(value) {
10613
- set("difficulty", value);
10614
- }, "wbt-create-difficulty", props.lang),
10615
- 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) {
11189
+ } })
11190
+ ) : null,
11191
+ source !== "2" && form.status === "1" ? h2(
11192
+ "label",
11193
+ { className: "wbt-field" },
11194
+ h2("span", null, t.shutdownDate),
11195
+ h2(DP.DatePicker, { React, h: h2, prefix: "wbt", lang: props.lang, label: t.shutdownDate, value: form.shutdownDate, onChange: function(next) {
10616
11196
  set("shutdownDate", next);
10617
- } })) : null
10618
- ),
10619
- priorityError ? h("div", { id: "wbt-create-priority-error", className: "wbt-err", role: "alert" }, priorityError) : null,
10620
- error ? h("div", { className: "wbt-err" }, error) : null,
10621
- h(
11197
+ } })
11198
+ ) : null
11199
+ );
11200
+ }
11201
+ function TagPicker(p2) {
11202
+ var h2 = p2.h;
11203
+ var names = splitTags(p2.value);
11204
+ var qs = React.useState(""), query = qs[0], setQuery = qs[1];
11205
+ var rs = React.useState([]), rows = rs[0], setRows = rs[1];
11206
+ var ts = React.useState(0), total = ts[0], setTotal = ts[1];
11207
+ var ps = React.useState(1), page = ps[0], setPage = ps[1];
11208
+ var hs = React.useState(false), hasMore = hs[0], setHasMore = hs[1];
11209
+ var ls = React.useState(false), loading = ls[0], setLoading = ls[1];
11210
+ var ds = React.useState(""), draft = ds[0], setDraft = ds[1];
11211
+ var seq = React.useRef(0);
11212
+ React.useEffect(function() {
11213
+ var mine = ++seq.current;
11214
+ setLoading(true);
11215
+ var timer = setTimeout(function() {
11216
+ p2.api.call("tasks.tagOptions", { query, pageNumber: 1, pageSize: 30 }).then(function(r) {
11217
+ if (mine !== seq.current) return;
11218
+ var out = r && r.ok ? r.result : {};
11219
+ var list = out.tags || [];
11220
+ setRows(list);
11221
+ setTotal(out.total || list.length);
11222
+ setPage(1);
11223
+ setHasMore(!!out.hasMore);
11224
+ setLoading(false);
11225
+ }).catch(function() {
11226
+ if (mine !== seq.current) return;
11227
+ setRows([]);
11228
+ setTotal(0);
11229
+ setHasMore(false);
11230
+ setLoading(false);
11231
+ });
11232
+ }, 200);
11233
+ return function() {
11234
+ clearTimeout(timer);
11235
+ };
11236
+ }, [p2.api, query]);
11237
+ function loadMore() {
11238
+ if (loading || !hasMore) return;
11239
+ var mine = seq.current, next = page + 1;
11240
+ setLoading(true);
11241
+ p2.api.call("tasks.tagOptions", { query, pageNumber: next, pageSize: 30 }).then(function(r) {
11242
+ if (mine !== seq.current) return;
11243
+ var out = r && r.ok ? r.result : {};
11244
+ setRows(rows.concat(out.tags || []));
11245
+ setPage(next);
11246
+ setHasMore(!!out.hasMore);
11247
+ setLoading(false);
11248
+ }).catch(function() {
11249
+ if (mine === seq.current) setLoading(false);
11250
+ });
11251
+ }
11252
+ function emit(next) {
11253
+ p2.onChange(next.join(", "));
11254
+ }
11255
+ function toggle(name) {
11256
+ emit(names.indexOf(name) >= 0 ? names.filter(function(x) {
11257
+ return x !== name;
11258
+ }) : names.concat([name]));
11259
+ }
11260
+ function toggleId(id) {
11261
+ var row = rows.filter(function(x) {
11262
+ return String(x.id) === String(id);
11263
+ })[0];
11264
+ if (row) toggle(String(row.name));
11265
+ }
11266
+ function addDraft() {
11267
+ var parts = splitTags(draft);
11268
+ if (!parts.length) return;
11269
+ var next = names.slice();
11270
+ parts.forEach(function(name2) {
11271
+ if (next.indexOf(name2) < 0) next.push(name2);
11272
+ });
11273
+ emit(next);
11274
+ setDraft("");
11275
+ }
11276
+ var selectedIds = rows.filter(function(x) {
11277
+ return names.indexOf(String(x.name)) >= 0;
11278
+ }).map(function(x) {
11279
+ return String(x.id);
11280
+ });
11281
+ return h2(
11282
+ "div",
11283
+ { className: "wbt-tagpick" },
11284
+ names.length ? h2("div", { className: "wbt-tagchips", role: "group", "aria-label": t.tagSelected }, names.map(function(name2) {
11285
+ return h2(
11286
+ "button",
11287
+ { key: name2, type: "button", className: "wbt-tagchip", title: t.tagRemove, onClick: function() {
11288
+ toggle(name2);
11289
+ } },
11290
+ h2("span", null, name2),
11291
+ h2("span", { className: "wbt-tagchip-x", "aria-hidden": true }, "\xD7")
11292
+ );
11293
+ })) : h2("p", { className: "wbctl-note" }, t.tagNoPick),
11294
+ h2(FilterChecklist, {
11295
+ items: rows.map(function(x) {
11296
+ return { id: String(x.id), name: x.name, meta: x.total };
11297
+ }),
11298
+ selected: selectedIds,
11299
+ onToggle: toggleId,
11300
+ onClear: function() {
11301
+ emit([]);
11302
+ },
11303
+ query,
11304
+ onQuery: setQuery,
11305
+ loading,
11306
+ hasMore,
11307
+ onLoadMore: loadMore,
11308
+ total,
11309
+ title: t.allTags || "\u5168\u90E8\u6807\u7B7E",
11310
+ selectedText: t.tagSelected || "\u5DF2\u9009",
11311
+ clearText: t.clear || "\u6E05\u7A7A",
11312
+ searchPlaceholder: t.tagSearchExisting || "\u641C\u7D22\u5DF2\u6709\u6807\u7B7E",
11313
+ emptyText: t.noTags || "\u6682\u65E0\u6807\u7B7E",
11314
+ noMatchText: t.tagNoMatch || "\u6CA1\u6709\u5339\u914D\u7684\u6807\u7B7E",
11315
+ loadingText: t.loadingMore || "\u52A0\u8F7D\u4E2D\u2026",
11316
+ noMoreText: t.noMore || "\u6CA1\u6709\u66F4\u591A",
11317
+ autoFocus: false
11318
+ }),
11319
+ h2(
10622
11320
  "div",
10623
- { className: "wbt-modal-foot" },
10624
- h("button", { className: "wbt-btn ghost", disabled: isBusy, onClick: requestClose }, t.cancel),
10625
- h("button", { className: "wbt-btn primary", disabled: isBusy || !!priorityError || !difficultyCheck.ok || !targetValid || source === "2" && !(origin && origin.timelineId), onClick: submit }, isBusy ? "\u2026" : t.create)
11321
+ { className: "wbt-tagnew" },
11322
+ h2("input", {
11323
+ className: "wbt-input",
11324
+ value: draft,
11325
+ placeholder: t.tagNewPlaceholder,
11326
+ "aria-label": t.tagNewPlaceholder,
11327
+ onChange: function(e) {
11328
+ setDraft(e.target.value);
11329
+ },
11330
+ onKeyDown: function(e) {
11331
+ if (e.key === "Enter") {
11332
+ e.preventDefault();
11333
+ addDraft();
11334
+ }
11335
+ }
11336
+ }),
11337
+ h2("button", { type: "button", className: "wbt-btn", disabled: !splitTags(draft).length, onClick: addDraft }, t.tagAdd || "\u6DFB\u52A0")
10626
11338
  )
10627
- )
10628
- );
11339
+ );
11340
+ }
11341
+ function stepTags(h2) {
11342
+ return h2(
11343
+ "div",
11344
+ { className: "wbctl-form" },
11345
+ h2("div", { className: "full" }, h2(TagPicker, { h: h2, api: props.api, t, value: form.tags, onChange: function(next) {
11346
+ set("tags", next);
11347
+ } }))
11348
+ );
11349
+ }
11350
+ function stepTable(h2) {
11351
+ return h2(
11352
+ "div",
11353
+ { className: "wbctl-form" },
11354
+ h2(
11355
+ "div",
11356
+ { className: "full" },
11357
+ fields({ form, set, setMany, tree: props.tree, recommended: props.defaultTableId || origin && origin.tableId })
11358
+ )
11359
+ );
11360
+ }
11361
+ function stepTimeline(h2) {
11362
+ if (source === "2") {
11363
+ return h2(
11364
+ "div",
11365
+ { className: "wbctl-form" },
11366
+ h2("p", { className: "wbt-mhint full" }, tr("\u7EE7\u627F\u6765\u6E90\u4EFB\u52A1\u7684\u65F6\u95F4\u7EBF")),
11367
+ !(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
11368
+ );
11369
+ }
11370
+ return h2("div", { className: "wbctl-form" }, timelineSection);
11371
+ }
11372
+ function stepWorkspace(h2) {
11373
+ return h2(
11374
+ "div",
11375
+ { className: "wbctl-form" },
11376
+ h2(WorkspaceSelect, { api: props.api, lang: props.lang, value: form.workspaceIds, onChange: function(ids) {
11377
+ set("workspaceIds", ids);
11378
+ } })
11379
+ );
11380
+ }
11381
+ var steps = [
11382
+ {
11383
+ key: "content",
11384
+ label: t.stepContent,
11385
+ hint: t.stepContentHint,
11386
+ render: stepContent,
11387
+ validate: function() {
11388
+ if (!String(form.title).trim()) return t.needTitle;
11389
+ if (priorityError) return priorityError;
11390
+ if (!difficultyCheck.ok) return difficultyCheck.error;
11391
+ if (!form.publishDate || !form.targetDate) return t.needDate;
11392
+ return "";
11393
+ }
11394
+ }
11395
+ ];
11396
+ if (hostHasAddon("wb-addon-tags")) {
11397
+ steps.push({ key: "tags", label: t.stepTags, hint: t.stepTagsHint, render: stepTags });
11398
+ }
11399
+ steps.push({
11400
+ key: "table",
11401
+ label: t.stepTable,
11402
+ hint: t.stepTableHint,
11403
+ render: stepTable,
11404
+ validate: function() {
11405
+ return targetValid ? "" : form.newPath ? plan.error || "\u8BF7\u786E\u8BA4\u65B0\u5EFA\u8DEF\u5F84" : t.needTable;
11406
+ }
11407
+ });
11408
+ steps.push({
11409
+ key: "timeline",
11410
+ label: t.stepTimeline,
11411
+ hint: t.stepTimelineHint,
11412
+ render: stepTimeline,
11413
+ validate: function() {
11414
+ if (source === "2" && !(origin && origin.timelineId)) return tr("\u8BF7\u5148\u624B\u52A8\u5EFA\u7ACB\u5E76\u5173\u8054\u65F6\u95F4\u7EBF\uFF0C\u518D\u91CD\u542F");
11415
+ if (source === "1" && !form.timelineId) return tr("\u8BF7\u9009\u62E9\u5DF2\u6709\u65F6\u95F4\u7EBF");
11416
+ return "";
11417
+ }
11418
+ });
11419
+ steps.push({ key: "workspace", label: t.stepWorkspace, hint: t.stepWorkspaceHint, render: stepWorkspace });
11420
+ return h(StagedDialog, {
11421
+ title,
11422
+ closeLabel: t.cancel,
11423
+ steps,
11424
+ submitting: isBusy,
11425
+ error,
11426
+ onClose: requestClose,
11427
+ onSubmit: submit,
11428
+ submitText: t.create,
11429
+ cancelText: t.cancel,
11430
+ nextText: t.nextStep || "\u4E0B\u4E00\u6B65",
11431
+ backText: t.prevStep || "\u4E0A\u4E00\u6B65",
11432
+ stepsLabel: t.createSteps || "\u521B\u5EFA\u6B65\u9AA4"
11433
+ });
10629
11434
  }
10630
11435
  return CreateModal;
10631
11436
  };
@@ -14065,7 +14870,7 @@ var require_timeline_view = __commonJS({
14065
14870
  var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
14066
14871
  host.registerAddon({
14067
14872
  id: "wb-addon-tasks",
14068
- version: "5.2.35",
14873
+ version: "5.2.40",
14069
14874
  icon: ICONS["list-checks"],
14070
14875
  // 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
14071
14876
  // 不会在邮件里留一个渲染即报错的孤儿按钮。