amis-editor 3.3.12-beta.1 → 4.0.1-beta.19
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/Breadcrumb.d.ts +1 -1
- package/dist/component/Control/APIControl.d.ts +540 -0
- package/dist/component/Control/OptionControl.d.ts +163 -0
- package/dist/component/Control/PopoverEdit.d.ts +57 -0
- package/dist/component/Control/ValidationControl.d.ts +30 -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 +20 -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/SearchRendererPanel.d.ts +51 -0
- package/dist/component/base/WidthDraggableBtn.d.ts +16 -0
- package/dist/component/base/WidthDraggableContainer.d.ts +2 -0
- package/dist/component/remarkTpl.d.ts +150 -0
- package/dist/dnd/default.d.ts +1 -1
- package/dist/dnd/index.d.ts +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +16 -9
- package/dist/plugin/BasicToolbar.d.ts +1 -1
- package/dist/plugin/Card.d.ts +0 -1
- package/dist/plugin/Date.d.ts +1 -0
- package/dist/plugin/Datetime.d.ts +3 -0
- package/dist/plugin/Flex.d.ts +0 -1
- 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/InputGroup.d.ts +0 -2
- package/dist/plugin/Form/InputTable.d.ts +0 -1
- package/dist/plugin/Form/Item.d.ts +1 -1
- package/dist/plugin/Form/Static.d.ts +0 -1
- package/dist/plugin/Grid.d.ts +17 -20
- package/dist/plugin/HBox.d.ts +1 -1
- package/dist/plugin/ListItem.d.ts +0 -1
- 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/TableCell.d.ts +0 -1
- package/dist/plugin/Time.d.ts +3 -0
- package/dist/plugin/Wrapper.d.ts +1 -0
- package/dist/plugin.d.ts +22 -3
- package/dist/store/editor.d.ts +17 -3
- package/dist/style.css +1 -1
- package/dist/util.d.ts +2 -2
- package/package.json +24 -15
- 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/Color.d.ts +0 -39
- package/rollup.config.js +0 -24
package/dist/manager.d.ts
CHANGED
@@ -240,6 +240,8 @@ export declare class EditorManager {
|
|
240
240
|
* @param preferTag
|
241
241
|
*/
|
242
242
|
showReplacePanel(id: string, preferTag?: string): void;
|
243
|
+
/** 显示左侧组件面板(主要在属性面板中使用)*/
|
244
|
+
showRendererPanel(tag?: string, msg?: string): void;
|
243
245
|
readonly listeners: Array<{
|
244
246
|
type: string;
|
245
247
|
fn: PluginEventFn;
|
@@ -252,6 +254,11 @@ export declare class EditorManager {
|
|
252
254
|
* @param context
|
253
255
|
*/
|
254
256
|
trigger<T extends EventContext>(type: string, context: T): PluginEvent<T>;
|
257
|
+
/**
|
258
|
+
* 组件面板中的组件点选添加
|
259
|
+
* @param rendererId
|
260
|
+
*/
|
261
|
+
addElem(rendererId: string): Promise<void>;
|
255
262
|
/**
|
256
263
|
* 给插入面板使用的,将当前选中的节点插入到当前选中的节点容器内。
|
257
264
|
* @param position
|
@@ -265,9 +272,9 @@ export declare class EditorManager {
|
|
265
272
|
/**
|
266
273
|
* 入口在 Preview 里面,用来获取渲染器对应的编辑器信息。
|
267
274
|
* 拿到这些信息后会在渲染原本渲染器的地方包一层,并创建高亮框在点选或者 hover 的时候显示。
|
268
|
-
* @param renderer
|
269
|
-
* @param path
|
270
|
-
* @param schema
|
275
|
+
* @param renderer amis元素渲染器,比如 { type: 'audio', component: 'xxx渲染器'}
|
276
|
+
* @param path 节点路径
|
277
|
+
* @param schema 节点 schema 数据
|
271
278
|
*/
|
272
279
|
getEditorInfo(renderer: RendererConfig, path: string, schema: any): RendererInfo | null | undefined;
|
273
280
|
/**
|
@@ -335,8 +342,8 @@ export declare class EditorManager {
|
|
335
342
|
emptyRegion(id: string, region: string): void;
|
336
343
|
/**
|
337
344
|
* 添加孩子,成功后返回节点,失败后返回 null。
|
338
|
-
* @param id
|
339
|
-
* @param region
|
345
|
+
* @param id 目标组件 id
|
346
|
+
* @param region 目标组件区域
|
340
347
|
* @param json
|
341
348
|
* @param position
|
342
349
|
*/
|
@@ -346,7 +353,7 @@ export declare class EditorManager {
|
|
346
353
|
data: any;
|
347
354
|
}): any | null;
|
348
355
|
/**
|
349
|
-
*
|
356
|
+
* 移动节点
|
350
357
|
* @param id 目标组件 id
|
351
358
|
* @param region 目标组件区域
|
352
359
|
* @param sourceId 移动的节点 id
|
@@ -383,13 +390,13 @@ export declare class EditorManager {
|
|
383
390
|
*/
|
384
391
|
hackRenderers(renderers?: RendererConfig[]): void;
|
385
392
|
/**
|
386
|
-
* 入口在 Preview
|
393
|
+
* 入口在 Preview,用来生成包括元素头部快捷工具栏。
|
387
394
|
* @param info
|
388
395
|
* @param render
|
389
396
|
*/
|
390
397
|
makeWrapper(info: RendererInfo, render: RendererConfig): any;
|
391
398
|
/**
|
392
|
-
*
|
399
|
+
* 用来生成属性配置面板。
|
393
400
|
* @param schema
|
394
401
|
*/
|
395
402
|
makeSchemaFormRender(schema: {
|
@@ -398,7 +405,7 @@ export declare class EditorManager {
|
|
398
405
|
definitions?: any;
|
399
406
|
api?: any;
|
400
407
|
submitOnChange?: boolean;
|
401
|
-
}): ({ value, onChange, popOverContainer, id, store }: import("./plugin").PanelProps) => JSX.Element;
|
408
|
+
}): ({ value, onChange, popOverContainer, id, store, node }: import("./plugin").PanelProps) => JSX.Element;
|
402
409
|
onWidthChangeStart(e: MouseEvent, ctx: {
|
403
410
|
dom: HTMLElement;
|
404
411
|
node: EditorNodeType;
|
@@ -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/Card.d.ts
CHANGED
@@ -43,7 +43,6 @@ export declare class CardPlugin extends BasePlugin {
|
|
43
43
|
regions: Array<RegionConfig>;
|
44
44
|
panelTitle: string;
|
45
45
|
panelBodyCreator: (context: BaseEventContext) => any[];
|
46
|
-
exchangeRenderer(id: string): void;
|
47
46
|
fieldWrapperResolve: (dom: HTMLElement) => HTMLElement;
|
48
47
|
overrides: {
|
49
48
|
renderFeild: (this: any, region: string, field: any, index: any, props: any) => any;
|
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
|
}
|
package/dist/plugin/Flex.d.ts
CHANGED
@@ -23,6 +23,5 @@ export declare class FlexPlugin extends BasePlugin {
|
|
23
23
|
panelTitle: string;
|
24
24
|
panelBody: any[];
|
25
25
|
regions: Array<RegionConfig>;
|
26
|
-
exchangeRenderer(id: string): void;
|
27
26
|
afterResolveJsonSchema(event: PluginEvent<RendererJSONSchemaResolveEventContext>): void;
|
28
27
|
}
|
@@ -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;
|
@@ -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
|
})[];
|
@@ -34,6 +34,5 @@ export declare class TableControlPlugin extends BasePlugin {
|
|
34
34
|
panelTitle: string;
|
35
35
|
panelBodyCreator: (context: BaseEventContext) => any;
|
36
36
|
filterProps(props: any): any;
|
37
|
-
exchangeRenderer(id: string): void;
|
38
37
|
beforeInsert(event: PluginEvent<InsertEventContext>): void;
|
39
38
|
}
|
@@ -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[];
|
package/dist/plugin/HBox.d.ts
CHANGED
@@ -4,6 +4,7 @@ import { Schema } from 'amis/lib/types';
|
|
4
4
|
export declare class HBoxPlugin extends BasePlugin {
|
5
5
|
rendererName: string;
|
6
6
|
$schema: string;
|
7
|
+
disabledRendererPlugin: boolean;
|
7
8
|
name: string;
|
8
9
|
icon: string;
|
9
10
|
description: string;
|
@@ -30,7 +31,6 @@ export declare class HBoxPlugin extends BasePlugin {
|
|
30
31
|
overrides: {
|
31
32
|
renderColumn: (this: any, node: Schema, index: number) => any;
|
32
33
|
};
|
33
|
-
exchangeRenderer(id: string): void;
|
34
34
|
afterResolveJsonSchema(event: PluginEvent<RendererJSONSchemaResolveEventContext>): void;
|
35
35
|
buildEditorContextMenu(context: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
|
36
36
|
onWidthChangeStart(event: PluginEvent<ResizeMoveEventContext, {
|
@@ -11,6 +11,5 @@ export declare class ListItemPlugin extends BasePlugin {
|
|
11
11
|
renderFeild: (this: any, region: string, field: any, index: any, props: any) => any;
|
12
12
|
};
|
13
13
|
vRendererConfig: VRendererConfig;
|
14
|
-
exchangeRenderer(id: string): void;
|
15
14
|
beforeInsert(event: PluginEvent<InsertEventContext>): void;
|
16
15
|
}
|
package/dist/plugin/Log.d.ts
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
import { BasePlugin, BasicPanelItem, BuildPanelEventContext } 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,9 @@
|
|
1
|
+
import { BasePlugin, BasicPanelItem, RendererJSONSchemaResolveEventContext, BuildPanelEventContext } 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,8 @@
|
|
1
|
+
import { BasePlugin, BasicPanelItem, BuildPanelEventContext } 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
|
+
}
|
package/dist/plugin/Panel.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { SchemaObject } from 'amis';
|
2
1
|
import { BasePlugin, BaseEventContext, BasicPanelItem, RegionConfig, BuildPanelEventContext } from '../plugin';
|
3
2
|
export declare class PanelPlugin extends BasePlugin {
|
4
3
|
rendererName: string;
|
@@ -8,8 +7,21 @@ export declare class PanelPlugin extends BasePlugin {
|
|
8
7
|
description: string;
|
9
8
|
docLink: string;
|
10
9
|
tags: string;
|
11
|
-
scaffold:
|
12
|
-
|
10
|
+
scaffold: {
|
11
|
+
type: string;
|
12
|
+
title: string;
|
13
|
+
body: string;
|
14
|
+
};
|
15
|
+
previewSchema: {
|
16
|
+
type: string;
|
17
|
+
title: string;
|
18
|
+
body: string;
|
19
|
+
className: string;
|
20
|
+
actions: {
|
21
|
+
label: string;
|
22
|
+
type: string;
|
23
|
+
}[];
|
24
|
+
};
|
13
25
|
regions: Array<RegionConfig>;
|
14
26
|
panelTitle: string;
|
15
27
|
panelBodyCreator: (context: BaseEventContext) => any[];
|
package/dist/plugin/Plain.d.ts
CHANGED
package/dist/plugin/Reset.d.ts
CHANGED
package/dist/plugin/Steps.d.ts
CHANGED
package/dist/plugin/Submit.d.ts
CHANGED
@@ -4,6 +4,5 @@ export declare class TableCellPlugin extends BasePlugin {
|
|
4
4
|
panelIcon: string;
|
5
5
|
panelBodyCreator: (context: BaseEventContext) => any[];
|
6
6
|
getRendererInfo({ renderer, schema }: RendererInfoResolveEventContext): BasicRendererInfo | void;
|
7
|
-
exchangeRenderer(id: string): void;
|
8
7
|
beforeReplace(event: PluginEvent<ReplaceEventContext>): void;
|
9
8
|
}
|
package/dist/plugin/Time.d.ts
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
+
import { BaseEventContext } from '../plugin';
|
1
2
|
import { DatePlugin } from './Date';
|
2
3
|
export declare class TimePlugin extends DatePlugin {
|
3
4
|
rendererName: string;
|
4
5
|
name: string;
|
5
6
|
scaffold: {
|
6
7
|
type: string;
|
8
|
+
value: number;
|
7
9
|
};
|
8
10
|
previewSchema: {
|
9
11
|
format: string;
|
10
12
|
value: number;
|
11
13
|
type: string;
|
12
14
|
};
|
15
|
+
panelBodyCreator: (context: BaseEventContext) => any[];
|
13
16
|
}
|
package/dist/plugin/Wrapper.d.ts
CHANGED
package/dist/plugin.d.ts
CHANGED
@@ -57,7 +57,7 @@ export interface RegionConfig {
|
|
57
57
|
optional?: boolean;
|
58
58
|
/**
|
59
59
|
* 有时候有些包括是需要其他条件的,所以要自己写包裹逻辑。
|
60
|
-
* 比如
|
60
|
+
* 比如 Panel 里面的 renderBody
|
61
61
|
*/
|
62
62
|
renderMethodOverride?: (regions: Array<RegionConfig>, insertRegion: (component: JSX.Element, dom: JSX.Element, regions: Array<RegionConfig>, info: RendererInfo, manager: EditorManager) => JSX.Element) => Function;
|
63
63
|
/**
|
@@ -182,7 +182,7 @@ export interface RendererInfo extends RendererScaffoldInfo {
|
|
182
182
|
*
|
183
183
|
* 表格的列,即是表格列,也可能是其他文本框。
|
184
184
|
*
|
185
|
-
* 配置了这个后会自动添加多个
|
185
|
+
* 配置了这个后会自动添加多个 Panel 面板来编辑。
|
186
186
|
*/
|
187
187
|
multifactor?: boolean;
|
188
188
|
/**
|
@@ -253,6 +253,10 @@ export interface SubRendererInfo extends RendererScaffoldInfo {
|
|
253
253
|
* 首次拖入的时候可以用来配置个表单。
|
254
254
|
*/
|
255
255
|
scaffoldForm?: ScaffoldForm;
|
256
|
+
/**
|
257
|
+
* 新增属性,用于判断是否出现在组件面板中,默认为false,为ture则不展示
|
258
|
+
*/
|
259
|
+
disabledRendererPlugin?: boolean;
|
256
260
|
plugin: PluginInterface;
|
257
261
|
parent: RendererInfo;
|
258
262
|
id: string;
|
@@ -271,6 +275,7 @@ export interface ToolbarItem {
|
|
271
275
|
draggable?: boolean;
|
272
276
|
onDragStart?: (e: React.DragEvent) => void;
|
273
277
|
icon: string;
|
278
|
+
iconSvg?: string;
|
274
279
|
onClick?: (e: React.MouseEvent) => void;
|
275
280
|
tooltip?: string;
|
276
281
|
placement?: 'top' | 'bottom' | 'right' | 'left';
|
@@ -284,6 +289,7 @@ export interface PanelProps {
|
|
284
289
|
id?: string;
|
285
290
|
info?: RendererInfo;
|
286
291
|
path?: string;
|
292
|
+
node?: EditorNodeType;
|
287
293
|
value: BaseSchema;
|
288
294
|
onChange: (value: BaseSchema, diff?: Array<DiffChange>) => void;
|
289
295
|
store: EditorStoreType;
|
@@ -298,10 +304,11 @@ export interface PanelItem {
|
|
298
304
|
key: string;
|
299
305
|
icon: string;
|
300
306
|
title: string;
|
301
|
-
component?: React.ComponentType<PanelProps>;
|
307
|
+
component?: React.ComponentType<PanelProps | any>;
|
302
308
|
order: number;
|
303
309
|
position?: 'left' | 'right';
|
304
310
|
render?: (props: PanelProps) => JSX.Element;
|
311
|
+
menus?: Array<any>;
|
305
312
|
}
|
306
313
|
export declare type BasicPanelItem = Omit<PanelItem, 'order'> & Partial<Pick<PanelItem, 'order'>>;
|
307
314
|
export interface EventContext {
|
@@ -490,6 +497,10 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
|
|
490
497
|
*/
|
491
498
|
panelIcon?: string;
|
492
499
|
panelTitle?: string;
|
500
|
+
/**
|
501
|
+
* 新增属性,用于判断是否出现在组件面板中,默认为false,为ture则不展示
|
502
|
+
*/
|
503
|
+
disabledRendererPlugin?: boolean;
|
493
504
|
/**
|
494
505
|
* @deprecated 用 panelBody
|
495
506
|
*/
|
@@ -554,6 +565,14 @@ export declare abstract class BasePlugin implements PluginInterface {
|
|
554
565
|
* @param subRenderers
|
555
566
|
*/
|
556
567
|
buildSubRenderers(context: RendererEventContext, subRenderers: Array<SubRendererInfo>, renderers: Array<RendererConfig>): BasicSubRenderInfo | Array<BasicSubRenderInfo> | void;
|
568
|
+
/**
|
569
|
+
* 构建当前选中组件的右键菜单
|
570
|
+
* @param id
|
571
|
+
* @param schema
|
572
|
+
* @param region
|
573
|
+
* @param info
|
574
|
+
* @param menus
|
575
|
+
*/
|
557
576
|
buildEditorContextMenu({ id, schema, region, info }: ContextMenuEventContext, menus: Array<ContextMenuItem>): void;
|
558
577
|
renderPlaceholder(text: string, key?: any): React.DetailedReactHTMLElement<{
|
559
578
|
key: any;
|
package/dist/store/editor.d.ts
CHANGED
@@ -140,6 +140,8 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
140
140
|
hoverId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
141
141
|
hoverRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
142
142
|
activeId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
143
|
+
activeRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
144
|
+
mouseMoveRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
143
145
|
selections: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<string[], string[], string[]>, [undefined]>;
|
144
146
|
contextId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
145
147
|
dragMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
@@ -165,10 +167,12 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
165
167
|
toolbars: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<ToolbarItem[], ToolbarItem[], ToolbarItem[]>, [undefined]>;
|
166
168
|
panels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<PanelItem[], PanelItem[], PanelItem[]>, [undefined]>;
|
167
169
|
subRenderersKeywords: import("mobx-state-tree").IType<string | undefined, string, string>;
|
170
|
+
subRenderersTag: import("mobx-state-tree").IType<string | undefined, string, string>;
|
168
171
|
subRendererRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
169
172
|
subRenderers: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<SubRendererInfo[], SubRendererInfo[], SubRendererInfo[]>, [undefined]>;
|
170
173
|
panelKey: import("mobx-state-tree").IType<string | undefined, string, string>;
|
171
174
|
leftPanelKey: import("mobx-state-tree").IType<string | undefined, string, string>;
|
175
|
+
leftPanelOpenStatus: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
172
176
|
jsonSchemaUri: import("mobx-state-tree").IType<string | undefined, string, string>;
|
173
177
|
scaffoldForm: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<ScaffoldFormContext, ScaffoldFormContext, ScaffoldFormContext>>;
|
174
178
|
scaffoldFormBuzy: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
@@ -186,6 +190,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
186
190
|
isContextOn(id: string): boolean | "";
|
187
191
|
readonly activeContainerId: string;
|
188
192
|
isRegionHighlighted(id: string, region: string): boolean;
|
193
|
+
isRegionHighlightHover(id: string, region: string): boolean;
|
189
194
|
isRegionActive(id: string, region: string): boolean;
|
190
195
|
isRegionDragEnter(id: string, region: string): boolean;
|
191
196
|
readonly highlightNodes: ({
|
@@ -354,6 +359,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
354
359
|
getLeftPanelKey(): string;
|
355
360
|
readonly leftPanels: PanelItem[];
|
356
361
|
readonly rightPanels: PanelItem[];
|
362
|
+
readonly contextMenuPanel: PanelItem | undefined;
|
357
363
|
getPanels(): Array<PanelItem>;
|
358
364
|
getLeftPanels(): Array<PanelItem>;
|
359
365
|
readonly sortedToolbars: ToolbarItem[];
|
@@ -837,6 +843,10 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
837
843
|
readonly dragging: boolean;
|
838
844
|
readonly needPatch: boolean;
|
839
845
|
readonly schemaRaw: any;
|
846
|
+
readonly subRenderersByOrder: SubRendererInfo[];
|
847
|
+
groupedSubRenderersByKeyword(_subRenderers?: SubRendererInfo[] | undefined, keywords?: string | undefined): {
|
848
|
+
[propName: string]: SubRendererInfo[];
|
849
|
+
};
|
840
850
|
readonly groupedSubRenderers: {
|
841
851
|
[propName: string]: SubRendererInfo[];
|
842
852
|
};
|
@@ -862,10 +872,11 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
862
872
|
setSchema(json: any): void;
|
863
873
|
insertSchema(event: PluginEvent<InsertEventContext>): any;
|
864
874
|
moveSchema(event: PluginEvent<MoveEventContext>): void;
|
865
|
-
setActiveId(id: string, selections?: Array<string>): void;
|
875
|
+
setActiveId(id: string, region?: string, selections?: Array<string>): void;
|
866
876
|
setSelections(ids: Array<string>): void;
|
867
877
|
clearSelection(): void;
|
868
878
|
setHoverId(id: string, region?: string | undefined): void;
|
879
|
+
setMouseMoveRegion(region: string): void;
|
869
880
|
setInsertId(id: string): void;
|
870
881
|
setContextId(id: string): void;
|
871
882
|
setDragId(id: string, mode?: 'move' | 'copy', type?: string, schema?: any): void;
|
@@ -875,10 +886,13 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
875
886
|
setPanels(panels: Array<PanelItem>): void;
|
876
887
|
setSubRenderers(renderers: Array<SubRendererInfo>): void;
|
877
888
|
changeSubRenderersKeywords(keywords: string): void;
|
889
|
+
changeSubRenderersTag(tag: string): void;
|
878
890
|
resetSubRenderersKeywords(): void;
|
879
891
|
changeSubRendererRegion(region: string): void;
|
880
|
-
changePanelKey(key: string
|
881
|
-
changeLeftPanelKey(key: string
|
892
|
+
changePanelKey(key: string): void;
|
893
|
+
changeLeftPanelKey(key: string): void;
|
894
|
+
changeLeftPanelOpenStatus(isOpenStatus: boolean): void;
|
895
|
+
showRendererPanel(tag?: string | undefined, msg?: string | undefined): void;
|
882
896
|
changeValue(value: Schema, diff?: any): void;
|
883
897
|
changeValueById(id: string, value: Schema, diff?: any, replace?: boolean | undefined, noTrace?: boolean | undefined): void;
|
884
898
|
moveUp(id: string): void;
|