amis-editor-core 6.9.0-rc.7 → 6.9.0-rc.8
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/deepSplice.d.ts +12 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/manager.d.ts +26 -16
- package/esm/store/editor.d.ts +3 -3
- package/esm/util.d.ts +3 -1
- package/lib/component/base/BackTop.d.ts +1 -1
- package/lib/deepSplice.d.ts +12 -0
- package/lib/dnd/flex.d.ts +1 -1
- package/lib/editor.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -2
- package/lib/manager.d.ts +26 -16
- package/lib/store/editor.d.ts +3 -3
- package/lib/util.d.ts +3 -1
- package/package.json +4 -3
package/esm/manager.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/// <reference types="lodash" />
|
|
3
3
|
import { DataSchema } from 'amis';
|
|
4
|
-
import {
|
|
4
|
+
import { RenderOptions } from 'amis-core';
|
|
5
|
+
import { PluginInterface, BasicPanelItem, RendererInfo, SubRendererInfo, PluginEvent, RegionConfig, ContextMenuItem, ContextMenuEventContext, EventContext, PluginEventFn, ScaffoldForm, RendererPluginEvent, PluginEvents, PluginActions } from './plugin';
|
|
5
6
|
import { EditorStoreType, SubEditorContext } from './store/editor';
|
|
6
7
|
import { EditorNodeType } from './store/node';
|
|
7
8
|
import { EditorProps } from './component/Editor';
|
|
@@ -9,7 +10,7 @@ import { EditorDNDManager } from './dnd';
|
|
|
9
10
|
import { VariableManager } from './variable';
|
|
10
11
|
import type { IScopedContext } from 'amis';
|
|
11
12
|
import type { SchemaObject, SchemaCollection } from 'amis';
|
|
12
|
-
import type {
|
|
13
|
+
import type { Api, Payload, RendererConfig } from 'amis-core';
|
|
13
14
|
export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
|
|
14
15
|
}
|
|
15
16
|
export interface PluginClass {
|
|
@@ -47,9 +48,7 @@ export declare class EditorManager {
|
|
|
47
48
|
readonly store: EditorStoreType;
|
|
48
49
|
readonly parent?: EditorManager | undefined;
|
|
49
50
|
readonly plugins: Array<PluginInterface>;
|
|
50
|
-
readonly env:
|
|
51
|
-
theme?: string;
|
|
52
|
-
};
|
|
51
|
+
readonly env: RenderOptions;
|
|
53
52
|
toDispose: Array<() => void>;
|
|
54
53
|
readonly dnd: EditorDNDManager;
|
|
55
54
|
readonly id: any;
|
|
@@ -62,6 +61,7 @@ export declare class EditorManager {
|
|
|
62
61
|
dataSchema: DataSchema;
|
|
63
62
|
/** 变量管理 */
|
|
64
63
|
readonly variableManager: VariableManager;
|
|
64
|
+
fetch?: (api: Api, data?: any, options?: object) => Promise<Payload>;
|
|
65
65
|
constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
|
|
66
66
|
normalizeScene(plugins?: Array<PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)]>): (PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)])[];
|
|
67
67
|
dynamicAddPlugin(pluginName: string): void;
|
|
@@ -105,7 +105,7 @@ export declare class EditorManager {
|
|
|
105
105
|
setRendererConfig(value: RendererConfig): void;
|
|
106
106
|
readonly isVitualRenderer: boolean;
|
|
107
107
|
readonly clickable: boolean;
|
|
108
|
-
readonly draggable: boolean;
|
|
108
|
+
readonly draggable: boolean;
|
|
109
109
|
readonly moveable: boolean;
|
|
110
110
|
readonly canMoveUp: boolean;
|
|
111
111
|
readonly canMoveDown: boolean;
|
|
@@ -169,7 +169,7 @@ export declare class EditorManager {
|
|
|
169
169
|
setRendererConfig(value: RendererConfig): void;
|
|
170
170
|
readonly isVitualRenderer: boolean;
|
|
171
171
|
readonly clickable: boolean;
|
|
172
|
-
readonly draggable: boolean;
|
|
172
|
+
readonly draggable: boolean;
|
|
173
173
|
readonly moveable: boolean;
|
|
174
174
|
readonly canMoveUp: boolean;
|
|
175
175
|
readonly canMoveDown: boolean;
|
|
@@ -232,7 +232,7 @@ export declare class EditorManager {
|
|
|
232
232
|
setRendererConfig(value: RendererConfig): void;
|
|
233
233
|
readonly isVitualRenderer: boolean;
|
|
234
234
|
readonly clickable: boolean;
|
|
235
|
-
readonly draggable: boolean;
|
|
235
|
+
readonly draggable: boolean;
|
|
236
236
|
readonly moveable: boolean;
|
|
237
237
|
readonly canMoveUp: boolean;
|
|
238
238
|
readonly canMoveDown: boolean;
|
|
@@ -322,7 +322,7 @@ export declare class EditorManager {
|
|
|
322
322
|
setRendererConfig(value: RendererConfig): void;
|
|
323
323
|
readonly isVitualRenderer: boolean;
|
|
324
324
|
readonly clickable: boolean;
|
|
325
|
-
readonly draggable: boolean;
|
|
325
|
+
readonly draggable: boolean;
|
|
326
326
|
readonly moveable: boolean;
|
|
327
327
|
readonly canMoveUp: boolean;
|
|
328
328
|
readonly canMoveDown: boolean;
|
|
@@ -385,7 +385,7 @@ export declare class EditorManager {
|
|
|
385
385
|
setRendererConfig(value: RendererConfig): void;
|
|
386
386
|
readonly isVitualRenderer: boolean;
|
|
387
387
|
readonly clickable: boolean;
|
|
388
|
-
readonly draggable: boolean;
|
|
388
|
+
readonly draggable: boolean;
|
|
389
389
|
readonly moveable: boolean;
|
|
390
390
|
readonly canMoveUp: boolean;
|
|
391
391
|
readonly canMoveDown: boolean;
|
|
@@ -441,6 +441,11 @@ export declare class EditorManager {
|
|
|
441
441
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
442
442
|
calculateHighlightBox(root?: any): void;
|
|
443
443
|
resetHighlightBox(root: any): void;
|
|
444
|
+
/**
|
|
445
|
+
* 显示插入面板
|
|
446
|
+
* @param region
|
|
447
|
+
* @param preferTag
|
|
448
|
+
*/
|
|
444
449
|
updateState(state: any, replace?: boolean): void;
|
|
445
450
|
setWidthMutable(value: any): void;
|
|
446
451
|
setHeightMutable(value: any): void;
|
|
@@ -482,7 +487,7 @@ export declare class EditorManager {
|
|
|
482
487
|
setRendererConfig(value: RendererConfig): void;
|
|
483
488
|
readonly isVitualRenderer: boolean;
|
|
484
489
|
readonly clickable: boolean;
|
|
485
|
-
readonly draggable: boolean;
|
|
490
|
+
readonly draggable: boolean;
|
|
486
491
|
readonly moveable: boolean;
|
|
487
492
|
readonly canMoveUp: boolean;
|
|
488
493
|
readonly canMoveDown: boolean;
|
|
@@ -546,7 +551,7 @@ export declare class EditorManager {
|
|
|
546
551
|
setRendererConfig(value: RendererConfig): void;
|
|
547
552
|
readonly isVitualRenderer: boolean;
|
|
548
553
|
readonly clickable: boolean;
|
|
549
|
-
readonly draggable: boolean;
|
|
554
|
+
readonly draggable: boolean;
|
|
550
555
|
readonly moveable: boolean;
|
|
551
556
|
readonly canMoveUp: boolean;
|
|
552
557
|
readonly canMoveDown: boolean;
|
|
@@ -609,7 +614,7 @@ export declare class EditorManager {
|
|
|
609
614
|
setRendererConfig(value: RendererConfig): void;
|
|
610
615
|
readonly isVitualRenderer: boolean;
|
|
611
616
|
readonly clickable: boolean;
|
|
612
|
-
readonly draggable: boolean;
|
|
617
|
+
readonly draggable: boolean;
|
|
613
618
|
readonly moveable: boolean;
|
|
614
619
|
readonly canMoveUp: boolean;
|
|
615
620
|
readonly canMoveDown: boolean;
|
|
@@ -699,7 +704,7 @@ export declare class EditorManager {
|
|
|
699
704
|
setRendererConfig(value: RendererConfig): void;
|
|
700
705
|
readonly isVitualRenderer: boolean;
|
|
701
706
|
readonly clickable: boolean;
|
|
702
|
-
readonly draggable: boolean;
|
|
707
|
+
readonly draggable: boolean;
|
|
703
708
|
readonly moveable: boolean;
|
|
704
709
|
readonly canMoveUp: boolean;
|
|
705
710
|
readonly canMoveDown: boolean;
|
|
@@ -762,7 +767,7 @@ export declare class EditorManager {
|
|
|
762
767
|
setRendererConfig(value: RendererConfig): void;
|
|
763
768
|
readonly isVitualRenderer: boolean;
|
|
764
769
|
readonly clickable: boolean;
|
|
765
|
-
readonly draggable: boolean;
|
|
770
|
+
readonly draggable: boolean;
|
|
766
771
|
readonly moveable: boolean;
|
|
767
772
|
readonly canMoveUp: boolean;
|
|
768
773
|
readonly canMoveDown: boolean;
|
|
@@ -818,6 +823,11 @@ export declare class EditorManager {
|
|
|
818
823
|
getTarget(): HTMLElement | HTMLElement[] | null;
|
|
819
824
|
calculateHighlightBox(root?: any): void;
|
|
820
825
|
resetHighlightBox(root: any): void;
|
|
826
|
+
/**
|
|
827
|
+
* 显示插入面板
|
|
828
|
+
* @param region
|
|
829
|
+
* @param preferTag
|
|
830
|
+
*/
|
|
821
831
|
updateState(state: any, replace?: boolean): void;
|
|
822
832
|
setWidthMutable(value: any): void;
|
|
823
833
|
setHeightMutable(value: any): void;
|
|
@@ -954,7 +964,7 @@ export declare class EditorManager {
|
|
|
954
964
|
x: number;
|
|
955
965
|
y: number;
|
|
956
966
|
}): void;
|
|
957
|
-
buildContextMenus(context: ContextMenuEventContext):
|
|
967
|
+
buildContextMenus(context: ContextMenuEventContext): ContextMenuItem[];
|
|
958
968
|
closeContextMenu(): void;
|
|
959
969
|
/**
|
|
960
970
|
* 将当前选中的节点上移
|
package/esm/store/editor.d.ts
CHANGED
|
@@ -3631,12 +3631,12 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3631
3631
|
readonly getSuperEditorData: any;
|
|
3632
3632
|
getComponentTreeSource(): any;
|
|
3633
3633
|
readonly scaffoldData: any;
|
|
3634
|
-
readonly modals:
|
|
3634
|
+
readonly modals: EditorModalBody[];
|
|
3635
3635
|
readonly modalOptions: {
|
|
3636
3636
|
label: string;
|
|
3637
3637
|
tip: string;
|
|
3638
|
-
value:
|
|
3639
|
-
$$ref:
|
|
3638
|
+
value: string | undefined;
|
|
3639
|
+
$$ref: string | undefined;
|
|
3640
3640
|
}[];
|
|
3641
3641
|
} & {
|
|
3642
3642
|
markReady(): void;
|
package/esm/util.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { VariableItem } from 'amis-ui';
|
|
|
4
4
|
import { Diff } from 'deep-diff';
|
|
5
5
|
import { EditorModalBody } from './store/editor';
|
|
6
6
|
import type { SchemaType } from 'amis/lib/Schema';
|
|
7
|
+
import type { DialogSchema } from 'amis/lib/renderers/Dialog';
|
|
8
|
+
import type { DrawerSchema } from 'amis/lib/renderers/Drawer';
|
|
7
9
|
declare const guid: any, omitControls: any, isObjectShallowModified: any, cloneObject: any, anyChanged: any, noop: any, makeHorizontalDeeper: any, isEmpty: any, eachTree: any, createObject: any;
|
|
8
10
|
export { guid, isObjectShallowModified, anyChanged, noop, makeHorizontalDeeper, omitControls, isEmpty, cloneObject, eachTree, createObject };
|
|
9
11
|
export declare let themeConfig: any;
|
|
@@ -196,7 +198,7 @@ export declare function modalsToDefinitions(modals: Array<EditorModalBody>, defi
|
|
|
196
198
|
*/
|
|
197
199
|
export declare function mergeDefinitions(originSchema: any, definitions: any, modal: any): any;
|
|
198
200
|
export declare function setDefaultColSize(regionList: any[], row: number, preRow?: number): any[];
|
|
199
|
-
export declare function getModals(schema: any):
|
|
201
|
+
export declare function getModals(schema: any): (DialogSchema | DrawerSchema)[];
|
|
200
202
|
/**
|
|
201
203
|
* 深度 splice 数组,同时返回新的对象,按需拷贝,没有副作用
|
|
202
204
|
* @param target
|
|
@@ -16,7 +16,7 @@ export default class BackTop extends React.Component<BackTopProps, BackTopStates
|
|
|
16
16
|
constructor(props: any);
|
|
17
17
|
componentDidMount(): void;
|
|
18
18
|
componentWillUnmount(): void;
|
|
19
|
-
getDefaultTarget():
|
|
19
|
+
getDefaultTarget(): (Window & typeof globalThis) | Document;
|
|
20
20
|
handleScroll(e: React.UIEvent<HTMLElement> | {
|
|
21
21
|
target: any;
|
|
22
22
|
}): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
package/lib/dnd/flex.d.ts
CHANGED
|
@@ -45,6 +45,6 @@ export declare class FlexDNDMode implements DNDModeInterface {
|
|
|
45
45
|
* 销毁
|
|
46
46
|
*/
|
|
47
47
|
dispose(): void;
|
|
48
|
-
getDropPosition(): "left" | "right" | "
|
|
48
|
+
getDropPosition(): "left" | "right" | "bottom" | "top" | undefined;
|
|
49
49
|
interruptionDrop(): boolean;
|
|
50
50
|
}
|
package/lib/editor.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ import WidthDraggableContainer from './component/base/WidthDraggableContainer';
|
|
|
41
41
|
import { SchemaFrom } from './component/base/SchemaForm';
|
|
42
42
|
import { RendererThumb } from './component/RendererThumb';
|
|
43
43
|
import { AvailableRenderersPanel } from './component/Panel/AvailableRenderersPanel';
|
|
44
|
+
import { deepSplice } from './deepSplice';
|
|
44
45
|
export declare const version = "__buildVersion";
|
|
45
46
|
export default Editor;
|
|
46
|
-
export { Editor, MiniEditor, utils, mapReactElement, RendererEditor, BasicEditor, CodeEditor, VRenderer, RegionWrapper, IFramePreview as IFrameEditor, SearchPanel, EditorNodeType, EditorNodeSnapshot, EditorStoreType, ContainerWrapper, AvailableRenderersPlugin, AvailableRenderersPanel, BasicToolbarPlugin, CodePlugin, ErrorRendererPlugin, OutlinePlugin, UnknownRendererPlugin, ShortcutKey, SchemaFrom, WidthDraggableContainer, RendererThumb };
|
|
47
|
+
export { Editor, MiniEditor, utils, deepSplice, mapReactElement, RendererEditor, BasicEditor, CodeEditor, VRenderer, RegionWrapper, IFramePreview as IFrameEditor, SearchPanel, EditorNodeType, EditorNodeSnapshot, EditorStoreType, ContainerWrapper, AvailableRenderersPlugin, AvailableRenderersPanel, BasicToolbarPlugin, CodePlugin, ErrorRendererPlugin, OutlinePlugin, UnknownRendererPlugin, ShortcutKey, SchemaFrom, WidthDraggableContainer, RendererThumb };
|