@tmagic/editor 1.0.6 → 1.1.0-beta.10
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 +5 -1
- package/dist/{tmagic-editor.es.js → tmagic-editor.mjs} +1522 -1177
- package/dist/tmagic-editor.mjs.map +1 -0
- package/dist/tmagic-editor.umd.js +1606 -1259
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +22 -20
- package/src/Editor.vue +41 -15
- package/src/components/ContentMenu.vue +87 -99
- package/src/components/Icon.vue +2 -2
- package/src/components/ScrollViewer.vue +2 -2
- package/src/components/ToolButton.vue +151 -168
- package/src/fields/UISelect.vue +49 -70
- package/src/index.ts +2 -1
- package/src/layouts/AddPageBox.vue +3 -3
- package/src/layouts/Framework.vue +1 -1
- package/src/layouts/NavMenu.vue +2 -2
- package/src/layouts/PropsPanel.vue +1 -1
- package/src/layouts/Resizer.vue +1 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +43 -2
- package/src/layouts/sidebar/LayerMenu.vue +3 -3
- package/src/layouts/sidebar/LayerPanel.vue +13 -4
- package/src/layouts/sidebar/Sidebar.vue +1 -1
- package/src/layouts/sidebar/TabPane.vue +3 -3
- package/src/layouts/workspace/PageBar.vue +63 -192
- package/src/layouts/workspace/PageBarScrollContainer.vue +111 -0
- package/src/layouts/workspace/Stage.vue +208 -188
- package/src/layouts/workspace/ViewerMenu.vue +141 -148
- package/src/layouts/workspace/Workspace.vue +11 -11
- package/src/services/BaseService.ts +5 -10
- package/src/services/componentList.ts +3 -3
- package/src/services/editor.ts +247 -140
- package/src/services/events.ts +1 -1
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +63 -11
- package/src/services/storage.ts +133 -0
- package/src/services/ui.ts +10 -4
- package/src/theme/component-list-panel.scss +5 -0
- package/src/theme/framework.scss +1 -1
- package/src/theme/stage.scss +2 -2
- package/src/type.ts +28 -7
- package/src/utils/config.ts +1 -1
- package/src/utils/editor.ts +53 -35
- package/src/utils/operator.ts +109 -0
- package/src/utils/props.ts +2 -24
- package/src/utils/scroll-viewer.ts +1 -1
- package/tsconfig.build.json +13 -0
- package/{dist/types/src → types}/Editor.vue.d.ts +44 -9
- package/types/components/ContentMenu.vue.d.ts +116 -0
- package/types/components/Icon.vue.d.ts +13 -0
- package/types/components/ScrollViewer.vue.d.ts +22 -0
- package/types/components/ToolButton.vue.d.ts +109 -0
- package/types/fields/Code.vue.d.ts +23 -0
- package/{dist/types/src → types}/fields/CodeLink.vue.d.ts +4 -6
- package/types/fields/UISelect.vue.d.ts +83 -0
- package/{dist/types/src → types}/index.d.ts +4 -1
- package/types/layouts/AddPageBox.vue.d.ts +4 -0
- package/{dist/types/src → types}/layouts/CodeEditor.vue.d.ts +11 -13
- package/types/layouts/Framework.vue.d.ts +22 -0
- package/types/layouts/NavMenu.vue.d.ts +25 -0
- package/types/layouts/PropsPanel.vue.d.ts +245 -0
- package/types/layouts/Resizer.vue.d.ts +12 -0
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +14 -0
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +100 -0
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +1099 -0
- package/{dist/types/src → types}/layouts/sidebar/Sidebar.vue.d.ts +3 -5
- package/types/layouts/sidebar/TabPane.vue.d.ts +14 -0
- package/types/layouts/workspace/PageBar.vue.d.ts +54 -0
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +48 -0
- package/types/layouts/workspace/Stage.vue.d.ts +46 -0
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +88 -0
- package/types/layouts/workspace/Workspace.vue.d.ts +6 -0
- package/{dist/types/src → types}/services/BaseService.d.ts +0 -0
- package/types/services/componentList.d.ts +14 -0
- package/{dist/types/src → types}/services/editor.d.ts +27 -14
- package/{dist/types/src → types}/services/events.d.ts +0 -0
- package/{dist/types/src → types}/services/history.d.ts +0 -0
- package/{dist/types/src → types}/services/props.d.ts +26 -2
- package/types/services/storage.d.ts +56 -0
- package/{dist/types/src → types}/services/ui.d.ts +1 -1
- package/{dist/types/src → types}/type.d.ts +21 -1
- package/{dist/types/src → types}/utils/compose.d.ts +1 -1
- package/{dist/types/src → types}/utils/config.d.ts +0 -0
- package/{dist/types/src → types}/utils/editor.d.ts +11 -4
- package/{dist/types/src → types}/utils/index.d.ts +0 -0
- package/{dist/types/src → types}/utils/logger.d.ts +0 -0
- package/types/utils/operator.d.ts +21 -0
- package/{dist/types/src → types}/utils/polyfills.d.ts +0 -0
- package/{dist/types/src → types}/utils/props.d.ts +2 -22
- package/{dist/types/src → types}/utils/scroll-viewer.d.ts +0 -0
- package/{dist/types/src → types}/utils/undo-redo.d.ts +0 -0
- package/dist/tmagic-editor.es.js.map +0 -1
- package/dist/types/src/components/Icon.vue.d.ts +0 -14
- package/dist/types/src/components/ScrollViewer.vue.d.ts +0 -24
- package/dist/types/src/fields/Code.vue.d.ts +0 -25
- package/dist/types/src/layouts/AddPageBox.vue.d.ts +0 -5
- package/dist/types/src/layouts/Framework.vue.d.ts +0 -24
- package/dist/types/src/layouts/NavMenu.vue.d.ts +0 -27
- package/dist/types/src/layouts/PropsPanel.vue.d.ts +0 -13
- package/dist/types/src/layouts/Resizer.vue.d.ts +0 -14
- package/dist/types/src/layouts/sidebar/ComponentListPanel.vue.d.ts +0 -14
- package/dist/types/src/layouts/sidebar/TabPane.vue.d.ts +0 -16
- package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +0 -8
- package/dist/types/src/shims-vue.d.ts +0 -6
- package/dist/types/src/vite-env.d.ts +0 -1
- package/src/vite-env.d.ts +0 -1
package/src/utils/props.ts
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
import { FormConfig, FormState } from '@tmagic/form';
|
|
20
20
|
|
|
21
|
-
import editorService from '
|
|
22
|
-
import eventsService from '
|
|
21
|
+
import editorService from '../services/editor';
|
|
22
|
+
import eventsService from '../services/events';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* 统一为组件属性表单加上事件、高级、样式配置
|
|
@@ -237,25 +237,3 @@ export const fillConfig = (config: FormConfig = []) => [
|
|
|
237
237
|
|
|
238
238
|
// 默认组件属性表单配置
|
|
239
239
|
export const DEFAULT_CONFIG: FormConfig = fillConfig([]);
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* 获取默认属性配置
|
|
243
|
-
* @param type 组件类型
|
|
244
|
-
* @returns Object
|
|
245
|
-
*/
|
|
246
|
-
export const getDefaultPropsValue = (type: string, id: string) =>
|
|
247
|
-
['page', 'container'].includes(type)
|
|
248
|
-
? {
|
|
249
|
-
type,
|
|
250
|
-
id,
|
|
251
|
-
layout: 'absolute',
|
|
252
|
-
style: {},
|
|
253
|
-
name: type,
|
|
254
|
-
items: [],
|
|
255
|
-
}
|
|
256
|
-
: {
|
|
257
|
-
type,
|
|
258
|
-
id,
|
|
259
|
-
style: {},
|
|
260
|
-
name: type,
|
|
261
|
-
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
1
|
import { PropType } from 'vue';
|
|
3
2
|
import type { FormConfig } from '@tmagic/form';
|
|
4
3
|
import type { MApp, MNode } from '@tmagic/schema';
|
|
5
4
|
import type StageCore from '@tmagic/stage';
|
|
6
|
-
import
|
|
5
|
+
import { ContainerHighlightType, MoveableOptions } from '@tmagic/stage';
|
|
7
6
|
import type { ComponentGroup, MenuBarData, MenuItem, Services, SideBarData, StageRect } from './type';
|
|
8
|
-
declare const _default: DefineComponent<{
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
9
8
|
/** 页面初始值 */
|
|
10
9
|
modelValue: {
|
|
11
10
|
type: PropType<MApp>;
|
|
@@ -62,16 +61,32 @@ declare const _default: DefineComponent<{
|
|
|
62
61
|
};
|
|
63
62
|
/** 画布中组件选中框的移动范围 */
|
|
64
63
|
moveableOptions: {
|
|
65
|
-
type: PropType<MoveableOptions | ((core?: StageCore
|
|
64
|
+
type: PropType<MoveableOptions | ((core?: StageCore) => MoveableOptions)>;
|
|
66
65
|
};
|
|
67
66
|
/** 编辑器初始化时默认选中的组件ID */
|
|
68
67
|
defaultSelected: {
|
|
69
|
-
type: (
|
|
68
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
70
69
|
};
|
|
71
70
|
canSelect: {
|
|
72
71
|
type: PropType<(el: HTMLElement) => boolean | Promise<boolean>>;
|
|
73
72
|
default: (el: HTMLElement) => boolean;
|
|
74
73
|
};
|
|
74
|
+
isContainer: {
|
|
75
|
+
type: PropType<(el: HTMLElement) => boolean | Promise<boolean>>;
|
|
76
|
+
default: (el: HTMLElement) => boolean;
|
|
77
|
+
};
|
|
78
|
+
containerHighlightClassName: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
containerHighlightDuration: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
containerHighlightType: {
|
|
87
|
+
type: PropType<ContainerHighlightType>;
|
|
88
|
+
default: ContainerHighlightType;
|
|
89
|
+
};
|
|
75
90
|
stageRect: {
|
|
76
91
|
type: PropType<StageRect>;
|
|
77
92
|
};
|
|
@@ -82,7 +97,7 @@ declare const _default: DefineComponent<{
|
|
|
82
97
|
updateDragEl: {
|
|
83
98
|
type: PropType<(el: HTMLDivElement, target: HTMLElement) => void>;
|
|
84
99
|
};
|
|
85
|
-
}, Services, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("props-panel-mounted" | "update:modelValue")[], "props-panel-mounted" | "update:modelValue", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
100
|
+
}, Services, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("props-panel-mounted" | "update:modelValue")[], "props-panel-mounted" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
86
101
|
/** 页面初始值 */
|
|
87
102
|
modelValue: {
|
|
88
103
|
type: PropType<MApp>;
|
|
@@ -139,16 +154,32 @@ declare const _default: DefineComponent<{
|
|
|
139
154
|
};
|
|
140
155
|
/** 画布中组件选中框的移动范围 */
|
|
141
156
|
moveableOptions: {
|
|
142
|
-
type: PropType<MoveableOptions | ((core?: StageCore
|
|
157
|
+
type: PropType<MoveableOptions | ((core?: StageCore) => MoveableOptions)>;
|
|
143
158
|
};
|
|
144
159
|
/** 编辑器初始化时默认选中的组件ID */
|
|
145
160
|
defaultSelected: {
|
|
146
|
-
type: (
|
|
161
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
147
162
|
};
|
|
148
163
|
canSelect: {
|
|
149
164
|
type: PropType<(el: HTMLElement) => boolean | Promise<boolean>>;
|
|
150
165
|
default: (el: HTMLElement) => boolean;
|
|
151
166
|
};
|
|
167
|
+
isContainer: {
|
|
168
|
+
type: PropType<(el: HTMLElement) => boolean | Promise<boolean>>;
|
|
169
|
+
default: (el: HTMLElement) => boolean;
|
|
170
|
+
};
|
|
171
|
+
containerHighlightClassName: {
|
|
172
|
+
type: StringConstructor;
|
|
173
|
+
default: string;
|
|
174
|
+
};
|
|
175
|
+
containerHighlightDuration: {
|
|
176
|
+
type: NumberConstructor;
|
|
177
|
+
default: number;
|
|
178
|
+
};
|
|
179
|
+
containerHighlightType: {
|
|
180
|
+
type: PropType<ContainerHighlightType>;
|
|
181
|
+
default: ContainerHighlightType;
|
|
182
|
+
};
|
|
152
183
|
stageRect: {
|
|
153
184
|
type: PropType<StageRect>;
|
|
154
185
|
};
|
|
@@ -164,9 +195,9 @@ declare const _default: DefineComponent<{
|
|
|
164
195
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
165
196
|
}, {
|
|
166
197
|
menu: MenuBarData;
|
|
198
|
+
codeOptions: Record<string, any>;
|
|
167
199
|
layerContentMenu: MenuItem[];
|
|
168
200
|
stageContentMenu: MenuItem[];
|
|
169
|
-
codeOptions: Record<string, any>;
|
|
170
201
|
modelValue: MApp;
|
|
171
202
|
componentGroupList: ComponentGroup[];
|
|
172
203
|
autoScrollIntoView: boolean;
|
|
@@ -174,5 +205,9 @@ declare const _default: DefineComponent<{
|
|
|
174
205
|
propsValues: Record<string, MNode>;
|
|
175
206
|
eventMethodList: Record<string, any>;
|
|
176
207
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
208
|
+
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
209
|
+
containerHighlightClassName: string;
|
|
210
|
+
containerHighlightDuration: number;
|
|
211
|
+
containerHighlightType: ContainerHighlightType;
|
|
177
212
|
}>;
|
|
178
213
|
export default _default;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { MenuItem } from '../type';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
new (...args: any[]): {
|
|
5
|
+
$: import("vue").ComponentInternalInstance;
|
|
6
|
+
$data: {};
|
|
7
|
+
$props: Partial<{
|
|
8
|
+
menuData: MenuItem[];
|
|
9
|
+
isSubMenu: boolean;
|
|
10
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
menuData?: MenuItem[] | undefined;
|
|
12
|
+
isSubMenu?: boolean | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
menuData: () => never[];
|
|
15
|
+
isSubMenu: boolean;
|
|
16
|
+
}>>> & {
|
|
17
|
+
onHide?: ((...args: any[]) => any) | undefined;
|
|
18
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "menuData" | "isSubMenu">;
|
|
20
|
+
$attrs: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
$refs: {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
$slots: Readonly<{
|
|
27
|
+
[name: string]: import("vue").Slot | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
30
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
31
|
+
$emit: (event: "hide" | "show", ...args: any[]) => void;
|
|
32
|
+
$el: any;
|
|
33
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
34
|
+
menuData?: MenuItem[] | undefined;
|
|
35
|
+
isSubMenu?: boolean | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
menuData: () => never[];
|
|
38
|
+
isSubMenu: boolean;
|
|
39
|
+
}>>> & {
|
|
40
|
+
onHide?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
hide: () => void;
|
|
44
|
+
show: (e: MouseEvent) => void;
|
|
45
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], string, {
|
|
46
|
+
menuData: MenuItem[];
|
|
47
|
+
isSubMenu: boolean;
|
|
48
|
+
}> & {
|
|
49
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
50
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
51
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
52
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
53
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
54
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
55
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
56
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
57
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
58
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
59
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
60
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
61
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
62
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
63
|
+
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;
|
|
64
|
+
};
|
|
65
|
+
$forceUpdate: () => void;
|
|
66
|
+
$nextTick: typeof nextTick;
|
|
67
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
68
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
69
|
+
menuData?: MenuItem[] | undefined;
|
|
70
|
+
isSubMenu?: boolean | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
menuData: () => never[];
|
|
73
|
+
isSubMenu: boolean;
|
|
74
|
+
}>>> & {
|
|
75
|
+
onHide?: ((...args: any[]) => any) | undefined;
|
|
76
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
77
|
+
} & import("vue").ShallowUnwrapRef<{
|
|
78
|
+
hide: () => void;
|
|
79
|
+
show: (e: MouseEvent) => void;
|
|
80
|
+
}> & {} & import("vue").ComponentCustomProperties;
|
|
81
|
+
__isFragment?: undefined;
|
|
82
|
+
__isTeleport?: undefined;
|
|
83
|
+
__isSuspense?: undefined;
|
|
84
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
85
|
+
menuData?: MenuItem[] | undefined;
|
|
86
|
+
isSubMenu?: boolean | undefined;
|
|
87
|
+
}>, {
|
|
88
|
+
menuData: () => never[];
|
|
89
|
+
isSubMenu: boolean;
|
|
90
|
+
}>>> & {
|
|
91
|
+
onHide?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
hide: () => void;
|
|
95
|
+
show: (e: MouseEvent) => void;
|
|
96
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], "hide" | "show", {
|
|
97
|
+
menuData: MenuItem[];
|
|
98
|
+
isSubMenu: boolean;
|
|
99
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
100
|
+
$slots: {};
|
|
101
|
+
});
|
|
102
|
+
export default _default;
|
|
103
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
104
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
105
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
106
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
107
|
+
} : {
|
|
108
|
+
type: import('vue').PropType<T[K]>;
|
|
109
|
+
required: true;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
113
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
114
|
+
default: D[K];
|
|
115
|
+
} : P[K];
|
|
116
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component, PropType, toRaw } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
icon: {
|
|
4
|
+
type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
|
|
5
|
+
};
|
|
6
|
+
}, {
|
|
7
|
+
toRaw: typeof toRaw;
|
|
8
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
icon: {
|
|
10
|
+
type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
|
|
11
|
+
};
|
|
12
|
+
}>>, {}>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
width: NumberConstructor;
|
|
3
|
+
height: NumberConstructor;
|
|
4
|
+
zoom: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
container: import("vue").Ref<HTMLDivElement | undefined>;
|
|
10
|
+
el: import("vue").Ref<HTMLDivElement | undefined>;
|
|
11
|
+
style: import("vue").ComputedRef<string>;
|
|
12
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
width: NumberConstructor;
|
|
14
|
+
height: NumberConstructor;
|
|
15
|
+
zoom: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
zoom: number;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import type { MenuButton, MenuComponent } from '../type';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
new (...args: any[]): {
|
|
5
|
+
$: import("vue").ComponentInternalInstance;
|
|
6
|
+
$data: {};
|
|
7
|
+
$props: Partial<{
|
|
8
|
+
data: string | MenuButton | MenuComponent;
|
|
9
|
+
eventType: "click" | "mousedown" | "mouseup";
|
|
10
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
data: {
|
|
12
|
+
type: PropType<string | MenuButton | MenuComponent>;
|
|
13
|
+
require: boolean;
|
|
14
|
+
default: () => {
|
|
15
|
+
type: string;
|
|
16
|
+
display: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
eventType: {
|
|
20
|
+
type: PropType<"click" | "mousedown" | "mouseup">;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "eventType">;
|
|
24
|
+
$attrs: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
$refs: {
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
$slots: Readonly<{
|
|
31
|
+
[name: string]: import("vue").Slot | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
34
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
35
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
36
|
+
$el: any;
|
|
37
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
data: {
|
|
39
|
+
type: PropType<string | MenuButton | MenuComponent>;
|
|
40
|
+
require: boolean;
|
|
41
|
+
default: () => {
|
|
42
|
+
type: string;
|
|
43
|
+
display: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
eventType: {
|
|
47
|
+
type: PropType<"click" | "mousedown" | "mouseup">;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
51
|
+
data: string | MenuButton | MenuComponent;
|
|
52
|
+
eventType: "click" | "mousedown" | "mouseup";
|
|
53
|
+
}> & {
|
|
54
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
55
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
56
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
57
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
58
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
59
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
60
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
61
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
62
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
63
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
64
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
65
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
66
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
67
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
68
|
+
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;
|
|
69
|
+
};
|
|
70
|
+
$forceUpdate: () => void;
|
|
71
|
+
$nextTick: typeof import("vue").nextTick;
|
|
72
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
73
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
|
74
|
+
data: {
|
|
75
|
+
type: PropType<string | MenuButton | MenuComponent>;
|
|
76
|
+
require: boolean;
|
|
77
|
+
default: () => {
|
|
78
|
+
type: string;
|
|
79
|
+
display: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
eventType: {
|
|
83
|
+
type: PropType<"click" | "mousedown" | "mouseup">;
|
|
84
|
+
default: string;
|
|
85
|
+
};
|
|
86
|
+
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
87
|
+
__isFragment?: undefined;
|
|
88
|
+
__isTeleport?: undefined;
|
|
89
|
+
__isSuspense?: undefined;
|
|
90
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
91
|
+
data: {
|
|
92
|
+
type: PropType<string | MenuButton | MenuComponent>;
|
|
93
|
+
require: boolean;
|
|
94
|
+
default: () => {
|
|
95
|
+
type: string;
|
|
96
|
+
display: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
eventType: {
|
|
100
|
+
type: PropType<"click" | "mousedown" | "mouseup">;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
104
|
+
data: string | MenuButton | MenuComponent;
|
|
105
|
+
eventType: "click" | "mousedown" | "mouseup";
|
|
106
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
107
|
+
$slots: {};
|
|
108
|
+
});
|
|
109
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<Readonly<{
|
|
2
|
+
name?: any;
|
|
3
|
+
model?: any;
|
|
4
|
+
config?: any;
|
|
5
|
+
prop?: any;
|
|
6
|
+
}>, {
|
|
7
|
+
height: import("vue").ComputedRef<string>;
|
|
8
|
+
language: import("vue").ComputedRef<any>;
|
|
9
|
+
save(v: string): void;
|
|
10
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
|
|
11
|
+
name?: any;
|
|
12
|
+
model?: any;
|
|
13
|
+
config?: any;
|
|
14
|
+
prop?: any;
|
|
15
|
+
}>>> & {
|
|
16
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
readonly name?: any;
|
|
19
|
+
readonly model?: any;
|
|
20
|
+
readonly config?: any;
|
|
21
|
+
readonly prop?: any;
|
|
22
|
+
}>;
|
|
23
|
+
export default _default;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
-
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
1
|
import { PropType } from 'vue';
|
|
4
2
|
interface CodeLinkConfig {
|
|
5
3
|
type: 'code-link';
|
|
@@ -7,7 +5,7 @@ interface CodeLinkConfig {
|
|
|
7
5
|
text?: string;
|
|
8
6
|
formTitle?: string;
|
|
9
7
|
}
|
|
10
|
-
declare const _default: DefineComponent<{
|
|
8
|
+
declare const _default: import("vue").DefineComponent<{
|
|
11
9
|
config: {
|
|
12
10
|
type: PropType<CodeLinkConfig>;
|
|
13
11
|
};
|
|
@@ -21,10 +19,10 @@ declare const _default: DefineComponent<{
|
|
|
21
19
|
type: StringConstructor;
|
|
22
20
|
};
|
|
23
21
|
}, {
|
|
24
|
-
modelValue: Ref<{
|
|
22
|
+
modelValue: import("vue").Ref<{
|
|
25
23
|
form: Record<string, any>;
|
|
26
24
|
}>;
|
|
27
|
-
formConfig: ComputedRef<{
|
|
25
|
+
formConfig: import("vue").ComputedRef<{
|
|
28
26
|
text: string;
|
|
29
27
|
type: string;
|
|
30
28
|
form: {
|
|
@@ -35,7 +33,7 @@ declare const _default: DefineComponent<{
|
|
|
35
33
|
formTitle?: string | undefined;
|
|
36
34
|
}>;
|
|
37
35
|
changeHandler(v: Record<string, any>): void;
|
|
38
|
-
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "change"[], "change", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
36
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
37
|
config: {
|
|
40
38
|
type: PropType<CodeLinkConfig>;
|
|
41
39
|
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
config: any;
|
|
7
|
+
model: any;
|
|
8
|
+
prop: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}>>> & {
|
|
11
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
13
|
+
$attrs: {
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
$refs: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
$slots: Readonly<{
|
|
20
|
+
[name: string]: import("vue").Slot | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
23
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
24
|
+
$emit: (event: "change", ...args: any[]) => void;
|
|
25
|
+
$el: any;
|
|
26
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
27
|
+
config: any;
|
|
28
|
+
model: any;
|
|
29
|
+
prop: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}>>> & {
|
|
32
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], string, {}> & {
|
|
34
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
38
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
39
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
40
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
41
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
42
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
43
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
44
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
45
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
46
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
47
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
48
|
+
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;
|
|
49
|
+
};
|
|
50
|
+
$forceUpdate: () => void;
|
|
51
|
+
$nextTick: typeof import("vue").nextTick;
|
|
52
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
53
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
54
|
+
config: any;
|
|
55
|
+
model: any;
|
|
56
|
+
prop: string;
|
|
57
|
+
name: string;
|
|
58
|
+
}>>> & {
|
|
59
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
60
|
+
} & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
61
|
+
__isFragment?: undefined;
|
|
62
|
+
__isTeleport?: undefined;
|
|
63
|
+
__isSuspense?: undefined;
|
|
64
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
65
|
+
config: any;
|
|
66
|
+
model: any;
|
|
67
|
+
prop: string;
|
|
68
|
+
name: string;
|
|
69
|
+
}>>> & {
|
|
70
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
72
|
+
$slots: {};
|
|
73
|
+
});
|
|
74
|
+
export default _default;
|
|
75
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
76
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
77
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
78
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
79
|
+
} : {
|
|
80
|
+
type: import('vue').PropType<T[K]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import './utils/polyfills';
|
|
1
2
|
import { App } from 'vue';
|
|
2
3
|
import type { InstallOptions } from './type';
|
|
4
|
+
import './theme/index.scss';
|
|
3
5
|
export type { MoveableOptions } from '@tmagic/stage';
|
|
4
6
|
export * from './type';
|
|
5
7
|
export * from './utils';
|
|
@@ -8,6 +10,7 @@ export { default as TMagicCodeEditor } from './layouts/CodeEditor.vue';
|
|
|
8
10
|
export { default as editorService } from './services/editor';
|
|
9
11
|
export { default as propsService } from './services/props';
|
|
10
12
|
export { default as historyService } from './services/history';
|
|
13
|
+
export { default as storageService } from './services/storage';
|
|
11
14
|
export { default as eventsService } from './services/events';
|
|
12
15
|
export { default as uiService } from './services/ui';
|
|
13
16
|
export { default as ComponentListPanel } from './layouts/sidebar/ComponentListPanel.vue';
|
|
@@ -15,6 +18,6 @@ export { default as LayerPanel } from './layouts/sidebar/LayerPanel.vue';
|
|
|
15
18
|
export { default as PropsPanel } from './layouts/PropsPanel.vue';
|
|
16
19
|
export { default as ToolButton } from './components/ToolButton.vue';
|
|
17
20
|
declare const _default: {
|
|
18
|
-
install: (app: App, opt?: InstallOptions
|
|
21
|
+
install: (app: App, opt?: InstallOptions) => void;
|
|
19
22
|
};
|
|
20
23
|
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
clickHandler(): void;
|
|
3
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|