@next-bricks/visual-builder 1.21.0 → 1.22.0
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/bricks.json +3 -2
- package/dist/chunks/{1122.22a54f2c.js → 1122.a7519460.js} +2 -2
- package/dist/chunks/{1122.22a54f2c.js.map → 1122.a7519460.js.map} +1 -1
- package/dist/chunks/{114.257c9063.js → 114.63bf1208.js} +2 -2
- package/dist/chunks/{114.257c9063.js.map → 114.63bf1208.js.map} +1 -1
- package/dist/chunks/{1940.e4b5933d.js → 1940.5f0efc53.js} +2 -2
- package/dist/chunks/{1940.e4b5933d.js.map → 1940.5f0efc53.js.map} +1 -1
- package/dist/chunks/2252.043616c7.js +3 -0
- package/dist/chunks/2252.043616c7.js.map +1 -0
- package/dist/chunks/{2277.b9ac921f.js → 2277.06e20216.js} +2 -2
- package/dist/chunks/{4658.d9a35126.js.map → 2277.06e20216.js.map} +1 -1
- package/dist/chunks/2980.1f86c8c1.js +2 -0
- package/dist/chunks/{2980.dc0edf4e.js.map → 2980.1f86c8c1.js.map} +1 -1
- package/dist/chunks/{3171.a4c5c8ad.js → 3171.50ff3a26.js} +2 -2
- package/dist/chunks/{3171.a4c5c8ad.js.map → 3171.50ff3a26.js.map} +1 -1
- package/dist/chunks/{3933.249da6ff.js → 3933.970e4f69.js} +2 -2
- package/dist/chunks/{3933.249da6ff.js.map → 3933.970e4f69.js.map} +1 -1
- package/dist/chunks/{4658.d9a35126.js → 4658.6f1f1b37.js} +2 -2
- package/dist/chunks/{2277.b9ac921f.js.map → 4658.6f1f1b37.js.map} +1 -1
- package/dist/chunks/4837.c11be2c0.js +2 -0
- package/dist/chunks/{7218.a7563c01.js.map → 4837.c11be2c0.js.map} +1 -1
- package/dist/chunks/4947.0103ed62.js +3 -0
- package/dist/chunks/4947.0103ed62.js.map +1 -0
- package/dist/chunks/{5552.e9003587.js → 5552.8c2ed047.js} +2 -2
- package/dist/chunks/{5552.e9003587.js.map → 5552.8c2ed047.js.map} +1 -1
- package/dist/chunks/{5659.9000e441.js → 5659.c2b28502.js} +3 -3
- package/dist/chunks/{5659.9000e441.js.map → 5659.c2b28502.js.map} +1 -1
- package/dist/chunks/6233.18a64bb2.js +3 -0
- package/dist/chunks/6233.18a64bb2.js.map +1 -0
- package/dist/chunks/{6314.d4929d4b.js → 6314.86404a43.js} +2 -2
- package/dist/chunks/{6314.d4929d4b.js.map → 6314.86404a43.js.map} +1 -1
- package/dist/chunks/7218.cf7baa8d.js +2 -0
- package/dist/chunks/{4837.be6e0550.js.map → 7218.cf7baa8d.js.map} +1 -1
- package/dist/chunks/{7434.4ddb3aab.js → 7434.99b24ba5.js} +2 -2
- package/dist/chunks/{7434.4ddb3aab.js.map → 7434.99b24ba5.js.map} +1 -1
- package/dist/chunks/{7733.0ded6e62.js → 7733.6aaf0acb.js} +2 -2
- package/dist/chunks/{7733.0ded6e62.js.map → 7733.6aaf0acb.js.map} +1 -1
- package/dist/chunks/{790.bf45032e.js → 790.d4f3b21c.js} +2 -2
- package/dist/chunks/{790.bf45032e.js.map → 790.d4f3b21c.js.map} +1 -1
- package/dist/chunks/{8091.0da1c3bd.js → 8091.c5adab63.js} +3 -3
- package/dist/chunks/{8091.0da1c3bd.js.map → 8091.c5adab63.js.map} +1 -1
- package/dist/chunks/9027.397f0c1f.js +2 -0
- package/dist/chunks/{9027.73a15c9e.js.map → 9027.397f0c1f.js.map} +1 -1
- package/dist/chunks/{9559.769f4ba7.js → 9559.a7cc0fe6.js} +2 -2
- package/dist/chunks/{9559.769f4ba7.js.map → 9559.a7cc0fe6.js.map} +1 -1
- package/dist/chunks/{chat-conversation.719bc9ad.js → chat-conversation.064750a3.js} +3 -3
- package/dist/chunks/{chat-conversation.719bc9ad.js.map → chat-conversation.064750a3.js.map} +1 -1
- package/dist/chunks/chat-preview.8de942c9.js +3 -0
- package/dist/chunks/{chat-preview.1060a657.js.map → chat-preview.8de942c9.js.map} +1 -1
- package/dist/chunks/check-editor-by-name.73728483.js +2 -0
- package/dist/chunks/{check-editor-by-name.3650b398.js.map → check-editor-by-name.73728483.js.map} +1 -1
- package/dist/chunks/contract-select.531ce760.js +3 -0
- package/dist/chunks/{contract-select.11fa79d1.js.map → contract-select.531ce760.js.map} +1 -1
- package/dist/chunks/{generate-snippets-context-menu.b917e8ff.js → generate-snippets-context-menu.cec122bb.js} +2 -2
- package/dist/chunks/{generate-snippets-context-menu.b917e8ff.js.map → generate-snippets-context-menu.cec122bb.js.map} +1 -1
- package/dist/chunks/get-data-deps.03f2aae3.js +2 -0
- package/dist/chunks/get-data-deps.03f2aae3.js.map +1 -0
- package/dist/chunks/{inject-chat-preview-agent.62239f34.js → inject-chat-preview-agent.75e178b0.js} +2 -2
- package/dist/chunks/{inject-chat-preview-agent.62239f34.js.map → inject-chat-preview-agent.75e178b0.js.map} +1 -1
- package/dist/chunks/{inject-preview-agent.f329e0d9.js → inject-preview-agent.83ee9dfe.js} +2 -2
- package/dist/chunks/{inject-preview-agent.f329e0d9.js.map → inject-preview-agent.83ee9dfe.js.map} +1 -1
- package/dist/chunks/main.1c9f57b6.js +2 -0
- package/dist/chunks/main.1c9f57b6.js.map +1 -0
- package/dist/chunks/{page-arch-node.496da924.js → page-arch-node.50fe50b2.js} +3 -3
- package/dist/chunks/{page-arch-node.496da924.js.map → page-arch-node.50fe50b2.js.map} +1 -1
- package/dist/chunks/pre-generated-container.0e9e33dc.js +2 -0
- package/dist/chunks/{pre-generated-container.1235feb9.js.map → pre-generated-container.0e9e33dc.js.map} +1 -1
- package/dist/chunks/pre-generated-preview.da3f0cc6.js +3 -0
- package/dist/chunks/{pre-generated-preview.d8429f7d.js.map → pre-generated-preview.da3f0cc6.js.map} +1 -1
- package/dist/chunks/{pre-generated-table-view.7be02729.js → pre-generated-table-view.a76e65eb.js} +2 -2
- package/dist/chunks/{pre-generated-table-view.7be02729.js.map → pre-generated-table-view.a76e65eb.js.map} +1 -1
- package/dist/chunks/property-editor.81603794.js +2 -0
- package/dist/chunks/property-editor.81603794.js.map +1 -0
- package/dist/chunks/workbench-action-list.06eae580.js +2 -0
- package/dist/chunks/{workbench-action-list.97d5b127.js.map → workbench-action-list.06eae580.js.map} +1 -1
- package/dist/chunks/{workbench-action.1a44a90f.js → workbench-action.5cd875ea.js} +3 -3
- package/dist/chunks/{workbench-action.1a44a90f.js.map → workbench-action.5cd875ea.js.map} +1 -1
- package/dist/chunks/workbench-history-action.81a1f9d8.js +3 -0
- package/dist/chunks/{workbench-history-action.54976323.js.map → workbench-history-action.81a1f9d8.js.map} +1 -1
- package/dist/chunks/{workbench-pane.5636e95b.js → workbench-pane.9634f35a.js} +3 -3
- package/dist/chunks/{workbench-pane.5636e95b.js.map → workbench-pane.9634f35a.js.map} +1 -1
- package/dist/chunks/{workbench-sidebar.e66c6daa.js → workbench-sidebar.d9bc1d1a.js} +2 -2
- package/dist/chunks/{workbench-sidebar.e66c6daa.js.map → workbench-sidebar.d9bc1d1a.js.map} +1 -1
- package/dist/chunks/{workbench-tree.a03b7c9d.js → workbench-tree.c3469448.js} +3 -3
- package/dist/chunks/{workbench-tree.a03b7c9d.js.map → workbench-tree.c3469448.js.map} +1 -1
- package/dist/examples.json +1 -1
- package/dist/index.647b0e56.js +2 -0
- package/dist/index.647b0e56.js.map +1 -0
- package/dist/manifest.json +17 -9
- package/dist/types.json +410 -344
- package/dist-types/bootstrap.d.ts +1 -0
- package/dist-types/data-providers/get-data-dependency.d.ts +3 -0
- package/dist-types/data-providers/get-data-dependency.spec.d.ts +1 -0
- package/dist-types/interfaces.d.ts +0 -3
- package/dist-types/property-editor/index.d.ts +34 -30
- package/dist-types/shared/workbench/WorkbenchActionsContext.d.ts +0 -1
- package/dist-types/shared/workbench/WorkbenchTreeContext.d.ts +0 -1
- package/dist-types/shared/workbench/WorkbenchTreeDndContext.d.ts +0 -1
- package/dist-types/utils/setDragImage.d.ts +0 -1
- package/docs/property-editor.md +39 -8
- package/package.json +4 -4
- package/dist/chunks/2252.779b6b84.js +0 -3
- package/dist/chunks/2252.779b6b84.js.map +0 -1
- package/dist/chunks/2980.dc0edf4e.js +0 -2
- package/dist/chunks/4837.be6e0550.js +0 -2
- package/dist/chunks/4947.3d3f4ed8.js +0 -3
- package/dist/chunks/4947.3d3f4ed8.js.map +0 -1
- package/dist/chunks/7218.a7563c01.js +0 -2
- package/dist/chunks/8275.42c8c9a8.js +0 -3
- package/dist/chunks/8275.42c8c9a8.js.map +0 -1
- package/dist/chunks/9027.73a15c9e.js +0 -2
- package/dist/chunks/chat-preview.1060a657.js +0 -3
- package/dist/chunks/check-editor-by-name.3650b398.js +0 -2
- package/dist/chunks/contract-select.11fa79d1.js +0 -3
- package/dist/chunks/main.20534ae8.js +0 -2
- package/dist/chunks/main.20534ae8.js.map +0 -1
- package/dist/chunks/pre-generated-container.1235feb9.js +0 -2
- package/dist/chunks/pre-generated-preview.d8429f7d.js +0 -3
- package/dist/chunks/property-editor.e0aefc4a.js +0 -2
- package/dist/chunks/property-editor.e0aefc4a.js.map +0 -1
- package/dist/chunks/workbench-action-list.97d5b127.js +0 -2
- package/dist/chunks/workbench-history-action.54976323.js +0 -3
- package/dist/index.ee070745.js +0 -2
- package/dist/index.ee070745.js.map +0 -1
- /package/dist/chunks/{2252.779b6b84.js.LICENSE.txt → 2252.043616c7.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{4947.3d3f4ed8.js.LICENSE.txt → 4947.0103ed62.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5659.9000e441.js.LICENSE.txt → 5659.c2b28502.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{8275.42c8c9a8.js.LICENSE.txt → 6233.18a64bb2.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{8091.0da1c3bd.js.LICENSE.txt → 8091.c5adab63.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-conversation.719bc9ad.js.LICENSE.txt → chat-conversation.064750a3.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-preview.1060a657.js.LICENSE.txt → chat-preview.8de942c9.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{contract-select.11fa79d1.js.LICENSE.txt → contract-select.531ce760.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{page-arch-node.496da924.js.LICENSE.txt → page-arch-node.50fe50b2.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{pre-generated-preview.d8429f7d.js.LICENSE.txt → pre-generated-preview.da3f0cc6.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-action.1a44a90f.js.LICENSE.txt → workbench-action.5cd875ea.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.54976323.js.LICENSE.txt → workbench-history-action.81a1f9d8.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-pane.5636e95b.js.LICENSE.txt → workbench-pane.9634f35a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-tree.a03b7c9d.js.LICENSE.txt → workbench-tree.c3469448.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import { CodeEditorComponent } from "./components/common/CodeEditorComponent";
|
|
|
9
9
|
import { IconSelectComponent } from "./components/common/IconSelectComponent";
|
|
10
10
|
import { DataNode } from "./utils/formilySchemaFormatter";
|
|
11
11
|
import "./style.css";
|
|
12
|
+
import { BrickPackage } from "@next-core/types";
|
|
12
13
|
declare const SchemaField: {
|
|
13
14
|
<Decorator extends import("@formily/react").JSXComponent, Component extends import("@formily/react").JSXComponent>(props: import("@formily/react").ISchemaFieldProps<Decorator, Component, import("@formily/core").ObjectField<Decorator, Component>>): JSX.Element;
|
|
14
15
|
displayName: string;
|
|
@@ -29,7 +30,7 @@ declare const SchemaField: {
|
|
|
29
30
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
30
31
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
31
32
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
32
|
-
activeKeys: string | number | (string | number)[];
|
|
33
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
33
34
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
34
35
|
hasActiveKey(key: string | number): boolean;
|
|
35
36
|
addActiveKey(key: string | number): void;
|
|
@@ -38,11 +39,11 @@ declare const SchemaField: {
|
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
41
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
41
|
-
children?:
|
|
42
|
+
children?: import("react").ReactNode;
|
|
42
43
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
43
44
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
44
45
|
__ANT_RADIO: boolean;
|
|
45
|
-
Group:
|
|
46
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
46
47
|
};
|
|
47
48
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
48
49
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -69,7 +70,7 @@ declare const SchemaField: {
|
|
|
69
70
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
70
71
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
71
72
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
72
|
-
activeKeys: string | number | (string | number)[];
|
|
73
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
73
74
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
74
75
|
hasActiveKey(key: string | number): boolean;
|
|
75
76
|
addActiveKey(key: string | number): void;
|
|
@@ -78,11 +79,11 @@ declare const SchemaField: {
|
|
|
78
79
|
};
|
|
79
80
|
};
|
|
80
81
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
81
|
-
children?:
|
|
82
|
+
children?: import("react").ReactNode;
|
|
82
83
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
83
84
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
84
85
|
__ANT_RADIO: boolean;
|
|
85
|
-
Group:
|
|
86
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
86
87
|
};
|
|
87
88
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
88
89
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -109,7 +110,7 @@ declare const SchemaField: {
|
|
|
109
110
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
110
111
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
111
112
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
112
|
-
activeKeys: string | number | (string | number)[];
|
|
113
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
113
114
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
114
115
|
hasActiveKey(key: string | number): boolean;
|
|
115
116
|
addActiveKey(key: string | number): void;
|
|
@@ -118,11 +119,11 @@ declare const SchemaField: {
|
|
|
118
119
|
};
|
|
119
120
|
};
|
|
120
121
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
121
|
-
children?:
|
|
122
|
+
children?: import("react").ReactNode;
|
|
122
123
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
123
124
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
124
125
|
__ANT_RADIO: boolean;
|
|
125
|
-
Group:
|
|
126
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
126
127
|
};
|
|
127
128
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
128
129
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -149,7 +150,7 @@ declare const SchemaField: {
|
|
|
149
150
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
150
151
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
151
152
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
152
|
-
activeKeys: string | number | (string | number)[];
|
|
153
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
153
154
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
154
155
|
hasActiveKey(key: string | number): boolean;
|
|
155
156
|
addActiveKey(key: string | number): void;
|
|
@@ -158,11 +159,11 @@ declare const SchemaField: {
|
|
|
158
159
|
};
|
|
159
160
|
};
|
|
160
161
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
161
|
-
children?:
|
|
162
|
+
children?: import("react").ReactNode;
|
|
162
163
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
163
164
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
164
165
|
__ANT_RADIO: boolean;
|
|
165
|
-
Group:
|
|
166
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
166
167
|
};
|
|
167
168
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
168
169
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -189,7 +190,7 @@ declare const SchemaField: {
|
|
|
189
190
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
190
191
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
191
192
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
192
|
-
activeKeys: string | number | (string | number)[];
|
|
193
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
193
194
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
194
195
|
hasActiveKey(key: string | number): boolean;
|
|
195
196
|
addActiveKey(key: string | number): void;
|
|
@@ -198,11 +199,11 @@ declare const SchemaField: {
|
|
|
198
199
|
};
|
|
199
200
|
};
|
|
200
201
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
201
|
-
children?:
|
|
202
|
+
children?: import("react").ReactNode;
|
|
202
203
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
203
204
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
204
205
|
__ANT_RADIO: boolean;
|
|
205
|
-
Group:
|
|
206
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
206
207
|
};
|
|
207
208
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
208
209
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -229,7 +230,7 @@ declare const SchemaField: {
|
|
|
229
230
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
230
231
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
231
232
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
232
|
-
activeKeys: string | number | (string | number)[];
|
|
233
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
233
234
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
234
235
|
hasActiveKey(key: string | number): boolean;
|
|
235
236
|
addActiveKey(key: string | number): void;
|
|
@@ -238,11 +239,11 @@ declare const SchemaField: {
|
|
|
238
239
|
};
|
|
239
240
|
};
|
|
240
241
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
241
|
-
children?:
|
|
242
|
+
children?: import("react").ReactNode;
|
|
242
243
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
243
244
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
244
245
|
__ANT_RADIO: boolean;
|
|
245
|
-
Group:
|
|
246
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
246
247
|
};
|
|
247
248
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
248
249
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -269,7 +270,7 @@ declare const SchemaField: {
|
|
|
269
270
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
270
271
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
271
272
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
272
|
-
activeKeys: string | number | (string | number)[];
|
|
273
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
273
274
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
274
275
|
hasActiveKey(key: string | number): boolean;
|
|
275
276
|
addActiveKey(key: string | number): void;
|
|
@@ -278,11 +279,11 @@ declare const SchemaField: {
|
|
|
278
279
|
};
|
|
279
280
|
};
|
|
280
281
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
281
|
-
children?:
|
|
282
|
+
children?: import("react").ReactNode;
|
|
282
283
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
283
284
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
284
285
|
__ANT_RADIO: boolean;
|
|
285
|
-
Group:
|
|
286
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
286
287
|
};
|
|
287
288
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
288
289
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -309,7 +310,7 @@ declare const SchemaField: {
|
|
|
309
310
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
310
311
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
311
312
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
312
|
-
activeKeys: string | number | (string | number)[];
|
|
313
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
313
314
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
314
315
|
hasActiveKey(key: string | number): boolean;
|
|
315
316
|
addActiveKey(key: string | number): void;
|
|
@@ -318,11 +319,11 @@ declare const SchemaField: {
|
|
|
318
319
|
};
|
|
319
320
|
};
|
|
320
321
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
321
|
-
children?:
|
|
322
|
+
children?: import("react").ReactNode;
|
|
322
323
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
323
324
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
324
325
|
__ANT_RADIO: boolean;
|
|
325
|
-
Group:
|
|
326
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
326
327
|
};
|
|
327
328
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
328
329
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -349,7 +350,7 @@ declare const SchemaField: {
|
|
|
349
350
|
FormCollapse: import("@formily/react").ReactFC<import("@formily/antd-v5").IFormCollapseProps> & {
|
|
350
351
|
CollapsePanel: React.FC<React.PropsWithChildren<import("antd").CollapsePanelProps>>;
|
|
351
352
|
createFormCollapse: (defaultActiveKeys?: string | number | (string | number)[]) => {
|
|
352
|
-
activeKeys: string | number | (string | number)[];
|
|
353
|
+
activeKeys: (string | number | (string | number)[]) | undefined;
|
|
353
354
|
setActiveKeys(keys: string | number | (string | number)[]): void;
|
|
354
355
|
hasActiveKey(key: string | number): boolean;
|
|
355
356
|
addActiveKey(key: string | number): void;
|
|
@@ -358,11 +359,11 @@ declare const SchemaField: {
|
|
|
358
359
|
};
|
|
359
360
|
};
|
|
360
361
|
NumberPicker: React.ForwardRefExoticComponent<Pick<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
|
|
361
|
-
children?:
|
|
362
|
+
children?: import("react").ReactNode;
|
|
362
363
|
} & React.RefAttributes<HTMLInputElement>>, "key" | keyof import("antd").InputNumberProps<import("rc-input-number").ValueType>> & React.RefAttributes<unknown>>;
|
|
363
364
|
Radio: React.ForwardRefExoticComponent<Pick<Partial<import("antd").RadioProps & React.RefAttributes<import("rc-checkbox").CheckboxRef>>, "key" | keyof import("antd").RadioProps> & React.RefAttributes<unknown>> & {
|
|
364
365
|
__ANT_RADIO: boolean;
|
|
365
|
-
Group:
|
|
366
|
+
Group: import("react").ForwardRefExoticComponent<Pick<Partial<import("antd").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>, "key" | keyof import("antd").RadioGroupProps> & import("react").RefAttributes<unknown>>;
|
|
366
367
|
};
|
|
367
368
|
Select: import("@formily/react").ReactFC<import("antd/lib").SelectProps<any, any>>;
|
|
368
369
|
Switch: React.ForwardRefExoticComponent<Pick<Partial<import("antd").SwitchProps & React.RefAttributes<HTMLElement>>, "key" | keyof import("antd").SwitchProps> & React.RefAttributes<unknown>>;
|
|
@@ -384,7 +385,8 @@ export interface EditorComponentProps {
|
|
|
384
385
|
onFieldInitialValueChange: typeof onFieldInitialValueChange;
|
|
385
386
|
onFormInitialValuesChange: typeof onFormInitialValuesChange;
|
|
386
387
|
onFormValidateSuccess: typeof onFormValidateSuccess;
|
|
387
|
-
onSubmit: (listener: (form: Form) => any) => void;
|
|
388
|
+
onSubmit: (listener: (value: any, form: Form) => any) => void;
|
|
389
|
+
onAdvancedChange: (listener: (advancedMode: boolean, form: Form) => any) => void;
|
|
388
390
|
};
|
|
389
391
|
scope: {
|
|
390
392
|
advancedMode: boolean;
|
|
@@ -416,6 +418,7 @@ export declare class PropertyEditor extends ReactNextElement {
|
|
|
416
418
|
/** 高级模式 */
|
|
417
419
|
accessor advancedMode: boolean | undefined;
|
|
418
420
|
accessor dataList: DataItem[];
|
|
421
|
+
accessor editorPackages: BrickPackage[];
|
|
419
422
|
validate(): void;
|
|
420
423
|
render(): React.JSX.Element;
|
|
421
424
|
}
|
|
@@ -424,7 +427,8 @@ export interface PropertyEditorProps {
|
|
|
424
427
|
editorName: string;
|
|
425
428
|
advancedMode?: boolean;
|
|
426
429
|
dataList: DataItem[];
|
|
430
|
+
editorPackages: BrickPackage[];
|
|
427
431
|
handleValuesChange: (value: any) => void;
|
|
428
|
-
onSubmitEffect: (listener: (form: Form) => any) => void;
|
|
432
|
+
onSubmitEffect: (listener: (value: any, form: Form) => any) => void;
|
|
429
433
|
}
|
|
430
|
-
export declare function LegacyPropertyEditor({ advancedMode, values, editorName, dataList, handleValuesChange, onSubmitEffect, }: PropertyEditorProps, ref: any): React.JSX.Element;
|
|
434
|
+
export declare function LegacyPropertyEditor({ advancedMode, values, editorName, dataList, editorPackages, handleValuesChange, onSubmitEffect, }: PropertyEditorProps, ref: any): React.JSX.Element;
|
package/docs/property-editor.md
CHANGED
|
@@ -5,20 +5,51 @@
|
|
|
5
5
|
### Basic
|
|
6
6
|
|
|
7
7
|
```yaml preview
|
|
8
|
+
- brick: eo-select
|
|
9
|
+
properties:
|
|
10
|
+
label: 选择一个构件
|
|
11
|
+
value: eo-button
|
|
12
|
+
options: <% MISC.local_editors %>
|
|
13
|
+
style:
|
|
14
|
+
display: block
|
|
15
|
+
marginBottom: 2em
|
|
16
|
+
events:
|
|
17
|
+
change:
|
|
18
|
+
target: "#editor"
|
|
19
|
+
properties:
|
|
20
|
+
editorName: <% EVENT.detail.value %>
|
|
8
21
|
- brick: visual-builder.property-editor
|
|
9
22
|
properties:
|
|
10
23
|
id: editor
|
|
11
|
-
editorName: eo-button
|
|
24
|
+
editorName: eo-button
|
|
25
|
+
advancedMode: <%= CTX.isAdvanced %>
|
|
12
26
|
events:
|
|
13
27
|
validate.success:
|
|
14
28
|
- action: console.log
|
|
15
29
|
validate.error:
|
|
16
30
|
- action: console.log
|
|
17
|
-
- brick: eo-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
- brick: eo-search-bar
|
|
32
|
+
context:
|
|
33
|
+
- name: isAdvanced
|
|
34
|
+
value: false
|
|
35
|
+
children:
|
|
36
|
+
- brick: eo-button
|
|
37
|
+
slot: start
|
|
38
|
+
properties:
|
|
39
|
+
textContent: Submit
|
|
40
|
+
events:
|
|
41
|
+
click:
|
|
42
|
+
- target: "#editor"
|
|
43
|
+
method: validate
|
|
44
|
+
- brick: eo-link
|
|
45
|
+
slot: end
|
|
46
|
+
properties:
|
|
47
|
+
textContent: |
|
|
48
|
+
<%= `切换到${CTX.isAdvanced ? "普通" : "高级"}模式` %>
|
|
49
|
+
events:
|
|
50
|
+
click:
|
|
51
|
+
- action: context.replace
|
|
52
|
+
args:
|
|
53
|
+
- isAdvanced
|
|
54
|
+
- <% !CTX.isAdvanced %>
|
|
24
55
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/visual-builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/visual-builder",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"postpublish": "mv package.json.bak package.json"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@next-core/build-next-bricks": "^1.22.
|
|
39
|
-
"@next-core/test-next": "^1.1.
|
|
38
|
+
"@next-core/build-next-bricks": "^1.22.2",
|
|
39
|
+
"@next-core/test-next": "^1.1.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@next-bricks/basic": "*",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@next-bricks/icons": "*",
|
|
45
45
|
"@next-bricks/vs": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "898bc118c9e1de37b7fab5738f38c029b4b9bb99"
|
|
48
48
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 2252.779b6b84.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[2252],{2559:(e,t,n)=>{function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},6330:(e,t,n)=>{function r(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))}}n.d(t,{A:()=>o})},2016:(e,t,n)=>{function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},829:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2559);function o(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2016);function o(e,t,n){(0,r.A)(e,t),t.set(e,n)}},6121:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2559);function o(e,t,n){return e.set((0,r.A)(e,t),n),n}},5536:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2559);function o(e,t,n){return n((0,r.A)(e,t))}},4635:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2016);function o(e,t){(0,r.A)(e,t),t.add(e)}},2252:(e,t,n)=>{n.r(t),n.d(t,{analytics:()=>u,auth:()=>dt,checkInstalledApps:()=>o,checkPermissions:()=>pt,flowApi:()=>i,menu:()=>s,messageDispatcher:()=>lt});var r={};n.r(r),n.d(r,{authenticate:()=>g,getAuth:()=>A,isLoggedIn:()=>w,logout:()=>v});var o={};n.r(o),n.d(o,{getCheckedApp:()=>ne,preCheckInstalledApps:()=>ee,waitForCheckingApps:()=>te});var i={};n.r(i),n.d(i,{FLOW_API_PROVIDER:()=>oe,clearCollectWidgetContract:()=>ge,clearDebugContract:()=>ve,collectContract:()=>he,collectDebugContract:()=>Ae,collectWidgetContract:()=>me,getArgsOfFlowApi:()=>Se,isFlowApiProvider:()=>ye,registerFlowApiProvider:()=>ae});var s={};n.r(s),n.d(s,{fetchMenuById:()=>He,getMenuById:()=>ze});var a={};n.r(a),n.d(a,{onRequest:()=>it,onResponse:()=>st,onResponseError:()=>at});var c={};n.r(c),n.d(c,{create:()=>ut});var u={};n.r(u),n.d(u,{http:()=>a,initialize:()=>rt,pageView:()=>c});var p=n(1030),l=n(7302),d=n(6330),f=n(3688),h=function(){var e=(0,d.A)((function*(e,t){return(yield f.http.post("api/gateway/micro_app.permission.ValidatePermissions/api/micro_app/v1/permission/validate",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}();const m={};function g(e){Object.assign(m,{org:e.org,username:e.username,userInstanceId:e.userInstanceId,loginFrom:e.loginFrom,accessRule:e.accessRule,isAdmin:e.isAdmin,csrfToken:e.csrfToken,license:e.license,accessToken:e.accessToken,userShowValue:e.userShowValue})}function A(){return{...m}}function v(){for(const e of Object.keys(m))m[e]=void 0;y.length=0,S.clear()}function w(){return void 0!==m.username}const y=[],S=new Map;function b(e){if(w()&&!A().isAdmin)return I((0,l.scanPermissionActionsInAny)(e))}async function I(e){const t=(0,p.difference)(e,[...y]);if(0!==t.length){y.push(...t);try{const e=await h({actions:t},{noAbortOnRouteChange:!0});for(const t of e.actions)S.set(t.action,t.authorizationStatus),"undefined"===t.authorizationStatus&&console.error(`Undefined permission action: "${t.action}"`)}catch(e){console.error("Pre-check permissions failed",e)}}}var E=n(4635),k=n(918),P=n(5536),O=n(2559),M=n(6121),C=n(829),_=n(6003);const T=1e3,N=6;var $=new WeakMap,j=new WeakMap,R=new WeakMap,D=new WeakMap,W=new WeakMap,x=new WeakMap,L=new WeakMap,U=new WeakSet;class B{constructor(e){(0,E.A)(this,U),(0,k.A)(this,$,void 0),(0,k.A)(this,j,void 0),(0,k.A)(this,R,[]),(0,k.A)(this,D,new Set),(0,k.A)(this,W,new Set),(0,k.A)(this,x,0),(0,k.A)(this,L,!1),(0,M.A)($,this,e)}send(e){(0,C.A)(j,this)||(0,M.A)(j,this,(0,O.A)(U,this,F).call(this));const t=JSON.stringify(e);(0,C.A)(j,this).readyState===WebSocket.OPEN?(0,C.A)(j,this).send(t):(0,C.A)(R,this).push(t)}onMessage(e){(0,C.A)(D,this).add(e)}onClose(e){(0,C.A)(W,this).add(e)}reset(){(0,C.A)(R,this).length=0,(0,C.A)(D,this).clear(),(0,C.A)(W,this).clear()}close(){var e;(0,M.A)(L,this,!0),(null===(e=(0,C.A)(j,this))||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(0,C.A)(j,this).close()}}function F(){console.log("WebSocket connecting ...");const e=new WebSocket((0,C.A)($,this));return e.addEventListener("open",(t=>{console.log("WebSocket open:",t),(0,M.A)(x,this,0);for(const t of(0,C.A)(R,this))e.send(t);(0,C.A)(R,this).length=0})),e.addEventListener("close",(e=>{if(!(0,C.A)(L,this)){console.log("WebSocket close:",e);for(const e of(0,C.A)(W,this))e();1e3!==e.code&&(0,O.A)(U,this,q).call(this)}})),e.addEventListener("error",(e=>{console.error("WebSocket error:",e)})),e.addEventListener("message",(e=>{const t=JSON.parse(e.data);for(const e of(0,C.A)(D,this))e(t)})),e}function q(){if((0,C.A)(x,this)>=N)return void console.error("WebSocket connect retry limit exceeded");const e=Math.pow(2,(0,C.A)(x,this))*T;console.log("WebSocket will reconnect after %d seconds",e/1e3),setTimeout((()=>{var e;(0,M.A)(x,this,(e=(0,C.A)(x,this),++e)),(0,M.A)(j,this,(0,O.A)(U,this,F).call(this))}),e)}var z=new WeakMap,H=new WeakMap,G=new WeakMap,J=new WeakSet;function V(e){if(!(0,C.A)(z,e)){const t=`${"https:"===location.protocol?"wss:":"ws:"}//${window.location.host}${(0,_.getBasePath)()}api/websocket_service/v1/ws`;(0,M.A)(z,e,new B(t))}return(0,C.A)(z,e)}function Y(e,t,n,r){const o=(0,C.A)(H,this)[e].get(r);if(o)return o;const i={event:"sub"===e?"TOPIC.SUB":"TOPIC.UNSUB",payload:n},s=new Promise(((t,r)=>{const o=K(n);(0,P.A)(J,this,V).onMessage((n=>{const i=n.event===("sub"===e?"TOPIC.SUB_SUCCESS":"TOPIC.UNSUB_SUCCESS"),s=n.event===("sub"===e?"TOPIC.SUB_FAILED":"TOPIC.UNSUB_FAILED");(i||s)&&o===K(n.payload)&&(i?t:r)(n)})),(0,P.A)(J,this,V).send(i)}));return"sub"===e&&(0,C.A)(G,this).set(t,r),(0,C.A)(H,this)[e].set(r,s),s}function K(e){const{system:t,topic:n}=e;return JSON.stringify({system:t,topic:n})}var Q=function(){var e=(0,d.A)((function*(e,t){return(yield f.http.post("api/gateway/micro_app_standalone.runtime.SearchMicroAppStandalone/api/v1/micro_app_standalone/search",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}();const X=new Map,Z=new Map;function ee(e,t){if(window.STANDALONE_MICRO_APPS&&!window.NO_AUTH_GUARD){const n=function(e){const t={usedArgs:new Set},{customTemplates:n,menus:r}=e.meta??{};return(0,l.traverseStoryboardExpressions)([e.routes,n,r],((e,n)=>{(0,l.collectInstalledAppsHasUsage)(t,e,n)}),"INSTALLED_APPS"),[...t.usedArgs]}(e),r=[];for(const e of n)X.has(e)||t(e)||r.push(e);if(0===r.length)return;const o=Q({query:{appId:{$in:r}},fields:["appId","currentVersion","installStatus"]}).catch((e=>{console.error("Get off site standalone micro-apps failed",e)}));for(const e of r)X.set(e,o.then((t=>{var n;const r=null==t||null===(n=t.list)||void 0===n?void 0:n.find((t=>t.appId===e)),o=r?{...r,id:e}:void 0;return Z.set(e,o),o})))}}async function te(e){await Promise.all(e.map((e=>X.get(e))))}function ne(e){if(window.STANDALONE_MICRO_APPS)return Z.get(e)}var re=n(8706);const oe="core.provider-flow-api";function ie(e,t){return e.some((e=>e.source===t))}async function se(e){let{url:t,originalUri:n,method:r="GET",responseWrapper:o=!0,ext_fields:i=[],request:s,isFileType:a,stream:c}=e;const u=["get","delete","head"].includes(r.toLowerCase()),l=a?{responseType:"blob"}:{};let d;for(var h=arguments.length,m=new Array(h>1?h-1:0),g=1;g<h;g++)m[g-1]=arguments[g];if(u){var A,v;let e,o;var w;if(n&&"object"===(null==s?void 0:s.type)&&((null===(A=n.match(/:([^/]+)/g))||void 0===A?void 0:A.length)??0)===((null===(v=s.fields)||void 0===v?void 0:v.length)??0)?[o]=m:[e,o]=m,c)return await(0,re.createSSEStream)(f.http.getUrlWithParams(t,e),{...l,...o,method:r,headers:Object.fromEntries([...new Headers((null===(w=o)||void 0===w?void 0:w.headers)??{}).entries()])});d=await f.http.simpleRequest(r,t,{params:e,...l,...o})}else{const e=function(e){if(!e||"object"!==e.type)return!1;const t=e=>!(0,p.isEmpty)(e)&&e.some((e=>["file","file[]"].includes(e.type)||t(e.fields)));return t(e.fields)}(s),n=function(e){const t=ie(e,"query"),n=ie(e,"body");for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(t){if(n){const[e,t,n]=o;return{data:e,options:{params:t,...n}}}const[e,t]=o;return{data:{},options:{params:e,...t}}}const[s,a]=o;return{data:s,options:a}}(i,...m),o=e?function(e){if(e instanceof FormData)return e;const t=new FormData;for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.append(n,e)})):!(0,p.isObject)(r)||r instanceof Blob||r instanceof Date?t.append(n,r):Object.entries(r).forEach((e=>{let[r,o]=e;t.append(`${n}[${r}]`,o)}));return t}(n.data):n.data;if(c){var y;const{body:e,headers:i}=f.http.getBodyAndHeaders(o,null===(y=n.options)||void 0===y?void 0:y.headers);return await(0,re.createSSEStream)(t,{...l,...n.options,method:r,headers:Object.fromEntries([...new Headers(i??{}).entries()]),body:e})}d=await f.http.requestWithBody(r,t,o,{...l,...n.options})}return!a&&o?d.data:d}function ae(){customElements.define(oe,(0,re.createProviderClass)(se))}var ce=n(8679),ue=function(){var e=(0,d.A)((function*(e,t){return(yield f.http.post("api/contract/single_search",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}();const pe=new Map,le=new Map,de=new Map,fe=(e,t)=>{null==e||e.forEach((e=>{t.set(`${e.namespaceId}.${e.name}`,e)}))};function he(e){fe(e,pe)}function me(e){fe(e,le)}function ge(){le.clear()}function Ae(e){fe(e,de)}function ve(){de.clear()}const we=new Map;function ye(e){return e.includes("@")}async function Se(e,t,n,r){if(!e.includes(":"))throw new Error(`You're using legacy Custom API "${e}" which is dropped in v3, please use Flow API instead`);const o=await async function(e){const[t,n]=e.split("@"),[r,o]=n.split(":"),i=function(e){return pe.get(e)||le.get(e)||de.get(e)}(`${t}.${r}`);if(i)return{name:i.name,namespace:i.namespaceId,serviceName:i.serviceName,version:i.version,contract:{endpoint:i.endpoint,response:i.response,request:i.request}};let s=we.get(e);return s||(s=async function(e,t,n){var r;const{contractData:o}=await ue({contractName:`${e}.${t}`,version:n});return o?{name:o.name,namespace:null===(r=o.namespace)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.name,serviceName:o.serviceName,version:o.version,contract:{endpoint:o.endpoint,response:o.response,request:o.request}}:null}(t,r,o),we.set(e,s)),s}(e);if(!o)throw new be(`Flow API not found: "${e}"`);const i=function(e,t){var n;const r="string"==typeof t.contract?ce.safeLoad(t.contract,{schema:ce.JSON_SCHEMA,json:!0}):t.contract,{uri:o,method:i="GET",ext_fields:s}=(null==r?void 0:r.endpoint)??{},a=!(null==r||!r.response)&&!1!==r.response.wrapper;if(!o)throw new Error(`Missing endpoint.uri in contract of provider "${e}"`);return{uri:o,method:"list"===i.toLowerCase()?"get":i,ext_fields:s,name:t.name,namespace:t.namespace,serviceName:t.serviceName,version:t.version,isFileType:"file"===(null==r||null===(n=r.response)||void 0===n?void 0:n.type),responseWrapper:a,request:null==r?void 0:r.request}}(e,o);return function(e,t,n,r){let{uri:o,method:i,ext_fields:s,name:a,namespace:c,serviceName:u,responseWrapper:p,version:l,isFileType:d,request:f}=e;const h="saveAs"===n;let m;h&&(m=t.shift());const{url:g,args:A}=function(e,t,n,r,o,i){const s=i?"logic.api.gateway"===o?"":o?`api/gateway/${o}`:`api/gateway/${r}.${n}@${i}`:`api/gateway/api_service.${r}.${n}`,a=t.slice(),c=e.replace(/:([^/]+)/g,(()=>a.shift()));return{url:s?s+c:c.replace(/^\//,""),args:a}}(o,t,a,c,u,l);return[...h?[m]:[],{url:g,originalUri:o,method:i,ext_fields:s,responseWrapper:p,request:f,isFileType:d,stream:r},...A]}(i,t,n,r)}class be extends Error{constructor(e){super(e),this.name="FlowApiNotFoundError",Error.captureStackTrace&&Error.captureStackTrace(this,be)}}var Ie=function(){var e=(0,d.A)((function*(e,t,n){return(yield f.http.post("api/gateway/cmdb.instance.PostSearch/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}(),Ee=n(9740),ke=function(){var e=(0,d.A)((function*(e,t,n){return(yield f.http.get("api/gateway/micro_app.installed_micro_app.GetMenusInfo/api/v1/micro-app/menus/".concat(e),(0,Ee.A)((0,Ee.A)({},n),{},{params:t}))).data}));return function(t,n,r){return e.apply(this,arguments)}}(),Pe=n(8799);const Oe=Symbol("appId"),Me=Symbol("menuI18nNamespace"),Ce=Symbol("overrideApp");async function _e(e,t,n){const r=e.find((e=>"inject"!==e.type));if(!r)return;const o=[],i=new Map,s=new WeakMap;for(const t of e)if(t.i18n){const e=`menu/${t.menuId}~${t.app[0].appId}+${t.instanceId}`;Object.entries(t.i18n).forEach((t=>{let[n,r]=t;Pe.i18n.addResourceBundle(n,e,r)})),s.set(t,e)}await Promise.all(e.map((e=>async function(e,t,n,r){if(e.dynamicItems&&e.itemsResolve){const i=e.app[0].appId,s={...t,pendingPermissionsPreCheck:[...t.pendingPermissionsPreCheck,b(e.itemsResolve)]};var o;i!==t.app.id&&(s.overrideApp=window.STANDALONE_MICRO_APPS?e.overrideApp:null===(o=r.getStoryboardByAppId(i))||void 0===o?void 0:o.app,s.appendI18nNamespace=n.get(e));const a=await r.resolveData({transform:"items",...e.itemsResolve},s);e.items=a.items}}(e,t,s,n))));for(const t of e){var a;if(null!==(a=t.items)&&void 0!==a&&a.length)if("inject"===t.type&&t.injectMenuGroupId){let e=i.get(t.injectMenuGroupId);e||(e=[],i.set(t.injectMenuGroupId,e)),e.push(t)}else o.push(t)}return{...r,items:o.flatMap((e=>Te(e.items,e,i,s))),[Me]:s.get(r),[Ce]:r.overrideApp}}function Te(e,t,n,r){return null==e?void 0:e.map((e=>{const o=e.groupId&&n.get(e.groupId);return o&&n.delete(e.groupId),{...e,children:(Te(e.children,t,n,r)??[]).concat(o?o.flatMap((e=>Te(e.items,e,n,r))):[]),[Oe]:t.app[0].appId,[Me]:r.get(t),[Ce]:t.overrideApp}}))}function Ne(e){e.items=$e(e.items)}function $e(e){return function(e){return(0,p.sortBy)(e,(e=>e.sort??-1/0))}(e).map((e=>({...e,children:$e(e.children)})))}var je=n(5575),Re=n(6974);function De(e,t,n,r){if("titleDataSource"in e&&(0,re.isObject)(e.titleDataSource)&&Object.entries(e.titleDataSource).every((e=>{let[,t]=e;return null===t||""===t}))&&delete e.titleDataSource,"if"in e&&null===e.if&&delete e.if,"to"in e&&e.to&&!(0,Re.isEvaluable)(e.to)){const t=je.pipes.yaml(e.to);(0,re.isObject)(t)&&["pathname","search","hash"].some((e=>(0,re.hasOwnProperty)(t,e)))&&(e.to=t)}let o=n;if(t!==n.app.id){var i;const s=window.STANDALONE_MICRO_APPS?e[Ce]:null===(i=r.getStoryboardByAppId(t))||void 0===i?void 0:i.app;o={...n,overrideApp:s,appendI18nNamespace:e[Me]}}return r.asyncComputeRealValue(e,o,{ignoreSymbols:!0})}function We(e,t,n){return Promise.all(e.map((async e=>{let{children:r,...o}=e;const[i,s]=await Promise.all([De(o,o[Oe],t,n),r&&await We(r,t,n)]);return{...i,children:s}})))}var xe=function(){var e=(0,d.A)((function*(e,t,n,r){return(yield f.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(e,"/instance/").concat(t),(0,Ee.A)((0,Ee.A)({},r),{},{params:n}))).data}));return function(t,n,r,o){return e.apply(this,arguments)}}();const Le=new Map;async function Ue(e){if(e.title||(0,p.isEmpty)(e.titleDataSource))return e.title;const t=JSON.stringify(e.titleDataSource),n=Le.get(t);if(void 0!==n)return n;const{objectId:r,instanceId:o,attributeId:i}=e.titleDataSource,s=i??"name",a=await xe(r,o,{fields:s});let c;if("#showKey"===i&&Array.isArray(a[s])){const[e,...t]=a[s];c=t.length>0?`${e}(${t.join(",")})`:String(e)}else c=String(a[s]);return Le.set(t,c),c}const Be=new Map,Fe=new Map;function qe(e){return null==e?void 0:e.filter(_.checkIfOfComputed).map((e=>{const t=qe(e.children);return"group"===e.type?{type:"group",title:e.text,childLayout:e.childLayout,items:t,groupId:e.groupId,groupFrom:e.groupFrom}:null!=t&&t.length?{type:"subMenu",childLayout:e.childLayout,title:e.text,icon:e.icon,items:t,defaultExpanded:e.defaultExpanded}:(0,p.omit)(e,["type","items","children"])}))}function ze(e){return Fe.get(e)}function He(e,t,n){let r=Be.get(e);return r||(r=async function(e,t,n){const r=window.STANDALONE_MICRO_APPS?function(e,t,n){var r,o;const i=n.getStoryboardByAppId(t);return((null===(r=i.meta)||void 0===r?void 0:r.injectMenus)??(null===(o=i.meta)||void 0===o?void 0:o.menus)??[]).filter((t=>t.menuId===e)).map((e=>{var n;return{...e,...null!==(n=e.app)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.appId?{}:{app:[{appId:t}]}}}))}(e,t.app.id,n):t.flags["three-level-menu-layout"]?(await ke(e,{menuObjectId:"EASYOPS_STORYBOARD_MENU"})).menus:(await Ie("EASYOPS_STORYBOARD_MENU",{page:1,page_size:200,fields:{menuId:!0,title:!0,icon:!0,link:!0,titleDataSource:!0,defaultCollapsed:!0,defaultCollapsedBreakpoint:!0,type:!0,injectMenuGroupId:!0,dynamicItems:!0,itemsResolve:!0,items:!0,i18n:!0,"items.children":!0,"app.appId":!0},query:{menuId:{$eq:e},app:{$size:{$gt:0}}}})).list,o=await _e(r,t,n);if(!o)throw new Error(`Menu not found: ${e}`);Ne(o);const{items:i,app:s,...a}=o,c={...t,pendingPermissionsPreCheck:[...t.pendingPermissionsPreCheck,b([i,a])]};delete c.tplStateStoreId,delete c.forEachItem,delete c.forEachIndex;const u=s[0].appId,[l,d]=await Promise.all([De(a,u,c,n),We(i,c,n)]),f={title:await Ue(l),...(0,p.pick)(l,["icon","link","defaultCollapsed","defaultCollapsedBreakpoint"]),menuItems:qe(d)};Fe.set(e,f)}(e,t,n)),r}const Ge=[];let Je=null;const Ve={maxWaitingTime:5e3,maxLoggedEvents:10};function Ye(){clearTimeout(Je),Ge.length>Ve.maxLoggedEvents?Ke():Je=setTimeout(Ke,Ve.maxWaitingTime)}function Ke(){if(0===Ge.length)return;const e={model:"easyops.FRONTEND_STAT",columns:["_ver","st","et","lt","size","time","traceId","code","duration","page","uid","username","api","type","msg","status","pageId","route","apiCount","maxApiTimeCost","apiSizeCost","pageTitle"],data:Ge.splice(0,Ve.maxLoggedEvents)};var t;!function(e,t){const n=new Blob([JSON.stringify(t)],{type:"application/json"});window.navigator.sendBeacon(e,n)}(Ve.api,e),Ge.length&&(t=Ke,(window.requestIdleCallback||window.requestAnimationFrame||(e=>setTimeout(e,17)))(t))}function Qe(){window.addEventListener("beforeunload",Ke,!1)}let Xe,Ze=!1,et=null,tt=!0;const nt=[];function rt(e){Ze||(Ze=!0,Xe||(Xe=function(e,t){return Object.assign(Ve,{...t,api:e}),{sendOnExit:Qe,emit:Ye}}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),Xe.sendOnExit()))}const ot=Symbol("HttpAnalytics");function it(e){const t=Math.round(performance.now()),n=Date.now();return e[ot]={st:n,time:Math.round(n/1e3),perfStartTime:t},e}function st(e,t){return ct(!1,e,t)}function at(e,t){return ct(!0,e,t)}function ct(e,t,n){const r=Math.round(performance.now()),o=Date.now(),{[ot]:i,url:s}=n;if(i&&!(e&&t instanceof f.HttpAbortError)){delete n[ot];const{st:c,time:u,perfStartTime:p}=i,{userInstanceId:l,username:d}=A();let h,m,g,v,w,y,S;if(e){const e=t instanceof f.HttpResponseError;(e||t instanceof f.HttpParseError)&&(({status:w,headers:y}=t.response),e&&(S=t.responseJson))}else({status:w,data:S,headers:y}=t);(0,re.isObject)(S)&&({code:h,message:m}=S),y instanceof Headers&&(g=y.get("x-b3-traceid"),v=y.get("content-length")),a={st:c,_ver:c,uid:l,username:d,time:u,et:o,page:location.href,duration:r-p,api:s,type:"api",code:h??-1,msg:m??"",status:w,traceId:g??"",size:v?Number(v):-1},et?Ge.push({...a,type:"apiRequest",...et}):nt.push(a)}var a;return e?Promise.reject(t):t}function ut(){const e=Math.round(performance.now()),t=Date.now();return nt.length=0,et=null,function(n){let{status:r,path:o,pageTitle:i}=n;if("ok"!==r)return Ge.push(...nt),void(nt.length=0);const s=Math.round(performance.now())-e,a=Date.now(),{username:c}=A();(function(e){const t=function(){const e=URL.createObjectURL(new Blob([]));let t=e.substring(e.lastIndexOf("/")+1);return URL.revokeObjectURL(e),tt&&(t="88-"+t,tt=!1),t}(),{lt:n,route:r}=e;et={lt:n,route:r,pageId:t},Ge.push({...e,pageId:t,apiCount:nt.length,maxApiTimeCost:Math.max(0,...nt.map((e=>e.duration))),size:nt.map((e=>e.size)).filter((e=>e>0)).reduce(((e,t)=>e+t),0)});for(const e of nt)Ge.push({...e,...et});nt.length=0,Xe.emit()})({type:"page",page:location.href,_ver:t,time:Math.round(t/1e3),st:t,et:a,lt:s,pageTitle:i,username:c,route:o}),window.dispatchEvent(new CustomEvent("route.render",{detail:{renderTime:s}}))}}const pt=Object.freeze({checkPermissions:function(){if(!w())return!1;if(A().isAdmin)return!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const e of t)switch(S.get(e)){case"unauthorized":case"undefined":return!1;case void 0:return console.error(`Un-checked permission action: "${e}", please make sure the permission to check is defined in permissionsPreCheck.`),!1}return!0},preCheckPermissions:function(e){if(w()&&!A().isAdmin)return I((0,l.scanPermissionActionsInStoryboard)(e))},preCheckPermissionsForBrickOrRoute:async function(e,t){if(w()&&!A().isAdmin&&Array.isArray(e.permissionsPreCheck))return I(await t(e.permissionsPreCheck))}}),lt=new class{constructor(){(0,E.A)(this,J),(0,k.A)(this,z,void 0),(0,k.A)(this,H,{sub:new Map,unsub:new Map}),(0,k.A)(this,G,new Map)}subscribe(e,t){const n=JSON.stringify(t);return(0,O.A)(J,this,Y).call(this,"sub",e,t,n)}unsubscribe(e){const t=(0,C.A)(G,this).get(e);if(!t){const t=`The message channel to unsubscribe "${e}" is not found`;return console.error(t),Promise.reject(new Error(t))}const n=JSON.parse(t),r=(0,O.A)(J,this,Y).call(this,"unsub",e,n,t);return(0,C.A)(H,this).sub.delete(t),r.then((()=>{(0,C.A)(G,this).delete(e)})),r}onMessage(e,t){let n=(0,C.A)(G,this).get(e),r=!1;(0,P.A)(J,this,V).onMessage((o=>{n||(n=(0,C.A)(G,this).get(e)),n?"MESSAGE.PUSH"===o.event&&function(e,t){const n=JSON.parse(e);return n.system===t.system&&(n.topic===t.topic||"string"==typeof n.topic&&n.topic.includes("*")&&new RegExp(`^${n.topic.replace(/([^*]*)\*([^*]*)/g,((e,t,n)=>`${(0,p.escapeRegExp)(t)}[^/]*${(0,p.escapeRegExp)(n)}`))}$`).test(t.topic))}(n,o.payload)&&t(o.payload.message):r||(console.error(`Message channel: "${e}" not found`),r=!0)}))}onClose(e){(0,P.A)(J,this,V).onClose(e)}reset(){var e;(0,C.A)(H,this).sub.clear(),(0,C.A)(H,this).unsub.clear(),(0,C.A)(G,this).clear(),null===(e=(0,C.A)(z,this))||void 0===e||e.reset()}},dt=function(){const e=(0,_.getV2RuntimeFromDll)();if(e)return Object.freeze((0,p.pick)(e,["authenticate","getAuth","isLoggedIn","logout"]))}()||r}}]);
|
|
3
|
-
//# sourceMappingURL=2252.779b6b84.js.map
|