1032 Commits

Author SHA1 Message Date
roymondchen
62a2ee6693 feat(editor): 历史记录面板支持点击跳转与回到初始状态
- 单步组头部点击跳转到该步骤;合并组头部点击展开/收起,子步行点击跳转到具体步骤
- 列表底部新增「初始」记录项,可一键回到所有修改之前的状态
- editorService/dataSourceService/codeBlockService 新增 goto API;historyService 暴露 cursor 读取器
2026-05-28 18:52:11 +08:00
roymondchen
0446202ba6 feat(editor): 新增历史记录列表面板
- 新增 history-list 模块(面板、Tab、Bucket、GroupRow 与 composables)
- NavMenu 接入历史记录面板入口
- history/editor/codeBlock/dataSource service 配合面板能力调整
- utils/undo-redo 适配新面板
- 扩展 type.ts 相关类型定义
- 新增 history-list-panel.scss 并在 theme.scss 引入
- 补充 history-list 模块完整单元测试
- playground 同步小幅调整
2026-05-28 17:51:52 +08:00
roymondchen
8dae67769c feat(editor): 数据源与代码块 service 支持 undo/redo
- dataSourceService / codeBlockService 新增 undo / redo / canUndo / canRedo 方法
- undo/redo 内部复用 add / update / remove / setCodeDslByIdSync / deleteCodeDslByIds 写回,
  并强制 doNotPushHistory,借此自动驱动 initService 中的依赖收集链路
  (DepTargetType.DATA_SOURCE / DATA_SOURCE_COND / DATA_SOURCE_METHOD / CODE_BLOCK)
- 更新场景下若 step 带 changeRecords,按 propPath 局部 patch,不冲掉同节点其它无关变更;
  缺省退化为整 schema / 整内容替换
- 补充对应单测与 API 文档
2026-05-28 16:40:49 +08:00
roymondchen
09558fa027 feat(editor): 历史记录接入 changeRecords,undo/redo 按 propPath 局部更新
- 节点 / 数据源 / 代码块的 history step 增加 changeRecords 字段

- editor.update / dataSource.update / codeBlock.setCodeDslById(Sync) 透传 changeRecords 入历史

- applyHistoryOp 的 update 分支:携带 changeRecords 时,按 propPath 从 oldNode/newNode 取值

  构造最小 patch 走 update,不冲掉同节点上其它无关变更;缺省退化为整节点替换

  (覆盖 sort/moveLayer/拖动等纯快照场景)

- editor.update 增加 changeRecordList 形参,多节点场景每个节点单独保留 records;

  use-stage 多选拖动 / 缩放改用 changeRecordList,避免 records 在多节点间共享

- use-code-block-edit.submitCodeBlockHandler 透传 form changeRecords

- 同步更新 editor / dataSource / codeBlock / history service 文档
2026-05-28 16:28:35 +08:00
roymondchen
4c855ba50b feat(editor): 写操作支持 doNotPushHistory 选项以跳过历史记录
- editor/codeBlock/dataSource 的 add/update/delete 等接口新增 doNotPushHistory 选项
- 移除不再使用的 editor-history 工具及其单测
- 修复 layer 节点状态在重建时丢失已有 status 的问题
- 同步更新 service 方法文档,新增 dragto 复现用例
2026-05-28 16:03:29 +08:00
roymondchen
e2c065f90d feat(editor): 代码块与数据源支持按 id 独立的历史记录
- history service 新增 pushCodeBlock/undoCodeBlock/redoCodeBlock
  /canUndoCodeBlock/canRedoCodeBlock 及数据源对称 API
- 按 id 维度各自维护独立 UndoRedo 栈,与页面/节点历史完全解耦
- type 新增 CodeBlockStepValue / DataSourceStepValue 独立类型
- HistoryState 扩展 codeBlockState / dataSourceState 字段
- codeBlockService.setCodeDslByIdSync / deleteCodeDslByIds 自动入历史
- dataSourceService.add / update / remove 自动入历史
- 入栈成功时 emit code-block-history-change / data-source-history-change
- 补充单测共 21 例,更新 history/codeBlock/dataSource 相关文档
2026-05-27 19:50:17 +08:00
roymondchen
a341c7d73e fix(editor): 多选时对多个节点的操作合并入同一条历史记录
- moveToContainer 支持数组形参,多选移动整批只产生一条历史记录

- use-stage 拖动多选元素入容器 / 多选拖动缩放整批合成一次调用

- 右键移动至改走 moveToContainer,避免 remove+add 切成两条历史

- 跳过选中目标节点的分支清理 state.nodes 残留旧引用

- history.push 新增可选 pageId 参数,跨页操作正确落到目标页栈

- pushOpHistory 显式按 step.data.id 入栈,避免跨页操作错配
2026-05-27 19:09:34 +08:00
roymondchen
de94a75803 refactor(editor): 移除 BaseService 废弃的 use/middleware 机制
- 删除已 @deprecated 的 BaseService.use 方法及其 middleware 通道

- 删除 utils/compose.ts 及对应测试(仅服务于 middleware,无其他引用)

- editor.ts 移除 safeOptions/safeParent 兜底,相关方法 options 改用形参默认值

- props.ts fillConfig 的 labelWidth 改为形参默认值,移除 typeof function 兜底

- 同步更新 5 份 service 方法文档,删除 ## use 章节
2026-05-27 18:55:38 +08:00
roymondchen
d01a28ce76 fix(editor): 修复移动到菜单导致节点引用异常的问题 2026-05-27 17:17:43 +08:00
roymondchen
b8b0490260 chore: release v1.8.0-beta.1 2026-05-27 11:27:14 +08:00
roymondchen
ff810d09e4 feat(editor): 数据源字段选择按钮在对比模式与禁用态下禁止切换
- 按钮新增 disabled 绑定 (props.disabled || mForm?.isCompare)

- 抽取 onToggleDataSourceFieldSelectHandler 增加 guard 防御

- 补充对应单元测试
2026-05-26 21:05:01 +08:00
roymondchen
b1193b909e feat(editor): 样式设置器 StyleSetter 支持表单对比模式
- Index.vue 透传 lastValues/isCompare 给各分类子组件,并冒泡 addDiffCount

- pro 下 6 个分类组件接受新 props 并向 MContainer 传递

- Layout/Border 同时将新 props 传递给内部 Box/Border 组件

- components/Border.vue 接受新 props 并冒泡 MContainer 的 addDiffCount

- components/Box.vue 接受 props 以保持接口一致

- 补充单元测试覆盖透传与事件冒泡
2026-05-26 20:59:43 +08:00
roymondchen
540a2716d8 fix(editor): serializeConfig 只去掉对象 key 的引号,避免破坏字符串 value 内的引号 2026-05-26 20:20:51 +08:00
roymondchen
b9a6dd5b84 fix(editor): 修复 root 整体替换时图层面板节点状态残留与组件树闪烁问题 2026-05-26 17:06:45 +08:00
roymondchen
9b65917371 chore: release v1.8.0-beta.0 2026-05-22 16:53:17 +08:00
roymondchen
3d038513e3 feat(editor): 新增 DSL 修改方法的 doNotSwitchPage 选项
在 add / remove / doRemove / sort / paste / alignCenter / moveToContainer
的 options 对象中新增 doNotSwitchPage,与 doNotSelect 合并为同一配置 DslOpOptions,
用于在 DSL 操作(新增 / 删除 / 跨页移动)会引发当前页面切换时跳过该次切换。

- 抽取共用类型 DslOpOptions 到 type.ts 并对外导出
- 新增 editorService.isOnDifferentPage 辅助方法用于跨页判断
- 修复 doUpdate 同步 state.page 时无条件覆盖的问题:只在被更新页就是当前页时才同步引用,避免「更新非当前页」误把编辑器切到该页
- doRemove 中对已删除节点的引用清理与当前页清空逻辑提升为无条件执行,避免 doNotSelect / doNotSwitchPage 跳过后续 select 时 state 持有已删除节点
- 补充对应单元测试与 API 文档

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 16:49:52 +08:00
roymondchen
eb1c5a3ec1 fix(editor): 属性面板 padding 仅作用于最外层表单
为 PropsPanel 顶层 MForm 增加 .m-editor-props-form-panel-form 专属类名,
将原本挂在通用 .tmagic-design-form 上的 padding 与 tab 样式迁移到该类,
避免子组件中嵌套的 .tmagic-design-form 被错误命中。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 15:57:13 +08:00
roymondchen
7eeb9b544e chore: release v1.7.14-beta.3 2026-05-21 16:10:48 +08:00
roymondchen
05e512b1fe feat(editor): 新增 DSL 修改方法的 doNotSelect 选项
- add/remove/sort/alignCenter/moveToContainer/paste 新增 doNotSelect 选项,控制操作后是否自动触发选中变化
- doUpdate/doRemove 改为始终同步当前选中列表中的节点引用,避免 state 持有已被替换/已删除的过期节点
- 顺手修复 doUpdate 在 splice(-1) 时误改最后一个选中项的 bug
- 移除 update/doUpdate 的 selectedAfterUpdate 参数(语义已内化),move 不再暴露无意义的 doNotSelect
- 新增 safeOptions / safeParent 辅助函数,兜底插件机制将 dispatch 注入到形参位置的场景

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 17:20:04 +08:00
roymondchen
297e5cebb0 chore: release v1.7.14-beta.2 2026-05-18 13:35:04 +08:00
roymondchen
f1aedc4ce7 fix(editor): 修复 CodeEditor setValue 时滚动位置与折叠等视图状态丢失
使用 saveViewState/restoreViewState 替代 getPosition/setPosition,并放到
nextTick 中执行,避免被 setAutoHeight 的 setScrollTop(0) 覆盖,导致光标
位置变化时编辑器滚动跳回顶部。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 12:09:45 +08:00
roymondchen
873a51fc87 docs: 升级 VitePress 至 v2 alpha,类型引用改为源码片段同步
- 升级 vitepress 到 ^2.0.0-alpha.17
- vite.optimizeDeps.rolldownOptions.transform.define 迁移至 vite.define 以适配 v2 API
- 同步升级 vitest/rolldown/vue/vite 等周边依赖
- 文档中类型链接统一改为 <<< 片段引用源码 region,避免 commit hash 链接失效
- packages/{core,editor,form-schema,schema,stage} 相关类型加 // #region 锚点
- 移除已废弃的 docs/guide/advanced/tmagic-ui.md 及侧栏入口

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 11:47:03 +08:00
roymondchen
df8790042f feat(editor): 导航菜单支持菜单项溢出收纳,新增 NavMenuColumn 组件
- 抽离每列渲染逻辑为 NavMenuColumn 组件,监听容器宽度
- 容器空间不足时自动隐藏溢出项,并通过更多按钮 Popover 展开
- ToolButton 暴露根元素引用,便于父级测量宽度
- design ButtonProps 新增 bg 属性,用于更多按钮的激活态样式
- 补充 NavMenuColumn / NavMenu / ToolButton 的单元测试

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 19:33:53 +08:00
roymondchen
f13f94ca2d chore: release v1.7.14-beta.1 2026-05-14 19:37:22 +08:00
roymondchen
2ad5101471 fix(editor): 修复 StyleSetter 嵌套场景下 propPath 丢失上下文路径的问题
当 prop 与 name 不一致(如 data.items.0.style)时,原实现固定使用 name 会丢失上下文路径,
改为优先使用 prop,回退到 name,确保 changeRecords 携带完整路径。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 19:17:48 +08:00
roymondchen
ab6918f43d test: 完善测试用例 2026-05-14 15:26:22 +08:00
roymondchen
fd770f76f1 chore: release v1.7.14-beta.0 2026-05-11 17:05:46 +08:00
roymondchen
aab73249d1 feat(editor): 新增 alwaysMultiSelect 配置开启常驻多选模式
新增编辑器配置项 alwaysMultiSelect(默认 false),开启后无需按住 Ctrl/Meta
键,组件树与画布点击即多选;当 disabledMultiSelect=true 时本配置失效。同步
在 stage 层 ActionManager 暴露 setAlwaysMultiSelect 方法用于运行时切换,并
补充组件树/服务/画布的状态联动、文档与单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 16:50:40 +08:00
roymondchen
2475a4f901 feat(editor): 新增"已选组件"面板节点双击事件 layer-node-dblclick 与 beforeLayerNodeDblclick 钩子
- TreeNode/Tree 增加 node-dblclick 事件透传
- LayerPanel 默认双击切换可展开节点的展开/收起状态,并向上抛出 node-dblclick
- Sidebar/Editor 暴露 layer-node-dblclick 事件与 beforeLayerNodeDblclick 拦截钩子
- 补充 props/events 文档

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 16:52:15 +08:00
roymondchen
5af9f6e27a feat(editor): 新增 canDropIn 配置统一控制 layer/stage 拖拽放入行为
支持通过 scene 区分图层树、画布拖动、组件库新增三种场景;
返回 false 阻止放入,返回 Id 可重定向放入目标节点。
layer 场景下若禁用某节点的 inner,其子节点的 before/after 也会被同步禁用以避免被绕过。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 16:38:10 +08:00
roymondchen
d8133629b4 feat(editor): props 服务新增配置/值的批量获取与存在性判断方法
新增 getPropsConfigs、hasPropsConfig、getPropsValues、hasPropsValue 方法,便于外部按类型查询表单配置与初始值。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-08 19:57:06 +08:00
roymondchen
29026be6a0 chore: release v1.7.13-beta.0 2026-05-08 17:47:16 +08:00
roymondchen
7ce640627d feat(editor): 新增 stage-top 插槽用于在画布上方插入自定义元素
ScrollViewer 增加 before 具名插槽,Stage 据此暴露 stage-top 插槽,
经 Workspace、Editor 逐层透传,并补充对应类型定义与文档说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 20:31:25 +08:00
roymondchen
7b870e5908 feat(editor): 面包屑超出父容器 80% 时折叠中间项并对单项打点
- 路径过长时仅保留首项 + ... + 末两项,避免横向溢出工作区
- 单项设置 max-width 并通过内部 span 显示省略号,悬浮 tooltip 展示完整名称
- 通过 ResizeObserver 监听父容器宽度变化实时重测

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 19:20:46 +08:00
roymondchen
a520626ef6 feat(editor): getPropsConfig 支持传入 node 参数并修正 CondOpSelectConfig 类型
- props service 的 getPropsConfig 增加可选 data 参数以传递当前节点信息
- 修正 CondOpSelectConfig 的 type 字段为 'cond-op-select'

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 16:24:17 +08:00
roymondchen
3cde69f6f9 feat(editor): 支持自定义组件树节点是否可展开的判断函数
新增 layerNodeIsExpandable 配置项,业务方可自定义"已选组件"面板中
节点是否显示为可展开形态。同时导出默认实现 defaultIsExpandable 与
类型 IsExpandableFunction 供第三方复用。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 13:53:51 +08:00
roymondchen
bd0c5a7514 chore: release v1.7.13 2026-04-29 15:52:06 +08:00
roymondchen
26efa75ff2 feat(editor): update 支持 selectedAfterUpdate 参数控制是否更新 nodes
Made-with: Cursor
2026-04-28 15:50:03 +08:00
roymondchen
94e58342e5 chore: release v1.7.12 2026-04-24 15:48:55 +08:00
roymondchen
3c41091f96 refactor(form): 重构 table/group-list 目录结构与新增行逻辑
- 将 table 相关文件迁移至 containers/table 与 containers/table-group-list 目录
- 将新增行处理统一上移至 TableGroupList,通过 add 事件触发
- 抽取 TableGroupListCommonConfig 公共配置类型
- useFullscreen 内聚管理 zIndex
- TableColumnConfig 支持 text 作为 label 别名

Made-with: Cursor
2026-04-24 15:45:15 +08:00
roymondchen
407572ee3a chore: release v1.7.11 2026-04-23 20:41:21 +08:00
roymondchen
d7ad63d3a2 refactor(form): 调整 table-group-list 属性透传与切换按钮控制方式
- TableGroupList 新增 showIndex、sortKey、sort 属性透传至 Table
- 切换按钮显示改由 config.enableToggleMode 或组件 prop 控制,Table 不再内置 enableToggleMode
- GroupList 新增 showIndex 属性
- DisplayConds 关闭切换模式
- GroupListConfig.beforeAddRow 返回值去掉 Promise 支持

Made-with: Cursor
2026-04-23 20:38:56 +08:00
roymondchen
e106c081c8 feat(editor): 样式面板布局分组新增透明度配置
closes #675

Made-with: Cursor
2026-04-23 17:08:51 +08:00
roymondchen
b46b571214 feat(editor): 没有参考线时不显示参考线切换按钮
Made-with: Cursor
2026-04-23 15:42:10 +08:00
roymondchen
27bb886054 chore: release v1.7.10 2026-04-13 20:30:30 +08:00
roymondchen
fa09ab0b30 feat(editor): 样式配置添加变形项 2026-04-13 20:04:23 +08:00
roymondchen
31f4d2b4e2 fix(editor): 数据源方法选择器展示所有数据源并支持字段非叶子节点选择
移除 methodsOptions 中过滤无自定义方法数据源的逻辑,因为所有数据源都有内置"设置数据"方法;字段选择增加 checkStrictly 支持选择非叶子节点

Made-with: Cursor
2026-04-09 15:32:35 +08:00
roymondchen
b2888962df style(schema,editor,data-source): 代码块类型定义中content去掉string类型 2026-04-09 15:28:03 +08:00
roymondchen
26dc70d70c fix(editor): 历史记录信息中添加页面信息 2026-04-08 17:19:15 +08:00
roymondchen
99c8274a1e fix(editor): 修复 getTMagicAppPrimise 变量名拼写错误
Made-with: Cursor
2026-04-07 20:30:39 +08:00