@tmagic/editor 1.1.6 → 1.2.0-beta.2
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 +177 -0
- package/dist/tmagic-editor.mjs +1456 -524
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +1448 -510
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/Editor.vue +18 -1
- package/src/fields/Code.vue +4 -1
- package/src/fields/CodeLink.vue +19 -11
- package/src/fields/CodeSelect.vue +139 -0
- package/src/index.ts +6 -2
- package/src/layouts/AddPageBox.vue +11 -19
- package/src/layouts/CodeEditor.vue +106 -120
- package/src/layouts/Layout.vue +1 -1
- package/src/layouts/PropsPanel.vue +1 -1
- package/src/layouts/sidebar/LayerMenu.vue +86 -91
- package/src/layouts/sidebar/Sidebar.vue +30 -24
- package/src/layouts/sidebar/TabPane.vue +57 -40
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +164 -0
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +267 -0
- package/src/services/codeBlock.ts +415 -0
- package/src/services/editor.ts +27 -1
- package/src/theme/code-block.scss +184 -0
- package/src/theme/index.scss +1 -13
- package/src/theme/layout.scss +5 -0
- package/src/theme/theme.scss +15 -0
- package/src/type.ts +87 -1
- package/src/utils/props.ts +9 -3
- package/types/fields/Code.vue.d.ts +8 -0
- package/types/fields/CodeLink.vue.d.ts +4 -0
- package/types/fields/CodeSelect.vue.d.ts +96 -0
- package/types/index.d.ts +3 -0
- package/types/layouts/AddPageBox.vue.d.ts +45 -3
- package/types/layouts/CodeEditor.vue.d.ts +160 -45
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +16 -64
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +8 -196
- package/types/layouts/sidebar/Sidebar.vue.d.ts +114 -17
- package/types/layouts/sidebar/TabPane.vue.d.ts +80 -12
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +50 -0
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +73 -0
- package/types/services/codeBlock.d.ts +155 -0
- package/types/services/editor.d.ts +12 -1
- package/types/services/props.d.ts +12 -0
- package/types/type.d.ts +77 -1
- package/types/utils/props.d.ts +12 -0
|
@@ -1,26 +1,123 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
1
|
import { SideBarData } from '../../type';
|
|
3
|
-
declare const _default:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{
|
|
7
|
+
data: SideBarData;
|
|
8
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
+
data?: SideBarData | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
data: () => {
|
|
12
|
+
type: string;
|
|
13
|
+
status: string;
|
|
14
|
+
items: string[];
|
|
15
|
+
};
|
|
16
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data">;
|
|
17
|
+
$attrs: {
|
|
18
|
+
[x: string]: unknown;
|
|
10
19
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
$refs: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
$slots: Readonly<{
|
|
24
|
+
[name: string]: import("vue").Slot | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
27
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
28
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
29
|
+
$el: any;
|
|
30
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
31
|
+
data?: SideBarData | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
data: () => {
|
|
34
|
+
type: string;
|
|
35
|
+
status: string;
|
|
36
|
+
items: string[];
|
|
37
|
+
};
|
|
38
|
+
}>>>, {
|
|
39
|
+
activeTabName: import("vue").Ref<string>;
|
|
40
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
41
|
+
data: SideBarData;
|
|
42
|
+
}> & {
|
|
43
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
44
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
45
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
46
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
47
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
48
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
49
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
50
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
51
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
52
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
53
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
54
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
55
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
56
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
57
|
+
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;
|
|
58
|
+
};
|
|
59
|
+
$forceUpdate: () => void;
|
|
60
|
+
$nextTick: typeof import("vue").nextTick;
|
|
61
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
62
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
63
|
+
data?: SideBarData | undefined;
|
|
64
|
+
}>, {
|
|
65
|
+
data: () => {
|
|
18
66
|
type: string;
|
|
19
67
|
status: string;
|
|
20
68
|
items: string[];
|
|
21
69
|
};
|
|
70
|
+
}>>> & import("vue").ShallowUnwrapRef<{
|
|
71
|
+
activeTabName: import("vue").Ref<string>;
|
|
72
|
+
}> & {} & import("vue").ComponentCustomProperties;
|
|
73
|
+
__isFragment?: undefined;
|
|
74
|
+
__isTeleport?: undefined;
|
|
75
|
+
__isSuspense?: undefined;
|
|
76
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
77
|
+
data?: SideBarData | undefined;
|
|
78
|
+
}>, {
|
|
79
|
+
data: () => {
|
|
80
|
+
type: string;
|
|
81
|
+
status: string;
|
|
82
|
+
items: string[];
|
|
22
83
|
};
|
|
23
|
-
}
|
|
84
|
+
}>>>, {
|
|
85
|
+
activeTabName: import("vue").Ref<string>;
|
|
86
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
24
87
|
data: SideBarData;
|
|
25
|
-
}
|
|
88
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
89
|
+
$slots: {
|
|
90
|
+
'layer-panel-header': (_: {}) => any;
|
|
91
|
+
'layer-node-content': (_: {
|
|
92
|
+
data: any;
|
|
93
|
+
node: any;
|
|
94
|
+
}) => any;
|
|
95
|
+
'component-list-panel-header': (_: {}) => any;
|
|
96
|
+
'component-list-item': (_: {
|
|
97
|
+
component: any;
|
|
98
|
+
}) => any;
|
|
99
|
+
'code-block-panel-header': (_: {}) => any;
|
|
100
|
+
'code-block-panel-tool': (_: {
|
|
101
|
+
id: any;
|
|
102
|
+
data: any;
|
|
103
|
+
}) => any;
|
|
104
|
+
'code-block-edit-panel-header': (_: {
|
|
105
|
+
id: any;
|
|
106
|
+
}) => any;
|
|
107
|
+
};
|
|
108
|
+
});
|
|
26
109
|
export default _default;
|
|
110
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
111
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
112
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
113
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
114
|
+
} : {
|
|
115
|
+
type: import('vue').PropType<T[K]>;
|
|
116
|
+
required: true;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
120
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
121
|
+
default: D[K];
|
|
122
|
+
} : P[K];
|
|
123
|
+
};
|
|
@@ -1,14 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { SideItem } from '../../type';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
data?: SideItem | undefined;
|
|
8
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
9
|
+
$attrs: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
$refs: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
$slots: Readonly<{
|
|
16
|
+
[name: string]: import("vue").Slot | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
19
|
+
$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;
|
|
21
|
+
$el: any;
|
|
22
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
23
|
+
data?: SideItem | undefined;
|
|
24
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
25
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
26
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
27
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
28
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
29
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
30
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
33
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
34
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
38
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
39
|
+
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;
|
|
40
|
+
};
|
|
41
|
+
$forceUpdate: () => void;
|
|
42
|
+
$nextTick: typeof import("vue").nextTick;
|
|
43
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
44
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
45
|
+
data?: SideItem | undefined;
|
|
46
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
47
|
+
__isFragment?: undefined;
|
|
48
|
+
__isTeleport?: undefined;
|
|
49
|
+
__isSuspense?: undefined;
|
|
50
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
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;
|
|
6
71
|
};
|
|
7
|
-
}
|
|
8
|
-
config: import("vue").ComputedRef<SideComponent | undefined>;
|
|
9
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
-
data: {
|
|
11
|
-
type: PropType<SideItem>;
|
|
12
|
-
};
|
|
13
|
-
}>>, {}>;
|
|
72
|
+
});
|
|
14
73
|
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
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
6
|
+
$attrs: {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
$refs: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
$slots: Readonly<{
|
|
13
|
+
[name: string]: import("vue").Slot | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
16
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
17
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
|
18
|
+
$el: any;
|
|
19
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
|
|
20
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
21
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
22
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
23
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
24
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
25
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
26
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
27
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
28
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
29
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
30
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
33
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
34
|
+
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
|
+
};
|
|
36
|
+
$forceUpdate: () => void;
|
|
37
|
+
$nextTick: typeof import("vue").nextTick;
|
|
38
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
39
|
+
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
40
|
+
__isFragment?: undefined;
|
|
41
|
+
__isTeleport?: undefined;
|
|
42
|
+
__isSuspense?: undefined;
|
|
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
|
+
$slots: {
|
|
45
|
+
'code-block-edit-panel-header': (_: {
|
|
46
|
+
id: string;
|
|
47
|
+
}) => any;
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CodeDeleteErrorType } from '../../../type';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
8
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
9
|
+
$attrs: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
$refs: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
$slots: Readonly<{
|
|
16
|
+
[name: string]: import("vue").Slot | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
19
|
+
$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;
|
|
21
|
+
$el: any;
|
|
22
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
23
|
+
customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
24
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
25
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
26
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
27
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
28
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
29
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
30
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
33
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
34
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
38
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
39
|
+
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;
|
|
40
|
+
};
|
|
41
|
+
$forceUpdate: () => void;
|
|
42
|
+
$nextTick: typeof import("vue").nextTick;
|
|
43
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
44
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
45
|
+
customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
46
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
47
|
+
__isFragment?: undefined;
|
|
48
|
+
__isTeleport?: undefined;
|
|
49
|
+
__isSuspense?: undefined;
|
|
50
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
51
|
+
customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | 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
|
+
'code-block-panel-header': (_: {}) => any;
|
|
55
|
+
'code-block-panel-tool': (_: {
|
|
56
|
+
id: any;
|
|
57
|
+
data: any;
|
|
58
|
+
}) => any;
|
|
59
|
+
'code-block-edit-panel-header': (_: {
|
|
60
|
+
id: string;
|
|
61
|
+
}) => any;
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
export default _default;
|
|
65
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
66
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
67
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
68
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
69
|
+
} : {
|
|
70
|
+
type: import('vue').PropType<T[K]>;
|
|
71
|
+
required: true;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Id, MNode } from '@tmagic/schema';
|
|
2
|
+
import type { CodeBlockContent, CodeBlockDSL } from '../type';
|
|
3
|
+
import { CodeEditorMode, CodeSelectOp } from '../type';
|
|
4
|
+
import BaseService from './BaseService';
|
|
5
|
+
declare class CodeBlock extends BaseService {
|
|
6
|
+
private state;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* 设置活动的代码块dsl数据源
|
|
10
|
+
* @param {CodeBlockDSL} codeDsl 代码DSL
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
setCodeDsl(codeDsl: CodeBlockDSL): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* 获取活动的代码块dsl数据源(默认从dsl中的codeBlocks字段读取)
|
|
16
|
+
* @param {boolean} forceRefresh 是否强制从活动dsl拉取刷新
|
|
17
|
+
* @returns {CodeBlockDSL | null}
|
|
18
|
+
*/
|
|
19
|
+
getCodeDsl(forceRefresh?: boolean): Promise<CodeBlockDSL | null>;
|
|
20
|
+
/**
|
|
21
|
+
* 根据代码块id获取代码块内容
|
|
22
|
+
* @param {string} id 代码块id
|
|
23
|
+
* @returns {CodeBlockContent | null}
|
|
24
|
+
*/
|
|
25
|
+
getCodeContentById(id: string): Promise<CodeBlockContent | null>;
|
|
26
|
+
/**
|
|
27
|
+
* 设置代码块ID和代码内容到源dsl
|
|
28
|
+
* @param {string} id 代码块id
|
|
29
|
+
* @param {CodeBlockContent} codeConfig 代码块内容配置信息
|
|
30
|
+
* @returns {void}
|
|
31
|
+
*/
|
|
32
|
+
setCodeDslById(id: string, codeConfig: CodeBlockContent): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* 根据代码块id数组获取代码dsl
|
|
35
|
+
* @param {string[]} ids 代码块id数组
|
|
36
|
+
* @returns {CodeBlockDSL}
|
|
37
|
+
*/
|
|
38
|
+
getCodeDslByIds(ids: string[]): Promise<CodeBlockDSL>;
|
|
39
|
+
/**
|
|
40
|
+
* 设置代码编辑面板展示状态
|
|
41
|
+
* @param {boolean} status 是否展示代码编辑面板
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
setCodeEditorShowStatus(status: boolean): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* 获取代码编辑面板展示状态
|
|
47
|
+
* @returns {boolean} 是否展示代码编辑面板
|
|
48
|
+
*/
|
|
49
|
+
getCodeEditorShowStatus(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 设置代码编辑面板展示状态及展示内容
|
|
52
|
+
* @param {boolean} status 是否展示代码编辑面板
|
|
53
|
+
* @param {string} id 代码块id
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
setCodeEditorContent(status: boolean, id: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* 获取当前选中的代码块内容
|
|
59
|
+
* @returns {CodeBlockContent | null}
|
|
60
|
+
*/
|
|
61
|
+
getCurrentDsl(): Promise<CodeBlockContent | null>;
|
|
62
|
+
/**
|
|
63
|
+
* 获取编辑状态
|
|
64
|
+
* @returns {boolean} 是否可编辑
|
|
65
|
+
*/
|
|
66
|
+
getEditStatus(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 设置编辑状态
|
|
69
|
+
* @param {boolean} 是否可编辑
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
setEditStatus(status: boolean): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* 设置当前选中的代码块ID
|
|
75
|
+
* @param {string} id 代码块id
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
setId(id: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* 获取当前选中的代码块ID
|
|
81
|
+
* @returns {string} id 代码块id
|
|
82
|
+
*/
|
|
83
|
+
getId(): string;
|
|
84
|
+
/**
|
|
85
|
+
* 获取当前模式
|
|
86
|
+
* @returns {CodeEditorMode}
|
|
87
|
+
*/
|
|
88
|
+
getMode(): CodeEditorMode;
|
|
89
|
+
/**
|
|
90
|
+
* 设置当前模式
|
|
91
|
+
* @param {CodeEditorMode} mode 模式
|
|
92
|
+
* @returns {void}
|
|
93
|
+
*/
|
|
94
|
+
setMode(mode: CodeEditorMode): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* 设置当前选中组件已关联绑定的代码块id数组
|
|
97
|
+
* @param {string[]} ids 代码块id数组
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
setCombineIds(ids: string[]): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* 获取当前选中组件已关联绑定的代码块id数组
|
|
103
|
+
* @returns {string[]}
|
|
104
|
+
*/
|
|
105
|
+
getCombineIds(): string[];
|
|
106
|
+
/**
|
|
107
|
+
* 设置绑定关系
|
|
108
|
+
* @param {Id} 组件id
|
|
109
|
+
* @param {string[]} diffCodeIds 代码块id数组
|
|
110
|
+
* @param {CodeSelectOp} opFlag 操作类型
|
|
111
|
+
* @param {string} hook 代码块挂载hook名称
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
setCombineRelation(compId: Id, diffCodeIds: string[], opFlag: CodeSelectOp, hook: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* 获取不可删除列表
|
|
117
|
+
* @returns {string[]}
|
|
118
|
+
*/
|
|
119
|
+
getUndeletableList(): string[];
|
|
120
|
+
/**
|
|
121
|
+
* 设置不可删除列表:为业务逻辑预留的不可删除的代码块列表,由业务逻辑维护(如代码块上线后不可删除)
|
|
122
|
+
* @param {string[]} codeIds 代码块id数组
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
setUndeleteableList(codeIds: string[]): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* 在dsl数据源中删除指定id的代码块
|
|
128
|
+
* @param {string[]} codeIds 需要删除的代码块id数组
|
|
129
|
+
* @returns {CodeBlockDSL} 删除后的code dsl
|
|
130
|
+
*/
|
|
131
|
+
deleteCodeDslByIds(codeIds: string[]): Promise<CodeBlockDSL>;
|
|
132
|
+
/**
|
|
133
|
+
* 生成代码块唯一id
|
|
134
|
+
* @returns {string} 代码块唯一id
|
|
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} 结果
|
|
143
|
+
*/
|
|
144
|
+
/**
|
|
145
|
+
* 通过组件id解除绑定关系(删除组件)
|
|
146
|
+
* @param {MNode} compId 组件节点
|
|
147
|
+
* @returns void
|
|
148
|
+
*/
|
|
149
|
+
deleteCompsInRelation(node: MNode): Promise<void>;
|
|
150
|
+
destroy(): void;
|
|
151
|
+
private recurseNodes;
|
|
152
|
+
}
|
|
153
|
+
export declare type CodeBlockService = CodeBlock;
|
|
154
|
+
declare const _default: CodeBlock;
|
|
155
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Id, MContainer, MNode } from '@tmagic/schema';
|
|
1
|
+
import type { CodeBlockDSL, Id, MContainer, MNode } from '@tmagic/schema';
|
|
2
2
|
import { StepValue } from '../services/history';
|
|
3
3
|
import type { AddMNode, EditorNodeInfo, PastePosition, StoreState } from '../type';
|
|
4
4
|
import { LayerOffset, Layout } from '../type';
|
|
@@ -138,6 +138,17 @@ declare class Editor extends BaseService {
|
|
|
138
138
|
move(left: number, top: number): Promise<void>;
|
|
139
139
|
destroy(): void;
|
|
140
140
|
resetModifiedNodeId(): void;
|
|
141
|
+
/**
|
|
142
|
+
* 从dsl中的codeBlocks字段读取活动的代码块
|
|
143
|
+
* @returns {CodeBlockDSL | null}
|
|
144
|
+
*/
|
|
145
|
+
getCodeDsl(): Promise<CodeBlockDSL | null>;
|
|
146
|
+
/**
|
|
147
|
+
* 设置代码块到dsl的codeBlocks字段
|
|
148
|
+
* @param {CodeBlockDSL} codeDsl 代码DSL
|
|
149
|
+
* @returns {void}
|
|
150
|
+
*/
|
|
151
|
+
setCodeDsl(codeDsl: CodeBlockDSL): Promise<void>;
|
|
141
152
|
private addModifiedNodeId;
|
|
142
153
|
private pushHistoryState;
|
|
143
154
|
private changeHistoryState;
|
|
@@ -13,6 +13,7 @@ declare class Props extends BaseService {
|
|
|
13
13
|
items: (import("@tmagic/form").ChildConfig & {
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
})[];
|
|
16
|
+
lazy?: undefined;
|
|
16
17
|
} | {
|
|
17
18
|
title: string;
|
|
18
19
|
items: {
|
|
@@ -34,6 +35,17 @@ declare class Props extends BaseService {
|
|
|
34
35
|
})[];
|
|
35
36
|
}[];
|
|
36
37
|
labelWidth?: undefined;
|
|
38
|
+
lazy?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
title: string;
|
|
41
|
+
lazy: boolean;
|
|
42
|
+
items: {
|
|
43
|
+
name: string;
|
|
44
|
+
text: string;
|
|
45
|
+
type: string;
|
|
46
|
+
labelWidth: string;
|
|
47
|
+
}[];
|
|
48
|
+
labelWidth?: undefined;
|
|
37
49
|
})[];
|
|
38
50
|
}[]>;
|
|
39
51
|
/**
|