dsh-workbench-tasks 5.13.0 → 5.13.1

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 (2) hide show
  1. package/lib/client.js +83 -7
  2. package/package.json +2 -2
package/lib/client.js CHANGED
@@ -7511,11 +7511,14 @@ var require_stepper = __commonJS({
7511
7511
  ".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)}",
7512
7512
  ".wbctl-step[data-state=current] .wbctl-step-index{background:var(--wb-accent,#2563eb);color:var(--wb-on-accent,#fff)}",
7513
7513
  ".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))}",
7514
- ".wbctl-step-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
7515
- ".wbctl-step-hint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
7514
+ // 标题优先可读:label 不收缩、不省略,宽度不够时让 hint 先让位(截断或整体隐藏),
7515
+ // 不再出现「关联凭…」这种把步骤标题截掉的结果。
7516
+ ".wbctl-step-label{flex:0 0 auto;min-width:0;white-space:nowrap}",
7517
+ ".wbctl-step-hint{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
7516
7518
  ".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
7517
- "@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}}",
7518
- "@media (max-width:520px){.wbctl-step-list{gap:4px}.wbctl-step-label{white-space:normal}.wbctl-step{gap:5px}}",
7519
+ // 窄屏先藏提示,标题仍占满整行;再窄就把标题折行,宁可变高也不截字。
7520
+ "@media (max-width:760px){.wbctl-step-list{flex-wrap:wrap}.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}}",
7521
+ "@media (max-width:520px){.wbctl-step-list{gap:4px}.wbctl-step-label{white-space:normal;overflow-wrap:anywhere}.wbctl-step{gap:5px}}",
7519
7522
  "@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
7520
7523
  ];
7521
7524
  module2.exports = { Steps, stepState, styles: STYLES };
@@ -7542,15 +7545,53 @@ var require_staged_dialog = __commonJS({
7542
7545
  }
7543
7546
  return null;
7544
7547
  }
7548
+ var ENTER_OWN_SELECTOR = [
7549
+ "[data-role=checklist]",
7550
+ "[data-role=datepicker]",
7551
+ "[role=combobox]",
7552
+ "[role=listbox]",
7553
+ "[role=menu]",
7554
+ "[aria-haspopup]",
7555
+ ".wbctl-step"
7556
+ ].join(",");
7557
+ var INPUT_TYPES_OWN_ENTER = [
7558
+ "checkbox",
7559
+ "radio",
7560
+ "file",
7561
+ "range",
7562
+ "color",
7563
+ "button",
7564
+ "submit",
7565
+ "reset",
7566
+ "search"
7567
+ ];
7568
+ function isEnterTarget(target) {
7569
+ if (!target || typeof target.tagName !== "string") return false;
7570
+ if (target.isContentEditable) return false;
7571
+ if (target.tagName.toUpperCase() !== "INPUT") return false;
7572
+ var type = String(target.type || "text").toLowerCase();
7573
+ if (INPUT_TYPES_OWN_ENTER.indexOf(type) >= 0) return false;
7574
+ if (target.disabled || target.readOnly) return false;
7575
+ if (typeof target.closest === "function" && target.closest(ENTER_OWN_SELECTOR)) return false;
7576
+ return true;
7577
+ }
7578
+ var STEP_FIELD_SELECTOR = [
7579
+ "input:not([type=hidden]):not([disabled]):not([readonly])",
7580
+ "textarea:not([disabled]):not([readonly])",
7581
+ "select:not([disabled])",
7582
+ "[contenteditable=true]"
7583
+ ].join(",");
7545
7584
  function createStagedDialog(options) {
7546
7585
  var opts = options || {};
7547
7586
  var React = opts.React || defaultReact;
7548
7587
  var h = React.createElement;
7549
7588
  var dialogClass = ((opts.dialogClass || "") + " wbctl-dialog").trim();
7589
+ var maskClass = ((opts.maskClass || "") + " wbctl-mask").trim();
7550
7590
  var Overlay = overlayFactory(
7551
7591
  Object.assign({}, opts, {
7552
7592
  React,
7553
7593
  dialogClass,
7594
+ maskClass,
7554
7595
  // 首焦点由外壳送进对话框,字段由 focusStep 负责,避免打开瞬间落进第一个输入框。
7555
7596
  autoFocusDialog: opts.autoFocusDialog !== false
7556
7597
  })
@@ -7590,10 +7631,26 @@ var require_staged_dialog = __commonJS({
7590
7631
  var el = bodyRef.current;
7591
7632
  if (el && typeof el.focus === "function") el.focus();
7592
7633
  }
7634
+ function focusFirstField() {
7635
+ var el = bodyRef.current;
7636
+ if (!el || typeof el.querySelector !== "function") {
7637
+ focusBody();
7638
+ return;
7639
+ }
7640
+ var field = el.querySelector(STEP_FIELD_SELECTOR);
7641
+ if (field && typeof field.focus === "function") field.focus();
7642
+ else focusBody();
7643
+ }
7644
+ var firstStep = R.useRef(true);
7593
7645
  R.useEffect(
7594
7646
  function() {
7595
7647
  if (!mounted.current) return;
7596
- focusBody();
7648
+ if (firstStep.current) {
7649
+ firstStep.current = false;
7650
+ focusBody();
7651
+ return;
7652
+ }
7653
+ focusFirstField();
7597
7654
  },
7598
7655
  [index]
7599
7656
  );
@@ -7672,7 +7729,17 @@ var require_staged_dialog = __commonJS({
7672
7729
  {
7673
7730
  className: "wbctl-dialog-body" + (props.bodyClassName ? " " + props.bodyClassName : ""),
7674
7731
  ref: bodyRef,
7675
- tabIndex: -1
7732
+ tabIndex: -1,
7733
+ // Enter 在当前步的单个输入框里等于「下一步 / 保存」:连续回车能一路走完表单。
7734
+ onKeyDown: function(e) {
7735
+ if (e.key !== "Enter") return;
7736
+ if (e.isComposing || e.keyCode === 229) return;
7737
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) return;
7738
+ if (busy || !isEnterTarget(e.target)) return;
7739
+ e.preventDefault();
7740
+ if (isLast) submit();
7741
+ else next();
7742
+ }
7676
7743
  },
7677
7744
  current ? current.render(h, props) : null
7678
7745
  ),
@@ -7709,6 +7776,12 @@ var require_staged_dialog = __commonJS({
7709
7776
  return StagedDialog;
7710
7777
  }
7711
7778
  var STYLES = [
7779
+ // 遮罩:比各插件原来的 45% 更深,并模糊背后内容——自定义主题把底色写成半透明时,
7780
+ // 背后的表格文字也不会透出来(用双类名压过插件自己的 .xxx-modal 单类规则,不依赖拼接顺序)。
7781
+ ".wbctl-mask.wbctl-mask{background:color-mix(in oklab,var(--wb-muted,var(--wb-border,currentColor)) 58%,transparent);backdrop-filter:blur(4px)}",
7782
+ // 弹窗底板:先铺主题的页面底色(一般是实色),再把可能带透明的卡片色叠上去,
7783
+ // 最后模糊背后内容;任何主题下弹窗本体都可读,不再依赖各插件自己写背景。
7784
+ ".wbctl-dialog.wbctl-dialog{background-color:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-layer-2,var(--wb-card,transparent)));background-image:linear-gradient(var(--wb-card,transparent),var(--wb-card,transparent));backdrop-filter:blur(12px) saturate(1.04)}",
7712
7785
  // 宽表单:内容多时给足横向空间,窄屏留 16px 边距后铺满。
7713
7786
  ".wbctl-dialog{width:min(880px,calc(100vw - 32px));max-height:min(92vh,760px);display:flex;flex-direction:column;overflow:hidden}",
7714
7787
  ".wbctl-dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px 2px 10px;outline:none}",
@@ -7734,6 +7807,9 @@ var require_staged_dialog = __commonJS({
7734
7807
  createStagedDialog,
7735
7808
  validateStep,
7736
7809
  firstFailing,
7810
+ isEnterTarget,
7811
+ enterOwnSelector: ENTER_OWN_SELECTOR,
7812
+ stepFieldSelector: STEP_FIELD_SELECTOR,
7737
7813
  styles: STYLES
7738
7814
  };
7739
7815
  }
@@ -13163,7 +13239,7 @@ var require_timeline_view = __commonJS({
13163
13239
  var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configClient, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
13164
13240
  host.registerAddon({
13165
13241
  id: "wb-addon-tasks",
13166
- version: "5.13.0",
13242
+ version: "5.13.1",
13167
13243
  icon: ICONS["list-checks"],
13168
13244
  // 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
13169
13245
  // 不会在邮件里留一个渲染即报错的孤儿按钮。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workbench-tasks",
3
- "version": "5.13.0",
3
+ "version": "5.13.1",
4
4
  "description": "个人工作台任务插件:任务树、优先级、截止日、时间线与重启",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -17,7 +17,7 @@
17
17
  "id": "wb-addon-tasks",
18
18
  "title": "任务",
19
19
  "description": "任务树 + 统计/记录/时间线/工作区四个视图:紧急/已关闭/已开启/已完成/总览,可按标签筛选,附统计报表;配置项由宿主统一配置中心渲染",
20
- "version": "5.13.0",
20
+ "version": "5.13.1",
21
21
  "minShell": "0.21.0",
22
22
  "tables": [
23
23
  "task",