ice-render 1.4.10 → 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/README.md +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/types/ICE.d.mts +32 -11
- package/dist/types/ICE.d.ts +32 -11
- package/dist/types/consts/COMPONENT_TYPE_MAPPING.d.mts +12 -29
- package/dist/types/consts/COMPONENT_TYPE_MAPPING.d.ts +12 -29
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/persistence/Serializer.d.mts +9 -0
- package/dist/types/persistence/Serializer.d.ts +9 -0
- package/dist/types/plugin/PluginHost.d.mts +6 -2
- package/dist/types/plugin/PluginHost.d.ts +6 -2
- package/dist/types/util/type-id.d.mts +19 -0
- package/dist/types/util/type-id.d.ts +19 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -87,12 +87,12 @@ ICERender 是一款 **Canvas 2D 交互图形渲染引擎**,面向 ER 图 / 流
|
|
|
87
87
|
|
|
88
88
|
**扩展与可访问性**
|
|
89
89
|
|
|
90
|
-
- **插件机制** —— `ICE.use(plugin)`
|
|
90
|
+
- **插件机制** —— `ICE.use(plugin)` 开放三层注册点:自定义图元类型(`components` 的键是 canonical typeId,形如 `'my-app:Badge'`,格式非法或与已注册类型冲突会明确抛错;自动获得 typeId 反查,因此可序列化)、每帧渲染回调、自定义交互工具。
|
|
91
91
|
- **无障碍原语** —— `getAccessibilityTree()` 产出可访问节点快照(角色 / 可读名称 / 屏幕坐标盒 / tab 顺序),`setFocusedComponent()` 让键盘事件派发给焦点组件。**引擎不自建 DOM 镜像层**:镜像结构、ARIA 与文案由应用层决定(参考实现见 `examples/a11y/`)。
|
|
92
92
|
|
|
93
93
|
**序列化与动画**
|
|
94
94
|
|
|
95
|
-
- **整图序列化** —— 组件树可序列化为 JSON 字符串并无损反序列化;类型键用**稳定 typeId
|
|
95
|
+
- **整图序列化** —— 组件树可序列化为 JSON 字符串并无损反序列化;类型键用**稳定 typeId**(格式为 `namespace:Type`,如 `ice-render:Rect`、`ice-chart:PlotArea`;由构造函数反查得到,与类的 JS 名解耦,压缩改名不影响已存数据),带 `version` 字段与可扩展迁移表;未注册类型跳过并记录而不是整份数据打不开。自定义组件用 `registerType('my-app:Badge', Badge)` 注册后才能持久化与加载 —— **同一个 typeId 注册不同构造函数、或同一个构造函数注册第二个 typeId 都会明确抛错**,不再静默覆盖。
|
|
96
96
|
- **关键帧动画** —— 动画配置类似 CSS `keyframes`:单段 `{ from, to, duration }` 或
|
|
97
97
|
多段 `{ keyframes: [{ offset, value, easing? }], duration }`(`easing` 写在段起始帧上,只作用于该段;
|
|
98
98
|
`offset` 缺省按顺序均分、超界夹紧)。内置线性 / 缓入 / 缓出等缓动函数与**弹簧类缓动**
|