amis-editor-core 6.9.0-rc.9 → 6.9.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/esm/component/Editor.d.ts +0 -3
- package/esm/index.d.ts +1 -4
- package/esm/index.js +2 -2
- package/esm/manager.d.ts +2 -13
- package/esm/plugin.d.ts +0 -4
- package/esm/store/editor.d.ts +36 -25
- package/lib/component/Editor.d.ts +0 -3
- package/lib/editor.js +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.js +2 -2
- package/lib/manager.d.ts +2 -13
- package/lib/plugin.d.ts +0 -4
- package/lib/store/editor.d.ts +36 -25
- package/package.json +3 -4
- package/esm/component/ModalForm.d.ts +0 -25
- package/esm/deepSplice.d.ts +0 -12
- package/lib/component/ModalForm.d.ts +0 -25
- package/lib/deepSplice.d.ts +0 -12
package/lib/manager.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { EditorDNDManager } from './dnd';
|
|
|
10
10
|
import { VariableManager } from './variable';
|
|
11
11
|
import type { IScopedContext } from 'amis';
|
|
12
12
|
import type { SchemaObject, SchemaCollection } from 'amis';
|
|
13
|
-
import type {
|
|
13
|
+
import type { RendererConfig } from 'amis-core';
|
|
14
14
|
export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
|
|
15
15
|
}
|
|
16
16
|
export interface PluginClass {
|
|
@@ -61,7 +61,6 @@ export declare class EditorManager {
|
|
|
61
61
|
dataSchema: DataSchema;
|
|
62
62
|
/** 变量管理 */
|
|
63
63
|
readonly variableManager: VariableManager;
|
|
64
|
-
fetch?: (api: Api, data?: any, options?: object) => Promise<Payload>;
|
|
65
64
|
constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
|
|
66
65
|
normalizeScene(plugins?: Array<PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)]>): (PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)])[];
|
|
67
66
|
dynamicAddPlugin(pluginName: string): void;
|
|
@@ -441,11 +440,6 @@ export declare class EditorManager {
|
|
|
441
440
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
442
441
|
calculateHighlightBox(root?: any): void;
|
|
443
442
|
resetHighlightBox(root: any): void;
|
|
444
|
-
/**
|
|
445
|
-
* 显示插入面板
|
|
446
|
-
* @param region
|
|
447
|
-
* @param preferTag
|
|
448
|
-
*/
|
|
449
443
|
updateState(state: any, replace?: boolean): void;
|
|
450
444
|
setWidthMutable(value: any): void;
|
|
451
445
|
setHeightMutable(value: any): void;
|
|
@@ -823,11 +817,6 @@ export declare class EditorManager {
|
|
|
823
817
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
824
818
|
calculateHighlightBox(root?: any): void;
|
|
825
819
|
resetHighlightBox(root: any): void;
|
|
826
|
-
/**
|
|
827
|
-
* 显示插入面板
|
|
828
|
-
* @param region
|
|
829
|
-
* @param preferTag
|
|
830
|
-
*/
|
|
831
820
|
updateState(state: any, replace?: boolean): void;
|
|
832
821
|
setWidthMutable(value: any): void;
|
|
833
822
|
setHeightMutable(value: any): void;
|
|
@@ -1050,7 +1039,7 @@ export declare class EditorManager {
|
|
|
1050
1039
|
toggleSelection(id: string): void;
|
|
1051
1040
|
setSelection(selections: Array<string>, id?: string): void;
|
|
1052
1041
|
startDrag(id: string, e: React.DragEvent): void;
|
|
1053
|
-
scaffold(form:
|
|
1042
|
+
scaffold(form: any, value: any): Promise<SchemaObject>;
|
|
1054
1043
|
reScaffold(id: string, form: ScaffoldForm, value: any): Promise<void>;
|
|
1055
1044
|
reScaffoldV2(id: string): Promise<void>;
|
|
1056
1045
|
lazyPatchSchema: import("lodash").DebouncedFunc<any>;
|
package/lib/plugin.d.ts
CHANGED
|
@@ -243,14 +243,11 @@ export interface PopOverForm {
|
|
|
243
243
|
* @deprecated 改用 body 代替
|
|
244
244
|
*/
|
|
245
245
|
controls?: Array<any>;
|
|
246
|
-
initApi?: any;
|
|
247
|
-
api?: any;
|
|
248
246
|
}
|
|
249
247
|
export interface ScaffoldForm extends PopOverForm {
|
|
250
248
|
stepsBody?: boolean;
|
|
251
249
|
/** 是否可跳过创建向导直接创建 */
|
|
252
250
|
canSkip?: boolean;
|
|
253
|
-
getSchema?: (value: any) => PopOverForm | Promise<PopOverForm>;
|
|
254
251
|
mode?: 'normal' | 'horizontal' | 'inline' | {
|
|
255
252
|
mode: string;
|
|
256
253
|
horizontal: any;
|
|
@@ -339,7 +336,6 @@ export interface PanelProps {
|
|
|
339
336
|
manager: EditorManager;
|
|
340
337
|
popOverContainer?: () => HTMLElement | void;
|
|
341
338
|
readonly?: boolean;
|
|
342
|
-
children?: React.ReactNode | ((props: PanelProps) => React.ReactNode);
|
|
343
339
|
}
|
|
344
340
|
/**
|
|
345
341
|
* 面板信息定义
|
package/lib/store/editor.d.ts
CHANGED
|
@@ -50,13 +50,6 @@ export interface PopOverFormContext extends PopOverForm {
|
|
|
50
50
|
callback: (value: any, diff: any) => void;
|
|
51
51
|
node?: EditorNodeType;
|
|
52
52
|
}
|
|
53
|
-
export interface ModalFormContext extends PopOverForm {
|
|
54
|
-
mode?: 'dialog' | 'drawer';
|
|
55
|
-
size?: string;
|
|
56
|
-
postion?: string;
|
|
57
|
-
value: any;
|
|
58
|
-
callback: (value: any, diff: any) => void;
|
|
59
|
-
}
|
|
60
53
|
/**
|
|
61
54
|
* 搜集的 name 信息
|
|
62
55
|
*/
|
|
@@ -447,7 +440,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
447
440
|
updateSchemaStyle(value: any): void;
|
|
448
441
|
setComponent(value: any): void;
|
|
449
442
|
getComponent(): any;
|
|
450
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
443
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
444
|
+
* 根据当前分类和关键字获取预置组件
|
|
445
|
+
* 备注:组件面板展示需要
|
|
446
|
+
*/
|
|
451
447
|
calculateHighlightBox(root?: any): void;
|
|
452
448
|
resetHighlightBox(root: any): void;
|
|
453
449
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -506,10 +502,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
506
502
|
scaffoldFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
507
503
|
scaffoldError: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
508
504
|
popOverForm: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<PopOverFormContext, PopOverFormContext, PopOverFormContext>>;
|
|
509
|
-
modalForm: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<ModalFormContext, ModalFormContext, ModalFormContext>>;
|
|
510
|
-
modalMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
511
|
-
modalFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
512
|
-
modalFormError: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
513
505
|
subEditorContext: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<SubEditorContext, SubEditorContext, SubEditorContext>>;
|
|
514
506
|
superEditorData: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<any, any, any>>;
|
|
515
507
|
calculateStarted: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -523,7 +515,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
523
515
|
readonly filteredSchema: any;
|
|
524
516
|
readonly filteredSchemaForPreview: any;
|
|
525
517
|
isRootSchema(id: string): boolean;
|
|
526
|
-
readonly rootId: any;
|
|
527
518
|
getRootId(): any;
|
|
528
519
|
isHoved(id: string): boolean | "";
|
|
529
520
|
isActive(id: string): boolean | "";
|
|
@@ -904,7 +895,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
904
895
|
updateSchemaStyle(value: any): void;
|
|
905
896
|
setComponent(value: any): void;
|
|
906
897
|
getComponent(): any;
|
|
907
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
898
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
899
|
+
* 根据当前分类和关键字获取预置组件
|
|
900
|
+
* 备注:组件面板展示需要
|
|
901
|
+
*/
|
|
908
902
|
calculateHighlightBox(root?: any): void;
|
|
909
903
|
resetHighlightBox(root: any): void;
|
|
910
904
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1281,7 +1275,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1281
1275
|
updateSchemaStyle(value: any): void;
|
|
1282
1276
|
setComponent(value: any): void;
|
|
1283
1277
|
getComponent(): any;
|
|
1284
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1278
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
1279
|
+
* 根据当前分类和关键字获取预置组件
|
|
1280
|
+
* 备注:组件面板展示需要
|
|
1281
|
+
*/
|
|
1285
1282
|
calculateHighlightBox(root?: any): void;
|
|
1286
1283
|
resetHighlightBox(root: any): void;
|
|
1287
1284
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1681,7 +1678,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1681
1678
|
updateSchemaStyle(value: any): void;
|
|
1682
1679
|
setComponent(value: any): void;
|
|
1683
1680
|
getComponent(): any;
|
|
1684
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1681
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
1682
|
+
* 根据当前分类和关键字获取预置组件
|
|
1683
|
+
* 备注:组件面板展示需要
|
|
1684
|
+
*/
|
|
1685
1685
|
calculateHighlightBox(root?: any): void;
|
|
1686
1686
|
resetHighlightBox(root: any): void;
|
|
1687
1687
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2058,7 +2058,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2058
2058
|
updateSchemaStyle(value: any): void;
|
|
2059
2059
|
setComponent(value: any): void;
|
|
2060
2060
|
getComponent(): any;
|
|
2061
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2061
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
2062
|
+
* 根据当前分类和关键字获取预置组件
|
|
2063
|
+
* 备注:组件面板展示需要
|
|
2064
|
+
*/
|
|
2062
2065
|
calculateHighlightBox(root?: any): void;
|
|
2063
2066
|
resetHighlightBox(root: any): void;
|
|
2064
2067
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2436,7 +2439,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2436
2439
|
updateSchemaStyle(value: any): void;
|
|
2437
2440
|
setComponent(value: any): void;
|
|
2438
2441
|
getComponent(): any;
|
|
2439
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2442
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
2443
|
+
* 根据当前分类和关键字获取预置组件
|
|
2444
|
+
* 备注:组件面板展示需要
|
|
2445
|
+
*/
|
|
2440
2446
|
calculateHighlightBox(root?: any): void;
|
|
2441
2447
|
resetHighlightBox(root: any): void;
|
|
2442
2448
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2813,7 +2819,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2813
2819
|
updateSchemaStyle(value: any): void;
|
|
2814
2820
|
setComponent(value: any): void;
|
|
2815
2821
|
getComponent(): any;
|
|
2816
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2822
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
2823
|
+
* 根据当前分类和关键字获取预置组件
|
|
2824
|
+
* 备注:组件面板展示需要
|
|
2825
|
+
*/
|
|
2817
2826
|
calculateHighlightBox(root?: any): void;
|
|
2818
2827
|
resetHighlightBox(root: any): void;
|
|
2819
2828
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3191,7 +3200,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3191
3200
|
updateSchemaStyle(value: any): void;
|
|
3192
3201
|
setComponent(value: any): void;
|
|
3193
3202
|
getComponent(): any;
|
|
3194
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3203
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
3204
|
+
* 根据当前分类和关键字获取预置组件
|
|
3205
|
+
* 备注:组件面板展示需要
|
|
3206
|
+
*/
|
|
3195
3207
|
calculateHighlightBox(root?: any): void;
|
|
3196
3208
|
resetHighlightBox(root: any): void;
|
|
3197
3209
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3568,7 +3580,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3568
3580
|
updateSchemaStyle(value: any): void;
|
|
3569
3581
|
setComponent(value: any): void;
|
|
3570
3582
|
getComponent(): any;
|
|
3571
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3583
|
+
getTarget(): HTMLElement | HTMLElement[] | null; /**
|
|
3584
|
+
* 根据当前分类和关键字获取预置组件
|
|
3585
|
+
* 备注:组件面板展示需要
|
|
3586
|
+
*/
|
|
3572
3587
|
calculateHighlightBox(root?: any): void;
|
|
3573
3588
|
resetHighlightBox(root: any): void;
|
|
3574
3589
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3735,10 +3750,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3735
3750
|
updateScaffoldData(value: any, replace?: boolean): void;
|
|
3736
3751
|
openPopOverForm(context: PopOverFormContext): void;
|
|
3737
3752
|
closePopOverForm(): void;
|
|
3738
|
-
openModalForm(context: ModalFormContext): void;
|
|
3739
|
-
closeModalForm(): void;
|
|
3740
|
-
markModalFormBuzy(value: any): void;
|
|
3741
|
-
setModalFormError(msg?: string): void;
|
|
3742
3753
|
activeHighlightNodes(ids: Array<string>): void;
|
|
3743
3754
|
deActiveHighlightNodes(ids: Array<string>): void;
|
|
3744
3755
|
calculateHighlightBox(ids?: Array<string>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amis-editor-core",
|
|
3
|
-
"version": "6.9.0
|
|
3
|
+
"version": "6.9.0",
|
|
4
4
|
"description": "amis 可视化编辑器",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "echo \"Warnings: no test specified\"",
|
|
30
|
-
"build": "npm run clean-dist &&
|
|
31
|
-
"build-esm": "npm run clean-dist &&
|
|
30
|
+
"build": "npm run clean-dist && NODE_ENV=production rollup -c",
|
|
31
|
+
"build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
|
|
32
32
|
"clean-dist": "rimraf lib/* esm/*",
|
|
33
33
|
"i18n:update": "npx i18n update --config=./i18nConfig.js",
|
|
34
34
|
"i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US",
|
|
@@ -84,7 +84,6 @@
|
|
|
84
84
|
"ajv": "^8.8.2",
|
|
85
85
|
"autoprefixer": "^10.4.12",
|
|
86
86
|
"concurrently": "^6.2.0",
|
|
87
|
-
"cross-env": "^7.0.3",
|
|
88
87
|
"css-loader": "^6.2.0",
|
|
89
88
|
"faker": "^5.5.3",
|
|
90
89
|
"i18n-command": "^0.0.23-beta.15",
|
|
@@ -1,25 +0,0 @@
|
|
|
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;
|
|
25
|
-
}
|
package/esm/deepSplice.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 深度 splice 数组,同时返回新的对象,按需拷贝,没有副作用
|
|
3
|
-
*
|
|
4
|
-
* 第二个参数可以是一个函数,函数的返回值不为 false 时,表示找到了目标,函数的返回值为 number 时,表示偏移量
|
|
5
|
-
*
|
|
6
|
-
* @param target
|
|
7
|
-
* @param path
|
|
8
|
-
* @param numberToDelete
|
|
9
|
-
* @param items
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare function deepSplice(target: any, path: string | ((value: any, index: number | string, stack: Array<any>) => any), numberToDelete: number, provider?: ((origin: any) => any) | any, ...items: any[]): any;
|
|
@@ -1,25 +0,0 @@
|
|
|
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;
|
|
25
|
-
}
|
package/lib/deepSplice.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 深度 splice 数组,同时返回新的对象,按需拷贝,没有副作用
|
|
3
|
-
*
|
|
4
|
-
* 第二个参数可以是一个函数,函数的返回值不为 false 时,表示找到了目标,函数的返回值为 number 时,表示偏移量
|
|
5
|
-
*
|
|
6
|
-
* @param target
|
|
7
|
-
* @param path
|
|
8
|
-
* @param numberToDelete
|
|
9
|
-
* @param items
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare function deepSplice(target: any, path: string | ((value: any, index: number | string, stack: Array<any>) => any), numberToDelete: number, provider?: ((origin: any) => any) | any, ...items: any[]): any;
|