dsh-workbench-tasks 5.2.46 → 5.2.47
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 +63 -13
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -5829,6 +5829,10 @@ var require_action_schema_style = __commonJS({
|
|
|
5829
5829
|
"." + P + "-copy:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
|
|
5830
5830
|
"." + P + " details>summary{cursor:pointer;font-size:11.5px;color:var(--dsw-alias-label-secondary,inherit);width:max-content}",
|
|
5831
5831
|
"." + P + " details>summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
|
|
5832
|
+
// 参数折叠面板:折叠时只留一行「参数 · 必填 n」,展开后与表格之间留一点气口。
|
|
5833
|
+
"." + P + "-params{min-width:0}",
|
|
5834
|
+
"." + P + "-params>summary{user-select:none;max-width:100%}",
|
|
5835
|
+
"." + P + "-params[open]>summary{margin-bottom:6px}",
|
|
5832
5836
|
"." + P + "-empty{padding:24px;text-align:center;border:1px dashed var(--wb-border,#e3e5e9);border-radius:10px;color:var(--dsw-alias-label-tertiary,inherit)}",
|
|
5833
5837
|
"." + P + "-error{padding:12px;border:1px solid var(--dsw-alias-state-error-primary,#d9534f);border-radius:10px;color:var(--dsw-alias-state-error-primary,#d9534f);display:flex;gap:10px;align-items:center;flex-wrap:wrap;overflow-wrap:anywhere}",
|
|
5834
5838
|
"." + P + "-toast{position:sticky;bottom:8px;align-self:flex-start;border-radius:999px;padding:3px 10px;background:var(--dsw-alias-bg-skeleton,#f2f3f5);font-size:11.5px;max-width:100%}",
|
|
@@ -5908,6 +5912,10 @@ var require_action_schema_view = __commonJS({
|
|
|
5908
5912
|
paramCount: function(n) {
|
|
5909
5913
|
return n + " \u4E2A\u53C2\u6570";
|
|
5910
5914
|
},
|
|
5915
|
+
params: "\u53C2\u6570",
|
|
5916
|
+
requiredCount: function(n) {
|
|
5917
|
+
return "\u5FC5\u586B " + n;
|
|
5918
|
+
},
|
|
5911
5919
|
examples: "\u793A\u4F8B",
|
|
5912
5920
|
noExamples: "\u65E0\u793A\u4F8B",
|
|
5913
5921
|
copy: "\u590D\u5236",
|
|
@@ -5971,6 +5979,10 @@ var require_action_schema_view = __commonJS({
|
|
|
5971
5979
|
paramCount: function(n) {
|
|
5972
5980
|
return n + " params";
|
|
5973
5981
|
},
|
|
5982
|
+
params: "Parameters",
|
|
5983
|
+
requiredCount: function(n) {
|
|
5984
|
+
return n + " required";
|
|
5985
|
+
},
|
|
5974
5986
|
examples: "Examples",
|
|
5975
5987
|
noExamples: "No examples",
|
|
5976
5988
|
copy: "Copy",
|
|
@@ -6109,6 +6121,8 @@ var require_action_schema_view = __commonJS({
|
|
|
6109
6121
|
var toast = toastState[0], setToast = toastState[1];
|
|
6110
6122
|
var savingState = React.useState("");
|
|
6111
6123
|
var saving = savingState[0], setSaving = savingState[1];
|
|
6124
|
+
var foldsState = React.useState({});
|
|
6125
|
+
var folds = foldsState[0], setFolds = foldsState[1];
|
|
6112
6126
|
React.useEffect(function() {
|
|
6113
6127
|
injectCss();
|
|
6114
6128
|
}, []);
|
|
@@ -6208,6 +6222,15 @@ var require_action_schema_view = __commonJS({
|
|
|
6208
6222
|
}
|
|
6209
6223
|
Promise.resolve(api.call("actions.setActionOrigins", { action: name, origins: next })).then(done, fail);
|
|
6210
6224
|
}
|
|
6225
|
+
function paramsOpen(action) {
|
|
6226
|
+
if (Object.prototype.hasOwnProperty.call(folds, action.name)) return folds[action.name] === true;
|
|
6227
|
+
return Boolean(String(query || "").trim()) || reqMode !== "all" || Boolean(typePick);
|
|
6228
|
+
}
|
|
6229
|
+
function resetFolds() {
|
|
6230
|
+
setFolds(function(prev) {
|
|
6231
|
+
return Object.keys(prev).length ? {} : prev;
|
|
6232
|
+
});
|
|
6233
|
+
}
|
|
6211
6234
|
var all = snap && Array.isArray(snap.actions) ? snap.actions.filter(function(a) {
|
|
6212
6235
|
return a && a.domain === DOMAIN;
|
|
6213
6236
|
}) : [];
|
|
@@ -6304,6 +6327,10 @@ var require_action_schema_view = __commonJS({
|
|
|
6304
6327
|
}
|
|
6305
6328
|
function card(action) {
|
|
6306
6329
|
var rows = paramRows(action);
|
|
6330
|
+
var required = rows.filter(function(row) {
|
|
6331
|
+
return row.required;
|
|
6332
|
+
}).length;
|
|
6333
|
+
var open = paramsOpen(action);
|
|
6307
6334
|
var examples = Array.isArray(action.examples) ? action.examples : [];
|
|
6308
6335
|
return h(
|
|
6309
6336
|
"div",
|
|
@@ -6324,18 +6351,38 @@ var require_action_schema_view = __commonJS({
|
|
|
6324
6351
|
),
|
|
6325
6352
|
action.description ? h("p", { className: P + "-desc" }, Highlight.hit(action.description, kw)) : null,
|
|
6326
6353
|
rows.length ? h(
|
|
6327
|
-
"
|
|
6328
|
-
{
|
|
6329
|
-
|
|
6330
|
-
"
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6354
|
+
"details",
|
|
6355
|
+
{
|
|
6356
|
+
className: P + "-params",
|
|
6357
|
+
"data-params-fold": action.name,
|
|
6358
|
+
open,
|
|
6359
|
+
// 原生 details 自带键盘与无障碍语义,这里只记下用户的开合;
|
|
6360
|
+
// 筛选变化引起的程序性开合也会触发 toggle,记下的值与当次默认一致,随后由 resetFolds 清掉。
|
|
6361
|
+
onToggle: function(e) {
|
|
6362
|
+
var next = !!(e && e.currentTarget && e.currentTarget.open);
|
|
6363
|
+
setFolds(function(prev) {
|
|
6364
|
+
if (prev[action.name] === next) return prev;
|
|
6365
|
+
var out = Object.assign({}, prev);
|
|
6366
|
+
out[action.name] = next;
|
|
6367
|
+
return out;
|
|
6368
|
+
});
|
|
6369
|
+
}
|
|
6370
|
+
},
|
|
6371
|
+
h("summary", null, t.params + (required ? " \xB7 " + t.requiredCount(required) : "")),
|
|
6372
|
+
h(
|
|
6373
|
+
"table",
|
|
6374
|
+
{ className: P + "-table" },
|
|
6375
|
+
h("thead", null, h(
|
|
6376
|
+
"tr",
|
|
6377
|
+
null,
|
|
6378
|
+
h("th", null, t.colName),
|
|
6379
|
+
h("th", null, t.colType),
|
|
6380
|
+
h("th", null, t.colReq),
|
|
6381
|
+
h("th", null, t.colExtra),
|
|
6382
|
+
h("th", null, t.colDesc)
|
|
6383
|
+
)),
|
|
6384
|
+
h("tbody", null, rows.map(paramRow))
|
|
6385
|
+
)
|
|
6339
6386
|
) : h("div", { className: P + "-none" }, t.noParams),
|
|
6340
6387
|
h(
|
|
6341
6388
|
"div",
|
|
@@ -6412,6 +6459,7 @@ var require_action_schema_view = __commonJS({
|
|
|
6412
6459
|
"aria-label": t.search,
|
|
6413
6460
|
onChange: function(e) {
|
|
6414
6461
|
setQuery(e.target.value);
|
|
6462
|
+
resetFolds();
|
|
6415
6463
|
}
|
|
6416
6464
|
})
|
|
6417
6465
|
),
|
|
@@ -6423,6 +6471,7 @@ var require_action_schema_view = __commonJS({
|
|
|
6423
6471
|
"select",
|
|
6424
6472
|
{ value: reqMode, "aria-label": t.filterReq, onChange: function(e) {
|
|
6425
6473
|
setReqMode(e.target.value);
|
|
6474
|
+
resetFolds();
|
|
6426
6475
|
} },
|
|
6427
6476
|
h("option", { value: "all" }, t.all),
|
|
6428
6477
|
h("option", { value: "required" }, t.onlyRequired),
|
|
@@ -6437,6 +6486,7 @@ var require_action_schema_view = __commonJS({
|
|
|
6437
6486
|
"select",
|
|
6438
6487
|
{ value: typePick, "aria-label": t.filterType, onChange: function(e) {
|
|
6439
6488
|
setTypePick(e.target.value);
|
|
6489
|
+
resetFolds();
|
|
6440
6490
|
} },
|
|
6441
6491
|
h("option", { value: "" }, t.allTypes),
|
|
6442
6492
|
typeOptions.map(function(name) {
|
|
@@ -14911,7 +14961,7 @@ var require_timeline_view = __commonJS({
|
|
|
14911
14961
|
var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configView, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
|
|
14912
14962
|
host.registerAddon({
|
|
14913
14963
|
id: "wb-addon-tasks",
|
|
14914
|
-
version: "5.2.
|
|
14964
|
+
version: "5.2.47",
|
|
14915
14965
|
icon: ICONS["list-checks"],
|
|
14916
14966
|
// 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
|
|
14917
14967
|
// 不会在邮件里留一个渲染即报错的孤儿按钮。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workbench-tasks",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.47",
|
|
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.
|
|
20
|
+
"version": "5.2.47",
|
|
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.
|
|
104
|
+
"dsh-workbench-host": "^0.10.6"
|
|
105
105
|
},
|
|
106
106
|
"dsh": {
|
|
107
107
|
"bundle": {
|