dsh-mermaid-smooth 0.1.0 → 0.2.0

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
@@ -7,11 +7,30 @@ default, with smooth zoom and pan, a per-fence diagram/code toggle at each
7
7
  card's top-right, a persisted per-fence preference, dark-mode follow, and a
8
8
  fully bundled offline engine (zero CDN).
9
9
 
10
+ ## Supported diagram types
11
+
12
+ The plugin bundles **Mermaid 11.17.2** locally, so it renders these diagram
13
+ types without adding another charting library:
14
+
15
+ | Type | Syntax |
16
+ | --- | --- |
17
+ | Flowchart | `flowchart` / `graph` |
18
+ | Sequence diagram | `sequenceDiagram` |
19
+ | State diagram | `stateDiagram` |
20
+ | Class diagram | `classDiagram` |
21
+ | Mind map | `mindmap` |
22
+ | Gantt chart / timeline | `gantt` / `timeline` |
23
+ | ER diagram | `erDiagram` |
24
+ | User journey, pie, Git, Sankey, XY, Kanban, and architecture diagrams | Supported by the bundled Mermaid engine |
25
+
10
26
  - **Default diagram** — fences in assistant messages render as SVG diagrams
11
27
  the moment they are complete; non-mermaid code blocks are untouched.
12
28
  - **Smooth interaction** — cursor-anchored wheel zoom over one composed
13
29
  transform (with a short ease-out), direct pointer drag, double-click to
14
30
  fit. Reduced-motion preferences disable all easing.
31
+ - **Useful diagram tools** — fit to width or the whole diagram, copy the
32
+ Mermaid source, and download the rendered SVG. Press <kbd>Esc</kbd> to exit
33
+ fullscreen.
15
34
  - **Toggle at top-right** — every diagram card has a 图/文案 (diagram/code)
16
35
  switch; several fences in one message toggle independently.
17
36
  - **Per-fence memory** — the toggle state persists in localStorage keyed by
@@ -32,10 +51,25 @@ fully bundled offline engine (zero CDN).
32
51
 
33
52
  ## Install
34
53
 
35
- Two ways — pick one, then restart DSH Web (the current session ends, but DSH
54
+ dsh-mermaid-smooth is a plugin for the DeepSeek Harness (dsh) web UI. Before
55
+ proceeding, make sure the dsh CLI and web environment are installed and set
56
+ up.
57
+
58
+ Four ways — pick one, then restart DSH Web (the current session ends, but DSH
36
59
  sessions are persisted on disk and can be resumed after restart).
37
60
 
38
- **1. From GitHub (pinned to a verified commit)**
61
+ **1. npm package (recommended, simplest)**
62
+
63
+ ```sh
64
+ dsh plugin --profile web add dsh-mermaid-smooth
65
+ ```
66
+
67
+ Verified working: the tarball ships the prebuilt `lib/client.js`, so nothing
68
+ is compiled at install time. pnpm may auto-add the package to
69
+ `minimumReleaseAgeExclude` in the profile's `pnpm-workspace.yaml` (because the
70
+ package was just published) — that is expected and harmless.
71
+
72
+ **2. From GitHub (pinned to a commit)**
39
73
 
40
74
  ```sh
41
75
  dsh plugin --profile web add 'github:gitByteFree/dsh-mermaid-smooth#<full-commit-sha>'
@@ -46,7 +80,18 @@ history page); later changes on `main` will not silently alter installed code.
46
80
  The source is installed and built at install time (`prepare` runs the esbuild
47
81
  bundle), so git and Node.js ≥ 20 are required.
48
82
 
49
- **2. Local clone (for development)**
83
+ **3. From a release tarball (offline / where git is inconvenient)**
84
+
85
+ Download `dsh-mermaid-smooth-<version>.tgz` from this repo's
86
+ [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) (it
87
+ contains the prebuilt `lib/client.js`, so no `prepare` script runs at install
88
+ time), then:
89
+
90
+ ```sh
91
+ dsh plugin --profile web add ./dsh-mermaid-smooth-<version>.tgz
92
+ ```
93
+
94
+ **4. Local clone (for development)**
50
95
 
51
96
  ```sh
52
97
  git clone git@github.com:gitByteFree/dsh-mermaid-smooth.git
package/README.zh.md CHANGED
@@ -4,8 +4,24 @@
4
4
 
5
5
  将 DeepSeek Harness(dsh)Web 对话中的 mermaid 代码围栏**默认渲染为图**:丝滑的缩放与拖拽,每张图右上角提供图/文案切换,偏好按围栏记忆,明暗主题跟随,渲染引擎完全本地打包(零 CDN)。
6
6
 
7
+ ## 支持的图表类型
8
+
9
+ 插件本地打包了 **Mermaid 11.17.2**,无需再接入其他图表库,即可渲染以下图表:
10
+
11
+ | 类型 | 语法 |
12
+ | --- | --- |
13
+ | 流程图 | `flowchart` / `graph` |
14
+ | 时序图 | `sequenceDiagram` |
15
+ | 状态图 | `stateDiagram` |
16
+ | 类图 | `classDiagram` |
17
+ | 思维导图 | `mindmap` |
18
+ | 甘特图 / 时间线 | `gantt` / `timeline` |
19
+ | ER 图 | `erDiagram` |
20
+ | 用户旅程、饼图、Git 图、桑基图、XY 图、看板、架构图等 | 由内置 Mermaid 引擎支持 |
21
+
7
22
  - **默认成图** — 助手消息中的 mermaid 围栏一旦完整立即渲染为 SVG 图;非 mermaid 代码块不受影响。
8
23
  - **丝滑交互** — 滚轮缩放以指针为锚点(单一 transform 合成 + 短过渡),拖拽平移 1:1 跟手,双击适应/复位;系统开启「减少动态效果」时全部动画禁用。
24
+ - **实用工具** — 可一键适应宽度或全图、复制 Mermaid 源码、下载渲染后的 SVG;全屏时按 <kbd>Esc</kbd> 即可退出。
9
25
  - **右上角切换** — 每张图卡片有「图/文案」切换按钮;一条消息中的多个围栏各自独立。
10
26
  - **按围栏记忆** — 切换状态存于 localStorage(以围栏源码为键),刷新页面、重连后保持。
11
27
  - **主题跟随** — 图随 GUI 明暗主题重新渲染。
@@ -21,9 +37,19 @@
21
37
 
22
38
  ## 安装
23
39
 
24
- 两种方式任选其一,装完重启 DSH Web 即生效(当前会话会中断,但 DSH 会话有磁盘持久化,重启后可以恢复)。
40
+ dsh-mermaid-smooth 是 DeepSeek Harness (dsh) Web 界面的插件。使用前请确保你已安装并配置好 dsh 命令行工具及 Web 环境。
41
+
42
+ 四种方式任选其一,装完重启 DSH Web 即生效(当前会话会中断,但 DSH 会话有磁盘持久化,重启后可以恢复)。
43
+
44
+ **方式一:npm 正式包(推荐,最简单)**
45
+
46
+ ```sh
47
+ dsh plugin --profile web add dsh-mermaid-smooth
48
+ ```
49
+
50
+ 安装时无需编译。pnpm 可能会自动把该包加进 profile 的 `pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude`(因为包刚发布)——这是预期行为,无副作用。
25
51
 
26
- **方式一:从 GitHub 安装(固定到指定提交)**
52
+ **方式二:从 GitHub 安装(固定到指定提交)**
27
53
 
28
54
  ```sh
29
55
  dsh plugin --profile web add 'github:gitByteFree/dsh-mermaid-smooth#<40位commit>'
@@ -31,7 +57,15 @@ dsh plugin --profile web add 'github:gitByteFree/dsh-mermaid-smooth#<40位commit
31
57
 
32
58
  固定到你想装的 commit(如仓库提交历史页显示的 main HEAD),之后 main 的新改动不会静默改变已安装代码。源码安装时会在本机构建(`prepare` 脚本执行 esbuild 打包),需要 git 与 Node.js ≥ 20。
33
59
 
34
- **方式二:克隆后从本地路径安装(开发迭代)**
60
+ **方式三:从 Release tarball 安装(离线 / 不便走 git 的环境)**
61
+
62
+ 从本仓库 [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) 下载 `dsh-mermaid-smooth-<版本>.tgz`(内含构建好的 `lib/client.js`,安装时无需执行任何 prepare 脚本),然后:
63
+
64
+ ```sh
65
+ dsh plugin --profile web add ./dsh-mermaid-smooth-<版本>.tgz
66
+ ```
67
+
68
+ **方式四:克隆后从本地路径安装(开发迭代)**
35
69
 
36
70
  ```sh
37
71
  git clone git@github.com:gitByteFree/dsh-mermaid-smooth.git