@tmagic/editor 1.3.4 → 1.3.6
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 +73 -51
- package/dist/tmagic-editor.js +1171 -1102
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1188 -1119
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -17
- package/src/Editor.vue +5 -0
- package/src/components/FloatingBox.vue +117 -0
- package/src/components/Tree.vue +5 -0
- package/src/components/TreeNode.vue +8 -2
- package/src/editorProps.ts +7 -0
- package/src/hooks/use-filter.ts +55 -0
- package/src/hooks/use-node-status.ts +48 -0
- package/src/hooks/use-stage.ts +1 -0
- package/src/initService.ts +28 -12
- package/src/layouts/sidebar/Sidebar.vue +7 -2
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -65
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +2 -1
- package/src/layouts/sidebar/data-source/DataSourceList.vue +63 -59
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +1 -1
- package/src/layouts/sidebar/layer/LayerPanel.vue +24 -7
- package/src/layouts/sidebar/layer/use-node-status.ts +8 -11
- package/src/layouts/workspace/viewer/NodeListMenu.vue +67 -128
- package/src/layouts/workspace/viewer/Stage.vue +2 -1
- package/src/layouts/workspace/viewer/ViewerMenu.vue +1 -6
- package/src/services/BaseService.ts +63 -26
- package/src/services/codeBlock.ts +7 -1
- package/src/services/dep.ts +12 -8
- package/src/services/editor.ts +66 -30
- package/src/services/props.ts +70 -12
- package/src/services/storage.ts +23 -13
- package/src/services/ui.ts +4 -1
- package/src/theme/floating-box.scss +30 -0
- package/src/theme/layer-panel.scss +19 -0
- package/src/theme/stage.scss +24 -0
- package/src/theme/theme.scss +1 -1
- package/src/theme/tree.scss +12 -1
- package/src/type.ts +6 -3
- package/src/utils/compose.ts +25 -6
- package/src/utils/content-menu.ts +4 -5
- package/src/utils/editor.ts +12 -3
- package/src/utils/operator.ts +1 -2
- package/types/components/CodeBlockEditor.vue.d.ts +6 -2
- package/types/components/CodeParams.vue.d.ts +3 -1
- package/types/components/ContentMenu.vue.d.ts +13 -5
- package/types/components/FloatingBox.vue.d.ts +78 -0
- package/types/components/Resizer.vue.d.ts +6 -1
- package/types/components/ScrollBar.vue.d.ts +3 -1
- package/types/components/ScrollViewer.vue.d.ts +3 -3
- package/types/components/SearchInput.vue.d.ts +3 -1
- package/types/components/SplitView.vue.d.ts +8 -4
- package/types/components/ToolButton.vue.d.ts +1 -1
- package/types/components/Tree.vue.d.ts +27 -8
- package/types/components/TreeNode.vue.d.ts +24 -7
- package/types/editorProps.d.ts +7 -1
- package/types/fields/Code.vue.d.ts +6 -2
- package/types/fields/CodeLink.vue.d.ts +5 -3
- package/types/fields/CodeSelect.vue.d.ts +3 -1
- package/types/fields/CodeSelectCol.vue.d.ts +3 -1
- package/types/fields/DataSourceFieldSelect.vue.d.ts +3 -1
- package/types/fields/DataSourceFields.vue.d.ts +5 -3
- package/types/fields/DataSourceInput.vue.d.ts +8 -4
- package/types/fields/DataSourceMethodSelect.vue.d.ts +3 -1
- package/types/fields/DataSourceMethods.vue.d.ts +5 -3
- package/types/fields/DataSourceMocks.vue.d.ts +5 -3
- package/types/fields/DataSourceSelect.vue.d.ts +5 -3
- package/types/fields/EventSelect.vue.d.ts +3 -1
- package/types/fields/KeyValue.vue.d.ts +2 -2
- package/types/fields/UISelect.vue.d.ts +3 -1
- package/types/hooks/use-code-block-edit.d.ts +14 -5
- package/types/hooks/use-data-source-method.d.ts +14 -5
- package/types/hooks/use-filter.d.ts +7 -0
- package/types/hooks/use-node-status.d.ts +6 -0
- package/types/layouts/CodeEditor.vue.d.ts +4 -1
- package/types/layouts/Framework.vue.d.ts +1 -1
- package/types/layouts/PropsPanel.vue.d.ts +10 -4
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/Sidebar.vue.d.ts +5 -5
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +9 -3
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +3 -1
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +8 -2
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +6 -2
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/use-click.d.ts +14 -5
- package/types/layouts/sidebar/layer/use-node-status.d.ts +3 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +1 -1
- package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +1 -14
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +1 -1
- package/types/services/BaseService.d.ts +4 -1
- package/types/services/dep.d.ts +6 -5
- package/types/services/editor.d.ts +9 -3
- package/types/services/props.d.ts +25 -1
- package/types/services/storage.d.ts +7 -7
- package/types/type.d.ts +8 -6
- package/types/utils/compose.d.ts +1 -1
- package/types/utils/editor.d.ts +5 -1
- package/src/layouts/sidebar/layer/use-filter.ts +0 -59
- package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +0 -68
- package/src/theme/dep-list.scss +0 -59
- package/types/layouts/sidebar/layer/use-filter.d.ts +0 -7
- package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +0 -15
|
@@ -26,7 +26,10 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
26
26
|
setEditorValue: (v: any, m: any) => void | undefined;
|
|
27
27
|
getEditorValue: () => string;
|
|
28
28
|
focus(): void;
|
|
29
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
29
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
initd: (...args: any[]) => void;
|
|
31
|
+
save: (...args: any[]) => void;
|
|
32
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
30
33
|
initValues?: any;
|
|
31
34
|
modifiedValues?: any;
|
|
32
35
|
type?: "diff" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FrameworkSlots } from '../type';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, FrameworkSlots
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, Readonly<FrameworkSlots>>;
|
|
3
3
|
export default _default;
|
|
4
4
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
5
5
|
new (): {
|
|
@@ -114,7 +114,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
114
114
|
}>;
|
|
115
115
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
116
116
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
117
|
-
$emit: (event: "change"
|
|
117
|
+
$emit: ((event: "change", ...args: any[]) => void) & ((event: "field-input", ...args: any[]) => void) & ((event: "field-change", ...args: any[]) => void);
|
|
118
118
|
$el: any;
|
|
119
119
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
120
120
|
labelWidth: {
|
|
@@ -188,7 +188,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
188
188
|
changeHandler: () => void;
|
|
189
189
|
resetForm: () => any;
|
|
190
190
|
submitForm: (native?: boolean | undefined) => Promise<any>;
|
|
191
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
191
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
192
|
+
change: (...args: any[]) => void;
|
|
193
|
+
"field-input": (...args: any[]) => void;
|
|
194
|
+
"field-change": (...args: any[]) => void;
|
|
195
|
+
}, string, {
|
|
192
196
|
config: import("@tmagic/form").FormConfig;
|
|
193
197
|
initValues: Record<string, any>;
|
|
194
198
|
lastValues: Record<string, any>;
|
|
@@ -295,11 +299,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
295
299
|
submitForm: (native?: boolean | undefined) => Promise<any>;
|
|
296
300
|
}> & {} & import("vue").ComponentCustomProperties & {}) | undefined>;
|
|
297
301
|
submit: () => Promise<void>;
|
|
298
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
302
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
303
|
+
mounted: (...args: any[]) => void;
|
|
304
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
299
305
|
extendState?: ((state: FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
300
306
|
}>>> & {
|
|
301
307
|
onMounted?: ((...args: any[]) => any) | undefined;
|
|
302
|
-
}, {}, {}>, PropsPanelSlots
|
|
308
|
+
}, {}, {}>, Readonly<PropsPanelSlots>>;
|
|
303
309
|
export default _default;
|
|
304
310
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
305
311
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentListPanelSlots } from '../../type';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, ComponentListPanelSlots
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, Readonly<ComponentListPanelSlots>>;
|
|
3
3
|
export default _default;
|
|
4
4
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
5
5
|
new (): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MenuButton, MenuComponent, SideBarData
|
|
1
|
+
import type { MenuButton, MenuComponent, SideBarData } from '../../type';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
data: SideBarData;
|
|
4
4
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
@@ -21,7 +21,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
21
21
|
};
|
|
22
22
|
}>>>, {
|
|
23
23
|
data: SideBarData;
|
|
24
|
-
}, {}>,
|
|
24
|
+
}, {}>, Readonly<import("../../type").LayerPanelSlots & import("../../type").CodeBlockListPanelSlots & import("../../type").ComponentListPanelSlots & import("../../type").DataSourceListSlots>>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -37,11 +37,11 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
37
37
|
default: D[K];
|
|
38
38
|
}> : P[K];
|
|
39
39
|
};
|
|
40
|
+
type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
40
43
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
44
|
new (): {
|
|
42
45
|
$slots: S;
|
|
43
46
|
};
|
|
44
47
|
};
|
|
45
|
-
type __VLS_Prettify<T> = {
|
|
46
|
-
[K in keyof T]: T[K];
|
|
47
|
-
} & {};
|
|
@@ -3,10 +3,16 @@ import { type CodeBlockListSlots, CodeDeleteErrorType } from '../../../type';
|
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
5
5
|
}>, {
|
|
6
|
-
filter(
|
|
7
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
filter: (text: string | string[]) => void;
|
|
7
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
remove: (id: string) => void;
|
|
9
|
+
edit: (id: string) => void;
|
|
10
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
8
11
|
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
9
|
-
}
|
|
12
|
+
}>>> & {
|
|
13
|
+
onEdit?: ((id: string) => any) | undefined;
|
|
14
|
+
onRemove?: ((id: string) => any) | undefined;
|
|
15
|
+
}, {}, {}>, Readonly<CodeBlockListSlots>>;
|
|
10
16
|
export default _default;
|
|
11
17
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
18
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -6,7 +6,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
6
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
7
|
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
8
8
|
slideType?: SlideType | undefined;
|
|
9
|
-
}>>>, {}, {}>, CodeBlockListPanelSlots
|
|
9
|
+
}>>>, {}, {}>, Readonly<CodeBlockListPanelSlots>>;
|
|
10
10
|
export default _default;
|
|
11
11
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
12
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -7,7 +7,9 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
7
7
|
}>, {
|
|
8
8
|
show(): void;
|
|
9
9
|
hide(): void;
|
|
10
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
10
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
submit: (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
13
|
title?: string | undefined;
|
|
12
14
|
values: any;
|
|
13
15
|
disabled: boolean;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { DataSourceListSlots } from '../../../type';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
|
|
3
|
-
filter(
|
|
4
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
filter: (text: string | string[]) => void;
|
|
4
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
remove: (id: string) => void;
|
|
6
|
+
edit: (id: string) => void;
|
|
7
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
8
|
+
onEdit?: ((id: string) => any) | undefined;
|
|
9
|
+
onRemove?: ((id: string) => any) | undefined;
|
|
10
|
+
}, {}, {}>, Readonly<DataSourceListSlots>>;
|
|
5
11
|
export default _default;
|
|
6
12
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
7
13
|
new (): {
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
3
3
|
slideType?: SlideType | undefined;
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
slideType?: SlideType | undefined;
|
|
6
|
-
}>>>, {}, {}>, DataSourceListSlots
|
|
6
|
+
}>>>, {}, {}>, Readonly<DataSourceListSlots>>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
9
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -3,9 +3,13 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
3
3
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
4
4
|
}>, {
|
|
5
5
|
show: (e: MouseEvent) => void;
|
|
6
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"collapse-all": () => void;
|
|
8
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
9
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
8
|
-
}
|
|
10
|
+
}>>> & {
|
|
11
|
+
"onCollapse-all"?: (() => any) | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
9
13
|
export default _default;
|
|
10
14
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
15
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
3
3
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
6
|
-
}>>>, {}, {}>, LayerPanelSlots
|
|
6
|
+
}>>>, {}, {}>, Readonly<LayerPanelSlots>>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
9
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -7,12 +7,15 @@ export declare const useClick: (services: Services | undefined, isCtrlKeyDown: R
|
|
|
7
7
|
$data: {};
|
|
8
8
|
$props: Partial<{}> & Omit<{
|
|
9
9
|
readonly layerContentMenu: (import("../../../type").MenuButton | import("../../../type").MenuComponent)[];
|
|
10
|
+
"onCollapse-all"?: (() => any) | undefined;
|
|
10
11
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
11
12
|
layerContentMenu: {
|
|
12
13
|
type: import("vue").PropType<(import("../../../type").MenuButton | import("../../../type").MenuComponent)[]>;
|
|
13
14
|
required: true;
|
|
14
15
|
};
|
|
15
|
-
}
|
|
16
|
+
}>> & {
|
|
17
|
+
"onCollapse-all"?: (() => any) | undefined;
|
|
18
|
+
}, never>;
|
|
16
19
|
$attrs: {
|
|
17
20
|
[x: string]: unknown;
|
|
18
21
|
};
|
|
@@ -24,16 +27,20 @@ export declare const useClick: (services: Services | undefined, isCtrlKeyDown: R
|
|
|
24
27
|
}>;
|
|
25
28
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
26
29
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
27
|
-
$emit: (event:
|
|
30
|
+
$emit: (event: "collapse-all") => void;
|
|
28
31
|
$el: any;
|
|
29
32
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
30
33
|
layerContentMenu: {
|
|
31
34
|
type: import("vue").PropType<(import("../../../type").MenuButton | import("../../../type").MenuComponent)[]>;
|
|
32
35
|
required: true;
|
|
33
36
|
};
|
|
34
|
-
}
|
|
37
|
+
}>> & {
|
|
38
|
+
"onCollapse-all"?: (() => any) | undefined;
|
|
39
|
+
}, {
|
|
35
40
|
show: (e: MouseEvent) => void;
|
|
36
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
|
+
"collapse-all": () => void;
|
|
43
|
+
}, string, {}, {}, string, {}> & {
|
|
37
44
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
38
45
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
39
46
|
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -58,7 +65,9 @@ export declare const useClick: (services: Services | undefined, isCtrlKeyDown: R
|
|
|
58
65
|
type: import("vue").PropType<(import("../../../type").MenuButton | import("../../../type").MenuComponent)[]>;
|
|
59
66
|
required: true;
|
|
60
67
|
};
|
|
61
|
-
}>> &
|
|
68
|
+
}>> & {
|
|
69
|
+
"onCollapse-all"?: (() => any) | undefined;
|
|
70
|
+
} & import("vue").ShallowUnwrapRef<{
|
|
62
71
|
show: (e: MouseEvent) => void;
|
|
63
72
|
}> & {} & import("vue").ComponentCustomProperties & {}) | undefined>;
|
|
64
73
|
nodeClickHandler: (event: MouseEvent, data: TreeNodeData) => void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Id, MPage } from '@tmagic/schema';
|
|
1
|
+
import type { Id } from '@tmagic/schema';
|
|
3
2
|
import { LayerNodeStatus, Services } from '../../../type';
|
|
4
|
-
export declare const useNodeStatus: (services: Services | undefined
|
|
3
|
+
export declare const useNodeStatus: (services: Services | undefined) => {
|
|
5
4
|
nodeStatusMaps: import("vue").Ref<Map<Id, Map<Id, LayerNodeStatus>>>;
|
|
6
|
-
nodeStatusMap: ComputedRef<Map<Id, LayerNodeStatus> | undefined>;
|
|
5
|
+
nodeStatusMap: import("vue").ComputedRef<Map<Id, LayerNodeStatus> | undefined>;
|
|
7
6
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
3
3
|
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
6
|
-
}>>>, {}, {}>, WorkspaceSlots
|
|
6
|
+
}>>>, {}, {}>, Readonly<WorkspaceSlots>>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
9
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
2
|
-
isMultiSelect?: boolean | undefined;
|
|
3
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
-
isMultiSelect?: boolean | undefined;
|
|
5
|
-
}>>>, {}, {}>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
6
2
|
export default _default;
|
|
7
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
9
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
-
} : {
|
|
12
|
-
type: import('vue').PropType<T[K]>;
|
|
13
|
-
required: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
5
5
|
}>, {
|
|
6
6
|
isMultiSelect: boolean;
|
|
7
7
|
}>, {
|
|
8
|
-
show: (e: MouseEvent) =>
|
|
8
|
+
show: (e: MouseEvent) => void;
|
|
9
9
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
10
|
isMultiSelect?: boolean | undefined;
|
|
11
11
|
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
@@ -52,7 +52,10 @@ export default class extends EventEmitter {
|
|
|
52
52
|
private middleware;
|
|
53
53
|
private taskList;
|
|
54
54
|
private doingTask;
|
|
55
|
-
constructor(methods?:
|
|
55
|
+
constructor(methods?: {
|
|
56
|
+
name: string;
|
|
57
|
+
isAsync: boolean;
|
|
58
|
+
}[], serialMethods?: string[]);
|
|
56
59
|
use(options: Record<string, Function>): void;
|
|
57
60
|
usePlugin(options: Record<string, Function>): void;
|
|
58
61
|
removeAllPlugins(): void;
|
package/types/services/dep.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Target } from '@tmagic/dep';
|
|
1
|
+
import { DepTargetType, type Target } from '@tmagic/dep';
|
|
2
2
|
import type { Id, MNode } from '@tmagic/schema';
|
|
3
3
|
import BaseService from './BaseService';
|
|
4
4
|
declare class Dep extends BaseService {
|
|
@@ -8,13 +8,14 @@ declare class Dep extends BaseService {
|
|
|
8
8
|
[targetId: string]: Target;
|
|
9
9
|
[targetId: number]: Target;
|
|
10
10
|
};
|
|
11
|
-
getTarget(id: Id): Target
|
|
11
|
+
getTarget(id: Id, type?: string): Target;
|
|
12
12
|
addTarget(target: Target): void;
|
|
13
|
-
removeTarget(id: Id): void;
|
|
13
|
+
removeTarget(id: Id, type?: string): void;
|
|
14
14
|
clearTargets(): void;
|
|
15
|
-
collect(nodes: MNode[], deep?: boolean): void;
|
|
15
|
+
collect(nodes: MNode[], deep?: boolean, type?: DepTargetType): void;
|
|
16
16
|
clear(nodes?: MNode[]): void;
|
|
17
|
-
hasTarget(id: Id): boolean;
|
|
17
|
+
hasTarget(id: Id, type?: string): boolean;
|
|
18
|
+
hasSpecifiedTypeTarget(type?: string): boolean;
|
|
18
19
|
}
|
|
19
20
|
export type DepService = Dep;
|
|
20
21
|
declare const _default: Dep;
|
|
@@ -92,11 +92,17 @@ declare class Editor extends BaseService {
|
|
|
92
92
|
*/
|
|
93
93
|
sort(id1: Id, id2: Id): Promise<void>;
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* 将组件节点配置存储到localStorage中
|
|
96
96
|
* @param config 组件节点配置
|
|
97
|
-
* @returns
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
copy(config: MNode | MNode[]): void;
|
|
100
|
+
/**
|
|
101
|
+
* 复制时会带上组件关联的依赖
|
|
102
|
+
* @param config 组件节点配置
|
|
103
|
+
* @returns
|
|
98
104
|
*/
|
|
99
|
-
|
|
105
|
+
copyWithRelated(config: MNode | MNode[]): void;
|
|
100
106
|
/**
|
|
101
107
|
* 从localStorage中获取节点,然后添加到当前容器中
|
|
102
108
|
* @param position 粘贴的坐标
|
|
@@ -45,9 +45,11 @@ declare class Props extends BaseService {
|
|
|
45
45
|
createId(type: string | number): Promise<string>;
|
|
46
46
|
/**
|
|
47
47
|
* 将组件与组件的子元素配置中的id都设置成一个新的ID
|
|
48
|
+
* 如果没有相同ID并且force为false则保持不变
|
|
48
49
|
* @param {Object} config 组件配置
|
|
50
|
+
* @param {Boolean} force 是否强制设置新的ID
|
|
49
51
|
*/
|
|
50
|
-
setNewItemId(config: MNode): Promise<MNode>;
|
|
52
|
+
setNewItemId(config: MNode, force?: boolean): Promise<MNode>;
|
|
51
53
|
/**
|
|
52
54
|
* 获取默认属性配置
|
|
53
55
|
* @param type 组件类型
|
|
@@ -67,7 +69,29 @@ declare class Props extends BaseService {
|
|
|
67
69
|
items?: undefined;
|
|
68
70
|
}>;
|
|
69
71
|
resetState(): void;
|
|
72
|
+
/**
|
|
73
|
+
* 替换关联ID
|
|
74
|
+
* @param originConfigs 原组件配置
|
|
75
|
+
* @param targetConfigs 待替换的组件配置
|
|
76
|
+
*/
|
|
77
|
+
replaceRelateId(originConfigs: MNode[], targetConfigs: MNode[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* 清除setNewItemId前后映射关系
|
|
80
|
+
*/
|
|
81
|
+
clearRelateId(): void;
|
|
70
82
|
destroy(): void;
|
|
83
|
+
/**
|
|
84
|
+
* 获取setNewItemId前后映射关系
|
|
85
|
+
* @param oldId 原组件ID
|
|
86
|
+
* @returns 新旧ID映射
|
|
87
|
+
*/
|
|
88
|
+
private getRelateIdMap;
|
|
89
|
+
/**
|
|
90
|
+
* 记录setNewItemId前后映射关系
|
|
91
|
+
* @param oldId 原组件ID
|
|
92
|
+
* @param newId 分配的新ID
|
|
93
|
+
*/
|
|
94
|
+
private setRelateId;
|
|
71
95
|
}
|
|
72
96
|
export type PropsService = Props;
|
|
73
97
|
declare const _default: Props;
|
|
@@ -27,28 +27,28 @@ export declare class WebStorage extends BaseService {
|
|
|
27
27
|
* },
|
|
28
28
|
* });
|
|
29
29
|
*/
|
|
30
|
-
getStorage():
|
|
31
|
-
getNamespace():
|
|
30
|
+
getStorage(): Storage;
|
|
31
|
+
getNamespace(): string;
|
|
32
32
|
/**
|
|
33
33
|
* 清理,支持storageService.usePlugin
|
|
34
34
|
*/
|
|
35
|
-
clear():
|
|
35
|
+
clear(): void;
|
|
36
36
|
/**
|
|
37
37
|
* 获取存储项,支持storageService.usePlugin
|
|
38
38
|
*/
|
|
39
|
-
getItem(key: string, options?: Options):
|
|
39
|
+
getItem(key: string, options?: Options): any;
|
|
40
40
|
/**
|
|
41
41
|
* 获取指定索引位置的key
|
|
42
42
|
*/
|
|
43
|
-
key(index: number):
|
|
43
|
+
key(index: number): string | null;
|
|
44
44
|
/**
|
|
45
45
|
* 移除存储项,支持storageService.usePlugin
|
|
46
46
|
*/
|
|
47
|
-
removeItem(key: string, options?: Options):
|
|
47
|
+
removeItem(key: string, options?: Options): void;
|
|
48
48
|
/**
|
|
49
49
|
* 设置存储项,支持storageService.usePlugin
|
|
50
50
|
*/
|
|
51
|
-
setItem(key: string, value: any, options?: Options):
|
|
51
|
+
setItem(key: string, value: any, options?: Options): void;
|
|
52
52
|
destroy(): void;
|
|
53
53
|
private getValueAndProtocol;
|
|
54
54
|
}
|
package/types/type.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Component } from 'vue';
|
|
|
2
2
|
import type { ColumnConfig, FilterFunction, FormConfig, FormItem } from '@tmagic/form';
|
|
3
3
|
import type { CodeBlockContent, CodeBlockDSL, Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
|
|
4
4
|
import type StageCore from '@tmagic/stage';
|
|
5
|
-
import type { ContainerHighlightType, CustomizeMoveableOptionsCallbackConfig, MoveableOptions, UpdateDragEl } from '@tmagic/stage';
|
|
5
|
+
import type { ContainerHighlightType, CustomizeMoveableOptionsCallbackConfig, MoveableOptions, RenderType, UpdateDragEl } from '@tmagic/stage';
|
|
6
6
|
import type { CodeBlockService } from './services/codeBlock';
|
|
7
7
|
import type { ComponentListService } from './services/componentList';
|
|
8
8
|
import type { DataSourceService } from './services/dataSource';
|
|
@@ -50,7 +50,7 @@ export interface CodeBlockListPanelSlots extends CodeBlockListSlots {
|
|
|
50
50
|
export interface CodeBlockListSlots {
|
|
51
51
|
'code-block-panel-tool'(props: {
|
|
52
52
|
id: Id;
|
|
53
|
-
data:
|
|
53
|
+
data: any;
|
|
54
54
|
}): any;
|
|
55
55
|
}
|
|
56
56
|
export interface DataSourceListSlots {
|
|
@@ -62,16 +62,16 @@ export interface LayerNodeSlots {
|
|
|
62
62
|
'layer-node-content'(props: {
|
|
63
63
|
data: MNode;
|
|
64
64
|
}): any;
|
|
65
|
-
}
|
|
66
|
-
export interface LayerPanelSlots extends LayerNodeSlots {
|
|
67
|
-
'layer-panel-header'(props: {}): any;
|
|
68
65
|
'layer-node-tool'(props: {
|
|
69
66
|
data: MNode;
|
|
70
67
|
}): any;
|
|
71
|
-
'layer-node-
|
|
68
|
+
'layer-node-label'(props: {
|
|
72
69
|
data: MNode;
|
|
73
70
|
}): any;
|
|
74
71
|
}
|
|
72
|
+
export interface LayerPanelSlots extends LayerNodeSlots {
|
|
73
|
+
'layer-panel-header'(props: {}): any;
|
|
74
|
+
}
|
|
75
75
|
export interface PropsPanelSlots {
|
|
76
76
|
'props-panel-header'(props: {}): any;
|
|
77
77
|
}
|
|
@@ -107,6 +107,7 @@ export interface StageOptions {
|
|
|
107
107
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
108
108
|
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
109
109
|
updateDragEl: UpdateDragEl;
|
|
110
|
+
renderType: RenderType;
|
|
110
111
|
}
|
|
111
112
|
export interface StoreState {
|
|
112
113
|
root: MApp | null;
|
|
@@ -123,6 +124,7 @@ export type StoreStateKey = keyof StoreState;
|
|
|
123
124
|
export interface PropsState {
|
|
124
125
|
propsConfigMap: Record<string, FormConfig>;
|
|
125
126
|
propsValueMap: Record<string, Partial<MNode>>;
|
|
127
|
+
relateIdMap: Record<Id, Id>;
|
|
126
128
|
}
|
|
127
129
|
export interface ComponentGroupState {
|
|
128
130
|
list: ComponentGroup[];
|
package/types/utils/compose.d.ts
CHANGED
|
@@ -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) => Promise<void>;
|
|
5
|
+
export declare const compose: (middleware: Function[], isAsync: boolean) => (args: any[], next?: Function) => void | Promise<void>;
|
package/types/utils/editor.d.ts
CHANGED
|
@@ -47,4 +47,8 @@ export declare const fixNodePosition: (config: MNode, parent: MContainer, stage:
|
|
|
47
47
|
[key: string]: any;
|
|
48
48
|
} | undefined;
|
|
49
49
|
export declare const serializeConfig: (config: any) => string;
|
|
50
|
-
export
|
|
50
|
+
export interface NodeItem {
|
|
51
|
+
items?: NodeItem[];
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}
|
|
54
|
+
export declare const traverseNode: <T extends NodeItem = NodeItem>(node: T, cb: (node: T, parents: T[]) => void, parents?: T[]) => void;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type ComputedRef, ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
import { Id, MNode, MPage } from '@tmagic/schema';
|
|
4
|
-
|
|
5
|
-
import { LayerNodeStatus } from '@editor/type';
|
|
6
|
-
import { traverseNode } from '@editor/utils';
|
|
7
|
-
import { updateStatus } from '@editor/utils/tree';
|
|
8
|
-
|
|
9
|
-
export const useFilter = (
|
|
10
|
-
nodeStatusMap: ComputedRef<Map<Id, LayerNodeStatus> | undefined>,
|
|
11
|
-
page: ComputedRef<MPage | null | undefined>,
|
|
12
|
-
) => {
|
|
13
|
-
// tree方法:对树节点进行筛选时执行的方法
|
|
14
|
-
const filterIsMatch = (value: string, data: MNode): boolean => {
|
|
15
|
-
if (!value) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
let name = '';
|
|
19
|
-
if (data.name) {
|
|
20
|
-
name = data.name;
|
|
21
|
-
} else if (data.items) {
|
|
22
|
-
name = 'container';
|
|
23
|
-
}
|
|
24
|
-
return `${data.id}${name}${data.type}`.includes(value);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const filterNode = (text: string) => (node: MNode, parents: MNode[]) => {
|
|
28
|
-
if (!nodeStatusMap.value) return;
|
|
29
|
-
|
|
30
|
-
const visible = filterIsMatch(text, node);
|
|
31
|
-
if (visible && parents.length) {
|
|
32
|
-
parents.forEach((parent) => {
|
|
33
|
-
updateStatus(nodeStatusMap.value!, parent.id, {
|
|
34
|
-
visible,
|
|
35
|
-
expand: true,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
updateStatus(nodeStatusMap.value, node.id, {
|
|
41
|
-
visible,
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const filter = (text: string) => {
|
|
46
|
-
if (!page.value?.items?.length) return;
|
|
47
|
-
|
|
48
|
-
page.value.items.forEach((node) => {
|
|
49
|
-
traverseNode(node, filterNode(text));
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
filterText: ref(''),
|
|
55
|
-
filterTextChangeHandler(text: string) {
|
|
56
|
-
filter(text);
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
};
|