drawui-core 0.4.0 → 0.4.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 CHANGED
@@ -61,6 +61,21 @@ interface EditorOptions {
61
61
 
62
62
  ## 更新日志
63
63
 
64
+ ### v0.4.1
65
+
66
+ - 📊 **新增图形「表格」(`table`)**:工具栏独立按钮 + 8×6 选择器一键插入,双击单元格就地编辑。
67
+ - **飞书式交互**:表格内拖拽 = 框选单元格(拖到表格外自动扩成整行 / 整列),只有左上角六点把手能移动整张表;选区浅蓝高亮,点合并块内任意一格即选中整块。
68
+ - **合并 / 拆分**:选区永远吸附完整合并块(不会再出现「选左边却合并右边」),合并**保留全部单元格内容**(按行优先拼接),拆分一次拆掉选区内所有合并区。
69
+ - **插入 / 删除行列可指定位置**:`insertTableRowRelative` / `insertTableColumnRelative`(`above` / `below` / `left` / `right`)、`deleteTableRowsInSelection` / `deleteTableColsInSelection`;插入的行列继承邻居的样式(底色 / 加粗 / 字号 / 对齐 / 文字色)与列宽行高,删除按选区批量进行且只占一步撤销。
70
+ - **单元格文字自动换行 + 行高按内容增高**:画布与 SVG / PNG 导出共用同一套折行规则;增删行列表格左上角保持不动。
71
+ - 表格缩放自动等比拉伸列宽 / 行高,撤销重做完整支持(一个编辑会话 = 一个撤销点)。
72
+ - ✨ **体验优化**:
73
+ - 网格线对齐到物理像素,非 100% 缩放不再出现摩尔纹「发花」。
74
+ - 悬停弹出的「全文提示块」只在文字真的被截断时出现,显示得下就不再打扰。
75
+ - 撤销粒度修正:连续编辑多个单元格后撤销,只回退最后一个编辑会话,不会一路退到第一次编辑之前。
76
+ - 界面文字不再被拖蓝选中复制(状态栏 / 工具栏 / 小地图等),输入框不受影响。
77
+ - 🐞 **UML 修复**:行文字统一由 `uml.ts` 生成(画布 / SVG 导出 / 尺寸计算同源,`umlAttrRowText` / `umlMethodRowText` 已导出);整行可自由删除(连可见性符号 `+ - # ~` 一起删),删空即空白、不会自己长回预设文字;就地编辑不再「删到冒号就删不动」。
78
+
64
79
  ### v0.4.0
65
80
 
66
81
  - 💾 **新增 `exportJSON()` / `importJSON()`**:把**完整文档**(全部图形 + 相机位置 + 版本号)序列化 / 反序列化,宿主可用它实现「导出数据 → 下次导入继续绘制」的跨会话存档;`exportJSON()` 返回带版本号的 JSON 数据,`importJSON()` 校验格式后整体恢复(含相机),非法数据返回失败结果、不破坏现有文档。
@@ -211,6 +226,21 @@ interface EditorOptions {
211
226
 
212
227
  ## Changelog
213
228
 
229
+ ### v0.4.1
230
+
231
+ - 📊 **New `table` shape**: insert one from its own toolbar button with an 8×6 picker, then double-click any cell to edit in place.
232
+ - **Feishu-style interaction**: dragging inside the table selects a cell range (dragging past the edge extends it to full rows / columns); only the six-dot handle at the top-left moves the whole table. The selection is highlighted in light blue, and clicking any cell inside a merged block selects the entire block.
233
+ - **Merge / split**: the selection always snaps to whole merged blocks (no more "selected the left, merged the right"), merging **keeps every cell's text** (joined row-major) and splitting clears all merged blocks in the selection.
234
+ - **Insert / delete rows & columns at a chosen position**: `insertTableRowRelative` / `insertTableColumnRelative` (`above` / `below` / `left` / `right`) and `deleteTableRowsInSelection` / `deleteTableColsInSelection`. Inserted rows / columns inherit their neighbour's style (fill / bold / font size / align / text color) and width / height; deletion is a single undo step.
235
+ - **Cell text wraps and rows grow to fit** — canvas and SVG / PNG export share the same wrapping rules. Adding or removing rows / columns keeps the table's top-left corner anchored.
236
+ - Resizing scales column widths and row heights proportionally; undo / redo fully supported (one editing session = one undo step).
237
+ - ✨ **Experience polish**:
238
+ - Grid lines snap to physical pixels, so non-100% zoom levels no longer show moiré artifacts.
239
+ - The hover "full text" tooltip now appears **only when the text is actually truncated**.
240
+ - Undo granularity fixed: after editing several cells in a row, undo rolls back just the last editing session.
241
+ - UI text can no longer be accidentally selected / copied (status bar, toolbar, minimap); inputs are unaffected.
242
+ - 🐞 **UML fixes**: row text is now produced by `uml.ts` only (canvas, SVG export and size calculation share `umlAttrRowText` / `umlMethodRowText`, both exported). A whole row can be deleted freely — including the visibility marker `+ - # ~` — and an emptied row stays empty instead of growing the preset text back. In-place editing no longer gets stuck at the colon.
243
+
214
244
  ### v0.4.0
215
245
 
216
246
  - 💾 **New `exportJSON()` / `importJSON()`**: serialize / restore the **full document** (all shapes + camera + version). Hosts can use them for cross-session persistence ("export data now, import and keep drawing later"). `exportJSON()` returns versioned JSON; `importJSON()` validates and restores everything (camera included) — invalid input fails cleanly without touching the current document.