dsh-plugin-core-demo 0.2.2 → 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.
Files changed (2) hide show
  1. package/dist/client.js +123 -40
  2. 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
- .dshpc-seg{display:inline-flex;align-items:center;gap:2px;padding:2px;border-radius:var(--dshpc-radius-md);background:var(--seg-track);}
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;}
@@ -518,21 +523,6 @@ var BUTTON_CSS = `
518
523
  .dshpc-iconbtn:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:2px;}
519
524
  .dshpc-iconbtn:disabled{cursor:default;opacity:.4;}
520
525
 
521
- .dshpc-iconbtn{appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
522
- border:1px solid transparent;border-radius:var(--dshpc-radius-sm);background:transparent;color:var(--dshpc-fg-2);
523
- font-family:inherit;cursor:pointer;flex:none;
524
- 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);}
525
- .dshpc-iconbtn--sm{width:var(--dshpc-control-h-sm);height:var(--dshpc-control-h-sm);font-size:var(--dshpc-font-sm);}
526
- .dshpc-iconbtn--md{width:var(--dshpc-control-h-md);height:var(--dshpc-control-h-md);font-size:var(--dshpc-font-md);}
527
- .dshpc-iconbtn--lg{width:var(--dshpc-control-h-lg);height:var(--dshpc-control-h-lg);font-size:var(--dshpc-font-md);}
528
- .dshpc-iconbtn--plain{color:var(--dshpc-fg-2);}
529
- .dshpc-iconbtn--outline{background:var(--dshpc-surface-1);border-color:var(--dshpc-border);color:var(--dshpc-fg-2);}
530
- .dshpc-iconbtn--danger{color:var(--dshpc-danger);}
531
- .dshpc-iconbtn:hover:not(:disabled){background:var(--dshpc-hover);color:var(--dshpc-fg);}
532
- .dshpc-iconbtn--danger:hover:not(:disabled){background:var(--dshpc-hover);color:var(--dshpc-danger);}
533
- .dshpc-iconbtn:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:2px;}
534
- .dshpc-iconbtn:disabled{cursor:default;opacity:.4;}
535
-
536
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
537
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
538
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
@@ -2027,7 +2017,13 @@ var DICT2 = {
2027
2017
  btnVariantHint: "\u5B9E\u5FC3\uFF1Aprimary / secondary / danger / success / warning / info\uFF1B\u7EBF\u6846\uFF1Aoutline / danger-outline\uFF1B\u65E0\u5E95\uFF1Aghost / link",
2028
2018
  btnSizeTitle: "\u5C3A\u5BF8 / \u56FE\u6807 / block",
2029
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",
2030
- btnIconOnly: "\u7EAF\u56FE\u6807\u94AE",
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",
2031
2027
  btnHintTitle: "\u95EE\u53F7\u63D0\u793A\uFF08FieldHint\uFF09",
2032
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",
2033
2029
  btnStateTitle: "\u72B6\u6001",
@@ -2039,7 +2035,24 @@ var DICT2 = {
2039
2035
  btnLabelDelete: "\u5220\u9664",
2040
2036
  btnLabelMixed: "\u4FDD\u5B58 Save",
2041
2037
  inputHint: "Input / PrefixedInput / NumberInput / Textarea\uFF0C\u90FD\u652F\u6301 error \u63CF\u7EA2\uFF1B\u884C\u5C3E\u53EF\u6302 FieldHint \u95EE\u53F7\u63D0\u793A",
2042
- 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\u89C1\u4E0B",
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",
2043
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",
2044
2057
  designInjectHint: "\u63A7\u4EF6\u6E32\u67D3\u524D\u8C03\u4E00\u6B21 setStyleKit + ensureControls\uFF0Ctoken \u4E0E\u63A7\u4EF6 CSS \u7531 kit \u6CE8\u5165 <head>",
2045
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",
@@ -2082,7 +2095,13 @@ var DICT2 = {
2082
2095
  btnVariantHint: "Solid: primary / secondary / danger / success / warning / info; outlined: outline / danger-outline; flat: ghost / link",
2083
2096
  btnSizeTitle: "Sizes / icons / block",
2084
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",
2085
- btnIconOnly: "Icon-only",
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.",
2086
2105
  btnHintTitle: "Question-mark hint (FieldHint)",
2087
2106
  btnHintHint: "Standalone component, drop it anywhere: after a title, a button, a sentence, or an input; hover or keyboard-focus to reveal",
2088
2107
  btnStateTitle: "States",
@@ -2094,7 +2113,24 @@ var DICT2 = {
2094
2113
  btnLabelDelete: "Delete",
2095
2114
  btnLabelMixed: "Save \u4FDD\u5B58",
2096
2115
  inputHint: "Input / PrefixedInput / NumberInput / Textarea, all support error highlighting; a FieldHint question-mark tip can hang at the row end",
2097
- checkboxHint: "Looks match the real plugin: grey inset background (no outer border); the bordered default is for special cases only, see below",
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",
2098
2134
  designTokenHint: "All colors come from design tokens; switch light/dark at top-right and these update with it",
2099
2135
  designInjectHint: "Call setStyleKit + ensureControls once before controls render; the kit injects tokens and control CSS into <head>",
2100
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.',
@@ -2242,6 +2278,22 @@ var VARIANTS = [
2242
2278
  { value: "link", icon: "search" }
2243
2279
  ];
2244
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
+ }
2245
2297
  function Row(props) {
2246
2298
  return (0, import_react20.createElement)("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", alignItems: "center" } }, props.children);
2247
2299
  }
@@ -2260,6 +2312,7 @@ function ButtonsSection() {
2260
2312
  const [seg, setSeg] = (0, import_react20.useState)("week");
2261
2313
  const [filter, setFilter] = (0, import_react20.useState)("all");
2262
2314
  const [multi, setMulti] = (0, import_react20.useState)(["1"]);
2315
+ const [view, setView] = (0, import_react20.useState)("render");
2263
2316
  return (0, import_react20.createElement)(
2264
2317
  "div",
2265
2318
  null,
@@ -2356,6 +2409,42 @@ function ButtonsSection() {
2356
2409
  )
2357
2410
  )
2358
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
+ ),
2359
2448
  // ── 问号提示:证明它不属于 Input 家族,随处可挂 ──────────────────────
2360
2449
  (0, import_react20.createElement)(
2361
2450
  Demo,
@@ -2465,11 +2554,11 @@ function ButtonsSection() {
2465
2554
  (0, import_react20.createElement)(Segmented, {
2466
2555
  variant: "inset",
2467
2556
  items: [
2468
- { value: "all", label: "\u5168\u90E8", count: 11 },
2469
- { value: "doing", label: "\u8FDB\u884C\u4E2D", count: 5 },
2470
- { value: "claimed", label: "\u5F85\u8BA4\u9886", count: 11 },
2471
- { value: "blocked", label: "\u963B\u585E" },
2472
- { value: "stalled", label: "\u505C\u6EDE" }
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") }
2473
2562
  ],
2474
2563
  value: filter,
2475
2564
  onChange: setFilter
@@ -2479,15 +2568,10 @@ function ButtonsSection() {
2479
2568
  multiple: true,
2480
2569
  className: "dshpc-seg--weekday",
2481
2570
  label: "\u661F\u671F",
2482
- items: [
2483
- { value: "1", label: "\u4E00" },
2484
- { value: "2", label: "\u4E8C" },
2485
- { value: "3", label: "\u4E09" },
2486
- { value: "4", label: "\u56DB" },
2487
- { value: "5", label: "\u4E94" },
2488
- { value: "6", label: "\u516D" },
2489
- { value: "7", label: "\u65E5" }
2490
- ],
2571
+ items: [1, 2, 3, 4, 5, 6, 7].map((n) => ({
2572
+ value: String(n),
2573
+ label: t2(`weekday${n}`)
2574
+ })),
2491
2575
  value: multi,
2492
2576
  onChange: setMulti
2493
2577
  }),
@@ -2497,12 +2581,11 @@ function ButtonsSection() {
2497
2581
  variant: "default",
2498
2582
  label: "default \u5916\u89C2\u793A\u4F8B",
2499
2583
  items: [
2500
- { value: "render", label: "\u9884\u89C8" },
2501
- { value: "source", label: "\u6E90\u7801" }
2584
+ { value: "render", label: t2("segPreview") },
2585
+ { value: "source", label: t2("segSource") }
2502
2586
  ],
2503
- value: seg === "week" ? "render" : "source",
2504
- onChange: () => {
2505
- }
2587
+ value: view,
2588
+ onChange: setView
2506
2589
  })
2507
2590
  )
2508
2591
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.2.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",