@tmagic/editor 1.2.0-beta.2 → 1.2.0-beta.21
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/style.css +41 -28
- package/dist/{tmagic-editor.mjs → tmagic-editor.js} +1693 -1272
- package/dist/tmagic-editor.js.map +1 -0
- package/dist/{tmagic-editor.umd.js → tmagic-editor.umd.cjs} +1700 -1274
- package/dist/tmagic-editor.umd.cjs.map +1 -0
- package/package.json +16 -14
- package/src/Editor.vue +54 -37
- package/src/components/CodeDraftEditor.vue +145 -0
- package/src/components/ContentMenu.vue +4 -4
- package/src/components/FunctionEditor.vue +145 -0
- package/src/components/Icon.vue +7 -5
- package/src/components/Layout.vue +149 -0
- package/src/components/ScrollBar.vue +1 -1
- package/src/components/ScrollViewer.vue +10 -1
- package/src/components/ToolButton.vue +30 -15
- package/src/fields/Code.vue +1 -1
- package/src/fields/CodeLink.vue +1 -1
- package/src/fields/CodeSelect.vue +89 -110
- package/src/fields/UISelect.vue +9 -8
- package/src/index.ts +1 -0
- package/src/layouts/AddPageBox.vue +3 -2
- package/src/layouts/CodeEditor.vue +2 -3
- package/src/layouts/Framework.vue +62 -40
- package/src/layouts/NavMenu.vue +1 -1
- package/src/layouts/PropsPanel.vue +11 -13
- package/src/layouts/Resizer.vue +1 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +15 -13
- package/src/layouts/sidebar/LayerMenu.vue +9 -7
- package/src/layouts/sidebar/LayerPanel.vue +277 -177
- package/src/layouts/sidebar/Sidebar.vue +113 -27
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +34 -85
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -89
- package/src/layouts/workspace/Breadcrumb.vue +32 -0
- package/src/layouts/workspace/PageBar.vue +12 -11
- package/src/layouts/workspace/PageBarScrollContainer.vue +1 -1
- package/src/layouts/workspace/Stage.vue +26 -9
- package/src/layouts/workspace/ViewerMenu.vue +11 -9
- package/src/layouts/workspace/Workspace.vue +10 -3
- package/src/services/BaseService.ts +6 -1
- package/src/services/codeBlock.ts +124 -125
- package/src/services/componentList.ts +6 -1
- package/src/services/editor.ts +43 -19
- package/src/services/events.ts +6 -1
- package/src/services/history.ts +7 -16
- package/src/services/props.ts +7 -2
- package/src/services/storage.ts +1 -0
- package/src/services/ui.ts +12 -0
- package/src/theme/breadcrumb.scss +6 -0
- package/src/theme/code-block.scss +30 -21
- package/src/theme/component-list-panel.scss +3 -7
- package/src/theme/layer-panel.scss +7 -2
- package/src/theme/theme.scss +1 -0
- package/src/type.ts +76 -50
- package/src/utils/editor.ts +9 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/props.ts +2 -2
- package/src/utils/scroll-viewer.ts +18 -2
- package/src/utils/stage.ts +9 -2
- package/types/Editor.vue.d.ts +42 -29
- package/types/components/CodeDraftEditor.vue.d.ts +148 -0
- package/types/components/ContentMenu.vue.d.ts +1 -3
- package/types/components/FunctionEditor.vue.d.ts +120 -0
- package/types/components/Icon.vue.d.ts +1 -3
- package/types/{layouts → components}/Layout.vue.d.ts +12 -1
- package/types/components/ScrollBar.vue.d.ts +1 -3
- package/types/components/ScrollViewer.vue.d.ts +45 -1
- package/types/components/ToolButton.vue.d.ts +1 -3
- package/types/fields/Code.vue.d.ts +1 -3
- package/types/fields/CodeLink.vue.d.ts +1 -3
- package/types/fields/CodeSelect.vue.d.ts +10 -12
- package/types/fields/UISelect.vue.d.ts +1 -3
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +1 -3
- package/types/layouts/CodeEditor.vue.d.ts +6 -15
- package/types/layouts/NavMenu.vue.d.ts +1 -3
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +25 -9
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +38 -886
- package/types/layouts/sidebar/Sidebar.vue.d.ts +10 -5
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +1 -1
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +6 -5
- package/types/layouts/{sidebar/TabPane.vue.d.ts → workspace/Breadcrumb.vue.d.ts} +5 -43
- package/types/layouts/workspace/Stage.vue.d.ts +25 -8
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +6 -3
- package/types/layouts/workspace/Workspace.vue.d.ts +23 -5
- package/types/services/BaseService.d.ts +2 -1
- package/types/services/codeBlock.d.ts +57 -36
- package/types/services/componentList.d.ts +1 -0
- package/types/services/editor.d.ts +5 -6
- package/types/services/events.d.ts +1 -0
- package/types/services/history.d.ts +5 -15
- package/types/services/props.d.ts +3 -2
- package/types/services/ui.d.ts +2 -1
- package/types/type.d.ts +64 -48
- package/types/utils/editor.d.ts +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/props.d.ts +1 -1
- package/types/utils/scroll-viewer.d.ts +5 -0
- package/dist/tmagic-editor.mjs.map +0 -1
- package/dist/tmagic-editor.umd.js.map +0 -1
- package/src/layouts/Layout.vue +0 -100
- package/src/layouts/sidebar/TabPane.vue +0 -116
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MenuButton, MenuComponent } from '../../type';
|
|
1
2
|
import { SideBarData } from '../../type';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
new (...args: any[]): {
|
|
@@ -7,6 +8,7 @@ declare const _default: {
|
|
|
7
8
|
data: SideBarData;
|
|
8
9
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
10
|
data?: SideBarData | undefined;
|
|
11
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
10
12
|
}>, {
|
|
11
13
|
data: () => {
|
|
12
14
|
type: string;
|
|
@@ -29,6 +31,7 @@ declare const _default: {
|
|
|
29
31
|
$el: any;
|
|
30
32
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
31
33
|
data?: SideBarData | undefined;
|
|
34
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
32
35
|
}>, {
|
|
33
36
|
data: () => {
|
|
34
37
|
type: string;
|
|
@@ -61,6 +64,7 @@ declare const _default: {
|
|
|
61
64
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
62
65
|
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
63
66
|
data?: SideBarData | undefined;
|
|
67
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
64
68
|
}>, {
|
|
65
69
|
data: () => {
|
|
66
70
|
type: string;
|
|
@@ -75,6 +79,7 @@ declare const _default: {
|
|
|
75
79
|
__isSuspense?: undefined;
|
|
76
80
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
77
81
|
data?: SideBarData | undefined;
|
|
82
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
78
83
|
}>, {
|
|
79
84
|
data: () => {
|
|
80
85
|
type: string;
|
|
@@ -87,15 +92,11 @@ declare const _default: {
|
|
|
87
92
|
data: SideBarData;
|
|
88
93
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
89
94
|
$slots: {
|
|
90
|
-
'layer-panel-header': (_: {}) => any;
|
|
91
|
-
'layer-node-content': (_: {
|
|
92
|
-
data: any;
|
|
93
|
-
node: any;
|
|
94
|
-
}) => any;
|
|
95
95
|
'component-list-panel-header': (_: {}) => any;
|
|
96
96
|
'component-list-item': (_: {
|
|
97
97
|
component: any;
|
|
98
98
|
}) => any;
|
|
99
|
+
'layer-panel-header': (_: {}) => any;
|
|
99
100
|
'code-block-panel-header': (_: {}) => any;
|
|
100
101
|
'code-block-panel-tool': (_: {
|
|
101
102
|
id: any;
|
|
@@ -104,6 +105,10 @@ declare const _default: {
|
|
|
104
105
|
'code-block-edit-panel-header': (_: {
|
|
105
106
|
id: any;
|
|
106
107
|
}) => any;
|
|
108
|
+
'layer-node-content': (_: {
|
|
109
|
+
data: any;
|
|
110
|
+
node: any;
|
|
111
|
+
}) => any;
|
|
107
112
|
};
|
|
108
113
|
});
|
|
109
114
|
export default _default;
|
|
@@ -43,7 +43,7 @@ declare const _default: {
|
|
|
43
43
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
44
44
|
$slots: {
|
|
45
45
|
'code-block-edit-panel-header': (_: {
|
|
46
|
-
id:
|
|
46
|
+
id: import("@tmagic/schema").Id;
|
|
47
47
|
}) => any;
|
|
48
48
|
};
|
|
49
49
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Id } from '@tmagic/schema';
|
|
1
2
|
import { CodeDeleteErrorType } from '../../../type';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
new (...args: any[]): {
|
|
4
5
|
$: import("vue").ComponentInternalInstance;
|
|
5
6
|
$data: {};
|
|
6
7
|
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
-
customError?: ((id:
|
|
8
|
+
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
8
9
|
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
9
10
|
$attrs: {
|
|
10
11
|
[x: string]: unknown;
|
|
@@ -20,7 +21,7 @@ declare const _default: {
|
|
|
20
21
|
$emit: (event: string, ...args: any[]) => void;
|
|
21
22
|
$el: any;
|
|
22
23
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
23
|
-
customError?: ((id:
|
|
24
|
+
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
24
25
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
25
26
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
26
27
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -42,13 +43,13 @@ declare const _default: {
|
|
|
42
43
|
$nextTick: typeof import("vue").nextTick;
|
|
43
44
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
44
45
|
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
45
|
-
customError?: ((id:
|
|
46
|
+
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
46
47
|
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
47
48
|
__isFragment?: undefined;
|
|
48
49
|
__isTeleport?: undefined;
|
|
49
50
|
__isSuspense?: undefined;
|
|
50
51
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
51
|
-
customError?: ((id:
|
|
52
|
+
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
52
53
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
53
54
|
$slots: {
|
|
54
55
|
'code-block-panel-header': (_: {}) => any;
|
|
@@ -57,7 +58,7 @@ declare const _default: {
|
|
|
57
58
|
data: any;
|
|
58
59
|
}) => any;
|
|
59
60
|
'code-block-edit-panel-header': (_: {
|
|
60
|
-
id:
|
|
61
|
+
id: Id;
|
|
61
62
|
}) => any;
|
|
62
63
|
};
|
|
63
64
|
});
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { SideItem } from '../../type';
|
|
2
1
|
declare const _default: {
|
|
3
2
|
new (...args: any[]): {
|
|
4
3
|
$: import("vue").ComponentInternalInstance;
|
|
5
4
|
$data: {};
|
|
6
|
-
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<
|
|
7
|
-
data?: SideItem | undefined;
|
|
8
|
-
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
5
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
9
6
|
$attrs: {
|
|
10
7
|
[x: string]: unknown;
|
|
11
8
|
};
|
|
@@ -17,11 +14,9 @@ declare const _default: {
|
|
|
17
14
|
}>;
|
|
18
15
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
19
16
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
20
|
-
$emit: (event: string, ...args: any[]) => void;
|
|
17
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
|
21
18
|
$el: any;
|
|
22
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<
|
|
23
|
-
data?: SideItem | undefined;
|
|
24
|
-
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
19
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
|
|
25
20
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
26
21
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
27
22
|
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -41,42 +36,9 @@ declare const _default: {
|
|
|
41
36
|
$forceUpdate: () => void;
|
|
42
37
|
$nextTick: typeof import("vue").nextTick;
|
|
43
38
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
44
|
-
} & Readonly<import("vue").ExtractPropTypes<
|
|
45
|
-
data?: SideItem | undefined;
|
|
46
|
-
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
39
|
+
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
47
40
|
__isFragment?: undefined;
|
|
48
41
|
__isTeleport?: undefined;
|
|
49
42
|
__isSuspense?: undefined;
|
|
50
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<
|
|
51
|
-
data?: SideItem | undefined;
|
|
52
|
-
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
53
|
-
$slots: {
|
|
54
|
-
'component-list-panel-header': (_: {}) => any;
|
|
55
|
-
'component-list-item': (_: {
|
|
56
|
-
component: any;
|
|
57
|
-
}) => any;
|
|
58
|
-
'layer-panel-header': (_: {}) => any;
|
|
59
|
-
'code-block-panel-header': (_: {}) => any;
|
|
60
|
-
'code-block-panel-tool': (_: {
|
|
61
|
-
id: any;
|
|
62
|
-
data: any;
|
|
63
|
-
}) => any;
|
|
64
|
-
'code-block-edit-panel-header': (_: {
|
|
65
|
-
id: any;
|
|
66
|
-
}) => any;
|
|
67
|
-
'layer-node-content': (_: {
|
|
68
|
-
data: any;
|
|
69
|
-
node: any;
|
|
70
|
-
}) => any;
|
|
71
|
-
};
|
|
72
|
-
});
|
|
43
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
73
44
|
export default _default;
|
|
74
|
-
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
75
|
-
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
76
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
77
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
78
|
-
} : {
|
|
79
|
-
type: import('vue').PropType<T[K]>;
|
|
80
|
-
required: true;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { MenuButton, MenuComponent } from '../../type';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
new (...args: any[]): {
|
|
3
5
|
$: import("vue").ComponentInternalInstance;
|
|
4
6
|
$data: {};
|
|
5
|
-
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
9
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
6
10
|
$attrs: {
|
|
7
11
|
[x: string]: unknown;
|
|
8
12
|
};
|
|
@@ -14,9 +18,11 @@ declare const _default: {
|
|
|
14
18
|
}>;
|
|
15
19
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
16
20
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
17
|
-
$emit: (
|
|
21
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
18
22
|
$el: any;
|
|
19
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
24
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
25
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
20
26
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
21
27
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
22
28
|
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -34,13 +40,24 @@ declare const _default: {
|
|
|
34
40
|
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
35
41
|
};
|
|
36
42
|
$forceUpdate: () => void;
|
|
37
|
-
$nextTick: typeof
|
|
43
|
+
$nextTick: typeof nextTick;
|
|
38
44
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
39
|
-
} & Readonly<import("vue").ExtractPropTypes<
|
|
45
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
46
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
47
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
40
48
|
__isFragment?: undefined;
|
|
41
49
|
__isTeleport?: undefined;
|
|
42
50
|
__isSuspense?: undefined;
|
|
43
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
-
|
|
45
|
-
});
|
|
51
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
52
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
53
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
46
54
|
export default _default;
|
|
55
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
56
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
57
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
58
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
59
|
+
} : {
|
|
60
|
+
type: import('vue').PropType<T[K]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MenuButton, MenuComponent } from '../../type';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
new (...args: any[]): {
|
|
3
4
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -6,6 +7,7 @@ declare const _default: {
|
|
|
6
7
|
isMultiSelect: boolean;
|
|
7
8
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
8
9
|
isMultiSelect?: boolean | undefined;
|
|
10
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
9
11
|
}>, {
|
|
10
12
|
isMultiSelect: boolean;
|
|
11
13
|
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "isMultiSelect">;
|
|
@@ -24,6 +26,7 @@ declare const _default: {
|
|
|
24
26
|
$el: any;
|
|
25
27
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
26
28
|
isMultiSelect?: boolean | undefined;
|
|
29
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
27
30
|
}>, {
|
|
28
31
|
isMultiSelect: boolean;
|
|
29
32
|
}>>>, {
|
|
@@ -52,6 +55,7 @@ declare const _default: {
|
|
|
52
55
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
53
56
|
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
54
57
|
isMultiSelect?: boolean | undefined;
|
|
58
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
55
59
|
}>, {
|
|
56
60
|
isMultiSelect: boolean;
|
|
57
61
|
}>>> & import("vue").ShallowUnwrapRef<{
|
|
@@ -62,15 +66,14 @@ declare const _default: {
|
|
|
62
66
|
__isSuspense?: undefined;
|
|
63
67
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
64
68
|
isMultiSelect?: boolean | undefined;
|
|
69
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
65
70
|
}>, {
|
|
66
71
|
isMultiSelect: boolean;
|
|
67
72
|
}>>>, {
|
|
68
73
|
show: (e: MouseEvent) => Promise<void>;
|
|
69
74
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
70
75
|
isMultiSelect: boolean;
|
|
71
|
-
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps
|
|
72
|
-
$slots: {};
|
|
73
|
-
});
|
|
76
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
74
77
|
export default _default;
|
|
75
78
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
76
79
|
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { MPage } from '@tmagic/schema';
|
|
2
|
+
import type { MenuButton, MenuComponent } from '../../type';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
new (...args: any[]): {
|
|
4
5
|
$: import("vue").ComponentInternalInstance;
|
|
5
6
|
$data: {};
|
|
6
|
-
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
9
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
7
10
|
$attrs: {
|
|
8
11
|
[x: string]: unknown;
|
|
9
12
|
};
|
|
@@ -15,9 +18,11 @@ declare const _default: {
|
|
|
15
18
|
}>;
|
|
16
19
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
17
20
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
18
|
-
$emit: (
|
|
21
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
19
22
|
$el: any;
|
|
20
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
24
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
25
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
21
26
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
22
27
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
23
28
|
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -37,11 +42,15 @@ declare const _default: {
|
|
|
37
42
|
$forceUpdate: () => void;
|
|
38
43
|
$nextTick: typeof import("vue").nextTick;
|
|
39
44
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
40
|
-
} & Readonly<import("vue").ExtractPropTypes<
|
|
45
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
46
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
47
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
41
48
|
__isFragment?: undefined;
|
|
42
49
|
__isTeleport?: undefined;
|
|
43
50
|
__isSuspense?: undefined;
|
|
44
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
51
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
52
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
53
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
45
54
|
$slots: {
|
|
46
55
|
stage: (_: {}) => any;
|
|
47
56
|
'workspace-content': (_: {}) => any;
|
|
@@ -54,3 +63,12 @@ declare const _default: {
|
|
|
54
63
|
};
|
|
55
64
|
});
|
|
56
65
|
export default _default;
|
|
66
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
67
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
68
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
69
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
70
|
+
} : {
|
|
71
|
+
type: import('vue').PropType<T[K]>;
|
|
72
|
+
required: true;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -18,7 +18,7 @@ import { EventEmitter } from 'events';
|
|
|
18
18
|
*
|
|
19
19
|
* editorService.usePlugin({
|
|
20
20
|
* beforeAdd(value) { return [value] },
|
|
21
|
-
* afterAdd(
|
|
21
|
+
* afterAdd(result, value) { return result },
|
|
22
22
|
* });
|
|
23
23
|
*
|
|
24
24
|
* editorService.add(); 最终会变成 () => {
|
|
@@ -55,5 +55,6 @@ export default class extends EventEmitter {
|
|
|
55
55
|
constructor(methods?: string[], serialMethods?: string[]);
|
|
56
56
|
use(options: Record<string, Function>): void;
|
|
57
57
|
usePlugin(options: Record<string, Function>): void;
|
|
58
|
+
removeAllPlugins(): void;
|
|
58
59
|
private doTask;
|
|
59
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Id, MNode } from '@tmagic/schema';
|
|
2
|
-
import type {
|
|
3
|
-
import { CodeEditorMode
|
|
1
|
+
import { CodeBlockContent, CodeBlockDSL, Id, MNode } from '@tmagic/schema';
|
|
2
|
+
import type { CodeRelation } from '../type';
|
|
3
|
+
import { CodeEditorMode } from '../type';
|
|
4
4
|
import BaseService from './BaseService';
|
|
5
5
|
declare class CodeBlock extends BaseService {
|
|
6
6
|
private state;
|
|
@@ -13,23 +13,25 @@ declare class CodeBlock extends BaseService {
|
|
|
13
13
|
setCodeDsl(codeDsl: CodeBlockDSL): Promise<void>;
|
|
14
14
|
/**
|
|
15
15
|
* 获取活动的代码块dsl数据源(默认从dsl中的codeBlocks字段读取)
|
|
16
|
+
* 方法要支持钩子添加扩展,会被重写为异步方法,因此这里显示写为异步以提醒调用者需以异步形式调用
|
|
16
17
|
* @param {boolean} forceRefresh 是否强制从活动dsl拉取刷新
|
|
17
18
|
* @returns {CodeBlockDSL | null}
|
|
18
19
|
*/
|
|
19
20
|
getCodeDsl(forceRefresh?: boolean): Promise<CodeBlockDSL | null>;
|
|
21
|
+
getCodeDslSync(forceRefresh?: boolean): CodeBlockDSL | null;
|
|
20
22
|
/**
|
|
21
23
|
* 根据代码块id获取代码块内容
|
|
22
|
-
* @param {
|
|
24
|
+
* @param {Id} id 代码块id
|
|
23
25
|
* @returns {CodeBlockContent | null}
|
|
24
26
|
*/
|
|
25
|
-
getCodeContentById(id:
|
|
27
|
+
getCodeContentById(id: Id): Promise<CodeBlockContent | null>;
|
|
26
28
|
/**
|
|
27
29
|
* 设置代码块ID和代码内容到源dsl
|
|
28
|
-
* @param {
|
|
30
|
+
* @param {Id} id 代码块id
|
|
29
31
|
* @param {CodeBlockContent} codeConfig 代码块内容配置信息
|
|
30
32
|
* @returns {void}
|
|
31
33
|
*/
|
|
32
|
-
setCodeDslById(id:
|
|
34
|
+
setCodeDslById(id: Id, codeConfig: CodeBlockContent): Promise<void>;
|
|
33
35
|
/**
|
|
34
36
|
* 根据代码块id数组获取代码dsl
|
|
35
37
|
* @param {string[]} ids 代码块id数组
|
|
@@ -50,10 +52,10 @@ declare class CodeBlock extends BaseService {
|
|
|
50
52
|
/**
|
|
51
53
|
* 设置代码编辑面板展示状态及展示内容
|
|
52
54
|
* @param {boolean} status 是否展示代码编辑面板
|
|
53
|
-
* @param {
|
|
55
|
+
* @param {Id} id 代码块id
|
|
54
56
|
* @returns {void}
|
|
55
57
|
*/
|
|
56
|
-
setCodeEditorContent(status: boolean, id:
|
|
58
|
+
setCodeEditorContent(status: boolean, id: Id): void;
|
|
57
59
|
/**
|
|
58
60
|
* 获取当前选中的代码块内容
|
|
59
61
|
* @returns {CodeBlockContent | null}
|
|
@@ -72,15 +74,15 @@ declare class CodeBlock extends BaseService {
|
|
|
72
74
|
setEditStatus(status: boolean): Promise<void>;
|
|
73
75
|
/**
|
|
74
76
|
* 设置当前选中的代码块ID
|
|
75
|
-
* @param {
|
|
77
|
+
* @param {Id} id 代码块id
|
|
76
78
|
* @returns {void}
|
|
77
79
|
*/
|
|
78
|
-
setId(id:
|
|
80
|
+
setId(id: Id): void;
|
|
79
81
|
/**
|
|
80
82
|
* 获取当前选中的代码块ID
|
|
81
|
-
* @returns {
|
|
83
|
+
* @returns {Id} id 代码块id
|
|
82
84
|
*/
|
|
83
|
-
getId():
|
|
85
|
+
getId(): Id;
|
|
84
86
|
/**
|
|
85
87
|
* 获取当前模式
|
|
86
88
|
* @returns {CodeEditorMode}
|
|
@@ -104,51 +106,70 @@ declare class CodeBlock extends BaseService {
|
|
|
104
106
|
*/
|
|
105
107
|
getCombineIds(): string[];
|
|
106
108
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
109
|
+
* 刷新绑定关系
|
|
110
|
+
* @returns {CodeRelation | null}
|
|
111
|
+
*/
|
|
112
|
+
refreshCombineInfo(): CodeRelation | null;
|
|
113
|
+
/**
|
|
114
|
+
* 获取绑定关系
|
|
115
|
+
* @returns {CodeRelation}
|
|
113
116
|
*/
|
|
114
|
-
|
|
117
|
+
getCombineInfo(): CodeRelation;
|
|
115
118
|
/**
|
|
116
119
|
* 获取不可删除列表
|
|
117
|
-
* @returns {
|
|
120
|
+
* @returns {Id[]}
|
|
118
121
|
*/
|
|
119
|
-
getUndeletableList():
|
|
122
|
+
getUndeletableList(): Id[];
|
|
120
123
|
/**
|
|
121
124
|
* 设置不可删除列表:为业务逻辑预留的不可删除的代码块列表,由业务逻辑维护(如代码块上线后不可删除)
|
|
122
|
-
* @param {
|
|
125
|
+
* @param {Id[]} codeIds 代码块id数组
|
|
123
126
|
* @returns {void}
|
|
124
127
|
*/
|
|
125
|
-
setUndeleteableList(codeIds:
|
|
128
|
+
setUndeleteableList(codeIds: Id[]): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* 设置代码草稿
|
|
131
|
+
*/
|
|
132
|
+
setCodeDraft(codeId: Id, content: string): void;
|
|
133
|
+
/**
|
|
134
|
+
* 获取代码草稿
|
|
135
|
+
*/
|
|
136
|
+
getCodeDraft(codeId: Id): string | null;
|
|
137
|
+
/**
|
|
138
|
+
* 删除代码草稿
|
|
139
|
+
*/
|
|
140
|
+
removeCodeDraft(codeId: Id): void;
|
|
126
141
|
/**
|
|
127
142
|
* 在dsl数据源中删除指定id的代码块
|
|
128
|
-
* @param {
|
|
143
|
+
* @param {Id[]} codeIds 需要删除的代码块id数组
|
|
129
144
|
* @returns {CodeBlockDSL} 删除后的code dsl
|
|
130
145
|
*/
|
|
131
|
-
deleteCodeDslByIds(codeIds:
|
|
146
|
+
deleteCodeDslByIds(codeIds: Id[]): Promise<CodeBlockDSL>;
|
|
132
147
|
/**
|
|
133
148
|
* 生成代码块唯一id
|
|
134
|
-
* @returns {
|
|
135
|
-
*/
|
|
136
|
-
getUniqueId(): Promise<string>;
|
|
137
|
-
/**
|
|
138
|
-
* 一对一解除绑定关系 功能隐藏,暂时注释
|
|
139
|
-
* @param {string} compId 组件id
|
|
140
|
-
* @param {string} codeId 代码块id
|
|
141
|
-
* @param {string[]} codeHooks 代码块挂载hook名称
|
|
142
|
-
* @returns {boolean} 结果
|
|
149
|
+
* @returns {Id} 代码块唯一id
|
|
143
150
|
*/
|
|
151
|
+
getUniqueId(): Promise<Id>;
|
|
144
152
|
/**
|
|
145
153
|
* 通过组件id解除绑定关系(删除组件)
|
|
146
154
|
* @param {MNode} compId 组件节点
|
|
147
155
|
* @returns void
|
|
148
156
|
*/
|
|
149
157
|
deleteCompsInRelation(node: MNode): Promise<void>;
|
|
158
|
+
resetState(): void;
|
|
150
159
|
destroy(): void;
|
|
151
|
-
|
|
160
|
+
/**
|
|
161
|
+
* 删除组件时 如果是容器 需要遍历删除其包含节点的绑定信息
|
|
162
|
+
* @param {MNode} node 节点信息
|
|
163
|
+
* @param {CodeBlockDSL} codeDsl 代码块
|
|
164
|
+
* @returns void
|
|
165
|
+
*/
|
|
166
|
+
private refreshRelationDeep;
|
|
167
|
+
/**
|
|
168
|
+
* 递归遍历dsl中挂载了代码块的节点,并更新绑定关系数据
|
|
169
|
+
* @param {MContainer} node 节点信息
|
|
170
|
+
* @returns void
|
|
171
|
+
*/
|
|
172
|
+
private recurseMNode;
|
|
152
173
|
}
|
|
153
174
|
export declare type CodeBlockService = CodeBlock;
|
|
154
175
|
declare const _default: CodeBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CodeBlockDSL, Id, MContainer, MNode } from '@tmagic/schema';
|
|
2
|
-
import { StepValue } from '../
|
|
3
|
-
import type { AddMNode, EditorNodeInfo, PastePosition, StoreState } from '../type';
|
|
2
|
+
import type { AddMNode, EditorNodeInfo, PastePosition, StepValue, StoreState } from '../type';
|
|
4
3
|
import { LayerOffset, Layout } from '../type';
|
|
5
4
|
import BaseService from './BaseService';
|
|
6
5
|
declare class Editor extends BaseService {
|
|
@@ -9,14 +8,13 @@ declare class Editor extends BaseService {
|
|
|
9
8
|
constructor();
|
|
10
9
|
/**
|
|
11
10
|
* 设置当前指点节点配置
|
|
12
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes'
|
|
11
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
13
12
|
* @param value MNode
|
|
14
|
-
* @returns MNode
|
|
15
13
|
*/
|
|
16
14
|
set<T = MNode>(name: keyof StoreState, value: T): void;
|
|
17
15
|
/**
|
|
18
16
|
* 获取当前指点节点配置
|
|
19
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes'
|
|
17
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
20
18
|
* @returns MNode
|
|
21
19
|
*/
|
|
22
20
|
get<T = MNode>(name: keyof StoreState): T;
|
|
@@ -77,7 +75,6 @@ declare class Editor extends BaseService {
|
|
|
77
75
|
/**
|
|
78
76
|
* 删除组件
|
|
79
77
|
* @param {Object} node
|
|
80
|
-
* @return {Object} 删除的组件配置
|
|
81
78
|
*/
|
|
82
79
|
remove(nodeOrNodeList: MNode | MNode[]): Promise<void>;
|
|
83
80
|
doUpdate(config: MNode): Promise<MNode>;
|
|
@@ -136,6 +133,7 @@ declare class Editor extends BaseService {
|
|
|
136
133
|
*/
|
|
137
134
|
redo(): Promise<StepValue | null>;
|
|
138
135
|
move(left: number, top: number): Promise<void>;
|
|
136
|
+
resetState(): void;
|
|
139
137
|
destroy(): void;
|
|
140
138
|
resetModifiedNodeId(): void;
|
|
141
139
|
/**
|
|
@@ -143,6 +141,7 @@ declare class Editor extends BaseService {
|
|
|
143
141
|
* @returns {CodeBlockDSL | null}
|
|
144
142
|
*/
|
|
145
143
|
getCodeDsl(): Promise<CodeBlockDSL | null>;
|
|
144
|
+
getCodeDslSync(): CodeBlockDSL | null;
|
|
146
145
|
/**
|
|
147
146
|
* 设置代码块到dsl的codeBlocks字段
|
|
148
147
|
* @param {CodeBlockDSL} codeDsl 代码DSL
|
|
@@ -10,6 +10,7 @@ declare class Events extends BaseService {
|
|
|
10
10
|
setMethods(methods: Record<string, EventOption[]>): void;
|
|
11
11
|
setMethod(type: string, method: EventOption[]): void;
|
|
12
12
|
getMethod(type: string): EventOption[];
|
|
13
|
+
resetState(): void;
|
|
13
14
|
destroy(): void;
|
|
14
15
|
}
|
|
15
16
|
export declare type EventsService = Events;
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MPage } from '@tmagic/schema';
|
|
2
|
+
import { StepValue } from '../type';
|
|
2
3
|
import { UndoRedo } from '../utils/undo-redo';
|
|
3
4
|
import BaseService from './BaseService';
|
|
4
|
-
export interface StepValue {
|
|
5
|
-
data: MPage;
|
|
6
|
-
modifiedNodeIds: Map<Id, Id>;
|
|
7
|
-
nodeId: Id;
|
|
8
|
-
}
|
|
9
|
-
export interface HistoryState {
|
|
10
|
-
pageId?: Id;
|
|
11
|
-
pageSteps: Record<Id, UndoRedo<StepValue>>;
|
|
12
|
-
canRedo: boolean;
|
|
13
|
-
canUndo: boolean;
|
|
14
|
-
}
|
|
15
5
|
declare class History extends BaseService {
|
|
16
6
|
state: {
|
|
17
|
-
pageId?: Id | undefined;
|
|
18
|
-
pageSteps: Record<Id, UndoRedo<StepValue>>;
|
|
7
|
+
pageId?: import("@tmagic/schema").Id | undefined;
|
|
8
|
+
pageSteps: Record<import("@tmagic/schema").Id, UndoRedo<StepValue>>;
|
|
19
9
|
canRedo: boolean;
|
|
20
10
|
canUndo: boolean;
|
|
21
11
|
};
|
|
22
12
|
constructor();
|
|
23
13
|
reset(): void;
|
|
24
14
|
changePage(page: MPage): void;
|
|
25
|
-
|
|
15
|
+
resetState(): void;
|
|
26
16
|
push(state: StepValue): StepValue | null;
|
|
27
17
|
undo(): StepValue | null;
|
|
28
18
|
redo(): StepValue | null;
|