amis-editor 3.3.10 → 4.0.1-beta.16
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.
- package/dist/150a58f3318ca7541ed9.png +0 -0
- package/dist/471adb97c322b226e589.png +0 -0
- package/dist/4de5f42360bc5946c3c2.png +0 -0
- package/dist/4e9968bba3855f088fed.png +0 -0
- package/dist/7f09c38ebc687fea847a.png +0 -0
- package/dist/c94073576487510314ea.png +0 -0
- package/dist/cebfe0bc5a1dbde02da1.svg +10 -0
- package/dist/component/AvailableRenderersPanel.d.ts +13 -1
- package/dist/component/BackTop.d.ts +26 -0
- package/dist/component/Breadcrumb.d.ts +1 -1
- package/dist/component/ContextMenuPanel.d.ts +8 -0
- package/dist/component/InputComponentName.d.ts +8 -0
- package/dist/component/Outline.d.ts +6 -0
- package/dist/component/Panel/AMisCodeEditor.d.ts +37 -0
- package/dist/component/Panel/AvailableRenderersPanel.d.ts +20 -0
- package/dist/component/Panel/CodeEditorPanel.d.ts +6 -0
- package/dist/component/Panel/ContextMenuPanel.d.ts +8 -0
- package/dist/component/Panel/DrawerPanel.d.ts +15 -0
- package/dist/component/Panel/InsertSubRendererPanel.d.ts +11 -0
- package/dist/component/Panel/LeftPanels.d.ts +21 -0
- package/dist/component/Panel/Outline.d.ts +18 -0
- package/dist/component/Panel/RightPanels.d.ts +21 -0
- package/dist/component/Panel/TargetNamePanel.d.ts +7 -0
- package/dist/component/Preview.d.ts +2 -0
- package/dist/component/RegionHLBox.d.ts +1 -8
- package/dist/component/ScaffoldModal.d.ts +1 -1
- package/dist/component/base/BackTop.d.ts +26 -0
- package/dist/component/base/ErrorRenderer.d.ts +4 -0
- package/dist/component/base/InputComponentName.d.ts +8 -0
- package/dist/component/base/WidthDraggableBtn.d.ts +16 -0
- package/dist/component/base/WidthDraggableContainer.d.ts +2 -0
- package/dist/dnd/default.d.ts +1 -1
- package/dist/dnd/index.d.ts +1 -1
- package/dist/index.d.ts +9 -10
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +442 -0
- package/dist/plugin/BasicToolbar.d.ts +1 -1
- package/dist/plugin/Date.d.ts +1 -0
- package/dist/plugin/Datetime.d.ts +3 -0
- package/dist/plugin/Form/CodeEditor.d.ts +39 -0
- package/dist/plugin/Form/FieldSet.d.ts +1 -0
- package/dist/plugin/Form/Group.d.ts +1 -0
- package/dist/plugin/Form/InputExcel.d.ts +13 -1
- package/dist/plugin/Form/InputGroup.d.ts +0 -2
- package/dist/plugin/Form/InputKV.d.ts +28 -0
- package/dist/plugin/Form/Item.d.ts +1 -1
- package/dist/plugin/Grid.d.ts +17 -20
- package/dist/plugin/HBox.d.ts +1 -0
- package/dist/plugin/Log.d.ts +1 -0
- package/dist/plugin/Panel/AvailableRenderers.d.ts +8 -0
- package/dist/plugin/Panel/Code.d.ts +9 -0
- package/dist/plugin/Panel/Name.d.ts +8 -0
- package/dist/plugin/Panel.d.ts +15 -3
- package/dist/plugin/Plain.d.ts +1 -0
- package/dist/plugin/Reset.d.ts +1 -0
- package/dist/plugin/Steps.d.ts +1 -7
- package/dist/plugin/Submit.d.ts +1 -0
- package/dist/plugin/Time.d.ts +3 -0
- package/dist/plugin/WebComponent.d.ts +1 -0
- package/dist/plugin/Wrapper.d.ts +1 -0
- package/dist/plugin.d.ts +22 -3
- package/dist/store/editor.d.ts +8 -3
- package/dist/style.css +1 -1
- package/package.json +14 -6
- package/static/Code-hover.png +0 -0
- package/static/Code.png +0 -0
- package/static/Outline-hover.png +0 -0
- package/static/Outline.png +0 -0
- package/static/Renderers-hover.png +0 -0
- package/static/Renderers.png +0 -0
- package/static/side_hide_left.svg +10 -0
- package/.editorconfig +0 -12
- package/.fecsrc +0 -8
- package/.prettierrc +0 -20
- package/dist/plugin/Form/Reset.d.ts +0 -7
- package/dist/plugin/Form/Submit.d.ts +0 -6
- package/rollup.config.js +0 -24
@@ -0,0 +1,442 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
/// <reference types="lodash" />
|
3
|
+
/**
|
4
|
+
* @file 把一些功能性的东西放在了这个里面,辅助 compoennt/Editor.tsx 组件的。
|
5
|
+
* 编辑器非 UI 相关的东西应该放在这。
|
6
|
+
*/
|
7
|
+
import { RendererConfig, RenderOptions } from 'amis/lib/factory';
|
8
|
+
import { PluginInterface, BasicPanelItem, RendererInfo, SubRendererInfo, PluginEvent, RegionConfig, ContextMenuItem, ContextMenuEventContext, EventContext, PluginEventFn, ScaffoldForm } from './plugin';
|
9
|
+
import { EditorStoreType, SubEditorContext } from './store/editor';
|
10
|
+
import { SchemaObject } from 'amis';
|
11
|
+
import { EditorNodeType } from './store/node';
|
12
|
+
import { EditorProps } from './component/Editor';
|
13
|
+
import { EditorDNDManager } from './dnd';
|
14
|
+
export interface EditorManagerConfig extends Omit<EditorProps, 'value' | 'onChange'> {
|
15
|
+
}
|
16
|
+
export interface PluginClass {
|
17
|
+
new (manager: EditorManager): PluginInterface;
|
18
|
+
id?: string;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* 注册默认的插件。
|
22
|
+
* @param editor
|
23
|
+
*/
|
24
|
+
export declare function registerEditorPlugin(klass: PluginClass): void;
|
25
|
+
/**
|
26
|
+
* 获取当前已经注册的插件。
|
27
|
+
*/
|
28
|
+
export declare function getEditorPlugins(): PluginClass[];
|
29
|
+
/**
|
30
|
+
* 注销插件
|
31
|
+
*/
|
32
|
+
export declare function unRegisterEditorPlugin(id: string): void;
|
33
|
+
/**
|
34
|
+
* 在 component/Editor.tsx 里面实例化的。
|
35
|
+
*
|
36
|
+
* 辅助 component/Editor.tsx 实现一些非 UI 相关的功能。
|
37
|
+
*/
|
38
|
+
export declare class EditorManager {
|
39
|
+
readonly config: EditorManagerConfig;
|
40
|
+
readonly store: EditorStoreType;
|
41
|
+
readonly parent?: EditorManager | undefined;
|
42
|
+
readonly plugins: Array<PluginInterface>;
|
43
|
+
readonly env: RenderOptions;
|
44
|
+
toDispose: Array<() => void>;
|
45
|
+
readonly dnd: EditorDNDManager;
|
46
|
+
readonly id: string;
|
47
|
+
disableHover: boolean;
|
48
|
+
private clipboardData;
|
49
|
+
readonly hackIn: any;
|
50
|
+
constructor(config: EditorManagerConfig, store: EditorStoreType, parent?: EditorManager | undefined);
|
51
|
+
buildEventContext(idOrNode: string | EditorNodeType): {
|
52
|
+
node: {
|
53
|
+
parentId: string;
|
54
|
+
parentRegion: string;
|
55
|
+
isCommonConfig: boolean;
|
56
|
+
id: string;
|
57
|
+
label: string;
|
58
|
+
regionInfo: (RegionConfig & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>>) | undefined;
|
59
|
+
path: string;
|
60
|
+
schemaPath: string;
|
61
|
+
region: string;
|
62
|
+
preferTag: string;
|
63
|
+
state: any;
|
64
|
+
widthMutable: boolean;
|
65
|
+
heightMutable: boolean;
|
66
|
+
memberIndex: number;
|
67
|
+
folded: boolean;
|
68
|
+
patched: boolean;
|
69
|
+
x: number;
|
70
|
+
y: number;
|
71
|
+
w: number;
|
72
|
+
h: number;
|
73
|
+
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]>>;
|
74
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
75
|
+
getData: import("mobx-state-tree").IType<() => any, () => any, () => any>;
|
76
|
+
} & {
|
77
|
+
readonly info: RendererInfo;
|
78
|
+
setInfo(value: RendererInfo): void;
|
79
|
+
readonly isVitualRenderer: boolean;
|
80
|
+
readonly clickable: boolean;
|
81
|
+
readonly draggable: boolean;
|
82
|
+
readonly moveable: boolean;
|
83
|
+
readonly removable: boolean;
|
84
|
+
readonly duplicatable: boolean;
|
85
|
+
readonly replaceable: boolean;
|
86
|
+
memberImmutable(region: string): boolean;
|
87
|
+
readonly isRegion: boolean;
|
88
|
+
readonly childRegions: any[];
|
89
|
+
readonly uniqueChildren: any[];
|
90
|
+
readonly sameIdChild: any;
|
91
|
+
readonly singleRegion: boolean;
|
92
|
+
isExists(id: string): boolean;
|
93
|
+
getChildById(id: string): any;
|
94
|
+
readonly parent: any;
|
95
|
+
readonly host: any;
|
96
|
+
readonly firstChild: any;
|
97
|
+
readonly index: any;
|
98
|
+
readonly prevSibling: any;
|
99
|
+
readonly nextSibling: any;
|
100
|
+
readonly schema: any;
|
101
|
+
readonly schemaParent: any;
|
102
|
+
readonly isSecondFactor: boolean;
|
103
|
+
} & {
|
104
|
+
updateIsCommonConfig: (value: boolean) => void;
|
105
|
+
addChild(props: {
|
106
|
+
id: string;
|
107
|
+
label: string;
|
108
|
+
path: string;
|
109
|
+
isCommonConfig?: boolean | undefined;
|
110
|
+
info?: RendererInfo | undefined;
|
111
|
+
region?: string | undefined;
|
112
|
+
getData?: (() => any) | undefined;
|
113
|
+
preferTag?: string | undefined;
|
114
|
+
schemaPath?: string | undefined;
|
115
|
+
regionInfo?: RegionConfig | undefined;
|
116
|
+
widthMutable?: boolean | undefined;
|
117
|
+
memberIndex?: number | undefined;
|
118
|
+
}): any;
|
119
|
+
removeChild(child: any): void;
|
120
|
+
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
121
|
+
patch(store: any, force?: boolean): void;
|
122
|
+
updateSchema(value: any): void;
|
123
|
+
setComponent(value: any): void;
|
124
|
+
getComponent(): any;
|
125
|
+
calculateHighlightBox(root?: any): void;
|
126
|
+
resetHighlightBox(root: any): void;
|
127
|
+
updateState(state: any, replace?: boolean): void;
|
128
|
+
setWidthMutable(value: any): void;
|
129
|
+
setHeightMutable(value: any): void;
|
130
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
131
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
132
|
+
parentRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
133
|
+
isCommonConfig: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
134
|
+
id: import("mobx-state-tree").IType<string | undefined, string, string>;
|
135
|
+
label: import("mobx-state-tree").IType<string | undefined, string, string>;
|
136
|
+
regionInfo: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>;
|
137
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
138
|
+
schemaPath: import("mobx-state-tree").IType<string | undefined, string, string>;
|
139
|
+
region: import("mobx-state-tree").IType<string | undefined, string, string>;
|
140
|
+
preferTag: import("mobx-state-tree").IType<string | undefined, string, string>;
|
141
|
+
state: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
142
|
+
widthMutable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
143
|
+
heightMutable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
144
|
+
memberIndex: import("mobx-state-tree").IType<number | undefined, number, number>;
|
145
|
+
folded: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
146
|
+
patched: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
147
|
+
x: import("mobx-state-tree").IType<number | undefined, number, number>;
|
148
|
+
y: import("mobx-state-tree").IType<number | undefined, number, number>;
|
149
|
+
w: import("mobx-state-tree").IType<number | undefined, number, number>;
|
150
|
+
h: import("mobx-state-tree").IType<number | undefined, number, number>;
|
151
|
+
children: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>, [undefined]>;
|
152
|
+
}, {
|
153
|
+
getData: import("mobx-state-tree").IType<() => any, () => any, () => any>;
|
154
|
+
} & {
|
155
|
+
readonly info: RendererInfo;
|
156
|
+
setInfo(value: RendererInfo): void;
|
157
|
+
readonly isVitualRenderer: boolean;
|
158
|
+
readonly clickable: boolean;
|
159
|
+
readonly draggable: boolean;
|
160
|
+
readonly moveable: boolean;
|
161
|
+
readonly removable: boolean;
|
162
|
+
readonly duplicatable: boolean;
|
163
|
+
readonly replaceable: boolean;
|
164
|
+
memberImmutable(region: string): boolean;
|
165
|
+
readonly isRegion: boolean;
|
166
|
+
readonly childRegions: any[];
|
167
|
+
readonly uniqueChildren: any[];
|
168
|
+
readonly sameIdChild: any;
|
169
|
+
readonly singleRegion: boolean;
|
170
|
+
isExists(id: string): boolean;
|
171
|
+
getChildById(id: string): any;
|
172
|
+
readonly parent: any;
|
173
|
+
readonly host: any;
|
174
|
+
readonly firstChild: any;
|
175
|
+
readonly index: any;
|
176
|
+
readonly prevSibling: any;
|
177
|
+
readonly nextSibling: any;
|
178
|
+
readonly schema: any;
|
179
|
+
readonly schemaParent: any;
|
180
|
+
readonly isSecondFactor: boolean;
|
181
|
+
} & {
|
182
|
+
updateIsCommonConfig: (value: boolean) => void;
|
183
|
+
addChild(props: {
|
184
|
+
id: string;
|
185
|
+
label: string;
|
186
|
+
path: string;
|
187
|
+
isCommonConfig?: boolean | undefined;
|
188
|
+
info?: RendererInfo | undefined;
|
189
|
+
region?: string | undefined;
|
190
|
+
getData?: (() => any) | undefined;
|
191
|
+
preferTag?: string | undefined;
|
192
|
+
schemaPath?: string | undefined;
|
193
|
+
regionInfo?: RegionConfig | undefined;
|
194
|
+
widthMutable?: boolean | undefined;
|
195
|
+
memberIndex?: number | undefined;
|
196
|
+
}): any;
|
197
|
+
removeChild(child: any): void;
|
198
|
+
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
199
|
+
patch(store: any, force?: boolean): void;
|
200
|
+
updateSchema(value: any): void;
|
201
|
+
setComponent(value: any): void;
|
202
|
+
getComponent(): any;
|
203
|
+
calculateHighlightBox(root?: any): void;
|
204
|
+
resetHighlightBox(root: any): void;
|
205
|
+
updateState(state: any, replace?: boolean): void;
|
206
|
+
setWidthMutable(value: any): void;
|
207
|
+
setHeightMutable(value: any): void;
|
208
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
209
|
+
id: string;
|
210
|
+
info: RendererInfo;
|
211
|
+
path: string;
|
212
|
+
schemaPath: string;
|
213
|
+
schema: any;
|
214
|
+
data: string;
|
215
|
+
};
|
216
|
+
/**
|
217
|
+
* 构建 JSONSchema Uri,这样可以用代码模式编辑了。
|
218
|
+
*/
|
219
|
+
buildJSONSchemaUri(): void;
|
220
|
+
buildToolbars(): void;
|
221
|
+
collectPanels(node: EditorNodeType, triggerEvent?: boolean, secondFactor?: boolean): BasicPanelItem[];
|
222
|
+
buildPanels(): void;
|
223
|
+
collectRenderers(region?: string, id?: string): SubRendererInfo[];
|
224
|
+
buildRenderers(region?: string): void;
|
225
|
+
rebuild(): void;
|
226
|
+
/**
|
227
|
+
* 可用组件面板里面会点进来,不同的区域可能可插入的组件不一样。
|
228
|
+
* @param region 区域的 key
|
229
|
+
*/
|
230
|
+
switchToRegion(region: string): void;
|
231
|
+
/**
|
232
|
+
* 显示插入面板
|
233
|
+
* @param region
|
234
|
+
* @param preferTag
|
235
|
+
*/
|
236
|
+
showInsertPanel(region: string, id?: string, preferTag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string): void;
|
237
|
+
/**
|
238
|
+
* 显示组件更换面板
|
239
|
+
* @param region
|
240
|
+
* @param preferTag
|
241
|
+
*/
|
242
|
+
showReplacePanel(id: string, preferTag?: string): void;
|
243
|
+
readonly listeners: Array<{
|
244
|
+
type: string;
|
245
|
+
fn: PluginEventFn;
|
246
|
+
}>;
|
247
|
+
on(event: string, fn: PluginEventFn): void;
|
248
|
+
off(event: string, fn: PluginEventFn): void;
|
249
|
+
/**
|
250
|
+
* 派发事件。
|
251
|
+
* @param type
|
252
|
+
* @param context
|
253
|
+
*/
|
254
|
+
trigger<T extends EventContext>(type: string, context: T): PluginEvent<T>;
|
255
|
+
/**
|
256
|
+
* 组件面板中的组件点选添加
|
257
|
+
* @param rendererId
|
258
|
+
*/
|
259
|
+
addElem(rendererId: string): Promise<void>;
|
260
|
+
/**
|
261
|
+
* 给插入面板使用的,将当前选中的节点插入到当前选中的节点容器内。
|
262
|
+
* @param position
|
263
|
+
*/
|
264
|
+
insert(): Promise<void>;
|
265
|
+
/**
|
266
|
+
* 给插入面板使用的,替换组件类型。
|
267
|
+
* @param position
|
268
|
+
*/
|
269
|
+
replace(): Promise<void>;
|
270
|
+
/**
|
271
|
+
* 入口在 Preview 里面,用来获取渲染器对应的编辑器信息。
|
272
|
+
* 拿到这些信息后会在渲染原本渲染器的地方包一层,并创建高亮框在点选或者 hover 的时候显示。
|
273
|
+
* @param renderer amis元素渲染器,比如 { type: 'audio', component: 'xxx渲染器'}
|
274
|
+
* @param path 节点路径
|
275
|
+
* @param schema 节点 schema 数据
|
276
|
+
*/
|
277
|
+
getEditorInfo(renderer: RendererConfig, path: string, schema: any): RendererInfo | null | undefined;
|
278
|
+
/**
|
279
|
+
* 面板的配置修改方法,不直接调用 store.changeValue 的原因是,
|
280
|
+
* 这里面还有事件逻辑,插件里面可以写些逻辑。
|
281
|
+
* @param value
|
282
|
+
* @param diff
|
283
|
+
*/
|
284
|
+
panelChangeValue(value: any, diff?: any): void;
|
285
|
+
/**
|
286
|
+
* 打开子编辑器,比如弹框什么的,没办法直接编辑器,靠弹窗个新的编辑器来编辑。
|
287
|
+
* @param config
|
288
|
+
*/
|
289
|
+
openSubEditor(config: SubEditorContext): void;
|
290
|
+
/**
|
291
|
+
* 打开对应节点的右键菜单。
|
292
|
+
* @param id
|
293
|
+
* @param region
|
294
|
+
* @param info
|
295
|
+
*/
|
296
|
+
openContextMenu(id: string, region: string, info: {
|
297
|
+
x: number;
|
298
|
+
y: number;
|
299
|
+
}): void;
|
300
|
+
buildContextMenus(context: ContextMenuEventContext): ContextMenuItem[];
|
301
|
+
closeContextMenu(): void;
|
302
|
+
/**
|
303
|
+
* 将当前选中的节点上移
|
304
|
+
*/
|
305
|
+
moveUp(): void;
|
306
|
+
/**
|
307
|
+
* 将当前选中的节点下移
|
308
|
+
*/
|
309
|
+
moveDown(): void;
|
310
|
+
/**
|
311
|
+
* 删除节点
|
312
|
+
*/
|
313
|
+
del(ids: string | Array<string>): void;
|
314
|
+
/**
|
315
|
+
* 重复节点
|
316
|
+
* @param id
|
317
|
+
*/
|
318
|
+
duplicate(id: string | Array<string>): void;
|
319
|
+
/**
|
320
|
+
* 复制节点配置
|
321
|
+
* @param id
|
322
|
+
*/
|
323
|
+
copy(id: string): void;
|
324
|
+
/**
|
325
|
+
* 剪切当前节点,并复制配置到剪切板。
|
326
|
+
* @param id
|
327
|
+
*/
|
328
|
+
cut(id: string): void;
|
329
|
+
/**
|
330
|
+
* 在节点上应用粘贴。
|
331
|
+
* @param id
|
332
|
+
* @param region
|
333
|
+
*/
|
334
|
+
paste(id: string, region?: string): Promise<void>;
|
335
|
+
/**
|
336
|
+
* 清空区域
|
337
|
+
* @param id
|
338
|
+
* @param region
|
339
|
+
*/
|
340
|
+
emptyRegion(id: string, region: string): void;
|
341
|
+
/**
|
342
|
+
* 添加孩子,成功后返回节点,失败后返回 null。
|
343
|
+
* @param id 目标组件 id
|
344
|
+
* @param region 目标组件区域
|
345
|
+
* @param json
|
346
|
+
* @param position
|
347
|
+
*/
|
348
|
+
addChild(id: string, region: string, json: any, beforeId?: string, subRenderer?: SubRendererInfo, dragInfo?: {
|
349
|
+
id: string;
|
350
|
+
type: string;
|
351
|
+
data: any;
|
352
|
+
}): any | null;
|
353
|
+
/**
|
354
|
+
* 移动节点
|
355
|
+
* @param id 目标组件 id
|
356
|
+
* @param region 目标组件区域
|
357
|
+
* @param sourceId 移动的节点 id
|
358
|
+
* @param beforeId 移动到哪个节点前面
|
359
|
+
*/
|
360
|
+
move(id: string, region: string, sourceId: string, beforeId?: string): boolean;
|
361
|
+
/**
|
362
|
+
* 替换节点。
|
363
|
+
* @param id
|
364
|
+
* @param json
|
365
|
+
*/
|
366
|
+
replaceChild(id: string, json: any, subRenderer?: SubRendererInfo, region?: string): boolean;
|
367
|
+
setActiveId(id: string): void;
|
368
|
+
/**
|
369
|
+
* 打开某节点的编辑面板
|
370
|
+
* @param id
|
371
|
+
*/
|
372
|
+
openConfigPanel(id: string): void;
|
373
|
+
/**
|
374
|
+
* 打开某节点的代码面板
|
375
|
+
* @param id
|
376
|
+
*/
|
377
|
+
openCodePanel(id: string): void;
|
378
|
+
toggleSelection(id: string): void;
|
379
|
+
setSelection(selections: Array<string>, id?: string): void;
|
380
|
+
startDrag(id: string, e: React.DragEvent): void;
|
381
|
+
scaffold(form: ScaffoldForm, value: any): Promise<SchemaObject>;
|
382
|
+
reScaffold(id: string, form: ScaffoldForm, value: any): Promise<void>;
|
383
|
+
lazyPatchSchema: import("lodash").DebouncedFunc<any>;
|
384
|
+
patching: boolean;
|
385
|
+
patchSchema(force?: boolean): void;
|
386
|
+
/**
|
387
|
+
* 把设置了特殊 region 的,hack 一下。
|
388
|
+
*/
|
389
|
+
hackRenderers(renderers?: RendererConfig[]): void;
|
390
|
+
/**
|
391
|
+
* 入口在 Preview,用来生成包括元素头部快捷工具栏。
|
392
|
+
* @param info
|
393
|
+
* @param render
|
394
|
+
*/
|
395
|
+
makeWrapper(info: RendererInfo, render: RendererConfig): any;
|
396
|
+
/**
|
397
|
+
* 用来生成属性配置面板。
|
398
|
+
* @param schema
|
399
|
+
*/
|
400
|
+
makeSchemaFormRender(schema: {
|
401
|
+
body?: Array<any>;
|
402
|
+
controls?: Array<any>;
|
403
|
+
definitions?: any;
|
404
|
+
api?: any;
|
405
|
+
submitOnChange?: boolean;
|
406
|
+
}): ({ value, onChange, popOverContainer, id, store, node }: import("./plugin").PanelProps) => JSX.Element;
|
407
|
+
onWidthChangeStart(e: MouseEvent, ctx: {
|
408
|
+
dom: HTMLElement;
|
409
|
+
node: EditorNodeType;
|
410
|
+
resizer: HTMLElement;
|
411
|
+
}): PluginEvent<{
|
412
|
+
nativeEvent: MouseEvent;
|
413
|
+
dom: HTMLElement;
|
414
|
+
node: EditorNodeType;
|
415
|
+
resizer: HTMLElement;
|
416
|
+
}, any>;
|
417
|
+
onHeightChangeStart(e: MouseEvent, ctx: {
|
418
|
+
dom: HTMLElement;
|
419
|
+
node: EditorNodeType;
|
420
|
+
resizer: HTMLElement;
|
421
|
+
}): PluginEvent<{
|
422
|
+
nativeEvent: MouseEvent;
|
423
|
+
dom: HTMLElement;
|
424
|
+
node: EditorNodeType;
|
425
|
+
resizer: HTMLElement;
|
426
|
+
}, any>;
|
427
|
+
onSizeChangeStart(e: MouseEvent, ctx: {
|
428
|
+
dom: HTMLElement;
|
429
|
+
node: EditorNodeType;
|
430
|
+
resizer: HTMLElement;
|
431
|
+
}): PluginEvent<{
|
432
|
+
nativeEvent: MouseEvent;
|
433
|
+
dom: HTMLElement;
|
434
|
+
node: EditorNodeType;
|
435
|
+
resizer: HTMLElement;
|
436
|
+
}, any>;
|
437
|
+
openNodePopOverForm(id: string | EditorNodeType): void;
|
438
|
+
/**
|
439
|
+
* 销毁函数
|
440
|
+
*/
|
441
|
+
dispose(): void;
|
442
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BasePlugin, BaseEventContext, BasicToolbarItem, ContextMenuItem, ContextMenuEventContext, BasicPanelItem, BuildPanelEventContext, PluginEvent, InsertEventContext } from '../plugin';
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* 用来给当前选中的元素添加一些基本的工具栏按钮。
|
4
4
|
*/
|
5
5
|
export declare class BasicToolbarPlugin extends BasePlugin {
|
6
6
|
order: number;
|
package/dist/plugin/Date.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
import { BaseEventContext } from '../plugin';
|
1
2
|
import { DatePlugin } from './Date';
|
2
3
|
export declare class DatetimePlugin extends DatePlugin {
|
3
4
|
rendererName: string;
|
4
5
|
scaffold: {
|
5
6
|
type: string;
|
7
|
+
value: number;
|
6
8
|
};
|
7
9
|
name: string;
|
8
10
|
previewSchema: {
|
@@ -10,4 +12,5 @@ export declare class DatetimePlugin extends DatePlugin {
|
|
10
12
|
value: number;
|
11
13
|
type: string;
|
12
14
|
};
|
15
|
+
panelBodyCreator: (context: BaseEventContext) => any[];
|
13
16
|
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { BasePlugin } from '../../plugin';
|
2
|
+
export declare class CodeEditorControlPlugin extends BasePlugin {
|
3
|
+
rendererName: string;
|
4
|
+
$schema: string;
|
5
|
+
name: string;
|
6
|
+
icon: string;
|
7
|
+
description: string;
|
8
|
+
docLink: string;
|
9
|
+
tags: string[];
|
10
|
+
scaffold: {
|
11
|
+
type: string;
|
12
|
+
label: string;
|
13
|
+
name: string;
|
14
|
+
};
|
15
|
+
previewSchema: any;
|
16
|
+
panelTitle: string;
|
17
|
+
panelBody: ({
|
18
|
+
label: string;
|
19
|
+
name: string;
|
20
|
+
type: string;
|
21
|
+
value: string;
|
22
|
+
searchable: boolean;
|
23
|
+
options: string[];
|
24
|
+
size?: undefined;
|
25
|
+
pipeIn?: undefined;
|
26
|
+
} | {
|
27
|
+
name: string;
|
28
|
+
type: string;
|
29
|
+
size: string;
|
30
|
+
pipeIn: (value: any) => any;
|
31
|
+
label: string;
|
32
|
+
options: {
|
33
|
+
label: string;
|
34
|
+
value: string;
|
35
|
+
}[];
|
36
|
+
value?: undefined;
|
37
|
+
searchable?: undefined;
|
38
|
+
})[];
|
39
|
+
}
|
@@ -2,6 +2,7 @@ import { BaseEventContext, BasePlugin, RegionConfig } from '../../plugin';
|
|
2
2
|
export declare class FieldSetControlPlugin extends BasePlugin {
|
3
3
|
rendererName: string;
|
4
4
|
$schema: string;
|
5
|
+
disabledRendererPlugin: boolean;
|
5
6
|
name: string;
|
6
7
|
icon: string;
|
7
8
|
description: string;
|
@@ -2,6 +2,7 @@ import { BasePlugin, ContextMenuEventContext, ContextMenuItem, RegionConfig } fr
|
|
2
2
|
export declare class GroupControlPlugin extends BasePlugin {
|
3
3
|
rendererName: string;
|
4
4
|
$schema: string;
|
5
|
+
disabledRendererPlugin: boolean;
|
5
6
|
name: string;
|
6
7
|
icon: string;
|
7
8
|
description: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BasePlugin } from '../../plugin';
|
2
|
-
export declare class
|
2
|
+
export declare class ExcelControlPlugin extends BasePlugin {
|
3
3
|
rendererName: string;
|
4
4
|
$schema: string;
|
5
5
|
name: string;
|
@@ -24,6 +24,7 @@ export declare class ColorControlPlugin extends BasePlugin {
|
|
24
24
|
}[];
|
25
25
|
mode?: undefined;
|
26
26
|
className?: undefined;
|
27
|
+
pipeIn?: undefined;
|
27
28
|
visibleOn?: undefined;
|
28
29
|
} | {
|
29
30
|
type: string;
|
@@ -32,6 +33,16 @@ export declare class ColorControlPlugin extends BasePlugin {
|
|
32
33
|
mode: string;
|
33
34
|
className: string;
|
34
35
|
options?: undefined;
|
36
|
+
pipeIn?: undefined;
|
37
|
+
visibleOn?: undefined;
|
38
|
+
} | {
|
39
|
+
type: string;
|
40
|
+
name: string;
|
41
|
+
label: string;
|
42
|
+
pipeIn: (value: any) => any;
|
43
|
+
mode: string;
|
44
|
+
className: string;
|
45
|
+
options?: undefined;
|
35
46
|
visibleOn?: undefined;
|
36
47
|
} | {
|
37
48
|
type: string;
|
@@ -41,5 +52,6 @@ export declare class ColorControlPlugin extends BasePlugin {
|
|
41
52
|
visibleOn: string;
|
42
53
|
className: string;
|
43
54
|
options?: undefined;
|
55
|
+
pipeIn?: undefined;
|
44
56
|
})[];
|
45
57
|
}
|
@@ -13,7 +13,6 @@ export declare class InputGroupControlPlugin extends BasePlugin {
|
|
13
13
|
label: string;
|
14
14
|
body: ({
|
15
15
|
type: string;
|
16
|
-
placeholder: string;
|
17
16
|
inputClassName: string;
|
18
17
|
name: string;
|
19
18
|
label?: undefined;
|
@@ -22,7 +21,6 @@ export declare class InputGroupControlPlugin extends BasePlugin {
|
|
22
21
|
type: string;
|
23
22
|
label: string;
|
24
23
|
level: string;
|
25
|
-
placeholder?: undefined;
|
26
24
|
inputClassName?: undefined;
|
27
25
|
name?: undefined;
|
28
26
|
})[];
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { BasePlugin } from '../../plugin';
|
2
|
+
export declare class KVControlPlugin extends BasePlugin {
|
3
|
+
rendererName: string;
|
4
|
+
$schema: string;
|
5
|
+
name: string;
|
6
|
+
icon: string;
|
7
|
+
description: string;
|
8
|
+
docLink: string;
|
9
|
+
tags: string[];
|
10
|
+
scaffold: {
|
11
|
+
type: string;
|
12
|
+
label: string;
|
13
|
+
name: string;
|
14
|
+
};
|
15
|
+
previewSchema: any;
|
16
|
+
panelTitle: string;
|
17
|
+
panelBody: ({
|
18
|
+
type: string;
|
19
|
+
name: string;
|
20
|
+
label: string;
|
21
|
+
pipeIn: (value: any) => any;
|
22
|
+
} | {
|
23
|
+
type: string;
|
24
|
+
name: string;
|
25
|
+
label: string;
|
26
|
+
pipeIn?: undefined;
|
27
|
+
})[];
|
28
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { BasePlugin, BaseEventContext, BasicPanelItem, PluginEvent, DragEventContext, ChangeEventContext, ReplaceEventContext, BuildPanelEventContext, ContextMenuEventContext, ContextMenuItem } from '../../plugin';
|
2
2
|
export declare class ItemPlugin extends BasePlugin {
|
3
|
-
buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
|
4
3
|
panelTitle: string;
|
4
|
+
buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
|
5
5
|
panelBodyCreator: (context: BaseEventContext) => any[];
|
6
6
|
onDndAccept(event: PluginEvent<DragEventContext>): false | void;
|
7
7
|
afterUpdate(event: PluginEvent<ChangeEventContext>): void;
|
package/dist/plugin/Grid.d.ts
CHANGED
@@ -5,29 +5,26 @@ export declare class GridPlugin extends BasePlugin {
|
|
5
5
|
rendererName: string;
|
6
6
|
$schema: string;
|
7
7
|
name: string;
|
8
|
+
description: string;
|
8
9
|
tags: string[];
|
9
10
|
icon: string;
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
tpl: string;
|
25
|
-
inline: boolean;
|
26
|
-
className: string;
|
27
|
-
}[];
|
11
|
+
scaffold: {
|
12
|
+
type: string;
|
13
|
+
columns: {
|
14
|
+
body: never[];
|
15
|
+
}[];
|
16
|
+
};
|
17
|
+
previewSchema: {
|
18
|
+
type: string;
|
19
|
+
columns: {
|
20
|
+
body: {
|
21
|
+
type: string;
|
22
|
+
tpl: string;
|
23
|
+
inline: boolean;
|
24
|
+
className: string;
|
28
25
|
}[];
|
29
|
-
};
|
30
|
-
}
|
26
|
+
}[];
|
27
|
+
};
|
31
28
|
panelTitle: string;
|
32
29
|
panelWithOutOthers: boolean;
|
33
30
|
panelBodyCreator(context: BaseEventContext): any[];
|