amis-editor-core 6.9.0 → 6.10.0-beta.1
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 +5 -1
- package/esm/component/ModalForm.d.ts +25 -0
- package/esm/deepSplice.d.ts +12 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.js +2 -2
- package/esm/manager.d.ts +13 -2
- package/esm/plugin.d.ts +13 -0
- package/esm/store/editor.d.ts +25 -36
- package/lib/component/Editor.d.ts +5 -1
- package/lib/component/ModalForm.d.ts +25 -0
- package/lib/component/base/BackTop.d.ts +1 -1
- package/lib/deepSplice.d.ts +12 -0
- package/lib/editor.js +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +2 -2
- package/lib/layout/flex.d.ts +0 -1
- package/lib/manager.d.ts +13 -2
- package/lib/plugin.d.ts +13 -0
- package/lib/store/editor.d.ts +25 -36
- package/lib/style.css +1 -1
- package/package.json +4 -4
package/lib/layout/flex.d.ts
CHANGED
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 { RendererConfig } from 'amis-core';
|
|
13
|
+
import type { Api, Payload, RendererConfig } from 'amis-core';
|
|
14
14
|
export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
|
|
15
15
|
}
|
|
16
16
|
export interface PluginClass {
|
|
@@ -61,6 +61,7 @@ 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>;
|
|
64
65
|
constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
|
|
65
66
|
normalizeScene(plugins?: Array<PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)]>): (PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)])[];
|
|
66
67
|
dynamicAddPlugin(pluginName: string): void;
|
|
@@ -440,6 +441,11 @@ export declare class EditorManager {
|
|
|
440
441
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
441
442
|
calculateHighlightBox(root?: any): void;
|
|
442
443
|
resetHighlightBox(root: any): void;
|
|
444
|
+
/**
|
|
445
|
+
* 显示插入面板
|
|
446
|
+
* @param region
|
|
447
|
+
* @param preferTag
|
|
448
|
+
*/
|
|
443
449
|
updateState(state: any, replace?: boolean): void;
|
|
444
450
|
setWidthMutable(value: any): void;
|
|
445
451
|
setHeightMutable(value: any): void;
|
|
@@ -817,6 +823,11 @@ export declare class EditorManager {
|
|
|
817
823
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
818
824
|
calculateHighlightBox(root?: any): void;
|
|
819
825
|
resetHighlightBox(root: any): void;
|
|
826
|
+
/**
|
|
827
|
+
* 显示插入面板
|
|
828
|
+
* @param region
|
|
829
|
+
* @param preferTag
|
|
830
|
+
*/
|
|
820
831
|
updateState(state: any, replace?: boolean): void;
|
|
821
832
|
setWidthMutable(value: any): void;
|
|
822
833
|
setHeightMutable(value: any): void;
|
|
@@ -1039,7 +1050,7 @@ export declare class EditorManager {
|
|
|
1039
1050
|
toggleSelection(id: string): void;
|
|
1040
1051
|
setSelection(selections: Array<string>, id?: string): void;
|
|
1041
1052
|
startDrag(id: string, e: React.DragEvent): void;
|
|
1042
|
-
scaffold(form:
|
|
1053
|
+
scaffold(form: ScaffoldForm, value: any): Promise<SchemaObject>;
|
|
1043
1054
|
reScaffold(id: string, form: ScaffoldForm, value: any): Promise<void>;
|
|
1044
1055
|
reScaffoldV2(id: string): Promise<void>;
|
|
1045
1056
|
lazyPatchSchema: import("lodash").DebouncedFunc<any>;
|
package/lib/plugin.d.ts
CHANGED
|
@@ -243,11 +243,14 @@ export interface PopOverForm {
|
|
|
243
243
|
* @deprecated 改用 body 代替
|
|
244
244
|
*/
|
|
245
245
|
controls?: Array<any>;
|
|
246
|
+
initApi?: any;
|
|
247
|
+
api?: any;
|
|
246
248
|
}
|
|
247
249
|
export interface ScaffoldForm extends PopOverForm {
|
|
248
250
|
stepsBody?: boolean;
|
|
249
251
|
/** 是否可跳过创建向导直接创建 */
|
|
250
252
|
canSkip?: boolean;
|
|
253
|
+
getSchema?: (value: any) => PopOverForm | Promise<PopOverForm>;
|
|
251
254
|
mode?: 'normal' | 'horizontal' | 'inline' | {
|
|
252
255
|
mode: string;
|
|
253
256
|
horizontal: any;
|
|
@@ -336,6 +339,7 @@ export interface PanelProps {
|
|
|
336
339
|
manager: EditorManager;
|
|
337
340
|
popOverContainer?: () => HTMLElement | void;
|
|
338
341
|
readonly?: boolean;
|
|
342
|
+
children?: React.ReactNode | ((props: PanelProps) => React.ReactNode);
|
|
339
343
|
}
|
|
340
344
|
/**
|
|
341
345
|
* 面板信息定义
|
|
@@ -379,6 +383,15 @@ export interface RendererInfoResolveEventContext extends EventContext {
|
|
|
379
383
|
export interface RendererJSONSchemaResolveEventContext extends BaseEventContext {
|
|
380
384
|
data: string;
|
|
381
385
|
}
|
|
386
|
+
export interface IGlobalEvent {
|
|
387
|
+
label: string;
|
|
388
|
+
name: string;
|
|
389
|
+
description: string;
|
|
390
|
+
mapping: Array<{
|
|
391
|
+
key: string;
|
|
392
|
+
type: string;
|
|
393
|
+
}>;
|
|
394
|
+
}
|
|
382
395
|
/**
|
|
383
396
|
* 右键菜单事件的上下文。
|
|
384
397
|
*/
|
package/lib/store/editor.d.ts
CHANGED
|
@@ -50,6 +50,13 @@ 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
|
+
}
|
|
53
60
|
/**
|
|
54
61
|
* 搜集的 name 信息
|
|
55
62
|
*/
|
|
@@ -440,10 +447,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
440
447
|
updateSchemaStyle(value: any): void;
|
|
441
448
|
setComponent(value: any): void;
|
|
442
449
|
getComponent(): any;
|
|
443
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
444
|
-
* 根据当前分类和关键字获取预置组件
|
|
445
|
-
* 备注:组件面板展示需要
|
|
446
|
-
*/
|
|
450
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
447
451
|
calculateHighlightBox(root?: any): void;
|
|
448
452
|
resetHighlightBox(root: any): void;
|
|
449
453
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -502,6 +506,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
502
506
|
scaffoldFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
503
507
|
scaffoldError: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
504
508
|
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>;
|
|
505
513
|
subEditorContext: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<SubEditorContext, SubEditorContext, SubEditorContext>>;
|
|
506
514
|
superEditorData: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<any, any, any>>;
|
|
507
515
|
calculateStarted: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -515,6 +523,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
515
523
|
readonly filteredSchema: any;
|
|
516
524
|
readonly filteredSchemaForPreview: any;
|
|
517
525
|
isRootSchema(id: string): boolean;
|
|
526
|
+
readonly rootId: any;
|
|
518
527
|
getRootId(): any;
|
|
519
528
|
isHoved(id: string): boolean | "";
|
|
520
529
|
isActive(id: string): boolean | "";
|
|
@@ -895,10 +904,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
895
904
|
updateSchemaStyle(value: any): void;
|
|
896
905
|
setComponent(value: any): void;
|
|
897
906
|
getComponent(): any;
|
|
898
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
899
|
-
* 根据当前分类和关键字获取预置组件
|
|
900
|
-
* 备注:组件面板展示需要
|
|
901
|
-
*/
|
|
907
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
902
908
|
calculateHighlightBox(root?: any): void;
|
|
903
909
|
resetHighlightBox(root: any): void;
|
|
904
910
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1275,10 +1281,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1275
1281
|
updateSchemaStyle(value: any): void;
|
|
1276
1282
|
setComponent(value: any): void;
|
|
1277
1283
|
getComponent(): any;
|
|
1278
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1279
|
-
* 根据当前分类和关键字获取预置组件
|
|
1280
|
-
* 备注:组件面板展示需要
|
|
1281
|
-
*/
|
|
1284
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1282
1285
|
calculateHighlightBox(root?: any): void;
|
|
1283
1286
|
resetHighlightBox(root: any): void;
|
|
1284
1287
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -1678,10 +1681,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1678
1681
|
updateSchemaStyle(value: any): void;
|
|
1679
1682
|
setComponent(value: any): void;
|
|
1680
1683
|
getComponent(): any;
|
|
1681
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1682
|
-
* 根据当前分类和关键字获取预置组件
|
|
1683
|
-
* 备注:组件面板展示需要
|
|
1684
|
-
*/
|
|
1684
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
1685
1685
|
calculateHighlightBox(root?: any): void;
|
|
1686
1686
|
resetHighlightBox(root: any): void;
|
|
1687
1687
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2058,10 +2058,7 @@ 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;
|
|
2062
|
-
* 根据当前分类和关键字获取预置组件
|
|
2063
|
-
* 备注:组件面板展示需要
|
|
2064
|
-
*/
|
|
2061
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2065
2062
|
calculateHighlightBox(root?: any): void;
|
|
2066
2063
|
resetHighlightBox(root: any): void;
|
|
2067
2064
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2439,10 +2436,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2439
2436
|
updateSchemaStyle(value: any): void;
|
|
2440
2437
|
setComponent(value: any): void;
|
|
2441
2438
|
getComponent(): any;
|
|
2442
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2443
|
-
* 根据当前分类和关键字获取预置组件
|
|
2444
|
-
* 备注:组件面板展示需要
|
|
2445
|
-
*/
|
|
2439
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2446
2440
|
calculateHighlightBox(root?: any): void;
|
|
2447
2441
|
resetHighlightBox(root: any): void;
|
|
2448
2442
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -2819,10 +2813,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2819
2813
|
updateSchemaStyle(value: any): void;
|
|
2820
2814
|
setComponent(value: any): void;
|
|
2821
2815
|
getComponent(): any;
|
|
2822
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2823
|
-
* 根据当前分类和关键字获取预置组件
|
|
2824
|
-
* 备注:组件面板展示需要
|
|
2825
|
-
*/
|
|
2816
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
2826
2817
|
calculateHighlightBox(root?: any): void;
|
|
2827
2818
|
resetHighlightBox(root: any): void;
|
|
2828
2819
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3200,10 +3191,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3200
3191
|
updateSchemaStyle(value: any): void;
|
|
3201
3192
|
setComponent(value: any): void;
|
|
3202
3193
|
getComponent(): any;
|
|
3203
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3204
|
-
* 根据当前分类和关键字获取预置组件
|
|
3205
|
-
* 备注:组件面板展示需要
|
|
3206
|
-
*/
|
|
3194
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3207
3195
|
calculateHighlightBox(root?: any): void;
|
|
3208
3196
|
resetHighlightBox(root: any): void;
|
|
3209
3197
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3580,10 +3568,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3580
3568
|
updateSchemaStyle(value: any): void;
|
|
3581
3569
|
setComponent(value: any): void;
|
|
3582
3570
|
getComponent(): any;
|
|
3583
|
-
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3584
|
-
* 根据当前分类和关键字获取预置组件
|
|
3585
|
-
* 备注:组件面板展示需要
|
|
3586
|
-
*/
|
|
3571
|
+
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
3587
3572
|
calculateHighlightBox(root?: any): void;
|
|
3588
3573
|
resetHighlightBox(root: any): void;
|
|
3589
3574
|
updateState(state: any, replace?: boolean): void;
|
|
@@ -3750,6 +3735,10 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3750
3735
|
updateScaffoldData(value: any, replace?: boolean): void;
|
|
3751
3736
|
openPopOverForm(context: PopOverFormContext): void;
|
|
3752
3737
|
closePopOverForm(): void;
|
|
3738
|
+
openModalForm(context: ModalFormContext): void;
|
|
3739
|
+
closeModalForm(): void;
|
|
3740
|
+
markModalFormBuzy(value: any): void;
|
|
3741
|
+
setModalFormError(msg?: string): void;
|
|
3753
3742
|
activeHighlightNodes(ids: Array<string>): void;
|
|
3754
3743
|
deActiveHighlightNodes(ids: Array<string>): void;
|
|
3755
3744
|
calculateHighlightBox(ids?: Array<string>): void;
|