dsh-plugin-core-demo 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -38,6 +38,6 @@ dsh plugin --profile web add dsh-plugin-core-demo
38
38
  - client 侧只导出 `apply`;依赖一律 `ctx.inject([...], cb)` 内等待(顶层导出 `inject` 会卡死宿主启动)。
39
39
  - 三块注册(`sidebar.panellist` / `main` / `settings.plugin.item`)各自 `ctx.inject`、自成一块;
40
40
  `settings.plugin.item` 与 `main` 的 key 必须 = 包名(宿主机制)。
41
- - 变量前缀用本插件独有的 `dshpc`,**不占用 `--tdt-*`**(宿主里别的插件在用);
42
- 展示代码里的 `--tdt-*` 由 `src/client/token-alias.ts` 那层别名接过去。
41
+ - 变量前缀统一用 `dshpc`,**完全不碰 `--tdt-*` / `--dsw-*` / `--dsh-*`**(兄弟插件与宿主在用);
42
+ 展示代码直接用 `--dshpc-*`。已删除旧的 `token-alias` 别名层——那层会往 `body` 写 `--tdt-*`,把兄弟插件的 token 抢过来。
43
43
  - 零运行时依赖:不引内部 `@deepseek-ai/*`,故不声明 schemastery Config。
package/dist/client.js CHANGED
@@ -889,7 +889,7 @@ var CONTROLS_CSS = [
889
889
  CARD_CSS,
890
890
  CHIP_CSS
891
891
  ].join("\n");
892
- var current = createStyleKit({ id: "dsh-plugin-core-ui", prefix: "dsh" });
892
+ var current = createStyleKit({ id: "dsh-plugin-core-ui", prefix: "dshpc" });
893
893
  function setStyleKit(kit) {
894
894
  current = kit;
895
895
  }
@@ -1998,17 +1998,17 @@ function t2(key, vars) {
1998
1998
 
1999
1999
  // packages/demo/src/sections/design.tsx
2000
2000
  var TOKENS = [
2001
- { label: "business", cssVar: "--tdt-business" },
2002
- { label: "success", cssVar: "--tdt-success" },
2003
- { label: "warning", cssVar: "--tdt-warning" },
2004
- { label: "danger", cssVar: "--tdt-danger" },
2005
- { label: "surface-1", cssVar: "--tdt-surface-1" },
2006
- { label: "surface-2", cssVar: "--tdt-surface-2" },
2007
- { label: "surface-sunken", cssVar: "--tdt-surface-sunken" },
2008
- { label: "border", cssVar: "--tdt-border" },
2009
- { label: "fg", cssVar: "--tdt-fg" },
2010
- { label: "fg-3", cssVar: "--tdt-fg-3" },
2011
- { label: "fg-4", cssVar: "--tdt-fg-4" }
2001
+ { label: "business", cssVar: "--dshpc-business" },
2002
+ { label: "success", cssVar: "--dshpc-success" },
2003
+ { label: "warning", cssVar: "--dshpc-warning" },
2004
+ { label: "danger", cssVar: "--dshpc-danger" },
2005
+ { label: "surface-1", cssVar: "--dshpc-surface-1" },
2006
+ { label: "surface-2", cssVar: "--dshpc-surface-2" },
2007
+ { label: "surface-sunken", cssVar: "--dshpc-surface-sunken" },
2008
+ { label: "border", cssVar: "--dshpc-border" },
2009
+ { label: "fg", cssVar: "--dshpc-fg" },
2010
+ { label: "fg-3", cssVar: "--dshpc-fg-3" },
2011
+ { label: "fg-4", cssVar: "--dshpc-fg-4" }
2012
2012
  ];
2013
2013
  function DesignSection() {
2014
2014
  return (0, import_react19.createElement)(
@@ -2029,11 +2029,11 @@ function DesignSection() {
2029
2029
  height: "40px",
2030
2030
  borderRadius: "6px",
2031
2031
  background: `var(${t3.cssVar})`,
2032
- border: "1px solid var(--tdt-border-faint)"
2032
+ border: "1px solid var(--dshpc-border-faint)"
2033
2033
  }
2034
2034
  }),
2035
2035
  (0, import_react19.createElement)("div", { style: { fontSize: "11px", marginTop: "4px" } }, t3.label),
2036
- (0, import_react19.createElement)("div", { style: { fontSize: "10px", color: "var(--tdt-fg-4)" } }, t3.cssVar)
2036
+ (0, import_react19.createElement)("div", { style: { fontSize: "10px", color: "var(--dshpc-fg-4)" } }, t3.cssVar)
2037
2037
  )
2038
2038
  )
2039
2039
  )
@@ -2051,7 +2051,7 @@ ensureControls()`
2051
2051
  },
2052
2052
  (0, import_react19.createElement)(
2053
2053
  "div",
2054
- { style: { color: "var(--tdt-fg-3)", fontSize: "12px" } },
2054
+ { style: { color: "var(--dshpc-fg-3)", fontSize: "12px" } },
2055
2055
  t2("designInjectNote")
2056
2056
  )
2057
2057
  )
@@ -2094,7 +2094,7 @@ function ButtonsSection() {
2094
2094
  (0, import_react20.createElement)(
2095
2095
  "div",
2096
2096
  { style: { display: "flex", alignItems: "center", gap: "6px" } },
2097
- (0, import_react20.createElement)("span", { style: { color: "var(--tdt-fg-2)", fontSize: "13px", flex: "none" } }, "\u5F00\u59CB\u65F6\u95F4"),
2097
+ (0, import_react20.createElement)("span", { style: { color: "var(--dshpc-fg-2)", fontSize: "13px", flex: "none" } }, "\u5F00\u59CB\u65F6\u95F4"),
2098
2098
  (0, import_react20.createElement)(Input, { value: text, onChange: setText, placeholder: "\u9009\u62E9\u65E5\u671F" }),
2099
2099
  (0, import_react20.createElement)(FieldHint, { text: t2("fieldHintDate") })
2100
2100
  ),
@@ -2326,12 +2326,12 @@ function FeedbackSection() {
2326
2326
  (0, import_react22.createElement)(EmptyState, { text: "\u6682\u65E0\u6570\u636E" }),
2327
2327
  (0, import_react22.createElement)(
2328
2328
  "div",
2329
- { style: { border: "1px solid var(--tdt-border-faint)", borderRadius: "8px", padding: "10px" } },
2329
+ { style: { border: "1px solid var(--dshpc-border-faint)", borderRadius: "8px", padding: "10px" } },
2330
2330
  boom ? (0, import_react22.createElement)(ErrorBoundary, null, (0, import_react22.createElement)(Boom, null)) : (0, import_react22.createElement)(Button, { variant: "danger", onClick: () => setBoom(true) }, "\u70B9\u6211\u629B\u9519\uFF08\u770B\u8FB9\u754C\u515C\u5E95\uFF09")
2331
2331
  ),
2332
2332
  (0, import_react22.createElement)(
2333
2333
  "div",
2334
- { style: { color: "var(--tdt-fg-3)", fontSize: "12px" } },
2334
+ { style: { color: "var(--dshpc-fg-3)", fontSize: "12px" } },
2335
2335
  t2("loadingNote")
2336
2336
  )
2337
2337
  )
@@ -2361,10 +2361,10 @@ function DisplaySection() {
2361
2361
  { style: { display: "flex", alignItems: "baseline", gap: "8px" } },
2362
2362
  (0, import_react23.createElement)(
2363
2363
  "div",
2364
- { style: { fontWeight: 600, flex: "1 1 auto", minWidth: 0, fontSize: "var(--tdt-font-md)" } },
2364
+ { style: { fontWeight: 600, flex: "1 1 auto", minWidth: 0, fontSize: "var(--dshpc-font-md)" } },
2365
2365
  "\u5C06 OpenSSH \u4E0A\u6240\u6709 NPM \u5B89\u88C5\u8FC1\u79FB\u5230 PNPM"
2366
2366
  ),
2367
- (0, import_react23.createElement)("div", { style: { color: "var(--tdt-fg-3)", fontSize: "var(--tdt-font-xs)", flex: "none" } }, "2026-10-18 \u521B\u5EFA")
2367
+ (0, import_react23.createElement)("div", { style: { color: "var(--dshpc-fg-3)", fontSize: "var(--dshpc-font-xs)", flex: "none" } }, "2026-10-18 \u521B\u5EFA")
2368
2368
  ),
2369
2369
  (0, import_react23.createElement)(
2370
2370
  "div",
@@ -2384,7 +2384,7 @@ function DisplaySection() {
2384
2384
  (a) => (0, import_react23.createElement)(
2385
2385
  Card,
2386
2386
  { key: a, accent: a, style: { padding: "8px 12px" } },
2387
- (0, import_react23.createElement)("div", { style: { fontSize: "var(--tdt-font-sm)", color: "var(--tdt-fg-2)" } }, `accent="${a}"`)
2387
+ (0, import_react23.createElement)("div", { style: { fontSize: "var(--dshpc-font-sm)", color: "var(--dshpc-fg-2)" } }, `accent="${a}"`)
2388
2388
  )
2389
2389
  )
2390
2390
  )
@@ -2395,21 +2395,21 @@ function DisplaySection() {
2395
2395
  { title: t2("demoStripTitle"), hint: t2("displayStripHint") },
2396
2396
  (0, import_react23.createElement)(
2397
2397
  "div",
2398
- { style: { maxWidth: "640px", background: "var(--tdt-surface-sunken)", borderRadius: "8px", overflow: "hidden" } },
2398
+ { style: { maxWidth: "640px", background: "var(--dshpc-surface-sunken)", borderRadius: "8px", overflow: "hidden" } },
2399
2399
  (0, import_react23.createElement)(
2400
2400
  StripCard,
2401
2401
  {
2402
2402
  accent: "business",
2403
- action: (0, import_react23.createElement)("span", { style: { color: "var(--tdt-fg-3)", fontSize: "var(--tdt-font-xs)", flex: "none" } }, "2026-10-18 \u5F00\u59CB \xB7 \u4ECA\u5929")
2403
+ action: (0, import_react23.createElement)("span", { style: { color: "var(--dshpc-fg-3)", fontSize: "var(--dshpc-font-xs)", flex: "none" } }, "2026-10-18 \u5F00\u59CB \xB7 \u4ECA\u5929")
2404
2404
  },
2405
- (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--tdt-font-md)" } }, "DAY:1 - Docker \u955C\u50CF\u7248\u672C\u68C0\u67E5\u5668"),
2405
+ (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--dshpc-font-md)" } }, "DAY:1 - Docker \u955C\u50CF\u7248\u672C\u68C0\u67E5\u5668"),
2406
2406
  (0, import_react23.createElement)(
2407
2407
  "div",
2408
2408
  { style: { display: "flex", alignItems: "center", gap: "6px", marginTop: "4px", flexWrap: "wrap" } },
2409
2409
  (0, import_react23.createElement)(Chip, null, "NAS-Docker"),
2410
2410
  (0, import_react23.createElement)(
2411
2411
  "span",
2412
- { style: { color: "var(--tdt-fg-3)", fontSize: "var(--tdt-font-xs)" } },
2412
+ { style: { color: "var(--dshpc-fg-3)", fontSize: "var(--dshpc-font-xs)" } },
2413
2413
  "\u8BA1\u5212 02:00 \xB7 \u5B9E\u9645 02:00 \xB7 \u65F6\u957F 04:02 \xB7 2.4M"
2414
2414
  )
2415
2415
  )
@@ -2417,8 +2417,8 @@ function DisplaySection() {
2417
2417
  (0, import_react23.createElement)(
2418
2418
  StripCard,
2419
2419
  { accent: "success" },
2420
- (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--tdt-font-md)" } }, "\u6267\u884C\u6210\u529F"),
2421
- (0, import_react23.createElement)("div", { style: { color: "var(--tdt-fg-3)", fontSize: "var(--tdt-font-xs)", marginTop: "4px" } }, "\u8017\u65F6 12s \xB7 3 \u4E2A\u6587\u4EF6\u53D8\u66F4")
2420
+ (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--dshpc-font-md)" } }, "\u6267\u884C\u6210\u529F"),
2421
+ (0, import_react23.createElement)("div", { style: { color: "var(--dshpc-fg-3)", fontSize: "var(--dshpc-font-xs)", marginTop: "4px" } }, "\u8017\u65F6 12s \xB7 3 \u4E2A\u6587\u4EF6\u53D8\u66F4")
2422
2422
  ),
2423
2423
  (0, import_react23.createElement)(
2424
2424
  StripCard,
@@ -2427,10 +2427,10 @@ function DisplaySection() {
2427
2427
  expanded: open,
2428
2428
  onToggle: () => setOpen(!open),
2429
2429
  action: (0, import_react23.createElement)(Button, { size: "sm", variant: "ghost" }, "\u67E5\u770B\u4F1A\u8BDD"),
2430
- panel: (0, import_react23.createElement)("div", { style: { fontSize: "12px", color: "var(--tdt-fg-3)" } }, "\u5C55\u5F00\u540E\u7684\u8BE6\u60C5\u9762\u677F")
2430
+ panel: (0, import_react23.createElement)("div", { style: { fontSize: "12px", color: "var(--dshpc-fg-3)" } }, "\u5C55\u5F00\u540E\u7684\u8BE6\u60C5\u9762\u677F")
2431
2431
  },
2432
- (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--tdt-font-md)" } }, "\u6709\u8B66\u544A\uFF08\u53EF\u6298\u53E0\uFF0C\u70B9\u53F3\u4FA7\u7BAD\u5934\uFF09"),
2433
- (0, import_react23.createElement)("div", { style: { color: "var(--tdt-fg-3)", fontSize: "var(--tdt-font-xs)", marginTop: "4px" } }, "\u8017\u65F6 8s \xB7 1 \u4E2A\u8B66\u544A")
2432
+ (0, import_react23.createElement)("div", { style: { fontWeight: 600, fontSize: "var(--dshpc-font-md)" } }, "\u6709\u8B66\u544A\uFF08\u53EF\u6298\u53E0\uFF0C\u70B9\u53F3\u4FA7\u7BAD\u5934\uFF09"),
2433
+ (0, import_react23.createElement)("div", { style: { color: "var(--dshpc-fg-3)", fontSize: "var(--dshpc-font-xs)", marginTop: "4px" } }, "\u8017\u65F6 8s \xB7 1 \u4E2A\u8B66\u544A")
2434
2434
  )
2435
2435
  )
2436
2436
  ),
@@ -2508,8 +2508,8 @@ function UtilsSection() {
2508
2508
  )
2509
2509
  );
2510
2510
  }
2511
- var th = { textAlign: "left", padding: "6px 14px 6px 0", color: "var(--tdt-fg-3)" };
2512
- var td = { padding: "5px 14px 5px 0", borderTop: "1px solid var(--tdt-border-faint)" };
2511
+ var th = { textAlign: "left", padding: "6px 14px 6px 0", color: "var(--dshpc-fg-3)" };
2512
+ var td = { padding: "5px 14px 5px 0", borderTop: "1px solid var(--dshpc-border-faint)" };
2513
2513
 
2514
2514
  // packages/demo/src/sections/explorer.tsx
2515
2515
  var import_react27 = require("react");
@@ -2848,7 +2848,7 @@ function ExplorerSection() {
2848
2848
  width: "520px",
2849
2849
  height: "380px",
2850
2850
  overflow: "hidden",
2851
- border: "1px solid var(--tdt-border)",
2851
+ border: "1px solid var(--dshpc-border)",
2852
2852
  borderRadius: "8px"
2853
2853
  }
2854
2854
  },
@@ -2861,7 +2861,7 @@ function ExplorerSection() {
2861
2861
  ),
2862
2862
  (0, import_react27.createElement)(
2863
2863
  "div",
2864
- { style: { fontSize: "12px", color: "var(--tdt-fg-3)", alignSelf: "center" } },
2864
+ { style: { fontSize: "12px", color: "var(--dshpc-fg-3)", alignSelf: "center" } },
2865
2865
  selected === null ? "\u70B9\u5DE6\u4FA7\u6587\u4EF6\u8BD5\u8BD5" : `\u5DF2\u9009\u4E2D\uFF1A${selected}`
2866
2866
  )
2867
2867
  )
@@ -2968,13 +2968,13 @@ function Demo(props) {
2968
2968
  style: {
2969
2969
  marginBottom: "28px",
2970
2970
  padding: "16px 18px",
2971
- border: "1px solid var(--tdt-border-faint)",
2971
+ border: "1px solid var(--dshpc-border-faint)",
2972
2972
  borderRadius: "8px",
2973
- background: "var(--tdt-surface-1)"
2973
+ background: "var(--dshpc-surface-1)"
2974
2974
  }
2975
2975
  },
2976
2976
  (0, import_react30.createElement)("h3", { style: { margin: "0 0 2px", fontSize: "15px" } }, props.title),
2977
- props.hint === void 0 ? null : (0, import_react30.createElement)("div", { style: { color: "var(--tdt-fg-3)", fontSize: "12px", marginBottom: "12px" } }, props.hint),
2977
+ props.hint === void 0 ? null : (0, import_react30.createElement)("div", { style: { color: "var(--dshpc-fg-3)", fontSize: "12px", marginBottom: "12px" } }, props.hint),
2978
2978
  (0, import_react30.createElement)("div", { style: { marginBottom: props.code === void 0 ? 0 : "12px" } }, props.children ?? null),
2979
2979
  props.code === void 0 ? null : (0, import_react30.createElement)(
2980
2980
  "pre",
@@ -2984,9 +2984,9 @@ function Demo(props) {
2984
2984
  padding: "10px 12px",
2985
2985
  borderRadius: "6px",
2986
2986
  overflowX: "auto",
2987
- background: "var(--tdt-code-surface)",
2988
- color: "var(--tdt-fg)",
2989
- font: "var(--tdt-code-font)",
2987
+ background: "var(--dshpc-code-surface)",
2988
+ color: "var(--dshpc-fg)",
2989
+ font: "var(--dshpc-code-font)",
2990
2990
  fontSize: "12px"
2991
2991
  }
2992
2992
  },
@@ -2999,7 +2999,7 @@ function SectionHead2(props) {
2999
2999
  "div",
3000
3000
  { id: `sec-${props.id}`, style: { margin: "28px 0 14px" } },
3001
3001
  (0, import_react30.createElement)("h2", { style: { margin: 0, fontSize: "20px" } }, props.title),
3002
- (0, import_react30.createElement)("div", { style: { height: "3px", width: "36px", background: "var(--tdt-business)", borderRadius: "2px", marginTop: "6px" } })
3002
+ (0, import_react30.createElement)("div", { style: { height: "3px", width: "36px", background: "var(--dshpc-business)", borderRadius: "2px", marginTop: "6px" } })
3003
3003
  );
3004
3004
  }
3005
3005
  var ALL_SECTIONS = [
@@ -3022,9 +3022,6 @@ function Sections(props) {
3022
3022
  );
3023
3023
  }
3024
3024
 
3025
- // packages/demo/src/client/token-alias.ts
3026
- var ALIAS_TOKEN_NAMES = ["accent", "active", "border", "border-faint", "border-heavy", "border-strong", "business", "chip-bg", "chip-bg-hover", "code-font", "code-surface", "control-h-lg", "control-h-md", "control-h-sm", "danger", "dur", "dur-fast", "ease", "fg", "fg-2", "fg-3", "fg-4", "fg-dim", "fg-inverse", "focus", "font-lg", "font-md", "font-mono", "font-sm", "font-xs", "hover", "line-lg", "line-md", "line-sm", "link", "on-signal", "on-solid", "open-bg", "open-bg-soft", "radius-md", "radius-sm", "radius-xs", "shadow-1", "shadow-2", "shadow-raised", "solid", "space-1", "space-2", "space-3", "space-4", "success", "surface-1", "surface-2", "surface-base", "surface-menu", "surface-sunken", "warning", "warning-label", "z-dock", "z-menu"];
3027
-
3028
3025
  // packages/demo/src/client/index.tsx
3029
3026
  var PANEL_ID = "dsh-plugin-core-demo";
3030
3027
  var PREFIX = "dshpc";
@@ -3039,10 +3036,6 @@ function useLocaleTick() {
3039
3036
  });
3040
3037
  }, []);
3041
3038
  }
3042
- function aliasCss() {
3043
- const decls = ALIAS_TOKEN_NAMES.map((n) => `--tdt-${n}:var(--${PREFIX}-${n})`);
3044
- return `body{${decls.join(";")}}`;
3045
- }
3046
3039
  function DemoPage() {
3047
3040
  useLocaleTick();
3048
3041
  const [active, setActive] = (0, import_react31.useState)(ALL_SECTIONS[0].id);
@@ -3138,7 +3131,6 @@ function apply(ctx) {
3138
3131
  const kit = createStyleKit({ id: "dsh-plugin-core-plugin", prefix: PREFIX });
3139
3132
  setStyleKit(kit);
3140
3133
  ensureControls(kit);
3141
- kit.registerStyle("tdt-alias", aliasCss());
3142
3134
  kit.ensureStyles();
3143
3135
  let jump = () => {
3144
3136
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",