amis-editor 4.1.0-beta.4 → 4.2.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/dist/component/Breadcrumb.d.ts +23 -2
  2. package/dist/component/ClassNameControl.d.ts +1 -1
  3. package/dist/component/Control/APIControl.d.ts +2 -2
  4. package/dist/component/Control/OptionControl.d.ts +3 -3
  5. package/dist/component/Control/PopoverEdit.d.ts +4 -4
  6. package/dist/component/Control/ValidationControl.d.ts +1 -1
  7. package/dist/component/Editor.d.ts +20 -1
  8. package/dist/component/IFramePreview.d.ts +2 -1
  9. package/dist/component/NodeWrapper.d.ts +1 -1
  10. package/dist/component/Panel/RenderersPanel.d.ts +1 -2
  11. package/dist/component/Preview.d.ts +3 -1
  12. package/dist/component/RegionWrapper.d.ts +4 -0
  13. package/dist/component/ScaffoldModal.d.ts +1 -1
  14. package/dist/component/VRenderer.d.ts +4 -0
  15. package/dist/component/base/InputComponentName.d.ts +1 -1
  16. package/dist/component/base/SearchCustomRendererPanel.d.ts +15 -0
  17. package/dist/component/base/SearchPanel.d.ts +83 -0
  18. package/dist/component/base/SearchRendererPanel.d.ts +2 -42
  19. package/dist/component/base/ShortcutKey.d.ts +23 -0
  20. package/dist/env.d.ts +1 -1
  21. package/dist/exports.min.js +1 -1
  22. package/dist/index.d.ts +5 -1
  23. package/dist/index.min.js +1 -1
  24. package/dist/manager.d.ts +16 -4
  25. package/dist/plugin/Alert.d.ts +1 -1
  26. package/dist/plugin/Button.d.ts +1 -1
  27. package/dist/plugin/Card.d.ts +1 -0
  28. package/dist/plugin/Cards.d.ts +2 -1
  29. package/dist/plugin/Carousel.d.ts +1 -0
  30. package/dist/plugin/Chart.d.ts +1 -0
  31. package/dist/plugin/Collapse.d.ts +1 -0
  32. package/dist/plugin/Custom.d.ts +3 -0
  33. package/dist/plugin/CustomRegion.d.ts +40 -0
  34. package/dist/plugin/Dialog.d.ts +1 -1
  35. package/dist/plugin/Drawer.d.ts +1 -1
  36. package/dist/plugin/DropDownButton.d.ts +1 -1
  37. package/dist/plugin/Each.d.ts +1 -1
  38. package/dist/plugin/Flex.d.ts +1 -0
  39. package/dist/plugin/Form/Control.d.ts +1 -0
  40. package/dist/plugin/Form/Form.d.ts +19 -3
  41. package/dist/plugin/Form/Formula.d.ts +3 -3
  42. package/dist/plugin/Form/InputURL.d.ts +1 -0
  43. package/dist/plugin/Form/Switch.d.ts +2 -0
  44. package/dist/plugin/Grid.d.ts +1 -0
  45. package/dist/plugin/HBox.d.ts +1 -0
  46. package/dist/plugin/IFrame.d.ts +3 -3
  47. package/dist/plugin/Json.d.ts +1 -0
  48. package/dist/plugin/List.d.ts +2 -1
  49. package/dist/plugin/Mapping.d.ts +1 -0
  50. package/dist/plugin/Markdown.d.ts +1 -0
  51. package/dist/plugin/Nav.d.ts +1 -0
  52. package/dist/plugin/Page.d.ts +1 -1
  53. package/dist/plugin/Panel/Outline.d.ts +8 -0
  54. package/dist/plugin/Progress.d.ts +1 -0
  55. package/dist/plugin/QRCode.d.ts +1 -0
  56. package/dist/plugin/Reset.d.ts +0 -1
  57. package/dist/plugin/Service.d.ts +1 -0
  58. package/dist/plugin/Sparkline.d.ts +1 -0
  59. package/dist/plugin/Status.d.ts +1 -0
  60. package/dist/plugin/Steps.d.ts +1 -0
  61. package/dist/plugin/Submit.d.ts +0 -1
  62. package/dist/plugin/Table.d.ts +1 -1
  63. package/dist/plugin/TableView.d.ts +1 -0
  64. package/dist/plugin/Tasks.d.ts +1 -0
  65. package/dist/plugin/TooltipWrapper.d.ts +1 -0
  66. package/dist/plugin/Video.d.ts +1 -0
  67. package/dist/plugin/WebComponent.d.ts +1 -0
  68. package/dist/plugin/Wizard.d.ts +11 -2
  69. package/dist/plugin/Wrapper.d.ts +1 -0
  70. package/dist/plugin.d.ts +8 -7
  71. package/dist/store/editor.d.ts +58 -22
  72. package/dist/store/node.d.ts +6 -0
  73. package/dist/style.css +1 -1
  74. package/dist/util.d.ts +1 -1
  75. package/package.json +9 -3
  76. package/src/component/schemaTpl.tsx +2157 -0
  77. package/src/plugin/Alert.tsx +87 -0
  78. package/src/plugin/AnchorNav.tsx +233 -0
  79. package/src/plugin/Audio.tsx +154 -0
  80. package/src/plugin/Avatar.tsx +77 -0
  81. package/src/plugin/Breadcrumb.tsx +107 -0
  82. package/src/plugin/Button.tsx +281 -0
  83. package/src/plugin/ButtonGroup.tsx +85 -0
  84. package/src/plugin/ButtonToolbar.tsx +87 -0
  85. package/src/plugin/CRUD.tsx +1835 -0
  86. package/src/plugin/Card.tsx +290 -0
  87. package/src/plugin/Cards.tsx +318 -0
  88. package/src/plugin/Carousel.tsx +377 -0
  89. package/src/plugin/Chart.tsx +218 -0
  90. package/src/plugin/CodeView.tsx +60 -0
  91. package/src/plugin/Collapse.tsx +136 -0
  92. package/src/plugin/CollapseGroup.tsx +167 -0
  93. package/src/plugin/Container.tsx +40 -0
  94. package/src/plugin/Custom.tsx +128 -0
  95. package/src/plugin/CustomRegion.tsx +156 -0
  96. package/src/plugin/Date.tsx +74 -0
  97. package/src/plugin/Datetime.tsx +68 -0
  98. package/src/plugin/Dialog.tsx +176 -0
  99. package/src/plugin/Divider.tsx +36 -0
  100. package/src/plugin/Drawer.tsx +214 -0
  101. package/src/plugin/DropDownButton.tsx +235 -0
  102. package/src/plugin/Each.tsx +150 -0
  103. package/src/plugin/ErrorRenderer.tsx +15 -0
  104. package/src/plugin/Flex.tsx +151 -0
  105. package/src/plugin/Form/ButtonGroupSelect.tsx +75 -0
  106. package/src/plugin/Form/ButtonToolbar.tsx +110 -0
  107. package/src/plugin/Form/ChainedSelect.tsx +70 -0
  108. package/src/plugin/Form/Checkbox.tsx +87 -0
  109. package/src/plugin/Form/Checkboxes.tsx +167 -0
  110. package/src/plugin/Form/CodeEditor.tsx +81 -0
  111. package/src/plugin/Form/Combo.tsx +582 -0
  112. package/src/plugin/Form/ConditionBuilder.tsx +315 -0
  113. package/src/plugin/Form/Control.tsx +139 -0
  114. package/src/plugin/Form/DiffEditor.tsx +111 -0
  115. package/src/plugin/Form/FieldSet.tsx +163 -0
  116. package/src/plugin/Form/Form.tsx +687 -0
  117. package/src/plugin/Form/Formula.tsx +79 -0
  118. package/src/plugin/Form/Group.tsx +295 -0
  119. package/src/plugin/Form/Hidden.tsx +44 -0
  120. package/src/plugin/Form/InputArray.tsx +228 -0
  121. package/src/plugin/Form/InputCity.tsx +93 -0
  122. package/src/plugin/Form/InputColor.tsx +123 -0
  123. package/src/plugin/Form/InputDate.tsx +175 -0
  124. package/src/plugin/Form/InputDateRange.tsx +225 -0
  125. package/src/plugin/Form/InputDateTime.tsx +183 -0
  126. package/src/plugin/Form/InputDateTimeRange.tsx +221 -0
  127. package/src/plugin/Form/InputEmail.tsx +33 -0
  128. package/src/plugin/Form/InputExcel.tsx +85 -0
  129. package/src/plugin/Form/InputFile.tsx +221 -0
  130. package/src/plugin/Form/InputGroup.tsx +96 -0
  131. package/src/plugin/Form/InputImage.tsx +266 -0
  132. package/src/plugin/Form/InputKV.tsx +72 -0
  133. package/src/plugin/Form/InputMonth.tsx +35 -0
  134. package/src/plugin/Form/InputMonthRange.tsx +195 -0
  135. package/src/plugin/Form/InputNumber.tsx +89 -0
  136. package/src/plugin/Form/InputPassword.tsx +33 -0
  137. package/src/plugin/Form/InputQuarter.tsx +35 -0
  138. package/src/plugin/Form/InputQuarterRange.tsx +195 -0
  139. package/src/plugin/Form/InputRange.tsx +121 -0
  140. package/src/plugin/Form/InputRating.tsx +78 -0
  141. package/src/plugin/Form/InputRepeat.tsx +57 -0
  142. package/src/plugin/Form/InputRichText.tsx +186 -0
  143. package/src/plugin/Form/InputSubForm.tsx +189 -0
  144. package/src/plugin/Form/InputTable.tsx +434 -0
  145. package/src/plugin/Form/InputTag.tsx +70 -0
  146. package/src/plugin/Form/InputText.tsx +186 -0
  147. package/src/plugin/Form/InputTime.tsx +85 -0
  148. package/src/plugin/Form/InputTree.tsx +229 -0
  149. package/src/plugin/Form/InputURL.tsx +34 -0
  150. package/src/plugin/Form/InputYear.tsx +35 -0
  151. package/src/plugin/Form/Item.tsx +327 -0
  152. package/src/plugin/Form/ListSelect.tsx +73 -0
  153. package/src/plugin/Form/LocationPicker.tsx +62 -0
  154. package/src/plugin/Form/MatrixCheckboxes.tsx +136 -0
  155. package/src/plugin/Form/NestedSelect.tsx +211 -0
  156. package/src/plugin/Form/Picker.tsx +209 -0
  157. package/src/plugin/Form/Radios.tsx +119 -0
  158. package/src/plugin/Form/Select.tsx +233 -0
  159. package/src/plugin/Form/Static.tsx +322 -0
  160. package/src/plugin/Form/Switch.tsx +107 -0
  161. package/src/plugin/Form/TabsTransfer.tsx +259 -0
  162. package/src/plugin/Form/Textarea.tsx +83 -0
  163. package/src/plugin/Form/Transfer.tsx +368 -0
  164. package/src/plugin/Form/TreeSelect.tsx +263 -0
  165. package/src/plugin/Form/UUID.tsx +48 -0
  166. package/src/plugin/Grid.tsx +798 -0
  167. package/src/plugin/HBox.tsx +727 -0
  168. package/src/plugin/IFrame.tsx +70 -0
  169. package/src/plugin/Image.tsx +314 -0
  170. package/src/plugin/Images.tsx +231 -0
  171. package/src/plugin/Json.tsx +69 -0
  172. package/src/plugin/Link.tsx +93 -0
  173. package/src/plugin/List.tsx +278 -0
  174. package/src/plugin/ListItem.tsx +229 -0
  175. package/src/plugin/Log.tsx +52 -0
  176. package/src/plugin/Mapping.tsx +149 -0
  177. package/src/plugin/Markdown.tsx +47 -0
  178. package/src/plugin/Nav.tsx +184 -0
  179. package/src/plugin/Operation.tsx +95 -0
  180. package/src/plugin/Others/Action.tsx +426 -0
  181. package/src/plugin/Others/BasicToolbar.tsx +585 -0
  182. package/src/plugin/Others/DataDebug.tsx +134 -0
  183. package/src/plugin/Others/TableCell.tsx +480 -0
  184. package/src/plugin/Others/Unknown.tsx +37 -0
  185. package/src/plugin/Page.tsx +306 -0
  186. package/src/plugin/Panel/AvailableRenderers.tsx +41 -0
  187. package/src/plugin/Panel/Code.tsx +44 -0
  188. package/src/plugin/Panel/Name.tsx +26 -0
  189. package/src/plugin/Panel/Outline.tsx +40 -0
  190. package/src/plugin/Panel.tsx +243 -0
  191. package/src/plugin/Plain.tsx +84 -0
  192. package/src/plugin/Progress.tsx +125 -0
  193. package/src/plugin/Property.tsx +139 -0
  194. package/src/plugin/QRCode.tsx +96 -0
  195. package/src/plugin/Reset.tsx +23 -0
  196. package/src/plugin/Service.tsx +162 -0
  197. package/src/plugin/Sparkline.tsx +40 -0
  198. package/src/plugin/Status.tsx +76 -0
  199. package/src/plugin/Steps.tsx +128 -0
  200. package/src/plugin/Submit.tsx +23 -0
  201. package/src/plugin/Table.tsx +428 -0
  202. package/src/plugin/TableView.tsx +709 -0
  203. package/src/plugin/Tabs.tsx +362 -0
  204. package/src/plugin/Tasks.tsx +274 -0
  205. package/src/plugin/Time.tsx +68 -0
  206. package/src/plugin/TooltipWrapper.tsx +193 -0
  207. package/src/plugin/Tpl.tsx +158 -0
  208. package/src/plugin/Video.tsx +158 -0
  209. package/src/plugin/WebComponent.tsx +53 -0
  210. package/src/plugin/Wizard.tsx +740 -0
  211. package/src/plugin/Wrapper.tsx +107 -0
  212. package/src/plugin.ts +1050 -0
  213. package/dist/150a58f3318ca7541ed9.png +0 -0
  214. package/dist/471adb97c322b226e589.png +0 -0
  215. package/dist/4de5f42360bc5946c3c2.png +0 -0
  216. package/dist/4e9968bba3855f088fed.png +0 -0
  217. package/dist/7f09c38ebc687fea847a.png +0 -0
  218. package/dist/c94073576487510314ea.png +0 -0
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 {
@@ -48,6 +49,7 @@ export declare class EditorManager {
48
49
  readonly hackIn: any;
49
50
  constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
50
51
  dynamicAddPlugin(pluginName: string): void;
52
+ buildRenderersAndPanels(): void;
51
53
  buildEventContext(idOrNode: string | EditorNodeType): {
52
54
  node: {
53
55
  parentId: string;
@@ -80,6 +82,8 @@ export declare class EditorManager {
80
82
  readonly clickable: boolean;
81
83
  readonly draggable: boolean;
82
84
  readonly moveable: boolean;
85
+ readonly canMoveUp: boolean;
86
+ readonly canMoveDown: boolean;
83
87
  readonly removable: boolean;
84
88
  readonly duplicatable: boolean;
85
89
  readonly replaceable: boolean;
@@ -158,6 +162,8 @@ export declare class EditorManager {
158
162
  readonly clickable: boolean;
159
163
  readonly draggable: boolean;
160
164
  readonly moveable: boolean;
165
+ readonly canMoveUp: boolean;
166
+ readonly canMoveDown: boolean;
161
167
  readonly removable: boolean;
162
168
  readonly duplicatable: boolean;
163
169
  readonly replaceable: boolean;
@@ -219,8 +225,8 @@ export declare class EditorManager {
219
225
  buildJSONSchemaUri(): void;
220
226
  buildToolbars(): void;
221
227
  collectPanels(node: EditorNodeType, triggerEvent?: boolean, secondFactor?: boolean): BasicPanelItem[];
222
- buildPanels(): void;
223
- collectRenderers(region?: string, id?: string): Promise<SubRendererInfo[]>;
228
+ buildPanels(curRendererId?: string): void;
229
+ collectRenderers(region?: string, activeContainerId?: string): Promise<SubRendererInfo[]>;
224
230
  buildRenderers(region?: string): Promise<void>;
225
231
  rebuild(): Promise<void>;
226
232
  /**
@@ -260,6 +266,12 @@ export declare class EditorManager {
260
266
  * 备注:可以根据渲染器ID添加新元素,也可以根据现有schema片段添加新元素
261
267
  */
262
268
  addElem(rendererIdOrSchema: string | Object): Promise<void>;
269
+ /**
270
+ * 在当前选中元素追加新的schema
271
+ * 备注:目前主要用在复制&粘贴快捷功能键中
272
+ * @param rendererSchema
273
+ */
274
+ appendSiblingSchema(rendererSchema: Object): Promise<void>;
263
275
  /**
264
276
  * 给插入面板使用的,将当前选中的节点插入到当前选中的节点容器内。
265
277
  * @param position
@@ -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;
@@ -5,6 +5,7 @@ export declare class CardPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class CardsPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -64,7 +65,7 @@ export declare class CardsPlugin extends BasePlugin {
64
65
  panelBodyCreator: (context: BaseEventContext) => any[];
65
66
  editDetail(id: string): void;
66
67
  buildEditorToolbar({ id, info, schema }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
67
- buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
68
+ buildEditorContextMenu({ id, schema, region, info, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
68
69
  filterProps(props: any): any;
69
70
  getRendererInfo(context: RendererInfoResolveEventContext): BasicRendererInfo | void;
70
71
  }
@@ -5,6 +5,7 @@ export declare class CarouselPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class ChartPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class CollapsePlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -10,12 +10,15 @@ export declare class CustomPlugin extends BasePlugin {
10
10
  description: string;
11
11
  tags: string[];
12
12
  icon: string;
13
+ docLink: string;
13
14
  scaffold: {
14
15
  type: string;
16
+ html: string;
15
17
  onMount: string;
16
18
  };
17
19
  previewSchema: {
18
20
  type: string;
21
+ html: string;
19
22
  onMount: string;
20
23
  };
21
24
  panelTitle: string;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @file 自定义代码
3
+ */
4
+ import { BasePlugin, BasicRendererInfo, RendererInfoResolveEventContext, RegionConfig } from '../plugin';
5
+ export declare class CustomPlugin extends BasePlugin {
6
+ rendererName: string;
7
+ $schema: string;
8
+ name: string;
9
+ isBaseComponent: boolean;
10
+ disabledRendererPlugin: boolean;
11
+ description: string;
12
+ docLink: string;
13
+ tags: string[];
14
+ icon: string;
15
+ scaffold: {
16
+ type: string;
17
+ html: string;
18
+ onMount: string;
19
+ body: {
20
+ type: string;
21
+ tpl: string;
22
+ }[];
23
+ };
24
+ previewSchema: {
25
+ type: string;
26
+ html: string;
27
+ onMount: string;
28
+ body: {
29
+ type: string;
30
+ tpl: string;
31
+ }[];
32
+ };
33
+ regions: Array<RegionConfig>;
34
+ panelTitle: string;
35
+ panelBody: any[];
36
+ /**
37
+ * 备注: 根据当前custom组件的schema中是否有body元素来启动容器模式,用于实现custom组件实现自定义容器类型
38
+ */
39
+ getRendererInfo(context: RendererInfoResolveEventContext): BasicRendererInfo | void;
40
+ }
@@ -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
  };
@@ -38,6 +38,6 @@ export declare class DropDownButtonPlugin extends BasePlugin {
38
38
  panelBodyCreator: (context: BaseEventContext) => any;
39
39
  buildEditorToolbar({ id, info }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
40
40
  editDetail(id: string): void;
41
- buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
41
+ buildEditorContextMenu({ id, schema, region, info, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
42
42
  filterProps(props: any): any;
43
43
  }
@@ -30,6 +30,6 @@ export declare class EachPlugin extends BasePlugin {
30
30
  panelBodyCreator: (context: BaseEventContext) => any[];
31
31
  filterProps(props: any): any;
32
32
  buildEditorToolbar({ id, info }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
33
- buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
33
+ buildEditorContextMenu({ id, schema, region, info, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
34
34
  editDetail(id: string): void;
35
35
  }
@@ -7,6 +7,7 @@ export declare class FlexPlugin extends BasePlugin {
7
7
  isBaseComponent: boolean;
8
8
  icon: string;
9
9
  description: string;
10
+ docLink: string;
10
11
  tags: string[];
11
12
  scaffold: {
12
13
  type: string;
@@ -6,6 +6,7 @@ export declare class ControlPlugin extends BasePlugin {
6
6
  isBaseComponent: boolean;
7
7
  icon: string;
8
8
  description: string;
9
+ docLink: string;
9
10
  tags: string[];
10
11
  scaffold: {
11
12
  type: string;
@@ -1,4 +1,3 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { BasePlugin, ChangeEventContext, BaseEventContext, PluginEvent, RegionConfig, ScaffoldForm } from '../../plugin';
3
2
  export declare class FormPlugin extends BasePlugin {
4
3
  rendererName: string;
@@ -10,8 +9,25 @@ export declare class FormPlugin extends BasePlugin {
10
9
  docLink: string;
11
10
  tags: string[];
12
11
  icon: string;
13
- scaffold: SchemaObject;
14
- previewSchema: SchemaObject;
12
+ scaffold: {
13
+ type: string;
14
+ title: string;
15
+ body: {
16
+ label: string;
17
+ type: string;
18
+ name: string;
19
+ }[];
20
+ };
21
+ previewSchema: {
22
+ type: string;
23
+ panelClassName: string;
24
+ mode: string;
25
+ body: {
26
+ label: string;
27
+ name: string;
28
+ type: string;
29
+ }[];
30
+ };
15
31
  scaffoldForm: ScaffoldForm;
16
32
  regions: Array<RegionConfig>;
17
33
  panelTitle: string;
@@ -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>;
@@ -6,6 +6,7 @@ export declare class URLControlPlugin extends TextControlPlugin {
6
6
  isBaseComponent: boolean;
7
7
  icon: string;
8
8
  description: string;
9
+ docLink: string;
9
10
  scaffold: {
10
11
  type: string;
11
12
  label: string;
@@ -13,6 +13,8 @@ export declare class SwitchControlPlugin extends BasePlugin {
13
13
  type: string;
14
14
  option: string;
15
15
  name: string;
16
+ falseValue: boolean;
17
+ trueValue: boolean;
16
18
  };
17
19
  previewSchema: any;
18
20
  panelTitle: string;
@@ -7,6 +7,7 @@ export declare class GridPlugin extends BasePlugin {
7
7
  name: string;
8
8
  isBaseComponent: boolean;
9
9
  description: string;
10
+ docLink: string;
10
11
  tags: string[];
11
12
  icon: string;
12
13
  scaffold: {
@@ -9,6 +9,7 @@ export declare class HBoxPlugin extends BasePlugin {
9
9
  isBaseComponent: boolean;
10
10
  icon: string;
11
11
  description: string;
12
+ docLink: string;
12
13
  tags: string[];
13
14
  scaffold: {
14
15
  type: string;
@@ -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>;
@@ -5,6 +5,7 @@ export declare class JsonPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class ListPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -49,6 +50,6 @@ export declare class ListPlugin extends BasePlugin {
49
50
  };
50
51
  editDetail(id: string): void;
51
52
  buildEditorToolbar({ id, info, schema }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
52
- buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
53
+ buildEditorContextMenu({ id, schema, region, info, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
53
54
  getRendererInfo(context: RendererInfoResolveEventContext): BasicRendererInfo | void;
54
55
  }
@@ -5,6 +5,7 @@ export declare class MappingPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class MarkdownPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class NavPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { BasePlugin, BasicPanelItem, BuildPanelEventContext } from '../../plugin';
2
+ /**
3
+ * 大纲面板
4
+ */
5
+ export declare class OutlinePlugin extends BasePlugin {
6
+ order: number;
7
+ buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
8
+ }
@@ -5,6 +5,7 @@ export declare class ProgressPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class QRCodePlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -6,7 +6,6 @@ export declare class ResetPlugin extends ButtonPlugin {
6
6
  isBaseComponent: boolean;
7
7
  icon: string;
8
8
  description: string;
9
- docLink: string;
10
9
  panelTitle: string;
11
10
  scaffold: any;
12
11
  previewSchema: any;
@@ -5,6 +5,7 @@ export declare class ServicePlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -8,6 +8,7 @@ export declare class SparklinePlugin extends BasePlugin {
8
8
  name: string;
9
9
  isBaseComponent: boolean;
10
10
  description: string;
11
+ docLink: string;
11
12
  tags: string[];
12
13
  icon: string;
13
14
  scaffold: {
@@ -5,6 +5,7 @@ export declare class StatusPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -6,6 +6,7 @@ export declare class StepsPlugin extends BasePlugin {
6
6
  isBaseComponent: boolean;
7
7
  icon: string;
8
8
  description: string;
9
+ docLink: string;
9
10
  tags: string[];
10
11
  scaffold: {
11
12
  type: string;
@@ -5,7 +5,6 @@ export declare class SubmitPlugin extends ButtonPlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
- docLink: string;
9
8
  panelTitle: string;
10
9
  scaffold: any;
11
10
  previewSchema: any;
@@ -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;
@@ -10,6 +10,7 @@ export declare class TableViewPlugin extends BasePlugin {
10
10
  isBaseComponent: boolean;
11
11
  icon: string;
12
12
  description: string;
13
+ docLink: string;
13
14
  tags: string[];
14
15
  scaffold: {
15
16
  type: string;
@@ -5,6 +5,7 @@ export declare class TasksPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class TooltipWrapperPlugin extends BasePlugin {
5
5
  isBaseComponent: boolean;
6
6
  name: string;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -5,6 +5,7 @@ export declare class VideoPlugin extends BasePlugin {
5
5
  name: string;
6
6
  isBaseComponent: boolean;
7
7
  description: string;
8
+ docLink: string;
8
9
  tags: string[];
9
10
  icon: string;
10
11
  scaffold: {
@@ -6,6 +6,7 @@ export declare class WebComponentPlugin extends BasePlugin {
6
6
  name: string;
7
7
  isBaseComponent: boolean;
8
8
  description: string;
9
+ docLink: string;
9
10
  tags: string[];
10
11
  icon: string;
11
12
  scaffold: {
@@ -1,4 +1,3 @@
1
- import { SchemaObject } from 'amis';
2
1
  import { BaseEventContext, BasePlugin, BasicToolbarItem, VRendererConfig } from '../plugin';
3
2
  export declare class WizardPlugin extends BasePlugin {
4
3
  rendererName: string;
@@ -9,7 +8,17 @@ export declare class WizardPlugin extends BasePlugin {
9
8
  docLink: string;
10
9
  tags: string[];
11
10
  icon: string;
12
- scaffold: SchemaObject;
11
+ scaffold: {
12
+ type: string;
13
+ steps: {
14
+ title: string;
15
+ body: {
16
+ type: string;
17
+ label: string;
18
+ name: string;
19
+ }[];
20
+ }[];
21
+ };
13
22
  previewSchema: {
14
23
  type: string;
15
24
  className: string;
@@ -6,6 +6,7 @@ export declare class WrapperPlugin extends BasePlugin {
6
6
  name: string;
7
7
  isBaseComponent: boolean;
8
8
  description: string;
9
+ docLink: string;
9
10
  tags: string[];
10
11
  icon: string;
11
12
  scaffold: {
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
  */
@@ -281,10 +281,10 @@ export interface ToolbarItem {
281
281
  level?: 'primary' | 'secondary' | 'special';
282
282
  className?: string;
283
283
  draggable?: boolean;
284
- onDragStart?: (e: React.DragEvent) => void;
284
+ onDragStart?: (e: any) => void;
285
285
  icon?: string;
286
286
  iconSvg?: string;
287
- onClick?: (e: React.MouseEvent) => void;
287
+ onClick?: (e: any) => void;
288
288
  tooltip?: string;
289
289
  placement?: 'top' | 'bottom' | 'right' | 'left';
290
290
  }
@@ -311,7 +311,7 @@ export interface PanelItem {
311
311
  nodeId?: string;
312
312
  key: string;
313
313
  icon: string;
314
- title: string;
314
+ title: string | JSX.Element;
315
315
  component?: React.ComponentType<PanelProps | any>;
316
316
  order: number;
317
317
  position?: 'left' | 'right';
@@ -475,6 +475,7 @@ export interface PluginEventListener {
475
475
  onDndAccept?: (event: PluginEvent<DragEventContext>) => false | void;
476
476
  onBuildPanels?: (event: PluginEvent<BuildPanelEventContext>) => void;
477
477
  onBuildContextMenus?: (event: PluginEvent<ContextMenuEventContext>) => void;
478
+ onBuildToolbars?: (event: PluginEvent<BaseEventContext>) => void;
478
479
  onSelectionChange?: (event: PluginEvent<SelectionEventContext>) => void;
479
480
  onPreventClick?: (event: PluginEvent<PreventClickEventContext>) => false | void;
480
481
  onWidthChangeStart?: (event: PluginEvent<ResizeMoveEventContext, {
@@ -586,7 +587,7 @@ export declare abstract class BasePlugin implements PluginInterface {
586
587
  * @param info
587
588
  * @param menus
588
589
  */
589
- buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
590
+ buildEditorContextMenu({ id, schema, region, info, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
590
591
  buildEditorToolbar({ id, schema, info }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
591
592
  renderPlaceholder(text: string, key?: any): React.DetailedReactHTMLElement<{
592
593
  key: any;