amis-editor 4.1.0-beta.27 → 4.2.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/dist/component/ClassNameControl.d.ts +1 -1
  2. package/dist/component/Control/APIControl.d.ts +2 -2
  3. package/dist/component/Control/OptionControl.d.ts +3 -3
  4. package/dist/component/Control/PopoverEdit.d.ts +4 -4
  5. package/dist/component/Control/ValidationControl.d.ts +1 -1
  6. package/dist/component/Editor.d.ts +1 -1
  7. package/dist/component/IFramePreview.d.ts +2 -1
  8. package/dist/component/NodeWrapper.d.ts +1 -1
  9. package/dist/component/Preview.d.ts +3 -1
  10. package/dist/component/ScaffoldModal.d.ts +1 -1
  11. package/dist/component/base/InputComponentName.d.ts +1 -1
  12. package/dist/env.d.ts +1 -1
  13. package/dist/exports.min.js +1 -1
  14. package/dist/index.min.js +1 -1
  15. package/dist/manager.d.ts +6 -24
  16. package/dist/plugin/Alert.d.ts +1 -1
  17. package/dist/plugin/Button.d.ts +1 -1
  18. package/dist/plugin/Dialog.d.ts +1 -1
  19. package/dist/plugin/Drawer.d.ts +1 -1
  20. package/dist/plugin/Form/Formula.d.ts +3 -3
  21. package/dist/plugin/IFrame.d.ts +3 -3
  22. package/dist/plugin/Page.d.ts +1 -1
  23. package/dist/plugin/Table.d.ts +1 -1
  24. package/dist/plugin.d.ts +3 -3
  25. package/dist/store/editor.d.ts +38 -20
  26. package/dist/util.d.ts +1 -1
  27. package/package.json +5 -2
  28. package/src/plugin/Alert.tsx +1 -1
  29. package/src/plugin/AnchorNav.tsx +1 -1
  30. package/src/plugin/Audio.tsx +1 -8
  31. package/src/plugin/Button.tsx +2 -4
  32. package/src/plugin/ButtonGroup.tsx +3 -6
  33. package/src/plugin/ButtonToolbar.tsx +4 -6
  34. package/src/plugin/CRUD.tsx +4 -4
  35. package/src/plugin/Card.tsx +1 -1
  36. package/src/plugin/Cards.tsx +1 -1
  37. package/src/plugin/Carousel.tsx +3 -12
  38. package/src/plugin/Chart.tsx +1 -1
  39. package/src/plugin/Collapse.tsx +1 -8
  40. package/src/plugin/Container.tsx +2 -6
  41. package/src/plugin/Date.tsx +1 -8
  42. package/src/plugin/Datetime.tsx +1 -8
  43. package/src/plugin/Dialog.tsx +2 -4
  44. package/src/plugin/Drawer.tsx +3 -6
  45. package/src/plugin/DropDownButton.tsx +2 -4
  46. package/src/plugin/Each.tsx +2 -7
  47. package/src/plugin/Flex.tsx +4 -9
  48. package/src/plugin/Form/ButtonGroupSelect.tsx +2 -13
  49. package/src/plugin/Form/ButtonToolbar.tsx +2 -13
  50. package/src/plugin/Form/CodeEditor.tsx +2 -12
  51. package/src/plugin/Form/Combo.tsx +1 -1
  52. package/src/plugin/Form/ConditionBuilder.tsx +4 -13
  53. package/src/plugin/Form/DiffEditor.tsx +1 -7
  54. package/src/plugin/Form/FieldSet.tsx +3 -15
  55. package/src/plugin/Form/Form.tsx +1 -6
  56. package/src/plugin/Form/Formula.tsx +2 -14
  57. package/src/plugin/Form/Group.tsx +2 -7
  58. package/src/plugin/Form/Hidden.tsx +1 -13
  59. package/src/plugin/Form/InputFile.tsx +1 -8
  60. package/src/plugin/Form/InputGroup.tsx +4 -13
  61. package/src/plugin/Form/InputImage.tsx +2 -13
  62. package/src/plugin/Form/InputNumber.tsx +2 -10
  63. package/src/plugin/Form/InputRepeat.tsx +5 -17
  64. package/src/plugin/Form/InputRichText.tsx +2 -13
  65. package/src/plugin/Form/InputSubForm.tsx +2 -11
  66. package/src/plugin/Form/InputTable.tsx +1 -1
  67. package/src/plugin/Form/InputTag.tsx +2 -13
  68. package/src/plugin/Form/InputTime.tsx +2 -12
  69. package/src/plugin/Form/InputTree.tsx +2 -13
  70. package/src/plugin/Form/ListSelect.tsx +2 -13
  71. package/src/plugin/Form/LocationPicker.tsx +1 -14
  72. package/src/plugin/Form/MatrixCheckboxes.tsx +2 -13
  73. package/src/plugin/Form/NestedSelect.tsx +2 -13
  74. package/src/plugin/Form/Picker.tsx +2 -10
  75. package/src/plugin/Form/Radios.tsx +2 -13
  76. package/src/plugin/Form/Static.tsx +2 -15
  77. package/src/plugin/Form/Switch.tsx +2 -13
  78. package/src/plugin/Form/TabsTransfer.tsx +2 -13
  79. package/src/plugin/Form/Textarea.tsx +2 -13
  80. package/src/plugin/Form/Transfer.tsx +2 -13
  81. package/src/plugin/Grid.tsx +1 -2
  82. package/src/plugin/IFrame.tsx +1 -3
  83. package/src/plugin/Image.tsx +0 -4
  84. package/src/plugin/Images.tsx +1 -8
  85. package/src/plugin/Json.tsx +1 -8
  86. package/src/plugin/Link.tsx +2 -4
  87. package/src/plugin/List.tsx +1 -4
  88. package/src/plugin/ListItem.tsx +0 -4
  89. package/src/plugin/Mapping.tsx +1 -8
  90. package/src/plugin/Nav.tsx +2 -4
  91. package/src/plugin/Operation.tsx +2 -4
  92. package/src/plugin/Others/Action.tsx +2 -4
  93. package/src/plugin/Others/BasicToolbar.tsx +2 -8
  94. package/src/plugin/Others/TableCell.tsx +1 -1
  95. package/src/plugin/Page.tsx +1 -3
  96. package/src/plugin/Panel.tsx +1 -1
  97. package/src/plugin/Plain.tsx +1 -8
  98. package/src/plugin/Progress.tsx +1 -8
  99. package/src/plugin/QRCode.tsx +1 -3
  100. package/src/plugin/Service.tsx +3 -8
  101. package/src/plugin/Status.tsx +1 -3
  102. package/src/plugin/Steps.tsx +2 -14
  103. package/src/plugin/Table.tsx +4 -16
  104. package/src/plugin/TableView.tsx +2 -4
  105. package/src/plugin/Tabs.tsx +0 -2
  106. package/src/plugin/Tasks.tsx +1 -3
  107. package/src/plugin/Time.tsx +1 -8
  108. package/src/plugin/Tpl.tsx +1 -5
  109. package/src/plugin/Video.tsx +2 -4
  110. package/src/plugin/WebComponent.tsx +1 -4
  111. package/src/plugin/Wizard.tsx +1 -4
  112. package/src/plugin/Wrapper.tsx +1 -1
  113. package/src/plugin.ts +5 -4
package/dist/manager.d.ts CHANGED
@@ -4,13 +4,14 @@
4
4
  * @file 把一些功能性的东西放在了这个里面,辅助 compoennt/Editor.tsx 组件的。
5
5
  * 编辑器非 UI 相关的东西应该放在这。
6
6
  */
7
- import { RendererConfig, RenderOptions } from 'amis/lib/factory';
7
+ import { RenderOptions } from 'amis-core';
8
8
  import { PluginInterface, BasicPanelItem, RendererInfo, SubRendererInfo, PluginEvent, RegionConfig, ContextMenuItem, ContextMenuEventContext, EventContext, PluginEventFn, ScaffoldForm } from './plugin';
9
9
  import { EditorStoreType, SubEditorContext } from './store/editor';
10
- import { SchemaObject } from 'amis';
11
10
  import { EditorNodeType } from './store/node';
12
11
  import { EditorProps } from './component/Editor';
13
12
  import { EditorDNDManager } from './dnd';
13
+ import { SchemaObject } from 'amis/lib/Schema';
14
+ import type { RendererConfig } from 'amis-core/lib/factory';
14
15
  export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
15
16
  }
16
17
  export interface PluginClass {
@@ -44,12 +45,11 @@ export declare class EditorManager {
44
45
  readonly dnd: EditorDNDManager;
45
46
  readonly id: string;
46
47
  disableHover: boolean;
47
- private renderersId;
48
- private panelsId;
49
48
  private clipboardData;
50
49
  readonly hackIn: any;
51
50
  constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
52
51
  dynamicAddPlugin(pluginName: string): void;
52
+ buildRenderersAndPanels(): void;
53
53
  buildEventContext(idOrNode: string | EditorNodeType): {
54
54
  node: {
55
55
  parentId: string;
@@ -121,11 +121,7 @@ export declare class EditorManager {
121
121
  memberIndex?: number | undefined;
122
122
  }): any;
123
123
  removeChild(child: any): void;
124
- toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void; /**
125
- * 显示插入面板
126
- * @param region
127
- * @param preferTag
128
- */
124
+ toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
129
125
  patch(store: any, force?: boolean): void;
130
126
  updateSchema(value: any): void;
131
127
  setComponent(value: any): void;
@@ -133,11 +129,6 @@ export declare class EditorManager {
133
129
  calculateHighlightBox(root?: any): void;
134
130
  resetHighlightBox(root: any): void;
135
131
  updateState(state: any, replace?: boolean): void;
136
- /**
137
- * 在当前选中元素插入或追加新的元素
138
- * @param rendererIdOrSchema
139
- * 备注:可以根据渲染器ID添加新元素,也可以根据现有schema片段添加新元素
140
- */
141
132
  setWidthMutable(value: any): void;
142
133
  setHeightMutable(value: any): void;
143
134
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
@@ -210,11 +201,7 @@ export declare class EditorManager {
210
201
  memberIndex?: number | undefined;
211
202
  }): any;
212
203
  removeChild(child: any): void;
213
- toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void; /**
214
- * 显示插入面板
215
- * @param region
216
- * @param preferTag
217
- */
204
+ toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
218
205
  patch(store: any, force?: boolean): void;
219
206
  updateSchema(value: any): void;
220
207
  setComponent(value: any): void;
@@ -222,11 +209,6 @@ export declare class EditorManager {
222
209
  calculateHighlightBox(root?: any): void;
223
210
  resetHighlightBox(root: any): void;
224
211
  updateState(state: any, replace?: boolean): void;
225
- /**
226
- * 在当前选中元素插入或追加新的元素
227
- * @param rendererIdOrSchema
228
- * 备注:可以根据渲染器ID添加新元素,也可以根据现有schema片段添加新元素
229
- */
230
212
  setWidthMutable(value: any): void;
231
213
  setHeightMutable(value: any): void;
232
214
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
@@ -1,5 +1,5 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { BasePlugin } from '../plugin';
2
+ import { SchemaObject } from 'amis/lib/Schema';
3
3
  export declare class AlertPlugin extends BasePlugin {
4
4
  rendererName: string;
5
5
  $schema: string;
@@ -1,5 +1,5 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { BaseEventContext, BasePlugin, BasicRendererInfo, RendererInfoResolveEventContext } from '../plugin';
2
+ import { SchemaObject } from 'amis/lib/Schema';
3
3
  export declare class ButtonPlugin extends BasePlugin {
4
4
  rendererName: string;
5
5
  $schema: string;
@@ -7,7 +7,7 @@ export declare class DialogPlugin extends BasePlugin {
7
7
  isBaseComponent: boolean;
8
8
  wrapperProps: {
9
9
  wrapperComponent: typeof InlineModal;
10
- onClose: typeof import("amis/lib/utils/helper").noop;
10
+ onClose: typeof import("amis-core").noop;
11
11
  show: boolean;
12
12
  };
13
13
  regions: Array<RegionConfig>;
@@ -7,7 +7,7 @@ export declare class DrawerPlugin extends BasePlugin {
7
7
  isBaseComponent: boolean;
8
8
  wrapperProps: {
9
9
  wrapperComponent: typeof InlineModal;
10
- onClose: typeof import("amis/lib/utils/helper").noop;
10
+ onClose: typeof import("amis-core").noop;
11
11
  resizable: boolean;
12
12
  show: boolean;
13
13
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { BasePlugin } from '../../plugin';
3
3
  export declare class FormulaControlPlugin extends BasePlugin {
4
4
  rendererName: string;
@@ -40,10 +40,10 @@ export declare class FormulaControlPlugin extends BasePlugin {
40
40
  mode: string;
41
41
  className: string;
42
42
  })[];
43
- renderRenderer(props: any): React.DetailedReactHTMLElement<{
43
+ renderRenderer(props: any): import("react").DetailedReactHTMLElement<{
44
44
  key: any;
45
45
  className: string;
46
- children: React.DetailedReactHTMLElement<{
46
+ children: import("react").DetailedReactHTMLElement<{
47
47
  className: string;
48
48
  children: string;
49
49
  }, HTMLElement>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { BasePlugin } from '../plugin';
3
3
  export declare class IFramePlugin extends BasePlugin {
4
4
  rendererName: string;
@@ -18,10 +18,10 @@ export declare class IFramePlugin extends BasePlugin {
18
18
  };
19
19
  panelTitle: string;
20
20
  panelBody: any[];
21
- renderRenderer(props: any): React.DetailedReactHTMLElement<{
21
+ renderRenderer(props: any): import("react").DetailedReactHTMLElement<{
22
22
  key: any;
23
23
  className: string;
24
- children: React.DetailedReactHTMLElement<{
24
+ children: import("react").DetailedReactHTMLElement<{
25
25
  className: string;
26
26
  children: string;
27
27
  }, HTMLElement>;
@@ -1,6 +1,6 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { ContainerWrapper } from '../component/ContainerWrapper';
3
2
  import { BasePlugin } from '../plugin';
3
+ import type { SchemaObject } from 'amis/lib/Schema';
4
4
  export declare class PagePlugin extends BasePlugin {
5
5
  rendererName: string;
6
6
  $schema: string;
@@ -1,5 +1,5 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { BasePlugin, BaseEventContext, PluginEvent, RegionConfig, RendererInfoResolveEventContext, BasicRendererInfo, InsertEventContext, ScaffoldForm } from '../plugin';
2
+ import { SchemaObject } from 'amis/lib/Schema';
3
3
  export declare class TablePlugin extends BasePlugin {
4
4
  rendererName: string;
5
5
  $schema: string;
package/dist/plugin.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * @file 定义插件的 interface,以及提供一个 BasePlugin 基类,把一些通用的方法放在这。
3
3
  */
4
- import { BaseSchema } from 'amis';
5
- import { MenuDivider, MenuItem } from 'amis/lib/components/ContextMenu';
6
- import { RendererConfig } from 'amis/lib/factory';
7
4
  import { RegionWrapperProps } from './component/RegionWrapper';
8
5
  import { EditorManager } from './manager';
9
6
  import { EditorStoreType } from './store/editor';
@@ -12,6 +9,9 @@ import { DNDModeInterface } from './dnd/interface';
12
9
  import { EditorDNDManager } from './dnd';
13
10
  import React from 'react';
14
11
  import { DiffChange } from './util';
12
+ import type { RendererConfig } from 'amis-core/lib/factory';
13
+ import type { MenuDivider, MenuItem } from 'amis-ui/lib/components/ContextMenu';
14
+ import type { BaseSchema } from 'amis/lib/Schema';
15
15
  /**
16
16
  * 区域的定义,容器渲染器都需要定义区域信息。
17
17
  */
@@ -136,7 +136,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
136
136
  calculateHighlightBox(root?: any): void;
137
137
  resetHighlightBox(root: any): void;
138
138
  updateState(state: any, replace?: boolean): void;
139
- setWidthMutable(value: any): void;
139
+ setWidthMutable(value: any): void; /** 获取自定义组件
140
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
141
+ */
140
142
  setHeightMutable(value: any): void;
141
143
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
142
144
  theme: import("mobx-state-tree").IType<string | undefined, string, string>;
@@ -280,7 +282,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
280
282
  calculateHighlightBox(root?: any): void;
281
283
  resetHighlightBox(root: any): void;
282
284
  updateState(state: any, replace?: boolean): void;
283
- setWidthMutable(value: any): void;
285
+ setWidthMutable(value: any): void; /** 获取自定义组件
286
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
287
+ */
284
288
  setHeightMutable(value: any): void;
285
289
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
286
290
  parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
@@ -360,12 +364,14 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
360
364
  calculateHighlightBox(root?: any): void;
361
365
  resetHighlightBox(root: any): void;
362
366
  updateState(state: any, replace?: boolean): void;
363
- setWidthMutable(value: any): void;
367
+ setWidthMutable(value: any): void; /** 获取自定义组件
368
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
369
+ */
364
370
  setHeightMutable(value: any): void;
365
371
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
366
- getNodeById(id: string, region?: string): EditorNodeType | undefined;
372
+ getNodeById(id: string, region?: string | undefined): EditorNodeType | undefined;
367
373
  readonly activeNodeInfo: RendererInfo | null | undefined;
368
- getSchema(id?: string): any;
374
+ getSchema(id?: string | undefined): any;
369
375
  getSchemaParentById(id: string): any;
370
376
  getSchemaPath(id: string): string;
371
377
  getSimpleSchema(curSchema: any): any;
@@ -461,7 +467,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
461
467
  calculateHighlightBox(root?: any): void;
462
468
  resetHighlightBox(root: any): void;
463
469
  updateState(state: any, replace?: boolean): void;
464
- setWidthMutable(value: any): void;
470
+ setWidthMutable(value: any): void; /** 获取自定义组件
471
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
472
+ */
465
473
  setHeightMutable(value: any): void;
466
474
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
467
475
  parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
@@ -541,7 +549,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
541
549
  calculateHighlightBox(root?: any): void;
542
550
  resetHighlightBox(root: any): void;
543
551
  updateState(state: any, replace?: boolean): void;
544
- setWidthMutable(value: any): void;
552
+ setWidthMutable(value: any): void; /** 获取自定义组件
553
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
554
+ */
545
555
  setHeightMutable(value: any): void;
546
556
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
547
557
  readonly activePath: ({
@@ -622,7 +632,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
622
632
  calculateHighlightBox(root?: any): void;
623
633
  resetHighlightBox(root: any): void;
624
634
  updateState(state: any, replace?: boolean): void;
625
- setWidthMutable(value: any): void;
635
+ setWidthMutable(value: any): void; /** 获取自定义组件
636
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
637
+ */
626
638
  setHeightMutable(value: any): void;
627
639
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
628
640
  parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
@@ -702,7 +714,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
702
714
  calculateHighlightBox(root?: any): void;
703
715
  resetHighlightBox(root: any): void;
704
716
  updateState(state: any, replace?: boolean): void;
705
- setWidthMutable(value: any): void;
717
+ setWidthMutable(value: any): void; /** 获取自定义组件
718
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
719
+ */
706
720
  setHeightMutable(value: any): void;
707
721
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
708
722
  getNodePathById(id: string): ({
@@ -783,7 +797,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
783
797
  calculateHighlightBox(root?: any): void;
784
798
  resetHighlightBox(root: any): void;
785
799
  updateState(state: any, replace?: boolean): void;
786
- setWidthMutable(value: any): void;
800
+ setWidthMutable(value: any): void; /** 获取自定义组件
801
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
802
+ */
787
803
  setHeightMutable(value: any): void;
788
804
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
789
805
  parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
@@ -863,7 +879,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
863
879
  calculateHighlightBox(root?: any): void;
864
880
  resetHighlightBox(root: any): void;
865
881
  updateState(state: any, replace?: boolean): void;
866
- setWidthMutable(value: any): void;
882
+ setWidthMutable(value: any): void; /** 获取自定义组件
883
+ * 备注:disabledRendererPlugin 为 true 则不在面板中展示
884
+ */
867
885
  setHeightMutable(value: any): void;
868
886
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
869
887
  readonly dragging: boolean;
@@ -878,13 +896,13 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
878
896
  */
879
897
  readonly customRenderersByOrder: SubRendererInfo[];
880
898
  /** 根据关键字过滤组件 */
881
- groupedRenderersByKeyword(_subRenderers: Array<SubRendererInfo>, keywords?: string): {
899
+ groupedRenderersByKeyword(_subRenderers: Array<SubRendererInfo>, keywords?: string | undefined): {
882
900
  [propName: string]: SubRendererInfo[];
883
901
  };
884
902
  /** 根据关键字过滤预置组件
885
903
  * 备注:组件搜索中需要
886
904
  */
887
- groupedSubRenderersByKeyword(_subRenderers?: Array<SubRendererInfo>, keywords?: string): {
905
+ groupedSubRenderersByKeyword(_subRenderers?: SubRendererInfo[] | undefined, keywords?: string | undefined): {
888
906
  [propName: string]: SubRendererInfo[];
889
907
  };
890
908
  /**
@@ -895,7 +913,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
895
913
  [propName: string]: SubRendererInfo[];
896
914
  };
897
915
  /** 根据关键字过滤自定义组件 */
898
- groupedCustomRenderersByKeyword(_subRenderers?: Array<SubRendererInfo>, keywords?: string): {
916
+ groupedCustomRenderersByKeyword(_subRenderers?: SubRendererInfo[] | undefined, keywords?: string | undefined): {
899
917
  [propName: string]: SubRendererInfo[];
900
918
  };
901
919
  /**
@@ -920,7 +938,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
920
938
  getDoc(): Document;
921
939
  setIframe(value: any): void;
922
940
  getIframe(): HTMLIFrameElement | undefined;
923
- setIsMobile(value?: boolean): void;
941
+ setIsMobile(value?: boolean | undefined): void;
924
942
  setCtx(value: any): void;
925
943
  setTheme(value: string): void;
926
944
  setIsSubEditor(isSubEditor: boolean): void;
@@ -931,7 +949,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
931
949
  setActiveId(id: string, region?: string, selections?: Array<string>): void;
932
950
  setSelections(ids: Array<string>): void;
933
951
  clearSelection(): void;
934
- setHoverId(id: string, region?: string): void;
952
+ setHoverId(id: string, region?: string | undefined): void;
935
953
  setMouseMoveRegion(region: string): void;
936
954
  setInsertId(id: string): void;
937
955
  setContextId(id: string): void;
@@ -952,9 +970,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
952
970
  changeLeftPanelKey(key: string): void;
953
971
  changeRenderersTabsKey(key: string): void;
954
972
  changeLeftPanelOpenStatus(isOpenStatus: boolean): void;
955
- showRendererPanel(tag?: string, msg?: string): void;
973
+ showRendererPanel(tag?: string | undefined, msg?: string | undefined): void;
956
974
  changeValue(value: Schema, diff?: any): void;
957
- changeValueById(id: string, value: Schema, diff?: any, replace?: boolean, noTrace?: boolean): void;
975
+ changeValueById(id: string, value: Schema, diff?: any, replace?: boolean | undefined, noTrace?: boolean | undefined): void;
958
976
  moveUp(id: string): void;
959
977
  moveDown(id: string): void;
960
978
  del(id: string): void;
@@ -962,7 +980,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
962
980
  duplicate(id: string | Array<string>): void;
963
981
  emptyRegion(id: string, region: string): void;
964
982
  replaceChild(id: string, json: any): void;
965
- setInsertRegion(region: string, id?: string, tag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string): void;
983
+ setInsertRegion(region: string, id?: string, tag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string | undefined): void;
966
984
  closeInsertPanel(): void;
967
985
  showInsertRendererPanel(): void;
968
986
  closeInsertRendererPanel(): void;
@@ -991,7 +1009,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
991
1009
  * 更新可供 target 及 reload 使用的名称列表
992
1010
  */
993
1011
  updateTargetName(): void;
994
- traceableSetSchema(schema: any, noTrace?: boolean): void;
1012
+ traceableSetSchema(schema: any, noTrace?: boolean | undefined): void;
995
1013
  undo(): void;
996
1014
  redo(): void;
997
1015
  resetHistory(): void;
package/dist/util.d.ts CHANGED
@@ -50,7 +50,7 @@ export declare function sortByList(list: Array<string>, attr: string | Function)
50
50
  export declare function persistGet(key: string, defaultValue?: any): any;
51
51
  export declare function persistSet(key: string, value: any): void;
52
52
  export declare function normalizeId(id: string): string;
53
- export declare const autobind: typeof import("amis/lib/utils/autobind").autobindMethod;
53
+ export declare const autobind: typeof import("amis").autobindMethod;
54
54
  export declare function addDragingClass(el: HTMLElement): void;
55
55
  export declare function removeDragingClass(el: HTMLElement): void;
56
56
  export declare function camelize(str: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amis-editor",
3
- "version": "4.1.0-beta.27",
3
+ "version": "4.2.0-beta.0",
4
4
  "description": "amis 可视化编辑器",
5
5
  "main": "dist/index.min.js",
6
6
  "types": "dist/index.d.ts",
@@ -60,7 +60,10 @@
60
60
  "@types/react-router": "^4.0.16",
61
61
  "@types/sortablejs": "^1.10.7",
62
62
  "ajv": "^8.8.2",
63
- "amis": "^1.9.0",
63
+ "amis": "^2.0.0-rc.9",
64
+ "amis-core": "^2.0.0-rc.9",
65
+ "amis-formula": "^2.0.0-rc.9",
66
+ "amis-ui": "^2.0.0-rc.9",
64
67
  "axios": "0.21.1",
65
68
  "concurrently": "^6.2.0",
66
69
  "css-loader": "^6.2.0",
@@ -1,8 +1,8 @@
1
- import {SchemaObject} from 'amis';
2
1
  import React from 'react';
3
2
  import {registerEditorPlugin} from '../manager';
4
3
  import {BasePlugin} from '../plugin';
5
4
  import {getSchemaTpl} from '../component/schemaTpl';
5
+ import {SchemaObject} from 'amis/lib/Schema';
6
6
 
7
7
  export class AlertPlugin extends BasePlugin {
8
8
  // 关联渲染器名字
@@ -6,7 +6,7 @@ import {VRenderer} from '../component/VRenderer';
6
6
  import {mapReactElement} from '../component/factory';
7
7
  import findIndex from 'lodash/findIndex';
8
8
  import {RegionWrapper as Region} from '../component/RegionWrapper';
9
- import {AnchorNavSection} from 'amis/lib/components/AnchorNav';
9
+ import {AnchorNavSection} from 'amis-ui';
10
10
 
11
11
  export class AnchorNavPlugin extends BasePlugin {
12
12
  // 关联渲染器名字
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
2
+ import {BaseEventContext, BasePlugin} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
 
12
5
  export class AudioPlugin extends BasePlugin {
@@ -1,6 +1,3 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import flatten from 'lodash/flatten';
3
- import React from 'react';
4
1
  import {registerEditorPlugin} from '../manager';
5
2
  import {
6
3
  BaseEventContext,
@@ -9,7 +6,8 @@ import {
9
6
  PluginInterface,
10
7
  RendererInfoResolveEventContext
11
8
  } from '../plugin';
12
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
9
+ import {getSchemaTpl} from '../component/schemaTpl';
10
+ import {SchemaObject} from 'amis/lib/Schema';
13
11
 
14
12
  export class ButtonPlugin extends BasePlugin {
15
13
  // 关联渲染器名字
@@ -1,9 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
5
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
6
- import {RegionWrapper as Region} from '../component/RegionWrapper';
2
+ import {BasePlugin, RegionConfig} from '../plugin';
7
3
 
8
4
  export class ButtonGroupPlugin extends BasePlugin {
9
5
  // 关联渲染器名字
@@ -63,7 +59,8 @@ export class ButtonGroupPlugin extends BasePlugin {
63
59
  type: 'tpl',
64
60
  inline: false,
65
61
  className: 'p-t-xs',
66
- tpl: '<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
62
+ tpl:
63
+ '<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
67
64
  }
68
65
  ],
69
66
  addButtonText: '新增按钮',
@@ -1,8 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
- import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
5
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
1
+ import {BasePlugin} from '../plugin';
2
+ import {getSchemaTpl} from '../component/schemaTpl';
6
3
 
7
4
  export class ButtonToolbarPlugin extends BasePlugin {
8
5
  // 关联渲染器名字
@@ -63,7 +60,8 @@ export class ButtonToolbarPlugin extends BasePlugin {
63
60
  type: 'tpl',
64
61
  inline: false,
65
62
  className: 'p-t-xs',
66
- tpl: '<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
63
+ tpl:
64
+ '<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
67
65
  }
68
66
  ],
69
67
  addButtonText: '新增按钮',
@@ -1,5 +1,5 @@
1
- import {buildApi, Button, SchemaObject, Html, toast} from 'amis';
2
- import {RendererConfig} from 'amis/lib/factory';
1
+ import {toast} from 'amis';
2
+
3
3
  import get from 'lodash/get';
4
4
  import cloneDeep from 'lodash/cloneDeep';
5
5
  import React from 'react';
@@ -20,10 +20,10 @@ import {
20
20
  } from '../plugin';
21
21
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
22
22
  import {isObject, JSONPipeIn} from '../util';
23
- import {setVariable} from 'amis/lib/utils/helper';
23
+ import {setVariable} from 'amis-core';
24
24
  import {ActionSchema} from 'amis/lib/renderers/Action';
25
25
  import {getEnv} from 'mobx-state-tree';
26
- import {normalizeApi} from 'amis/lib/utils/api';
26
+ import {normalizeApi} from 'amis-core';
27
27
 
28
28
  interface ColumnItem {
29
29
  label: string;
@@ -1,4 +1,4 @@
1
- import {Button, SchemaObject} from 'amis';
1
+ import {Button} from 'amis-ui';
2
2
  import React from 'react';
3
3
  import {registerEditorPlugin} from '../manager';
4
4
  import {
@@ -1,4 +1,4 @@
1
- import {Button, resolveVariable, SchemaObject} from 'amis';
1
+ import {Button, resolveVariable} from 'amis';
2
2
  import React from 'react';
3
3
  import {registerEditorPlugin} from '../manager';
4
4
  import {
@@ -1,15 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- BasicToolbarItem,
8
- PluginEvent,
9
- PreventClickEventContext,
10
- RegionConfig,
11
- RendererInfo
12
- } from '../plugin';
2
+ import {BaseEventContext, BasePlugin, BasicToolbarItem} from '../plugin';
13
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
14
4
  import {mockValue} from '../mocker';
15
5
 
@@ -33,7 +23,8 @@ export class CarouselPlugin extends BasePlugin {
33
23
  image: mockValue({type: 'image'})
34
24
  },
35
25
  {
36
- html: '<div style="width: 100%; height: 300px; background: #e3e3e3; text-align: center; line-height: 300px;">carousel data</div>'
26
+ html:
27
+ '<div style="width: 100%; height: 300px; background: #e3e3e3; text-align: center; line-height: 300px;">carousel data</div>'
37
28
  },
38
29
  {
39
30
  image: mockValue({type: 'image'})
@@ -1,4 +1,4 @@
1
- import {Button, SchemaObject} from 'amis';
1
+ import {Button} from 'amis';
2
2
  import React from 'react';
3
3
  import {registerEditorPlugin} from '../manager';
4
4
  import {
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BasePlugin,
6
- RegionConfig,
7
- RendererInfo,
8
- BaseEventContext
9
- } from '../plugin';
2
+ import {BasePlugin, RegionConfig, BaseEventContext} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
 
12
5
  export class CollapsePlugin extends BasePlugin {
@@ -1,13 +1,9 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
2
  import {
5
3
  BaseEventContext,
6
4
  BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
10
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
5
+ RegionConfig} from '../plugin';
6
+ import {getSchemaTpl} from '../component/schemaTpl';
11
7
 
12
8
  export class ContainerPlugin extends BasePlugin {
13
9
  // 关联渲染器名字
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
2
+ import {BaseEventContext, BasePlugin} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
 
12
5
  export class DatePlugin extends BasePlugin {
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
2
+ import {BaseEventContext} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
  import {DatePlugin} from './Date';
12
5