diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a2b1dd32..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,40 +0,0 @@ -## Changelog / 变更日志 - -### 2025-08-10 - -- Added - - - Central typings entry `types/index.d.ts` and regenerated declaration files under `types/generated/` for core and plugins (dom, format, graph, layout_provider, mind, node, option, plugin, shortcut_provider, util, view_provider, draggable-node, screenshot). - - Declaration build config `tsconfig.decls.json` and npm scripts: `gen:dts`, `gen:dts:check`. - - TypeScript typings validation: `tests/unit/typescript.types.test.js` with fixture `tests/fixtures/typescript-test.ts` using TypeScript Compiler API. - -- Changed - - - Updated `package.json` to expose `types` via `types/index.d.ts` and added scripts for generating/checking declarations. - - Enriched JSDoc and in-source documentation across core modules and plugins to improve generated typings (data_provider, dom, format, graph, layout_provider, mind, node, option, plugin, util, view_provider, draggable-node, screenshot). - - Updated `tsconfig.json` strictness and paths; CI updated to run `npm run gen:dts` before build and include `gen:dts:check` in install pipeline. - - Dev dependencies refreshed, adding `typescript`, `tsd-jsdoc`, and updating various `@types/*`, jest, jsdoc toolchain packages. - -- Removed - - - Legacy type files under `types/` (`jsmind.d.ts`, `jsmind.draggable-node.d.ts`, `jsmind.screenshot.d.ts`) in favor of `types/generated/`. - -- Notes - - - Running `npm test` now validates both runtime tests and TypeScript definitions. Consumers can rely on the aggregated public typings from the package root; plugin typings are exposed under `plugins/` paths. - -### 2025-08-09 - -- Added - - - TypeScript support: publish `.d.ts` for core and plugins (`es6/jsmind.d.ts`, `es6/jsmind.draggable-node.d.ts`, `es6/jsmind.screenshot.d.ts`). - - Type checking in CI: added Jest test `tests/unit/typescript.types.test.js` using TypeScript Compiler API to verify typings with `tsconfig.json` (noEmit). - -- Changed - - - Updated root `package.json` to expose `types` and proper `exports` fields for typings. - -- Notes - - - The TS example `example/typescript-test.ts` is included in `tsconfig.json#includes` for compile-time verification. - - Running `npm test` will now validate TypeScript definitions. diff --git a/README.md b/README.md index 9f760221..05f1ee61 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ jsMind is mind map library built by javascript, it base on html5 canvas and svg. diff --git a/docs/en/1.usage.md b/docs/en/1.usage.md index 1a45cc41..4cc3e6d9 100644 --- a/docs/en/1.usage.md +++ b/docs/en/1.usage.md @@ -14,22 +14,22 @@ At first, 2 files (jsmind.css and jsmind.js) are required. Here we link to the resources on the CDN. It is recommended to use the latest version. ```html - + - + ``` > CDNs in common use: [UNPKG](https://unpkg.com/jsmind/), [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/), and [the mirror of jsDelivr in China](https://jsd.onmicrosoft.cn/npm/jsmind/). the resource urls would look like: -> - https://unpkg.com/jsmind@0.8.7/es6/jsmind.js -> - https://cdn.jsdelivr.net/npm/jsmind@0.8.7/es6/jsmind.js -> - https://jsd.onmicrosoft.cn/npm/jsmind@0.8.7/es6/jsmind.js +> - https://unpkg.com/jsmind@0.8.8/es6/jsmind.js +> - https://cdn.jsdelivr.net/npm/jsmind@0.8.8/es6/jsmind.js +> - https://jsd.onmicrosoft.cn/npm/jsmind@0.8.8/es6/jsmind.js > > The version number appear in the url of CDN. It's strongly recommended that you also specify the version number in your project to avoid the risks that caused by version upgrades. Access the [jsMind on NPM](https://www.npmjs.com/package/jsmind) to get the latest version number of jsMind. Add script jsmind.draggable-node.js for enabling draggable node feature. ```html - + ``` The second, a div element should be in your HTML as container diff --git a/docs/en/plugin-screenshot.md b/docs/en/plugin-screenshot.md index 6b39094a..b9561c67 100644 --- a/docs/en/plugin-screenshot.md +++ b/docs/en/plugin-screenshot.md @@ -18,16 +18,16 @@ This feature can support to export mind maps as png images. ```html - + - + - + + ``` > 常用的 CDN 有 [UNPKG](https://unpkg.com/jsmind/),[jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/),以及 jsDelivr 的[国内镜像](https://jsd.onmicrosoft.cn/npm/jsmind/)。文件路径大概像这样: -> - https://unpkg.com/jsmind@0.8.7/es6/jsmind.js -> - https://cdn.jsdelivr.net/npm/jsmind@0.8.7/es6/jsmind.js -> - https://jsd.onmicrosoft.cn/npm/jsmind@0.8.7/es6/jsmind.js +> - https://unpkg.com/jsmind@0.8.8/es6/jsmind.js +> - https://cdn.jsdelivr.net/npm/jsmind@0.8.8/es6/jsmind.js +> - https://jsd.onmicrosoft.cn/npm/jsmind@0.8.8/es6/jsmind.js > > 示例中url中都有版本号,强烈建议你在项目里也指明版本号,以避免版本升级给你的项目带来风险。访问 [NPM 上的 jsMind](https://www.npmjs.com/package/jsmind) 可以获取 jsmind 的最新版本号。 如果希望能够通过鼠标拖拽的方式移动节点,需要额外引用 jsmind.draggable-node.js 文件 ```html - + ``` 其次,要为 jsMind 准备一个容器,jsMind 将在这个容器里显示思维导图。可自行定义容器的id、大小及样式。 diff --git a/docs/zh/plugin-screenshot.md b/docs/zh/plugin-screenshot.md index 59c266ca..250ff891 100644 --- a/docs/zh/plugin-screenshot.md +++ b/docs/zh/plugin-screenshot.md @@ -20,16 +20,16 @@ ```html - + - + - + - + + - + + diff --git a/example/2_features_cn.html b/example/2_features_cn.html index d48c004a..f8d6f5f7 100644 --- a/example/2_features_cn.html +++ b/example/2_features_cn.html @@ -7,7 +7,7 @@