@tmagic/editor 1.1.0-beta.1 → 1.1.0-beta.12
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} +1449 -1205
- package/dist/tmagic-editor.mjs.map +1 -0
- package/dist/tmagic-editor.umd.js +1463 -1219
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +23 -21
- package/src/Editor.vue +24 -15
- package/src/components/ContentMenu.vue +87 -99
- package/src/components/Icon.vue +1 -1
- package/src/components/ScrollViewer.vue +2 -2
- package/src/components/ToolButton.vue +150 -167
- package/src/fields/UISelect.vue +51 -72
- package/src/index.ts +2 -1
- package/src/layouts/AddPageBox.vue +2 -2
- 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 +6 -17
- package/src/layouts/sidebar/LayerMenu.vue +2 -2
- package/src/layouts/sidebar/LayerPanel.vue +52 -12
- package/src/layouts/sidebar/Sidebar.vue +1 -1
- package/src/layouts/sidebar/TabPane.vue +2 -2
- package/src/layouts/workspace/PageBar.vue +63 -192
- package/src/layouts/workspace/PageBarScrollContainer.vue +111 -0
- package/src/layouts/workspace/Stage.vue +198 -219
- package/src/layouts/workspace/ViewerMenu.vue +140 -147
- package/src/layouts/workspace/Workspace.vue +14 -12
- package/src/services/BaseService.ts +5 -10
- package/src/services/componentList.ts +3 -3
- package/src/services/editor.ts +208 -147
- package/src/services/events.ts +1 -1
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +74 -49
- 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 +25 -7
- package/src/utils/config.ts +1 -1
- package/src/utils/editor.ts +20 -12
- package/src/utils/operator.ts +109 -0
- package/src/utils/props.ts +2 -27
- package/src/utils/scroll-viewer.ts +1 -1
- package/tsconfig.build.json +13 -0
- package/{dist/types/src → types}/Editor.vue.d.ts +17 -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 +1101 -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 +22 -14
- package/{dist/types/src → types}/services/events.d.ts +0 -0
- package/{dist/types/src → types}/services/history.d.ts +0 -0
- package/types/services/props.d.ts +97 -0
- 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 +18 -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 +6 -3
- 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 -23
- 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 -16
- 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/services/props.d.ts +0 -42
- 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
|
@@ -33,12 +33,15 @@ export declare const generatePageNameByApp: (app: MApp) => string;
|
|
|
33
33
|
export declare const isFixed: (node: MNode) => boolean;
|
|
34
34
|
export declare const getNodeIndex: (node: MNode, parent: MContainer | MApp) => number;
|
|
35
35
|
export declare const getRelativeStyle: (style?: Record<string, any>) => Record<string, any>;
|
|
36
|
-
export declare const getInitPositionStyle: (style: Record<string, any> | undefined, layout: Layout
|
|
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
38
|
export declare const change2Fixed: (node: MNode, root: MApp) => {
|
|
39
39
|
left: number;
|
|
40
40
|
top: number;
|
|
41
41
|
};
|
|
42
|
-
export declare const Fixed2Other: (node: MNode, root: MApp, getLayout: (parent: MNode, node?: MNode
|
|
42
|
+
export declare const Fixed2Other: (node: MNode, root: MApp, getLayout: (parent: MNode, node?: MNode) => Promise<Layout>) => Promise<Record<string, any>>;
|
|
43
43
|
export declare const getGuideLineFromCache: (key: string) => number[];
|
|
44
|
-
export declare const fixNodeLeft: (config: MNode, parent: MContainer, doc?: Document
|
|
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>;
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FormConfig, FormState } from '@tmagic/form';
|
|
2
2
|
/**
|
|
3
3
|
* 统一为组件属性表单加上事件、高级、样式配置
|
|
4
4
|
* @param config 组件属性配置
|
|
@@ -9,7 +9,7 @@ export declare const fillConfig: (config?: FormConfig) => {
|
|
|
9
9
|
items: ({
|
|
10
10
|
title: string;
|
|
11
11
|
labelWidth: string;
|
|
12
|
-
items: (ChildConfig & {
|
|
12
|
+
items: (import("@tmagic/form").ChildConfig & {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
})[];
|
|
15
15
|
} | {
|
|
@@ -35,24 +35,3 @@ export declare const fillConfig: (config?: FormConfig) => {
|
|
|
35
35
|
labelWidth?: undefined;
|
|
36
36
|
})[];
|
|
37
37
|
}[];
|
|
38
|
-
export declare const DEFAULT_CONFIG: FormConfig;
|
|
39
|
-
/**
|
|
40
|
-
* 获取默认属性配置
|
|
41
|
-
* @param type 组件类型
|
|
42
|
-
* @returns Object
|
|
43
|
-
*/
|
|
44
|
-
export declare const getDefaultPropsValue: (type: string, id: string) => {
|
|
45
|
-
type: string;
|
|
46
|
-
id: string;
|
|
47
|
-
layout: string;
|
|
48
|
-
style: {};
|
|
49
|
-
name: string;
|
|
50
|
-
items: never[];
|
|
51
|
-
} | {
|
|
52
|
-
type: string;
|
|
53
|
-
id: string;
|
|
54
|
-
style: {};
|
|
55
|
-
name: string;
|
|
56
|
-
layout?: undefined;
|
|
57
|
-
items?: undefined;
|
|
58
|
-
};
|
|
File without changes
|
|
File without changes
|