amis-editor-core 5.5.0 → 5.6.0-beta.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.
Files changed (90) hide show
  1. package/esm/component/AsyncLayer.d.ts +9 -0
  2. package/esm/component/Breadcrumb.d.ts +1 -1
  3. package/esm/component/ClassNameControl.d.ts +4 -4
  4. package/esm/component/ContainerWrapper.d.ts +1 -1
  5. package/esm/component/Editor.d.ts +2 -2
  6. package/esm/component/HighlightBox.d.ts +1 -1
  7. package/esm/component/IFramePreview.d.ts +15 -27
  8. package/esm/component/MiniEditor.d.ts +2 -1
  9. package/esm/component/Panel/AMisCodeEditor.d.ts +1 -1
  10. package/esm/component/Panel/AvailableRenderersPanel.d.ts +1 -1
  11. package/esm/component/Panel/CodeEditorPanel.d.ts +1 -1
  12. package/esm/component/Panel/ContextMenuPanel.d.ts +1 -1
  13. package/esm/component/Panel/DrawerPanel.d.ts +1 -1
  14. package/esm/component/Panel/DrawerRendererPanel.d.ts +1 -1
  15. package/esm/component/Panel/InsertSubRendererPanel.d.ts +1 -1
  16. package/esm/component/Panel/LeftPanels.d.ts +1 -1
  17. package/esm/component/Panel/Outline.d.ts +3 -3
  18. package/esm/component/Panel/RenderersPanel.d.ts +1 -1
  19. package/esm/component/Panel/RightPanels.d.ts +1 -1
  20. package/esm/component/Panel/TargetNamePanel.d.ts +1 -1
  21. package/esm/component/PopOverForm.d.ts +1 -1
  22. package/esm/component/Preview.d.ts +1 -2
  23. package/esm/component/RegionHLBox.d.ts +1 -1
  24. package/esm/component/RegionWrapper.d.ts +1 -1
  25. package/esm/component/RendererThumb.d.ts +1 -1
  26. package/esm/component/ScaffoldModal.d.ts +1 -1
  27. package/esm/component/SubEditor.d.ts +2 -2
  28. package/esm/component/VRenderer.d.ts +1 -1
  29. package/esm/component/base/BackTop.d.ts +1 -1
  30. package/esm/component/base/ErrorRenderer.d.ts +1 -1
  31. package/esm/component/base/SearchCustomRendererPanel.d.ts +1 -1
  32. package/esm/component/base/SearchPanel.d.ts +2 -2
  33. package/esm/component/base/SearchRendererPanel.d.ts +1 -1
  34. package/esm/component/base/ShortcutKey.d.ts +1 -1
  35. package/esm/component/base/WidthDraggableBtn.d.ts +1 -1
  36. package/esm/component/factory.d.ts +2 -1
  37. package/esm/index.d.ts +1 -2
  38. package/esm/index.js +2 -2
  39. package/esm/manager.d.ts +4 -5
  40. package/esm/plugin/DataDebug.d.ts +5 -5
  41. package/esm/plugin.d.ts +20 -2
  42. package/esm/util.d.ts +2 -2
  43. package/lib/component/AsyncLayer.d.ts +9 -0
  44. package/lib/component/Breadcrumb.d.ts +1 -1
  45. package/lib/component/ClassNameControl.d.ts +4 -4
  46. package/lib/component/ContainerWrapper.d.ts +1 -1
  47. package/lib/component/Editor.d.ts +2 -2
  48. package/lib/component/HighlightBox.d.ts +1 -1
  49. package/lib/component/IFramePreview.d.ts +15 -27
  50. package/lib/component/MiniEditor.d.ts +2 -1
  51. package/lib/component/Panel/AMisCodeEditor.d.ts +1 -1
  52. package/lib/component/Panel/AvailableRenderersPanel.d.ts +1 -1
  53. package/lib/component/Panel/CodeEditorPanel.d.ts +1 -1
  54. package/lib/component/Panel/ContextMenuPanel.d.ts +1 -1
  55. package/lib/component/Panel/DrawerPanel.d.ts +1 -1
  56. package/lib/component/Panel/DrawerRendererPanel.d.ts +1 -1
  57. package/lib/component/Panel/InsertSubRendererPanel.d.ts +1 -1
  58. package/lib/component/Panel/LeftPanels.d.ts +1 -1
  59. package/lib/component/Panel/Outline.d.ts +3 -3
  60. package/lib/component/Panel/RenderersPanel.d.ts +1 -1
  61. package/lib/component/Panel/RightPanels.d.ts +1 -1
  62. package/lib/component/Panel/TargetNamePanel.d.ts +1 -1
  63. package/lib/component/PopOverForm.d.ts +1 -1
  64. package/lib/component/Preview.d.ts +1 -2
  65. package/lib/component/RegionHLBox.d.ts +1 -1
  66. package/lib/component/RegionWrapper.d.ts +1 -1
  67. package/lib/component/RendererThumb.d.ts +1 -1
  68. package/lib/component/ScaffoldModal.d.ts +1 -1
  69. package/lib/component/SubEditor.d.ts +2 -2
  70. package/lib/component/VRenderer.d.ts +1 -1
  71. package/lib/component/base/BackTop.d.ts +1 -1
  72. package/lib/component/base/ErrorRenderer.d.ts +1 -1
  73. package/lib/component/base/SearchCustomRendererPanel.d.ts +1 -1
  74. package/lib/component/base/SearchPanel.d.ts +2 -2
  75. package/lib/component/base/SearchRendererPanel.d.ts +1 -1
  76. package/lib/component/base/ShortcutKey.d.ts +1 -1
  77. package/lib/component/base/WidthDraggableBtn.d.ts +1 -1
  78. package/lib/component/factory.d.ts +2 -1
  79. package/lib/editor.js +1 -1
  80. package/lib/index.d.ts +1 -2
  81. package/lib/index.js +2 -2
  82. package/lib/manager.d.ts +4 -5
  83. package/lib/plugin/DataDebug.d.ts +5 -5
  84. package/lib/plugin.d.ts +20 -2
  85. package/lib/store/editor.d.ts +1 -0
  86. package/lib/style.css +1 -1
  87. package/lib/util.d.ts +2 -2
  88. package/package.json +3 -1
  89. package/esm/component/IFrameBridge.d.ts +0 -30
  90. package/lib/component/IFrameBridge.d.ts +0 -30
package/lib/manager.d.ts CHANGED
@@ -26,7 +26,8 @@ export interface PluginClass {
26
26
  */
27
27
  export declare function autoPreRegisterEditorCustomPlugins(): void;
28
28
  /**
29
- * 注册Editor插件。
29
+ * 注册Editor插件
30
+ * 备注: 支持覆盖原有组件,注册新的组件时需配置 priority。
30
31
  * @param editor
31
32
  */
32
33
  export declare function registerEditorPlugin(klass: PluginClass): void;
@@ -45,7 +46,6 @@ export declare function unRegisterEditorPlugin(id: string): void;
45
46
  export declare class EditorManager {
46
47
  readonly config: EditorManagerConfig;
47
48
  readonly store: EditorStoreType;
48
- readonly parent?: EditorManager | undefined;
49
49
  readonly plugins: Array<PluginInterface>;
50
50
  readonly env: RenderOptions;
51
51
  toDispose: Array<() => void>;
@@ -58,10 +58,9 @@ export declare class EditorManager {
58
58
  readonly pluginEvents: PluginEvents;
59
59
  readonly pluginActions: PluginActions;
60
60
  dataSchema: DataSchema;
61
- readonly isInFrame: boolean;
62
61
  /** 变量管理 */
63
62
  readonly variableManager: VariableManager;
64
- constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
63
+ constructor(config: EditorManagerConfig, store: EditorStoreType);
65
64
  normalizeScene(plugins?: Array<PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)]>): (PluginClass | [PluginClass, Record<string, any> | (() => Record<string, any>)])[];
66
65
  dynamicAddPlugin(pluginName: string): void;
67
66
  buildRenderersAndPanels(): void;
@@ -995,7 +994,7 @@ export declare class EditorManager {
995
994
  formKey?: string;
996
995
  pipeIn?: (value: any) => any;
997
996
  pipeOut?: (value: any) => any;
998
- }): ({ value, onChange, popOverContainer, id, store, node }: import("./plugin").PanelProps) => JSX.Element;
997
+ }): ({ value, onChange, popOverContainer, id, store, node }: import("./plugin").PanelProps) => import("react").JSX.Element;
999
998
  onWidthChangeStart(e: MouseEvent, ctx: {
1000
999
  dom: HTMLElement;
1001
1000
  node: EditorNodeType;
@@ -1,4 +1,6 @@
1
1
  import { BaseEventContext, BasePlugin, BasicToolbarItem } from '../plugin';
2
+ import React from 'react';
3
+ export declare const JsonView: React.LazyExoticComponent<React.ComponentType<import("react-json-view").ReactJsonViewProps>>;
2
4
  /**
3
5
  * 添加调试功能
4
6
  */
@@ -11,11 +13,9 @@ export declare class DataDebugPlugin extends BasePlugin {
11
13
  name: string;
12
14
  asFormItem: boolean;
13
15
  className: string;
14
- component: ({ value, onChange, readOnly }: {
16
+ component: ({ value }: {
15
17
  value: any;
16
- onChange: (value: any) => void;
17
- readOnly?: boolean | undefined;
18
- }) => JSX.Element;
18
+ }) => React.JSX.Element;
19
19
  };
20
- openDebugForm(data: any, callback?: (values: any) => void): Promise<void>;
20
+ openDebugForm(data: any): Promise<void>;
21
21
  }
package/lib/plugin.d.ts CHANGED
@@ -9,9 +9,10 @@ import { DNDModeInterface } from './dnd/interface';
9
9
  import { EditorDNDManager } from './dnd';
10
10
  import React from 'react';
11
11
  import { DiffChange } from './util';
12
- import type { RendererConfig } from 'amis-core';
12
+ import type { RendererConfig, Schema } from 'amis-core';
13
13
  import type { MenuDivider, MenuItem } from 'amis-ui/lib/components/ContextMenu';
14
14
  import type { BaseSchema, SchemaCollection } from 'amis';
15
+ import type { AsyncLayerOptions } from './component/AsyncLayer';
15
16
  /**
16
17
  * 区域的定义,容器渲染器都需要定义区域信息。
17
18
  */
@@ -572,6 +573,10 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
572
573
  * 右侧面板是否需要两端对齐布局
573
574
  */
574
575
  panelJustify?: boolean;
576
+ /**
577
+ * panelBodyAsyncCreator设置后异步加载层的配置项
578
+ */
579
+ async?: AsyncLayerOptions;
575
580
  /**
576
581
  * 有数据域的容器,可以为子组件提供读取的字段绑定页面
577
582
  */
@@ -581,6 +586,10 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
581
586
  */
582
587
  panelControlsCreator?: (context: BaseEventContext) => Array<any>;
583
588
  panelBodyCreator?: (context: BaseEventContext) => SchemaCollection;
589
+ /**
590
+ * 配置面板内容区的异步加载方法,设置后优先级大于panelBodyCreator
591
+ */
592
+ panelBodyAsyncCreator?: (context: BaseEventContext) => Promise<SchemaCollection>;
584
593
  popOverBody?: Array<any>;
585
594
  popOverBodyCreator?: (context: BaseEventContext) => Array<any>;
586
595
  /**
@@ -619,8 +628,16 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
619
628
  * @param node 当前容器节点
620
629
  * @param region 所属容器节点
621
630
  */
622
- buildDataSchemas?: (node: EditorNodeType, region?: EditorNodeType, trigger?: EditorNodeType) => any | Promise<any>;
631
+ buildDataSchemas?: (node: EditorNodeType, region?: EditorNodeType, trigger?: EditorNodeType, parent?: EditorNodeType) => any | Promise<any>;
623
632
  rendererBeforeDispatchEvent?: (node: EditorNodeType, e: any, data: any) => void;
633
+ /**
634
+ * 给 schema 打补丁,纠正一下 schema 配置。
635
+ * @param schema
636
+ * @param renderer
637
+ * @param props
638
+ * @returns
639
+ */
640
+ patchSchema?: (schema: Schema, renderer: RendererConfig, props?: any) => Schema | void;
624
641
  dispose?: () => void;
625
642
  }
626
643
  export interface RendererPluginEvent {
@@ -687,6 +704,7 @@ export declare abstract class BasePlugin implements PluginInterface {
687
704
  }, HTMLElement>;
688
705
  }, HTMLElement>;
689
706
  getPlugin(rendererNameOrKlass: string | typeof BasePlugin): PluginInterface | undefined;
707
+ buildDataSchemas(node: EditorNodeType, region?: EditorNodeType, trigger?: EditorNodeType, parent?: EditorNodeType): any;
690
708
  }
691
709
  /**
692
710
  * 布局相关组件基类,带宽高可拖拽功能。
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Instance } from 'mobx-state-tree';
2
3
  import { InsertEventContext, PluginEvent, RendererInfo, SubRendererInfo, ToolbarItem, PanelItem, MoveEventContext, ScaffoldForm, PopOverForm } from '../plugin';
3
4
  import { EditorNodeType } from './node';