@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.
Files changed (106) hide show
  1. package/dist/style.css +5 -1
  2. package/dist/{tmagic-editor.es.js → tmagic-editor.mjs} +1449 -1205
  3. package/dist/tmagic-editor.mjs.map +1 -0
  4. package/dist/tmagic-editor.umd.js +1463 -1219
  5. package/dist/tmagic-editor.umd.js.map +1 -1
  6. package/package.json +23 -21
  7. package/src/Editor.vue +24 -15
  8. package/src/components/ContentMenu.vue +87 -99
  9. package/src/components/Icon.vue +1 -1
  10. package/src/components/ScrollViewer.vue +2 -2
  11. package/src/components/ToolButton.vue +150 -167
  12. package/src/fields/UISelect.vue +51 -72
  13. package/src/index.ts +2 -1
  14. package/src/layouts/AddPageBox.vue +2 -2
  15. package/src/layouts/Framework.vue +1 -1
  16. package/src/layouts/NavMenu.vue +2 -2
  17. package/src/layouts/PropsPanel.vue +1 -1
  18. package/src/layouts/Resizer.vue +1 -1
  19. package/src/layouts/sidebar/ComponentListPanel.vue +6 -17
  20. package/src/layouts/sidebar/LayerMenu.vue +2 -2
  21. package/src/layouts/sidebar/LayerPanel.vue +52 -12
  22. package/src/layouts/sidebar/Sidebar.vue +1 -1
  23. package/src/layouts/sidebar/TabPane.vue +2 -2
  24. package/src/layouts/workspace/PageBar.vue +63 -192
  25. package/src/layouts/workspace/PageBarScrollContainer.vue +111 -0
  26. package/src/layouts/workspace/Stage.vue +198 -219
  27. package/src/layouts/workspace/ViewerMenu.vue +140 -147
  28. package/src/layouts/workspace/Workspace.vue +14 -12
  29. package/src/services/BaseService.ts +5 -10
  30. package/src/services/componentList.ts +3 -3
  31. package/src/services/editor.ts +208 -147
  32. package/src/services/events.ts +1 -1
  33. package/src/services/history.ts +1 -1
  34. package/src/services/props.ts +74 -49
  35. package/src/services/storage.ts +133 -0
  36. package/src/services/ui.ts +10 -4
  37. package/src/theme/component-list-panel.scss +5 -0
  38. package/src/theme/framework.scss +1 -1
  39. package/src/theme/stage.scss +2 -2
  40. package/src/type.ts +25 -7
  41. package/src/utils/config.ts +1 -1
  42. package/src/utils/editor.ts +20 -12
  43. package/src/utils/operator.ts +109 -0
  44. package/src/utils/props.ts +2 -27
  45. package/src/utils/scroll-viewer.ts +1 -1
  46. package/tsconfig.build.json +13 -0
  47. package/{dist/types/src → types}/Editor.vue.d.ts +17 -9
  48. package/types/components/ContentMenu.vue.d.ts +116 -0
  49. package/types/components/Icon.vue.d.ts +13 -0
  50. package/types/components/ScrollViewer.vue.d.ts +22 -0
  51. package/types/components/ToolButton.vue.d.ts +109 -0
  52. package/types/fields/Code.vue.d.ts +23 -0
  53. package/{dist/types/src → types}/fields/CodeLink.vue.d.ts +4 -6
  54. package/types/fields/UISelect.vue.d.ts +83 -0
  55. package/{dist/types/src → types}/index.d.ts +4 -1
  56. package/types/layouts/AddPageBox.vue.d.ts +4 -0
  57. package/{dist/types/src → types}/layouts/CodeEditor.vue.d.ts +11 -13
  58. package/types/layouts/Framework.vue.d.ts +22 -0
  59. package/types/layouts/NavMenu.vue.d.ts +25 -0
  60. package/types/layouts/PropsPanel.vue.d.ts +245 -0
  61. package/types/layouts/Resizer.vue.d.ts +12 -0
  62. package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +14 -0
  63. package/types/layouts/sidebar/LayerMenu.vue.d.ts +100 -0
  64. package/types/layouts/sidebar/LayerPanel.vue.d.ts +1101 -0
  65. package/{dist/types/src → types}/layouts/sidebar/Sidebar.vue.d.ts +3 -5
  66. package/types/layouts/sidebar/TabPane.vue.d.ts +14 -0
  67. package/types/layouts/workspace/PageBar.vue.d.ts +54 -0
  68. package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +48 -0
  69. package/types/layouts/workspace/Stage.vue.d.ts +46 -0
  70. package/types/layouts/workspace/ViewerMenu.vue.d.ts +88 -0
  71. package/types/layouts/workspace/Workspace.vue.d.ts +6 -0
  72. package/{dist/types/src → types}/services/BaseService.d.ts +0 -0
  73. package/types/services/componentList.d.ts +14 -0
  74. package/{dist/types/src → types}/services/editor.d.ts +22 -14
  75. package/{dist/types/src → types}/services/events.d.ts +0 -0
  76. package/{dist/types/src → types}/services/history.d.ts +0 -0
  77. package/types/services/props.d.ts +97 -0
  78. package/types/services/storage.d.ts +56 -0
  79. package/{dist/types/src → types}/services/ui.d.ts +1 -1
  80. package/{dist/types/src → types}/type.d.ts +18 -1
  81. package/{dist/types/src → types}/utils/compose.d.ts +1 -1
  82. package/{dist/types/src → types}/utils/config.d.ts +0 -0
  83. package/{dist/types/src → types}/utils/editor.d.ts +6 -3
  84. package/{dist/types/src → types}/utils/index.d.ts +0 -0
  85. package/{dist/types/src → types}/utils/logger.d.ts +0 -0
  86. package/types/utils/operator.d.ts +21 -0
  87. package/{dist/types/src → types}/utils/polyfills.d.ts +0 -0
  88. package/{dist/types/src → types}/utils/props.d.ts +2 -23
  89. package/{dist/types/src → types}/utils/scroll-viewer.d.ts +0 -0
  90. package/{dist/types/src → types}/utils/undo-redo.d.ts +0 -0
  91. package/dist/tmagic-editor.es.js.map +0 -1
  92. package/dist/types/src/components/Icon.vue.d.ts +0 -14
  93. package/dist/types/src/components/ScrollViewer.vue.d.ts +0 -24
  94. package/dist/types/src/fields/Code.vue.d.ts +0 -25
  95. package/dist/types/src/layouts/AddPageBox.vue.d.ts +0 -5
  96. package/dist/types/src/layouts/Framework.vue.d.ts +0 -24
  97. package/dist/types/src/layouts/NavMenu.vue.d.ts +0 -27
  98. package/dist/types/src/layouts/PropsPanel.vue.d.ts +0 -13
  99. package/dist/types/src/layouts/Resizer.vue.d.ts +0 -14
  100. package/dist/types/src/layouts/sidebar/ComponentListPanel.vue.d.ts +0 -16
  101. package/dist/types/src/layouts/sidebar/TabPane.vue.d.ts +0 -16
  102. package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +0 -8
  103. package/dist/types/src/services/props.d.ts +0 -42
  104. package/dist/types/src/shims-vue.d.ts +0 -6
  105. package/dist/types/src/vite-env.d.ts +0 -1
  106. 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, parentNode: MNode, stage: StageCore) => 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
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 | undefined) => Promise<Layout>) => Promise<Record<string, any>>;
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 | undefined) => any;
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 type { ChildConfig, FormConfig, FormState } from '@tmagic/form';
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