@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
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Ref } from '@vue/reactivity';
|
|
2
|
-
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
1
|
import { PropType } from 'vue';
|
|
4
2
|
import { SideBarData } from '../../type';
|
|
5
|
-
declare const _default: DefineComponent<{
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
6
4
|
data: {
|
|
7
5
|
type: PropType<SideBarData>;
|
|
8
6
|
default: () => {
|
|
@@ -12,8 +10,8 @@ declare const _default: DefineComponent<{
|
|
|
12
10
|
};
|
|
13
11
|
};
|
|
14
12
|
}, {
|
|
15
|
-
activeTabName: Ref<string>;
|
|
16
|
-
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
13
|
+
activeTabName: import("vue").Ref<string>;
|
|
14
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
15
|
data: {
|
|
18
16
|
type: PropType<SideBarData>;
|
|
19
17
|
default: () => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { SideComponent, SideItem } from '../../type';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
data: {
|
|
5
|
+
type: PropType<SideItem>;
|
|
6
|
+
};
|
|
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
|
+
}>>, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { MPage } from '@tmagic/schema';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
7
|
+
$attrs: {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
$refs: {
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
$slots: Readonly<{
|
|
14
|
+
[name: string]: import("vue").Slot | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
17
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
18
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
|
19
|
+
$el: any;
|
|
20
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
|
|
21
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
22
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
23
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
24
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
25
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
26
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
27
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
28
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
29
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
30
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
33
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
34
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
35
|
+
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;
|
|
36
|
+
};
|
|
37
|
+
$forceUpdate: () => void;
|
|
38
|
+
$nextTick: typeof import("vue").nextTick;
|
|
39
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
40
|
+
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
41
|
+
__isFragment?: undefined;
|
|
42
|
+
__isTeleport?: undefined;
|
|
43
|
+
__isSuspense?: undefined;
|
|
44
|
+
} & 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 () => {
|
|
45
|
+
$slots: {
|
|
46
|
+
'page-bar-title': (_: {
|
|
47
|
+
page: MPage;
|
|
48
|
+
}) => any;
|
|
49
|
+
'page-bar-popover': (_: {
|
|
50
|
+
page: MPage;
|
|
51
|
+
}) => any;
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
default: (_: {}) => any;
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
});
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{
|
|
6
|
+
isMultiSelect: boolean;
|
|
7
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
isMultiSelect?: boolean | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
isMultiSelect: boolean;
|
|
11
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "isMultiSelect">;
|
|
12
|
+
$attrs: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
$refs: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
$slots: Readonly<{
|
|
19
|
+
[name: string]: import("vue").Slot | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
22
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
23
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
24
|
+
$el: any;
|
|
25
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
26
|
+
isMultiSelect?: boolean | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
isMultiSelect: boolean;
|
|
29
|
+
}>>>, {
|
|
30
|
+
show: (e: MouseEvent) => Promise<void>;
|
|
31
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
32
|
+
isMultiSelect: boolean;
|
|
33
|
+
}> & {
|
|
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_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
54
|
+
isMultiSelect?: boolean | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
isMultiSelect: boolean;
|
|
57
|
+
}>>> & import("vue").ShallowUnwrapRef<{
|
|
58
|
+
show: (e: MouseEvent) => Promise<void>;
|
|
59
|
+
}> & {} & import("vue").ComponentCustomProperties;
|
|
60
|
+
__isFragment?: undefined;
|
|
61
|
+
__isTeleport?: undefined;
|
|
62
|
+
__isSuspense?: undefined;
|
|
63
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
64
|
+
isMultiSelect?: boolean | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
isMultiSelect: boolean;
|
|
67
|
+
}>>>, {
|
|
68
|
+
show: (e: MouseEvent) => Promise<void>;
|
|
69
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
70
|
+
isMultiSelect: boolean;
|
|
71
|
+
}> & 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
|
+
};
|
|
84
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
85
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
86
|
+
default: D[K];
|
|
87
|
+
} : P[K];
|
|
88
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MPage } from '@tmagic/schema';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
3
|
+
workspace: import("vue").Ref<HTMLDivElement | undefined>;
|
|
4
|
+
page: import("vue").ComputedRef<MPage | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
6
|
+
export default _default;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentGroup } from '../type';
|
|
2
|
+
import BaseService from './BaseService';
|
|
3
|
+
declare class ComponentList extends BaseService {
|
|
4
|
+
private state;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* @param componentGroupList 组件列表配置
|
|
8
|
+
*/
|
|
9
|
+
setList(componentGroupList: ComponentGroup[]): void;
|
|
10
|
+
getList(): ComponentGroup[];
|
|
11
|
+
}
|
|
12
|
+
export declare type ComponentListService = ComponentList;
|
|
13
|
+
declare const _default: ComponentList;
|
|
14
|
+
export default _default;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { Id, MContainer, MNode } from '@tmagic/schema';
|
|
2
2
|
import { StepValue } from '../services/history';
|
|
3
|
-
import type { AddMNode, EditorNodeInfo, StoreState } from '../type';
|
|
3
|
+
import type { AddMNode, EditorNodeInfo, PastePosition, StoreState } from '../type';
|
|
4
4
|
import { LayerOffset, Layout } from '../type';
|
|
5
5
|
import BaseService from './BaseService';
|
|
6
6
|
declare class Editor extends BaseService {
|
|
7
|
+
state: StoreState;
|
|
7
8
|
private isHistoryStateChange;
|
|
8
|
-
private state;
|
|
9
9
|
constructor();
|
|
10
10
|
/**
|
|
11
11
|
* 设置当前指点节点配置
|
|
12
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode'
|
|
12
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes'
|
|
13
13
|
* @param value MNode
|
|
14
14
|
* @returns MNode
|
|
15
15
|
*/
|
|
16
16
|
set<T = MNode>(name: keyof StoreState, value: T): void;
|
|
17
17
|
/**
|
|
18
18
|
* 获取当前指点节点配置
|
|
19
|
-
* @param name 'root' | 'page' | 'parent' | 'node'
|
|
19
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes'
|
|
20
20
|
* @returns MNode
|
|
21
21
|
*/
|
|
22
22
|
get<T = MNode>(name: keyof StoreState): T;
|
|
@@ -59,25 +59,34 @@ declare class Editor extends BaseService {
|
|
|
59
59
|
* @returns 当前高亮的节点配置
|
|
60
60
|
*/
|
|
61
61
|
highlight(config: MNode | Id): void;
|
|
62
|
+
/**
|
|
63
|
+
* 多选
|
|
64
|
+
* @param ids 指定节点ID
|
|
65
|
+
* @returns 加入多选的节点配置
|
|
66
|
+
*/
|
|
67
|
+
multiSelect(ids: Id[]): void;
|
|
68
|
+
doAdd(node: MNode, parent: MContainer): Promise<MNode>;
|
|
62
69
|
/**
|
|
63
70
|
* 向指点容器添加组件节点
|
|
64
71
|
* @param addConfig 将要添加的组件节点配置
|
|
65
72
|
* @param parent 要添加到的容器组件节点配置,如果不设置,默认为当前选中的组件的父节点
|
|
66
73
|
* @returns 添加后的节点
|
|
67
74
|
*/
|
|
68
|
-
add(addNode: AddMNode, parent?: MContainer | null): Promise<MNode>;
|
|
75
|
+
add(addNode: AddMNode | MNode[], parent?: MContainer | null): Promise<MNode | MNode[]>;
|
|
76
|
+
doRemove(node: MNode): Promise<void>;
|
|
69
77
|
/**
|
|
70
78
|
* 删除组件
|
|
71
79
|
* @param {Object} node
|
|
72
80
|
* @return {Object} 删除的组件配置
|
|
73
81
|
*/
|
|
74
|
-
remove(
|
|
82
|
+
remove(nodeOrNodeList: MNode | MNode[]): Promise<void>;
|
|
83
|
+
doUpdate(config: MNode): Promise<MNode>;
|
|
75
84
|
/**
|
|
76
85
|
* 更新节点
|
|
77
86
|
* @param config 新的节点配置,配置中需要有id信息
|
|
78
87
|
* @returns 更新后的节点配置
|
|
79
88
|
*/
|
|
80
|
-
update(config: MNode): Promise<MNode>;
|
|
89
|
+
update(config: MNode | MNode[]): Promise<MNode | MNode[]>;
|
|
81
90
|
/**
|
|
82
91
|
* 将id为id1的组件移动到id为id2的组件位置上,例如:[1,2,3,4] -> sort(1,3) -> [2,1,3,4]
|
|
83
92
|
* @param id1 组件ID
|
|
@@ -90,27 +99,31 @@ declare class Editor extends BaseService {
|
|
|
90
99
|
* @param config 组件节点配置
|
|
91
100
|
* @returns 组件节点配置
|
|
92
101
|
*/
|
|
93
|
-
copy(config: MNode): Promise<void>;
|
|
102
|
+
copy(config: MNode | MNode[]): Promise<void>;
|
|
94
103
|
/**
|
|
95
104
|
* 从localStorage中获取节点,然后添加到当前容器中
|
|
96
|
-
* @param position
|
|
105
|
+
* @param position 粘贴的坐标
|
|
97
106
|
* @returns 添加后的组件节点配置
|
|
98
107
|
*/
|
|
99
|
-
paste(position?:
|
|
100
|
-
|
|
101
|
-
top?: number;
|
|
102
|
-
}): Promise<MNode | void>;
|
|
108
|
+
paste(position?: PastePosition): Promise<MNode | MNode[] | void>;
|
|
109
|
+
doAlignCenter(config: MNode): Promise<MNode>;
|
|
103
110
|
/**
|
|
104
111
|
* 将指点节点设置居中
|
|
105
112
|
* @param config 组件节点配置
|
|
106
113
|
* @returns 当前组件节点配置
|
|
107
114
|
*/
|
|
108
|
-
alignCenter(config: MNode): Promise<MNode |
|
|
115
|
+
alignCenter(config: MNode | MNode[]): Promise<MNode | MNode[]>;
|
|
109
116
|
/**
|
|
110
117
|
* 移动当前选中节点位置
|
|
111
118
|
* @param offset 偏移量
|
|
112
119
|
*/
|
|
113
120
|
moveLayer(offset: number | LayerOffset): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* 移动到指定容器中
|
|
123
|
+
* @param config 需要移动的节点
|
|
124
|
+
* @param targetId 容器ID
|
|
125
|
+
*/
|
|
126
|
+
moveToContainer(config: MNode, targetId: Id): Promise<MNode | undefined>;
|
|
114
127
|
/**
|
|
115
128
|
* 撤销当前操作
|
|
116
129
|
* @returns 上一次数据
|
|
File without changes
|
|
File without changes
|
|
@@ -29,13 +29,37 @@ declare class Props extends BaseService {
|
|
|
29
29
|
* @param type 组件类型
|
|
30
30
|
* @returns 组件初始值
|
|
31
31
|
*/
|
|
32
|
-
getPropsValue(type: string, defaultValue?: Record<string, any>): Promise<any>;
|
|
32
|
+
getPropsValue(type: string, { inputEvent, ...defaultValue }?: Record<string, any>): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* 生成指定位数的GUID,无【-】格式
|
|
35
|
+
* @param digit 位数,默认值8
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
guid(digit?: number): string;
|
|
33
39
|
createId(type: string | number): Promise<string>;
|
|
34
40
|
/**
|
|
35
41
|
* 将组件与组件的子元素配置中的id都设置成一个新的ID
|
|
36
42
|
* @param {Object} config 组件配置
|
|
37
43
|
*/
|
|
38
|
-
setNewItemId(config: MNode, parent?: MPage): Promise<
|
|
44
|
+
setNewItemId(config: MNode, parent?: MPage): Promise<MNode>;
|
|
45
|
+
/**
|
|
46
|
+
* 获取默认属性配置
|
|
47
|
+
* @param type 组件类型
|
|
48
|
+
* @returns Object
|
|
49
|
+
*/
|
|
50
|
+
getDefaultPropsValue(type: string): Promise<{
|
|
51
|
+
type: string;
|
|
52
|
+
layout: string;
|
|
53
|
+
style: {};
|
|
54
|
+
name: string;
|
|
55
|
+
items: never[];
|
|
56
|
+
} | {
|
|
57
|
+
type: string;
|
|
58
|
+
style: {};
|
|
59
|
+
name: string;
|
|
60
|
+
layout?: undefined;
|
|
61
|
+
items?: undefined;
|
|
62
|
+
}>;
|
|
39
63
|
}
|
|
40
64
|
export declare type PropsService = Props;
|
|
41
65
|
declare const _default: Props;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import BaseService from './BaseService';
|
|
2
|
+
interface Options {
|
|
3
|
+
namespace?: string;
|
|
4
|
+
protocol?: Protocol;
|
|
5
|
+
}
|
|
6
|
+
export declare enum Protocol {
|
|
7
|
+
OBJECT = "object",
|
|
8
|
+
JSON = "json",
|
|
9
|
+
STRING = "string",
|
|
10
|
+
NUMBER = "number",
|
|
11
|
+
BOOLEAN = "boolean"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 数据存储服务
|
|
15
|
+
*/
|
|
16
|
+
export declare class WebStorage extends BaseService {
|
|
17
|
+
private storage;
|
|
18
|
+
private namespace;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* 获取数据存储对象,可以通过
|
|
22
|
+
* const storageService = new StorageService();
|
|
23
|
+
* storageService.usePlugin({
|
|
24
|
+
* // 替换存储对象为 sessionStorage
|
|
25
|
+
* async afterGetStorage(): Promise<Storage> {
|
|
26
|
+
* return window.sessionStorage;
|
|
27
|
+
* },
|
|
28
|
+
* });
|
|
29
|
+
*/
|
|
30
|
+
getStorage(): Promise<Storage>;
|
|
31
|
+
getNamespace(): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* 清理,支持storageService.usePlugin
|
|
34
|
+
*/
|
|
35
|
+
clear(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* 获取存储项,支持storageService.usePlugin
|
|
38
|
+
*/
|
|
39
|
+
getItem(key: string, options?: Options): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* 获取指定索引位置的key
|
|
42
|
+
*/
|
|
43
|
+
key(index: number): Promise<string | null>;
|
|
44
|
+
/**
|
|
45
|
+
* 移除存储项,支持storageService.usePlugin
|
|
46
|
+
*/
|
|
47
|
+
removeItem(key: string, options?: Options): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* 设置存储项,支持storageService.usePlugin
|
|
50
|
+
*/
|
|
51
|
+
setItem(key: string, value: any, options?: Options): Promise<void>;
|
|
52
|
+
private getValueAndProtocol;
|
|
53
|
+
}
|
|
54
|
+
export declare type StorageService = WebStorage;
|
|
55
|
+
declare const _default: WebStorage;
|
|
56
|
+
export default _default;
|
|
@@ -2,12 +2,13 @@ import type { Component } from 'vue';
|
|
|
2
2
|
import type { FormConfig } from '@tmagic/form';
|
|
3
3
|
import type { Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
|
|
4
4
|
import type StageCore from '@tmagic/stage';
|
|
5
|
-
import type { MoveableOptions } from '@tmagic/stage';
|
|
5
|
+
import type { ContainerHighlightType, MoveableOptions } from '@tmagic/stage';
|
|
6
6
|
import type { ComponentListService } from './services/componentList';
|
|
7
7
|
import type { EditorService } from './services/editor';
|
|
8
8
|
import type { EventsService } from './services/events';
|
|
9
9
|
import type { HistoryService } from './services/history';
|
|
10
10
|
import type { PropsService } from './services/props';
|
|
11
|
+
import type { StorageService } from './services/storage';
|
|
11
12
|
import type { UiService } from './services/ui';
|
|
12
13
|
export declare type BeforeAdd = (config: MNode, parent: MContainer) => Promise<MNode> | MNode;
|
|
13
14
|
export declare type GetConfig = (config: FormConfig) => Promise<FormConfig> | FormConfig;
|
|
@@ -17,6 +18,7 @@ export interface InstallOptions {
|
|
|
17
18
|
export interface Services {
|
|
18
19
|
editorService: EditorService;
|
|
19
20
|
historyService: HistoryService;
|
|
21
|
+
storageService: StorageService;
|
|
20
22
|
eventsService: EventsService;
|
|
21
23
|
propsService: PropsService;
|
|
22
24
|
componentListService: ComponentListService;
|
|
@@ -25,9 +27,13 @@ export interface Services {
|
|
|
25
27
|
export interface StageOptions {
|
|
26
28
|
runtimeUrl: string;
|
|
27
29
|
autoScrollIntoView: boolean;
|
|
30
|
+
containerHighlightClassName: string;
|
|
31
|
+
containerHighlightDuration: number;
|
|
32
|
+
containerHighlightType: ContainerHighlightType;
|
|
28
33
|
render: () => HTMLDivElement;
|
|
29
34
|
moveableOptions: MoveableOptions | ((core?: StageCore) => MoveableOptions);
|
|
30
35
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
36
|
+
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
31
37
|
updateDragEl: (el: HTMLDivElement) => void;
|
|
32
38
|
}
|
|
33
39
|
export interface StoreState {
|
|
@@ -36,6 +42,7 @@ export interface StoreState {
|
|
|
36
42
|
parent: MContainer | null;
|
|
37
43
|
node: MNode | null;
|
|
38
44
|
highlightNode: MNode | null;
|
|
45
|
+
nodes: MNode[];
|
|
39
46
|
stage: StageCore | null;
|
|
40
47
|
modifiedNodeIds: Map<Id, Id>;
|
|
41
48
|
pageLength: number;
|
|
@@ -89,8 +96,21 @@ export interface EditorNodeInfo {
|
|
|
89
96
|
export interface AddMNode {
|
|
90
97
|
type: string;
|
|
91
98
|
name?: string;
|
|
99
|
+
inputEvent?: DragEvent;
|
|
92
100
|
[key: string]: any;
|
|
93
101
|
}
|
|
102
|
+
export interface PastePosition {
|
|
103
|
+
left?: number;
|
|
104
|
+
top?: number;
|
|
105
|
+
/**
|
|
106
|
+
* 粘贴位置X方向偏移量
|
|
107
|
+
*/
|
|
108
|
+
offsetX?: number;
|
|
109
|
+
/**
|
|
110
|
+
* 粘贴位置Y方向偏移量
|
|
111
|
+
*/
|
|
112
|
+
offsetY?: number;
|
|
113
|
+
}
|
|
94
114
|
/**
|
|
95
115
|
* 菜单按钮
|
|
96
116
|
*/
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* @param {Array} middleware
|
|
3
3
|
* @return {Function}
|
|
4
4
|
*/
|
|
5
|
-
export declare const compose: (middleware: Function[]) => (args: any[], next?: Function
|
|
5
|
+
export declare const compose: (middleware: Function[]) => (args: any[], next?: Function) => Promise<void>;
|
|
File without changes
|
|
@@ -32,9 +32,16 @@ export declare const generatePageNameByApp: (app: MApp) => string;
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const isFixed: (node: MNode) => boolean;
|
|
34
34
|
export declare const getNodeIndex: (node: MNode, parent: MContainer | MApp) => number;
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const
|
|
35
|
+
export declare const getRelativeStyle: (style?: Record<string, any>) => Record<string, any>;
|
|
36
|
+
export declare const getInitPositionStyle: (style: Record<string, any> | undefined, layout: Layout) => Record<string, any>;
|
|
37
37
|
export declare const setLayout: (node: MNode, layout: Layout) => MNode;
|
|
38
|
-
export declare const change2Fixed: (node: MNode, root: MApp) =>
|
|
39
|
-
|
|
38
|
+
export declare const change2Fixed: (node: MNode, root: MApp) => {
|
|
39
|
+
left: number;
|
|
40
|
+
top: number;
|
|
41
|
+
};
|
|
42
|
+
export declare const Fixed2Other: (node: MNode, root: MApp, getLayout: (parent: MNode, node?: MNode) => Promise<Layout>) => Promise<Record<string, any>>;
|
|
40
43
|
export declare const getGuideLineFromCache: (key: string) => number[];
|
|
44
|
+
export declare const fixNodeLeft: (config: MNode, parent: MContainer, doc?: Document) => any;
|
|
45
|
+
export declare const fixNodePosition: (config: MNode, parent: MContainer, stage: StageCore | null) => {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
} | undefined;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Id, MContainer, MNode } from '@tmagic/schema';
|
|
2
|
+
import { AddMNode, PastePosition } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* 粘贴前置操作:返回分配了新id以及校准了坐标的配置
|
|
5
|
+
* @param position 粘贴的坐标
|
|
6
|
+
* @param config 待粘贴的元素配置(复制时保存的那份配置)
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const beforePaste: (position: PastePosition, config: MNode[]) => Promise<MNode[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 将元素粘贴到容器内时,将相对于画布坐标转换为相对于容器的坐标
|
|
12
|
+
* @param position PastePosition 粘贴时相对于画布的坐标
|
|
13
|
+
* @param id 元素id
|
|
14
|
+
* @returns PastePosition 转换后的坐标
|
|
15
|
+
*/
|
|
16
|
+
export declare const getPositionInContainer: (position: PastePosition | undefined, id: Id) => {
|
|
17
|
+
left: number;
|
|
18
|
+
top: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const getAddParent: (node: MNode) => MContainer | undefined;
|
|
21
|
+
export declare const getDefaultConfig: (addNode: AddMNode, parentNode: MContainer) => Promise<any>;
|