dsh-plugin-core-demo 0.35.24 → 0.35.26

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.en.md ADDED
@@ -0,0 +1,101 @@
1
+ # dsh-plugin-core-demo
2
+
3
+ [简体中文](https://github.com/cq-guojia/dsh-plugin-core/blob/main/packages/demo/README.md) · **English**
4
+
5
+ The live preview plugin for [`dsh-plugin-core`](https://www.npmjs.com/package/dsh-plugin-core) — in the DSH sidebar it appears as **Blue Whale Component Library**.
6
+
7
+ Install it into a real DSH host and every base control and composed module renders with the host's own theme, tokens and data. There is no standalone web page: what you see is exactly what a plugin built on the library gets.
8
+
9
+ | | Package | Role |
10
+ |---|---|---|
11
+ | Library | `dsh-plugin-core` | Imported by plugins by subpath (`/ui`, `/design`, `/utils`, `/adv/explorer`, `/adv/session`) |
12
+ | Plugin | `dsh-plugin-core-demo` (this package) | Installed into DSH, renders the library in place |
13
+
14
+ ## Install
15
+
16
+ Into a DSH host, with the DSH CLI:
17
+
18
+ ```bash
19
+ dsh plugin --profile web add dsh-plugin-core-demo
20
+ ```
21
+
22
+ Or the npm package itself:
23
+
24
+ ```bash
25
+ npm install dsh-plugin-core-demo
26
+ ```
27
+
28
+ After installing: open the plugin in the DSH plugin list — the plugin page carries a **Component preview** entry that opens the full-page preview. The sidebar entry position (first level / under "More" / off) is a plugin setting.
29
+
30
+ ## What it shows
31
+
32
+ | Page | Content |
33
+ |---|---|
34
+ | Design foundation | The token palette, the dark-mode predicate, the style injector that puts both on the page |
35
+ | Actions | Button across all 18 appearance tiers and three heights, icon buttons, loading behaviour |
36
+ | Inputs | Input family, pickers, date and time, checkbox / switch / segmented, field hints |
37
+ | Display | Surface, cards, chips, section heads, marquee and flip text, tables with grouped headers and banner groups |
38
+ | Feedback | Modal, side sheet, promise-based confirm and alert, toasts, loaders and the global loading card |
39
+ | Layout and scrolling | The right-docked panel, toolbar behaviour, split groups and resizers |
40
+ | Navigation | Pagination on its own and built into a table |
41
+ | Workspace browsing | Docked file browser and every preview body, driven by real workspace files |
42
+ | Session preview | A read-only conversation dialog, including archive state and changed-file review |
43
+ | Utilities | Every helper with live input and output, including failure returns |
44
+ | Localization | Every built-in string in both Chinese and English |
45
+
46
+ Everything on these pages runs the same code the library ships — the preview plugin bundles core's build output into itself, so it always shows the current source, without publishing core first.
47
+
48
+ ## Screenshots
49
+
50
+ Design tokens, the theme predicate and the injector:
51
+
52
+ ![Design tokens and theme predicate](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/01-tokens.png)
53
+
54
+ Buttons:
55
+
56
+ ![Button tiers](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/02-buttons.png)
57
+
58
+ Inputs:
59
+
60
+ ![Inputs](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/03-inputs.png)
61
+
62
+ Workspace browsing:
63
+
64
+ ![Workspace explorer](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/04-explorer.png)
65
+
66
+ Session preview:
67
+
68
+ ![Session preview](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/05-session.png)
69
+
70
+ ## Compatibility
71
+
72
+ | Area | Requirement |
73
+ |---|---|
74
+ | Host | DSH web client (`client.platform: web`); the plugin registers into the sidebar, the main area and the plugin settings page |
75
+ | Node.js | `>= 22.5` |
76
+ | React / React DOM | `>= 18`, optional peers provided by the host |
77
+ | Official modules | `@deepseek-ai/*` packages are resolved by the host at runtime and never declared as dependencies |
78
+ | Styling | Runtime-injected; variables and classes use the fixed `--dshpc-*` / `dshpc-*` prefixes and never touch the host's own |
79
+
80
+ ## Build from source
81
+
82
+ ```bash
83
+ # in the repository root
84
+ pnpm run build # build the library first (this package imports ../../dist/)
85
+ pnpm run build:demo # build this package → dist/index.js (server shell) + dist/client.js (preview bundle)
86
+ ```
87
+
88
+ `dist/` is committed alongside `src/`: the host does not run build scripts when installing a plugin.
89
+
90
+ ## Release
91
+
92
+ Do not run `npm publish` in this directory. The library and this plugin share the same `vX.Y.Z` tag and are published by `.github/workflows/demo-publish.yml`; the two versions must match exactly (checked by `test/version-sync.test.mjs` and by CI).
93
+
94
+ ```bash
95
+ # from the repository root — one tag publishes both packages
96
+ git tag vX.Y.Z && git push origin vX.Y.Z
97
+ ```
98
+
99
+ ## License
100
+
101
+ MIT
package/README.md CHANGED
@@ -1,101 +1,101 @@
1
1
  # dsh-plugin-core-demo
2
2
 
3
- **English** · [简体中文](https://github.com/cq-guojia/dsh-plugin-core/blob/main/packages/demo/README.zh-CN.md)
3
+ **简体中文** · [English](https://github.com/cq-guojia/dsh-plugin-core/blob/main/packages/demo/README.en.md)
4
4
 
5
- The live preview plugin for [`dsh-plugin-core`](https://www.npmjs.com/package/dsh-plugin-core) — in the DSH sidebar it appears as **Blue Whale Component Library**.
5
+ [`dsh-plugin-core`](https://www.npmjs.com/package/dsh-plugin-core) 的实时预览插件——在 DSH 侧栏里显示为**蓝鲸组件库**。
6
6
 
7
- Install it into a real DSH host and every base control and composed module renders with the host's own theme, tokens and data. There is no standalone web page: what you see is exactly what a plugin built on the library gets.
7
+ 装进真实的 DSH 宿主后,每个基础控件与组合模块都用宿主自己的主题、token 和数据渲染。它没有独立的网页形态:你看到的就是一个用这套库写出来的插件该有的样子。
8
8
 
9
- | | Package | Role |
9
+ | | 包 | 角色 |
10
10
  |---|---|---|
11
- | Library | `dsh-plugin-core` | Imported by plugins by subpath (`/ui`, `/design`, `/utils`, `/explorer`, `/session`) |
12
- | Plugin | `dsh-plugin-core-demo` (this package) | Installed into DSH, renders the library in place |
11
+ | 库 | `dsh-plugin-core` | 各插件按子路径引用(`/ui`、`/design`、`/utils`、`/adv/explorer`、`/adv/session`) |
12
+ | 插件 | `dsh-plugin-core-demo`(本包) | 装进 DSH,就地渲染这套库 |
13
13
 
14
- ## Install
14
+ ## 安装
15
15
 
16
- Into a DSH host, with the DSH CLI:
16
+ 用 DSH 命令装进宿主:
17
17
 
18
18
  ```bash
19
19
  dsh plugin --profile web add dsh-plugin-core-demo
20
20
  ```
21
21
 
22
- Or the npm package itself:
22
+ 或用 npm 装这个包本身:
23
23
 
24
24
  ```bash
25
25
  npm install dsh-plugin-core-demo
26
26
  ```
27
27
 
28
- After installing: open the plugin in the DSH plugin list — the plugin page carries a **Component preview** entry that opens the full-page preview. The sidebar entry position (first level / under "More" / off) is a plugin setting.
28
+ 装好后打开插件列表里的本插件:详情页有「组件预览」入口,点开即整页预览。侧栏入口位置(第一级 / 收入「更多」/ 关闭)是插件设置项。
29
29
 
30
- ## What it shows
30
+ ## 演示了什么
31
31
 
32
- | Page | Content |
32
+ | 页面 | 内容 |
33
33
  |---|---|
34
- | Design foundation | The token palette, the dark-mode predicate, the style injector that puts both on the page |
35
- | Actions | Button across all 18 appearance tiers and three heights, icon buttons, loading behaviour |
36
- | Inputs | Input family, pickers, date and time, checkbox / switch / segmented, field hints |
37
- | Display | Surface, cards, chips, section heads, marquee and flip text, tables with grouped headers and banner groups |
38
- | Feedback | Modal, side sheet, promise-based confirm and alert, toasts, loaders and the global loading card |
39
- | Layout and scrolling | The right-docked panel, toolbar behaviour, split groups and resizers |
40
- | Navigation | Pagination on its own and built into a table |
41
- | Workspace browsing | Docked file browser and every preview body, driven by real workspace files |
42
- | Session preview | A read-only conversation dialog, including archive state and changed-file review |
43
- | Utilities | Every helper with live input and output, including failure returns |
44
- | Localization | Every built-in string in both Chinese and English |
34
+ | 设计基础 | token 色板、明暗判据、把两者弄上页面的样式注入 |
35
+ | 动作 | 按钮全部 18 档外观与三档高度、图标按钮、loading 行为 |
36
+ | 录入 | 输入框家族、选择器、日期与时间、勾选 / 开关 / 分段、问号提示 |
37
+ | 展示 | 框容器、卡片、Chip、区块标题、跑马灯与翻牌文本、带分组表头与通栏分组的表格 |
38
+ | 反馈 | 弹窗、侧边抽屉、Promise 形态的确认与提示、toast、加载图标与全局加载卡 |
39
+ | 布局与滚动 | 右侧停靠分栏、工具栏行为、组合选择框与拖宽 |
40
+ | 导航 | 独立分页,以及表格内置分页 |
41
+ | 工作区浏览 | 停靠式文件浏览与全部预览体,读的是真实工作区文件 |
42
+ | 会话预览 | 只读会话弹窗,含归档态与变更文件审阅 |
43
+ | 工具方法 | 每个方法都给出实时输入与输出,包括失败返回值 |
44
+ | 多语言 | 每条内置文案的中英对照 |
45
45
 
46
- Everything on these pages runs the same code the library ships — the preview plugin bundles core's build output into itself, so it always shows the current source, without publishing core first.
46
+ 这些页面跑的都是库发布出去的同一份代码——预览插件把 core 的构建产物打进自己 bundle,所以它永远显示当前这份源码,不需要先把 core 发到 npm。
47
47
 
48
- ## Screenshots
48
+ ## 截图
49
49
 
50
- Design tokens, the theme predicate and the injector:
50
+ 设计基础——token、明暗判据与注入机制:
51
51
 
52
- ![Design tokens and theme predicate](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/01-tokens.png)
52
+ ![设计基础](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/01-tokens.png)
53
53
 
54
- Buttons:
54
+ 动作——按钮:
55
55
 
56
- ![Button tiers](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/02-buttons.png)
56
+ ![按钮](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/02-buttons.png)
57
57
 
58
- Inputs:
58
+ 录入:
59
59
 
60
- ![Inputs](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/03-inputs.png)
60
+ ![录入](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/03-inputs.png)
61
61
 
62
- Workspace browsing:
62
+ 工作区浏览:
63
63
 
64
- ![Workspace explorer](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/04-explorer.png)
64
+ ![工作区浏览](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/04-explorer.png)
65
65
 
66
- Session preview:
66
+ 会话预览:
67
67
 
68
- ![Session preview](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/05-session.png)
68
+ ![会话预览](https://cdn.jsdelivr.net/gh/cq-guojia/dsh-plugin-core@main/assets/readme/05-session.png)
69
69
 
70
- ## Compatibility
70
+ ## 适配范围
71
71
 
72
- | Area | Requirement |
72
+ | 维度 | 要求 |
73
73
  |---|---|
74
- | Host | DSH web client (`client.platform: web`); the plugin registers into the sidebar, the main area and the plugin settings page |
74
+ | 宿主 | DSH web client(`client.platform: web`);插件注册到侧栏、主区与插件设置页 |
75
75
  | Node.js | `>= 22.5` |
76
- | React / React DOM | `>= 18`, optional peers provided by the host |
77
- | Official modules | `@deepseek-ai/*` packages are resolved by the host at runtime and never declared as dependencies |
78
- | Styling | Runtime-injected; variables and classes use the fixed `--dshpc-*` / `dshpc-*` prefixes and never touch the host's own |
76
+ | React / React DOM | `>= 18`,可选 peer,由宿主提供 |
77
+ | 官方模块 | `@deepseek-ai/*` 由宿主运行时解析,本包不声明为依赖 |
78
+ | 样式 | 运行时注入;变量与类名固定 `--dshpc-*` / `dshpc-*`,不碰宿主自己的前缀 |
79
79
 
80
- ## Build from source
80
+ ## 从源码构建
81
81
 
82
82
  ```bash
83
- # in the repository root
84
- pnpm run build # build the library first (this package imports ../../dist/)
85
- pnpm run build:demo # build this package → dist/index.js (server shell) + dist/client.js (preview bundle)
83
+ # 在仓库根目录
84
+ pnpm run build # 先构建库(本包引用 ../../dist/)
85
+ pnpm run build:demo # 再构建本包 → dist/index.js(server 壳)+ dist/client.js(预览页 bundle)
86
86
  ```
87
87
 
88
- `dist/` is committed alongside `src/`: the host does not run build scripts when installing a plugin.
88
+ `dist/` 与 `src/` 一起入库:宿主安装插件时不跑构建脚本。
89
89
 
90
- ## Release
90
+ ## 发布
91
91
 
92
- Do not run `npm publish` in this directory. The library and this plugin share the same `vX.Y.Z` tag and are published by `.github/workflows/demo-publish.yml`; the two versions must match exactly (checked by `test/version-sync.test.mjs` and by CI).
92
+ 不要在本目录手跑 `npm publish`。库与本插件共用同一个 `vX.Y.Z` tag,由 `.github/workflows/demo-publish.yml` 发布;两个版本必须完全一致(`test/version-sync.test.mjs` 与 CI 都校验)。
93
93
 
94
94
  ```bash
95
- # from the repository root — one tag publishes both packages
95
+ # 在仓库根:一次 tag 发两个包
96
96
  git tag vX.Y.Z && git push origin vX.Y.Z
97
97
  ```
98
98
 
99
- ## License
99
+ ## 许可证
100
100
 
101
101
  MIT