jsmind 0.9.1 → 2.0.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/LICENSE +2 -2
- package/README.md +78 -67
- package/README.zh.md +81 -0
- package/dist/cli.js +4482 -0
- package/dist/cli.js.map +1 -0
- package/dist/jsmind.cjs +4101 -0
- package/dist/jsmind.cjs.map +1 -0
- package/dist/jsmind.d.ts +1269 -0
- package/dist/jsmind.js +4099 -0
- package/dist/jsmind.js.map +1 -0
- package/dist/jsmind.umd.js +4107 -0
- package/dist/jsmind.umd.js.map +1 -0
- package/package.json +65 -51
- package/es6/README-en.md +0 -37
- package/es6/README.md +0 -34
- package/es6/jsmind.draggable-node.js +0 -9
- package/es6/jsmind.draggable-node.js.map +0 -1
- package/es6/jsmind.js +0 -9
- package/es6/jsmind.js.map +0 -1
- package/es6/jsmind.screenshot.js +0 -9
- package/es6/jsmind.screenshot.js.map +0 -1
- package/style/jsmind.css +0 -408
- package/types/generated/index.d.ts +0 -8
- package/types/generated/jsmind.common.d.ts +0 -66
- package/types/generated/jsmind.d.ts +0 -366
- package/types/generated/jsmind.data_provider.d.ts +0 -56
- package/types/generated/jsmind.dom.d.ts +0 -59
- package/types/generated/jsmind.format.d.ts +0 -100
- package/types/generated/jsmind.graph.d.ts +0 -180
- package/types/generated/jsmind.layout_provider.d.ts +0 -182
- package/types/generated/jsmind.mind.d.ts +0 -121
- package/types/generated/jsmind.node.d.ts +0 -62
- package/types/generated/jsmind.option.d.ts +0 -64
- package/types/generated/jsmind.plugin.d.ts +0 -21
- package/types/generated/jsmind.shortcut_provider.d.ts +0 -52
- package/types/generated/jsmind.util.d.ts +0 -26
- package/types/generated/jsmind.view_provider.d.ts +0 -347
- package/types/generated/plugins/jsmind.draggable-node.d.ts +0 -229
- package/types/generated/plugins/jsmind.screenshot.d.ts +0 -83
- package/types/tsconfig.declaration.json +0 -19
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2024-2026, ZHANG ZHIGANG <hizzgdev@163.com>
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -11,7 +11,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
版权所有 (c)
|
|
14
|
+
版权所有 (c) 2024-2026, 张志刚 <hizzgdev@163.com>
|
|
15
15
|
保留一切权利。
|
|
16
16
|
|
|
17
17
|
在满足下列条件的前提下,授予使用者使用及再发布本软件的源代码或二进制形式的权利,无论是否修改皆然:
|
package/README.md
CHANGED
|
@@ -1,74 +1,85 @@
|
|
|
1
|
-
# jsMind
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
# jsMind V2
|
|
2
|
+
|
|
3
|
+
A mind-map kernel designed for AI agents — agents can reliably create, read, and modify structured maps; people can view, edit, and export them.
|
|
4
|
+
|
|
5
|
+
[Documentation](https://github.com/hizzgdev/jsmind-v2/blob/master/docs/README.md) · [Playground](https://hizzgdev.github.io/jsmind-v2/playground.html) · [Skill](skills/jsmind/SKILL.md)
|
|
6
|
+
|
|
7
|
+
中文说明见 [README.zh.md](README.zh.md)。
|
|
8
|
+
|
|
9
|
+
<!-- Both the documentation and playground links are absolute, and both leave
|
|
10
|
+
the repository.
|
|
11
|
+
Docs stay on GitHub rather than being published as a site: they can be
|
|
12
|
+
searched, blamed and edited there, and rendering them to HTML would mean
|
|
13
|
+
maintaining a markdown build step for a project whose site is one page.
|
|
14
|
+
The documentation link points at docs/README.md, the public docs index,
|
|
15
|
+
not the whole historical docs/ tree.
|
|
16
|
+
The playground only exists on the published site - it is copied there from
|
|
17
|
+
example/ with its script path rewritten during deployment - so a relative
|
|
18
|
+
link would 404 when this README is read on GitHub. -->
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm i jsmind@2
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This is the 2.x line (npm tag `v2-preview`), a rewrite. It is not a drop-in replacement for v1 yet. `npm i jsmind` still installs v1 (0.9.x).
|
|
27
|
+
|
|
28
|
+
To build and run the CLI from this repository you need Node.js >= 22.12.0:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/hizzgdev/jsmind-v2.git
|
|
32
|
+
cd jsmind-v2
|
|
33
|
+
npm install
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
From the repository root, run the local CLI with `npx jsmind` or `node dist/cli.js`. The commands below use `npx jsmind`; `node dist/cli.js` is equivalent.
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
Create a map, read the root id from `context`, add a child, validate, and export a PNG:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
$ npx jsmind create tmp/hello.json --title "Hello"
|
|
45
|
+
created tmp/hello.json
|
|
46
|
+
|
|
47
|
+
$ npx jsmind context tmp/hello.json
|
|
48
|
+
root Hello {side=center}
|
|
49
|
+
|
|
50
|
+
$ npx jsmind mind add-child tmp/hello.json --parent-id root --text "World"
|
|
51
|
+
added jm-mwh96wk6 under root
|
|
52
|
+
|
|
53
|
+
$ npx jsmind validate tmp/hello.json
|
|
54
|
+
tmp/hello.json: valid
|
|
55
|
+
|
|
56
|
+
$ npx jsmind export tmp/hello.json tmp/hello.png
|
|
57
|
+
tmp/hello.png: 2400x1600 (85.0 KB)
|
|
48
58
|
```
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
The root id in this example is `root`. Child ids are generated; when you run these commands, use the ids from your current `context` output, and do not copy example ids.
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
Public product docs are in [`docs/`](https://github.com/hizzgdev/jsmind-v2/blob/master/docs/README.md):
|
|
65
|
+
|
|
66
|
+
- Features — [serialization](docs/features/serialization.md), [image export](docs/features/image-export.md), [node content](docs/features/node-content.md), and [node move](docs/features/node-move.md)
|
|
67
|
+
- [Architecture](docs/architecture/architecture-overview.md) — design notes on why the system is built this way, **not** a getting-started handbook
|
|
68
|
+
- [Data format](docs/requirements/v2-data-format.md) — on-disk schema, validation rules, and error codes
|
|
69
|
+
- [CLI](docs/requirements/v2-cli.md) — command structure and exit-code contract
|
|
70
|
+
|
|
71
|
+
## Playground
|
|
72
|
+
|
|
73
|
+
Try the library in the [Playground](https://hizzgdev.github.io/jsmind-v2/playground.html).
|
|
74
|
+
|
|
75
|
+
## Skill
|
|
51
76
|
|
|
52
|
-
|
|
53
|
-
- [文档 - Documents](https://hizzgdev.github.io/jsmind/docs)
|
|
54
|
-
- [NPM - jsmind](https://www.npmjs.com/package/jsmind)
|
|
55
|
-
- CDN - [用法](docs/zh/1.usage.md) [Usage](docs/en/1.usage.md)
|
|
56
|
-
- [UNPKG](https://unpkg.com/browse/jsmind/)
|
|
57
|
-
- [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/)
|
|
58
|
-
- [jsDelivr 国内镜像](https://jsd.onmicrosoft.cn/npm/jsmind/)
|
|
59
|
-
- Apps :
|
|
60
|
-
- <https://jsmind.online>
|
|
61
|
-
- Demo :
|
|
62
|
-
- [显示一个脑图 Render a mindmap](https://hizzgdev.github.io/jsmind/example/1_basic.html) [[国内版](https://hizzgdev.github.io/jsmind/example/1_basic_cn.html)]
|
|
63
|
-
- [试用所有功能 Try all features](https://hizzgdev.github.io/jsmind/example/2_features.html) [[国内版](https://hizzgdev.github.io/jsmind/example/2_features_cn.html)]
|
|
64
|
-
- [requirejs + jsMind](https://hizzgdev.github.io/jsmind/example/3_requirejs.html)
|
|
65
|
-
- [更多示例 - More samples](https://github.com/hizzgdev/jsmind-samples) [[国内版](https://gitee.com/hizzgdev/jsmind-samples)]
|
|
77
|
+
The jsmind skill for drawing or editing a map with the CLI: [`skills/jsmind/SKILL.md`](skills/jsmind/SKILL.md). A Chinese copy is in [`SKILL.zh.md`](skills/jsmind/SKILL.zh.md).
|
|
66
78
|
|
|
67
|
-
##
|
|
79
|
+
## Development
|
|
68
80
|
|
|
69
|
-
|
|
70
|
-
- [资助 - Sponsor](https://hizzgdev.github.io/sponsor.html)
|
|
81
|
+
How to work in this repository — environment, layout, branch and PR conventions, and commands — is in [`AGENTS.md`](AGENTS.md).
|
|
71
82
|
|
|
72
|
-
##
|
|
83
|
+
## License
|
|
73
84
|
|
|
74
|
-
|
|
85
|
+
This project is open source under the [BSD 3-Clause License](LICENSE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# jsMind V2
|
|
2
|
+
|
|
3
|
+
为 AI agent 设计的思维导图内核 —— agent 能可靠地生成、读取、修改结构化的脑图数据,人能查看、编辑、导出。
|
|
4
|
+
|
|
5
|
+
[文档](https://github.com/hizzgdev/jsmind-v2/blob/master/docs/README.md) · [Playground](https://hizzgdev.github.io/jsmind-v2/playground.html) · [Skill](skills/jsmind/SKILL.zh.md)
|
|
6
|
+
|
|
7
|
+
English version: [README.md](README.md).
|
|
8
|
+
|
|
9
|
+
<!-- 文档和 Playground 都使用绝对链接,都会离开本仓库。
|
|
10
|
+
文档留在 GitHub 上,不单独做成站点:方便在仓库里搜索、blame 和编辑;
|
|
11
|
+
为只有一页的项目维护一套 markdown 构建流程并不值得。
|
|
12
|
+
文档链接指向 docs/README.md(对外文档索引),而不是历史上整棵混杂的 docs/ 目录。
|
|
13
|
+
Playground 只存在于发布后的站点 —— 部署时从 example/ 复制并改写脚本路径 ——
|
|
14
|
+
所以本 README 在 GitHub 上阅读时,相对链接会 404。 -->
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i jsmind@2
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
这是 2.x 预览线(npm tag 为 `v2-preview`),是一次重写,目前还不是 v1 的替代品。`npm i jsmind` 仍然会安装 v1(0.9.x)。
|
|
23
|
+
|
|
24
|
+
从本仓库构建并运行 CLI 需要 Node.js >= 22.12.0:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/hizzgdev/jsmind-v2.git
|
|
28
|
+
cd jsmind-v2
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
在仓库根目录,用 `npx jsmind` 或 `node dist/cli.js` 运行本地 CLI。下面的命令使用 `npx jsmind`;`node dist/cli.js` 效果相同。
|
|
34
|
+
|
|
35
|
+
## 快速上手
|
|
36
|
+
|
|
37
|
+
创建一张图,用 `context` 拿到根节点 id,添加子节点,校验,再导出 PNG:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
$ npx jsmind create tmp/hello.json --title "Hello"
|
|
41
|
+
created tmp/hello.json
|
|
42
|
+
|
|
43
|
+
$ npx jsmind context tmp/hello.json
|
|
44
|
+
root Hello {side=center}
|
|
45
|
+
|
|
46
|
+
$ npx jsmind mind add-child tmp/hello.json --parent-id root --text "World"
|
|
47
|
+
added jm-mwh96wk6 under root
|
|
48
|
+
|
|
49
|
+
$ npx jsmind validate tmp/hello.json
|
|
50
|
+
tmp/hello.json: valid
|
|
51
|
+
|
|
52
|
+
$ npx jsmind export tmp/hello.json tmp/hello.png
|
|
53
|
+
tmp/hello.png: 2400x1600 (85.0 KB)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
这个示例里的根节点 id 是 `root`。子节点 id 是生成的;执行时请使用当前 `context` 输出的 id,不要照抄示例 id。
|
|
57
|
+
|
|
58
|
+
## 文档
|
|
59
|
+
|
|
60
|
+
对外产品文档在 [`docs/`](https://github.com/hizzgdev/jsmind-v2/blob/master/docs/README.md):
|
|
61
|
+
|
|
62
|
+
- 功能说明 — [序列化](docs/features/serialization.md)、[图片导出](docs/features/image-export.md)、[节点内容](docs/features/node-content.md)、[节点移动](docs/features/node-move.md)
|
|
63
|
+
- [设计说明](docs/architecture/architecture-overview.md) — 解释系统为什么是现在这样,**不是**上手手册
|
|
64
|
+
- [数据格式](docs/requirements/v2-data-format.md) — 磁盘格式、校验规则与错误码
|
|
65
|
+
- [CLI](docs/requirements/v2-cli.md) — 命令结构与退出码契约
|
|
66
|
+
|
|
67
|
+
## Playground
|
|
68
|
+
|
|
69
|
+
在 [Playground](https://hizzgdev.github.io/jsmind-v2/playground.html) 里试用。
|
|
70
|
+
|
|
71
|
+
## Skill
|
|
72
|
+
|
|
73
|
+
用 CLI 画图或改图时使用的 jsmind skill:[`skills/jsmind/SKILL.zh.md`](skills/jsmind/SKILL.zh.md)。英文版见 [`SKILL.md`](skills/jsmind/SKILL.md)。
|
|
74
|
+
|
|
75
|
+
## 开发
|
|
76
|
+
|
|
77
|
+
如何改这个仓库(环境、目录、分支与 PR 约定、常用命令)见 [`AGENTS.md`](AGENTS.md)。
|
|
78
|
+
|
|
79
|
+
## 开源协议
|
|
80
|
+
|
|
81
|
+
本项目以 [BSD 3-Clause License](LICENSE) 开源。
|