@hankchen/canvas-editor 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HankChen
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 ADDED
@@ -0,0 +1,15 @@
1
+ # @hankchen/canvas-editor
2
+
3
+ headless 编辑器内核:observable store、immer patches 双栈撤销、工具状态机、选择/视口/命中/吸附/物化状态机/剪贴板。唯一 API 是 `EditorSession` 门面(根 barrel 单出口,刻意不开子路径导出)。
4
+
5
+ ## 安装
6
+
7
+ ```sh
8
+ npm install @hankchen/canvas @hankchen/canvas-editor
9
+ ```
10
+
11
+ 运行时依赖仅 `immer`;与 UI 框架解耦——Vue 绑定见 [@hankchen/canvas-editor-vue](https://www.npmjs.com/package/@hankchen/canvas-editor-vue),浏览器渲染后端见 [@hankchen/canvas-browser-renderer](https://www.npmjs.com/package/@hankchen/canvas-browser-renderer)。
12
+
13
+ ## 依赖边界
14
+
15
+ 内核只依赖 `@hankchen/canvas`(文档模型)与 `@hankchen/canvas-browser-renderer`(视口感知后端类型),由 dependency-cruiser 在 CI 锁死;宿主不得绕过内核直连底层包(再出口收在根 barrel)。