amis-editor-core 6.9.0-rc.2 → 6.9.0-rc.4
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/esm/component/Editor.d.ts +9 -1
- package/esm/component/ModalForm.d.ts +25 -0
- package/esm/component/Preview.d.ts +1 -0
- package/esm/index.js +2 -2
- package/esm/plugin.d.ts +2 -0
- package/esm/store/editor.d.ts +21 -36
- package/esm/util.d.ts +9 -0
- package/lib/component/Editor.d.ts +9 -1
- package/lib/component/ModalForm.d.ts +25 -0
- package/lib/component/Preview.d.ts +1 -0
- package/lib/editor.js +1 -1
- package/lib/index.js +2 -2
- package/lib/plugin.d.ts +2 -0
- package/lib/store/editor.d.ts +21 -36
- package/lib/style.css +1 -1
- package/lib/util.d.ts +9 -0
- package/package.json +1 -1
package/esm/plugin.d.ts
CHANGED
package/esm/store/editor.d.ts
CHANGED
|
@@ -51,6 +51,13 @@ export interface PopOverFormContext extends PopOverForm {
|
|
|
51
51
|
callback: (value: any, diff: any) => void;
|
|
52
52
|
node?: EditorNodeType;
|
|
53
53
|
}
|
|
54
|
+
export interface ModalFormContext extends PopOverForm {
|
|
55
|
+
mode?: 'dialog' | 'drawer';
|
|
56
|
+
size?: string;
|
|
57
|
+
postion?: string;
|
|
58
|
+
value: any;
|
|
59
|
+
callback: (value: any, diff: any) => void;
|
|
60
|
+
}
|
|
54
61
|
/**
|
|
55
62
|
* 搜集的 name 信息
|
|
56
63
|
*/
|
|
@@ -441,10 +448,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
441
448
|
updateSchemaStyle(value: any): void;
|
|
442
449
|
setComponent(value: any): void;
|
|
443
450
|
getComponent(): any;
|
|
444
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
445
|
-
* 根据当前分类和关键字获取预置组件
|
|
446
|
-
* 备注:组件面板展示需要
|
|
447
|
-
*/
|
|
451
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
448
452
|
calculateHighlightBox(root?: any): void;
|
|
449
453
|
resetHighlightBox(root: any): void;
|
|
450
454
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -503,6 +507,8 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
503
507
|
scaffoldFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
504
508
|
scaffoldError: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
505
509
|
popOverForm: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<PopOverFormContext, PopOverFormContext, PopOverFormContext>>;
|
|
510
|
+
modalForm: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<ModalFormContext, ModalFormContext, ModalFormContext>>;
|
|
511
|
+
modalFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
506
512
|
subEditorContext: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<SubEditorContext, SubEditorContext, SubEditorContext>>;
|
|
507
513
|
superEditorData: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<any, any, any>>;
|
|
508
514
|
calculateStarted: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -896,10 +902,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
896
902
|
updateSchemaStyle(value: any): void;
|
|
897
903
|
setComponent(value: any): void;
|
|
898
904
|
getComponent(): any;
|
|
899
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
900
|
-
* 根据当前分类和关键字获取预置组件
|
|
901
|
-
* 备注:组件面板展示需要
|
|
902
|
-
*/
|
|
905
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
903
906
|
calculateHighlightBox(root?: any): void;
|
|
904
907
|
resetHighlightBox(root: any): void;
|
|
905
908
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1276,10 +1279,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1276
1279
|
updateSchemaStyle(value: any): void;
|
|
1277
1280
|
setComponent(value: any): void;
|
|
1278
1281
|
getComponent(): any;
|
|
1279
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1280
|
-
* 根据当前分类和关键字获取预置组件
|
|
1281
|
-
* 备注:组件面板展示需要
|
|
1282
|
-
*/
|
|
1282
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1283
1283
|
calculateHighlightBox(root?: any): void;
|
|
1284
1284
|
resetHighlightBox(root: any): void;
|
|
1285
1285
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1679,10 +1679,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1679
1679
|
updateSchemaStyle(value: any): void;
|
|
1680
1680
|
setComponent(value: any): void;
|
|
1681
1681
|
getComponent(): any;
|
|
1682
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1683
|
-
* 根据当前分类和关键字获取预置组件
|
|
1684
|
-
* 备注:组件面板展示需要
|
|
1685
|
-
*/
|
|
1682
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1686
1683
|
calculateHighlightBox(root?: any): void;
|
|
1687
1684
|
resetHighlightBox(root: any): void;
|
|
1688
1685
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2059,10 +2056,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2059
2056
|
updateSchemaStyle(value: any): void;
|
|
2060
2057
|
setComponent(value: any): void;
|
|
2061
2058
|
getComponent(): any;
|
|
2062
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2063
|
-
* 根据当前分类和关键字获取预置组件
|
|
2064
|
-
* 备注:组件面板展示需要
|
|
2065
|
-
*/
|
|
2059
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2066
2060
|
calculateHighlightBox(root?: any): void;
|
|
2067
2061
|
resetHighlightBox(root: any): void;
|
|
2068
2062
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2440,10 +2434,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2440
2434
|
updateSchemaStyle(value: any): void;
|
|
2441
2435
|
setComponent(value: any): void;
|
|
2442
2436
|
getComponent(): any;
|
|
2443
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2444
|
-
* 根据当前分类和关键字获取预置组件
|
|
2445
|
-
* 备注:组件面板展示需要
|
|
2446
|
-
*/
|
|
2437
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2447
2438
|
calculateHighlightBox(root?: any): void;
|
|
2448
2439
|
resetHighlightBox(root: any): void;
|
|
2449
2440
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2820,10 +2811,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2820
2811
|
updateSchemaStyle(value: any): void;
|
|
2821
2812
|
setComponent(value: any): void;
|
|
2822
2813
|
getComponent(): any;
|
|
2823
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2824
|
-
* 根据当前分类和关键字获取预置组件
|
|
2825
|
-
* 备注:组件面板展示需要
|
|
2826
|
-
*/
|
|
2814
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2827
2815
|
calculateHighlightBox(root?: any): void;
|
|
2828
2816
|
resetHighlightBox(root: any): void;
|
|
2829
2817
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3201,10 +3189,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3201
3189
|
updateSchemaStyle(value: any): void;
|
|
3202
3190
|
setComponent(value: any): void;
|
|
3203
3191
|
getComponent(): any;
|
|
3204
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3205
|
-
* 根据当前分类和关键字获取预置组件
|
|
3206
|
-
* 备注:组件面板展示需要
|
|
3207
|
-
*/
|
|
3192
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3208
3193
|
calculateHighlightBox(root?: any): void;
|
|
3209
3194
|
resetHighlightBox(root: any): void;
|
|
3210
3195
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3581,10 +3566,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3581
3566
|
updateSchemaStyle(value: any): void;
|
|
3582
3567
|
setComponent(value: any): void;
|
|
3583
3568
|
getComponent(): any;
|
|
3584
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3585
|
-
* 根据当前分类和关键字获取预置组件
|
|
3586
|
-
* 备注:组件面板展示需要
|
|
3587
|
-
*/
|
|
3569
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3588
3570
|
calculateHighlightBox(root?: any): void;
|
|
3589
3571
|
resetHighlightBox(root: any): void;
|
|
3590
3572
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3751,6 +3733,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3751
3733
|
updateScaffoldData(value: any, replace?: boolean): void;
|
|
3752
3734
|
openPopOverForm(context: PopOverFormContext): void;
|
|
3753
3735
|
closePopOverForm(): void;
|
|
3736
|
+
openModalForm(context: ModalFormContext): void;
|
|
3737
|
+
closeModalForm(): void;
|
|
3738
|
+
markModalFormBuzy(value: any): void;
|
|
3754
3739
|
activeHighlightNodes(ids: Array<string>): void;
|
|
3755
3740
|
deActiveHighlightNodes(ids: Array<string>): void;
|
|
3756
3741
|
calculateHighlightBox(ids?: Array<string>): void;
|
package/esm/util.d.ts
CHANGED
|
@@ -199,6 +199,15 @@ export declare function modalsToDefinitions(modals: Array<EditorModalBody>, defi
|
|
|
199
199
|
export declare function mergeDefinitions(originSchema: any, definitions: any, modal: any): any;
|
|
200
200
|
export declare function setDefaultColSize(regionList: any[], row: number, preRow?: number): any[];
|
|
201
201
|
export declare function getModals(schema: any): (DialogSchema | DrawerSchema)[];
|
|
202
|
+
/**
|
|
203
|
+
* 深度 splice 数组,同时返回新的对象,按需拷贝,没有副作用
|
|
204
|
+
* @param target
|
|
205
|
+
* @param path
|
|
206
|
+
* @param numberToDelete
|
|
207
|
+
* @param items
|
|
208
|
+
* @returns
|
|
209
|
+
*/
|
|
210
|
+
export declare function deepSplice(target: any, path: string, numberToDelete: number, ...items: any[]): any;
|
|
202
211
|
export declare const RAW_TYPE_MAP: {
|
|
203
212
|
[k in SchemaType | 'user-select' | 'department-select']?: 'string' | 'number' | 'array' | 'boolean' | 'object' | 'enum' | 'date' | 'datetime' | 'time' | 'quarter' | 'year' | 'month' | 'user' | 'department';
|
|
204
213
|
};
|
|
@@ -92,10 +92,18 @@ export interface EditorProps extends PluginEventListener {
|
|
|
92
92
|
getAvaiableContextFields?: (node: EditorNodeType) => Promise<any>;
|
|
93
93
|
readonly?: boolean;
|
|
94
94
|
}
|
|
95
|
-
export default class Editor extends Component<EditorProps
|
|
95
|
+
export default class Editor extends Component<EditorProps, {
|
|
96
|
+
mobileDimensions: {
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
};
|
|
100
|
+
mobileScale: number;
|
|
101
|
+
}> {
|
|
96
102
|
readonly store: EditorStoreType;
|
|
97
103
|
readonly manager: EditorManager;
|
|
98
104
|
readonly mainRef: React.RefObject<HTMLDivElement>;
|
|
105
|
+
readonly mainPreviewRef: React.RefObject<HTMLDivElement>;
|
|
106
|
+
readonly mainPreviewBodyRef: React.RefObject<any>;
|
|
99
107
|
toDispose: Array<Function>;
|
|
100
108
|
lastResult: any;
|
|
101
109
|
curCopySchemaData: any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../manager';
|
|
3
|
+
import { EditorStoreType } from '../store/editor';
|
|
4
|
+
export interface ModalFormProps {
|
|
5
|
+
store: EditorStoreType;
|
|
6
|
+
manager: EditorManager;
|
|
7
|
+
theme?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ModalForm extends React.Component<ModalFormProps> {
|
|
10
|
+
handleConfirmClick(): Promise<void>;
|
|
11
|
+
amisScope: any;
|
|
12
|
+
scopeRef(scoped: any): void;
|
|
13
|
+
buildSchema(): {
|
|
14
|
+
type: string;
|
|
15
|
+
wrapWithPanel: boolean;
|
|
16
|
+
mode: string;
|
|
17
|
+
wrapperComponent: string;
|
|
18
|
+
initApi: any;
|
|
19
|
+
api: any;
|
|
20
|
+
body: any[];
|
|
21
|
+
submitOnChange: boolean;
|
|
22
|
+
autoFocus: boolean;
|
|
23
|
+
};
|
|
24
|
+
render(): React.JSX.Element | null;
|
|
25
|
+
}
|
package/lib/editor.js
CHANGED