@tmagic/editor 1.8.0-beta.8 → 1.8.0-manmanyu.8

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 (115) hide show
  1. package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +13 -3
  2. package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +1 -4
  3. package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +11 -4
  4. package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +9 -4
  5. package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +4 -1
  6. package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +4 -1
  7. package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +68 -43
  8. package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +5 -1
  9. package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  10. package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +10 -7
  11. package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +4 -1
  12. package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +4 -1
  13. package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +4 -1
  14. package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +4 -1
  15. package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +4 -1
  16. package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  17. package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +8 -2
  18. package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +101 -64
  19. package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +4 -1
  20. package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  21. package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +5 -4
  22. package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +4 -1
  23. package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -1
  24. package/dist/es/fields/StyleSetter/icons/align-items/Center.js +31 -0
  25. package/dist/es/fields/StyleSetter/icons/align-items/FlexEnd.js +31 -0
  26. package/dist/es/fields/StyleSetter/icons/align-items/FlexStart.js +31 -0
  27. package/dist/es/fields/StyleSetter/icons/align-items/SpaceAround.js +50 -0
  28. package/dist/es/fields/StyleSetter/icons/align-items/SpaceBetween.js +50 -0
  29. package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +6 -6
  30. package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +5 -2
  31. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +28 -5
  32. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +31 -5
  33. package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +10 -2
  34. package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +10 -2
  35. package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +10 -2
  36. package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +10 -2
  37. package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +16 -2
  38. package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +18 -2
  39. package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +18 -2
  40. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +36 -2
  41. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +32 -2
  42. package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +11 -6
  43. package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +6 -3
  44. package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +82 -46
  45. package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +4 -1
  46. package/dist/es/icons/DatasourceIcon.js +17 -0
  47. package/dist/es/index.js +2 -2
  48. package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +14 -10
  49. package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +2 -2
  50. package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +18 -28
  51. package/dist/es/layouts/history-list/useHistoryList.js +4 -4
  52. package/dist/es/layouts/history-list/useHistoryRevert.js +6 -6
  53. package/dist/es/services/codeBlock.js +28 -32
  54. package/dist/es/services/dataSource.js +34 -43
  55. package/dist/es/services/editor.js +26 -31
  56. package/dist/es/services/history.js +392 -259
  57. package/dist/es/style.css +294 -37
  58. package/dist/es/utils/const.js +1 -1
  59. package/dist/es/utils/history.js +47 -35
  60. package/dist/es/utils/props.js +137 -31
  61. package/dist/style.css +294 -37
  62. package/dist/themes/magic-admin.css +2316 -0
  63. package/dist/tmagic-editor.umd.cjs +1665 -880
  64. package/package.json +7 -7
  65. package/src/Editor.vue +13 -1
  66. package/src/components/ContentMenu.vue +10 -2
  67. package/src/components/FloatingBox.vue +13 -2
  68. package/src/editorProps.ts +9 -0
  69. package/src/fields/CodeSelect.vue +51 -40
  70. package/src/fields/CodeSelectCol.vue +1 -0
  71. package/src/fields/DataSourceFieldSelect/Index.vue +14 -5
  72. package/src/fields/DisplayConds.vue +4 -1
  73. package/src/fields/EventSelect.vue +58 -32
  74. package/src/fields/StyleSetter/Index.vue +1 -4
  75. package/src/fields/StyleSetter/components/Border.vue +1 -1
  76. package/src/fields/StyleSetter/icons/align-items/Center.vue +19 -0
  77. package/src/fields/StyleSetter/icons/align-items/FlexEnd.vue +19 -0
  78. package/src/fields/StyleSetter/icons/align-items/FlexStart.vue +19 -0
  79. package/src/fields/StyleSetter/icons/align-items/SpaceAround.vue +34 -0
  80. package/src/fields/StyleSetter/icons/align-items/SpaceBetween.vue +34 -0
  81. package/src/fields/StyleSetter/icons/align-items/index copy.ts +5 -0
  82. package/src/fields/StyleSetter/icons/align-items/index.ts +5 -0
  83. package/src/fields/StyleSetter/icons/background-repeat/NoRepeat.vue +20 -4
  84. package/src/fields/StyleSetter/icons/background-repeat/Repeat.vue +10 -28
  85. package/src/fields/StyleSetter/icons/background-repeat/RepeatX.vue +4 -5
  86. package/src/fields/StyleSetter/icons/background-repeat/RepeatY.vue +4 -5
  87. package/src/fields/StyleSetter/icons/flex-direction/Column.vue +4 -3
  88. package/src/fields/StyleSetter/icons/flex-direction/ColumnReverse.vue +4 -3
  89. package/src/fields/StyleSetter/icons/flex-direction/Row.vue +4 -3
  90. package/src/fields/StyleSetter/icons/flex-direction/RowReverse.vue +4 -3
  91. package/src/fields/StyleSetter/icons/justify-content/Center.vue +5 -2
  92. package/src/fields/StyleSetter/icons/justify-content/FlexEnd.vue +15 -2
  93. package/src/fields/StyleSetter/icons/justify-content/FlexStart.vue +15 -2
  94. package/src/fields/StyleSetter/icons/justify-content/SpaceAround.vue +28 -3
  95. package/src/fields/StyleSetter/icons/justify-content/SpaceBetween.vue +28 -2
  96. package/src/fields/StyleSetter/pro/Background.vue +11 -5
  97. package/src/fields/StyleSetter/pro/Font.vue +3 -3
  98. package/src/fields/StyleSetter/pro/Layout.vue +105 -28
  99. package/src/fields/UISelect.vue +1 -1
  100. package/src/icons/DatasourceIcon.vue +7 -0
  101. package/src/layouts/Framework.vue +7 -1
  102. package/src/theme/code-block.scss +37 -0
  103. package/src/theme/common/var.scss +1 -1
  104. package/src/theme/component-list-panel.scss +2 -2
  105. package/src/theme/data-source-field.scss +4 -0
  106. package/src/theme/display-conds.scss +11 -0
  107. package/src/theme/event.scss +55 -1
  108. package/src/theme/history-list-panel.scss +9 -9
  109. package/src/theme/props-panel.scss +2 -1
  110. package/src/theme/style-setter/border.scss +14 -5
  111. package/src/theme/theme.scss +1 -0
  112. package/src/theme/themes/magic-admin/index.scss +125 -0
  113. package/src/utils/const.ts +2 -1
  114. package/src/utils/props.ts +138 -9
  115. package/types/index.d.ts +310 -315
@@ -1,5 +1,5 @@
1
1
  import BaseService from "./BaseService.js";
2
- import { createStackStep, describeRevertStep, getLastPushedHistoryIds } from "../utils/history.js";
2
+ import { describeRevertStep, getLastPushedHistoryIds } from "../utils/history.js";
3
3
  import history_default from "./history.js";
4
4
  import storage_default, { Protocol } from "./storage.js";
5
5
  import { COPY_DS_STORAGE_KEY } from "../utils/editor.js";
@@ -92,15 +92,12 @@ var DataSource = class extends BaseService {
92
92
  id: config.id && !this.getDataSourceById(config.id) ? config.id : this.createId()
93
93
  };
94
94
  this.get("dataSources").push(newConfig);
95
- if (!doNotPushHistory) {
96
- const step = createStackStep(newConfig.id, {
97
- oldValue: null,
98
- newValue: newConfig,
99
- historyDescription,
100
- source: historySource
101
- });
102
- this.lastPushedHistoryId = (step ? history_default.push("dataSource", step, newConfig.id) : null)?.uuid ?? null;
103
- }
95
+ if (!doNotPushHistory) this.lastPushedHistoryId = history_default.pushDataSource(newConfig.id, {
96
+ oldSchema: null,
97
+ newSchema: newConfig,
98
+ historyDescription,
99
+ source: historySource
100
+ })?.uuid ?? null;
104
101
  this.emit("add", newConfig);
105
102
  return newConfig;
106
103
  }
@@ -118,16 +115,13 @@ var DataSource = class extends BaseService {
118
115
  const oldConfig = dataSources[index];
119
116
  const newConfig = cloneDeep$1(config);
120
117
  dataSources[index] = newConfig;
121
- if (!doNotPushHistory) {
122
- const step = createStackStep(newConfig.id, {
123
- oldValue: oldConfig ? cloneDeep$1(oldConfig) : null,
124
- newValue: newConfig,
125
- changeRecords,
126
- historyDescription,
127
- source: historySource
128
- });
129
- this.lastPushedHistoryId = (step ? history_default.push("dataSource", step, newConfig.id) : null)?.uuid ?? null;
130
- }
118
+ if (!doNotPushHistory) this.lastPushedHistoryId = history_default.pushDataSource(newConfig.id, {
119
+ oldSchema: oldConfig ? cloneDeep$1(oldConfig) : null,
120
+ newSchema: newConfig,
121
+ changeRecords,
122
+ historyDescription,
123
+ source: historySource
124
+ })?.uuid ?? null;
131
125
  this.emit("update", newConfig, {
132
126
  oldConfig,
133
127
  changeRecords
@@ -146,15 +140,12 @@ var DataSource = class extends BaseService {
146
140
  const index = dataSources.findIndex((ds) => ds.id === id);
147
141
  const oldConfig = index !== -1 ? dataSources[index] : null;
148
142
  dataSources.splice(index, 1);
149
- if (oldConfig && !doNotPushHistory) {
150
- const step = createStackStep(id, {
151
- oldValue: cloneDeep$1(oldConfig),
152
- newValue: null,
153
- historyDescription,
154
- source: historySource
155
- });
156
- this.lastPushedHistoryId = (step ? history_default.push("dataSource", step, id) : null)?.uuid ?? null;
157
- }
143
+ if (oldConfig && !doNotPushHistory) this.lastPushedHistoryId = history_default.pushDataSource(id, {
144
+ oldSchema: cloneDeep$1(oldConfig),
145
+ newSchema: null,
146
+ historyDescription,
147
+ source: historySource
148
+ })?.uuid ?? null;
158
149
  this.emit("remove", id);
159
150
  }
160
151
  /**
@@ -200,7 +191,7 @@ var DataSource = class extends BaseService {
200
191
  * @returns 撤销的 step;栈不存在或已无可撤销时返回 null
201
192
  */
202
193
  undo(id) {
203
- const step = history_default.undo("dataSource", id);
194
+ const step = history_default.undoDataSource(id);
204
195
  if (!step) return null;
205
196
  this.applyHistoryStep(step, true);
206
197
  return step;
@@ -211,18 +202,18 @@ var DataSource = class extends BaseService {
211
202
  * @returns 重做的 step;栈不存在或已无可重做时返回 null
212
203
  */
213
204
  redo(id) {
214
- const step = history_default.redo("dataSource", id);
205
+ const step = history_default.redoDataSource(id);
215
206
  if (!step) return null;
216
207
  this.applyHistoryStep(step, false);
217
208
  return step;
218
209
  }
219
210
  /** 是否可对指定数据源撤销。 */
220
211
  canUndo(id) {
221
- return history_default.canUndo("dataSource", id);
212
+ return history_default.canUndoDataSource(id);
222
213
  }
223
214
  /** 是否可对指定数据源重做。 */
224
215
  canRedo(id) {
225
- return history_default.canRedo("dataSource", id);
216
+ return history_default.canRedoDataSource(id);
226
217
  }
227
218
  /**
228
219
  * 跳转指定数据源的历史栈到目标游标。语义同 editor.gotoPageStep。
@@ -232,7 +223,7 @@ var DataSource = class extends BaseService {
232
223
  * @returns 实际移动到的最终游标位置
233
224
  */
234
225
  goto(id, targetCursor) {
235
- let cursor = history_default.getCursor("dataSource", id);
226
+ let cursor = history_default.getDataSourceCursor(id);
236
227
  const target = Math.max(0, targetCursor);
237
228
  while (cursor > target) {
238
229
  if (!this.undo(id)) break;
@@ -255,11 +246,11 @@ var DataSource = class extends BaseService {
255
246
  * @returns 反向后产生的新 step;目标不存在 / 未应用时返回 null
256
247
  */
257
248
  revert(id, index) {
258
- const entry = history_default.getStepList("dataSource", id)[index];
249
+ const entry = history_default.getDataSourceStepList(id)[index];
259
250
  if (!entry?.applied) return null;
260
251
  const { oldSchema, newSchema, changeRecords } = entry.step.diff?.[0] ?? {};
261
252
  if (oldSchema && newSchema && !changeRecords?.length) return null;
262
- const description = `回滚 #${index + 1}: ${describeRevertStep(entry.step.data.id, entry.step.diff?.[0], (s) => s.title)}`;
253
+ const description = `回滚 #${index + 1}: ${describeRevertStep(entry.step.id, entry.step.diff?.[0], (s) => s.title)}`;
263
254
  return this.applyRevertStep(entry.step, description);
264
255
  }
265
256
  /**
@@ -271,7 +262,7 @@ var DataSource = class extends BaseService {
271
262
  */
272
263
  revertById(uuids) {
273
264
  return uuids.map((uuid) => {
274
- const location = history_default.findStepLocationByUuid("dataSource", uuid);
265
+ const location = history_default.findDataSourceStepLocationByUuid(uuid);
275
266
  if (!location) return null;
276
267
  return this.revert(location.id, location.index);
277
268
  });
@@ -334,21 +325,21 @@ var DataSource = class extends BaseService {
334
325
  * 同构,差异仅在于走对应的公共 add / update / remove 而不是带 doNotPushHistory 的版本。
335
326
  */
336
327
  applyRevertStep(step, historyDescription) {
337
- const { id } = step.data;
328
+ const { id } = step;
338
329
  const { oldSchema, newSchema, changeRecords } = step.diff?.[0] ?? {};
339
330
  if (!oldSchema && newSchema) {
340
331
  this.remove(`${id}`, {
341
332
  historyDescription,
342
333
  historySource: "rollback"
343
334
  });
344
- return history_default.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
335
+ return history_default.getDataSourceStepList(id).slice(-1)[0]?.step ?? null;
345
336
  }
346
337
  if (oldSchema && !newSchema) {
347
338
  this.add(cloneDeep$1(oldSchema), {
348
339
  historyDescription,
349
340
  historySource: "rollback"
350
341
  });
351
- return history_default.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
342
+ return history_default.getDataSourceStepList(id).slice(-1)[0]?.step ?? null;
352
343
  }
353
344
  if (!oldSchema || !newSchema) return null;
354
345
  if (changeRecords?.length) {
@@ -369,13 +360,13 @@ var DataSource = class extends BaseService {
369
360
  historyDescription,
370
361
  historySource: "rollback"
371
362
  });
372
- return history_default.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
363
+ return history_default.getDataSourceStepList(id).slice(-1)[0]?.step ?? null;
373
364
  }
374
365
  this.update(cloneDeep$1(oldSchema), {
375
366
  historyDescription,
376
367
  historySource: "rollback"
377
368
  });
378
- return history_default.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
369
+ return history_default.getDataSourceStepList(id).slice(-1)[0]?.step ?? null;
379
370
  }
380
371
  /**
381
372
  * 把一条历史 step 应用到当前数据源服务上。
@@ -392,7 +383,7 @@ var DataSource = class extends BaseService {
392
383
  * @param reverse true=撤销,false=重做
393
384
  */
394
385
  applyHistoryStep(step, reverse) {
395
- const { id } = step.data;
386
+ const { id } = step;
396
387
  const { oldSchema, newSchema, changeRecords } = step.diff?.[0] ?? {};
397
388
  if (!oldSchema && newSchema) {
398
389
  if (reverse) this.remove(`${id}`, { doNotPushHistory: true });
@@ -74,7 +74,7 @@ var Editor = class extends BaseService {
74
74
  this.state.stageLoading = this.state.pageLength !== 0;
75
75
  if (preValue && !isEmpty(preValue)) this.pushRootDiffHistory(preValue, app, options.historySource);
76
76
  else app.items?.forEach((pageNode) => {
77
- if (pageNode?.id !== void 0 && !history_default.getMarker("page", pageNode.id)) history_default.setMarker("page", pageNode.id, {
77
+ if (pageNode?.id !== void 0 && !history_default.getPageMarker(pageNode.id)) history_default.setPageMarker(pageNode.id, {
78
78
  name: pageNode.name,
79
79
  source: options.historySource
80
80
  });
@@ -176,6 +176,8 @@ var Editor = class extends BaseService {
176
176
  this.set("nodes", node ? [node] : []);
177
177
  this.set("page", page);
178
178
  this.set("parent", parent);
179
+ if (page) history_default.changePage(toRaw(page));
180
+ else history_default.resetState();
179
181
  if (node?.id) this.get("stage")?.renderer?.runtime?.getApp?.()?.page?.emit("editor:select", {
180
182
  node,
181
183
  page,
@@ -366,7 +368,10 @@ var Editor = class extends BaseService {
366
368
  if (pages[0]) {
367
369
  await this.select(pages[0]);
368
370
  stage?.select(pages[0].id);
369
- } else this.selectRoot();
371
+ } else {
372
+ this.selectRoot();
373
+ history_default.resetPage();
374
+ }
370
375
  };
371
376
  const rootItems = root.items || [];
372
377
  if (isPage(node)) {
@@ -870,9 +875,7 @@ var Editor = class extends BaseService {
870
875
  * @returns 被撤销的操作
871
876
  */
872
877
  async undo() {
873
- const pageId = this.get("page")?.id;
874
- if (pageId === void 0) return null;
875
- const value = history_default.undo("page", pageId);
878
+ const value = history_default.undo();
876
879
  if (value) await this.applyHistoryOp(value, true);
877
880
  return value;
878
881
  }
@@ -881,9 +884,7 @@ var Editor = class extends BaseService {
881
884
  * @returns 被恢复的操作
882
885
  */
883
886
  async redo() {
884
- const pageId = this.get("page")?.id;
885
- if (pageId === void 0) return null;
886
- const value = history_default.redo("page", pageId);
887
+ const value = history_default.redo();
887
888
  if (value) await this.applyHistoryOp(value, false);
888
889
  return value;
889
890
  }
@@ -904,7 +905,7 @@ var Editor = class extends BaseService {
904
905
  * @returns 反向后产生的新 step;目标不存在 / 未应用 / 反向失败时返回 null
905
906
  */
906
907
  async revertPageStep(index) {
907
- const entry = history_default.getStepList("page", this.get("page")?.id)[index];
908
+ const entry = history_default.getPageStepList()[index];
908
909
  if (!entry?.applied) return null;
909
910
  const { step } = entry;
910
911
  if (step.opType === "initial") return null;
@@ -914,7 +915,7 @@ var Editor = class extends BaseService {
914
915
  if (!items.length || !items.every((item) => item.changeRecords?.length)) return null;
915
916
  }
916
917
  let revertedStep = null;
917
- const captureRevert = (_pageId, s) => {
918
+ const captureRevert = (s) => {
918
919
  revertedStep = s;
919
920
  };
920
921
  history_default.once("change", captureRevert);
@@ -984,10 +985,9 @@ var Editor = class extends BaseService {
984
985
  */
985
986
  async revertPageStepById(uuids) {
986
987
  const results = [];
987
- const pageId = this.get("page")?.id;
988
988
  for (const uuid of uuids) {
989
- const location = history_default.findStepLocationByUuid("page", uuid, pageId);
990
- results.push(!location ? null : await this.revertPageStep(location.index));
989
+ const index = history_default.getPageStepIndexByUuid(uuid);
990
+ results.push(index < 0 ? null : await this.revertPageStep(index));
991
991
  }
992
992
  return results;
993
993
  }
@@ -1001,9 +1001,8 @@ var Editor = class extends BaseService {
1001
1001
  * @returns 实际移动到的最终游标位置
1002
1002
  */
1003
1003
  async gotoPageStep(targetCursor) {
1004
- const pageId = this.get("page")?.id;
1005
- let cursor = history_default.getCursor("page", pageId);
1006
- const { length } = history_default.getStepList("page", pageId);
1004
+ let cursor = history_default.getPageCursor();
1005
+ const { length } = history_default.getPageStepList();
1007
1006
  const target = Math.max(0, Math.min(targetCursor, length));
1008
1007
  while (cursor > target) {
1009
1008
  if (!await this.undo()) break;
@@ -1118,34 +1117,30 @@ var Editor = class extends BaseService {
1118
1117
  id: page.id
1119
1118
  },
1120
1119
  opType,
1121
- extra: {
1122
- selectedBefore: [],
1123
- selectedAfter: [],
1124
- modifiedNodeIds: /* @__PURE__ */ new Map()
1125
- },
1120
+ selectedBefore: [],
1121
+ selectedAfter: [],
1122
+ modifiedNodeIds: /* @__PURE__ */ new Map(),
1126
1123
  diff: [diffItem],
1127
1124
  rootStep: true
1128
1125
  };
1129
1126
  if (source) step.source = source;
1130
1127
  const top = history_default.getCurrentPageStep(page.id);
1131
- if (top?.rootStep && top.source === source) history_default.replaceCurrentStep("page", step, page.id);
1132
- else history_default.push("page", step, page.id);
1128
+ if (top?.rootStep && top.source === source) history_default.replaceCurrentPageStep(step, page.id);
1129
+ else history_default.push(step, page.id);
1133
1130
  }
1134
1131
  pushOpHistory(opType, { diff, pageData, historyDescription, source }) {
1135
1132
  const step = {
1136
1133
  uuid: guid(),
1137
1134
  data: pageData,
1138
1135
  opType,
1139
- extra: {
1140
- selectedBefore: this.selectionBeforeOp ?? [],
1141
- selectedAfter: this.get("nodes").map((n) => n.id),
1142
- modifiedNodeIds: new Map(this.get("modifiedNodeIds"))
1143
- },
1136
+ selectedBefore: this.selectionBeforeOp ?? [],
1137
+ selectedAfter: this.get("nodes").map((n) => n.id),
1138
+ modifiedNodeIds: new Map(this.get("modifiedNodeIds")),
1144
1139
  diff
1145
1140
  };
1146
1141
  if (historyDescription) step.historyDescription = historyDescription;
1147
1142
  if (source) step.source = source;
1148
- const historyId = history_default.push("page", step, pageData.id) ? step.uuid : null;
1143
+ const historyId = history_default.push(step, pageData.id) ? step.uuid : null;
1149
1144
  this.lastPushedHistoryId = historyId;
1150
1145
  this.selectionBeforeOp = null;
1151
1146
  return historyId;
@@ -1246,10 +1241,10 @@ var Editor = class extends BaseService {
1246
1241
  break;
1247
1242
  }
1248
1243
  }
1249
- this.set("modifiedNodeIds", step.extra?.modifiedNodeIds ?? /* @__PURE__ */ new Map());
1244
+ this.set("modifiedNodeIds", step.modifiedNodeIds);
1250
1245
  const page = toRaw(this.get("page"));
1251
1246
  if (page) {
1252
- const selectIds = (reverse ? step.extra?.selectedBefore : step.extra?.selectedAfter) ?? [];
1247
+ const selectIds = reverse ? step.selectedBefore : step.selectedAfter;
1253
1248
  setTimeout(() => {
1254
1249
  if (!selectIds.length) return;
1255
1250
  if (selectIds.length > 1) {