amis-editor-core 6.9.0-rc.7 → 6.9.0-rc.9

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { BaseEventContext, InsertEventContext, MoveEventContext } from '../plugin';
2
3
  import { LayoutInterface } from './interface';
3
4
  export default class FlexLayout implements LayoutInterface {
package/lib/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 { PluginInterface, BasicPanelItem, RendererInfo, SubRendererInfo, PluginEvent, RegionConfig, ContextMenuEventContext, EventContext, PluginEventFn, ScaffoldForm, RendererPluginEvent, PluginEvents, PluginActions } from './plugin';
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 { RendererConfig, RendererEnv } from 'amis-core';
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: Omit<RendererEnv, 'theme'> & {
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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; /** 因为class的继承关系,未设置ID的子class会和父class共用ID, 只有设置了priority的时候才会执行同ID去重 */
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): any[];
967
+ buildContextMenus(context: ContextMenuEventContext): ContextMenuItem[];
958
968
  closeContextMenu(): void;
959
969
  /**
960
970
  * 将当前选中的节点上移
@@ -3630,12 +3630,12 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
3630
3630
  readonly getSuperEditorData: any;
3631
3631
  getComponentTreeSource(): any;
3632
3632
  readonly scaffoldData: any;
3633
- readonly modals: any[];
3633
+ readonly modals: EditorModalBody[];
3634
3634
  readonly modalOptions: {
3635
3635
  label: string;
3636
3636
  tip: string;
3637
- value: any;
3638
- $$ref: any;
3637
+ value: string | undefined;
3638
+ $$ref: string | undefined;
3639
3639
  }[];
3640
3640
  } & {
3641
3641
  markReady(): void;
package/lib/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): any[];
201
+ export declare function getModals(schema: any): (DialogSchema | DrawerSchema)[];
200
202
  /**
201
203
  * 深度 splice 数组,同时返回新的对象,按需拷贝,没有副作用
202
204
  * @param target
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amis-editor-core",
3
- "version": "6.9.0-rc.7",
3
+ "version": "6.9.0-rc.9",
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 && NODE_ENV=production rollup -c",
31
- "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js",
30
+ "build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c",
31
+ "build-esm": "npm run clean-dist && cross-env 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,6 +84,7 @@
84
84
  "ajv": "^8.8.2",
85
85
  "autoprefixer": "^10.4.12",
86
86
  "concurrently": "^6.2.0",
87
+ "cross-env": "^7.0.3",
87
88
  "css-loader": "^6.2.0",
88
89
  "faker": "^5.5.3",
89
90
  "i18n-command": "^0.0.23-beta.15",