dsh-plugin-core-demo 0.2.1 → 0.2.3
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/dist/client.js +194 -55
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -369,7 +369,12 @@ var SEGMENTED_CSS = `
|
|
|
369
369
|
\u51E0\u4F55 = \u6BB5\u9AD8 = token \u2212 6px\uFF08\u4E0A\u4E0B\u5404 2px padding + 1px \u8FB9\u6846\uFF09\uFF1Bdefault \u771F\u8FB9\u6846 1px + padding 2px\uFF0C
|
|
370
370
|
inset \u65E0\u8FB9\u6846\u6545 padding \u6536 3px \u628A\u7F3A\u7684 1px \u8865\u56DE\uFF0C\u4E24\u79CD\u5916\u89C2\u603B\u9AD8\u90FD == token\uFF0824/28/32\uFF09\uFF0C\u4E0D\u518D\u591A +2px\u3002
|
|
371
371
|
\u4EE5\u540E Button / Input \u7684\u6709\u8FB9 / \u65E0\u8FB9\u540C\u6B64\u89C4\u5219\u3002 */
|
|
372
|
-
|
|
372
|
+
/* \u26A0\uFE0F \u8F68\u9053 / \u9009\u4E2D\u7247\u7684\u989C\u8272\u53D8\u91CF\u5728\u57FA\u7840\u7C7B\u4E0A\u7ED9**\u9ED8\u8BA4\u503C**\uFF08= inset \u89C2\u611F\uFF09\uFF0Cvariant \u7C7B\u53EA\u505A\u8986\u76D6\uFF1A
|
|
373
|
+
\u6B64\u524D --seg-track \u53EA\u7531 variant \u7C7B\u5B9A\u4E49\uFF0C\u7C7B\u4E00\u65E6\u6CA1\u751F\u6548\uFF08\u5BBF\u4E3B\u6837\u5F0F\u88C1\u526A / \u9009\u62E9\u5668\u88AB\u88C1 / \u7248\u672C\u9519\u4F4D\uFF09\uFF0C
|
|
374
|
+
background:var(--seg-track) \u6574\u6761\u4F5C\u5E9F \u21D2 \u8F68\u9053\u5168\u900F\u660E\u3001\u300C\u5C31\u5269\u51E0\u4E2A\u5B57\u6D6E\u5728\u9875\u9762\u4E0A\u300D\uFF080.2.2 \u771F\u673A\u73B0\u8C61\uFF09\u3002
|
|
375
|
+
var() \u7684\u7B2C\u4E8C\u53C2\u515C\u5E95\u4FDD\u8BC1\u4EFB\u4F55\u60C5\u51B5\u4E0B\u8F68\u9053\u90FD\u6709\u5E95\u3001\u9009\u4E2D\u7247\u90FD\u6709\u8272\u3002 */
|
|
376
|
+
.dshpc-seg{--seg-track:var(--dshpc-hover);--seg-thumb:var(--dshpc-surface-raised);
|
|
377
|
+
display:inline-flex;align-items:center;gap:2px;padding:2px;border-radius:var(--dshpc-radius-md);background:var(--seg-track);}
|
|
373
378
|
/* \u9009\u4E2D\u7247 = --dshpc-surface-raised\uFF08\u5144\u5F1F\u9879\u76EE dsh-task-dispatch-table \u7684\u53D6\u6CD5\uFF0C2026-10-19 \u7528\u6237\u70B9\u540D
|
|
374
379
|
\u300C\u628A\u5144\u5F1F\u7684\u6837\u5F0F\u6E05\u4E86\u5C31\u4E0D\u6B63\u5E38 \u21D2 \u6CA1\u642C\u5168\u300D\u540E\u6539\u56DE\uFF09\u300210-18 \u66FE\u6539\u6210 --dshpc-solid\uFF0C\u4F46\u5B83\u5728\u6697\u8272\u4E3B\u9898\u4E0B
|
|
375
380
|
\u662F\u8FD1\u9ED1\uFF08\u6BD4\u8F68\u9053\u8FD8\u6697\uFF09\u21D2 \u9009\u4E2D\u7247\u9677\u8FDB\u8F68\u9053\u91CC\uFF1Braised \u5728\u4E24\u4E2A\u4E3B\u9898\u4E0B\u90FD\u6BD4\u8F68\u9053\u4EAE\u4E00\u6863\uFF0C\u65B9\u5411\u6B63\u786E\u3002
|
|
@@ -389,7 +394,7 @@ var SEGMENTED_CSS = `
|
|
|
389
394
|
.dshpc-seg__item:hover:not([aria-pressed='true']):not(:disabled){color:var(--dshpc-fg);background:var(--dshpc-hover);}
|
|
390
395
|
.dshpc-seg--inset .dshpc-seg__item:hover:not([aria-pressed='true']):not(:disabled){background:var(--dshpc-active);}
|
|
391
396
|
/* \u9009\u4E2D\u7247\uFF1A\u4EAE\u7247 + \u63CF\u8FB9 + \u6D6E\u8D77\u9634\u5F71 \u21D2 \u5728\u5361\u7247\u5E95\uFF08\u4E0E\u4EAE\u7247\u540C\u8272\uFF09\u4E0A\u4E5F\u770B\u5F97\u51FA\u8FB9\u754C */
|
|
392
|
-
.dshpc-seg__item[aria-pressed='true']{background:var(--seg-thumb);border-color:var(--dshpc-border);
|
|
397
|
+
.dshpc-seg__item[aria-pressed='true']{background:var(--seg-thumb,var(--dshpc-surface-raised));border-color:var(--dshpc-border);
|
|
393
398
|
box-shadow:var(--dshpc-shadow-raised);color:var(--dshpc-fg);font-weight:600;}
|
|
394
399
|
.dshpc-seg__item:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:-2px;}
|
|
395
400
|
.dshpc-seg__item:disabled{cursor:default;opacity:.4;}
|
|
@@ -446,17 +451,22 @@ var BUTTON_CSS = `
|
|
|
446
451
|
|
|
447
452
|
\u26A0\uFE0F hover \u4E0D\u518D\u7528 opacity \u538B\u4E00\u5C42\uFF08\u7528\u6237 2026-10-19\uFF1A\u300C\u9ED1\u8272\u548C\u7EA2\u8272\u7684\u6309\u94AE\u79FB\u4E0A\u53BB\u53D8\u5316\u592A\u5C0F\uFF0C
|
|
448
453
|
\u5B8C\u5168\u611F\u89C9\u4E0D\u5230\u989C\u8272\u53D8\u4E86\u300D\uFF09\u21D2 \u8D70 --dshpc-*-hover / -active \u7684\u660E\u786E\u6DF7\u8272\uFF0C\u89C1 tokens-css.ts\u3002 */
|
|
449
|
-
.dshpc-btn{--btn-bg:transparent;--btn-fg:var(--dshpc-fg);--btn-border:transparent;
|
|
454
|
+
.dshpc-btn{--btn-bg:transparent;--btn-fg:var(--dshpc-fg);--btn-border:transparent;--btn-pad:12px;
|
|
450
455
|
--btn-bg-hover:var(--dshpc-hover);--btn-bg-active:var(--dshpc-active);--btn-fg-hover:var(--btn-fg);
|
|
451
456
|
appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;
|
|
452
457
|
box-sizing:border-box;border:1px solid var(--btn-border);border-radius:var(--dshpc-radius-md);
|
|
453
458
|
background-color:var(--btn-bg);color:var(--btn-fg);font-family:inherit;font-weight:500;white-space:nowrap;cursor:pointer;
|
|
454
459
|
transition:background-color var(--dshpc-dur-fast) var(--dshpc-ease),border-color var(--dshpc-dur-fast) var(--dshpc-ease),color var(--dshpc-dur-fast) var(--dshpc-ease),box-shadow var(--dshpc-dur-fast) var(--dshpc-ease),transform var(--dshpc-dur-fast) var(--dshpc-ease);}
|
|
455
|
-
.dshpc-btn--sm{height:var(--dshpc-control-h-sm);padding:0
|
|
456
|
-
.dshpc-btn--md{height:var(--dshpc-control-h-md);padding:0
|
|
457
|
-
.dshpc-btn--lg{height:var(--dshpc-control-h-lg);padding:0
|
|
460
|
+
.dshpc-btn--sm{--btn-pad:10px;height:var(--dshpc-control-h-sm);padding:0 var(--btn-pad);font-size:var(--dshpc-font-sm);line-height:var(--dshpc-line-sm);}
|
|
461
|
+
.dshpc-btn--md{--btn-pad:12px;height:var(--dshpc-control-h-md);padding:0 var(--btn-pad);font-size:var(--dshpc-font-md);line-height:var(--dshpc-line-md);}
|
|
462
|
+
.dshpc-btn--lg{--btn-pad:14px;height:var(--dshpc-control-h-lg);padding:0 var(--btn-pad);font-size:var(--dshpc-font-md);line-height:var(--dshpc-line-md);}
|
|
458
463
|
/* block\uFF1A\u6491\u6EE1\u7236\u5BBD\uFF08\u8868\u5355\u5E95\u680F / \u62BD\u5C49\u5E95\u90E8\u7684\u4E3B\u64CD\u4F5C\uFF09 */
|
|
459
464
|
.dshpc-btn--block{display:flex;width:100%;}
|
|
465
|
+
/* block + \u524D\u7F6E\u56FE\u6807 \u21D2 \u6587\u5B57\u89C6\u89C9\u5C45\u4E2D\uFF082026-10-19 \u7528\u6237\u70B9\u540D\uFF09\uFF1A
|
|
466
|
+
\u5185\u5BB9\u7EC4 [\u56FE\u6807 + \u95F4\u8DDD + \u6587\u5B57] \u6574\u4F53\u5728\u76D2\u5185\u5C45\u4E2D\u65F6\uFF0C**\u6587\u5B57**\u7684\u4E2D\u5FC3\u4F1A\u88AB\u56FE\u6807\u63A8\u53F3\u534A\u683C\u3002
|
|
467
|
+
\u628A\u53F3\u5185\u8FB9\u8DDD\u8865\u4E0A\u300C\u56FE\u6807\u5BBD + \u95F4\u8DDD\u300D\uFF0C\u53EF\u7528\u76D2\u968F\u4E4B\u5DE6\u79FB\u540C\u91CF \u21D2 \u6587\u5B57\u843D\u56DE\u89C6\u89C9\u4E2D\u5FC3\uFF0C\u56FE\u6807\u8D34\u5DE6\u4FA7\u3002
|
|
468
|
+
\u56FE\u6807\u5BBD\u6309 1.2em \u4F30\uFF08\u5B98\u65B9\u56FE\u6807 14/16px vs \u5B57\u53F7 12/13px\uFF09\uFF0Cem \u968F\u5B57\u53F7\u6863\u81EA\u52A8\u7F29\u653E\u3002 */
|
|
469
|
+
.dshpc-btn--block.dshpc-btn--icon-start{padding-right:calc(var(--btn-pad) + 1.2em + 6px);}
|
|
460
470
|
.dshpc-btn__icon,.dshpc-btn__icon-end{display:inline-flex;align-items:center;justify-content:center;flex:none;}
|
|
461
471
|
/* loading\uFF1A\u4E0D\u6362 DOM \u7ED3\u6784\uFF0C\u53EA\u5728\u6587\u6848\u524D\u63D2\u4E00\u4E2A\u540C\u8272\u5C0F\u5708\uFF08\u5C3A\u5BF8\u968F\u5B57\u53F7\uFF0C\u7F29\u653E\u4E0D\u4F9D\u8D56\u5E38\u91CF\uFF09 */
|
|
462
472
|
.dshpc-btn__spinner{display:inline-block;flex:none;width:1em;height:1em;box-sizing:border-box;
|
|
@@ -513,21 +523,6 @@ var BUTTON_CSS = `
|
|
|
513
523
|
.dshpc-iconbtn:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:2px;}
|
|
514
524
|
.dshpc-iconbtn:disabled{cursor:default;opacity:.4;}
|
|
515
525
|
|
|
516
|
-
.dshpc-iconbtn{appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
|
|
517
|
-
border:1px solid transparent;border-radius:var(--dshpc-radius-sm);background:transparent;color:var(--dshpc-fg-2);
|
|
518
|
-
font-family:inherit;cursor:pointer;flex:none;
|
|
519
|
-
transition:background-color var(--dshpc-dur-fast) var(--dshpc-ease),border-color var(--dshpc-dur-fast) var(--dshpc-ease),color var(--dshpc-dur-fast) var(--dshpc-ease),opacity var(--dshpc-dur-fast) var(--dshpc-ease);}
|
|
520
|
-
.dshpc-iconbtn--sm{width:var(--dshpc-control-h-sm);height:var(--dshpc-control-h-sm);font-size:var(--dshpc-font-sm);}
|
|
521
|
-
.dshpc-iconbtn--md{width:var(--dshpc-control-h-md);height:var(--dshpc-control-h-md);font-size:var(--dshpc-font-md);}
|
|
522
|
-
.dshpc-iconbtn--lg{width:var(--dshpc-control-h-lg);height:var(--dshpc-control-h-lg);font-size:var(--dshpc-font-md);}
|
|
523
|
-
.dshpc-iconbtn--plain{color:var(--dshpc-fg-2);}
|
|
524
|
-
.dshpc-iconbtn--outline{background:var(--dshpc-surface-1);border-color:var(--dshpc-border);color:var(--dshpc-fg-2);}
|
|
525
|
-
.dshpc-iconbtn--danger{color:var(--dshpc-danger);}
|
|
526
|
-
.dshpc-iconbtn:hover:not(:disabled){background:var(--dshpc-hover);color:var(--dshpc-fg);}
|
|
527
|
-
.dshpc-iconbtn--danger:hover:not(:disabled){background:var(--dshpc-hover);color:var(--dshpc-danger);}
|
|
528
|
-
.dshpc-iconbtn:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:2px;}
|
|
529
|
-
.dshpc-iconbtn:disabled{cursor:default;opacity:.4;}
|
|
530
|
-
|
|
531
526
|
/* \u2500\u2500 \u884C\u5F0F\u6587\u4EF6\u6309\u94AE\uFF08\u56FE\u6807 + \u6587\u4EF6\u540D\uFF09P2\uFF1A**\u5168\u7AD9\u552F\u4E00\u5B9E\u73B0**\uFF082026-10-04 \u6536\u7F16\uFF09\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
532
527
|
\u7528\u9014\uFF1A\u300C\u4EA7\u51FA\u7269 / \u9644\u4EF6\u300D\u90A3\u79CD**\u4E00\u884C\u4E00\u4E2A\u6587\u4EF6**\u7684\u6E05\u5355\u9879\uFF08\u57FA\u7840\u4FE1\u606F\u53F3\u680F\u4EA7\u51FA\u7269\u6E05\u5355\u3001\u9644\u4EF6\u533A\u3001
|
|
533
528
|
\u6267\u884C\u8BB0\u5F55\u9875\u7684\u5C55\u5F00\u533A\uFF09\u3002\u5E73\u65F6\u900F\u660E\u3001**\u9F20\u6807\u79FB\u4E0A\u53BB\u624D\u51FA\u6D45\u5E95**\uFF08\u6CBF\u7528\u7528\u6237 2026-10-03 \u5B9A\u7684\u89C2\u611F\uFF09\u3002
|
|
@@ -1525,8 +1520,8 @@ function colorVars(variant, color) {
|
|
|
1525
1520
|
"--btn-bg-active": `color-mix(in srgb, ${color} 18%, transparent)`
|
|
1526
1521
|
};
|
|
1527
1522
|
}
|
|
1528
|
-
function buttonClass(variant, size, block, extra) {
|
|
1529
|
-
return `dshpc-btn dshpc-btn--${variant} dshpc-btn--${size}${block ? " dshpc-btn--block" : ""}${extra !== void 0 && extra !== "" ? ` ${extra}` : ""}`;
|
|
1523
|
+
function buttonClass(variant, size, block, hasIcon, extra) {
|
|
1524
|
+
return `dshpc-btn dshpc-btn--${variant} dshpc-btn--${size}${block ? " dshpc-btn--block" : ""}${hasIcon ? " dshpc-btn--icon-start" : ""}${extra !== void 0 && extra !== "" ? ` ${extra}` : ""}`;
|
|
1530
1525
|
}
|
|
1531
1526
|
function Button(props) {
|
|
1532
1527
|
ensureControls();
|
|
@@ -1535,7 +1530,7 @@ function Button(props) {
|
|
|
1535
1530
|
...rest,
|
|
1536
1531
|
type: rest.type ?? "button",
|
|
1537
1532
|
disabled: rest.disabled === true || loading,
|
|
1538
|
-
className: buttonClass(variant, size, block, className),
|
|
1533
|
+
className: buttonClass(variant, size, block, icon !== void 0 && icon !== null && !loading, className),
|
|
1539
1534
|
style: { ...colorVars(variant, color), ...style }
|
|
1540
1535
|
};
|
|
1541
1536
|
return (0, import_react9.createElement)("button", attrs, loading ? (0, import_react9.createElement)("span", { className: "dshpc-btn__spinner", "aria-hidden": true }) : icon !== void 0 && icon !== null ? (0, import_react9.createElement)("span", { className: "dshpc-btn__icon" }, icon) : null, children, iconRight !== void 0 && iconRight !== null ? (0, import_react9.createElement)("span", { className: "dshpc-btn__icon-end" }, iconRight) : null);
|
|
@@ -2021,7 +2016,16 @@ var DICT2 = {
|
|
|
2021
2016
|
btnVariantTitle: "\u5916\u89C2\u6863\uFF0810 \u6863\uFF09",
|
|
2022
2017
|
btnVariantHint: "\u5B9E\u5FC3\uFF1Aprimary / secondary / danger / success / warning / info\uFF1B\u7EBF\u6846\uFF1Aoutline / danger-outline\uFF1B\u65E0\u5E95\uFF1Aghost / link",
|
|
2023
2018
|
btnSizeTitle: "\u5C3A\u5BF8 / \u56FE\u6807 / block",
|
|
2024
|
-
btnSizeHint: "sm 24 \xB7 md 28 \xB7 lg 32 \u540C\u9AD8\uFF1Bicon \
|
|
2019
|
+
btnSizeHint: "sm 24 \xB7 md 28 \xB7 lg 32 \u540C\u9AD8\uFF1Bicon \u6536\u7684\u662F ReactNode\u2014\u2014\u5B98\u65B9\u56FE\u6807\u7EC4\u4EF6\u3001\u81EA\u7ED8 SVG\u3001\u751A\u81F3\u4E00\u4E2A\u5B57\u7B26\u90FD\u884C\uFF0C\u4E0D\u662F\u540D\u5B57\u4E5F\u4E0D\u662F class\uFF08\u4E0B\u9762\u4E09\u9897\u5206\u522B\u662F\u8FD9\u4E09\u79CD\uFF09\uFF1BiconRight \u540E\u7F6E\u3001block \u6491\u6EE1\u7236\u5BBD",
|
|
2020
|
+
btnIconOnly: "icon only",
|
|
2021
|
+
tooltipTitle: "Tooltip\uFF08\u9F20\u6807\u60AC\u505C\u63D0\u793A\uFF09",
|
|
2022
|
+
tooltipHint: "\u5B98\u65B9 Tooltip\uFF1Aside \u4E0A / \u4E0B / \u53F3 \xD7 align \u5C45\u4E2D / \u8D34\u8FB9\uFF1B\u951A\u70B9\u53EF\u4EE5\u662F\u6309\u94AE\u3001\u4E5F\u53EF\u4EE5\u662F\u4E00\u6BB5\u6587\u5B57\uFF1B\u957F\u6587\u672C\u81EA\u52A8\u6362\u884C\uFF08maxWidth \u9650\u5BBD\uFF09",
|
|
2023
|
+
tooltipAnchorText: "\u6587\u5B57\u951A\u70B9",
|
|
2024
|
+
tooltipAnchorButton: "\u6309\u94AE\u951A\u70B9",
|
|
2025
|
+
tooltipLong: "\u957F\u6587\u672C\u6362\u884C",
|
|
2026
|
+
tooltipLongText: "\u8FD9\u662F\u4E00\u6BB5\u8DB3\u591F\u957F\u7684\u63D0\u793A\u6587\u5B57\uFF1A\u6C14\u6CE1\u9047\u5230 maxWidth \u4F1A\u81EA\u52A8\u6362\u884C\uFF0C\u800C\u4E0D\u4F1A\u4E00\u8DEF\u6491\u5230\u534A\u4E2A\u5C4F\u5E55\u5BBD\uFF0C anchored \u5143\u7D20\u5728\u8FB9\u7F18\u65F6\u5B98\u65B9\u8FD8\u4F1A\u81EA\u52A8\u628A\u6C14\u6CE1\u6536\u56DE\u89C6\u53E3\u5185\u3002",
|
|
2027
|
+
btnHintTitle: "\u95EE\u53F7\u63D0\u793A\uFF08FieldHint\uFF09",
|
|
2028
|
+
btnHintHint: "\u72EC\u7ACB\u7EC4\u4EF6\uFF0C\u653E\u54EA\u90FD\u884C\uFF1A\u6807\u9898\u540E / \u6309\u94AE\u540E / \u4E00\u6BB5\u6587\u5B57\u540E / \u8F93\u5165\u6846\u540E\uFF1B\u9F20\u6807\u60AC\u505C\u6216\u952E\u76D8\u805A\u7126\u6D6E\u51FA\u6C14\u6CE1",
|
|
2025
2029
|
btnStateTitle: "\u72B6\u6001",
|
|
2026
2030
|
btnStateHint: "disabled \u534A\u900F\u660E\u4E0D\u53EF\u70B9\uFF1Bloading \u524D\u7F6E\u540C\u8272\u5C0F\u5708\u5E76\u81EA\u52A8\u7981\u7528",
|
|
2027
2031
|
btnColorTitle: "\u81EA\u5B9A\u4E49\u989C\u8272",
|
|
@@ -2031,7 +2035,24 @@ var DICT2 = {
|
|
|
2031
2035
|
btnLabelDelete: "\u5220\u9664",
|
|
2032
2036
|
btnLabelMixed: "\u4FDD\u5B58 Save",
|
|
2033
2037
|
inputHint: "Input / PrefixedInput / NumberInput / Textarea\uFF0C\u90FD\u652F\u6301 error \u63CF\u7EA2\uFF1B\u884C\u5C3E\u53EF\u6302 FieldHint \u95EE\u53F7\u63D0\u793A",
|
|
2034
|
-
checkboxHint: "\u5916\u89C2\u5BF9\u9F50\u771F\u5B9E\u63D2\u4EF6\uFF1A\u7070\u5E95 inset\uFF08\u65E0\u5916\u63CF\u8FB9\uFF09\uFF1B\u5E26\u63CF\u8FB9\u7684 default \u4EC5\u4F9B\u7279\u6B8A\u573A\u5408\uFF0C\
|
|
2038
|
+
checkboxHint: "\u5916\u89C2\u5BF9\u9F50\u771F\u5B9E\u63D2\u4EF6\uFF1A\u7070\u5E95 inset\uFF08\u65E0\u5916\u63CF\u8FB9\uFF09\uFF1B\u5E26\u63CF\u8FB9\u7684 default \u4EC5\u4F9B\u7279\u6B8A\u573A\u5408\uFF08\u6700\u53F3\uFF0C\u53EF\u70B9\u7740\u73A9\uFF09\uFF1B\u661F\u671F\u65B9\u5757\u662F\u591A\u9009\u3002\u6587\u6848\u968F\u8BED\u8A00\u5207\u6362",
|
|
2039
|
+
segDay: "\u65E5",
|
|
2040
|
+
segWeek: "\u5468",
|
|
2041
|
+
segMonth: "\u6708",
|
|
2042
|
+
segAll: "\u5168\u90E8",
|
|
2043
|
+
segDoing: "\u8FDB\u884C\u4E2D",
|
|
2044
|
+
segClaimed: "\u5F85\u8BA4\u9886",
|
|
2045
|
+
segBlocked: "\u963B\u585E",
|
|
2046
|
+
segStalled: "\u505C\u6EDE",
|
|
2047
|
+
segPreview: "\u9884\u89C8",
|
|
2048
|
+
segSource: "\u6E90\u7801",
|
|
2049
|
+
weekday1: "\u4E00",
|
|
2050
|
+
weekday2: "\u4E8C",
|
|
2051
|
+
weekday3: "\u4E09",
|
|
2052
|
+
weekday4: "\u56DB",
|
|
2053
|
+
weekday5: "\u4E94",
|
|
2054
|
+
weekday6: "\u516D",
|
|
2055
|
+
weekday7: "\u65E5",
|
|
2035
2056
|
designTokenHint: "\u989C\u8272\u5168\u90E8\u6765\u81EA design \u7684 token\uFF1B\u5207\u6362\u53F3\u4E0A\u89D2\u660E\u6697\uFF0C\u4E0B\u9762\u4F1A\u8DDF\u7740\u53D8",
|
|
2036
2057
|
designInjectHint: "\u63A7\u4EF6\u6E32\u67D3\u524D\u8C03\u4E00\u6B21 setStyleKit + ensureControls\uFF0Ctoken \u4E0E\u63A7\u4EF6 CSS \u7531 kit \u6CE8\u5165 <head>",
|
|
2037
2058
|
fieldHintDate: "\u4EFB\u52A1\u81EA\u8BE5\u65E5\u8D77\u5F00\u59CB\u6267\u884C\u3002\u53EF\u63D0\u524D\u521B\u5EFA\u4EFB\u52A1\uFF0C\u81F3\u8BE5\u65E5\u81EA\u52A8\u5F00\u8DD1\uFF1B\u300C\u6BCF N \u5468\u300D\u4EA6\u81EA\u8BE5\u65E5\u8D77\u7B97\u9996\u5468\u3002",
|
|
@@ -2073,7 +2094,16 @@ var DICT2 = {
|
|
|
2073
2094
|
btnVariantTitle: "Variants (10)",
|
|
2074
2095
|
btnVariantHint: "Solid: primary / secondary / danger / success / warning / info; outlined: outline / danger-outline; flat: ghost / link",
|
|
2075
2096
|
btnSizeTitle: "Sizes / icons / block",
|
|
2076
|
-
btnSizeHint: "sm 24 \xB7 md 28 \xB7 lg 32, same height; icon
|
|
2097
|
+
btnSizeHint: "sm 24 \xB7 md 28 \xB7 lg 32, same height; icon takes any ReactNode \u2014 an official icon component, your own SVG, even a single character (not a name, not a class); iconRight trails, block fills the parent",
|
|
2098
|
+
btnIconOnly: "icon only",
|
|
2099
|
+
tooltipTitle: "Tooltip (hover hint)",
|
|
2100
|
+
tooltipHint: "Official Tooltip: side top / bottom / right x align center / end; anchor can be a button or a span of text; long labels wrap (maxWidth)",
|
|
2101
|
+
tooltipAnchorText: "Text anchor",
|
|
2102
|
+
tooltipAnchorButton: "Button anchor",
|
|
2103
|
+
tooltipLong: "Long label",
|
|
2104
|
+
tooltipLongText: "A deliberately long hint: the bubble wraps at maxWidth instead of stretching to half the viewport, and the official layer pulls it back inside the viewport near the edges.",
|
|
2105
|
+
btnHintTitle: "Question-mark hint (FieldHint)",
|
|
2106
|
+
btnHintHint: "Standalone component, drop it anywhere: after a title, a button, a sentence, or an input; hover or keyboard-focus to reveal",
|
|
2077
2107
|
btnStateTitle: "States",
|
|
2078
2108
|
btnStateHint: "disabled is dimmed and unclickable; loading shows a same-color spinner and disables itself",
|
|
2079
2109
|
btnColorTitle: "Custom colors",
|
|
@@ -2083,7 +2113,24 @@ var DICT2 = {
|
|
|
2083
2113
|
btnLabelDelete: "Delete",
|
|
2084
2114
|
btnLabelMixed: "Save \u4FDD\u5B58",
|
|
2085
2115
|
inputHint: "Input / PrefixedInput / NumberInput / Textarea, all support error highlighting; a FieldHint question-mark tip can hang at the row end",
|
|
2086
|
-
checkboxHint: "Looks match the real plugin: grey inset background (no outer border); the bordered default is for special cases
|
|
2116
|
+
checkboxHint: "Looks match the real plugin: grey inset background (no outer border); the bordered default (rightmost, clickable) is for special cases; the weekday squares are multi-select. Labels follow the locale",
|
|
2117
|
+
segDay: "Day",
|
|
2118
|
+
segWeek: "Week",
|
|
2119
|
+
segMonth: "Month",
|
|
2120
|
+
segAll: "All",
|
|
2121
|
+
segDoing: "Doing",
|
|
2122
|
+
segClaimed: "Open",
|
|
2123
|
+
segBlocked: "Blocked",
|
|
2124
|
+
segStalled: "Stalled",
|
|
2125
|
+
segPreview: "Render",
|
|
2126
|
+
segSource: "Source",
|
|
2127
|
+
weekday1: "Mo",
|
|
2128
|
+
weekday2: "Tu",
|
|
2129
|
+
weekday3: "We",
|
|
2130
|
+
weekday4: "Th",
|
|
2131
|
+
weekday5: "Fr",
|
|
2132
|
+
weekday6: "Sa",
|
|
2133
|
+
weekday7: "Su",
|
|
2087
2134
|
designTokenHint: "All colors come from design tokens; switch light/dark at top-right and these update with it",
|
|
2088
2135
|
designInjectHint: "Call setStyleKit + ensureControls once before controls render; the kit injects tokens and control CSS into <head>",
|
|
2089
2136
|
fieldHintDate: 'The task runs starting from this date. You can create it ahead of time and it auto-starts on that day; "every N weeks" also counts its first week from this date.',
|
|
@@ -2205,6 +2252,18 @@ function iconOf(name, size = 14) {
|
|
|
2205
2252
|
const found = BUTTON_ICONS.find((item) => item.name === name);
|
|
2206
2253
|
return found === void 0 ? null : (0, import_react20.createElement)(found.Icon, { size });
|
|
2207
2254
|
}
|
|
2255
|
+
function StarSvg() {
|
|
2256
|
+
return (0, import_react20.createElement)(
|
|
2257
|
+
"svg",
|
|
2258
|
+
{ width: 14, height: 14, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true },
|
|
2259
|
+
(0, import_react20.createElement)("path", {
|
|
2260
|
+
d: "M8 1.6l1.9 4 4.4.6-3.2 3 .8 4.3L8 11.4l-3.9 2.1.8-4.3-3.2-3 4.4-.6z",
|
|
2261
|
+
stroke: "currentColor",
|
|
2262
|
+
strokeWidth: 1.2,
|
|
2263
|
+
strokeLinejoin: "round"
|
|
2264
|
+
})
|
|
2265
|
+
);
|
|
2266
|
+
}
|
|
2208
2267
|
var ICON_SIZE = { sm: 12, md: 14, lg: 16 };
|
|
2209
2268
|
var VARIANTS = [
|
|
2210
2269
|
{ value: "primary", icon: "check" },
|
|
@@ -2219,6 +2278,22 @@ var VARIANTS = [
|
|
|
2219
2278
|
{ value: "link", icon: "search" }
|
|
2220
2279
|
];
|
|
2221
2280
|
var CUSTOM_COLORS = ["#7c3aed", "#0ea5e9", "#f97316", "#16a34a"];
|
|
2281
|
+
function tipAnchor(text, side, align) {
|
|
2282
|
+
const props = { label: text, side };
|
|
2283
|
+
if (align !== void 0) props.align = align;
|
|
2284
|
+
return (0, import_react20.createElement)(import_dsh_client_ui_primitives.Tooltip, props, (0, import_react20.createElement)("button", {
|
|
2285
|
+
type: "button",
|
|
2286
|
+
style: {
|
|
2287
|
+
padding: "4px 10px",
|
|
2288
|
+
border: "1px solid var(--dshpc-border)",
|
|
2289
|
+
borderRadius: "6px",
|
|
2290
|
+
background: "var(--dshpc-surface-1)",
|
|
2291
|
+
color: "var(--dshpc-fg)",
|
|
2292
|
+
fontSize: "12px",
|
|
2293
|
+
cursor: "help"
|
|
2294
|
+
}
|
|
2295
|
+
}, text));
|
|
2296
|
+
}
|
|
2222
2297
|
function Row(props) {
|
|
2223
2298
|
return (0, import_react20.createElement)("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", alignItems: "center" } }, props.children);
|
|
2224
2299
|
}
|
|
@@ -2237,6 +2312,7 @@ function ButtonsSection() {
|
|
|
2237
2312
|
const [seg, setSeg] = (0, import_react20.useState)("week");
|
|
2238
2313
|
const [filter, setFilter] = (0, import_react20.useState)("all");
|
|
2239
2314
|
const [multi, setMulti] = (0, import_react20.useState)(["1"]);
|
|
2315
|
+
const [view, setView] = (0, import_react20.useState)("render");
|
|
2240
2316
|
return (0, import_react20.createElement)(
|
|
2241
2317
|
"div",
|
|
2242
2318
|
null,
|
|
@@ -2300,12 +2376,13 @@ function ButtonsSection() {
|
|
|
2300
2376
|
{ label: "size" },
|
|
2301
2377
|
["sm", "md", "lg"].map((size) => (0, import_react20.createElement)(Button, { key: size, size, variant: "outline", icon: iconOf("plus", ICON_SIZE[size]) }, size))
|
|
2302
2378
|
),
|
|
2379
|
+
// icon 收的是 ReactNode:官方图标组件 / 自绘 SVG / 一个字符,三种来源各一颗
|
|
2303
2380
|
(0, import_react20.createElement)(
|
|
2304
2381
|
Labeled,
|
|
2305
2382
|
{ label: "icon" },
|
|
2306
|
-
(0, import_react20.createElement)(Button, { variant: "primary", icon: iconOf("send", ICON_SIZE.lg) }, "\
|
|
2307
|
-
(0, import_react20.createElement)(Button, { variant: "outline", icon:
|
|
2308
|
-
(0, import_react20.createElement)(Button, { variant: "ghost", icon:
|
|
2383
|
+
(0, import_react20.createElement)(Button, { variant: "primary", icon: iconOf("send", ICON_SIZE.lg) }, "\u5B98\u65B9\u56FE\u6807"),
|
|
2384
|
+
(0, import_react20.createElement)(Button, { variant: "outline", icon: (0, import_react20.createElement)(StarSvg, null) }, "\u81EA\u7ED8 SVG"),
|
|
2385
|
+
(0, import_react20.createElement)(Button, { variant: "ghost", icon: "+" }, "\u4E00\u4E2A\u5B57\u7B26")
|
|
2309
2386
|
),
|
|
2310
2387
|
(0, import_react20.createElement)(
|
|
2311
2388
|
Labeled,
|
|
@@ -2313,22 +2390,88 @@ function ButtonsSection() {
|
|
|
2313
2390
|
(0, import_react20.createElement)(Button, { variant: "outline", iconRight: iconOf("chevron", ICON_SIZE.lg) }, "\u66F4\u591A"),
|
|
2314
2391
|
(0, import_react20.createElement)(Button, { variant: "primary" }, "\u4E0B\u4E00\u6B65")
|
|
2315
2392
|
),
|
|
2393
|
+
// block + 前置图标:文字要在视觉中心,不能整组内容居中(那样文字会被图标推右)
|
|
2316
2394
|
(0, import_react20.createElement)(
|
|
2317
2395
|
Labeled,
|
|
2318
2396
|
{ label: "block" },
|
|
2319
2397
|
(0, import_react20.createElement)(
|
|
2320
2398
|
"div",
|
|
2321
|
-
{ style: { width: "
|
|
2322
|
-
(0, import_react20.createElement)(Button, { variant: "primary", block: true, icon: iconOf("check", ICON_SIZE.lg) }, "\u6491\u6EE1\u7236\u5BBD")
|
|
2399
|
+
{ style: { width: "260px" } },
|
|
2400
|
+
(0, import_react20.createElement)(Button, { variant: "primary", block: true, icon: iconOf("check", ICON_SIZE.lg) }, "\u6491\u6EE1\u7236\u5BBD"),
|
|
2401
|
+
(0, import_react20.createElement)("div", { style: { height: "8px" } }),
|
|
2402
|
+
(0, import_react20.createElement)(Button, { variant: "outline", block: true }, "\u65E0\u56FE\u6807\u5BF9\u7167")
|
|
2323
2403
|
)
|
|
2324
2404
|
),
|
|
2325
2405
|
(0, import_react20.createElement)(
|
|
2326
2406
|
Labeled,
|
|
2327
|
-
{ label: "
|
|
2407
|
+
{ label: t2("btnIconOnly") },
|
|
2328
2408
|
BUTTON_ICONS.slice(0, 6).map((item) => (0, import_react20.createElement)(IconButton, { key: item.name, icon: (0, import_react20.createElement)(item.Icon, { size: 16 }), label: item.name }))
|
|
2329
2409
|
)
|
|
2330
2410
|
)
|
|
2331
2411
|
),
|
|
2412
|
+
// ── Tooltip:官方悬停提示,side × align 全组合 + 双锚点类型 + 长文本换行 ──
|
|
2413
|
+
(0, import_react20.createElement)(
|
|
2414
|
+
Demo,
|
|
2415
|
+
{ title: t2("tooltipTitle"), hint: t2("tooltipHint") },
|
|
2416
|
+
(0, import_react20.createElement)(
|
|
2417
|
+
"div",
|
|
2418
|
+
{ style: { display: "flex", flexDirection: "column", gap: "12px" } },
|
|
2419
|
+
(0, import_react20.createElement)(
|
|
2420
|
+
Labeled,
|
|
2421
|
+
{ label: t2("tooltipAnchorButton") },
|
|
2422
|
+
tipAnchor("top \xB7 center", "top", "center"),
|
|
2423
|
+
tipAnchor("top \xB7 end", "top", "end"),
|
|
2424
|
+
tipAnchor("bottom \xB7 center", "bottom", "center"),
|
|
2425
|
+
tipAnchor("bottom \xB7 end", "bottom", "end"),
|
|
2426
|
+
tipAnchor("right", "right")
|
|
2427
|
+
),
|
|
2428
|
+
(0, import_react20.createElement)(
|
|
2429
|
+
Labeled,
|
|
2430
|
+
{ label: t2("tooltipAnchorText") },
|
|
2431
|
+
(0, import_react20.createElement)(
|
|
2432
|
+
import_dsh_client_ui_primitives.Tooltip,
|
|
2433
|
+
{ label: t2("tooltipHint"), side: "top" },
|
|
2434
|
+
(0, import_react20.createElement)("span", {
|
|
2435
|
+
style: { borderBottom: "1px dashed var(--dshpc-border-strong)", cursor: "help", fontSize: "13px" }
|
|
2436
|
+
}, t2("tooltipAnchorText"))
|
|
2437
|
+
),
|
|
2438
|
+
(0, import_react20.createElement)(
|
|
2439
|
+
import_dsh_client_ui_primitives.Tooltip,
|
|
2440
|
+
{ label: t2("tooltipLongText"), side: "bottom", maxWidth: 240 },
|
|
2441
|
+
(0, import_react20.createElement)("span", {
|
|
2442
|
+
style: { borderBottom: "1px dashed var(--dshpc-border-strong)", cursor: "help", fontSize: "13px" }
|
|
2443
|
+
}, t2("tooltipLong"))
|
|
2444
|
+
)
|
|
2445
|
+
)
|
|
2446
|
+
)
|
|
2447
|
+
),
|
|
2448
|
+
// ── 问号提示:证明它不属于 Input 家族,随处可挂 ──────────────────────
|
|
2449
|
+
(0, import_react20.createElement)(
|
|
2450
|
+
Demo,
|
|
2451
|
+
{ title: t2("btnHintTitle"), hint: t2("btnHintHint") },
|
|
2452
|
+
(0, import_react20.createElement)(
|
|
2453
|
+
"div",
|
|
2454
|
+
{ style: { display: "flex", flexDirection: "column", gap: "10px" } },
|
|
2455
|
+
(0, import_react20.createElement)(
|
|
2456
|
+
Row,
|
|
2457
|
+
null,
|
|
2458
|
+
(0, import_react20.createElement)("b", { style: { fontSize: "13px" } }, "\u4E00\u4E2A\u6807\u9898"),
|
|
2459
|
+
(0, import_react20.createElement)(FieldHint, { text: "\u6302\u5728\u6807\u9898\u540E\u9762\uFF1A\u8BF4\u660E\u8FD9\u4E00\u5757\u662F\u5E72\u4EC0\u4E48\u7684\u3002" })
|
|
2460
|
+
),
|
|
2461
|
+
(0, import_react20.createElement)(
|
|
2462
|
+
Row,
|
|
2463
|
+
null,
|
|
2464
|
+
(0, import_react20.createElement)(Button, { variant: "outline" }, "\u4E00\u4E2A\u6309\u94AE"),
|
|
2465
|
+
(0, import_react20.createElement)(FieldHint, { text: "\u6302\u5728\u6309\u94AE\u540E\u9762\uFF1A\u89E3\u91CA\u8FD9\u4E2A\u64CD\u4F5C\u4F1A\u53D1\u751F\u4EC0\u4E48\u3002" })
|
|
2466
|
+
),
|
|
2467
|
+
(0, import_react20.createElement)(
|
|
2468
|
+
Row,
|
|
2469
|
+
null,
|
|
2470
|
+
(0, import_react20.createElement)("span", { style: { fontSize: "13px" } }, "\u4E00\u6BB5\u666E\u901A\u6587\u5B57"),
|
|
2471
|
+
(0, import_react20.createElement)(FieldHint, { text: "\u6302\u5728\u4EFB\u4F55\u6587\u5B57\u540E\u9762\u90FD\u884C\uFF0C\u5B83\u53EA\u662F\u4E00\u4E2A 14px \u7684\u5185\u8054\u5143\u7D20\u3002" })
|
|
2472
|
+
)
|
|
2473
|
+
)
|
|
2474
|
+
),
|
|
2332
2475
|
// ── 状态 ───────────────────────────────────────────────────────────
|
|
2333
2476
|
(0, import_react20.createElement)(
|
|
2334
2477
|
Demo,
|
|
@@ -2411,11 +2554,11 @@ function ButtonsSection() {
|
|
|
2411
2554
|
(0, import_react20.createElement)(Segmented, {
|
|
2412
2555
|
variant: "inset",
|
|
2413
2556
|
items: [
|
|
2414
|
-
{ value: "all", label: "
|
|
2415
|
-
{ value: "doing", label: "
|
|
2416
|
-
{ value: "claimed", label: "
|
|
2417
|
-
{ value: "blocked", label: "
|
|
2418
|
-
{ value: "stalled", label: "
|
|
2557
|
+
{ value: "all", label: t2("segAll"), count: 11 },
|
|
2558
|
+
{ value: "doing", label: t2("segDoing"), count: 5 },
|
|
2559
|
+
{ value: "claimed", label: t2("segClaimed"), count: 11 },
|
|
2560
|
+
{ value: "blocked", label: t2("segBlocked") },
|
|
2561
|
+
{ value: "stalled", label: t2("segStalled") }
|
|
2419
2562
|
],
|
|
2420
2563
|
value: filter,
|
|
2421
2564
|
onChange: setFilter
|
|
@@ -2425,15 +2568,10 @@ function ButtonsSection() {
|
|
|
2425
2568
|
multiple: true,
|
|
2426
2569
|
className: "dshpc-seg--weekday",
|
|
2427
2570
|
label: "\u661F\u671F",
|
|
2428
|
-
items: [
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
{ value: "4", label: "\u56DB" },
|
|
2433
|
-
{ value: "5", label: "\u4E94" },
|
|
2434
|
-
{ value: "6", label: "\u516D" },
|
|
2435
|
-
{ value: "7", label: "\u65E5" }
|
|
2436
|
-
],
|
|
2571
|
+
items: [1, 2, 3, 4, 5, 6, 7].map((n) => ({
|
|
2572
|
+
value: String(n),
|
|
2573
|
+
label: t2(`weekday${n}`)
|
|
2574
|
+
})),
|
|
2437
2575
|
value: multi,
|
|
2438
2576
|
onChange: setMulti
|
|
2439
2577
|
}),
|
|
@@ -2443,12 +2581,11 @@ function ButtonsSection() {
|
|
|
2443
2581
|
variant: "default",
|
|
2444
2582
|
label: "default \u5916\u89C2\u793A\u4F8B",
|
|
2445
2583
|
items: [
|
|
2446
|
-
{ value: "render", label: "
|
|
2447
|
-
{ value: "source", label: "
|
|
2584
|
+
{ value: "render", label: t2("segPreview") },
|
|
2585
|
+
{ value: "source", label: t2("segSource") }
|
|
2448
2586
|
],
|
|
2449
|
-
value:
|
|
2450
|
-
onChange:
|
|
2451
|
-
}
|
|
2587
|
+
value: view,
|
|
2588
|
+
onChange: setView
|
|
2452
2589
|
})
|
|
2453
2590
|
)
|
|
2454
2591
|
)
|
|
@@ -3311,13 +3448,15 @@ function DemoPage() {
|
|
|
3311
3448
|
const [active, setActive] = (0, import_react31.useState)(ALL_SECTIONS[0].id);
|
|
3312
3449
|
return (0, import_react31.createElement)(
|
|
3313
3450
|
"div",
|
|
3314
|
-
{ style: { display: "flex", alignItems: "
|
|
3451
|
+
{ style: { display: "flex", alignItems: "stretch", height: "100%", minHeight: 0, overflow: "hidden" } },
|
|
3315
3452
|
(0, import_react31.createElement)(
|
|
3316
3453
|
"aside",
|
|
3317
3454
|
{
|
|
3318
3455
|
style: {
|
|
3319
3456
|
width: "180px",
|
|
3320
3457
|
flex: "none",
|
|
3458
|
+
height: "100%",
|
|
3459
|
+
boxSizing: "border-box",
|
|
3321
3460
|
padding: "14px 10px",
|
|
3322
3461
|
overflowY: "auto",
|
|
3323
3462
|
borderRight: "1px solid var(--dshpc-border-faint)",
|
|
@@ -3353,7 +3492,7 @@ function DemoPage() {
|
|
|
3353
3492
|
),
|
|
3354
3493
|
(0, import_react31.createElement)(
|
|
3355
3494
|
"main",
|
|
3356
|
-
{ style: { flex: 1, minWidth: 0, overflowY: "auto", padding: "12px 22px 60px" } },
|
|
3495
|
+
{ style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%", boxSizing: "border-box", overflowY: "auto", padding: "12px 22px 60px" } },
|
|
3357
3496
|
(0, import_react31.createElement)(Sections, { active, onNavigate: setActive })
|
|
3358
3497
|
)
|
|
3359
3498
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-core-demo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "dsh-plugin-core 的组件预览插件:装进 DSH 宿主后,在真实宿主环境里预览控件与业务组件",
|
|
5
5
|
"keywords": ["deepseek", "harness", "dsh", "dsh-plugin", "dsh-plugin-core"],
|
|
6
6
|
"homepage": "https://github.com/cq-guojia/dsh-plugin-core/tree/main/packages/demo",
|