@huoweifang/dsh-mindmap 0.0.0-stage → 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/CHANGELOG.md +39 -0
- package/LICENSE +21 -0
- package/README.md +89 -2
- package/README.zh-CN.md +90 -0
- package/cordis.patch.yml +7 -0
- package/icon.svg +12 -0
- package/lib/client.js +229 -0
- package/lib/index.js +1190 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +81 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
Data safety
|
|
6
|
+
- Backups are kept per kind (daily 14, manual 10, pre-restore 5, purge 5); the daily snapshot is taken before the first write of the day.
|
|
7
|
+
- Restore is atomic (staged in `docs.new/`, swapped, recovered on startup if interrupted).
|
|
8
|
+
- Trash keeps documents for 30 days, then purges them automatically; "Empty trash" added. Permanent deletes take a coalesced backup first.
|
|
9
|
+
- Requests are checked for a loopback `Host` and same-origin `Origin`; body limits are per route (save 32 MB, restore 64 MB, other 1 MB); server errors no longer echo internal messages.
|
|
10
|
+
- Quarantined (corrupt) files are listed in the backup panel; warnings are shown once.
|
|
11
|
+
- Changes in another tab or window are picked up (BroadcastChannel + refetch on focus); a save conflict offers 载入对方版本 / 保留我的 / 另存为副本.
|
|
12
|
+
- Import refuses trees deeper than 200 levels; tree code is iterative (no stack overflow on very deep documents).
|
|
13
|
+
|
|
14
|
+
Formats
|
|
15
|
+
- OPML: attributes containing `>` parse correctly; `_note` is imported and exported.
|
|
16
|
+
- Markdown: node notes round-trip as quote lines; fenced code blocks and paragraphs under headings become notes.
|
|
17
|
+
|
|
18
|
+
Outline
|
|
19
|
+
- Node notes, find and replace, #tag filter, row selection with batch operations, structured copy/paste, mark toggles, visual-line ↑/↓, shortcut panel (Ctrl+/), status bar with node / character / to-do counts.
|
|
20
|
+
- Enter on an empty last child outdents it; Backspace at the start merges more predictably; Alt+↑/↓ can move across parents.
|
|
21
|
+
- Undo merges typing for at most 3 s; folding is no longer an undo step; undo zooms out when the restored node is outside the focused subtree.
|
|
22
|
+
|
|
23
|
+
Mind map
|
|
24
|
+
- Two-sided balanced layout (toggle 两侧 / 向右), branch colours, tapered main branches, long-text ellipsis, done styling.
|
|
25
|
+
- Keyboard editing on the map (Tab / Enter / Delete / F2 / Space / arrows), drag to reparent, Esc on a new empty node removes it.
|
|
26
|
+
- Much faster on large documents (culling, memoised layout); fit keeps text readable; export checks canvas limits and offers SVG instead.
|
|
27
|
+
|
|
28
|
+
Documents
|
|
29
|
+
- Nested folders, drag and drop of documents and folders, sorting (recent / title / created), hover ⋯ menu, Alt+1…9 for favorites, undo toast after moving to trash, trash preview.
|
|
30
|
+
- New document from pasted Markdown.
|
|
31
|
+
- Dialogs trap focus; menus return focus to their opener; narrow windows move secondary buttons into 更多.
|
|
32
|
+
|
|
33
|
+
## 0.1.0
|
|
34
|
+
|
|
35
|
+
- First public release. npm package `@huoweifang/dsh-mindmap`, plugin id `dsh-mindmap`.
|
|
36
|
+
- Outline editor: unlimited levels, keyboard editing, drag and drop, focus mode, undo/redo, checkboxes, inline Markdown.
|
|
37
|
+
- Mind-map view over the same document: collapse, zoom, pan, fit, edit in place.
|
|
38
|
+
- Documents: folders, favorites, trash, search, Markdown/OPML import and export, PNG/SVG export.
|
|
39
|
+
- Local storage under `~/.dsh/dsh-mindmap` with atomic writes, autosave and daily backups.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Weifang Huo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-mindmap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Outline notes with a live mind-map view for the [DeepSeek Harness](https://github.com/deepseek-ai) (DSH) web GUI. Both views edit the same document. Everything is stored locally: no account, no cloud, no AI, no runtime dependencies.
|
|
4
|
+
|
|
5
|
+
[简体中文](README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
| Outline | Mind map (dark) |
|
|
8
|
+
|---|---|
|
|
9
|
+
|  |  |
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Outline** — unlimited levels; Enter splits/creates a sibling, Alt+Enter inserts a line break, Shift+Enter adds a note, Tab / Shift+Tab indent / outdent, Backspace deletes an empty node or merges with the previous one, Delete merges the next one, ↑/↓ move across nodes, Alt+↑/↓ move a node, Ctrl+. collapse, Ctrl+Enter toggle done, Alt+→ focus a subtree (breadcrumb to go back), Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y undo/redo. Drag the bullet to reorder or change level. Multi-line paste becomes a tree. Inline Markdown (bold, italic, strikethrough, code, links, #tags) and checkboxes. Find and replace (Ctrl+F), #tag filter, Esc selects rows for batch indent / move / delete / copy. Press Ctrl+/ for all shortcuts. IME composition is never intercepted.
|
|
14
|
+
- **Mind map** — two-sided or right-only tree with coloured branches, collapse/expand, Ctrl+wheel zoom (20%–300%), drag to pan, center / fit / 100%, double-click or F2 to edit, Tab adds a child, Enter adds a sibling, arrows move between nodes, drag a node to reparent it.
|
|
15
|
+
- **Documents** — create, rename, trash and restore, nested folders with drag and drop, favorites (Alt+1…9), sorting, last-edited time, search across titles, node text and notes; trash is emptied automatically after 30 days.
|
|
16
|
+
- **Import / export** — import Markdown and OPML; export Markdown, OPML, PNG and SVG (whole document or the focused subtree).
|
|
17
|
+
- **Storage** — autosave 800 ms after typing stops and immediately on document switch / page hide; atomic writes; revision-based conflict detection; daily automatic backups (14 kept), manual backup, download and atomic restore; edits in another tab are picked up automatically.
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- DSH `>=0.2.2-rc.1 <0.3.0` (declared in `engines.dsh`; DSH checks it at install and at profile start)
|
|
22
|
+
- The web GUI (the page is a web client plugin)
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
Replace `desktop` with your profile name. `dsh plugin --profile <name> ...` forwards the arguments to pnpm inside that profile.
|
|
27
|
+
|
|
28
|
+
From npm (published as the scoped package `@huoweifang/dsh-mindmap`; the plugin itself is named `dsh-mindmap`):
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
dsh plugin --profile desktop add @huoweifang/dsh-mindmap
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
From GitHub (pin a tag; `lib/` is committed, so no build step runs on install):
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
dsh plugin --profile desktop add github:IsaacHuo/dsh-mindmap#v0.2.0
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Restart DSH. A **思维导图** entry appears in the sidebar.
|
|
41
|
+
|
|
42
|
+
### Update
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
dsh plugin --profile desktop add @huoweifang/dsh-mindmap@latest # npm
|
|
46
|
+
dsh plugin --profile desktop add github:IsaacHuo/dsh-mindmap#v0.2.0 # GitHub
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
npm installs can also be updated from the DSH plugin manager. Restart DSH afterwards.
|
|
50
|
+
|
|
51
|
+
### Uninstall
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
dsh plugin --profile desktop remove @huoweifang/dsh-mindmap
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Uninstalling keeps your documents. Delete the data directory below by hand if you want them gone.
|
|
58
|
+
|
|
59
|
+
## Data and security
|
|
60
|
+
|
|
61
|
+
- Data directory: `~/.dsh/dsh-mindmap/` (or `$DSH_HOME/dsh-mindmap`; override with `DSH_MINDMAP_DIR`). It holds `library.json`, `docs/<id>.json` and `backups/`.
|
|
62
|
+
- Documents are plain, unencrypted JSON. Anyone with access to your user account can read them; don't store secrets.
|
|
63
|
+
- The plugin only registers HTTP routes under `/dsh-mindmap/api` on the DSH web server and inherits its access control. Write requests must be `application/json` (blocks simple cross-site form posts); requests must come from a loopback host with a same-origin `Origin`; bodies are capped per route (save 32 MB, restore 64 MB, others 1 MB); document ids are validated before touching the file system.
|
|
64
|
+
- No network requests, telemetry, agent tools or model calls. Links in notes open only for `http(s)` URLs, and notes are never rendered as HTML.
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npm ci
|
|
70
|
+
npm run typecheck # tsc --noEmit
|
|
71
|
+
npm test # unit tests (node:test)
|
|
72
|
+
npm run build # lib/index.js (host) + lib/client.js (web page)
|
|
73
|
+
npm run pack:check # verify the npm tarball contents
|
|
74
|
+
npm run harness # local test page: real host routes + mocked DSH slots
|
|
75
|
+
npm run e2e # headless end-to-end test (Chromium/Edge via EDGE_PATH)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
To try a working copy in DSH: `dsh plugin --profile <name> add link:<path-to-this-repo>`.
|
|
79
|
+
|
|
80
|
+
The client does not bundle React — the DSH page provides it. `lib/` is committed so GitHub installs work; CI fails if it is out of date, so run `npm run build` before committing.
|
|
81
|
+
|
|
82
|
+
## Release
|
|
83
|
+
|
|
84
|
+
1. Update `version` in `package.json` and `CHANGELOG.md`, run `npm run check`, commit.
|
|
85
|
+
2. `git tag v<version> && git push origin v<version>`.
|
|
86
|
+
3. The Release workflow checks the tag against `package.json`, rebuilds, publishes to npm with provenance (`next` tag for prereleases) and creates a GitHub Release with the tarball. It needs the `NPM_TOKEN` repository secret.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](LICENSE). Not affiliated with DeepSeek or any outliner product; no third-party brand assets are included.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# dsh-mindmap(思维导图)
|
|
2
|
+
|
|
3
|
+
[DeepSeek Harness](https://github.com/deepseek-ai)(DSH)Web 界面插件:大纲笔记 + 思维导图,两种视图编辑同一份文档。数据全部保存在本机:无账号、无云端、无 AI、无运行时依赖。
|
|
4
|
+
|
|
5
|
+
[English](README.md)
|
|
6
|
+
|
|
7
|
+
| 大纲 | 导图(深色) |
|
|
8
|
+
|---|---|
|
|
9
|
+
|  |  |
|
|
10
|
+
|
|
11
|
+
## 功能
|
|
12
|
+
|
|
13
|
+
- **大纲**:无限层级;Enter 拆分 / 新建同级,Alt+Enter 换行,Shift+Enter 添加备注,Tab / Shift+Tab 缩进 / 反缩进,Backspace 删除空节点或与上一行合并,Delete 合并下一行,↑/↓ 跨节点移动,Alt+↑/↓ 移动节点,Ctrl+. 折叠,Ctrl+Enter 完成,Alt+→ 聚焦子树(面包屑返回),Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y 撤销重做;拖动圆点调整顺序或层级;多行粘贴自动生成层级;行内 Markdown(粗体、斜体、删除线、代码、链接、#标签)与复选框;查找替换(Ctrl+F)、#标签筛选,Esc 进入行选择后可批量缩进 / 移动 / 删除 / 复制;Ctrl+/ 查看全部快捷键;输入法组字期间不拦截按键。
|
|
14
|
+
- **导图**:两侧或向右布局、分支配色、折叠 / 展开、Ctrl+滚轮缩放(20%–300%)、拖动平移、居中 / 适应窗口 / 100%;双击或 F2 编辑,Tab 加子节点,Enter 加同级,方向键切换节点,拖动节点改变父级。
|
|
15
|
+
- **文档管理**:新建、重命名、删除到回收站并可恢复、多级文件夹与拖放、收藏(Alt+1…9)、排序、最近编辑时间、搜索标题 / 节点 / 备注;回收站 30 天后自动清空。
|
|
16
|
+
- **导入导出**:导入 Markdown、OPML;导出 Markdown、OPML、PNG、SVG(整篇或聚焦的子树)。
|
|
17
|
+
- **存储**:停止输入 800 ms 后自动保存,切换文档 / 离开页面时立即保存;原子写入;修订号冲突检测;每日自动备份(保留 14 份),可手动备份、下载、原子恢复;其他标签页的修改会自动同步。
|
|
18
|
+
|
|
19
|
+
## 环境要求
|
|
20
|
+
|
|
21
|
+
- DSH `>=0.2.2-rc.1 <0.3.0`(声明在 `engines.dsh`,DSH 在安装和启动 profile 时检查)
|
|
22
|
+
- 使用 Web 界面(页面是 Web 客户端插件)
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
把 `desktop` 换成你的 profile 名。`dsh plugin --profile <名称> ...` 会把参数转给该 profile 内的 pnpm。
|
|
27
|
+
|
|
28
|
+
从 npm 安装(npm 包名为 `@huoweifang/dsh-mindmap`,插件本身名为 `dsh-mindmap`):
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
dsh plugin --profile desktop add @huoweifang/dsh-mindmap
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
从 GitHub 安装(固定到 tag;仓库提交了 `lib/`,安装时不需要构建):
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
dsh plugin --profile desktop add github:IsaacHuo/dsh-mindmap#v0.2.0
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
重启 DSH,侧边栏出现「思维导图」。
|
|
41
|
+
|
|
42
|
+
### 更新
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
dsh plugin --profile desktop add @huoweifang/dsh-mindmap@latest # npm
|
|
46
|
+
dsh plugin --profile desktop add github:IsaacHuo/dsh-mindmap#v0.2.0 # GitHub
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
npm 安装的版本也可以在 DSH 插件管理里更新。更新后重启 DSH。
|
|
50
|
+
|
|
51
|
+
### 卸载
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
dsh plugin --profile desktop remove @huoweifang/dsh-mindmap
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
卸载不会删除文档;如需彻底清除,手动删除下面的数据目录。
|
|
58
|
+
|
|
59
|
+
## 数据与安全
|
|
60
|
+
|
|
61
|
+
- 数据目录:`~/.dsh/dsh-mindmap/`(或 `$DSH_HOME/dsh-mindmap`,可用 `DSH_MINDMAP_DIR` 覆盖),包含 `library.json`、`docs/<id>.json`、`backups/`。
|
|
62
|
+
- 文档是未加密的 JSON 文件,能访问你系统账号的人都能读到,请勿存放机密。
|
|
63
|
+
- 插件只在 DSH Web 服务上注册 `/dsh-mindmap/api` 路由,沿用 DSH 自身的访问控制;写请求必须是 `application/json`(挡住简单的跨站表单提交),请求须来自回环地址且 `Origin` 同源,请求体按路由限制(保存 32 MB、恢复 64 MB、其他 1 MB),文档 id 在访问文件系统前校验。
|
|
64
|
+
- 不发起网络请求、无遥测、不注册 Agent 工具、不调用模型。笔记中的链接只允许 `http(s)`,笔记内容从不作为 HTML 渲染。
|
|
65
|
+
|
|
66
|
+
## 开发
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npm ci
|
|
70
|
+
npm run typecheck # tsc --noEmit
|
|
71
|
+
npm test # 单元测试(node:test)
|
|
72
|
+
npm run build # lib/index.js(宿主)+ lib/client.js(页面)
|
|
73
|
+
npm run pack:check # 检查 npm 包内容
|
|
74
|
+
npm run harness # 本地测试页:真实宿主路由 + 模拟 DSH 插槽
|
|
75
|
+
npm run e2e # 无头端到端测试(Chromium/Edge,路径用 EDGE_PATH 指定)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
在 DSH 里试用工作副本:`dsh plugin --profile <名称> add link:<本仓库路径>`。
|
|
79
|
+
|
|
80
|
+
客户端不打包 React,由 DSH 页面提供。`lib/` 随仓库提交以支持 GitHub 安装;CI 会检查它是否与源码一致,提交前请先 `npm run build`。
|
|
81
|
+
|
|
82
|
+
## 发布
|
|
83
|
+
|
|
84
|
+
1. 修改 `package.json` 的 `version` 和 `CHANGELOG.md`,运行 `npm run check` 后提交。
|
|
85
|
+
2. `git tag v<版本> && git push origin v<版本>`。
|
|
86
|
+
3. Release 工作流校验 tag 与 `package.json` 一致,重新构建,带 provenance 发布到 npm(预发布版用 `next` 标签),并创建附带 tarball 的 GitHub Release。需要仓库 secret `NPM_TOKEN`。
|
|
87
|
+
|
|
88
|
+
## 许可证
|
|
89
|
+
|
|
90
|
+
[MIT](LICENSE)。与 DeepSeek 及任何大纲笔记产品无隶属关系,不含第三方品牌素材。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# dsh-mindmap bundle patch: inserts the plugin row into the profile roster.
|
|
2
|
+
# The node half (exports ".") registers the /dsh-mindmap/api routes on the
|
|
3
|
+
# shared DSH webserver; the dsh.client declaration loads exports "./client"
|
|
4
|
+
# in the web GUI, which registers the 思维导图 sidebar row and main page.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: dsh-mindmap
|
|
7
|
+
name: '@huoweifang/dsh-mindmap'
|
package/icon.svg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#3964fe"/>
|
|
3
|
+
<g fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round">
|
|
4
|
+
<path d="M22 32 C30 32 30 18 38 18"/>
|
|
5
|
+
<path d="M22 32 H38"/>
|
|
6
|
+
<path d="M22 32 C30 32 30 46 38 46"/>
|
|
7
|
+
</g>
|
|
8
|
+
<circle cx="18" cy="32" r="6" fill="#fff"/>
|
|
9
|
+
<rect x="38" y="14" width="14" height="8" rx="4" fill="#fff"/>
|
|
10
|
+
<rect x="38" y="28" width="14" height="8" rx="4" fill="#fff"/>
|
|
11
|
+
<rect x="38" y="42" width="14" height="8" rx="4" fill="#fff"/>
|
|
12
|
+
</svg>
|