@tmagic/editor 1.8.0-beta.2 → 1.8.0-beta.3
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 +9 -0
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +32 -28
- package/dist/es/editorProps.js +2 -0
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +2 -5
- package/dist/es/hooks/use-stage.js +2 -1
- package/dist/es/index.js +3 -1
- package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +2 -5
- package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +33 -14
- package/dist/es/layouts/history-list/BucketTab.js +5 -0
- package/dist/es/layouts/history-list/{CodeBlockTab.vue_vue_type_script_setup_true_lang.js → BucketTab.vue_vue_type_script_setup_true_lang.js} +27 -16
- package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +71 -53
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +78 -28
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +136 -66
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +15 -9
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +12 -6
- package/dist/es/layouts/history-list/composables.js +20 -2
- package/dist/es/services/history.js +5 -2
- package/dist/es/style.css +44 -12
- package/dist/style.css +44 -12
- package/dist/tmagic-editor.umd.cjs +479 -326
- package/package.json +7 -7
- package/src/Editor.vue +8 -0
- package/src/components/CompareForm.vue +32 -19
- package/src/editorProps.ts +7 -0
- package/src/fields/CodeLink.vue +2 -5
- package/src/hooks/use-stage.ts +1 -0
- package/src/index.ts +2 -0
- package/src/layouts/CodeEditor.vue +2 -5
- package/src/layouts/history-list/Bucket.vue +53 -28
- package/src/layouts/history-list/BucketTab.vue +77 -0
- package/src/layouts/history-list/GroupRow.vue +95 -60
- package/src/layouts/history-list/HistoryDiffDialog.vue +51 -32
- package/src/layouts/history-list/HistoryListPanel.vue +161 -52
- package/src/layouts/history-list/InitialRow.vue +17 -6
- package/src/layouts/history-list/PageTab.vue +20 -6
- package/src/layouts/history-list/composables.ts +32 -1
- package/src/services/history.ts +3 -0
- package/src/theme/history-list-panel.scss +52 -13
- package/src/type.ts +90 -0
- package/types/index.d.ts +295 -135
- package/dist/es/layouts/history-list/CodeBlockTab.js +0 -5
- package/dist/es/layouts/history-list/DataSourceTab.js +0 -5
- package/dist/es/layouts/history-list/DataSourceTab.vue_vue_type_script_setup_true_lang.js +0 -62
- package/src/layouts/history-list/CodeBlockTab.vue +0 -61
- package/src/layouts/history-list/DataSourceTab.vue +0 -61
|
@@ -54,6 +54,7 @@ var Editor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
54
54
|
disabledMultiSelect: { type: Boolean },
|
|
55
55
|
alwaysMultiSelect: { type: Boolean },
|
|
56
56
|
disabledPageFragment: { type: Boolean },
|
|
57
|
+
disabledFlashTip: { type: Boolean },
|
|
57
58
|
disabledStageOverlay: { type: Boolean },
|
|
58
59
|
disabledShowSrc: { type: Boolean },
|
|
59
60
|
disabledDataSource: { type: Boolean },
|
|
@@ -70,6 +71,7 @@ var Editor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
70
71
|
beforeDblclick: { type: Function },
|
|
71
72
|
beforeLayerNodeDblclick: { type: Function },
|
|
72
73
|
extendFormState: { type: Function },
|
|
74
|
+
historyListExtraTabs: {},
|
|
73
75
|
pageBarSortOptions: {},
|
|
74
76
|
pageFilterFunction: { type: Function }
|
|
75
77
|
}, defaultEditorProps),
|
|
@@ -119,6 +121,7 @@ var Editor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
119
121
|
guidesOptions: props.guidesOptions,
|
|
120
122
|
disabledMultiSelect: props.disabledMultiSelect,
|
|
121
123
|
alwaysMultiSelect: props.alwaysMultiSelect,
|
|
124
|
+
disabledFlashTip: props.disabledFlashTip,
|
|
122
125
|
beforeDblclick: props.beforeDblclick
|
|
123
126
|
};
|
|
124
127
|
stageOverlay_default.set("stageOptions", stageOptions);
|
|
@@ -131,6 +134,12 @@ var Editor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
131
134
|
* 与 PropsPanel 通过 `:extend-state` 显式传入的方式保持等价。
|
|
132
135
|
*/
|
|
133
136
|
provide("extendFormState", props.extendFormState);
|
|
137
|
+
/**
|
|
138
|
+
* 把历史记录面板的自定义扩展 tab 提供给深层的 HistoryListPanel(它挂在 NavMenu 中,
|
|
139
|
+
* 以 markRaw component 形式渲染,无法直接通过 props 透传)。业务方可借此在历史记录
|
|
140
|
+
* 面板内追加自定义模块的历史 tab。
|
|
141
|
+
*/
|
|
142
|
+
provide("historyListExtraTabs", props.historyListExtraTabs);
|
|
134
143
|
provide("eventBus", new EventEmitter());
|
|
135
144
|
const propsPanelMountedHandler = (e) => {
|
|
136
145
|
emit("props-panel-mounted", e);
|
|
@@ -16,15 +16,10 @@ var CompareForm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
16
16
|
dataSourceType: {},
|
|
17
17
|
labelWidth: { default: "120px" },
|
|
18
18
|
height: {},
|
|
19
|
-
extendState: {}
|
|
19
|
+
extendState: {},
|
|
20
|
+
loadConfig: {}
|
|
20
21
|
},
|
|
21
22
|
setup(__props, { expose: __expose }) {
|
|
22
|
-
/**
|
|
23
|
-
* 对比类型:
|
|
24
|
-
* - node: 节点组件,按 `type` 从 propsService 获取属性表单配置
|
|
25
|
-
* - data-source: 数据源,按 `type`(base/http/...) 从 dataSourceService 获取数据源表单配置
|
|
26
|
-
* - code-block: 数据源代码块,使用内置的代码块表单配置
|
|
27
|
-
*/
|
|
28
23
|
const props = __props;
|
|
29
24
|
const { propsService, dataSourceService, codeBlockService, editorService } = useServices();
|
|
30
25
|
const services = useServices();
|
|
@@ -84,34 +79,43 @@ var CompareForm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
84
79
|
}
|
|
85
80
|
return !isEqual(curValue, lastValue);
|
|
86
81
|
};
|
|
87
|
-
|
|
82
|
+
/**
|
|
83
|
+
* 内置的默认 FormConfig 加载逻辑:按 `category` 从对应 service / 工具取配置。
|
|
84
|
+
* 作为 ctx.defaultLoadConfig 透传给自定义 `loadConfig`,方便复用与二次加工。
|
|
85
|
+
*/
|
|
86
|
+
const defaultLoadConfig = async () => {
|
|
88
87
|
switch (props.category) {
|
|
89
88
|
case "node":
|
|
90
|
-
if (!props.type)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
if (!props.type) return [];
|
|
90
|
+
return await propsService.getPropsConfig(props.type);
|
|
91
|
+
case "data-source": return dataSourceService.getFormConfig(props.type || "base");
|
|
92
|
+
case "code-block": return getCodeBlockFormConfig({
|
|
93
|
+
paramColConfig: codeBlockService.getParamsColConfig(),
|
|
94
|
+
isDataSource: () => Boolean(props.dataSourceType),
|
|
95
|
+
dataSourceType: () => props.dataSourceType,
|
|
96
|
+
codeOptions,
|
|
97
|
+
editable: false
|
|
98
|
+
});
|
|
99
|
+
default: return [];
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const loadConfig = async () => {
|
|
103
|
+
if (props.loadConfig) {
|
|
104
|
+
config.value = await props.loadConfig({
|
|
105
|
+
category: props.category,
|
|
106
|
+
type: props.type,
|
|
107
|
+
dataSourceType: props.dataSourceType,
|
|
108
|
+
defaultLoadConfig
|
|
109
|
+
});
|
|
110
|
+
return;
|
|
109
111
|
}
|
|
112
|
+
config.value = await defaultLoadConfig();
|
|
110
113
|
};
|
|
111
114
|
watch([
|
|
112
115
|
() => props.category,
|
|
113
116
|
() => props.type,
|
|
114
|
-
() => props.dataSourceType
|
|
117
|
+
() => props.dataSourceType,
|
|
118
|
+
() => props.loadConfig
|
|
115
119
|
], () => {
|
|
116
120
|
loadConfig();
|
|
117
121
|
}, { immediate: true });
|
package/dist/es/editorProps.js
CHANGED
|
@@ -6,6 +6,7 @@ var defaultEditorProps = {
|
|
|
6
6
|
disabledMultiSelect: false,
|
|
7
7
|
alwaysMultiSelect: false,
|
|
8
8
|
disabledPageFragment: false,
|
|
9
|
+
disabledFlashTip: false,
|
|
9
10
|
disabledStageOverlay: false,
|
|
10
11
|
containerHighlightClassName: CONTAINER_HIGHLIGHT_CLASS_NAME,
|
|
11
12
|
containerHighlightDuration: 800,
|
|
@@ -15,6 +16,7 @@ var defaultEditorProps = {
|
|
|
15
16
|
disabledCodeBlock: false,
|
|
16
17
|
componentGroupList: () => [],
|
|
17
18
|
datasourceList: () => [],
|
|
19
|
+
historyListExtraTabs: () => [],
|
|
18
20
|
menu: () => ({
|
|
19
21
|
left: [],
|
|
20
22
|
right: []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getEditorConfig } from "../utils/config.js";
|
|
2
|
+
import { serializeConfig } from "../utils/editor.js";
|
|
2
3
|
import { computed, createBlock, defineComponent, openBlock, reactive, resolveComponent, watch } from "vue";
|
|
3
|
-
import serialize from "serialize-javascript";
|
|
4
4
|
//#region packages/editor/src/fields/CodeLink.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var CodeLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
6
|
name: "MFieldsCodeLink",
|
|
@@ -39,10 +39,7 @@ var CodeLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
39
39
|
});
|
|
40
40
|
const modelValue = reactive({ form: { [props.name]: "" } });
|
|
41
41
|
watch(() => props.model[props.name], (value) => {
|
|
42
|
-
modelValue.form = { [props.name]:
|
|
43
|
-
space: 2,
|
|
44
|
-
unsafe: true
|
|
45
|
-
}).replace(/"(\w+)":\s/g, "$1: ") };
|
|
42
|
+
modelValue.form = { [props.name]: serializeConfig(value) };
|
|
46
43
|
}, { immediate: true });
|
|
47
44
|
const changeHandler = (v) => {
|
|
48
45
|
if (!props.name || !props.model) return;
|
|
@@ -38,7 +38,8 @@ var useStage = (stageOptions) => {
|
|
|
38
38
|
guidesOptions: stageOptions.guidesOptions,
|
|
39
39
|
disabledMultiSelect: stageOptions.disabledMultiSelect,
|
|
40
40
|
alwaysMultiSelect: stageOptions.alwaysMultiSelect,
|
|
41
|
-
disabledRule: stageOptions.disabledRule
|
|
41
|
+
disabledRule: stageOptions.disabledRule,
|
|
42
|
+
disabledFlashTip: stageOptions.disabledFlashTip
|
|
42
43
|
});
|
|
43
44
|
watch(() => editor_default.get("disabledMultiSelect"), (disabledMultiSelect) => {
|
|
44
45
|
if (disabledMultiSelect) stage.disableMultiSelect();
|
package/dist/es/index.js
CHANGED
|
@@ -32,7 +32,9 @@ import SplitView_default from "./components/SplitView.js";
|
|
|
32
32
|
import Icon_default from "./components/Icon.js";
|
|
33
33
|
import ToolButton_default from "./components/ToolButton.js";
|
|
34
34
|
import CodeEditor_default from "./layouts/CodeEditor.js";
|
|
35
|
+
import Bucket_default from "./layouts/history-list/Bucket.js";
|
|
35
36
|
import CompareForm_default from "./components/CompareForm.js";
|
|
37
|
+
import HistoryDiffDialog_default from "./layouts/history-list/HistoryDiffDialog.js";
|
|
36
38
|
import FormPanel_default from "./layouts/props-panel/FormPanel.js";
|
|
37
39
|
import PropsPanel_default from "./layouts/props-panel/PropsPanel.js";
|
|
38
40
|
import FloatingBox_default from "./components/FloatingBox.js";
|
|
@@ -78,4 +80,4 @@ export * from "@tmagic/table";
|
|
|
78
80
|
export * from "@tmagic/stage";
|
|
79
81
|
export * from "@tmagic/design";
|
|
80
82
|
export * from "@tmagic/utils";
|
|
81
|
-
export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectRelatedNodes, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, designPlugin, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, info, isIncludeDataSource, monaco_editor_default as loadMonaco, log, moveItemsInContainer, numberOptions, props_default as propsService, resolveSelectedNode, serializeConfig, setChildrenLayout, setEditorConfig, setLayout, stageOverlay_default as stageOverlayService, storage_default as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, ui_default as uiService, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };
|
|
83
|
+
export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, HistoryDiffDialog_default as HistoryDiffDialog, Bucket_default as HistoryListBucket, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectRelatedNodes, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, designPlugin, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, info, isIncludeDataSource, monaco_editor_default as loadMonaco, log, moveItemsInContainer, numberOptions, props_default as propsService, resolveSelectedNode, serializeConfig, setChildrenLayout, setEditorConfig, setLayout, stageOverlay_default as stageOverlayService, storage_default as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, ui_default as uiService, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getEditorConfig } from "../utils/config.js";
|
|
2
|
+
import { serializeConfig } from "../utils/editor.js";
|
|
2
3
|
import monaco_editor_default from "../utils/monaco-editor.js";
|
|
3
4
|
import Icon_default from "../components/Icon.js";
|
|
4
5
|
import { TMagicButton } from "@tmagic/design";
|
|
5
6
|
import { Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, ref, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
6
7
|
import { throttle } from "lodash-es";
|
|
7
|
-
import serialize from "serialize-javascript";
|
|
8
8
|
import { FullScreen } from "@element-plus/icons-vue";
|
|
9
9
|
//#region packages/editor/src/layouts/CodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var _hoisted_1 = { class: "magic-code-editor" };
|
|
@@ -94,10 +94,7 @@ var CodeEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
94
94
|
const toString = (v, language) => {
|
|
95
95
|
let value;
|
|
96
96
|
if (typeof v !== "string") if (language === "json") value = JSON.stringify(v, null, 2);
|
|
97
|
-
else value =
|
|
98
|
-
space: 2,
|
|
99
|
-
unsafe: true
|
|
100
|
-
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
97
|
+
else value = serializeConfig(v);
|
|
101
98
|
else value = v;
|
|
102
99
|
if (language === "javascript" && value.startsWith("{") && value.endsWith("}")) value = `(${value})`;
|
|
103
100
|
return value;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { formatHistoryFullTime, formatHistoryTime, groupTimestamp } from "./composables.js";
|
|
1
2
|
import GroupRow_default from "./GroupRow.js";
|
|
2
3
|
import InitialRow_default from "./InitialRow.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode,
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, toDisplayString, unref } from "vue";
|
|
4
5
|
//#region packages/editor/src/layouts/history-list/Bucket.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var _hoisted_1 = { class: "m-editor-history-list-bucket" };
|
|
6
7
|
var _hoisted_2 = { class: "m-editor-history-list-bucket-title" };
|
|
@@ -13,11 +14,19 @@ var Bucket_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
13
14
|
title: {},
|
|
14
15
|
bucketId: {},
|
|
15
16
|
prefix: {},
|
|
17
|
+
showInitial: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
16
21
|
groups: {},
|
|
17
|
-
describeGroup: {
|
|
18
|
-
describeStep: {
|
|
19
|
-
isStepDiffable: {
|
|
20
|
-
expanded: {}
|
|
22
|
+
describeGroup: {},
|
|
23
|
+
describeStep: {},
|
|
24
|
+
isStepDiffable: {},
|
|
25
|
+
expanded: {},
|
|
26
|
+
gotoEnabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
}
|
|
21
30
|
},
|
|
22
31
|
emits: [
|
|
23
32
|
"toggle",
|
|
@@ -36,14 +45,16 @@ var Bucket_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
36
45
|
createElementVNode("code", null, toDisplayString(String(__props.bucketId)), 1),
|
|
37
46
|
createElementVNode("span", _hoisted_3, toDisplayString(__props.groups.length) + " 组", 1)
|
|
38
47
|
]), createElementVNode("ul", _hoisted_4, [
|
|
39
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.groups, (group
|
|
48
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.groups, (group) => {
|
|
40
49
|
return openBlock(), createBlock(GroupRow_default, {
|
|
41
|
-
key: `${__props.prefix}-${__props.bucketId}-${
|
|
42
|
-
"group-key": `${__props.prefix}-${__props.bucketId}-${
|
|
50
|
+
key: `${__props.prefix}-${__props.bucketId}-${group.steps[0]?.index}`,
|
|
51
|
+
"group-key": `${__props.prefix}-${__props.bucketId}-${group.steps[0]?.index}`,
|
|
43
52
|
applied: group.applied,
|
|
44
53
|
merged: group.steps.length > 1,
|
|
45
54
|
"op-type": group.opType,
|
|
46
55
|
desc: __props.describeGroup(group),
|
|
56
|
+
time: unref(formatHistoryTime)(unref(groupTimestamp)(group)),
|
|
57
|
+
"time-title": unref(formatHistoryFullTime)(unref(groupTimestamp)(group)),
|
|
47
58
|
"step-count": group.steps.length,
|
|
48
59
|
"sub-steps": group.steps.map((s) => ({
|
|
49
60
|
index: s.index,
|
|
@@ -51,10 +62,13 @@ var Bucket_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
51
62
|
isCurrent: s.isCurrent,
|
|
52
63
|
desc: __props.describeStep(s.step),
|
|
53
64
|
diffable: __props.isStepDiffable ? __props.isStepDiffable(s.step) : false,
|
|
54
|
-
revertable: s.applied
|
|
65
|
+
revertable: s.applied,
|
|
66
|
+
time: unref(formatHistoryTime)(s.step.timestamp),
|
|
67
|
+
timeTitle: unref(formatHistoryFullTime)(s.step.timestamp)
|
|
55
68
|
})),
|
|
56
69
|
"is-current": group.isCurrent,
|
|
57
|
-
expanded: !!__props.expanded[`${__props.prefix}-${__props.bucketId}-${
|
|
70
|
+
expanded: !!__props.expanded[`${__props.prefix}-${__props.bucketId}-${group.steps[0]?.index}`],
|
|
71
|
+
"goto-enabled": __props.gotoEnabled,
|
|
58
72
|
onToggle: _cache[0] || (_cache[0] = (key) => _ctx.$emit("toggle", key)),
|
|
59
73
|
onGoto: _cache[1] || (_cache[1] = (index) => _ctx.$emit("goto", __props.bucketId, index)),
|
|
60
74
|
onDiffStep: _cache[2] || (_cache[2] = (index) => _ctx.$emit("diff-step", __props.bucketId, index)),
|
|
@@ -65,17 +79,22 @@ var Bucket_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
65
79
|
"merged",
|
|
66
80
|
"op-type",
|
|
67
81
|
"desc",
|
|
82
|
+
"time",
|
|
83
|
+
"time-title",
|
|
68
84
|
"step-count",
|
|
69
85
|
"sub-steps",
|
|
70
86
|
"is-current",
|
|
71
|
-
"expanded"
|
|
87
|
+
"expanded",
|
|
88
|
+
"goto-enabled"
|
|
72
89
|
]);
|
|
73
90
|
}), 128)),
|
|
74
|
-
createCommentVNode("\n 初始状态项:永远位于该 bucket 列表底部(同样按倒序展示,最底部 = 最早状态)。\n 当 bucket 内所有 group 都未 applied 时即为当前位置。\n "),
|
|
75
|
-
|
|
91
|
+
createCommentVNode("\n 初始状态项:永远位于该 bucket 列表底部(同样按倒序展示,最底部 = 最早状态)。\n 当 bucket 内所有 group 都未 applied 时即为当前位置。\n showInitial=false 时不展示(用于没有\"撤销到初始状态\"语义的自定义历史,如业务模块历史)。\n "),
|
|
92
|
+
__props.showInitial !== false ? (openBlock(), createBlock(InitialRow_default, {
|
|
93
|
+
key: 0,
|
|
76
94
|
"is-current": isInitial.value,
|
|
95
|
+
"goto-enabled": __props.gotoEnabled,
|
|
77
96
|
onGotoInitial: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("goto-initial", __props.bucketId))
|
|
78
|
-
}, null, 8, ["is-current"])
|
|
97
|
+
}, null, 8, ["is-current", "goto-enabled"])) : createCommentVNode("v-if", true)
|
|
79
98
|
])]);
|
|
80
99
|
};
|
|
81
100
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import BucketTab_vue_vue_type_script_setup_true_lang_default from "./BucketTab.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region packages/editor/src/layouts/history-list/BucketTab.vue
|
|
3
|
+
var BucketTab_default = BucketTab_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { BucketTab_default as default };
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { describeCodeBlockGroup, describeCodeBlockStep } from "./composables.js";
|
|
2
1
|
import Bucket_default from "./Bucket.js";
|
|
3
2
|
import { TMagicScrollbar } from "@tmagic/design";
|
|
4
3
|
import { Fragment, createBlock, createElementBlock, defineComponent, openBlock, renderList, unref, withCtx } from "vue";
|
|
5
|
-
//#region packages/editor/src/layouts/history-list/
|
|
4
|
+
//#region packages/editor/src/layouts/history-list/BucketTab.vue?vue&type=script&setup=true&lang.ts
|
|
6
5
|
var _hoisted_1 = {
|
|
7
6
|
key: 0,
|
|
8
7
|
class: "m-editor-history-list-empty"
|
|
9
8
|
};
|
|
10
|
-
var
|
|
11
|
-
name: "
|
|
12
|
-
__name: "
|
|
9
|
+
var BucketTab_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "MEditorHistoryListBucketTab",
|
|
11
|
+
__name: "BucketTab",
|
|
13
12
|
props: {
|
|
13
|
+
title: {},
|
|
14
|
+
prefix: {},
|
|
14
15
|
buckets: {},
|
|
15
|
-
|
|
16
|
+
describeGroup: {},
|
|
17
|
+
describeStep: {},
|
|
18
|
+
isStepDiffable: {},
|
|
19
|
+
expanded: {},
|
|
20
|
+
gotoEnabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true
|
|
23
|
+
}
|
|
16
24
|
},
|
|
17
25
|
emits: [
|
|
18
26
|
"toggle",
|
|
@@ -22,8 +30,6 @@ var CodeBlockTab_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
22
30
|
"revert-step"
|
|
23
31
|
],
|
|
24
32
|
setup(__props) {
|
|
25
|
-
/** 仅 update(前后 content 都存在)时可查看差异。 */
|
|
26
|
-
const isCodeBlockStepDiffable = (step) => Boolean(step.oldContent && step.newContent);
|
|
27
33
|
return (_ctx, _cache) => {
|
|
28
34
|
return !__props.buckets.length ? (openBlock(), createElementBlock("div", _hoisted_1, "暂无操作记录")) : (openBlock(), createBlock(unref(TMagicScrollbar), {
|
|
29
35
|
key: 1,
|
|
@@ -31,26 +37,31 @@ var CodeBlockTab_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
31
37
|
}, {
|
|
32
38
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.buckets, (bucket) => {
|
|
33
39
|
return openBlock(), createBlock(Bucket_default, {
|
|
34
|
-
key:
|
|
35
|
-
title:
|
|
40
|
+
key: `${__props.prefix}-${bucket.id}`,
|
|
41
|
+
title: __props.title,
|
|
36
42
|
"bucket-id": bucket.id,
|
|
37
|
-
prefix:
|
|
43
|
+
prefix: __props.prefix,
|
|
38
44
|
groups: bucket.groups,
|
|
39
|
-
"describe-group":
|
|
40
|
-
"describe-step":
|
|
41
|
-
"is-step-diffable":
|
|
45
|
+
"describe-group": __props.describeGroup,
|
|
46
|
+
"describe-step": __props.describeStep,
|
|
47
|
+
"is-step-diffable": __props.isStepDiffable,
|
|
42
48
|
expanded: __props.expanded,
|
|
49
|
+
"goto-enabled": __props.gotoEnabled,
|
|
43
50
|
onToggle: _cache[0] || (_cache[0] = (key) => _ctx.$emit("toggle", key)),
|
|
44
51
|
onGoto: _cache[1] || (_cache[1] = (id, index) => _ctx.$emit("goto", id, index)),
|
|
45
52
|
onGotoInitial: _cache[2] || (_cache[2] = (id) => _ctx.$emit("goto-initial", id)),
|
|
46
53
|
onDiffStep: _cache[3] || (_cache[3] = (id, index) => _ctx.$emit("diff-step", id, index)),
|
|
47
54
|
onRevertStep: _cache[4] || (_cache[4] = (id, index) => _ctx.$emit("revert-step", id, index))
|
|
48
55
|
}, null, 8, [
|
|
56
|
+
"title",
|
|
49
57
|
"bucket-id",
|
|
58
|
+
"prefix",
|
|
50
59
|
"groups",
|
|
51
60
|
"describe-group",
|
|
52
61
|
"describe-step",
|
|
53
|
-
"
|
|
62
|
+
"is-step-diffable",
|
|
63
|
+
"expanded",
|
|
64
|
+
"goto-enabled"
|
|
54
65
|
]);
|
|
55
66
|
}), 128))]),
|
|
56
67
|
_: 1
|
|
@@ -59,4 +70,4 @@ var CodeBlockTab_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
59
70
|
}
|
|
60
71
|
});
|
|
61
72
|
//#endregion
|
|
62
|
-
export {
|
|
73
|
+
export { BucketTab_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -4,27 +4,22 @@ import { Fragment, computed, createCommentVNode, createElementBlock, createEleme
|
|
|
4
4
|
var _hoisted_1 = ["title"];
|
|
5
5
|
var _hoisted_2 = ["title"];
|
|
6
6
|
var _hoisted_3 = { class: "m-editor-history-list-item-desc" };
|
|
7
|
-
var _hoisted_4 =
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "m-editor-history-list-item-current"
|
|
10
|
-
};
|
|
7
|
+
var _hoisted_4 = ["title"];
|
|
11
8
|
var _hoisted_5 = {
|
|
12
|
-
key:
|
|
9
|
+
key: 1,
|
|
13
10
|
class: "m-editor-history-list-item-merge"
|
|
14
11
|
};
|
|
15
12
|
var _hoisted_6 = {
|
|
16
13
|
key: 0,
|
|
17
14
|
class: "m-editor-history-list-substeps"
|
|
18
15
|
};
|
|
19
|
-
var _hoisted_7 = ["title"
|
|
16
|
+
var _hoisted_7 = ["title"];
|
|
20
17
|
var _hoisted_8 = { class: "m-editor-history-list-item-index" };
|
|
21
18
|
var _hoisted_9 = { class: "m-editor-history-list-substep-desc" };
|
|
22
|
-
var _hoisted_10 =
|
|
23
|
-
key: 0,
|
|
24
|
-
class: "m-editor-history-list-item-current"
|
|
25
|
-
};
|
|
19
|
+
var _hoisted_10 = ["title"];
|
|
26
20
|
var _hoisted_11 = ["onClick"];
|
|
27
21
|
var _hoisted_12 = ["onClick"];
|
|
22
|
+
var _hoisted_13 = ["onClick"];
|
|
28
23
|
var GroupRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
29
24
|
name: "MEditorHistoryListGroupRow",
|
|
30
25
|
__name: "GroupRow",
|
|
@@ -34,10 +29,19 @@ var GroupRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
34
29
|
merged: { type: Boolean },
|
|
35
30
|
opType: {},
|
|
36
31
|
desc: {},
|
|
32
|
+
time: {},
|
|
33
|
+
timeTitle: {},
|
|
37
34
|
stepCount: {},
|
|
38
35
|
subSteps: {},
|
|
39
36
|
expanded: { type: Boolean },
|
|
40
|
-
isCurrent: {
|
|
37
|
+
isCurrent: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
gotoEnabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
}
|
|
41
45
|
},
|
|
42
46
|
emits: [
|
|
43
47
|
"toggle",
|
|
@@ -48,33 +52,29 @@ var GroupRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
48
52
|
setup(__props, { emit: __emit }) {
|
|
49
53
|
const props = __props;
|
|
50
54
|
const emit = __emit;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* 仅合并组头部可点击(切换展开 / 收起);
|
|
57
|
+
* 单步组的跳转改由头部的「回退」按钮触发,整行不再可点击。
|
|
58
|
+
*/
|
|
59
|
+
const isHeadClickable = computed(() => props.merged);
|
|
56
60
|
const headTitle = computed(() => {
|
|
57
61
|
if (props.merged) return props.expanded ? "点击收起子步" : "点击展开子步";
|
|
58
62
|
if (props.isCurrent) return "当前所在记录";
|
|
59
|
-
return "
|
|
63
|
+
return "";
|
|
60
64
|
});
|
|
61
65
|
/**
|
|
62
|
-
*
|
|
63
|
-
* - 合并组:仅切换展开 / 收起,不触发 goto;
|
|
64
|
-
* - 单步组:跳转到该唯一步骤;当前组忽略点击。
|
|
66
|
+
* 头部点击行为:仅合并组切换展开 / 收起;单步组不再响应整行点击。
|
|
65
67
|
*/
|
|
66
68
|
const onHeadClick = () => {
|
|
67
|
-
if (props.merged)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!props.subSteps.length) return;
|
|
73
|
-
emit("goto", props.subSteps[0].index);
|
|
69
|
+
if (props.merged) emit("toggle", props.groupKey);
|
|
70
|
+
};
|
|
71
|
+
const onGotoClick = (index) => {
|
|
72
|
+
if (!props.gotoEnabled) return;
|
|
73
|
+
emit("goto", index);
|
|
74
74
|
};
|
|
75
|
-
const
|
|
76
|
-
if (s.isCurrent) return;
|
|
77
|
-
|
|
75
|
+
const subStepTitle = (s) => {
|
|
76
|
+
if (s.isCurrent) return "当前所在记录";
|
|
77
|
+
return "";
|
|
78
78
|
};
|
|
79
79
|
/** 单步组头部是否展示"查看差异"入口:要求该唯一子步本身可对比。 */
|
|
80
80
|
const headDiffable = computed(() => !props.merged && Boolean(props.subSteps[0]?.diffable));
|
|
@@ -127,22 +127,32 @@ var GroupRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
127
127
|
}, toDisplayString(headIndexLabel.value), 9, _hoisted_2),
|
|
128
128
|
createElementVNode("span", { class: normalizeClass(["m-editor-history-list-item-op", `op-${__props.opType}`]) }, toDisplayString(unref(opLabel)(__props.opType)), 3),
|
|
129
129
|
createElementVNode("span", _hoisted_3, toDisplayString(__props.desc), 1),
|
|
130
|
-
__props.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onDiffClick(__props.subSteps[0].index), ["stop"]))
|
|
136
|
-
}, "查看差异")) : createCommentVNode("v-if", true),
|
|
130
|
+
__props.time ? (openBlock(), createElementBlock("span", {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "m-editor-history-list-item-time",
|
|
133
|
+
title: __props.timeTitle || __props.time
|
|
134
|
+
}, toDisplayString(__props.time), 9, _hoisted_4)) : createCommentVNode("v-if", true),
|
|
137
135
|
__props.merged ? (openBlock(), createElementBlock("span", _hoisted_5, "合并 " + toDisplayString(__props.stepCount) + " 步", 1)) : createCommentVNode("v-if", true),
|
|
138
136
|
!__props.merged && headRevertable.value ? (openBlock(), createElementBlock("span", {
|
|
139
|
-
key:
|
|
137
|
+
key: 2,
|
|
140
138
|
class: "m-editor-history-list-item-revert",
|
|
141
139
|
title: "将该步骤的修改作为一次新操作反向应用(不影响后续历史)",
|
|
142
|
-
onClick: _cache[
|
|
140
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onRevertClick(__props.subSteps[0].index), ["stop"]))
|
|
143
141
|
}, "回滚")) : createCommentVNode("v-if", true),
|
|
144
|
-
__props.merged ? (openBlock(), createElementBlock("span", {
|
|
142
|
+
!__props.merged && __props.gotoEnabled && !__props.isCurrent && __props.subSteps.length ? (openBlock(), createElementBlock("span", {
|
|
143
|
+
key: 3,
|
|
144
|
+
class: "m-editor-history-list-item-goto",
|
|
145
|
+
title: "回到该记录",
|
|
146
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => onGotoClick(__props.subSteps[0].index), ["stop"]))
|
|
147
|
+
}, "回到")) : createCommentVNode("v-if", true),
|
|
148
|
+
!__props.merged && headDiffable.value ? (openBlock(), createElementBlock("span", {
|
|
145
149
|
key: 4,
|
|
150
|
+
class: "m-editor-history-list-item-diff",
|
|
151
|
+
title: "查看修改差异",
|
|
152
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => onDiffClick(__props.subSteps[0].index), ["stop"]))
|
|
153
|
+
}, "查看差异")) : createCommentVNode("v-if", true),
|
|
154
|
+
__props.merged ? (openBlock(), createElementBlock("span", {
|
|
155
|
+
key: 5,
|
|
146
156
|
class: normalizeClass(["m-editor-history-list-group-toggle", { "is-expanded": __props.expanded }])
|
|
147
157
|
}, "▾", 2)) : createCommentVNode("v-if", true)
|
|
148
158
|
], 10, _hoisted_1), __props.merged && __props.expanded ? (openBlock(), createElementBlock("ul", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(subStepsDisplay.value, (s) => {
|
|
@@ -150,27 +160,35 @@ var GroupRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
150
160
|
key: s.index,
|
|
151
161
|
class: normalizeClass({
|
|
152
162
|
"is-undone": !s.applied,
|
|
153
|
-
"is-current": s.isCurrent
|
|
154
|
-
"is-clickable": !s.isCurrent
|
|
163
|
+
"is-current": s.isCurrent
|
|
155
164
|
}),
|
|
156
|
-
title: s
|
|
157
|
-
onClick: ($event) => onSubStepClick(s)
|
|
165
|
+
title: subStepTitle(s)
|
|
158
166
|
}, [
|
|
159
167
|
createElementVNode("span", _hoisted_8, "#" + toDisplayString(s.index + 1), 1),
|
|
160
168
|
createElementVNode("span", _hoisted_9, toDisplayString(s.desc), 1),
|
|
161
|
-
s.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
onClick: withModifiers(($event) => onDiffClick(s.index), ["stop"])
|
|
167
|
-
}, "查看差异", 8, _hoisted_11)) : createCommentVNode("v-if", true),
|
|
169
|
+
s.time ? (openBlock(), createElementBlock("span", {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "m-editor-history-list-item-time",
|
|
172
|
+
title: s.timeTitle || s.time
|
|
173
|
+
}, toDisplayString(s.time), 9, _hoisted_10)) : createCommentVNode("v-if", true),
|
|
168
174
|
s.revertable ? (openBlock(), createElementBlock("span", {
|
|
169
|
-
key:
|
|
175
|
+
key: 1,
|
|
170
176
|
class: "m-editor-history-list-item-revert",
|
|
171
177
|
title: "将该步骤的修改作为一次新操作反向应用(不影响后续历史)",
|
|
172
178
|
onClick: withModifiers(($event) => onRevertClick(s.index), ["stop"])
|
|
173
|
-
}, "回滚", 8,
|
|
179
|
+
}, "回滚", 8, _hoisted_11)) : createCommentVNode("v-if", true),
|
|
180
|
+
__props.gotoEnabled && !s.isCurrent ? (openBlock(), createElementBlock("span", {
|
|
181
|
+
key: 2,
|
|
182
|
+
class: "m-editor-history-list-item-goto",
|
|
183
|
+
title: "回到该记录",
|
|
184
|
+
onClick: withModifiers(($event) => onGotoClick(s.index), ["stop"])
|
|
185
|
+
}, "回到", 8, _hoisted_12)) : createCommentVNode("v-if", true),
|
|
186
|
+
s.diffable ? (openBlock(), createElementBlock("span", {
|
|
187
|
+
key: 3,
|
|
188
|
+
class: "m-editor-history-list-item-diff",
|
|
189
|
+
title: "查看修改差异",
|
|
190
|
+
onClick: withModifiers(($event) => onDiffClick(s.index), ["stop"])
|
|
191
|
+
}, "查看差异", 8, _hoisted_13)) : createCommentVNode("v-if", true)
|
|
174
192
|
], 10, _hoisted_7);
|
|
175
193
|
}), 128))])) : createCommentVNode("v-if", true)], 2);
|
|
176
194
|
};
|