@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
@@ -1,14 +0,0 @@
1
- import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
- import { Component, PropType, toRaw } from 'vue';
3
- declare const _default: DefineComponent<{
4
- icon: {
5
- type: PropType<string | Component<any, any, any, ComputedOptions, MethodOptions>>;
6
- };
7
- }, {
8
- toRaw: typeof toRaw;
9
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
10
- icon: {
11
- type: PropType<string | Component<any, any, any, ComputedOptions, MethodOptions>>;
12
- };
13
- }>>, {}>;
14
- export default _default;
@@ -1,24 +0,0 @@
1
- import type { Ref, ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- declare const _default: DefineComponent<{
4
- width: NumberConstructor;
5
- height: NumberConstructor;
6
- zoom: {
7
- type: NumberConstructor;
8
- default: number;
9
- };
10
- }, {
11
- container: Ref<HTMLDivElement | undefined>;
12
- el: Ref<HTMLDivElement | undefined>;
13
- style: ComputedRef<string>;
14
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
15
- width: NumberConstructor;
16
- height: NumberConstructor;
17
- zoom: {
18
- type: NumberConstructor;
19
- default: number;
20
- };
21
- }>>, {
22
- zoom: number;
23
- }>;
24
- export default _default;
@@ -1,25 +0,0 @@
1
- import type { ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- declare const _default: DefineComponent<Readonly<{
4
- name?: any;
5
- config?: any;
6
- model?: any;
7
- prop?: any;
8
- }>, {
9
- height: ComputedRef<string>;
10
- language: ComputedRef<any>;
11
- save(v: string): void;
12
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "change"[], "change", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<Readonly<{
13
- name?: any;
14
- config?: any;
15
- model?: any;
16
- prop?: any;
17
- }>>> & {
18
- onChange?: ((...args: any[]) => any) | undefined;
19
- }, {
20
- readonly name?: any;
21
- readonly config?: any;
22
- readonly model?: any;
23
- readonly prop?: any;
24
- }>;
25
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
- declare const _default: DefineComponent<{}, {
3
- clickHandler(): void;
4
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}>;
5
- export default _default;
@@ -1,24 +0,0 @@
1
- import type { ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import type { MApp } from '@tmagic/schema';
4
- import { GetColumnWidth } from '../type';
5
- declare const _default: DefineComponent<{
6
- codeOptions: {
7
- type: ObjectConstructor;
8
- default: () => {};
9
- };
10
- }, {
11
- root: ComputedRef<MApp | undefined>;
12
- pageLength: ComputedRef<number>;
13
- showSrc: ComputedRef<boolean | undefined>;
14
- columnWidth: ComputedRef<GetColumnWidth | undefined>;
15
- saveCode(value: string): void;
16
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
17
- codeOptions: {
18
- type: ObjectConstructor;
19
- default: () => {};
20
- };
21
- }>>, {
22
- codeOptions: Record<string, any>;
23
- }>;
24
- export default _default;
@@ -1,27 +0,0 @@
1
- import type { ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import { PropType } from 'vue';
4
- import { GetColumnWidth, MenuBarData } from '../type';
5
- declare const _default: DefineComponent<{
6
- data: {
7
- type: PropType<MenuBarData>;
8
- default: () => {};
9
- };
10
- height: {
11
- type: NumberConstructor;
12
- };
13
- }, {
14
- keys: ComputedRef<(keyof MenuBarData)[]>;
15
- columnWidth: ComputedRef<GetColumnWidth | undefined>;
16
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
17
- data: {
18
- type: PropType<MenuBarData>;
19
- default: () => {};
20
- };
21
- height: {
22
- type: NumberConstructor;
23
- };
24
- }>>, {
25
- data: MenuBarData;
26
- }>;
27
- export default _default;
@@ -1,13 +0,0 @@
1
- import type { Ref, ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import type { FormValue } from '@tmagic/form';
4
- declare const _default: DefineComponent<{}, {
5
- values: Ref<FormValue>;
6
- configForm: Ref<any>;
7
- curFormConfig: any;
8
- propsPanelSize: ComputedRef<unknown>;
9
- submit(): Promise<void>;
10
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "mounted"[], "mounted", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>> & {
11
- onMounted?: ((...args: any[]) => any) | undefined;
12
- }, {}>;
13
- export default _default;
@@ -1,14 +0,0 @@
1
- import type { Ref } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- declare const _default: DefineComponent<{
4
- type: {
5
- type: StringConstructor;
6
- };
7
- }, {
8
- target: Ref<HTMLSpanElement | undefined>;
9
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
10
- type: {
11
- type: StringConstructor;
12
- };
13
- }>>, {}>;
14
- export default _default;
@@ -1,16 +0,0 @@
1
- import type { Ref, ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import type { ComponentItem } from '../../type';
4
- declare const _default: DefineComponent<{}, {
5
- searchText: Ref<string>;
6
- collapseValue: ComputedRef<number[]>;
7
- list: ComputedRef<{
8
- items: ComponentItem[];
9
- title: string;
10
- }[] | undefined>;
11
- appendComponent({ text, type, data }: ComponentItem): void;
12
- dragstartHandler({ text, type, data }: ComponentItem, e: DragEvent): void;
13
- dragendHandler(): void;
14
- dragHandler(e: DragEvent): void;
15
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}>;
16
- export default _default;
@@ -1,16 +0,0 @@
1
- import type { ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import { PropType } from 'vue';
4
- import { SideComponent, SideItem } from '../../type';
5
- declare const _default: DefineComponent<{
6
- data: {
7
- type: PropType<SideItem>;
8
- };
9
- }, {
10
- config: ComputedRef<SideComponent | undefined>;
11
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
12
- data: {
13
- type: PropType<SideItem>;
14
- };
15
- }>>, {}>;
16
- export default _default;
@@ -1,8 +0,0 @@
1
- import type { Ref, ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- import type { MPage } from '@tmagic/schema';
4
- declare const _default: DefineComponent<{}, {
5
- workspace: Ref<HTMLDivElement | undefined>;
6
- page: ComputedRef<MPage | undefined>;
7
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}>;
8
- export default _default;
@@ -1,42 +0,0 @@
1
- import type { FormConfig } from '@tmagic/form';
2
- import type { MNode, MPage } from '@tmagic/schema';
3
- import BaseService from './BaseService';
4
- declare class Props extends BaseService {
5
- private state;
6
- constructor();
7
- setPropsConfigs(configs: Record<string, FormConfig>): void;
8
- /**
9
- * 为指定类型组件设置组件属性表单配置
10
- * @param type 组件类型
11
- * @param config 组件属性表单配置
12
- */
13
- setPropsConfig(type: string, config: FormConfig): void;
14
- /**
15
- * 获取指点类型的组件属性表单配置
16
- * @param type 组件类型
17
- * @returns 组件属性表单配置
18
- */
19
- getPropsConfig(type: string): Promise<FormConfig>;
20
- setPropsValues(values: Record<string, MNode>): void;
21
- /**
22
- * 为指点类型组件设置组件初始值
23
- * @param type 组件类型
24
- * @param value 组件初始值
25
- */
26
- setPropsValue(type: string, value: MNode): void;
27
- /**
28
- * 获取指定类型的组件初始值
29
- * @param type 组件类型
30
- * @returns 组件初始值
31
- */
32
- getPropsValue(type: string, defaultValue?: Record<string, any>): Promise<any>;
33
- createId(type: string | number): Promise<string>;
34
- /**
35
- * 将组件与组件的子元素配置中的id都设置成一个新的ID
36
- * @param {Object} config 组件配置
37
- */
38
- setNewItemId(config: MNode, parent?: MPage): Promise<void>;
39
- }
40
- export declare type PropsService = Props;
41
- declare const _default: Props;
42
- export default _default;
@@ -1,6 +0,0 @@
1
- declare module '*.vue' {
2
- import { DefineComponent } from 'vue';
3
-
4
- const component: DefineComponent<{}, {}, any>;
5
- export default component;
6
- }
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />