38 Commits

Author SHA1 Message Date
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
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
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
ab6918f43d test: 完善测试用例 2026-05-14 15:26:22 +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
f6bd647958 test(editor): 更新monaco-editor依赖 2026-03-18 20:27:09 +08:00
roymondchen
5242585500 chore: update copyright 2025-07-11 15:04:22 +08:00
roymondchen
402f05f3d6 test(editor): 删除eventsService.init用例 2025-03-06 20:36:10 +08:00
roymondchen
34fc0a15b9 refactor: 将data-source,dep,schema,utils收敛到core,将form,table,stage,design,util收敛到editor 2024-12-09 20:21:34 +08:00
roymondchen
831204663a test: 完善测试用例 2024-05-09 20:49:54 +08:00
roymondchen
16e45cb45d style(editor): 完善service use-plugin的ts类型定义 2024-03-05 14:55:41 +08:00
roymondchen
5c6a3455b0 feat(editor): service扩展支持设置成同步的 2023-12-06 15:28:18 +08:00
roymondchen
94641bad76 refactor: 依赖收集相关代码抽出独立成库 2023-11-16 19:34:50 +08:00
roymondchen
2d5b7726ef fix(editor): 数据源列表中依赖的key会重复出现 2023-11-03 14:58:19 +08:00
roymondchen
35862078b3 feat(editor,schema): 支持组件显示条件配置 2023-08-04 15:52:55 +08:00
roymondchen
2b881c3863 feat(editor): 新增parseDSL配置,用于解析DSL,默认使用eval 2023-06-19 11:27:47 +08:00
roymondchen
35f9a59f44 feat(editor): 新增依赖收集器 2023-03-27 19:07:56 +08:00
roymondchen
0491487385 feat(editor): 修改service get set 方法的ts定义,不再需要传入泛型参数 2023-02-06 19:25:37 +08:00
oceanzhu
23708e4644 chore: 更新版权年份 2023-01-04 16:11:51 +08:00
roymondchen
ac065504f6 test: vue组件测试用例 2022-09-26 21:29:54 +08:00
roymondchen
9b9c9db683 fix(editor): 上移一层通知runtime更新参数出错
fix #282
2022-08-24 10:36:42 +08:00
roymondchen
3cdcca3b0b chore(editor): 删除无用代码 2022-08-23 20:35:34 +08:00
roymondchen
b6fa064b0b feat(editor): editorService.add支持添加多个组件 2022-08-11 14:26:03 +08:00
roymondchen
574e03f685 feat(editor): 完善storageService功能
新增namespace,setItem/getItem时自动key自动加上namespace;setItem可以指定协议;getItem时根据协议自动解析

fix #224
2022-08-04 18:46:26 +08:00
王明华
da0cb7d614
feat(editor): 添加storageService服务 (#225)
* feat(editor): 添加storageService服务

* fix(editor): 添加type.ts 导出StorageService的定义
2022-08-04 12:45:55 +08:00
parisma
af2fa3eee4 test(editor): 修改测试用例,修复流水线打包问题 2022-08-03 14:46:48 +08:00
khuntoriia
b702857aad
feat(editor): 多选菜单支持复制粘贴删除 (#217)
* feat(editor): 多选菜单支持复制粘贴删除

* fix(editor): 编辑器选中节点统一为nodes数组,保留原node对象为nodes数组的第一个元素,将复制粘贴删除行为封装到editorservice中,支持键盘快捷键

* test(editor): 修改editor相关测试用例

* fix(editor): cr问题修改

* feat(editor): 将复制粘贴操作进行拆分封装

* fix(editor): cr修改

Co-authored-by: parisma <parisma@tencent.com>
2022-08-03 14:03:36 +08:00
roymondchen
fff587d9eb fix(editor): 新增组件id不对 2022-07-27 16:47:12 +08:00
roymondchen
5e3125706c feat: 添加组件支持添加组合 2022-06-13 16:52:14 +08:00
roymondchen
ca4a6b596d test: jest 改成 vitest 2022-06-07 20:10:41 +08:00
roymondchen
9ae93fc9f2 test: 修改测试用例 2022-04-13 17:17:14 +08:00
roymondchen
6dbda7b565 style(editor): 将节点类型改成枚举 2022-03-31 19:46:12 +08:00
roymondchen
bc8b9f5225 refactor: make it public 2022-02-17 14:47:39 +08:00