dsh-workbench-tasks 5.2.45 → 5.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -2471,7 +2471,7 @@ var require_switch = __commonJS({
2471
2471
  "packages/addons/lib/switch.cjs"(exports2, module2) {
2472
2472
  "use strict";
2473
2473
  var SWITCH_STYLES = [
2474
- ".wbctl-switch{display:inline-flex;align-items:center;gap:7px;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
2474
+ ".wbctl-switch{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
2475
2475
  ".wbctl-switch-track{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:34px;height:20px;padding:2px;border-radius:999px;background:color-mix(in oklab,currentColor 22%,transparent);transition:background .16s ease;flex:none}",
2476
2476
  ".wbctl-switch-knob{display:block;width:16px;height:16px;border-radius:50%;background:var(--wb-card,#fff);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .16s ease}",
2477
2477
  ".wbctl-switch[aria-checked=true]{color:var(--wb-accent,#2563eb)}",
@@ -6882,6 +6882,25 @@ var require_copy = __commonJS({
6882
6882
  }
6883
6883
  });
6884
6884
 
6885
+ // packages/addons/lib/icon-label.cjs
6886
+ var require_icon_label = __commonJS({
6887
+ "packages/addons/lib/icon-label.cjs"(exports2, module2) {
6888
+ "use strict";
6889
+ var VISUALLY_HIDDEN = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap";
6890
+ module2.exports = function iconLabel(h, Icon2, text, options) {
6891
+ var opts = options || {};
6892
+ var cls = "wb-icon-label" + (opts.short ? " wb-icon-label-short" : "") + (Icon2 ? "" : " wb-icon-label-fallback");
6893
+ return h(
6894
+ "span",
6895
+ { className: cls, title: typeof text === "string" ? text : void 0 },
6896
+ Icon2 ? h(Icon2, { size: 14, strokeWidth: 2, "aria-hidden": true, focusable: false }) : null,
6897
+ h("span", { className: "wb-icon-label-text" }, text)
6898
+ );
6899
+ };
6900
+ module2.exports.styles = ".wb-icon-label{display:inline-flex;align-items:center;gap:5px;max-width:100%;vertical-align:middle;text-align:start}.wb-icon-label>svg{flex:none}.wb-icon-label>span{min-width:0;overflow-wrap:anywhere}button .wb-icon-label:not(.wb-icon-label-fallback) .wb-icon-label-text{" + VISUALLY_HIDDEN + "}button .wb-icon-label.wb-icon-label-short .wb-icon-label-text{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal}";
6901
+ }
6902
+ });
6903
+
6885
6904
  // packages/addons/lib/icons.cjs
6886
6905
  var require_icons = __commonJS({
6887
6906
  "packages/addons/lib/icons.cjs"(exports2, module2) {
@@ -6905,6 +6924,11 @@ var require_icons = __commonJS({
6905
6924
  return h(C, attrs);
6906
6925
  }
6907
6926
  var set = { ICONS, Icon: Icon2 };
6927
+ set.label = function(name, text, options2) {
6928
+ return require_icon_label()(h, function NamedIcon(props) {
6929
+ return h(Icon2, Object.assign({ name }, props));
6930
+ }, text, options2);
6931
+ };
6908
6932
  if (opts.tabIcon) {
6909
6933
  set.tabIcon = function(name) {
6910
6934
  return function TabIcon() {
@@ -8151,7 +8175,7 @@ var require_icons2 = __commonJS({
8151
8175
  refresh: (init_refresh_cw(), __toCommonJS(refresh_cw_exports)).default
8152
8176
  // 「原邮件」回链:从邮件建出来的任务要能跳回去看一眼原文。
8153
8177
  }, {});
8154
- module2.exports = { ICONS: set.ICONS, Icon: set.Icon };
8178
+ module2.exports = { ICONS: set.ICONS, Icon: set.Icon, label: set.label };
8155
8179
  }
8156
8180
  });
8157
8181
 
@@ -14887,7 +14911,7 @@ var require_timeline_view = __commonJS({
14887
14911
  var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
14888
14912
  host.registerAddon({
14889
14913
  id: "wb-addon-tasks",
14890
- version: "5.2.45",
14914
+ version: "5.2.46",
14891
14915
  icon: ICONS["list-checks"],
14892
14916
  // 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
14893
14917
  // 不会在邮件里留一个渲染即报错的孤儿按钮。
package/lib/index.js CHANGED
@@ -17,6 +17,11 @@ import { registerActivityCalendarAction } from "./stats/activity-calendar.js";
17
17
  import { registerTimelineStatsAction } from "./stats/timeline-stats.js";
18
18
  import { DIFFICULTY_GUIDANCE } from "./task/model/task-difficulty.js";
19
19
  import { bindClock, ensureSchema } from "./db/db.js";
20
+ import { createRequire } from "node:module";
21
+
22
+ // 版本号只认 package.json:首页插件卡读的就是这里注册的 version,
23
+ // 之前手写字面量经常忘记跟着 package.json 一起改,卡片会一直显示旧版本。
24
+ const ADDON_VERSION = createRequire(import.meta.url)("../package.json").version;
20
25
  import { ensureTaskTagSource } from "./tagging/tagging.js";
21
26
  import { exportTasksData, importTasksData } from "./infra/backup.js";
22
27
  import { taskSync } from "./infra/sync.js";
@@ -129,7 +134,7 @@ export function apply(ctx) {
129
134
  id: "wb-addon-tasks",
130
135
  title: "任务",
131
136
  description: "任务树 + 统计/记录/时间线/配置/数据五个视图:紧急/已关闭/已开启/已完成/总览,可按标签筛选(需安装标签插件),附统计报表与只读数据浏览",
132
- version: "5.2.40",
137
+ version: ADDON_VERSION,
133
138
  category: "work",
134
139
  tables: ["task", "task_node", "task_timeline", "task_timeline_link", "task_workspace", "task_workspace_link"],
135
140
  sync: taskSync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workbench-tasks",
3
- "version": "5.2.45",
3
+ "version": "5.2.46",
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": "任务树 + 统计/记录/时间线/工作区/配置/数据/命令/Action 八个视图:紧急/已关闭/已开启/已完成/总览,可按标签筛选,附统计报表与表数据浏览",
20
- "version": "5.2.45",
20
+ "version": "5.2.46",
21
21
  "minShell": "0.8.4",
22
22
  "tables": [
23
23
  "task",
@@ -101,7 +101,7 @@
101
101
  "./package.json": "./package.json"
102
102
  },
103
103
  "dependencies": {
104
- "dsh-workbench-host": "^0.10.2"
104
+ "dsh-workbench-host": "^0.10.4"
105
105
  },
106
106
  "dsh": {
107
107
  "bundle": {