@tmagic/editor 1.2.0-beta.1 → 1.2.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/tmagic-editor.mjs +769 -768
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +773 -771
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +9 -9
- package/src/Editor.vue +2 -2
- package/src/components/ContentMenu.vue +2 -2
- package/src/components/Icon.vue +6 -4
- package/src/components/ToolButton.vue +29 -14
- package/src/fields/Code.vue +4 -1
- package/src/fields/CodeLink.vue +19 -11
- package/src/fields/CodeSelect.vue +6 -6
- package/src/fields/UISelect.vue +8 -7
- package/src/index.ts +2 -1
- package/src/layouts/AddPageBox.vue +13 -20
- package/src/layouts/CodeEditor.vue +106 -120
- package/src/layouts/Framework.vue +3 -2
- package/src/layouts/PropsPanel.vue +3 -8
- package/src/layouts/sidebar/ComponentListPanel.vue +13 -11
- package/src/layouts/sidebar/LayerMenu.vue +86 -91
- package/src/layouts/sidebar/LayerPanel.vue +252 -162
- package/src/layouts/sidebar/Sidebar.vue +24 -28
- package/src/layouts/sidebar/TabPane.vue +43 -51
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +22 -18
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +21 -21
- package/src/layouts/workspace/PageBar.vue +11 -10
- package/src/services/codeBlock.ts +16 -10
- package/src/services/editor.ts +4 -4
- package/src/theme/index.scss +1 -15
- package/src/theme/theme.scss +15 -0
- package/src/type.ts +1 -1
- package/types/Editor.vue.d.ts +2 -2
- package/types/fields/Code.vue.d.ts +8 -0
- package/types/fields/CodeLink.vue.d.ts +4 -0
- package/types/index.d.ts +1 -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 +16 -1071
- 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/CodeBlockList.vue.d.ts +1 -0
- package/types/services/codeBlock.d.ts +1 -1
- package/types/services/editor.d.ts +2 -2
- package/types/type.d.ts +1 -1
|
@@ -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
|
+
};
|
|
@@ -12,7 +12,7 @@ declare class CodeBlock extends BaseService {
|
|
|
12
12
|
*/
|
|
13
13
|
setCodeDsl(codeDsl: CodeBlockDSL): Promise<void>;
|
|
14
14
|
/**
|
|
15
|
-
* 获取活动的代码块dsl数据源(默认从dsl中的
|
|
15
|
+
* 获取活动的代码块dsl数据源(默认从dsl中的codeBlocks字段读取)
|
|
16
16
|
* @param {boolean} forceRefresh 是否强制从活动dsl拉取刷新
|
|
17
17
|
* @returns {CodeBlockDSL | null}
|
|
18
18
|
*/
|
|
@@ -139,12 +139,12 @@ declare class Editor extends BaseService {
|
|
|
139
139
|
destroy(): void;
|
|
140
140
|
resetModifiedNodeId(): void;
|
|
141
141
|
/**
|
|
142
|
-
* 从dsl中的
|
|
142
|
+
* 从dsl中的codeBlocks字段读取活动的代码块
|
|
143
143
|
* @returns {CodeBlockDSL | null}
|
|
144
144
|
*/
|
|
145
145
|
getCodeDsl(): Promise<CodeBlockDSL | null>;
|
|
146
146
|
/**
|
|
147
|
-
* 设置代码块到dsl的
|
|
147
|
+
* 设置代码块到dsl的codeBlocks字段
|
|
148
148
|
* @param {CodeBlockDSL} codeDsl 代码DSL
|
|
149
149
|
* @returns {void}
|
|
150
150
|
*/
|