amis-editor 4.1.0-beta.25 → 4.1.0-beta.26
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component/ScaffoldModal.d.ts +1 -1
- package/dist/exports.min.js +1 -1
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +10 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/store/editor.d.ts +11 -11
- package/package.json +1 -1
- package/src/plugin/Panel/AvailableRenderers.tsx +1 -1
- package/src/plugin.ts +6 -5
package/dist/manager.d.ts
CHANGED
@@ -115,6 +115,10 @@ export declare class EditorManager {
|
|
115
115
|
preferTag?: string | undefined;
|
116
116
|
schemaPath?: string | undefined;
|
117
117
|
regionInfo?: RegionConfig | undefined;
|
118
|
+
/**
|
119
|
+
* 可用组件面板里面会点进来,不同的区域可能可插入的组件不一样。
|
120
|
+
* @param region 区域的 key
|
121
|
+
*/
|
118
122
|
widthMutable?: boolean | undefined;
|
119
123
|
memberIndex?: number | undefined;
|
120
124
|
}): any;
|
@@ -195,6 +199,10 @@ export declare class EditorManager {
|
|
195
199
|
preferTag?: string | undefined;
|
196
200
|
schemaPath?: string | undefined;
|
197
201
|
regionInfo?: RegionConfig | undefined;
|
202
|
+
/**
|
203
|
+
* 可用组件面板里面会点进来,不同的区域可能可插入的组件不一样。
|
204
|
+
* @param region 区域的 key
|
205
|
+
*/
|
198
206
|
widthMutable?: boolean | undefined;
|
199
207
|
memberIndex?: number | undefined;
|
200
208
|
}): any;
|
@@ -223,8 +231,8 @@ export declare class EditorManager {
|
|
223
231
|
buildJSONSchemaUri(): void;
|
224
232
|
buildToolbars(): void;
|
225
233
|
collectPanels(node: EditorNodeType, triggerEvent?: boolean, secondFactor?: boolean): BasicPanelItem[];
|
226
|
-
buildPanels(): void;
|
227
|
-
collectRenderers(region?: string,
|
234
|
+
buildPanels(curRendererId?: string): void;
|
235
|
+
collectRenderers(region?: string, curId?: string): Promise<SubRendererInfo[]>;
|
228
236
|
buildRenderers(region?: string): Promise<void>;
|
229
237
|
rebuild(): Promise<void>;
|
230
238
|
/**
|
package/dist/plugin.d.ts
CHANGED
@@ -281,10 +281,10 @@ export interface ToolbarItem {
|
|
281
281
|
level?: 'primary' | 'secondary' | 'special';
|
282
282
|
className?: string;
|
283
283
|
draggable?: boolean;
|
284
|
-
onDragStart?: (e:
|
284
|
+
onDragStart?: (e: any) => void;
|
285
285
|
icon?: string;
|
286
286
|
iconSvg?: string;
|
287
|
-
onClick?: (e:
|
287
|
+
onClick?: (e: any) => void;
|
288
288
|
tooltip?: string;
|
289
289
|
placement?: 'top' | 'bottom' | 'right' | 'left';
|
290
290
|
}
|
package/dist/store/editor.d.ts
CHANGED
@@ -363,9 +363,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
363
363
|
setWidthMutable(value: any): void;
|
364
364
|
setHeightMutable(value: any): void;
|
365
365
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
366
|
-
getNodeById(id: string, region?: string
|
366
|
+
getNodeById(id: string, region?: string): EditorNodeType | undefined;
|
367
367
|
readonly activeNodeInfo: RendererInfo | null | undefined;
|
368
|
-
getSchema(id?: string
|
368
|
+
getSchema(id?: string): any;
|
369
369
|
getSchemaParentById(id: string): any;
|
370
370
|
getSchemaPath(id: string): string;
|
371
371
|
getSimpleSchema(curSchema: any): any;
|
@@ -878,13 +878,13 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
878
878
|
*/
|
879
879
|
readonly customRenderersByOrder: SubRendererInfo[];
|
880
880
|
/** 根据关键字过滤组件 */
|
881
|
-
groupedRenderersByKeyword(_subRenderers: Array<SubRendererInfo>, keywords?: string
|
881
|
+
groupedRenderersByKeyword(_subRenderers: Array<SubRendererInfo>, keywords?: string): {
|
882
882
|
[propName: string]: SubRendererInfo[];
|
883
883
|
};
|
884
884
|
/** 根据关键字过滤预置组件
|
885
885
|
* 备注:组件搜索中需要
|
886
886
|
*/
|
887
|
-
groupedSubRenderersByKeyword(_subRenderers?: SubRendererInfo
|
887
|
+
groupedSubRenderersByKeyword(_subRenderers?: Array<SubRendererInfo>, keywords?: string): {
|
888
888
|
[propName: string]: SubRendererInfo[];
|
889
889
|
};
|
890
890
|
/**
|
@@ -895,7 +895,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
895
895
|
[propName: string]: SubRendererInfo[];
|
896
896
|
};
|
897
897
|
/** 根据关键字过滤自定义组件 */
|
898
|
-
groupedCustomRenderersByKeyword(_subRenderers?: SubRendererInfo
|
898
|
+
groupedCustomRenderersByKeyword(_subRenderers?: Array<SubRendererInfo>, keywords?: string): {
|
899
899
|
[propName: string]: SubRendererInfo[];
|
900
900
|
};
|
901
901
|
/**
|
@@ -920,7 +920,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
920
920
|
getDoc(): Document;
|
921
921
|
setIframe(value: any): void;
|
922
922
|
getIframe(): HTMLIFrameElement | undefined;
|
923
|
-
setIsMobile(value?: boolean
|
923
|
+
setIsMobile(value?: boolean): void;
|
924
924
|
setCtx(value: any): void;
|
925
925
|
setTheme(value: string): void;
|
926
926
|
setIsSubEditor(isSubEditor: boolean): void;
|
@@ -931,7 +931,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
931
931
|
setActiveId(id: string, region?: string, selections?: Array<string>): void;
|
932
932
|
setSelections(ids: Array<string>): void;
|
933
933
|
clearSelection(): void;
|
934
|
-
setHoverId(id: string, region?: string
|
934
|
+
setHoverId(id: string, region?: string): void;
|
935
935
|
setMouseMoveRegion(region: string): void;
|
936
936
|
setInsertId(id: string): void;
|
937
937
|
setContextId(id: string): void;
|
@@ -952,9 +952,9 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
952
952
|
changeLeftPanelKey(key: string): void;
|
953
953
|
changeRenderersTabsKey(key: string): void;
|
954
954
|
changeLeftPanelOpenStatus(isOpenStatus: boolean): void;
|
955
|
-
showRendererPanel(tag?: string
|
955
|
+
showRendererPanel(tag?: string, msg?: string): void;
|
956
956
|
changeValue(value: Schema, diff?: any): void;
|
957
|
-
changeValueById(id: string, value: Schema, diff?: any, replace?: boolean
|
957
|
+
changeValueById(id: string, value: Schema, diff?: any, replace?: boolean, noTrace?: boolean): void;
|
958
958
|
moveUp(id: string): void;
|
959
959
|
moveDown(id: string): void;
|
960
960
|
del(id: string): void;
|
@@ -962,7 +962,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
962
962
|
duplicate(id: string | Array<string>): void;
|
963
963
|
emptyRegion(id: string, region: string): void;
|
964
964
|
replaceChild(id: string, json: any): void;
|
965
|
-
setInsertRegion(region: string, id?: string, tag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string
|
965
|
+
setInsertRegion(region: string, id?: string, tag?: string, mode?: 'insert' | 'replace', originId?: string, beforeId?: string): void;
|
966
966
|
closeInsertPanel(): void;
|
967
967
|
showInsertRendererPanel(): void;
|
968
968
|
closeInsertRendererPanel(): void;
|
@@ -991,7 +991,7 @@ export declare const EditorStore: import("mobx-state-tree").IModelType<{
|
|
991
991
|
* 更新可供 target 及 reload 使用的名称列表
|
992
992
|
*/
|
993
993
|
updateTargetName(): void;
|
994
|
-
traceableSetSchema(schema: any, noTrace?: boolean
|
994
|
+
traceableSetSchema(schema: any, noTrace?: boolean): void;
|
995
995
|
undo(): void;
|
996
996
|
redo(): void;
|
997
997
|
resetHistory(): void;
|
package/package.json
CHANGED
@@ -21,7 +21,7 @@ export class AvailableRenderersPlugin extends BasePlugin {
|
|
21
21
|
return;
|
22
22
|
}
|
23
23
|
|
24
|
-
if (store.
|
24
|
+
if (store.subRenderers.length) {
|
25
25
|
panels.push({
|
26
26
|
key: 'renderers',
|
27
27
|
icon: 'png-icon renderers-png', // 'fa fa-cube',
|
package/src/plugin.ts
CHANGED
@@ -374,10 +374,10 @@ export interface ToolbarItem {
|
|
374
374
|
level?: 'primary' | 'secondary' | 'special';
|
375
375
|
className?: string;
|
376
376
|
draggable?: boolean;
|
377
|
-
onDragStart?: (e:
|
377
|
+
onDragStart?: (e: any) => void;
|
378
378
|
icon?: string;
|
379
379
|
iconSvg?: string; // 自定义icon(svg格式)
|
380
|
-
onClick?: (e:
|
380
|
+
onClick?: (e: any) => void;
|
381
381
|
tooltip?: string;
|
382
382
|
placement?: 'top' | 'bottom' | 'right' | 'left';
|
383
383
|
}
|
@@ -412,7 +412,7 @@ export interface PanelItem {
|
|
412
412
|
component?: React.ComponentType<PanelProps | any>;
|
413
413
|
order: number;
|
414
414
|
position?: 'left' | 'right';
|
415
|
-
render?:
|
415
|
+
render?:(props: PanelProps) => JSX.Element;
|
416
416
|
menus?: Array<any>;
|
417
417
|
}
|
418
418
|
|
@@ -841,9 +841,10 @@ export abstract class BasePlugin implements PluginInterface {
|
|
841
841
|
panels: Array<BasicPanelItem>
|
842
842
|
) {
|
843
843
|
const plugin: PluginInterface = this;
|
844
|
+
const store = this.manager.store;
|
844
845
|
|
845
|
-
// 多选时不处理
|
846
|
-
if (context.selections.length) {
|
846
|
+
// 没有选中元素 或者 多选时不处理
|
847
|
+
if (!store.activeId || context.selections.length) {
|
847
848
|
return;
|
848
849
|
}
|
849
850
|
|