@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.
- package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +11 -3
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +24 -11
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/components/Icon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/Resizer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SearchInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SplitView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ToolButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/DataSourceFieldSelect/FieldSelect.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +1 -1
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Block.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Flex.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Inline.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/InlineBlock.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/None.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Left.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Right.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/CenterIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/CodeIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/index.js +8 -4
- package/dist/es/layouts/AddPageBox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/layouts/NavMenuColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +39 -27
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +10 -3
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +167 -302
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/composables.js +23 -55
- package/dist/es/layouts/history-list/useHistoryList.js +56 -0
- package/dist/es/layouts/history-list/useHistoryRevert.js +307 -0
- package/dist/es/layouts/page-bar/AddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/Search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/props-panel/FormPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/layouts/sidebar/data-source/DataSourceList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/layer/LayerMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/layer/LayerNodeTool.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/ViewerMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/services/codeBlock.js +32 -28
- package/dist/es/services/dataSource.js +43 -34
- package/dist/es/services/editor.js +31 -26
- package/dist/es/services/history.js +268 -384
- package/dist/es/style.css +12 -0
- package/dist/es/utils/dep/worker.js +1 -1
- package/dist/es/utils/history.js +35 -47
- package/dist/style.css +12 -0
- package/dist/tmagic-editor.umd.cjs +5524 -4807
- package/package.json +8 -8
- package/src/Editor.vue +10 -1
- package/src/components/CompareForm.vue +28 -7
- package/src/fields/DataSourceInput.vue +3 -3
- package/src/index.ts +4 -0
- package/src/layouts/NavMenu.vue +2 -2
- package/src/layouts/history-list/GroupRow.vue +10 -0
- package/src/layouts/history-list/HistoryDiffDialog.vue +8 -1
- package/src/layouts/history-list/HistoryListPanel.vue +64 -251
- package/src/layouts/history-list/PageTab.vue +4 -4
- package/src/layouts/history-list/composables.ts +52 -90
- package/src/layouts/history-list/useHistoryList.ts +60 -0
- package/src/layouts/history-list/useHistoryRevert.ts +406 -0
- package/src/services/codeBlock.ts +30 -29
- package/src/services/dataSource.ts +37 -37
- package/src/services/editor.ts +32 -29
- package/src/services/history.ts +340 -430
- package/src/theme/history-list-panel.scss +14 -0
- package/src/type.ts +185 -92
- package/src/utils/history.ts +52 -67
- package/types/index.d.ts +466 -297
package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { useServices } from "../../hooks/use-services.js";
|
|
2
2
|
import Icon_default from "../../components/Icon.js";
|
|
3
|
-
import { describeStep, isSingleDiffStepRevertable
|
|
3
|
+
import { confirmHistoryAction, describeStep, isSingleDiffStepRevertable } from "./composables.js";
|
|
4
4
|
import BucketTab_default from "./BucketTab.js";
|
|
5
|
-
import HistoryDiffDialog_default from "./HistoryDiffDialog.js";
|
|
6
5
|
import PageTab_default from "./PageTab.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useHistoryList } from "./useHistoryList.js";
|
|
7
|
+
import { useHistoryRevert } from "./useHistoryRevert.js";
|
|
8
|
+
import { TMagicButton, TMagicPopover, TMagicTabs, TMagicTooltip, getDesignConfig, tMagicMessage } from "@tmagic/design";
|
|
9
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, markRaw, mergeProps, normalizeProps, openBlock, ref, renderList, resolveDynamicComponent, toHandlers, unref, watch, withCtx } from "vue";
|
|
9
10
|
import { Clock, Close } from "@element-plus/icons-vue";
|
|
10
11
|
//#region packages/editor/src/layouts/history-list/HistoryListPanel.vue?vue&type=script&setup=true&lang.ts
|
|
11
12
|
var _hoisted_1 = { class: "m-editor-history-list" };
|
|
12
|
-
|
|
13
|
-
* 构造差异弹窗入参:仅 update(前后值都存在)可对比。
|
|
14
|
-
* - 页面(无 id):在全部分组中按 index 定位 step,目标 id 取自快照;
|
|
15
|
-
* - 数据源 / 代码块(带 id):先匹配分组 id 再按 index 定位。
|
|
16
|
-
* 无可对比内容(多节点 / add / remove)或定位不到时返回 null。
|
|
17
|
-
*/
|
|
18
|
-
var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13
|
+
var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
14
|
name: "MEditorHistoryListPanel",
|
|
20
15
|
__name: "HistoryListPanel",
|
|
21
16
|
setup(__props) {
|
|
@@ -56,7 +51,8 @@ var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
56
51
|
const extraTabs = inject("historyListExtraTabs", []);
|
|
57
52
|
/** label 支持字符串或函数,函数形式便于展示动态数量等内容。 */
|
|
58
53
|
const resolveTabLabel = (tab) => typeof tab.label === "function" ? tab.label() : tab.label;
|
|
59
|
-
const
|
|
54
|
+
const services = useServices();
|
|
55
|
+
const { editorService, dataSourceService, codeBlockService, historyService, propsService, stageOverlayService } = services;
|
|
60
56
|
/**
|
|
61
57
|
* 数据源 / 代码块功能可被业务方通过 `disabledDataSource` / `disabledCodeBlock` 禁用,
|
|
62
58
|
* 禁用后对应的历史记录 tab 不再展示。若当前激活的 tab 恰好被禁用,则回退到「页面」tab。
|
|
@@ -72,32 +68,41 @@ var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
72
68
|
* 未提供时为 undefined,CompareForm/MForm 会跳过 extendState 处理。
|
|
73
69
|
*/
|
|
74
70
|
const extendFormState = inject("extendFormState", void 0);
|
|
71
|
+
const getPropsPanelFormState = inject("getPropsPanelFormState", void 0);
|
|
75
72
|
const { expanded, toggleGroup, pageGroups, dataSourceGroups, codeBlockGroups, pageGroupsDisplay, dataSourceGroupsByTarget, codeBlockGroupsByTarget } = useHistoryList();
|
|
76
73
|
/**
|
|
77
74
|
* 当前活动页的「加载/初始」标记记录(设置 root 时生成),透传给 PageTab 的底部初始行展示。
|
|
78
75
|
* 基于 historyService 的 reactive state 派生,活动页切换或标记写入后自动刷新。
|
|
79
76
|
*/
|
|
80
|
-
const pageMarker = computed(() => historyService.
|
|
77
|
+
const pageMarker = computed(() => historyService.getMarker("page", editorService.get("page")?.id));
|
|
78
|
+
/**
|
|
79
|
+
* 各历史类型的展示名称(页面 / 数据源 / 代码块),由 historyService.state.stepNames 配置,
|
|
80
|
+
* 业务方可通过 historyService.setStepName / registerStepType 覆盖。基于 reactive state 派生,配置变更后自动刷新。
|
|
81
|
+
*/
|
|
82
|
+
const pageName = computed(() => historyService.getStepName("page"));
|
|
83
|
+
const dataSourceName = computed(() => historyService.getStepName("dataSource"));
|
|
84
|
+
const codeBlockName = computed(() => historyService.getStepName("codeBlock"));
|
|
81
85
|
/** 代码块 step 仅 update(前后 content 都存在)时可查看差异。 */
|
|
82
86
|
const isStepDiffable = (step) => Boolean(step.diff?.[0]?.oldSchema && step.diff?.[0]?.newSchema);
|
|
83
87
|
/**
|
|
84
88
|
* 数据源 / 代码块两类 bucket 历史的整体渲染配置:把 title / prefix 与各自的描述、
|
|
85
89
|
* 可差异、可回滚判定收敛为单一对象整体注入 BucketTab,组件内部按需读取。
|
|
90
|
+
* title / 描述回退名取自可配置的展示名称,故用 computed 使其随 stepNames 变更刷新。
|
|
86
91
|
*/
|
|
87
|
-
const dataSourceConfig = {
|
|
88
|
-
title:
|
|
92
|
+
const dataSourceConfig = computed(() => ({
|
|
93
|
+
title: dataSourceName.value,
|
|
89
94
|
prefix: "ds",
|
|
90
|
-
describeStep: (step) => describeStep(step, (schema) => schema?.title,
|
|
95
|
+
describeStep: (step) => describeStep(step, (schema) => schema?.title, dataSourceName.value),
|
|
91
96
|
isStepDiffable,
|
|
92
97
|
isStepRevertable: isSingleDiffStepRevertable
|
|
93
|
-
};
|
|
94
|
-
const codeBlockConfig = {
|
|
95
|
-
title:
|
|
98
|
+
}));
|
|
99
|
+
const codeBlockConfig = computed(() => ({
|
|
100
|
+
title: codeBlockName.value,
|
|
96
101
|
prefix: "cb",
|
|
97
|
-
describeStep: (step) => describeStep(step, (content) => content?.name,
|
|
102
|
+
describeStep: (step) => describeStep(step, (content) => content?.name, codeBlockName.value),
|
|
98
103
|
isStepDiffable,
|
|
99
104
|
isStepRevertable: isSingleDiffStepRevertable
|
|
100
|
-
};
|
|
105
|
+
}));
|
|
101
106
|
/** 把"目标 step 索引"翻译成"目标 cursor"(已应用步骤数量)。 */
|
|
102
107
|
const indexToCursor = (index) => index + 1;
|
|
103
108
|
const onPageGoto = (index) => {
|
|
@@ -110,7 +115,7 @@ var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
110
115
|
* - 该 step 涉及的节点都已不存在(如删除记录、被撤销的新增)时给出提示,不做选中。
|
|
111
116
|
*/
|
|
112
117
|
const onPageSelect = async (index) => {
|
|
113
|
-
const step = historyService.
|
|
118
|
+
const step = historyService.getStepList("page", editorService.get("page")?.id)[index]?.step;
|
|
114
119
|
if (!step) return;
|
|
115
120
|
const targetId = (step.diff ?? []).map((item) => item.newSchema?.id ?? item.oldSchema?.id).find((id) => id !== void 0 && id !== null && editorService.getNodeById(id, false));
|
|
116
121
|
if (targetId === void 0 || targetId === null) {
|
|
@@ -142,156 +147,15 @@ var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
142
147
|
const onCodeBlockGotoInitial = (id) => {
|
|
143
148
|
codeBlockService.goto(id, 0);
|
|
144
149
|
};
|
|
145
|
-
const diffDialogRef = useTemplateRef("diffDialog");
|
|
146
|
-
const confirmDialogRef = useTemplateRef("confirmDialog");
|
|
147
|
-
/**
|
|
148
|
-
* 三类历史(页面 / 数据源 / 代码块)差异弹窗入参的构造差异,收敛为一份配置:
|
|
149
|
-
* 仅「分组来源、当前值读取、类型 / 展示名提取」不同,定位 step、校验前后值、组装 payload 的流程共用。
|
|
150
|
-
*/
|
|
151
|
-
const buildDiffPayload = (source, index, id) => {
|
|
152
|
-
for (const group of source.groups()) {
|
|
153
|
-
if (id !== void 0 && group.id !== id) continue;
|
|
154
|
-
const step = group.steps.find((s) => s.index === index)?.step;
|
|
155
|
-
if (!step) continue;
|
|
156
|
-
const oldSchema = step.diff?.[0]?.oldSchema;
|
|
157
|
-
const newSchema = step.diff?.[0]?.newSchema;
|
|
158
|
-
if (!oldSchema || !newSchema) return null;
|
|
159
|
-
const targetId = id ?? newSchema.id ?? oldSchema.id;
|
|
160
|
-
const type = source.resolveType?.(newSchema, oldSchema);
|
|
161
|
-
return {
|
|
162
|
-
category: source.category,
|
|
163
|
-
...type !== void 0 ? { type } : {},
|
|
164
|
-
lastValue: oldSchema,
|
|
165
|
-
value: newSchema,
|
|
166
|
-
currentValue: (targetId !== void 0 ? source.getCurrent(targetId) : null) || null,
|
|
167
|
-
targetLabel: source.resolveLabel(newSchema, oldSchema, targetId),
|
|
168
|
-
id: targetId
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
return null;
|
|
172
|
-
};
|
|
173
|
-
const buildPageDiffPayload = (index) => buildDiffPayload({
|
|
174
|
-
category: "node",
|
|
175
|
-
groups: () => historyService.getPageHistoryGroups(),
|
|
176
|
-
getCurrent: (id) => editorService.getNodeById(id),
|
|
177
|
-
resolveType: (n, o) => n.type || o.type || "",
|
|
178
|
-
resolveLabel: (n, o) => n.name || o.name || n.type || o.type || ""
|
|
179
|
-
}, index);
|
|
180
|
-
const buildDataSourceDiffPayload = (id, index) => buildDiffPayload({
|
|
181
|
-
category: "data-source",
|
|
182
|
-
groups: () => historyService.getDataSourceHistoryGroups(),
|
|
183
|
-
getCurrent: (id) => dataSourceService.getDataSourceById(`${id}`),
|
|
184
|
-
resolveType: (n, o) => n.type || o.type || "base",
|
|
185
|
-
resolveLabel: (n, o, id) => n.title || o.title || `${id}`
|
|
186
|
-
}, index, id);
|
|
187
|
-
const buildCodeBlockDiffPayload = (id, index) => buildDiffPayload({
|
|
188
|
-
category: "code-block",
|
|
189
|
-
groups: () => historyService.getCodeBlockHistoryGroups(),
|
|
190
|
-
getCurrent: (id) => codeBlockService.getCodeContentById(id),
|
|
191
|
-
resolveLabel: (n, o, id) => n.name || o.name || `${id}`
|
|
192
|
-
}, index, id);
|
|
193
|
-
const onPageDiff = (index) => {
|
|
194
|
-
const payload = buildPageDiffPayload(index);
|
|
195
|
-
if (payload) diffDialogRef.value?.open(payload);
|
|
196
|
-
};
|
|
197
|
-
const onDataSourceDiff = (id, index) => {
|
|
198
|
-
const payload = buildDataSourceDiffPayload(id, index);
|
|
199
|
-
if (payload) diffDialogRef.value?.open(payload);
|
|
200
|
-
};
|
|
201
|
-
const onCodeBlockDiff = (id, index) => {
|
|
202
|
-
const payload = buildCodeBlockDiffPayload(id, index);
|
|
203
|
-
if (payload) diffDialogRef.value?.open(payload);
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* 「回滚」统一入口:把目标历史步骤的修改作为一次新操作反向应用(类 git revert),
|
|
207
|
-
* 不破坏原有栈结构。各 service 内部完成反向 + 入栈,并自带描述用于面板展示。
|
|
208
|
-
*
|
|
209
|
-
* 交互:
|
|
210
|
-
* - 可差异对比的步骤(单节点 / 单实体 update):弹出差异弹窗供用户确认,点「确定回滚」再执行;
|
|
211
|
-
* - 无法对比的步骤(add / remove / 多节点更新,payload 为 null):弹出普通二次确认框,确认后执行。
|
|
212
|
-
*
|
|
213
|
-
* 页面 / 数据源 / 代码块三类回滚仅「差异入参构造」与「实际 revert 调用」不同,
|
|
214
|
-
* 由调用方分别传入 payload 与 revert,公共的弹窗 / 确认流程在此收敛。
|
|
215
|
-
*/
|
|
216
|
-
const runRevert = (payload) => {
|
|
217
|
-
if (payload && confirmDialogRef.value) return confirmDialogRef.value.confirm(payload);
|
|
218
|
-
return confirmRevert();
|
|
219
|
-
};
|
|
220
150
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* add(回滚即删除)即使目标已不在,也已达成「删除」目的,不视为失败。
|
|
225
|
-
*
|
|
226
|
-
* 命中时弹出「回滚失败」提示并返回 true,调用方据此中止本次回滚。
|
|
151
|
+
* 「单步回滚」与「查看差异」的完整逻辑收敛到 useHistoryRevert,面板与业务方共用:
|
|
152
|
+
* 二者均由 useHistoryRevert 内部按需动态挂载 HistoryDiffDialog,
|
|
153
|
+
* 业务方亦可直接 import useHistoryRevert(services) 调用,无需自行挂载任何弹窗。
|
|
227
154
|
*/
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const id = item.newSchema?.id ?? item.oldSchema?.id;
|
|
233
|
-
return id !== void 0 && !editorService.getNodeById(id, false);
|
|
234
|
-
});
|
|
235
|
-
if (step.opType === "remove") return (step.diff ?? []).some((item) => item.parentId !== void 0 && !editorService.getNodeById(item.parentId, false));
|
|
236
|
-
return false;
|
|
237
|
-
};
|
|
238
|
-
/** 数据源 update 步骤回滚时,对应数据源必须仍存在(已删除则无处写回旧值)。 */
|
|
239
|
-
const isDataSourceRevertTargetMissing = (id, index) => {
|
|
240
|
-
const step = historyService.getDataSourceStepList(id)[index]?.step;
|
|
241
|
-
return Boolean(step && step.opType === "update" && !dataSourceService.getDataSourceById(`${id}`));
|
|
242
|
-
};
|
|
243
|
-
/** 代码块 update 步骤回滚时,对应代码块必须仍存在(已删除则无处写回旧值)。 */
|
|
244
|
-
const isCodeBlockRevertTargetMissing = (id, index) => {
|
|
245
|
-
const step = historyService.getCodeBlockStepList(id)[index]?.step;
|
|
246
|
-
return Boolean(step && step.opType === "update" && !codeBlockService.getCodeContentById(id));
|
|
247
|
-
};
|
|
248
|
-
/** 目标数据已被删除、无法回滚时的统一提示。 */
|
|
249
|
-
const showRevertTargetMissing = () => {
|
|
250
|
-
tMagicMessage.error("回滚失败:该记录对应的数据已被删除");
|
|
251
|
-
};
|
|
252
|
-
const onPageRevert = (index) => {
|
|
253
|
-
if (isPageRevertTargetMissing(index)) {
|
|
254
|
-
showRevertTargetMissing();
|
|
255
|
-
return Promise.resolve(null);
|
|
256
|
-
}
|
|
257
|
-
return runRevert(buildPageDiffPayload(index)).then((result) => result ? editorService.revertPageStep(index) : null);
|
|
258
|
-
};
|
|
259
|
-
const onDataSourceRevert = (id, index) => {
|
|
260
|
-
if (isDataSourceRevertTargetMissing(id, index)) {
|
|
261
|
-
showRevertTargetMissing();
|
|
262
|
-
return Promise.resolve(null);
|
|
263
|
-
}
|
|
264
|
-
return runRevert(buildDataSourceDiffPayload(id, index)).then((result) => result ? dataSourceService.revert(id, index) : null);
|
|
265
|
-
};
|
|
266
|
-
const onCodeBlockRevert = (id, index) => {
|
|
267
|
-
if (isCodeBlockRevertTargetMissing(id, index)) {
|
|
268
|
-
showRevertTargetMissing();
|
|
269
|
-
return Promise.resolve(null);
|
|
270
|
-
}
|
|
271
|
-
return runRevert(buildCodeBlockDiffPayload(id, index)).then((result) => result ? codeBlockService.revert(id, index) : null);
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* 「回滚」二次确认:新增 / 删除 / 多节点更新等无法做差异对比的步骤,
|
|
275
|
-
* 不弹差异弹窗,改用一个普通确认框替代「确定回滚」按钮,避免点击后无任何提示直接执行。
|
|
276
|
-
* 用户取消时返回 false,调用方据此中止回滚。
|
|
277
|
-
*/
|
|
278
|
-
const confirmRevert = () => confirmDialog("确定回滚该步骤吗?回滚会将该操作作为一条新记录反向应用(新增将被删除、删除将被还原),不影响后续历史记录。");
|
|
279
|
-
/**
|
|
280
|
-
* 通用二次确认弹窗:清空历史 / 无法差异对比的回滚等会改变状态的操作,先弹出确认框,
|
|
281
|
-
* 用户点击「确定」返回 true,取消(confirm reject)时返回 false 并静默忽略。
|
|
282
|
-
*/
|
|
283
|
-
const confirmDialog = async (message) => {
|
|
284
|
-
try {
|
|
285
|
-
await tMagicMessageBox.confirm(message, "提示", {
|
|
286
|
-
confirmButtonText: "确定",
|
|
287
|
-
cancelButtonText: "取消",
|
|
288
|
-
type: "warning"
|
|
289
|
-
});
|
|
290
|
-
return true;
|
|
291
|
-
} catch (e) {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
155
|
+
const { onPageRevert, onDataSourceRevert, onCodeBlockRevert, onPageDiff, onDataSourceDiff, onCodeBlockDiff } = useHistoryRevert(services, {
|
|
156
|
+
extendState: extendFormState,
|
|
157
|
+
getPropsPanelFormState
|
|
158
|
+
});
|
|
295
159
|
/**
|
|
296
160
|
* 把内存中(已清空对应类别后的)历史状态重新写回 IndexedDB,
|
|
297
161
|
* 使本地持久化的那份与内存保持一致——即「连同本地保存的一并删除」。
|
|
@@ -303,158 +167,159 @@ var HistoryListPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
303
167
|
} catch (e) {}
|
|
304
168
|
};
|
|
305
169
|
const onPageClear = async () => {
|
|
306
|
-
if (await
|
|
307
|
-
historyService.
|
|
170
|
+
if (await confirmHistoryAction("确定清空当前页面的历史记录吗?清空后将无法撤销/重做之前的操作,本地保存的记录也会一并删除。")) {
|
|
171
|
+
historyService.clear("page", editorService.get("page")?.id);
|
|
308
172
|
await syncIndexedDB();
|
|
309
173
|
}
|
|
310
174
|
};
|
|
311
175
|
const onDataSourceClear = async () => {
|
|
312
|
-
if (await
|
|
313
|
-
historyService.
|
|
176
|
+
if (await confirmHistoryAction("确定清空数据源的历史记录吗?清空后将无法撤销/重做之前的操作,本地保存的记录也会一并删除。")) {
|
|
177
|
+
historyService.clear("dataSource");
|
|
314
178
|
await syncIndexedDB();
|
|
315
179
|
}
|
|
316
180
|
};
|
|
317
181
|
const onCodeBlockClear = async () => {
|
|
318
|
-
if (await
|
|
319
|
-
historyService.
|
|
182
|
+
if (await confirmHistoryAction("确定清空代码块的历史记录吗?清空后将无法撤销/重做之前的操作,本地保存的记录也会一并删除。")) {
|
|
183
|
+
historyService.clear("codeBlock");
|
|
320
184
|
await syncIndexedDB();
|
|
321
185
|
}
|
|
322
186
|
};
|
|
323
187
|
return (_ctx, _cache) => {
|
|
324
|
-
return openBlock(),
|
|
325
|
-
|
|
326
|
-
|
|
188
|
+
return openBlock(), createBlock(unref(TMagicPopover), {
|
|
189
|
+
"popper-class": "m-editor-history-list-popover",
|
|
190
|
+
placement: "bottom",
|
|
191
|
+
trigger: "click",
|
|
192
|
+
visible: visible.value,
|
|
193
|
+
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
|
|
194
|
+
width: 660
|
|
195
|
+
}, {
|
|
196
|
+
reference: withCtx(() => [createVNode(unref(TMagicTooltip), {
|
|
197
|
+
effect: "dark",
|
|
327
198
|
placement: "bottom",
|
|
328
|
-
|
|
329
|
-
visible: visible.value,
|
|
330
|
-
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
|
|
331
|
-
width: 660
|
|
199
|
+
content: "历史记录"
|
|
332
200
|
}, {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
201
|
+
default: withCtx(() => [createVNode(unref(TMagicButton), {
|
|
202
|
+
size: "small",
|
|
203
|
+
link: "",
|
|
204
|
+
onClick: _cache[2] || (_cache[2] = ($event) => visible.value = !visible.value)
|
|
337
205
|
}, {
|
|
338
|
-
|
|
339
|
-
size: "small",
|
|
340
|
-
link: "",
|
|
341
|
-
onClick: _cache[2] || (_cache[2] = ($event) => visible.value = !visible.value)
|
|
342
|
-
}, {
|
|
343
|
-
icon: withCtx(() => [createVNode(Icon_default, { icon: unref(ClockIcon) }, null, 8, ["icon"])]),
|
|
344
|
-
_: 1
|
|
345
|
-
})]),
|
|
206
|
+
icon: withCtx(() => [createVNode(Icon_default, { icon: unref(ClockIcon) }, null, 8, ["icon"])]),
|
|
346
207
|
_: 1
|
|
347
208
|
})]),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
_: 1
|
|
361
|
-
})]),
|
|
362
|
-
_: 1
|
|
363
|
-
}), createVNode(unref(TMagicTabs), {
|
|
364
|
-
modelValue: activeTab.value,
|
|
365
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeTab.value = $event),
|
|
366
|
-
class: "m-editor-history-list-tabs"
|
|
209
|
+
_: 1
|
|
210
|
+
})]),
|
|
211
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(unref(TMagicTooltip), {
|
|
212
|
+
effect: "dark",
|
|
213
|
+
placement: "top",
|
|
214
|
+
content: "关闭"
|
|
215
|
+
}, {
|
|
216
|
+
default: withCtx(() => [createVNode(unref(TMagicButton), {
|
|
217
|
+
class: "m-editor-history-list-close",
|
|
218
|
+
size: "small",
|
|
219
|
+
link: "",
|
|
220
|
+
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = false)
|
|
367
221
|
}, {
|
|
368
|
-
|
|
369
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(guardReactiveProps(unref(tabPaneComponent)?.props({
|
|
370
|
-
name: "page",
|
|
371
|
-
label: `页面 (${unref(pageGroups).length})`
|
|
372
|
-
}) || {})), {
|
|
373
|
-
default: withCtx(() => [createVNode(PageTab_default, {
|
|
374
|
-
list: unref(pageGroupsDisplay),
|
|
375
|
-
expanded: unref(expanded),
|
|
376
|
-
marker: pageMarker.value,
|
|
377
|
-
onToggle: unref(toggleGroup),
|
|
378
|
-
onGoto: onPageGoto,
|
|
379
|
-
onGotoInitial: onPageGotoInitial,
|
|
380
|
-
onDiffStep: onPageDiff,
|
|
381
|
-
onRevertStep: onPageRevert,
|
|
382
|
-
onSelect: onPageSelect,
|
|
383
|
-
onClear: onPageClear
|
|
384
|
-
}, null, 8, [
|
|
385
|
-
"list",
|
|
386
|
-
"expanded",
|
|
387
|
-
"marker",
|
|
388
|
-
"onToggle"
|
|
389
|
-
])]),
|
|
390
|
-
_: 1
|
|
391
|
-
}, 16)),
|
|
392
|
-
!disabledDataSource.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(mergeProps({ key: 0 }, unref(tabPaneComponent)?.props({
|
|
393
|
-
name: "data-source",
|
|
394
|
-
label: `数据源 (${unref(dataSourceGroups).length})`
|
|
395
|
-
}) || {})), {
|
|
396
|
-
default: withCtx(() => [createVNode(BucketTab_default, {
|
|
397
|
-
config: dataSourceConfig,
|
|
398
|
-
buckets: unref(dataSourceGroupsByTarget),
|
|
399
|
-
expanded: unref(expanded),
|
|
400
|
-
onToggle: unref(toggleGroup),
|
|
401
|
-
onGoto: onDataSourceGoto,
|
|
402
|
-
onGotoInitial: onDataSourceGotoInitial,
|
|
403
|
-
onDiffStep: onDataSourceDiff,
|
|
404
|
-
onRevertStep: onDataSourceRevert,
|
|
405
|
-
onClear: onDataSourceClear
|
|
406
|
-
}, null, 8, [
|
|
407
|
-
"buckets",
|
|
408
|
-
"expanded",
|
|
409
|
-
"onToggle"
|
|
410
|
-
])]),
|
|
411
|
-
_: 1
|
|
412
|
-
}, 16)) : createCommentVNode("v-if", true),
|
|
413
|
-
!disabledCodeBlock.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(mergeProps({ key: 1 }, unref(tabPaneComponent)?.props({
|
|
414
|
-
name: "code-block",
|
|
415
|
-
label: `代码块 (${unref(codeBlockGroups).length})`
|
|
416
|
-
}) || {})), {
|
|
417
|
-
default: withCtx(() => [createVNode(BucketTab_default, {
|
|
418
|
-
config: codeBlockConfig,
|
|
419
|
-
buckets: unref(codeBlockGroupsByTarget),
|
|
420
|
-
expanded: unref(expanded),
|
|
421
|
-
onToggle: unref(toggleGroup),
|
|
422
|
-
onGoto: onCodeBlockGoto,
|
|
423
|
-
onGotoInitial: onCodeBlockGotoInitial,
|
|
424
|
-
onDiffStep: onCodeBlockDiff,
|
|
425
|
-
onRevertStep: onCodeBlockRevert,
|
|
426
|
-
onClear: onCodeBlockClear
|
|
427
|
-
}, null, 8, [
|
|
428
|
-
"buckets",
|
|
429
|
-
"expanded",
|
|
430
|
-
"onToggle"
|
|
431
|
-
])]),
|
|
432
|
-
_: 1
|
|
433
|
-
}, 16)) : createCommentVNode("v-if", true),
|
|
434
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(extraTabs), (tab) => {
|
|
435
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps({ key: tab.name }, { ref_for: true }, unref(tabPaneComponent)?.props({
|
|
436
|
-
name: tab.name,
|
|
437
|
-
label: resolveTabLabel(tab)
|
|
438
|
-
}) || {}), {
|
|
439
|
-
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(tab.component), mergeProps({ ref_for: true }, tab.props || {}, toHandlers(tab.listeners || {})), null, 16))]),
|
|
440
|
-
_: 2
|
|
441
|
-
}, 1040);
|
|
442
|
-
}), 128))
|
|
443
|
-
]),
|
|
222
|
+
icon: withCtx(() => [createVNode(Icon_default, { icon: unref(CloseIcon) }, null, 8, ["icon"])]),
|
|
444
223
|
_: 1
|
|
445
|
-
}
|
|
224
|
+
})]),
|
|
225
|
+
_: 1
|
|
226
|
+
}), createVNode(unref(TMagicTabs), {
|
|
227
|
+
modelValue: activeTab.value,
|
|
228
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeTab.value = $event),
|
|
229
|
+
class: "m-editor-history-list-tabs"
|
|
230
|
+
}, {
|
|
231
|
+
default: withCtx(() => [
|
|
232
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(guardReactiveProps(unref(tabPaneComponent)?.props({
|
|
233
|
+
name: "page",
|
|
234
|
+
label: `${pageName.value} (${unref(pageGroups).length})`,
|
|
235
|
+
lazy: true
|
|
236
|
+
}) || {})), {
|
|
237
|
+
default: withCtx(() => [createVNode(PageTab_default, {
|
|
238
|
+
list: unref(pageGroupsDisplay),
|
|
239
|
+
expanded: unref(expanded),
|
|
240
|
+
marker: pageMarker.value,
|
|
241
|
+
onToggle: unref(toggleGroup),
|
|
242
|
+
onGoto: onPageGoto,
|
|
243
|
+
onGotoInitial: onPageGotoInitial,
|
|
244
|
+
onDiffStep: unref(onPageDiff),
|
|
245
|
+
onRevertStep: unref(onPageRevert),
|
|
246
|
+
onSelect: onPageSelect,
|
|
247
|
+
onClear: onPageClear
|
|
248
|
+
}, null, 8, [
|
|
249
|
+
"list",
|
|
250
|
+
"expanded",
|
|
251
|
+
"marker",
|
|
252
|
+
"onToggle",
|
|
253
|
+
"onDiffStep",
|
|
254
|
+
"onRevertStep"
|
|
255
|
+
])]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 16)),
|
|
258
|
+
!disabledDataSource.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(mergeProps({ key: 0 }, unref(tabPaneComponent)?.props({
|
|
259
|
+
name: "data-source",
|
|
260
|
+
label: `${dataSourceName.value} (${unref(dataSourceGroups).length})`,
|
|
261
|
+
lazy: true
|
|
262
|
+
}) || {})), {
|
|
263
|
+
default: withCtx(() => [createVNode(BucketTab_default, {
|
|
264
|
+
config: dataSourceConfig.value,
|
|
265
|
+
buckets: unref(dataSourceGroupsByTarget),
|
|
266
|
+
expanded: unref(expanded),
|
|
267
|
+
onToggle: unref(toggleGroup),
|
|
268
|
+
onGoto: onDataSourceGoto,
|
|
269
|
+
onGotoInitial: onDataSourceGotoInitial,
|
|
270
|
+
onDiffStep: unref(onDataSourceDiff),
|
|
271
|
+
onRevertStep: unref(onDataSourceRevert),
|
|
272
|
+
onClear: onDataSourceClear
|
|
273
|
+
}, null, 8, [
|
|
274
|
+
"config",
|
|
275
|
+
"buckets",
|
|
276
|
+
"expanded",
|
|
277
|
+
"onToggle",
|
|
278
|
+
"onDiffStep",
|
|
279
|
+
"onRevertStep"
|
|
280
|
+
])]),
|
|
281
|
+
_: 1
|
|
282
|
+
}, 16)) : createCommentVNode("v-if", true),
|
|
283
|
+
!disabledCodeBlock.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), normalizeProps(mergeProps({ key: 1 }, unref(tabPaneComponent)?.props({
|
|
284
|
+
name: "code-block",
|
|
285
|
+
label: `${codeBlockName.value} (${unref(codeBlockGroups).length})`,
|
|
286
|
+
lazy: true
|
|
287
|
+
}) || {})), {
|
|
288
|
+
default: withCtx(() => [createVNode(BucketTab_default, {
|
|
289
|
+
config: codeBlockConfig.value,
|
|
290
|
+
buckets: unref(codeBlockGroupsByTarget),
|
|
291
|
+
expanded: unref(expanded),
|
|
292
|
+
onToggle: unref(toggleGroup),
|
|
293
|
+
onGoto: onCodeBlockGoto,
|
|
294
|
+
onGotoInitial: onCodeBlockGotoInitial,
|
|
295
|
+
onDiffStep: unref(onCodeBlockDiff),
|
|
296
|
+
onRevertStep: unref(onCodeBlockRevert),
|
|
297
|
+
onClear: onCodeBlockClear
|
|
298
|
+
}, null, 8, [
|
|
299
|
+
"config",
|
|
300
|
+
"buckets",
|
|
301
|
+
"expanded",
|
|
302
|
+
"onToggle",
|
|
303
|
+
"onDiffStep",
|
|
304
|
+
"onRevertStep"
|
|
305
|
+
])]),
|
|
306
|
+
_: 1
|
|
307
|
+
}, 16)) : createCommentVNode("v-if", true),
|
|
308
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(extraTabs), (tab) => {
|
|
309
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps({ key: tab.name }, { ref_for: true }, unref(tabPaneComponent)?.props({
|
|
310
|
+
name: tab.name,
|
|
311
|
+
label: resolveTabLabel(tab),
|
|
312
|
+
lazy: true
|
|
313
|
+
}) || {}), {
|
|
314
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(tab.component), mergeProps({ ref_for: true }, tab.props || {}, toHandlers(tab.listeners || {})), null, 16))]),
|
|
315
|
+
_: 2
|
|
316
|
+
}, 1040);
|
|
317
|
+
}), 128))
|
|
318
|
+
]),
|
|
446
319
|
_: 1
|
|
447
|
-
}, 8, ["
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
"extend-state": unref(extendFormState)
|
|
451
|
-
}, null, 8, ["extend-state"]),
|
|
452
|
-
createVNode(HistoryDiffDialog_default, {
|
|
453
|
-
ref: "confirmDialog",
|
|
454
|
-
"is-confirm": true,
|
|
455
|
-
"extend-state": unref(extendFormState)
|
|
456
|
-
}, null, 8, ["extend-state"])
|
|
457
|
-
], 64);
|
|
320
|
+
}, 8, ["modelValue"])])]),
|
|
321
|
+
_: 1
|
|
322
|
+
}, 8, ["visible"]);
|
|
458
323
|
};
|
|
459
324
|
}
|
|
460
325
|
});
|
|
@@ -13,7 +13,7 @@ var _hoisted_4 = {
|
|
|
13
13
|
class: "m-editor-history-list-item-actions"
|
|
14
14
|
};
|
|
15
15
|
var _hoisted_5 = ["title"];
|
|
16
|
-
var InitialRow_vue_vue_type_script_setup_true_lang_default =
|
|
16
|
+
var InitialRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
17
|
name: "MEditorHistoryListInitialRow",
|
|
18
18
|
__name: "InitialRow",
|
|
19
19
|
props: {
|
|
@@ -13,7 +13,7 @@ var _hoisted_2 = {
|
|
|
13
13
|
class: "m-editor-history-list-toolbar"
|
|
14
14
|
};
|
|
15
15
|
var _hoisted_3 = { class: "m-editor-history-list-ul" };
|
|
16
|
-
var PageTab_vue_vue_type_script_setup_true_lang_default =
|
|
16
|
+
var PageTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
17
|
name: "MEditorHistoryListPageTab",
|
|
18
18
|
__name: "PageTab",
|
|
19
19
|
props: {
|