amis-editor-core 5.2.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 (105) hide show
  1. package/lib/cebfe0bc5a1dbde02da1.svg +10 -0
  2. package/lib/compat.d.ts +30 -0
  3. package/lib/component/Breadcrumb.d.ts +33 -0
  4. package/lib/component/ClassNameControl.d.ts +31 -0
  5. package/lib/component/CommonConfigWrapper.d.ts +6 -0
  6. package/lib/component/ContainerWrapper.d.ts +12 -0
  7. package/lib/component/Editor.d.ts +99 -0
  8. package/lib/component/HighlightBox.d.ts +29 -0
  9. package/lib/component/IFrameBridge.d.ts +32 -0
  10. package/lib/component/IFramePreview.d.ts +38 -0
  11. package/lib/component/MiniEditor.d.ts +9 -0
  12. package/lib/component/NodeWrapper.d.ts +20 -0
  13. package/lib/component/Panel/AMisCodeEditor.d.ts +37 -0
  14. package/lib/component/Panel/AvailableRenderersPanel.d.ts +10 -0
  15. package/lib/component/Panel/CodeEditorPanel.d.ts +6 -0
  16. package/lib/component/Panel/ContextMenuPanel.d.ts +8 -0
  17. package/lib/component/Panel/DrawerPanel.d.ts +15 -0
  18. package/lib/component/Panel/DrawerRendererPanel.d.ts +15 -0
  19. package/lib/component/Panel/InsertSubRendererPanel.d.ts +11 -0
  20. package/lib/component/Panel/LeftPanels.d.ts +20 -0
  21. package/lib/component/Panel/Outline.d.ts +18 -0
  22. package/lib/component/Panel/RenderersPanel.d.ts +31 -0
  23. package/lib/component/Panel/RightPanels.d.ts +21 -0
  24. package/lib/component/Panel/TargetNamePanel.d.ts +7 -0
  25. package/lib/component/PopOverForm.d.ts +22 -0
  26. package/lib/component/Preview.d.ts +67 -0
  27. package/lib/component/RegionHLBox.d.ts +20 -0
  28. package/lib/component/RegionWrapper.d.ts +206 -0
  29. package/lib/component/RendererThumb.d.ts +22 -0
  30. package/lib/component/ScaffoldModal.d.ts +24 -0
  31. package/lib/component/SubEditor.d.ts +67 -0
  32. package/lib/component/VRenderer.d.ts +191 -0
  33. package/lib/component/base/BackTop.d.ts +26 -0
  34. package/lib/component/base/ErrorRenderer.d.ts +4 -0
  35. package/lib/component/base/SearchCustomRendererPanel.d.ts +15 -0
  36. package/lib/component/base/SearchPanel.d.ts +83 -0
  37. package/lib/component/base/SearchRendererPanel.d.ts +19 -0
  38. package/lib/component/base/WidthDraggableBtn.d.ts +16 -0
  39. package/lib/component/base/WidthDraggableContainer.d.ts +2 -0
  40. package/lib/component/factory.d.ts +19 -0
  41. package/lib/dnd/default.d.ts +47 -0
  42. package/lib/dnd/index.d.ts +119 -0
  43. package/lib/dnd/interface.d.ts +14 -0
  44. package/lib/dnd/position-h.d.ts +7 -0
  45. package/lib/env.d.ts +5 -0
  46. package/lib/icons/index.d.ts +2 -0
  47. package/lib/index.d.ts +36 -0
  48. package/lib/index.min.js +1 -0
  49. package/lib/manager.d.ts +509 -0
  50. package/lib/mocker.d.ts +1 -0
  51. package/lib/plugin/AvailableRenderers.d.ts +8 -0
  52. package/lib/plugin/BasicToolbar.d.ts +11 -0
  53. package/lib/plugin/Code.d.ts +9 -0
  54. package/lib/plugin/DataDebug.d.ts +19 -0
  55. package/lib/plugin/ErrorRenderer.d.ts +7 -0
  56. package/lib/plugin/Name.d.ts +8 -0
  57. package/lib/plugin/Outline.d.ts +8 -0
  58. package/lib/plugin/Unknown.d.ts +5 -0
  59. package/lib/plugin.d.ts +639 -0
  60. package/lib/store/editor.d.ts +1048 -0
  61. package/lib/store/node.d.ts +281 -0
  62. package/lib/style.css +1 -0
  63. package/lib/tpl.d.ts +5 -0
  64. package/lib/util.d.ts +80 -0
  65. package/package.json +102 -0
  66. package/scss/_backTop.scss +55 -0
  67. package/scss/_bcn.scss +157 -0
  68. package/scss/_classname-picker.scss +57 -0
  69. package/scss/_context-menu-setting.scss +109 -0
  70. package/scss/_data-chain.scss +39 -0
  71. package/scss/_leftPanel.scss +237 -0
  72. package/scss/_mixin.scss +95 -0
  73. package/scss/_outline.scss +206 -0
  74. package/scss/_renderers.scss +536 -0
  75. package/scss/_rightPanel.scss +424 -0
  76. package/scss/_searchRendererPanel.scss +244 -0
  77. package/scss/_selection.scss +6 -0
  78. package/scss/_tableview.scss +53 -0
  79. package/scss/_targetname.scss +30 -0
  80. package/scss/_tooltip.scss +111 -0
  81. package/scss/_variables.scss +41 -0
  82. package/scss/control/_api-control.scss +61 -0
  83. package/scss/control/_badge-control.scss +46 -0
  84. package/scss/control/_dateshortcut-control.scss +108 -0
  85. package/scss/control/_formItem-control.scss +121 -0
  86. package/scss/control/_formula-control.scss +108 -0
  87. package/scss/control/_option-control.scss +170 -0
  88. package/scss/control/_switch-more-control.scss +121 -0
  89. package/scss/control/_validation-control.scss +101 -0
  90. package/scss/editor.scss +1563 -0
  91. package/scss/style-control/_background.scss +204 -0
  92. package/scss/style-control/_border.scss +105 -0
  93. package/scss/style-control/_box-model.scss +100 -0
  94. package/scss/style-control/_box-shadow.scss +12 -0
  95. package/scss/style-control/_font.scss +28 -0
  96. package/scss/style-control/_size.scss +40 -0
  97. package/scss/style-control/_style-common.scss +22 -0
  98. package/static/Code-hover.png +0 -0
  99. package/static/Code.png +0 -0
  100. package/static/Outline-hover.png +0 -0
  101. package/static/Outline.png +0 -0
  102. package/static/Renderers-hover.png +0 -0
  103. package/static/Renderers.png +0 -0
  104. package/static/empty.png +0 -0
  105. package/static/side_hide_left.svg +10 -0
@@ -0,0 +1,509 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="lodash" />
3
+ /**
4
+ * @file 把一些功能性的东西放在了这个里面,辅助 compoennt/Editor.tsx 组件的。
5
+ * 编辑器非 UI 相关的东西应该放在这。
6
+ */
7
+ import { RenderOptions } from 'amis-core';
8
+ import { PluginInterface, BasicPanelItem, RendererInfo, SubRendererInfo, PluginEvent, RegionConfig, ContextMenuItem, ContextMenuEventContext, EventContext, PluginEventFn, ScaffoldForm } from './plugin';
9
+ import { EditorStoreType, SubEditorContext } from './store/editor';
10
+ import { DataSchema } from 'amis';
11
+ import { EditorNodeType } from './store/node';
12
+ import { EditorProps } from './component/Editor';
13
+ import { EditorDNDManager } from './dnd';
14
+ import { IScopedContext } from 'amis';
15
+ import { SchemaObject } from 'amis/lib/Schema';
16
+ import type { RendererConfig } from 'amis-core/lib/factory';
17
+ import type { PluginActions, PluginEvents, RendererEvent } from 'amis-editor-comp/dist/renderers/event-action';
18
+ export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
19
+ }
20
+ export interface PluginClass {
21
+ new (manager: EditorManager): PluginInterface;
22
+ id?: string;
23
+ }
24
+ /**
25
+ * 注册默认的插件。
26
+ * @param editor
27
+ */
28
+ export declare function registerEditorPlugin(klass: PluginClass): void;
29
+ /**
30
+ * 获取当前已经注册的插件。
31
+ */
32
+ export declare function getEditorPlugins(): PluginClass[];
33
+ /**
34
+ * 注销插件
35
+ */
36
+ export declare function unRegisterEditorPlugin(id: string): void;
37
+ /**
38
+ * 在 component/Editor.tsx 里面实例化的。
39
+ * 辅助 component/Editor.tsx 实现一些非 UI 相关的功能。
40
+ */
41
+ export declare class EditorManager {
42
+ readonly config: EditorManagerConfig;
43
+ readonly store: EditorStoreType;
44
+ readonly parent?: EditorManager | undefined;
45
+ readonly plugins: Array<PluginInterface>;
46
+ readonly env: RenderOptions;
47
+ toDispose: Array<() => void>;
48
+ readonly dnd: EditorDNDManager;
49
+ readonly id: string;
50
+ disableHover: boolean;
51
+ private clipboardData;
52
+ readonly hackIn: any;
53
+ amisStore: Object;
54
+ readonly broadcasts: RendererEvent[];
55
+ readonly pluginEvents: PluginEvents;
56
+ readonly pluginActions: PluginActions;
57
+ dataSchema: DataSchema;
58
+ readonly isInFrame: boolean;
59
+ constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
60
+ dynamicAddPlugin(pluginName: string): void;
61
+ updateAMISContext(amisStore: Object): void;
62
+ buildRenderersAndPanels(): void;
63
+ buildEventContext(idOrNode: string | EditorNodeType): {
64
+ node: {
65
+ parentId: string;
66
+ parentRegion: string;
67
+ isCommonConfig: boolean;
68
+ id: string;
69
+ type: string;
70
+ label: string;
71
+ regionInfo: (RegionConfig & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>>) | undefined;
72
+ path: string;
73
+ schemaPath: string;
74
+ region: string;
75
+ preferTag: string;
76
+ state: any;
77
+ widthMutable: boolean;
78
+ heightMutable: boolean;
79
+ memberIndex: number;
80
+ folded: boolean;
81
+ patched: boolean;
82
+ x: number;
83
+ y: number;
84
+ w: number;
85
+ h: number;
86
+ children: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>, [undefined]>>;
87
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
88
+ getData: import("mobx-state-tree").IType<() => any, () => any, () => any>;
89
+ } & {
90
+ readonly info: RendererInfo;
91
+ setInfo(value: RendererInfo): void;
92
+ readonly rendererConfig: RendererConfig | undefined;
93
+ setRendererConfig(value: RendererConfig): void;
94
+ readonly isVitualRenderer: boolean;
95
+ readonly clickable: boolean;
96
+ readonly draggable: boolean;
97
+ readonly moveable: boolean;
98
+ readonly canMoveUp: boolean;
99
+ readonly canMoveDown: boolean;
100
+ readonly removable: boolean;
101
+ readonly duplicatable: boolean;
102
+ readonly replaceable: boolean;
103
+ memberImmutable(region: string): boolean;
104
+ readonly isRegion: boolean;
105
+ readonly childRegions: any[];
106
+ readonly uniqueChildren: any[];
107
+ readonly sameIdChild: any;
108
+ readonly singleRegion: boolean;
109
+ isExists(id: string): boolean;
110
+ getChildById(id: string): any;
111
+ readonly parent: any;
112
+ readonly ancestorField: any;
113
+ readonly host: any;
114
+ readonly firstChild: any;
115
+ readonly index: any;
116
+ readonly prevSibling: any;
117
+ readonly nextSibling: any;
118
+ readonly schema: any;
119
+ readonly schemaParent: any;
120
+ readonly isSecondFactor: boolean;
121
+ } & {
122
+ updateIsCommonConfig: (value: boolean) => void;
123
+ addChild(props: {
124
+ id: string;
125
+ type: string;
126
+ label: string;
127
+ path: string;
128
+ isCommonConfig?: boolean | undefined;
129
+ info?: RendererInfo | undefined;
130
+ region?: string | undefined;
131
+ getData?: (() => any) | undefined;
132
+ preferTag?: string | undefined;
133
+ schemaPath?: string | undefined;
134
+ regionInfo?: RegionConfig | undefined;
135
+ widthMutable?: boolean | undefined;
136
+ memberIndex?: number | undefined;
137
+ }): any;
138
+ removeChild(child: any): void;
139
+ toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
140
+ patch(store: any, force?: boolean): void;
141
+ updateSchema(value: any): void;
142
+ setComponent(value: any): void;
143
+ getComponent(): any;
144
+ calculateHighlightBox(root?: any): void;
145
+ resetHighlightBox(root: any): void;
146
+ updateState(state: any, replace?: boolean): void;
147
+ setWidthMutable(value: any): void;
148
+ setHeightMutable(value: any): void;
149
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
150
+ parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
151
+ parentRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
152
+ isCommonConfig: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
153
+ id: import("mobx-state-tree").IType<string | undefined, string, string>;
154
+ type: import("mobx-state-tree").IType<string | undefined, string, string>;
155
+ label: import("mobx-state-tree").IType<string | undefined, string, string>;
156
+ regionInfo: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>;
157
+ path: import("mobx-state-tree").IType<string | undefined, string, string>;
158
+ schemaPath: import("mobx-state-tree").IType<string | undefined, string, string>;
159
+ region: import("mobx-state-tree").IType<string | undefined, string, string>;
160
+ preferTag: import("mobx-state-tree").IType<string | undefined, string, string>;
161
+ state: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
162
+ widthMutable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
163
+ heightMutable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
164
+ memberIndex: import("mobx-state-tree").IType<number | undefined, number, number>;
165
+ folded: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
166
+ patched: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
167
+ x: import("mobx-state-tree").IType<number | undefined, number, number>;
168
+ y: import("mobx-state-tree").IType<number | undefined, number, number>;
169
+ w: import("mobx-state-tree").IType<number | undefined, number, number>;
170
+ h: import("mobx-state-tree").IType<number | undefined, number, number>;
171
+ children: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>, [undefined]>;
172
+ }, {
173
+ getData: import("mobx-state-tree").IType<() => any, () => any, () => any>;
174
+ } & {
175
+ readonly info: RendererInfo;
176
+ setInfo(value: RendererInfo): void;
177
+ readonly rendererConfig: RendererConfig | undefined;
178
+ setRendererConfig(value: RendererConfig): void;
179
+ readonly isVitualRenderer: boolean;
180
+ readonly clickable: boolean;
181
+ readonly draggable: boolean;
182
+ readonly moveable: boolean;
183
+ readonly canMoveUp: boolean;
184
+ readonly canMoveDown: boolean;
185
+ readonly removable: boolean;
186
+ readonly duplicatable: boolean;
187
+ readonly replaceable: boolean;
188
+ memberImmutable(region: string): boolean;
189
+ readonly isRegion: boolean;
190
+ readonly childRegions: any[];
191
+ readonly uniqueChildren: any[];
192
+ readonly sameIdChild: any;
193
+ readonly singleRegion: boolean;
194
+ isExists(id: string): boolean;
195
+ getChildById(id: string): any;
196
+ readonly parent: any;
197
+ readonly ancestorField: any;
198
+ readonly host: any;
199
+ readonly firstChild: any;
200
+ readonly index: any;
201
+ readonly prevSibling: any;
202
+ readonly nextSibling: any;
203
+ readonly schema: any;
204
+ readonly schemaParent: any;
205
+ readonly isSecondFactor: boolean;
206
+ } & {
207
+ updateIsCommonConfig: (value: boolean) => void;
208
+ addChild(props: {
209
+ id: string;
210
+ type: string;
211
+ label: string;
212
+ path: string;
213
+ isCommonConfig?: boolean | undefined;
214
+ info?: RendererInfo | undefined;
215
+ region?: string | undefined;
216
+ getData?: (() => any) | undefined;
217
+ preferTag?: string | undefined;
218
+ schemaPath?: string | undefined;
219
+ regionInfo?: RegionConfig | undefined;
220
+ widthMutable?: boolean | undefined;
221
+ memberIndex?: number | undefined;
222
+ }): any;
223
+ removeChild(child: any): void;
224
+ toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
225
+ patch(store: any, force?: boolean): void;
226
+ updateSchema(value: any): void;
227
+ setComponent(value: any): void;
228
+ getComponent(): any;
229
+ calculateHighlightBox(root?: any): void;
230
+ resetHighlightBox(root: any): void;
231
+ updateState(state: any, replace?: boolean): void;
232
+ setWidthMutable(value: any): void;
233
+ setHeightMutable(value: any): void;
234
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
235
+ id: string;
236
+ info: RendererInfo;
237
+ path: string;
238
+ schemaPath: string;
239
+ schema: any;
240
+ data: string;
241
+ };
242
+ /**
243
+ * 构建 JSONSchema Uri,这样可以用代码模式编辑了。
244
+ */
245
+ buildJSONSchemaUri(): void;
246
+ buildToolbars(): void;
247
+ collectPanels(node: EditorNodeType, triggerEvent?: boolean, secondFactor?: boolean): BasicPanelItem[];
248
+ buildPanels(curRendererId?: string): void;
249
+ collectRenderers(region?: string, activeContainerId?: string): Promise<SubRendererInfo[]>;
250
+ buildRenderers(region?: string): Promise<void>;
251
+ rebuild(): Promise<void>;
252
+ /**
253
+ * 刷新属性配置面板
254
+ * 备注1: 组件类型更换时需要,以及表单编辑器实体绑定需要;
255
+ * 备注2: 仅适用于新版属性配置面板(仅有一个一级属性配置面板);
256
+ * 备注3: 建议优先使用当前选中组件ID(this.store.activeId)来更新属性配置面板;
257
+ * @param pluginType 组件类型
258
+ */
259
+ updateConfigPanel(pluginType: string): void;
260
+ /**
261
+ * 可用组件面板里面会点进来,不同的区域可能可插入的组件不一样。
262
+ * @param region 区域的 key
263
+ */
264
+ switchToRegion(region: string): void;
265
+ /**
266
+ * 显示插入面板
267
+ * @param region
268
+ * @param preferTag
269
+ */
270
+ showInsertPanel(region: string, id?: string, preferTag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string): Promise<void>;
271
+ /**
272
+ * 显示组件更换面板
273
+ * @param region
274
+ * @param preferTag
275
+ */
276
+ showReplacePanel(id: string, preferTag?: string): void;
277
+ /** 显示左侧组件面板(主要在属性面板中使用)*/
278
+ showRendererPanel(tag?: string, msg?: string): void;
279
+ readonly listeners: Array<{
280
+ type: string;
281
+ fn: PluginEventFn;
282
+ }>;
283
+ on(event: string, fn: PluginEventFn): void;
284
+ off(event: string, fn: PluginEventFn): void;
285
+ /**
286
+ * 派发事件。
287
+ * @param type
288
+ * @param context
289
+ */
290
+ trigger<T extends EventContext>(type: string, context: T): PluginEvent<T>;
291
+ /**
292
+ * 在当前选中元素插入或追加新的元素
293
+ * @param rendererIdOrSchema
294
+ * 备注:可以根据渲染器ID添加新元素,也可以根据现有schema片段添加新元素
295
+ */
296
+ addElem(rendererIdOrSchema: string | Object): Promise<void>;
297
+ /**
298
+ * 在当前选中元素追加新的schema
299
+ * 备注:目前主要用在复制&粘贴快捷功能键中
300
+ * @param rendererSchema
301
+ */
302
+ appendSiblingSchema(rendererSchema: Object): Promise<void>;
303
+ /**
304
+ * 给插入面板使用的,将当前选中的节点插入到当前选中的节点容器内。
305
+ * @param position
306
+ */
307
+ insert(): Promise<void>;
308
+ /**
309
+ * 给插入面板使用的,替换组件类型。
310
+ * @param position
311
+ */
312
+ replace(): Promise<void>;
313
+ /**
314
+ * 入口在 Preview 里面,用来获取渲染器对应的编辑器信息。
315
+ * 拿到这些信息后会在渲染原本渲染器的地方包一层,并创建高亮框在点选或者 hover 的时候显示。
316
+ * @param renderer amis元素渲染器,比如 { type: 'audio', component: 'xxx渲染器'}
317
+ * @param path 节点路径
318
+ * @param schema 节点 schema 数据
319
+ */
320
+ getEditorInfo(renderer: RendererConfig, path: string, schema: any): RendererInfo | null | undefined;
321
+ /**
322
+ * 面板的配置修改方法,不直接调用 store.changeValue 的原因是,
323
+ * 这里面还有事件逻辑,插件里面可以写些逻辑。
324
+ * @param value
325
+ * @param diff
326
+ */
327
+ panelChangeValue(value: any, diff?: any): void;
328
+ /**
329
+ * 打开子编辑器,比如弹框什么的,没办法直接编辑器,靠弹窗个新的编辑器来编辑。
330
+ * @param config
331
+ */
332
+ openSubEditor(config: SubEditorContext): void;
333
+ /**
334
+ * 打开对应节点的右键菜单。
335
+ * @param id
336
+ * @param region
337
+ * @param info
338
+ */
339
+ openContextMenu(id: string, region: string, info: {
340
+ x: number;
341
+ y: number;
342
+ }): void;
343
+ buildContextMenus(context: ContextMenuEventContext): ContextMenuItem[];
344
+ closeContextMenu(): void;
345
+ /**
346
+ * 将当前选中的节点上移
347
+ */
348
+ moveUp(): void;
349
+ /**
350
+ * 将当前选中的节点下移
351
+ */
352
+ moveDown(): void;
353
+ /**
354
+ * 删除节点
355
+ */
356
+ del(ids: string | Array<string>): void;
357
+ /**
358
+ * 重复节点
359
+ * @param id
360
+ */
361
+ duplicate(id: string | Array<string>): void;
362
+ /**
363
+ * 复制节点配置
364
+ * @param id
365
+ */
366
+ copy(id: string): void;
367
+ /**
368
+ * 剪切当前节点,并复制配置到剪切板。
369
+ * @param id
370
+ */
371
+ cut(id: string): void;
372
+ /**
373
+ * 在节点上应用粘贴。
374
+ * @param id
375
+ * @param region
376
+ */
377
+ paste(id: string, region?: string): Promise<void>;
378
+ /**
379
+ * 清空区域
380
+ * @param id
381
+ * @param region
382
+ */
383
+ emptyRegion(id: string, region: string): void;
384
+ /**
385
+ * 添加孩子,成功后返回节点,失败后返回 null。
386
+ * @param id 目标组件 id
387
+ * @param region 目标组件区域
388
+ * @param json
389
+ * @param position
390
+ */
391
+ addChild(id: string, region: string, json: any, beforeId?: string, subRenderer?: SubRendererInfo, dragInfo?: {
392
+ id: string;
393
+ type: string;
394
+ data: any;
395
+ }): any | null;
396
+ /**
397
+ * 移动节点
398
+ * @param id 目标组件 id
399
+ * @param region 目标组件区域
400
+ * @param sourceId 移动的节点 id
401
+ * @param beforeId 移动到哪个节点前面
402
+ */
403
+ move(id: string, region: string, sourceId: string, beforeId?: string): boolean;
404
+ /**
405
+ * 替换节点。
406
+ * @param id
407
+ * @param json
408
+ */
409
+ replaceChild(id: string, json: any, subRenderer?: SubRendererInfo, region?: string): boolean;
410
+ setActiveId(id: string): void;
411
+ /**
412
+ * 打开某节点的编辑面板
413
+ * @param id
414
+ */
415
+ openConfigPanel(id: string): void;
416
+ /**
417
+ * 打开某节点的代码面板
418
+ * @param id
419
+ */
420
+ openCodePanel(id: string): void;
421
+ toggleSelection(id: string): void;
422
+ setSelection(selections: Array<string>, id?: string): void;
423
+ startDrag(id: string, e: React.DragEvent): void;
424
+ scaffold(form: ScaffoldForm, value: any): Promise<SchemaObject>;
425
+ reScaffold(id: string, form: ScaffoldForm, value: any): Promise<void>;
426
+ lazyPatchSchema: import("lodash").DebouncedFunc<any>;
427
+ patching: boolean;
428
+ patchSchema(force?: boolean): void;
429
+ /**
430
+ * 把设置了特殊 region 的,hack 一下。
431
+ */
432
+ hackRenderers(renderers?: RendererConfig[]): void;
433
+ /**
434
+ * 入口在 Preview,用来生成包括元素头部快捷工具栏。
435
+ * @param info
436
+ * @param render
437
+ */
438
+ makeWrapper(info: RendererInfo, render: RendererConfig): any;
439
+ /**
440
+ * 用来生成属性配置面板。
441
+ * @param schema
442
+ */
443
+ makeSchemaFormRender(schema: {
444
+ body?: Array<any>;
445
+ controls?: Array<any>;
446
+ definitions?: any;
447
+ api?: any;
448
+ submitOnChange?: boolean;
449
+ justify?: boolean;
450
+ rendererName?: string;
451
+ formKey?: string;
452
+ }): ({ value, onChange, popOverContainer, id, store, node }: import("./plugin").PanelProps) => JSX.Element;
453
+ onWidthChangeStart(e: MouseEvent, ctx: {
454
+ dom: HTMLElement;
455
+ node: EditorNodeType;
456
+ resizer: HTMLElement;
457
+ }): PluginEvent<{
458
+ nativeEvent: MouseEvent;
459
+ dom: HTMLElement;
460
+ node: EditorNodeType;
461
+ resizer: HTMLElement;
462
+ }, any>;
463
+ onHeightChangeStart(e: MouseEvent, ctx: {
464
+ dom: HTMLElement;
465
+ node: EditorNodeType;
466
+ resizer: HTMLElement;
467
+ }): PluginEvent<{
468
+ nativeEvent: MouseEvent;
469
+ dom: HTMLElement;
470
+ node: EditorNodeType;
471
+ resizer: HTMLElement;
472
+ }, any>;
473
+ onSizeChangeStart(e: MouseEvent, ctx: {
474
+ dom: HTMLElement;
475
+ node: EditorNodeType;
476
+ resizer: HTMLElement;
477
+ }): PluginEvent<{
478
+ nativeEvent: MouseEvent;
479
+ dom: HTMLElement;
480
+ node: EditorNodeType;
481
+ resizer: HTMLElement;
482
+ }, any>;
483
+ openNodePopOverForm(id: string | EditorNodeType): void;
484
+ /**
485
+ * 更新广播事件集(还没想好怎么存)
486
+ *
487
+ * @param {string} key 插件名称
488
+ * @param {RendererEvent[]} events 事件集
489
+ * @memberof EditorManager
490
+ */
491
+ addBroadcast(event: RendererEvent): void;
492
+ /**
493
+ * 删除指定广播(还没想好怎么存)
494
+ *
495
+ * @param {string} id
496
+ * @memberof EditorManager
497
+ */
498
+ removeBroadcast(id: string): void;
499
+ /**
500
+ * 获取上下文数据结构
501
+ * @param id
502
+ */
503
+ getContextSchemas(id: string | EditorNodeType, withoutSuper?: boolean): Promise<import("json-schema").JSONSchema7[]>;
504
+ beforeDispatchEvent(originHook: any, e: any, component: any, scoped: IScopedContext, data: any, broadcasts?: any): void;
505
+ /**
506
+ * 销毁函数
507
+ */
508
+ dispose(): void;
509
+ }
@@ -0,0 +1 @@
1
+ export declare function mockValue(schema: any): string | string[];
@@ -0,0 +1,8 @@
1
+ import { BuildPanelEventContext, BasePlugin, BasicPanelItem } from '../plugin';
2
+ /**
3
+ * 添加源码编辑功能
4
+ */
5
+ export declare class AvailableRenderersPlugin extends BasePlugin {
6
+ order: number;
7
+ buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { BasePlugin, BaseEventContext, BasicToolbarItem, ContextMenuItem, ContextMenuEventContext, BasicPanelItem, BuildPanelEventContext, PluginEvent, InsertEventContext } from '../plugin';
2
+ /**
3
+ * 用来给当前选中的元素添加一些基本的工具栏按钮。
4
+ */
5
+ export declare class BasicToolbarPlugin extends BasePlugin {
6
+ order: number;
7
+ buildEditorToolbar({ id, schema }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
8
+ buildEditorContextMenu({ id, schema, region, selections }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
9
+ buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
10
+ afterInsert(event: PluginEvent<InsertEventContext>): void;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { BuildPanelEventContext, BasePlugin, BasicPanelItem, RendererJSONSchemaResolveEventContext } from '../plugin';
2
+ /**
3
+ * 添加源码编辑功能
4
+ */
5
+ export declare class CodePlugin extends BasePlugin {
6
+ order: number;
7
+ buildJSONSchema({ info }: RendererJSONSchemaResolveEventContext): string | undefined;
8
+ buildEditorPanel({ info, selections }: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
9
+ }
@@ -0,0 +1,19 @@
1
+ import { BaseEventContext, BasePlugin, BasicToolbarItem } from '../plugin';
2
+ /**
3
+ * 添加调试功能
4
+ */
5
+ export declare class DataDebugPlugin extends BasePlugin {
6
+ buildEditorToolbar({ id, schema, node }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
7
+ dataViewer: {
8
+ type: string;
9
+ name: string;
10
+ asFormItem: boolean;
11
+ className: string;
12
+ component: ({ value, onChange, readOnly }: {
13
+ value: any;
14
+ onChange: (value: any) => void;
15
+ readOnly?: boolean | undefined;
16
+ }) => JSX.Element;
17
+ };
18
+ openDebugForm(data: any, callback?: (values: any) => void): Promise<void>;
19
+ }
@@ -0,0 +1,7 @@
1
+ import { BasePlugin } from '../plugin';
2
+ export declare class ErrorRendererPlugin extends BasePlugin {
3
+ order: number;
4
+ rendererName: string;
5
+ name: string;
6
+ isBaseComponent: boolean;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { BuildPanelEventContext, BasePlugin, BasicPanelItem } from '../plugin';
2
+ /**
3
+ * 添加名字面板,方便根据组件名字定位节点
4
+ */
5
+ export declare class NamePlugin extends BasePlugin {
6
+ order: number;
7
+ buildEditorPanel({ info, selections }: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { BuildPanelEventContext, BasePlugin, BasicPanelItem } from '../plugin';
2
+ /**
3
+ * 大纲面板
4
+ */
5
+ export declare class OutlinePlugin extends BasePlugin {
6
+ order: number;
7
+ buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { BasePlugin, BasicRendererInfo, RendererInfoResolveEventContext } from '../plugin';
2
+ export declare class UnkownRendererPlugin extends BasePlugin {
3
+ order: number;
4
+ getRendererInfo({ renderer, schema, path }: RendererInfoResolveEventContext): BasicRendererInfo | void;
5
+ }