drawui-core 0.5.0 → 0.5.1
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 +26 -0
- package/dist/index.cjs +28 -28
- package/dist/index.d.cts +194 -46
- package/dist/index.d.ts +194 -46
- package/dist/index.js +28 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,19 @@ interface EditorOptions {
|
|
|
63
63
|
|
|
64
64
|
## 更新日志
|
|
65
65
|
|
|
66
|
+
### v0.5.1
|
|
67
|
+
|
|
68
|
+
> 主题:**思维导图四方向布局与交互重做**
|
|
69
|
+
|
|
70
|
+
- 🧭 **`MindMapNode` 新增 `direction` 字段**(`'right' | 'left' | 'up' | 'down'`):根节点无方向,子节点继承父方向;`layoutMindMap` 按四方向布局,根节点把子节点按方向分组各自生长。
|
|
71
|
+
- 🧭 **根节点四方向加号**:`handlePosOf` 对根遍历 `MINDMAP_DIRECTIONS` 生成四个 child 加号;非根节点 = 自身方向 child 加号 + 垂直方向 sibling 加号。
|
|
72
|
+
- 🔧 **连线按子节点方向绘制**:`drawMindMapConnections` 与导出 `mindMapSvg` 改用 `to.direction` 取四方向边缘 + 同构贝塞尔曲线,修复此前根节点的 left/up/down 子节点连线从右侧斜穿的 bug。
|
|
73
|
+
- ⚖️ **根节点一级子节点内边对齐**:布局改用孩子自身尺寸定位(`childSize`),一级孩子朝根内边严格对齐,子树尺寸不同也不会错开。
|
|
74
|
+
- 🔒 **拖拽 = 同方向重排序**(非自由拖):`getMindMapNodeSiblings` + `reorderMindMapNodeInTree`,跨方向互不交换;`calcMindMapReorderTarget` 排除被拖节点自身,需拖过邻节点中心才换位。
|
|
75
|
+
- 🟦 **重排落点预览**:`drawMindMapReorderIndicator` 改为与被拖节点等大的虚线圆角占位框。
|
|
76
|
+
- ✋ **点加号不进编辑态**:`addMindMapNodeFromHandle` 不再调 `beginMindMapEdit`,新节点仅成为活动节点 `mindMapSelectedNode`。
|
|
77
|
+
- 新增导出:`MINDMAP_DIRECTIONS`、`effectiveDirection`、`isHorizontalDirection`、`getMindMapNodeSiblings`、`reorderMindMapNodeInTree`、`MindMapDirection`(类型)。
|
|
78
|
+
|
|
66
79
|
### v0.5.0
|
|
67
80
|
|
|
68
81
|
> 主题:**图片上传通道**(OSS / 自建后端友好)
|
|
@@ -249,6 +262,19 @@ interface EditorOptions {
|
|
|
249
262
|
|
|
250
263
|
## Changelog
|
|
251
264
|
|
|
265
|
+
### v0.5.1
|
|
266
|
+
|
|
267
|
+
> Theme: **Mind map four-direction layout & interaction rework**
|
|
268
|
+
|
|
269
|
+
- 🧭 **`MindMapNode` gains a `direction` field** (`'right' | 'left' | 'up' | 'down'`): the root has no direction; children inherit it from their parent. `layoutMindMap` groups the root's children by direction and grows each group independently.
|
|
270
|
+
- 🧭 **Root gets four-direction "+" handles**: `handlePosOf` walks `MINDMAP_DIRECTIONS` for the root; non-root nodes get one child handle (own direction) plus one sibling handle (perpendicular direction).
|
|
271
|
+
- 🔧 **Connections drawn by child direction**: `drawMindMapConnections` and the exported `mindMapSvg` now use `to.direction` for the four-direction edges with isomorphic bézier curves — fixes the previous bug where a root's `left`/`up`/`down` children were wired out from the right edge.
|
|
272
|
+
- ⚖️ **Root's first-level children align on their inner edge**: layout positions children by their own size, so the inner edge facing the root is strictly aligned even when subtrees differ in size.
|
|
273
|
+
- 🔒 **Drag = same-direction reordering** (no free drag): `getMindMapNodeSiblings` + `reorderMindMapNodeInTree`; cross-direction groups never swap. `calcMindMapReorderTarget` excludes the dragged node itself, so a swap only happens once the pointer passes a neighbour's center.
|
|
274
|
+
- 🟦 **Reorder drop preview**: `drawMindMapReorderIndicator` now draws a dashed rounded placeholder the same size as the dragged node.
|
|
275
|
+
- ✋ **Clicking "+" no longer enters text-edit**: `addMindMapNodeFromHandle` no longer calls `beginMindMapEdit`; the new node only becomes the active node (`mindMapSelectedNode`).
|
|
276
|
+
- New exports: `MINDMAP_DIRECTIONS`, `effectiveDirection`, `isHorizontalDirection`, `getMindMapNodeSiblings`, `reorderMindMapNodeInTree`, `MindMapDirection` (type).
|
|
277
|
+
|
|
252
278
|
### v0.5.0
|
|
253
279
|
|
|
254
280
|
> Theme: **Image upload channel** (OSS / custom backend friendly)
|