dsh-mermaid-smooth 0.2.0 → 0.2.1
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 +26 -3
- package/README.zh.md +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,23 @@ types without adding another charting library:
|
|
|
41
41
|
(zero CDN), and a failed fence keeps its original code with an inline
|
|
42
42
|
error banner. Uninstalling restores the conversation verbatim.
|
|
43
43
|
|
|
44
|
+
## Diagram card toolbar
|
|
45
|
+
|
|
46
|
+
Every card carries an icon toolbar at its top-right; hover an icon for its
|
|
47
|
+
tooltip.
|
|
48
|
+
|
|
49
|
+
| Icon | Action | What it does |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| ↔ | Fit width | Scale the diagram to the card width (the initial state) |
|
|
52
|
+
| ⊙ | Fit diagram | Scale so the entire diagram fits inside the viewport |
|
|
53
|
+
| ⧉ | Copy source | Copy this fence's Mermaid source to the clipboard. The async Clipboard API is used when available, with a hidden-textarea fallback; a brief "Source copied" status confirms success and "Could not copy source" reports failure. |
|
|
54
|
+
| ↓ | Download SVG | Save the rendered diagram as `mermaid-diagram.svg` — a vector file that stays sharp at any zoom level in browsers, docs, and design tools. If the diagram has not finished rendering, a "Diagram is not ready" status appears instead. |
|
|
55
|
+
| `</>` | Diagram / code | Switch between the diagram and its source; the choice is remembered per fence |
|
|
56
|
+
| ⛶ | Fullscreen | Show the diagram full-screen (diagram view only). <kbd>Esc</kbd> exits and focus returns to the fullscreen button. |
|
|
57
|
+
|
|
58
|
+
Toolbar status messages auto-clear after about two seconds and are announced
|
|
59
|
+
to screen readers via `aria-live="polite"`.
|
|
60
|
+
|
|
44
61
|
## Screenshots
|
|
45
62
|
|
|
46
63
|

|
|
@@ -82,15 +99,21 @@ bundle), so git and Node.js ≥ 20 are required.
|
|
|
82
99
|
|
|
83
100
|
**3. From a release tarball (offline / where git is inconvenient)**
|
|
84
101
|
|
|
85
|
-
Download `dsh-mermaid-smooth
|
|
102
|
+
Download `dsh-mermaid-smooth-0.2.0.tgz` from this repo's
|
|
86
103
|
[Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) (it
|
|
87
104
|
contains the prebuilt `lib/client.js`, so no `prepare` script runs at install
|
|
88
|
-
time), then:
|
|
105
|
+
time), then run from the directory you downloaded it to:
|
|
89
106
|
|
|
90
107
|
```sh
|
|
91
|
-
dsh plugin --profile web add ./dsh-mermaid-smooth
|
|
108
|
+
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.0.tgz
|
|
92
109
|
```
|
|
93
110
|
|
|
111
|
+
`0.2.0` above is a real filename, not a placeholder — match the version you
|
|
112
|
+
downloaded and drop any `<...>` brackets (zsh reads a bare `<...>` as input
|
|
113
|
+
redirection and fails with "no such file or directory"). Keep the `./`
|
|
114
|
+
prefix: `dsh plugin add` anchors `./`-relative paths to your current
|
|
115
|
+
directory, while a bare filename would be looked up inside the profile.
|
|
116
|
+
|
|
94
117
|
**4. Local clone (for development)**
|
|
95
118
|
|
|
96
119
|
```sh
|
package/README.zh.md
CHANGED
|
@@ -27,6 +27,21 @@
|
|
|
27
27
|
- **主题跟随** — 图随 GUI 明暗主题重新渲染。
|
|
28
28
|
- **安全离线** — mermaid 以 securityLevel 'strict' 运行(内置消毒、不绑点击事件),引擎打包进插件本体(零 CDN);渲染失败的围栏保留原代码并内联错误条。卸载插件后对话原样还原。
|
|
29
29
|
|
|
30
|
+
## 图表卡片工具栏
|
|
31
|
+
|
|
32
|
+
每张图卡片右上角有一排图标按钮,悬停可见文字提示:
|
|
33
|
+
|
|
34
|
+
| 图标 | 功能 | 说明 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| ↔ | 适应宽度 | 将图缩放到卡片宽度(也是初始状态) |
|
|
37
|
+
| ⊙ | 适应全图 | 缩放到整张图完整显示在视口内 |
|
|
38
|
+
| ⧉ | 复制源码 | 把当前围栏的 Mermaid 源码复制到剪贴板。优先使用异步 Clipboard API,不可用时降级为隐藏 textarea 方案;成功显示「已复制源码」,失败显示「无法复制源码」。 |
|
|
39
|
+
| ↓ | 下载 SVG | 把渲染好的图保存为 `mermaid-diagram.svg` —— 矢量文件,在浏览器、文档、设计工具里任意缩放都不失真。图尚未渲染完成时会显示「图表尚未渲染完成」。 |
|
|
40
|
+
| `</>` | 图 / 文案 | 在图与源码之间切换;按围栏记忆偏好 |
|
|
41
|
+
| ⛶ | 全屏 | 全屏查看图(仅图视图)。<kbd>Esc</kbd> 退出,焦点回到全屏按钮。 |
|
|
42
|
+
|
|
43
|
+
工具栏的状态提示约两秒后自动消失,并通过 `aria-live="polite"` 播报给屏幕阅读器。
|
|
44
|
+
|
|
30
45
|
## 截图
|
|
31
46
|
|
|
32
47
|

|
|
@@ -59,12 +74,14 @@ dsh plugin --profile web add 'github:gitByteFree/dsh-mermaid-smooth#<40位commit
|
|
|
59
74
|
|
|
60
75
|
**方式三:从 Release tarball 安装(离线 / 不便走 git 的环境)**
|
|
61
76
|
|
|
62
|
-
从本仓库 [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) 下载 `dsh-mermaid-smooth
|
|
77
|
+
从本仓库 [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) 下载 `dsh-mermaid-smooth-0.2.0.tgz`(内含构建好的 `lib/client.js`,安装时无需执行任何 prepare 脚本),进入下载目录后执行:
|
|
63
78
|
|
|
64
79
|
```sh
|
|
65
|
-
dsh plugin --profile web add ./dsh-mermaid-smooth
|
|
80
|
+
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.0.tgz
|
|
66
81
|
```
|
|
67
82
|
|
|
83
|
+
命令里的 `0.2.0` 是**真实文件名**,不是占位符 —— 请改成你实际下载的版本,并去掉一切 `<...>` 尖括号(zsh 会把裸的 `<...>` 当作输入重定向,报「没有那个文件或目录」)。保留 `./` 前缀:`dsh plugin add` 只把 `./`、`../` 开头的路径锚定到你当前所在目录,裸文件名会在 profile 目录里查找。
|
|
84
|
+
|
|
68
85
|
**方式四:克隆后从本地路径安装(开发迭代)**
|
|
69
86
|
|
|
70
87
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mermaid-smooth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Render mermaid fences in dsh web chat as diagrams by default with smooth zoom/pan, per-fence diagram/code toggle at top-right, persisted per-fence preference, dark-mode follow, and full offline (bundled engine, zero CDN). DSH 对话 mermaid 围栏默认成图:丝滑缩放拖拽、图右上角图/文案切换、按围栏记忆偏好、明暗主题跟随、引擎本地打包完全离线。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|