@tmagic/editor 1.8.0-beta.7 → 1.8.0-beta.9

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.
Files changed (137) hide show
  1. package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +11 -3
  2. package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +3 -3
  3. package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +1 -1
  4. package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +24 -11
  5. package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  6. package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +2 -2
  7. package/dist/es/components/Icon.vue_vue_type_script_setup_true_lang.js +1 -1
  8. package/dist/es/components/Resizer.vue_vue_type_script_setup_true_lang.js +1 -1
  9. package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +1 -1
  10. package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -1
  11. package/dist/es/components/SearchInput.vue_vue_type_script_setup_true_lang.js +1 -1
  12. package/dist/es/components/SplitView.vue_vue_type_script_setup_true_lang.js +1 -1
  13. package/dist/es/components/ToolButton.vue_vue_type_script_setup_true_lang.js +1 -1
  14. package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +1 -1
  15. package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +1 -1
  16. package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +1 -1
  17. package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +1 -1
  18. package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +1 -1
  20. package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  21. package/dist/es/fields/DataSourceFieldSelect/FieldSelect.vue_vue_type_script_setup_true_lang.js +3 -3
  22. package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +1 -1
  23. package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +3 -3
  24. package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +2 -2
  25. package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +1 -1
  26. package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +3 -3
  28. package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +1 -1
  30. package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +1 -1
  32. package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  33. package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +1 -1
  34. package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +1 -1
  35. package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -1
  36. package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +1 -1
  38. package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +1 -1
  39. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +1 -1
  40. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +1 -1
  41. package/dist/es/fields/StyleSetter/icons/display/Block.js +1 -1
  42. package/dist/es/fields/StyleSetter/icons/display/Flex.js +1 -1
  43. package/dist/es/fields/StyleSetter/icons/display/Inline.js +1 -1
  44. package/dist/es/fields/StyleSetter/icons/display/InlineBlock.js +1 -1
  45. package/dist/es/fields/StyleSetter/icons/display/None.js +1 -1
  46. package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +1 -1
  47. package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +1 -1
  48. package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +1 -1
  49. package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +1 -1
  50. package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +1 -1
  51. package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +1 -1
  52. package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +1 -1
  53. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +1 -1
  54. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +1 -1
  55. package/dist/es/fields/StyleSetter/icons/text-align/Center.js +1 -1
  56. package/dist/es/fields/StyleSetter/icons/text-align/Left.js +1 -1
  57. package/dist/es/fields/StyleSetter/icons/text-align/Right.js +1 -1
  58. package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +1 -1
  59. package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +1 -1
  60. package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +1 -1
  61. package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +1 -1
  62. package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +1 -1
  63. package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +1 -1
  64. package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +1 -1
  65. package/dist/es/icons/CenterIcon.vue_vue_type_script_setup_true_lang.js +1 -1
  66. package/dist/es/icons/CodeIcon.vue_vue_type_script_setup_true_lang.js +1 -1
  67. package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -1
  68. package/dist/es/index.js +8 -4
  69. package/dist/es/layouts/AddPageBox.vue_vue_type_script_setup_true_lang.js +1 -1
  70. package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +1 -1
  71. package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +1 -1
  72. package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +3 -3
  73. package/dist/es/layouts/NavMenuColumn.vue_vue_type_script_setup_true_lang.js +1 -1
  74. package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +1 -1
  75. package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +1 -1
  76. package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +39 -27
  77. package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +10 -3
  78. package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +167 -302
  79. package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +1 -1
  80. package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +1 -1
  81. package/dist/es/layouts/history-list/composables.js +23 -55
  82. package/dist/es/layouts/history-list/useHistoryList.js +56 -0
  83. package/dist/es/layouts/history-list/useHistoryRevert.js +307 -0
  84. package/dist/es/layouts/page-bar/AddButton.vue_vue_type_script_setup_true_lang.js +1 -1
  85. package/dist/es/layouts/page-bar/PageBar.vue_vue_type_script_setup_true_lang.js +1 -1
  86. package/dist/es/layouts/page-bar/PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js +1 -1
  87. package/dist/es/layouts/page-bar/PageList.vue_vue_type_script_setup_true_lang.js +1 -1
  88. package/dist/es/layouts/page-bar/Search.vue_vue_type_script_setup_true_lang.js +2 -2
  89. package/dist/es/layouts/props-panel/FormPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  90. package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  91. package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  92. package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +1 -1
  93. package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +1 -1
  94. package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  95. package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.vue_vue_type_script_setup_true_lang.js +1 -1
  96. package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js +3 -3
  97. package/dist/es/layouts/sidebar/data-source/DataSourceList.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  99. package/dist/es/layouts/sidebar/layer/LayerMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  100. package/dist/es/layouts/sidebar/layer/LayerNodeTool.vue_vue_type_script_setup_true_lang.js +1 -1
  101. package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  102. package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +1 -1
  103. package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +1 -1
  104. package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  105. package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +1 -1
  106. package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
  107. package/dist/es/layouts/workspace/viewer/ViewerMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  108. package/dist/es/services/codeBlock.js +32 -28
  109. package/dist/es/services/dataSource.js +43 -34
  110. package/dist/es/services/editor.js +31 -26
  111. package/dist/es/services/history.js +268 -384
  112. package/dist/es/style.css +12 -0
  113. package/dist/es/utils/dep/worker.js +1 -1
  114. package/dist/es/utils/history.js +35 -47
  115. package/dist/style.css +12 -0
  116. package/dist/tmagic-editor.umd.cjs +5524 -4807
  117. package/package.json +8 -8
  118. package/src/Editor.vue +10 -1
  119. package/src/components/CompareForm.vue +28 -7
  120. package/src/fields/DataSourceInput.vue +3 -3
  121. package/src/index.ts +4 -0
  122. package/src/layouts/NavMenu.vue +2 -2
  123. package/src/layouts/history-list/GroupRow.vue +10 -0
  124. package/src/layouts/history-list/HistoryDiffDialog.vue +8 -1
  125. package/src/layouts/history-list/HistoryListPanel.vue +64 -251
  126. package/src/layouts/history-list/PageTab.vue +4 -4
  127. package/src/layouts/history-list/composables.ts +52 -90
  128. package/src/layouts/history-list/useHistoryList.ts +60 -0
  129. package/src/layouts/history-list/useHistoryRevert.ts +406 -0
  130. package/src/services/codeBlock.ts +30 -29
  131. package/src/services/dataSource.ts +37 -37
  132. package/src/services/editor.ts +32 -29
  133. package/src/services/history.ts +340 -430
  134. package/src/theme/history-list-panel.scss +14 -0
  135. package/src/type.ts +185 -92
  136. package/src/utils/history.ts +52 -67
  137. package/types/index.d.ts +466 -297
package/types/index.d.ts CHANGED
@@ -4,8 +4,8 @@ import StageCore, { CanDropIn, ContainerHighlightType, CustomizeMoveableOptions,
4
4
  import designPlugin, { ButtonProps, DesignPluginOptions } from "@tmagic/design";
5
5
  import Gesto, { OnDrag, OnDrag as OnDrag$1 } from "gesto";
6
6
  import { CodeBlockContent, CodeBlockDSL, DataSchema, DataSourceFieldType, DataSourceSchema, DepData, DepExtendedData, DepTargetType, DepTargetType as DepTargetType$1, DisplayCond, EventOption, Id, MApp, MContainer, MNode, MPage, MPageFragment, NodeType, Target, TargetOptions } from "@tmagic/core";
7
- import { App, Component, ComputedRef, Ref, ShallowRef } from "vue";
8
- import EventEmitter, { EventEmitter as EventEmitter$1 } from "events";
7
+ import { App, AppContext, Component, ComputedRef, Ref, ShallowRef } from "vue";
8
+ import EventEmitter$1, { EventEmitter } from "events";
9
9
  import * as Monaco from "monaco-editor";
10
10
  import Sortable, { Options, SortableEvent } from "sortablejs";
11
11
  import { PascalCasedProperties, Writable } from "type-fest";
@@ -47,7 +47,7 @@ export * from "@tmagic/utils";
47
47
  * 调用时的参数会透传到before方法的参数中, 然后before的return 会作为原方法的参数和after的参数,after第一个参数则是原方法的return值;
48
48
  * 如需终止后续方法调用可以return new Error();
49
49
  */
50
- declare class BaseService extends EventEmitter$1 {
50
+ declare class BaseService extends EventEmitter {
51
51
  private pluginOptionsList;
52
52
  private taskList;
53
53
  private doingTask;
@@ -62,11 +62,11 @@ declare class BaseService extends EventEmitter$1 {
62
62
  }
63
63
  //#endregion
64
64
  //#region temp/packages/editor/src/services/codeBlock.d.ts
65
- declare const canUsePluginMethods$7: {
65
+ declare const canUsePluginMethods$8: {
66
66
  async: readonly ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"];
67
67
  sync: string[];
68
68
  };
69
- type AsyncMethodName$4 = Writable<(typeof canUsePluginMethods$7)['async']>;
69
+ type AsyncMethodName$4 = Writable<(typeof canUsePluginMethods$8)['async']>;
70
70
  declare class CodeBlock extends BaseService {
71
71
  private state;
72
72
  /**
@@ -317,6 +317,7 @@ declare class ComponentList extends BaseService {
317
317
  destroy(): void;
318
318
  }
319
319
  type ComponentListService = ComponentList;
320
+ declare const _default$39: ComponentList;
320
321
  //#endregion
321
322
  //#region temp/packages/editor/src/services/dataSource.d.ts
322
323
  interface State$2 {
@@ -329,11 +330,11 @@ interface State$2 {
329
330
  methods: Record<string, EventOption[]>;
330
331
  }
331
332
  type StateKey$1 = keyof State$2;
332
- declare const canUsePluginMethods$6: {
333
+ declare const canUsePluginMethods$7: {
333
334
  async: never[];
334
335
  sync: readonly ["getFormConfig", "setFormConfig", "getFormValue", "setFormValue", "getFormEvent", "setFormEvent", "getFormMethod", "setFormMethod", "add", "update", "remove", "createId"];
335
336
  };
336
- type SyncMethodName$4 = Writable<(typeof canUsePluginMethods$6)['sync']>;
337
+ type SyncMethodName$5 = Writable<(typeof canUsePluginMethods$7)['sync']>;
337
338
  declare class DataSource extends BaseService {
338
339
  private state;
339
340
  /**
@@ -466,7 +467,7 @@ declare class DataSource extends BaseService {
466
467
  getDataSourceById(id: string): DataSourceSchema | undefined;
467
468
  resetState(): void;
468
469
  destroy(): void;
469
- usePlugin(options: SyncHookPlugin<SyncMethodName$4, DataSource>): void;
470
+ usePlugin(options: SyncHookPlugin<SyncMethodName$5, DataSource>): void;
470
471
  /**
471
472
  * 复制时会带上组件关联的数据源
472
473
  * @param config 组件节点配置
@@ -500,7 +501,7 @@ declare class DataSource extends BaseService {
500
501
  private applyHistoryStep;
501
502
  }
502
503
  type DataSourceService = DataSource;
503
- declare const _default$39: DataSource;
504
+ declare const _default$40: DataSource;
504
505
  //#endregion
505
506
  //#region temp/packages/editor/src/services/dep.d.ts
506
507
  interface DepEvents {
@@ -553,7 +554,7 @@ declare class Dep extends BaseService {
553
554
  private enqueueTask;
554
555
  }
555
556
  type DepService = Dep;
556
- declare const _default$41: Dep;
557
+ declare const _default$42: Dep;
557
558
  //#endregion
558
559
  //#region temp/packages/editor/src/services/editor.d.ts
559
560
  declare class Editor extends BaseService {
@@ -916,15 +917,15 @@ declare class Editor extends BaseService {
916
917
  private selectedConfigExceptionHandler;
917
918
  }
918
919
  type EditorService = Editor;
919
- declare const _default$42: Editor;
920
+ declare const _default$43: Editor;
920
921
  //#endregion
921
922
  //#region temp/packages/editor/src/services/events.d.ts
922
- declare const canUsePluginMethods$5: {
923
+ declare const canUsePluginMethods$6: {
923
924
  async: readonly [];
924
925
  sync: readonly ["setEvent", "getEvent", "setMethod", "getMethod"];
925
926
  };
926
- type AsyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['async']>;
927
- type SyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['sync']>;
927
+ type AsyncMethodName$3 = Writable<(typeof canUsePluginMethods$6)['async']>;
928
+ type SyncMethodName$4 = Writable<(typeof canUsePluginMethods$6)['sync']>;
928
929
  declare class Events extends BaseService {
929
930
  constructor();
930
931
  setEvents(events: Record<string, EventOption[]>): void;
@@ -935,10 +936,10 @@ declare class Events extends BaseService {
935
936
  getMethod(type: string, _targetId: Id): EventOption[];
936
937
  resetState(): void;
937
938
  destroy(): void;
938
- usePlugin(options: AsyncHookPlugin<AsyncMethodName$3, Events> & SyncHookPlugin<SyncMethodName$3, Events>): void;
939
+ usePlugin(options: AsyncHookPlugin<AsyncMethodName$3, Events> & SyncHookPlugin<SyncMethodName$4, Events>): void;
939
940
  }
940
941
  type EventsService = Events;
941
- declare const _default$43: Events;
942
+ declare const _default$44: Events;
942
943
  //#endregion
943
944
  //#region temp/packages/editor/src/utils/undo-redo.d.ts
944
945
  /**
@@ -1010,133 +1011,153 @@ declare class UndoRedo<T = any> {
1010
1011
  }
1011
1012
  //#endregion
1012
1013
  //#region temp/packages/editor/src/services/history.d.ts
1014
+ declare const canUsePluginMethods$5: {
1015
+ sync: readonly ["push", "undo", "redo"];
1016
+ };
1017
+ type SyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['sync']>;
1013
1018
  declare class History extends BaseService {
1014
1019
  state: {
1015
- pageId?: Id | undefined;
1016
- pageSteps: Record<Id, UndoRedo<StepValue>>;
1017
- canRedo: boolean;
1018
- canUndo: boolean;
1019
- codeBlockState: Record<Id, UndoRedo<CodeBlockStepValue>>;
1020
- dataSourceState: Record<Id, UndoRedo<DataSourceStepValue>>;
1020
+ steps: {
1021
+ [x: string]: Record<Id, UndoRedo<any>>;
1022
+ page: Record<Id, UndoRedo<StepValue>>;
1023
+ codeBlock: Record<Id, UndoRedo<CodeBlockStepValue>>;
1024
+ dataSource: Record<Id, UndoRedo<DataSourceStepValue>>;
1025
+ };
1026
+ stepNames: Record<string, string>;
1021
1027
  };
1022
1028
  constructor();
1029
+ /**
1030
+ * 注册一个扩展历史类型,使其可与内置 `page` / `codeBlock` / `dataSource` 一样走统一的
1031
+ * {@link push} / {@link undo} / {@link redo}(按 id 分栈、独立 undo/redo)。
1032
+ *
1033
+ * @param stepType 自定义历史类型标识(勿与内置类型重名)
1034
+ * @param options.event push/undo/redo 后派发的事件名,缺省为 `${stepType}-history-change`
1035
+ * @param options.name 历史面板中的展示名称(tab / 分组标题等),缺省回退到 stepType 本身
1036
+ */
1037
+ registerStepType(stepType: string, options?: {
1038
+ event?: string;
1039
+ name?: string;
1040
+ }): void;
1041
+ /**
1042
+ * 读取指定历史类型的展示名称(用于历史面板 tab / 分组标题等)。
1043
+ * 未登记名称时回退到 stepType 本身。
1044
+ */
1045
+ getStepName(stepType: HistoryStepType): string;
1046
+ /**
1047
+ * 设置指定历史类型的展示名称(用于历史面板 tab / 分组标题等)。
1048
+ * 内置 `page` / `codeBlock` / `dataSource` 也可在此覆盖默认中文名。
1049
+ */
1050
+ setStepName(stepType: HistoryStepType, name: string): void;
1023
1051
  reset(): void;
1024
- resetPage(): void;
1025
- changePage(page: MPage | MPageFragment): void;
1026
1052
  resetState(): void;
1027
1053
  /**
1028
- * 为指定页面 / 页面片种入一条「初始基线」记录(如加载 DSL 时的「初始 / 加载」基线)。
1054
+ * 为指定历史栈(默认 `page`,也适用于 codeBlock / dataSource / 扩展类型)种入一条「初始基线」记录。
1029
1055
  *
1030
- * 该记录是一条 `opType: 'initial'` 的 {@link StepValue},作为页面历史栈 **index 0 的固定底线**:
1056
+ * 该记录是一条 `opType: 'initial'` 的 step,作为对应栈 **index 0 的固定底线**:
1031
1057
  * - 它是一条真实入栈的 step(随栈一起持久化),但被钉为撤销/回滚的下限——cursor 永不低于它,
1032
- * 因此不会被 undo / goto / revert 触达(详见 {@link undo} / {@link setCanUndoRedo});
1033
- * - 历史面板把它过滤出分组列表(见 {@link getPageHistoryGroups}),改由底部「初始」行展示。
1058
+ * 因此不会被 undo / goto / revert 触达(详见 {@link undo} / {@link undoFloor});
1059
+ * - 历史面板把它过滤出分组列表(见 {@link getHistoryGroups}),改由底部「初始」行展示。
1034
1060
  *
1035
- * 仅当目标页面栈为空时种入(保证 initial 一定位于 index 0);已存在 initial 底线时默认不重复种入,
1036
- * 传 `force=true` 且栈为空时按新基线种入。
1061
+ * 仅当目标栈为空时种入(保证 initial 一定位于 index 0);已存在 initial 底线时不重复种入。
1062
+ *
1063
+ * @param stepType 历史类型
1064
+ * @param id 目标栈 id(page 为 pageId,其余类型为对应资源 id)
1065
+ * @param options 基线展示信息(名称 / 描述 / 来源)
1037
1066
  */
1038
- setPageMarker(pageId: Id, options?: {
1067
+ setMarker(stepType: HistoryStepType, id: Id, options?: {
1039
1068
  name?: string;
1040
1069
  description?: string;
1041
1070
  source?: HistoryOpSource;
1071
+ extra?: Record<string, any>;
1042
1072
  }): StepValue | null;
1043
1073
  /**
1044
- * 读取指定页面(缺省当前活动页)的初始基线 step(页面栈 index 0 且 `opType: 'initial'`);
1045
- * 不存在时返回 undefined。
1074
+ * 读取指定历史栈的初始基线 step(栈 index 0 且 `opType: 'initial'`);
1075
+ * 不存在或 id 缺省时返回 undefined。
1046
1076
  */
1047
- getPageMarker(pageId?: Id): StepValue | undefined;
1077
+ getMarker(stepType: HistoryStepType, id?: Id): StepValue | undefined;
1048
1078
  /**
1049
- * 把一条步骤推入指定页面的栈;不指定 pageId 时落到当前活动页。
1079
+ * 把一条步骤推入指定历史栈。统一入口,所有类型(page / codeBlock / dataSource / 扩展)行为完全一致:
1080
+ * 按 `stepType` 选择目标栈类型,按 `id`(必填)选择具体栈,按需建栈后入栈,并派发对应的历史变更事件
1081
+ * (`page` 为 `change`,其余见 {@link registerStepType}),回调签名统一为 `(id, step)`。
1050
1082
  *
1051
- * 跨页操作(例如 `moveToContainer` 把节点搬到其它页)必须显式传入 `pageId`,
1052
- * 否则会把记录错误地落到操作发起页 / 当前激活页,破坏目标页 / 源页的撤销栈语义。
1053
- */
1054
- push(state: StepValue, pageId?: Id): StepValue | null;
1055
- /** 读取指定页面(缺省当前活动页)历史栈当前游标所在的 step(cursor - 1);无则返回 null。 */
1056
- getCurrentPageStep(pageId?: Id): StepValue | null;
1057
- /**
1058
- * `state` 替换指定页面栈当前游标所在的 step(并丢弃其后的重做尾部),游标不变。
1059
- * 用于「连续 set root 记录合并」等就地替换最新一条的场景;替换成功后按需刷新 / 通知。
1083
+ * 跨页 / 跨资源操作(如 `moveToContainer` 把节点搬到其它页)必须显式传入目标 id,
1084
+ * 否则无法落到正确的栈。step 可由 `createStackStep` 等构造后传入。
1085
+ *
1086
+ * @param stepType 历史类型
1087
+ * @param step 已构造好的历史记录(缺省自动补全 uuid / timestamp)
1088
+ * @param id 目标栈 id(page 为 pageId,其余类型为对应资源 id),必填
1089
+ */
1090
+ push(stepType: 'page', step: StepValue, id: Id): StepValue | null;
1091
+ push(stepType: 'codeBlock', step: CodeBlockStepValue, id: Id): CodeBlockStepValue | null;
1092
+ push(stepType: 'dataSource', step: DataSourceStepValue, id: Id): DataSourceStepValue | null;
1093
+ push<T extends BaseStepValue>(stepType: string, step: T, id: Id): T | null;
1094
+ /**
1095
+ * 撤销指定历史栈的最近一次变更。统一入口,所有类型行为一致:
1096
+ * 按 `id`(必填)+ `stepType` 定位栈,不会越过 index 0 的 initial 基线(所有类型同等适用),
1097
+ * 仅在确有可撤销 step 时派发对应的历史变更事件(`page` 为 `change`,回调签名 `(id, step)`)。
1098
+ *
1099
+ * @param stepType 历史类型
1100
+ * @param id 目标栈 id(page 为 pageId,其余类型为对应资源 id),必填
1060
1101
  */
1061
- replaceCurrentPageStep(state: StepValue, pageId?: Id): StepValue | null;
1102
+ undo(stepType: 'page', id: Id): StepValue | null;
1103
+ undo(stepType: 'codeBlock', id: Id): CodeBlockStepValue | null;
1104
+ undo(stepType: 'dataSource', id: Id): DataSourceStepValue | null;
1105
+ undo<T extends BaseStepValue>(stepType: string, id: Id): T | null;
1062
1106
  /**
1063
- * 推入一条代码块变更记录(与页面/节点完全无关),按 `codeBlockId` 维度独立一份 UndoRedo 栈。
1107
+ * 重做指定历史栈的下一次变更。语义与 {@link undo} 对称,详见其说明。
1064
1108
  *
1065
- * - 新增:oldContent = null,newContent = 新内容
1066
- * - 更新:oldContent / newContent 都为对应内容
1067
- * - 删除:newContent = null,oldContent = 删除前内容
1068
- * - `changeRecords` 来自 form 端,撤销/重做时若有则按 propPath 局部覆盖;缺省才退化为整内容替换。
1069
- * - 不直接驱动 codeBlockService,调用方负责实际写回。
1070
- */
1071
- pushCodeBlock(codeBlockId: Id, payload: {
1072
- oldContent: CodeBlockContent | null;
1073
- newContent: CodeBlockContent | null;
1074
- changeRecords?: ChangeRecord[]; /** 可选的人类可读描述(如「修改按钮颜色」),仅用于历史面板展示。 */
1075
- historyDescription?: string; /** 可选的操作途径(配置面板 / 菜单 / 接口等),仅用于历史面板展示与埋点。 */
1076
- source?: HistoryOpSource;
1077
- }): CodeBlockStepValue | null;
1078
- /**
1079
- * 推入一条数据源变更记录(与页面/节点完全无关),按 `dataSourceId` 维度独立一份 UndoRedo 栈。
1080
- * 行为同 pushCodeBlock(新增 oldSchema=null;删除 newSchema=null)。
1109
+ * @param stepType 历史类型
1110
+ * @param id 目标栈 id(page pageId,其余类型为对应资源 id),必填
1081
1111
  */
1082
- pushDataSource(dataSourceId: Id, payload: {
1083
- oldSchema: DataSourceSchema | null;
1084
- newSchema: DataSourceSchema | null;
1085
- changeRecords?: ChangeRecord[]; /** 可选的人类可读描述,仅用于历史面板展示。 */
1086
- historyDescription?: string; /** 可选的操作途径(配置面板 / 菜单 / 接口等),仅用于历史面板展示与埋点。 */
1087
- source?: HistoryOpSource;
1088
- }): DataSourceStepValue | null;
1089
- /** 撤销指定代码块的最近一次变更。 */
1090
- undoCodeBlock(codeBlockId: Id): CodeBlockStepValue | null;
1091
- /** 重做指定代码块的下一次变更。 */
1092
- redoCodeBlock(codeBlockId: Id): CodeBlockStepValue | null;
1093
- /** 是否可对指定代码块撤销。 */
1094
- canUndoCodeBlock(codeBlockId: Id): boolean;
1095
- /** 是否可对指定代码块重做。 */
1096
- canRedoCodeBlock(codeBlockId: Id): boolean;
1097
- /** 撤销指定数据源的最近一次变更。 */
1098
- undoDataSource(dataSourceId: Id): DataSourceStepValue | null;
1099
- /** 重做指定数据源的下一次变更。 */
1100
- redoDataSource(dataSourceId: Id): DataSourceStepValue | null;
1101
- /** 是否可对指定数据源撤销。 */
1102
- canUndoDataSource(dataSourceId: Id): boolean;
1103
- /** 是否可对指定数据源重做。 */
1104
- canRedoDataSource(dataSourceId: Id): boolean;
1105
- undo(): StepValue | null;
1106
- redo(): StepValue | null;
1107
- destroy(): void;
1112
+ redo(stepType: 'page', id: Id): StepValue | null;
1113
+ redo(stepType: 'codeBlock', id: Id): CodeBlockStepValue | null;
1114
+ redo(stepType: 'dataSource', id: Id): DataSourceStepValue | null;
1115
+ redo<T extends BaseStepValue>(stepType: string, id: Id): T | null;
1108
1116
  /**
1109
- * 清空指定页面(缺省当前活动页)的历史记录栈。
1110
- * 仅删除撤销/重做记录,不会改动当前 DSL;清空后该页将无法再撤销/重做之前的操作。
1117
+ * 是否可对指定历史栈撤销(cursor 高于 initial 基线底线)。
1118
+ * @param stepType 历史类型
1119
+ * @param id 目标栈 id;缺省 / 无效时返回 false
1111
1120
  */
1112
- clearPage(pageId?: Id): void;
1121
+ canUndo(stepType: HistoryStepType, id?: Id): boolean;
1113
1122
  /**
1114
- * 清空数据源历史记录栈:传入 `dataSourceId` 仅清空该数据源,缺省清空全部数据源。
1115
- * 仅删除撤销/重做记录,不会改动数据源本身。
1123
+ * 是否可对指定历史栈重做。
1124
+ * @param stepType 历史类型
1125
+ * @param id 目标栈 id;缺省 / 无效时返回 false
1116
1126
  */
1117
- clearDataSource(dataSourceId?: Id): void;
1127
+ canRedo(stepType: HistoryStepType, id?: Id): boolean;
1128
+ /** 读取指定页面历史栈当前游标所在的 step(cursor - 1);无则返回 null。 */
1129
+ getCurrentPageStep(pageId: Id): StepValue | null;
1118
1130
  /**
1119
- * 清空代码块历史记录栈:传入 `codeBlockId` 仅清空该代码块,缺省清空全部代码块。
1120
- * 仅删除撤销/重做记录,不会改动代码块本身。
1131
+ * `state` 替换指定页面栈当前游标所在的 step(并丢弃其后的重做尾部),游标不变。
1132
+ * 用于「连续 set root 记录合并」等就地替换最新一条的场景;替换成功后派发 `change`。
1121
1133
  */
1122
- clearCodeBlock(codeBlockId?: Id): void;
1134
+ replaceCurrentStep(stepType: HistoryStepType, state: StepValue, id: Id): StepValue | null;
1135
+ destroy(): void;
1123
1136
  /**
1124
- * 标记「整份 DSL 已保存」:把页面 / 代码块 / 数据源所有栈当前游标所在的记录都标为 `saved`。
1125
- * 适用于「整体落库」场景;若只保存了其中一类,请改用更细粒度的
1126
- * {@link markPageSaved} / {@link markCodeBlockSaved} / {@link markDataSourceSaved}。
1137
+ * 清空历史记录栈。统一入口,所有类型(page / codeBlock / dataSource / 扩展)行为一致:
1138
+ * - 传入 `id`:仅清空 `stepType` 下该 id 对应的栈;
1139
+ * - 缺省 `id`:清空 `stepType` 下的全部栈。
1140
+ *
1141
+ * 仅删除撤销/重做记录,不会改动 DSL / 代码块 / 数据源本身。清空时会**保留各栈原有的
1142
+ * initial 基线**(文案 / 来源),无基线时清空成空栈。清空后派发 `clear`(签名 `(id, stepType)`)。
1143
+ *
1144
+ * @param stepType 历史类型
1145
+ * @param id 目标栈 id;缺省表示清空该类型下全部栈
1127
1146
  */
1128
- markSaved(): void;
1147
+ clear(stepType: HistoryStepType, id?: Id): void;
1129
1148
  /**
1130
- * 标记指定页面(缺省为当前活动页)的历史栈当前记录为已保存。
1131
- * 仅影响该页面自己的栈,不波及代码块 / 数据源 / 其它页面。
1149
+ * 标记历史记录为「已保存」(把对应栈当前游标所在的记录标为 `saved`)。统一入口:
1150
+ * - 缺省 `id`:标记**全部类型、全部栈**(整份 DSL 落库场景),派发 `mark-saved` 且 `kind: 'all'`;
1151
+ * - 传入 `id`:仅标记 `stepType` 下该 id 对应的栈,派发 `mark-saved` 且 `kind` 为 `stepType`。
1152
+ *
1153
+ * 同一栈内任意时刻最多只有一条记录为 `saved`;从 IndexedDB 恢复时游标会被定位到最近一条已保存记录之后。
1154
+ *
1155
+ * @param stepType 历史类型
1156
+ * @param id 目标栈 id;缺省表示标记全部类型 / 全部栈
1132
1157
  */
1133
- markPageSaved(pageId?: Id): void;
1134
- /** 标记指定代码块的历史栈当前记录为已保存,仅影响该代码块自己的栈。 */
1135
- markCodeBlockSaved(codeBlockId: Id): void;
1136
- /** 标记指定数据源的历史栈当前记录为已保存,仅影响该数据源自己的栈。 */
1137
- markDataSourceSaved(dataSourceId: Id): void;
1158
+ markSaved(stepType: HistoryStepType, id?: Id): void;
1138
1159
  /**
1139
- * 把当前内存中的全部历史栈(页面 / 代码块 / 数据源)序列化后写入本地 IndexedDB。
1160
+ * 把当前内存中的全部历史栈(页面 / 代码块 / 数据源 / 扩展类型)序列化后写入本地 IndexedDB。
1140
1161
  *
1141
1162
  * - 每个 UndoRedo 栈连同其游标、容量一并保存,恢复后可继续 undo/redo;
1142
1163
  * - `key` 用于区分不同活动页 / 项目(同一 store 下可保存多份快照),缺省为 `default`;
@@ -1148,95 +1169,93 @@ declare class History extends BaseService {
1148
1169
  * 从本地 IndexedDB 读取此前保存的历史快照并重建全部撤销/重做栈。
1149
1170
  *
1150
1171
  * - 读取到的每个栈都会经 {@link UndoRedo.fromSerialized} 还原(含游标),随后可直接 undo/redo;
1151
- * - 会整体覆盖当前内存中的历史状态,并把活动页恢复为快照中的 pageId;
1172
+ * - 会整体覆盖当前内存中的历史状态(活动页由 editorService 维护,不在此恢复);
1152
1173
  * - 找不到对应记录时返回 null,且不改动当前状态;
1153
1174
  * - 不支持 IndexedDB 的环境(如 SSR)会 reject。
1154
1175
  */
1155
1176
  restoreFromIndexedDB(options?: HistoryPersistOptions): Promise<PersistedHistoryState | null>;
1156
1177
  /**
1157
- * 取出当前活动页的历史步骤平铺列表(包含已应用 + 已撤销)。
1158
- * 列表按时间正序,最早一步在最前面。
1159
- * 通常 UI 应使用 `getPageHistoryGroups` 取已合并分组的版本;本方法仅为兼容/调试保留。
1160
- */
1161
- getPageStepList(pageId?: Id): PageHistoryStepEntry[];
1162
- /**
1163
- * 取出当前活动页的历史栈,按"目标节点"做相邻合并:
1164
- * - 连续修改同一节点(单节点 update)的多步合并为一个 group,组内可展开查看每步;
1165
- * - add / remove / 多节点 update 始终独立成组。
1166
- * 用于历史面板的"页面"tab 展示。
1167
- */
1168
- getPageHistoryGroups(pageId?: Id): PageHistoryGroup[];
1169
- /**
1170
- * 取出全部代码块的历史栈,按 codeBlockId 分桶展示。
1171
- * 同一栈内每条操作记录独立成组,不做相邻 update 合并。
1172
- */
1173
- getCodeBlockHistoryGroups(): StackHistoryGroup<CodeBlockStepValue, 'code-block'>[];
1174
- /**
1175
- * 读取指定页面历史栈的当前游标(已应用步骤数量)。不传则取当前活动页。
1176
- * 没有对应栈时返回 0。
1177
- */
1178
- getPageCursor(pageId?: Id): number;
1179
- /** 读取指定代码块历史栈的当前游标。 */
1180
- getCodeBlockCursor(codeBlockId: Id): number;
1181
- /** 读取指定数据源历史栈的当前游标。 */
1182
- getDataSourceCursor(dataSourceId: Id): number;
1183
- /**
1184
- * 取出指定代码块历史栈的平铺步骤列表(含 applied 标记)。供 revert 等按 index 索引步骤使用。
1185
- */
1186
- getCodeBlockStepList(codeBlockId: Id): {
1187
- step: CodeBlockStepValue;
1188
- index: number;
1189
- applied: boolean;
1190
- }[];
1191
- /**
1192
- * 取出指定数据源历史栈的平铺步骤列表(含 applied 标记)。供 revert 等按 index 索引步骤使用。
1178
+ * 取出指定历史类型(页面 / 代码块 / 数据源 / 扩展类型)某个栈的平铺步骤列表(含 applied 标记)。
1179
+ * 统一入口,替代旧的 `getPageStepList` / `getCodeBlockStepList` / `getDataSourceStepList`。
1180
+ *
1181
+ * 列表按时间正序,最早一步在最前面;`applied` 表示该步骤处于栈游标之前(已应用)。
1182
+ * revert / goto 等按 index 索引步骤的场景使用。通常 UI 应使用
1183
+ * {@link getHistoryGroups} 取已合并分组的版本;本方法仅为兼容/调试保留。
1184
+ *
1185
+ * @param stepType 历史类型
1186
+ * @param id 目标栈 id(page pageId,其余类型为对应资源 id);缺省 / 无效时返回空数组
1193
1187
  */
1194
- getDataSourceStepList(dataSourceId: Id): {
1195
- step: DataSourceStepValue;
1196
- index: number;
1197
- applied: boolean;
1198
- }[];
1188
+ getStepList(stepType: 'page', id?: Id): HistoryStepEntry<StepValue>[];
1189
+ getStepList(stepType: 'codeBlock', id: Id): HistoryStepEntry<CodeBlockStepValue>[];
1190
+ getStepList(stepType: 'dataSource', id: Id): HistoryStepEntry<DataSourceStepValue>[];
1191
+ getStepList<T extends BaseStepValue>(stepType: HistoryStepType, id?: Id): HistoryStepEntry<T>[];
1199
1192
  /**
1200
- * 按历史记录 uuid 在指定页面(默认当前活动页)的栈中查找其索引。
1201
- * 找不到时返回 -1。供「按 uuid 回滚」等需要把 uuid 映射回 index 的场景使用。
1193
+ * 取出指定历史类型的历史分组(页面 / 代码块 / 数据源 / 扩展类型统一入口)。
1194
+ *
1195
+ * 把目标栈的步骤列表按"目标"做相邻合并(连续修改同一目标的 update 合并为一组,组内可展开查看每步;
1196
+ * add / remove / 多实体 update 始终独立成组),并过滤掉 index 0 的 initial 基线(底部「初始」行由
1197
+ * {@link getMarker} 驱动)。各类型行为完全一致,仅 `kind` 与 step 快照类型不同。
1198
+ *
1199
+ * 作用域:
1200
+ * - 传入 `id`:仅取该 id 对应的单个栈(页面历史按活动页查看,传入 pageId);
1201
+ * - 缺省 `id`:遍历该类型下全部栈并汇总(代码块 / 数据源按全部资源分桶展示)。
1202
+ *
1203
+ * @param stepType 历史类型,缺省 `page`
1204
+ * @param id 目标栈 id;缺省表示遍历该类型下全部栈
1202
1205
  */
1203
- getPageStepIndexByUuid(uuid: string, pageId?: Id): number;
1206
+ getHistoryGroups(stepType: 'page', id?: Id): HistoryGroup<StepValue>[];
1207
+ getHistoryGroups(stepType: 'codeBlock', id?: Id): HistoryGroup<CodeBlockStepValue>[];
1208
+ getHistoryGroups(stepType: 'dataSource', id?: Id): HistoryGroup<DataSourceStepValue>[];
1209
+ getHistoryGroups<T extends BaseStepValue>(stepType: HistoryStepType, id?: Id): HistoryGroup<T>[];
1204
1210
  /**
1205
- * 按历史记录 uuid 在全部代码块栈中查找其所属 codeBlockId 与索引。
1206
- * 找不到时返回 null。
1211
+ * 读取指定历史栈的当前游标(已应用步骤数量)。统一入口,替代旧的
1212
+ * `getPageCursor` / `getCodeBlockCursor` / `getDataSourceCursor`。
1213
+ * - `id` 缺省或非法、或对应栈不存在时返回 0;
1214
+ * - `stepType` 支持 `page` / `codeBlock` / `dataSource` / 扩展类型。
1207
1215
  */
1208
- findCodeBlockStepLocationByUuid(uuid: string): {
1209
- id: Id;
1210
- index: number;
1211
- } | null;
1216
+ getCursor(stepType: HistoryStepType, id?: Id): number;
1212
1217
  /**
1213
- * 按历史记录 uuid 在全部数据源栈中查找其所属 dataSourceId 与索引。
1214
- * 找不到时返回 null。
1218
+ * 按历史记录 uuid 在指定历史类型的栈中查找其所属 id 与索引,统一入口,替代旧的
1219
+ * `getPageStepIndexByUuid` / `findCodeBlockStepLocationByUuid` / `findDataSourceStepLocationByUuid`。
1220
+ *
1221
+ * - 传入 `id`:仅在该 id 对应的单个栈中查找(如页面历史按活动页查看,传入 pageId);
1222
+ * - 缺省 `id`:遍历该类型下全部栈查找(代码块 / 数据源等按全部资源分桶的场景)。
1223
+ *
1224
+ * 找不到时返回 null。供「按 uuid 回滚」等需要把 uuid 映射回 (id, index) 的场景使用。
1225
+ *
1226
+ * @param stepType 历史类型
1227
+ * @param uuid 目标历史记录的 uuid
1228
+ * @param id 目标栈 id;缺省表示遍历该类型下全部栈
1215
1229
  */
1216
- findDataSourceStepLocationByUuid(uuid: string): {
1230
+ findStepLocationByUuid(stepType: HistoryStepType, uuid: string, id?: Id): {
1217
1231
  id: Id;
1218
1232
  index: number;
1219
1233
  } | null;
1234
+ usePlugin(options: SyncHookPlugin<SyncMethodName$3, History>): void;
1235
+ emit<Name extends keyof HistoryEvents, Param extends HistoryEvents[Name]>(eventName: Name, ...args: Param): boolean;
1220
1236
  /**
1221
- * 取出全部数据源的历史栈,按 dataSourceId 分桶展示。同上,每条操作独立成组。
1237
+ * 取出指定历史类型的栈桶(`Record<id, UndoRedo>`);不存在时按需创建空桶,
1238
+ * 从而支持通过 {@link registerStepType} 或首次 push 动态扩展历史类型。
1222
1239
  */
1223
- getDataSourceHistoryGroups(): StackHistoryGroup<DataSourceStepValue, 'data-source'>[];
1240
+ private getStepBucket;
1224
1241
  /**
1225
- * 取出指定页面的栈;不传 pageId 时按当前活动页取。
1226
- *
1227
- * 跨页 push 时如果目标页的栈尚不存在(用户从未进入过该页),会按需创建一条空栈,
1228
- * 这样切到目标页时 Ctrl+Z 也能撤回该步骤。
1242
+ * 清空单个历史栈并按需重建其 initial 基线(保留原基线的文案 / 来源)。
1229
1243
  */
1230
- private getUndoRedo;
1244
+ private clearStack;
1245
+ /** 入栈前补全 step 的 uuid / timestamp(调用方未指定时)。 */
1246
+ private fillStepMeta;
1247
+ /** 校验「按 id 分栈」类型(codeBlock / dataSource / 扩展)的 id 是否有效。 */
1248
+ private isValidStackId;
1249
+ /** 清空全部历史栈内容(保留已注册的类型键,使扩展类型在 reset 后仍可用)。 */
1250
+ private clearAllSteps;
1231
1251
  /**
1232
1252
  * 把基础 dbName 与当前 DSL(root app)的 id 拼成最终库名,实现不同应用历史隔离。
1233
1253
  * 取不到 app id(如尚未加载 DSL)时退回基础 dbName。
1234
1254
  */
1235
1255
  private resolveDbName;
1236
- private setCanUndoRedo;
1237
1256
  }
1238
1257
  type HistoryService = History;
1239
- declare const _default$44: History;
1258
+ declare const _default$45: History;
1240
1259
  //#endregion
1241
1260
  //#region temp/packages/editor/src/services/keybinding.d.ts
1242
1261
  declare class Keybinding extends BaseService {
@@ -1275,6 +1294,7 @@ declare class Keybinding extends BaseService {
1275
1294
  private getKeyconKeys;
1276
1295
  }
1277
1296
  type KeybindingService = Keybinding;
1297
+ declare const _default$46: Keybinding;
1278
1298
  //#endregion
1279
1299
  //#region temp/packages/editor/src/services/props.d.ts
1280
1300
  declare const canUsePluginMethods$4: {
@@ -1374,7 +1394,7 @@ declare class Props extends BaseService {
1374
1394
  private setRelateId;
1375
1395
  }
1376
1396
  type PropsService = Props;
1377
- declare const _default$46: Props;
1397
+ declare const _default$48: Props;
1378
1398
  //#endregion
1379
1399
  //#region temp/packages/editor/src/services/stageOverlay.d.ts
1380
1400
  declare const canUsePluginMethods$3: {
@@ -1401,7 +1421,7 @@ declare class StageOverlay extends BaseService {
1401
1421
  private updateSelectStatus;
1402
1422
  }
1403
1423
  type StageOverlayService = StageOverlay;
1404
- declare const _default$47: StageOverlay;
1424
+ declare const _default$49: StageOverlay;
1405
1425
  //#endregion
1406
1426
  //#region temp/packages/editor/src/services/storage.d.ts
1407
1427
  interface Options$1 {
@@ -1464,7 +1484,7 @@ declare class WebStorage extends BaseService {
1464
1484
  private getValueAndProtocol;
1465
1485
  }
1466
1486
  type StorageService = WebStorage;
1467
- declare const _default$48: WebStorage;
1487
+ declare const _default$50: WebStorage;
1468
1488
  //#endregion
1469
1489
  //#region temp/packages/editor/src/services/ui.d.ts
1470
1490
  declare const canUsePluginMethods$1: {
@@ -1484,7 +1504,7 @@ declare class Ui extends BaseService {
1484
1504
  private setStageRect;
1485
1505
  }
1486
1506
  type UiService = Ui;
1487
- declare const _default$49: Ui;
1507
+ declare const _default$51: Ui;
1488
1508
  //#endregion
1489
1509
  //#region temp/packages/editor/src/type.d.ts
1490
1510
  type EditorSlots = FrameworkSlots & WorkspaceSlots & SidebarSlots & PropsPanelSlots & {
@@ -2080,13 +2100,21 @@ interface StepDiffItem<T = unknown> {
2080
2100
  *
2081
2101
  * 泛型 `T` 为 `diff` 中变化内容的快照类型(页面节点 `MNode` / 代码块 `CodeBlockContent` / 数据源 `DataSourceSchema`)。
2082
2102
  */
2083
- interface BaseStepValue<T = unknown> {
2103
+ interface BaseStepValue<T = unknown, U extends Record<string, any> = {}> {
2084
2104
  /**
2085
2105
  * 历史记录唯一标识(uuid)。入栈时自动写入(若调用方未指定),
2086
2106
  * 用于精确定位 / 引用某一条历史记录(如 revert、埋点、跨端同步等)。
2087
- * 注意与各自的 `id`(关联的页面 / 代码块 / 数据源 id)区分。
2107
+ * 注意与 `data.id`(关联的页面 / 代码块 / 数据源 id)区分。
2088
2108
  */
2089
2109
  uuid: string;
2110
+ /**
2111
+ * 关联目标信息:`id` 为关联的页面 / 代码块 / 数据源等资源 id(也是历史栈的分组 key),
2112
+ * `name` 为展示名。所有历史类型统一携带。
2113
+ */
2114
+ data: {
2115
+ name: string;
2116
+ id: Id;
2117
+ };
2090
2118
  /** 操作类型:新增 / 删除 / 更新(三类历史记录统一携带)。 */
2091
2119
  opType: HistoryOpType;
2092
2120
  /**
@@ -2120,56 +2148,78 @@ interface BaseStepValue<T = unknown> {
2120
2148
  * 避免源码反复保存 / 外部重设 DSL 时堆积多条 root 记录。
2121
2149
  */
2122
2150
  rootStep?: boolean;
2123
- }
2124
- interface StepValue extends BaseStepValue<MNode> {
2125
- /** 页面信息 */
2126
- data: {
2127
- name: string;
2128
- id: Id;
2129
- };
2130
- /** 操作前选中的节点 ID,用于撤销后恢复选择状态 */
2131
- selectedBefore: Id[];
2132
- /** 操作后选中的节点 ID,用于重做后恢复选择状态 */
2133
- selectedAfter: Id[];
2134
- modifiedNodeIds: Map<Id, Id>;
2151
+ /** 操作人 */
2152
+ operator?: string;
2153
+ /** 扩展信息 */
2154
+ extra?: U;
2135
2155
  }
2136
2156
  /**
2137
- * 代码块历史记录条目。按 codeBlock.id 分组保存到 historyState.codeBlockState。
2138
- * 变更内容统一由 `diff`(单项)表达,每项见 {@link StepDiffItem}:
2139
- * - 新增(opType 'add'):仅 `newSchema`(新内容);
2140
- * - 更新(opType 'update'):`oldSchema` + `newSchema`,并可带 `changeRecords` 做局部更新;
2141
- * - 删除(opType 'remove'):仅 `oldSchema`(删除前内容)。
2157
+ * 历史记录的扩展上下文({@link BaseStepValue.extra})。
2158
+ * 内置字段供 `page` 类型在撤销 / 重做时恢复选区与受影响节点;扩展类型可自由附加其它键。
2142
2159
  */
2143
- interface CodeBlockStepValue extends BaseStepValue<CodeBlockContent> {
2144
- /** 关联的代码块 id */
2145
- id: Id;
2160
+ interface StepExtra {
2161
+ /** 操作前选中的节点 ID,用于撤销后恢复选择状态(page 类型) */
2162
+ selectedBefore?: Id[];
2163
+ /** 操作后选中的节点 ID,用于重做后恢复选择状态(page 类型) */
2164
+ selectedAfter?: Id[];
2165
+ /** 本次操作涉及的节点 id 集合(page 类型) */
2166
+ modifiedNodeIds?: Map<Id, Id>;
2167
+ [key: string]: any;
2146
2168
  }
2147
2169
  /**
2148
- * 数据源历史记录条目。按 dataSource.id 分组保存到 historyState.dataSourceState。
2149
- * 变更内容统一由 `diff`(单项)表达,每项见 {@link StepDiffItem}
2150
- * - 新增(opType 'add'):仅 `newSchema`(新 schema);
2151
- * - 更新(opType 'update'):`oldSchema` + `newSchema`,并可带 `changeRecords` 做局部更新;
2152
- * - 删除(opType 'remove'):仅 `oldSchema`(删除前 schema)。
2170
+ * 页面节点历史记录条目(`diff` 内容为 {@link MNode})。结构已与代码块 / 数据源统一收敛到
2171
+ * {@link BaseStepValue}:关联 id 见 `data.id`,选区等上下文见 `extra`。
2153
2172
  */
2154
- interface DataSourceStepValue extends BaseStepValue<DataSourceSchema> {
2155
- /** 关联的数据源 id */
2156
- id: Id;
2173
+ type StepValue = BaseStepValue<MNode, StepExtra>;
2174
+ /**
2175
+ * 代码块历史记录条目(`diff` 内容为 {@link CodeBlockContent}),按 `data.id`(codeBlock.id)
2176
+ * 分组保存到 historyState.steps.codeBlock。结构与 {@link StepValue} / {@link DataSourceStepValue}
2177
+ * 一致,仅 `diff` 快照类型不同。
2178
+ */
2179
+ type CodeBlockStepValue = BaseStepValue<CodeBlockContent>;
2180
+ /**
2181
+ * 数据源历史记录条目(`diff` 内容为 {@link DataSourceSchema}),按 `data.id`(dataSource.id)
2182
+ * 分组保存到 historyState.steps.dataSource。结构与 {@link StepValue} / {@link CodeBlockStepValue}
2183
+ * 一致,仅 `diff` 快照类型不同。
2184
+ */
2185
+ type DataSourceStepValue = BaseStepValue<DataSourceSchema>;
2186
+ /**
2187
+ * 历史记录类型标识:内置 `page` / `codeBlock` / `dataSource`,并允许业务扩展自定义类型。
2188
+ * `(string & {})` 保留对内置字面量的智能提示,同时不限制扩展取值。
2189
+ */
2190
+ type HistoryStepType = 'page' | 'codeBlock' | 'dataSource' | (string & {});
2191
+ /**
2192
+ * 全部历史栈的统一容器,按「类型 -> id -> UndoRedo 栈」两级分组。
2193
+ *
2194
+ * - `page`:页面历史栈,按 page.id 分组(每页一份 UndoRedo);
2195
+ * - `codeBlock`:代码块历史栈,按 codeBlock.id 分组;
2196
+ * - `dataSource`:数据源历史栈,按 dataSource.id 分组;
2197
+ * - 其余键:业务通过 {@link HistoryService.registerStepType} 注册的自定义历史类型。
2198
+ *
2199
+ * 所有类型(含扩展类型)一视同仁:均按 id 独立分栈、独立 undo/redo,且都可通过
2200
+ * {@link HistoryService.setMarker} 在 index 0 种入 `initial` 基线(撤销 / 回滚不会越过该基线)。
2201
+ */
2202
+ interface HistorySteps {
2203
+ page: Record<Id, UndoRedo<StepValue>>;
2204
+ codeBlock: Record<Id, UndoRedo<CodeBlockStepValue>>;
2205
+ dataSource: Record<Id, UndoRedo<DataSourceStepValue>>;
2206
+ /** 扩展历史类型:按 id 分组的 UndoRedo 栈。 */
2207
+ [stepType: string]: Record<Id, UndoRedo<any>>;
2157
2208
  }
2158
2209
  interface HistoryState {
2159
- pageId?: Id;
2160
- pageSteps: Record<Id, UndoRedo<StepValue>>;
2161
- canRedo: boolean;
2162
- canUndo: boolean;
2163
2210
  /**
2164
- * 代码块历史栈,按 codeBlock.id 分组(每个代码块独立一份 UndoRedo)。
2165
- * 与页面/节点无关,支持独立 undo/redo
2211
+ * 全部历史栈的统一容器(页面 / 代码块 / 数据源 / 扩展类型),见 {@link HistorySteps}。
2212
+ * 各类型互不影响,支持按 id 独立 undo/redo;是否可撤销 / 重做改用 {@link HistoryService.canUndo} /
2213
+ * {@link HistoryService.canRedo}(按 stepType + id 查询)替代旧的全局 canUndo / canRedo 字段。
2166
2214
  */
2167
- codeBlockState: Record<Id, UndoRedo<CodeBlockStepValue>>;
2215
+ steps: HistorySteps;
2168
2216
  /**
2169
- * 数据源历史栈,按 dataSource.id 分组(每个数据源独立一份 UndoRedo)。
2170
- * 与页面/节点无关,支持独立 undo/redo。
2217
+ * 各历史类型的展示名称,用于历史面板({@link HistorySteps} tab / 分组标题等)。
2218
+ * 内置 `page` / `codeBlock` / `dataSource` 有默认中文名(页面 / 代码块 / 数据源),
2219
+ * 扩展类型可通过 {@link HistoryService.registerStepType} 的 `name` 选项或
2220
+ * {@link HistoryService.setStepName} 登记;读取请用 {@link HistoryService.getStepName}。
2171
2221
  */
2172
- dataSourceState: Record<Id, UndoRedo<DataSourceStepValue>>;
2222
+ stepNames: Record<string, string>;
2173
2223
  }
2174
2224
  /**
2175
2225
  * 历史记录的可持久化快照。由 historyService.saveToIndexedDB 写入 IndexedDB,
@@ -2178,14 +2228,16 @@ interface HistoryState {
2178
2228
  interface PersistedHistoryState {
2179
2229
  /** 快照结构版本号,便于后续兼容升级。 */
2180
2230
  version: number;
2181
- /** 保存时的活动页 id。 */
2182
- pageId?: Id;
2183
- /** 各页面历史栈的序列化快照,按 pageId 分组。 */
2184
- pageSteps: Record<Id, SerializedUndoRedo<StepValue>>;
2185
- /** 各代码块历史栈的序列化快照,按 codeBlockId 分组。 */
2186
- codeBlockState: Record<Id, SerializedUndoRedo<CodeBlockStepValue>>;
2187
- /** 各数据源历史栈的序列化快照,按 dataSourceId 分组。 */
2188
- dataSourceState: Record<Id, SerializedUndoRedo<DataSourceStepValue>>;
2231
+ /**
2232
+ * 全部历史栈的序列化快照,按「类型 -> id」两级分组,与 {@link HistorySteps} 对应。
2233
+ * 内置 `page` / `codeBlock` / `dataSource`,并包含业务注册的扩展类型。
2234
+ */
2235
+ steps: {
2236
+ page: Record<Id, SerializedUndoRedo<StepValue>>;
2237
+ codeBlock: Record<Id, SerializedUndoRedo<CodeBlockStepValue>>;
2238
+ dataSource: Record<Id, SerializedUndoRedo<DataSourceStepValue>>;
2239
+ [stepType: string]: Record<Id, SerializedUndoRedo<any>>;
2240
+ };
2189
2241
  /** 保存时间戳(毫秒)。 */
2190
2242
  savedAt: number;
2191
2243
  }
@@ -2207,9 +2259,9 @@ interface HistoryPersistOptions {
2207
2259
  /**
2208
2260
  * 历史面板用:当前页面的一条历史步骤(包含位置和是否已应用)。
2209
2261
  */
2210
- interface PageHistoryStepEntry {
2262
+ interface HistoryStepEntry<T> {
2211
2263
  /** 步骤内容 */
2212
- step: StepValue;
2264
+ step: T;
2213
2265
  /** 在所属栈中的索引(0 为最早) */
2214
2266
  index: number;
2215
2267
  /** 是否处于"已应用"段(即位于栈游标之前)。撤销后变为 false。 */
@@ -2218,56 +2270,42 @@ interface PageHistoryStepEntry {
2218
2270
  isCurrent?: boolean;
2219
2271
  }
2220
2272
  /**
2221
- * 页面历史面板分组。
2222
- * - 连续修改同一目标节点(updatedItems[0].oldNode.id 一致)的 'update' 步骤合并成一组;
2223
- * - 多节点更新 / add / remove 始终独立成组(无法明确归属单一目标)。
2224
- * - targetId 为 undefined 表示"无明确目标"(如 add/remove/多节点 update),不参与合并。
2273
+ * 历史面板分组(页面 / 数据源 / 代码块 / 扩展类型统一结构)。
2274
+ *
2275
+ * 把指定历史栈的步骤列表按"目标"做相邻合并:
2276
+ * - 连续修改同一目标(单实体 update,targetId 一致)的多步合并成一组,组内可展开查看每步;
2277
+ * - add / remove / 多实体 update 始终独立成组(无法明确归属单一目标);
2278
+ * - targetId 为 undefined 表示"无明确目标",不参与合并。
2279
+ *
2280
+ * 各类型仅 `kind` 与 step 快照类型不同,统一由泛型描述:
2281
+ * - 页面:`HistoryGroup<StepValue>`,`kind: 'page'`,`id` 为 pageId,`targetId` 为被改节点 id;
2282
+ * - 数据源:`HistoryGroup<DataSourceStepValue>`,`kind: 'data-source'`,`id` 为 dataSource.id;
2283
+ * - 代码块:`HistoryGroup<CodeBlockStepValue>`,`kind: 'code-block'`,`id` 为 codeBlock.id。
2225
2284
  */
2226
- interface PageHistoryGroup {
2227
- kind: 'page';
2228
- /** 所属页面 id */
2229
- pageId: Id;
2230
- /** 该分组的操作类型 */
2285
+ interface HistoryGroup<T extends BaseStepValue = BaseStepValue> {
2286
+ /** 历史类型标识:page / code-block / data-source(扩展类型同理)。 */
2287
+ kind: string;
2288
+ /** 所属栈 id(page 为 pageId,代码块 / 数据源为对应资源 id)。 */
2289
+ id: Id;
2290
+ /** 该分组的操作类型。 */
2231
2291
  opType: HistoryOpType;
2232
2292
  /**
2233
- * 合并的目标节点 id;只有"单节点 update"才有值,并按此 id 与相邻同 id 的 update 合并。
2234
- * undefined 表示该分组不可被合并(add / remove / 多节点 update)。
2293
+ * 合并的目标 id:仅"单实体 update"有值,并按此与相邻同 id 的 update 合并。
2294
+ * undefined 表示该分组不可被合并(add / remove / 多实体 update)。
2235
2295
  */
2236
2296
  targetId?: Id;
2237
- /** 目标节点的可读名(取最后一步的 newNode.name/type/id */
2297
+ /** 目标可读名(取最后一步快照的 name/type/id)。 */
2238
2298
  targetName?: string;
2239
- /** 组内所有步骤,按时间正序 */
2240
- steps: PageHistoryStepEntry[];
2241
- /** 组内最后一步是否已应用 */
2242
- applied: boolean;
2243
- /** 是否为当前所在的分组(包含栈中最近一次已应用步骤的那一组)。 */
2244
- isCurrent?: boolean;
2245
- }
2246
- /**
2247
- * 数据源 / 代码块历史面板分组(按 id 分栈展示)。
2248
- * 二者结构完全一致,仅 `kind` 与 step 类型不同,统一由该泛型描述:
2249
- * - 数据源:`StackHistoryGroup<DataSourceStepValue, 'data-source'>`;
2250
- * - 代码块:`StackHistoryGroup<CodeBlockStepValue, 'code-block'>`。
2251
- *
2252
- * 每条操作记录独立成组,不做相邻合并(与页面历史 {@link PageHistoryGroup} 不同),故 `steps` 恒为单元素。
2253
- */
2254
- interface StackHistoryGroup<T extends BaseStepValue = BaseStepValue, K extends 'code-block' | 'data-source' = 'code-block' | 'data-source'> {
2255
- /** 区分代码块 / 数据源。 */
2256
- kind: K;
2257
- /** 关联的代码块 / 数据源 id。 */
2258
- id: Id;
2259
- /** 该分组的操作类型。 */
2260
- opType: HistoryOpType;
2261
- /** 组内所有步骤,按时间正序(不做相邻合并,恒为单元素)。 */
2299
+ /** 组内所有步骤,按时间正序。 */
2262
2300
  steps: {
2263
2301
  step: T;
2264
2302
  index: number;
2265
2303
  applied: boolean;
2266
2304
  isCurrent?: boolean;
2267
2305
  }[];
2268
- /** 组内最后一步是否已应用,用于整组的状态展示。 */
2306
+ /** 组内最后一步是否已应用。 */
2269
2307
  applied: boolean;
2270
- /** 是否为当前所在的分组(包含该栈最近一次已应用步骤的那一组)。 */
2308
+ /** 是否为当前所在的分组(包含栈中最近一次已应用步骤的那一组)。 */
2271
2309
  isCurrent?: boolean;
2272
2310
  }
2273
2311
  declare enum KeyBindingCommand {
@@ -2389,7 +2427,7 @@ interface EventBusEvent {
2389
2427
  'remove-data-source': [id: string];
2390
2428
  'edit-code': [id: string];
2391
2429
  }
2392
- interface EventBus extends EventEmitter {
2430
+ interface EventBus extends EventEmitter$1 {
2393
2431
  on<Name extends keyof EventBusEvent, Param extends EventBusEvent[Name]>(eventName: Name, listener: (...args: Param) => void): this;
2394
2432
  emit<Name extends keyof EventBusEvent, Param extends EventBusEvent[Name]>(eventName: Name, ...args: Param): boolean;
2395
2433
  }
@@ -2427,6 +2465,26 @@ interface EditorEvents {
2427
2465
  }];
2428
2466
  'history-change': [data: MPage | MPageFragment];
2429
2467
  }
2468
+ interface HistoryEvents {
2469
+ change: [state: BaseStepValue | StepValue | CodeBlockStepValue | DataSourceStepValue, stepType: HistoryStepType, id: Id];
2470
+ 'code-block-history-change': [id: Id, state: CodeBlockStepValue];
2471
+ 'data-source-history-change': [id: Id, state: DataSourceStepValue];
2472
+ 'restore-from-indexed-db': [snapshot: PersistedHistoryState | null];
2473
+ 'save-to-indexed-db': [snapshot: PersistedHistoryState];
2474
+ 'mark-saved': [{
2475
+ kind: HistoryStepType;
2476
+ id?: Id;
2477
+ }];
2478
+ clear: [{
2479
+ id: Id;
2480
+ stepType: HistoryStepType;
2481
+ }];
2482
+ 'marker-change': [{
2483
+ id: Id;
2484
+ marker: StepValue;
2485
+ stepType: HistoryStepType;
2486
+ }];
2487
+ }
2430
2488
  declare const canUsePluginMethods: {
2431
2489
  async: readonly ["getLayout", "highlight", "select", "multiSelect", "doAdd", "add", "doRemove", "remove", "doUpdate", "update", "sort", "copy", "paste", "doPaste", "doAlignCenter", "alignCenter", "moveLayer", "moveToContainer", "dragTo", "undo", "redo", "move"];
2432
2490
  sync: never[];
@@ -2510,6 +2568,60 @@ interface HistoryBucketConfig<T extends BaseStepValue = BaseStepValue> extends H
2510
2568
  /** 是否支持「跳转到该记录」(goto),默认 true。 */
2511
2569
  gotoEnabled?: boolean;
2512
2570
  }
2571
+ interface UseHistoryRevertOptions {
2572
+ /**
2573
+ * 父级应用上下文,用于让动态挂载的「差异确认弹窗」继承全局组件 / 指令 / provide / 插件
2574
+ * (Element Plus、@tmagic/form 字段组件等)。未显式传入时,会自动取调用方所在组件的 appContext
2575
+ * (`getCurrentInstance()?.appContext`)。业务方若在组件 setup 之外调用,需手动传入(如 `editorApp._context`)。
2576
+ */
2577
+ appContext?: AppContext | null;
2578
+ /**
2579
+ * 透传给差异确认弹窗的 `extendState`(即 Editor 的 `extendFormState`),
2580
+ * 使对比表单中依赖业务上下文的 `display` / `disabled` 等 filterFunction 正常工作。
2581
+ */
2582
+ extendState?: (_state: FormState) => Record<string, any> | Promise<Record<string, any>>;
2583
+ /**
2584
+ * 返回 PropsPanel 主属性表单(FormPanel -> MForm)的 formState。
2585
+ * 仅页面历史「查看差异 / 回滚确认」场景会使用该 formState 覆盖 CompareForm 中同名扩展字段,
2586
+ * 以保证两处 filterFunction 读取到一致的运行态上下文。
2587
+ */
2588
+ getPropsPanelFormState?: () => FormState | undefined;
2589
+ }
2590
+ /**
2591
+ * 业务自有历史(如管理台「模块」)做差异对比时所需的额外渲染入参。
2592
+ * 内置的页面 / 数据源 / 代码块按 `category` 自动取表单配置,无需传这些;
2593
+ * 业务自有类别可通过 `loadConfig` 注入自定义表单配置加载逻辑。
2594
+ */
2595
+ interface CustomDiffFormOptions {
2596
+ /**
2597
+ * 自定义差异表单配置加载逻辑(如「模块」按 c_type 重建表单配置),
2598
+ * 透传给弹窗内部的 CompareForm;缺省时按 `category` 走内置加载。
2599
+ */
2600
+ loadConfig?: CompareFormLoadConfig;
2601
+ /** 需要走 self diff 的字段类型(如模块的 mod-cond)。 */
2602
+ selfDiffFieldTypes?: string[];
2603
+ /**
2604
+ * 可选:外部提供的 formState(通常来自 PropsPanel 主表单),
2605
+ * 对比弹窗会用它覆盖 CompareForm 中同名扩展字段,避免上下文不一致。
2606
+ */
2607
+ compareFormState?: FormState;
2608
+ }
2609
+ /**
2610
+ * 业务自有历史复用「单步回滚」交互({@link useHistoryRevert} 的 `confirmAndRevert`)的入参。
2611
+ * 与内置页面 / 数据源 / 代码块回滚共用「目标校验 → 差异/二次确认弹窗 → 反向回滚」流程,
2612
+ * 业务方只需提供:差异弹窗入参(可选)、表单配置加载(可选)、实际回滚执行函数。
2613
+ */
2614
+ interface ConfirmAndRevertOptions<T = unknown> extends CustomDiffFormOptions {
2615
+ /**
2616
+ * 差异确认弹窗入参;可对比的步骤(单实体 update)传入后弹差异确认弹窗,
2617
+ * 传 null / 省略则退化为普通二次确认框(add / remove / 不可对比)。
2618
+ */
2619
+ diffPayload?: DiffDialogPayload | null;
2620
+ /** 回滚前置校验:返回 true 表示目标数据已删除等不可回滚,给出统一提示并中止。 */
2621
+ isTargetMissing?: () => boolean;
2622
+ /** 用户确认后执行的实际回滚逻辑。 */
2623
+ revert: () => T | Promise<T>;
2624
+ }
2513
2625
  //#endregion
2514
2626
  //#region temp/packages/editor/src/hooks/use-code-block-edit.d.ts
2515
2627
  declare const useCodeBlockEdit: (codeBlockService: Services["codeBlockService"]) => {
@@ -2916,7 +3028,7 @@ interface IdleTaskEvents {
2916
3028
  hightLevelLength: number;
2917
3029
  }];
2918
3030
  }
2919
- declare class IdleTask<T = any> extends EventEmitter$1 {
3031
+ declare class IdleTask<T = any> extends EventEmitter {
2920
3032
  private taskList;
2921
3033
  private hightLevelTaskList;
2922
3034
  private taskHandle;
@@ -2939,7 +3051,7 @@ interface ScrollViewerOptions {
2939
3051
  height: number;
2940
3052
  };
2941
3053
  }
2942
- declare class ScrollViewer extends EventEmitter$1 {
3054
+ declare class ScrollViewer extends EventEmitter {
2943
3055
  private container;
2944
3056
  private target;
2945
3057
  private zoom;
@@ -3019,43 +3131,36 @@ declare const detectStackOpType: (oldVal: unknown, newVal: unknown) => "add" | "
3019
3131
  *
3020
3132
  * - `add`:oldValue = null;`remove`:newValue = null;`update`:两者都有,可带 changeRecords 做局部更新。
3021
3133
  * - 内容会做 cloneDeep 防止后续被外部引用篡改;opType 依据 old/new 是否为 null 推断。
3022
- * - 仅负责构造 step 并返回,入栈与事件 emit 由各公共方法(pushCodeBlock / pushDataSource)自行处理。
3134
+ * - 仅负责构造 step 并返回,入栈与事件 emit 由统一的 history.push(stepType, step, id) 处理。
3023
3135
  * - 不直接驱动业务 service,调用方负责实际写回。
3024
3136
  */
3025
- declare const createStackStep: <T, S extends BaseStepValue<T> & {
3026
- id: Id;
3027
- }>(id: Id, payload: {
3137
+ declare const createStackStep: <T, S extends BaseStepValue<T>>(id: Id, payload: Omit<BaseStepValue<T>, "uuid" | "data" | "opType" | "diff" | "timestamp" | "saved"> & {
3028
3138
  oldValue: T | null;
3029
3139
  newValue: T | null;
3030
- changeRecords?: ChangeRecord[];
3031
- historyDescription?: string;
3032
- source?: HistoryOpSource;
3140
+ changeRecords?: ChangeRecord[]; /** 展示名(缺省时从快照 name / title 推断)。 */
3141
+ name?: string;
3033
3142
  }) => S | null;
3034
3143
  declare const markStackSaved: <S extends {
3035
3144
  saved?: boolean;
3036
3145
  }>(undoRedo?: UndoRedo<S>) => void;
3037
3146
  /**
3038
- * 把单个「按 id 分栈」的历史栈(代码块 / 数据源)拆成若干 group:
3039
- * 每条操作记录独立成组,不做相邻 update 合并(与页面历史的合并策略不同)。
3147
+ * 把单个历史栈(页面 / 代码块 / 数据源 / 扩展类型)的步骤列表按"目标"做相邻合并:
3148
+ * - 单实体的 'update' 按 targetId 与相邻同 targetId 的 update 合并到一个 group,组内可展开查看每步;
3149
+ * - 'add' / 'remove' 始终独立成组(语义上是结构变更,不应被收纳进单实体修改组);
3150
+ * - 多实体 'update'(如页面批量改属性)也独立成组(无明确单一目标,避免误合并)。
3040
3151
  *
3041
- * 代码块与数据源除 `kind` 外结构完全一致,统一由本方法处理;`kind` 决定返回的具体分组类型。
3042
- */
3043
- declare const mergeStackSteps: <S extends BaseStepValue, K extends "code-block" | "data-source">(kind: K, id: Id, list: S[], cursor: number) => StackHistoryGroup<S, K>[];
3044
- /**
3045
- * 把页面栈拆成若干 group:
3046
- * - 单节点的 'update' 按 targetId 与相邻同 targetId 的 update 合并到一个 group;
3047
- * - 'add' / 'remove' 始终独立成组(语义上是结构变更,不应被收纳进单节点修改组);
3048
- * - 多节点 'update'(如批量改属性)也独立成组(无明确单一目标,避免误合并)。
3152
+ * 各类型行为完全一致,仅 `kind` step 快照类型不同,统一由本方法处理。
3049
3153
  */
3050
- declare const mergePageSteps: (pageId: Id, list: StepValue[], cursor: number) => PageHistoryGroup[];
3154
+ declare const mergeSteps: <T extends BaseStepValue>(kind: string, id: Id, list: T[], cursor: number) => HistoryGroup<T>[];
3051
3155
  /**
3052
- * 解析 StepValue 中的"目标节点 id"用于合并:
3053
- * - 单节点 update:取唯一一项 updatedItems 的节点 id
3054
- * - 其它情形(多节点 update / add / remove):返回 undefined,表示不参与合并。
3156
+ * 解析 step 中的"目标 id"用于合并:
3157
+ * - 单实体 update:取唯一一项 diff 的快照 id;快照无 id 时(如 CodeBlockContent)回退到 `step.data.id`
3158
+ * (即资源 id),使代码块 / 数据源同样能按资源合并相邻 update;
3159
+ * - 其它情形(多实体 update / add / remove):返回 undefined,表示不参与合并。
3055
3160
  */
3056
- declare const detectPageTargetId: (step: StepValue) => Id | undefined;
3057
- /** 解析 StepValue 中的目标节点可读名(用于 UI 展示)。 */
3058
- declare const detectPageTargetName: (step: StepValue) => string | undefined;
3161
+ declare const detectTargetId: (step: BaseStepValue) => Id | undefined;
3162
+ /** 解析 step 中的目标可读名(用于 UI 展示)。 */
3163
+ declare const detectTargetName: (step: BaseStepValue) => string | undefined;
3059
3164
  /**
3060
3165
  * 把 `Record<Id, UndoRedo>` 整体序列化为 `Record<Id, SerializedUndoRedo>`。
3061
3166
  *
@@ -3082,10 +3187,11 @@ declare const deserializeStacks: <T extends {
3082
3187
  */
3083
3188
  declare const getOrCreateStack: <T>(stacks: Record<Id, UndoRedo<T>>, id: Id) => UndoRedo<T>;
3084
3189
  /**
3085
- * 撤销下限:当页面栈 index 0 是 `opType: 'initial'` 的基线 step 时为 1(基线不可被撤销),否则为 0。
3086
- * 用于把 cursor 钉在基线之上,保证 undo / canUndo / goto 都不会越过初始基线。
3190
+ * 撤销下限:当栈 index 0 是 `opType: 'initial'` 的基线 step 时为 1(基线不可被撤销),否则为 0。
3191
+ * 适用于所有历史类型(page / codeBlock / dataSource / 扩展),把 cursor 钉在基线之上,
3192
+ * 保证 undo / canUndo / goto 都不会越过初始基线。
3087
3193
  */
3088
- declare const undoFloor: (undoRedo: UndoRedo<StepValue>) => number;
3194
+ declare const undoFloor: (undoRedo: UndoRedo<any>) => number;
3089
3195
  /** 将单次 push 产生的 history uuid(或 null)转为 *AndGetHistoryId 返回用的 uuid 列表。 */
3090
3196
  declare const getLastPushedHistoryIds: (historyId: string | null) => string[];
3091
3197
  //#endregion
@@ -3104,7 +3210,7 @@ declare const H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
3104
3210
  declare const V_GUIDE_LINE_STORAGE_KEY = "$MagicStageVerticalGuidelinesData";
3105
3211
  //#endregion
3106
3212
  //#region temp/packages/editor/src/utils/monaco-editor.d.ts
3107
- declare const _default$45: () => Promise<typeof import("monaco-editor")>;
3213
+ declare const _default$47: () => Promise<typeof import("monaco-editor")>;
3108
3214
  //#endregion
3109
3215
  //#region temp/packages/form/src/schema.d.ts
3110
3216
  interface ChangeRecord$1 {
@@ -5848,12 +5954,19 @@ type __VLS_Props$8 = {
5848
5954
  * 因此在差异对比场景下也需要透传,避免出现 `formState.xxx is undefined` 的运行时错误。
5849
5955
  */
5850
5956
  extendState?: (_state: FormState) => Record<string, any> | Promise<Record<string, any>>;
5957
+ /**
5958
+ * 外部透传的基础 formState(通常来自 PropsPanel 主属性表单)。
5959
+ * CompareForm 会提取其中的扩展字段覆盖到自己的 formState,保证 filterFunction 上下文一致。
5960
+ */
5961
+ baseFormState?: FormState; /** 需要走 self diff 的字段类型(例如 mod-cond)。 */
5962
+ selfDiffFieldTypes?: string[];
5851
5963
  /**
5852
5964
  * 自定义 FormConfig 加载逻辑。传入后将接管内置的按 `category`(node/data-source/code-block)
5853
5965
  * 取配置逻辑,调用方可根据业务自行返回(或异步返回)表单配置。可通过
5854
5966
  * `ctx.defaultLoadConfig()` 复用默认结果再做二次加工。返回的 config 直接用于对比展示。
5855
5967
  */
5856
- loadConfig?: CompareFormLoadConfig;
5968
+ loadConfig?: CompareFormLoadConfig; /** 编辑器服务集合,由调用方传入(不再通过 inject('services') 获取)。 */
5969
+ services: Services;
5857
5970
  };
5858
5971
  declare const __VLS_export$10: import("@vue/runtime-core").DefineComponent<__VLS_Props$8, {
5859
5972
  form: ShallowRef<InstanceType<typeof MForm> | null>;
@@ -5861,6 +5974,8 @@ declare const __VLS_export$10: import("@vue/runtime-core").DefineComponent<__VLS
5861
5974
  reload: () => Promise<void>;
5862
5975
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props$8> & Readonly<{}>, {
5863
5976
  labelWidth: string;
5977
+ extendState: (_state: FormState) => Record<string, any> | Promise<Record<string, any>>;
5978
+ services: Services;
5864
5979
  category: CompareCategory;
5865
5980
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
5866
5981
  declare const _default$5: typeof __VLS_export$10;
@@ -5885,6 +6000,11 @@ interface HistoryBucketGroup<T extends BaseStepValue = BaseStepValue> {
5885
6000
  step: T;
5886
6001
  }[];
5887
6002
  }
6003
+ /**
6004
+ * 通用二次确认弹窗:清空历史 / 无法差异对比的回滚等会改变状态的操作,先弹出确认框,
6005
+ * 用户点击「确定」返回 true,取消(confirm reject)时返回 false 并静默忽略。
6006
+ */
6007
+ declare const confirmHistoryAction: (message: string) => Promise<boolean>;
5888
6008
  //#endregion
5889
6009
  //#region temp/packages/editor/src/layouts/history-list/Bucket.vue.d.ts
5890
6010
  declare const __VLS_export$9: <T extends BaseStepValue = BaseStepValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -5973,6 +6093,7 @@ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K i
5973
6093
  //#endregion
5974
6094
  //#region temp/packages/editor/src/layouts/history-list/HistoryDiffDialog.vue.d.ts
5975
6095
  type __VLS_Props$7 = {
6096
+ /** 编辑器服务集合,由调用方传入(不再通过 inject('services') 获取)。 */services: Services;
5976
6097
  /**
5977
6098
  * 来自 Editor 顶层的 `extendFormState`,用于扩展 MForm.formState。
5978
6099
  * 透传给 CompareForm,从而让差异对比时表单 item 中依赖业务上下文的
@@ -5988,6 +6109,7 @@ type __VLS_Props$7 = {
5988
6109
  isConfirm?: boolean;
5989
6110
  onConfirm?: () => void;
5990
6111
  selfDiffFieldTypes?: string[];
6112
+ compareFormState?: FormState;
5991
6113
  };
5992
6114
  declare const __VLS_export$7: import("@vue/runtime-core").DefineComponent<__VLS_Props$7, {
5993
6115
  open: (p: DiffDialogPayload) => void;
@@ -5999,9 +6121,56 @@ declare const __VLS_export$7: import("@vue/runtime-core").DefineComponent<__VLS_
5999
6121
  onClose?: ((...args: any[]) => any) | undefined;
6000
6122
  }>, {
6001
6123
  width: string;
6124
+ services: Services;
6002
6125
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
6003
6126
  declare const _default$21: typeof __VLS_export$7;
6004
6127
  //#endregion
6128
+ //#region temp/packages/editor/src/layouts/history-list/useHistoryRevert.d.ts
6129
+ /**
6130
+ * 历史记录「单步回滚」与「查看差异」的完整交互流程,供历史面板与业务方共用。
6131
+ *
6132
+ * 单步回滚(类 git revert):
6133
+ * 1. 前置校验:目标数据已被删除(update 写回目标 / 页面 remove 的原父容器缺失)时给出「回滚失败」提示并中止;
6134
+ * 2. 二次确认:可差异对比的步骤(单实体 update)弹出差异确认弹窗,其余步骤弹普通二次确认框;
6135
+ * 3. 用户确认后执行对应 service 的 revert(页面 / 数据源 / 代码块)。
6136
+ *
6137
+ * 查看差异:可差异对比的步骤动态挂载只读 HistoryDiffDialog 展示前后值差异。
6138
+ *
6139
+ * 上述弹窗均按需动态挂载 HistoryDiffDialog 实现,业务方无需自行挂载任何弹窗。
6140
+ *
6141
+ * 返回的能力分三组:
6142
+ * - 内置三类(页面 / 数据源 / 代码块):`onPageRevert` / `onDataSourceRevert` / `onCodeBlockRevert` 单步回滚,
6143
+ * `onPageDiff` / `onDataSourceDiff` / `onCodeBlockDiff` 查看差异,及配套的 `buildXxxDiffPayload` / `isXxxRevertTargetMissing`;
6144
+ * - 业务自有历史(如管理台「模块」):`confirmAndRevert` / `viewDiff` 复用同一套交互流程,由业务方自行构造差异入参;
6145
+ * 即上述内置三类本质上是它们各自预置好 payload 构造与 service.revert 的特例。
6146
+ *
6147
+ * 业务方可在拿到 Editor 实例暴露的 `services` 后直接 import 调用:
6148
+ *
6149
+ * ```ts
6150
+ * import { useHistoryRevert } from '@tmagic/editor';
6151
+ *
6152
+ * const { onPageRevert, onPageDiff } = useHistoryRevert(editorRef.value); // editorRef.value 即 Editor 暴露的 services
6153
+ * await onPageRevert(index); // 弹出差异 / 二次确认弹窗后回滚
6154
+ * onPageDiff(index); // 弹出只读差异弹窗查看前后值差异
6155
+ * ```
6156
+ */
6157
+ declare const useHistoryRevert: (services: Services, options?: UseHistoryRevertOptions) => {
6158
+ onPageRevert: (index: number) => Promise<StepValue | null>;
6159
+ onDataSourceRevert: (id: string | number, index: number) => Promise<DataSourceStepValue | null>;
6160
+ onCodeBlockRevert: (id: string | number, index: number) => Promise<CodeBlockStepValue | null>;
6161
+ onPageDiff: (index: number) => Promise<void> | void;
6162
+ onDataSourceDiff: (id: string | number, index: number) => Promise<void> | void;
6163
+ onCodeBlockDiff: (id: string | number, index: number) => Promise<void> | void;
6164
+ buildPageDiffPayload: (index: number) => DiffDialogPayload | null;
6165
+ buildDataSourceDiffPayload: (id: string | number, index: number) => DiffDialogPayload | null;
6166
+ buildCodeBlockDiffPayload: (id: string | number, index: number) => DiffDialogPayload | null;
6167
+ isPageRevertTargetMissing: (index: number) => boolean;
6168
+ isDataSourceRevertTargetMissing: (id: string | number, index: number) => boolean;
6169
+ isCodeBlockRevertTargetMissing: (id: string | number, index: number) => boolean;
6170
+ confirmAndRevert: <T = unknown>(revertOptions: ConfirmAndRevertOptions<T>) => Promise<T | null>;
6171
+ viewDiff: (payload: DiffDialogPayload | null, extra?: CustomDiffFormOptions) => Promise<void> | void;
6172
+ };
6173
+ //#endregion
6005
6174
  //#region temp/packages/editor/src/components/FloatingBox.vue.d.ts
6006
6175
  interface Position {
6007
6176
  left: number;
@@ -6192,8 +6361,8 @@ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Pr
6192
6361
  declare const _default$32: typeof __VLS_export;
6193
6362
  //#endregion
6194
6363
  //#region temp/packages/editor/src/plugin.d.ts
6195
- declare const _default$40: {
6364
+ declare const _default$41: {
6196
6365
  install: (app: App, opt?: Partial<EditorInstallOptions | DesignPluginOptions | FormInstallOptions>) => void;
6197
6366
  };
6198
6367
  //#endregion
6199
- export { AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BaseStepValue, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CanDropInFunction, CanDropInScene, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeBlockStepValue, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, CompareCategory, _default$5 as CompareForm, CompareFormLoadConfig, CompareFormLoadConfigContext, ComponentGroup, ComponentGroupState, ComponentItem, _default$6 as ComponentListPanel, ComponentListPanelSlots, _default$7 as CondOpSelect, _default$8 as ContentMenu, CustomContentMenuFunction, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$9 as DataSourceAddButton, _default$10 as DataSourceConfigPanel, _default$11 as DataSourceFieldSelect, _default$12 as DataSourceFields, _default$13 as DataSourceInput, DataSourceListSlots, _default$14 as DataSourceMethodSelect, _default$15 as DataSourceMethods, _default$16 as DataSourceMocks, _default$17 as DataSourceSelect, DataSourceStepValue, DatasourceTypeOption, DepTargetType, DiffDialogPayload, _default$18 as DisplayConds, DragClassification, DragType, DslOpOptions, DslOpWithHistoryIdsResult, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EventBus, EventBusEvent, _default$19 as EventSelect, Fixed2Other, _default$20 as FloatingBox, FrameworkSlots, GetCodeBlockFormConfigOptions, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryBucketConfig, _default$21 as HistoryDiffDialog, _default$22 as HistoryListBucket, _default$23 as HistoryListBucketTab, HistoryListExtraTab, HistoryOpOptions, HistoryOpOptionsWithChangeRecords, HistoryOpSource, HistoryOpType, HistoryPersistOptions, HistoryRowDescriptor, HistoryState, _default$24 as Icon, IdleTask, IdleTaskEvents, IsExpandableFunction, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$25 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$26 as LayerPanel, LayerPanelSlots, Layout, _default$27 as LayoutContainer, _default$27 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$28 as PageFragmentSelect, PageHistoryGroup, PageHistoryStepEntry, PartSortableOptions, PastePosition, PersistedHistoryState, PropsFormConfigFunction, _default$29 as PropsFormPanel, PropsFormValueFunction, _default$30 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$31 as Resizer, ScrollViewer, ScrollViewerEvent, ScrollViewerSlots, SerializedUndoRedo, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StackHistoryGroup, StageCore, StageOptions, StageOverlayState, StageRect, StageSlots, StepDiffItem, StepValue, StoreState, StoreStateKey, _default$32 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$33 as TMagicCodeEditor, _default$34 as TMagicEditor, _default$35 as ToolButton, _default$36 as Tree, _default$37 as TreeNode, TreeNodeData, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$38 as codeBlockService, collectRelatedNodes, createStackStep, _default$39 as dataSourceService, debug, _default$40 as default, defaultIsExpandable, _default$41 as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectPageTargetId, detectPageTargetName, detectStackOpType, displayTabConfig, editorNodeMergeCustomizer, _default$42 as editorService, eqOptions, error, eventTabConfig, _default$43 as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, _default$44 as historyService, idbDelete, idbGet, idbSet, info, isIncludeDataSource, isIndexedDBSupported, _default$45 as loadMonaco, log, markStackSaved, mergePageSteps, mergeStackSteps, moveItemsInContainer, numberOptions, openIndexedDB, _default$46 as propsService, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, _default$47 as stageOverlayService, _default$48 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$49 as uiService, undoFloor, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };
6368
+ export { AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BaseStepValue, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CanDropInFunction, CanDropInScene, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeBlockStepValue, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, CompareCategory, _default$5 as CompareForm, CompareFormLoadConfig, CompareFormLoadConfigContext, ComponentGroup, ComponentGroupState, ComponentItem, _default$6 as ComponentListPanel, ComponentListPanelSlots, _default$7 as CondOpSelect, ConfirmAndRevertOptions, _default$8 as ContentMenu, CustomContentMenuFunction, CustomDiffFormOptions, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$9 as DataSourceAddButton, _default$10 as DataSourceConfigPanel, _default$11 as DataSourceFieldSelect, _default$12 as DataSourceFields, _default$13 as DataSourceInput, DataSourceListSlots, _default$14 as DataSourceMethodSelect, _default$15 as DataSourceMethods, _default$16 as DataSourceMocks, _default$17 as DataSourceSelect, DataSourceStepValue, DatasourceTypeOption, DepTargetType, DiffDialogPayload, _default$18 as DisplayConds, DragClassification, DragType, DslOpOptions, DslOpWithHistoryIdsResult, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EventBus, EventBusEvent, _default$19 as EventSelect, Fixed2Other, _default$20 as FloatingBox, FrameworkSlots, GetCodeBlockFormConfigOptions, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryBucketConfig, _default$21 as HistoryDiffDialog, HistoryEvents, HistoryGroup, _default$22 as HistoryListBucket, _default$23 as HistoryListBucketTab, HistoryListExtraTab, HistoryOpOptions, HistoryOpOptionsWithChangeRecords, HistoryOpSource, HistoryOpType, HistoryPersistOptions, HistoryRowDescriptor, HistoryState, HistoryStepEntry, HistoryStepType, HistorySteps, _default$24 as Icon, IdleTask, IdleTaskEvents, IsExpandableFunction, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$25 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$26 as LayerPanel, LayerPanelSlots, Layout, _default$27 as LayoutContainer, _default$27 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$28 as PageFragmentSelect, PartSortableOptions, PastePosition, PersistedHistoryState, PropsFormConfigFunction, _default$29 as PropsFormPanel, PropsFormValueFunction, _default$30 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$31 as Resizer, ScrollViewer, ScrollViewerEvent, ScrollViewerSlots, SerializedUndoRedo, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StageCore, StageOptions, StageOverlayState, StageRect, StageSlots, StepDiffItem, StepExtra, StepValue, StoreState, StoreStateKey, _default$32 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$33 as TMagicCodeEditor, _default$34 as TMagicEditor, _default$35 as ToolButton, _default$36 as Tree, _default$37 as TreeNode, TreeNodeData, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, UseHistoryRevertOptions, V_GUIDE_LINE_STORAGE_KEY, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$38 as codeBlockService, collectRelatedNodes, _default$39 as componentListService, confirmHistoryAction, createStackStep, _default$40 as dataSourceService, debug, _default$41 as default, defaultIsExpandable, _default$42 as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, _default$43 as editorService, eqOptions, error, eventTabConfig, _default$44 as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, _default$45 as historyService, idbDelete, idbGet, idbSet, info, isIncludeDataSource, isIndexedDBSupported, _default$46 as keybindingService, _default$47 as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, numberOptions, openIndexedDB, _default$48 as propsService, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, _default$49 as stageOverlayService, _default$50 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$51 as uiService, undoFloor, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };