amis-editor-core 6.11.0 → 6.12.0-ab.2
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/esm/component/Preview.d.ts +4 -0
- package/esm/dnd/default.d.ts +16 -9
- package/esm/dnd/index.d.ts +6 -1
- package/esm/dnd/position-h.d.ts +17 -2
- package/esm/index.js +2 -2
- package/esm/plugin.d.ts +5 -1
- package/esm/store/editor.d.ts +36 -39
- package/lib/component/Preview.d.ts +4 -0
- package/lib/component/base/BackTop.d.ts +1 -1
- package/lib/dnd/default.d.ts +16 -9
- package/lib/dnd/flex.d.ts +1 -1
- package/lib/dnd/index.d.ts +6 -1
- package/lib/dnd/position-h.d.ts +17 -2
- package/lib/editor.js +1 -1
- package/lib/index.js +2 -2
- package/lib/plugin.d.ts +5 -1
- package/lib/store/editor.d.ts +36 -40
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/esm/plugin.d.ts
CHANGED
|
@@ -82,7 +82,11 @@ export interface RegionConfig {
|
|
|
82
82
|
/**
|
|
83
83
|
* 可以用来判断是否允许拖入当前节点。
|
|
84
84
|
*/
|
|
85
|
-
accept?: (json: any) => boolean;
|
|
85
|
+
accept?: (json: any, node: EditorNodeType, dragNode?: EditorNodeType) => boolean;
|
|
86
|
+
/**
|
|
87
|
+
* 当前区域是否隐藏
|
|
88
|
+
*/
|
|
89
|
+
hiddenOn?: (schema: Schema) => boolean;
|
|
86
90
|
}
|
|
87
91
|
export interface VRendererConfig {
|
|
88
92
|
/**
|
package/esm/store/editor.d.ts
CHANGED
|
@@ -446,6 +446,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
446
446
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
447
447
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
448
448
|
updateSchema(value: any): void;
|
|
449
|
+
/** 获取自定义组件
|
|
450
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
451
|
+
*/
|
|
449
452
|
updateSchemaStyle(value: any): void;
|
|
450
453
|
setComponent(value: any): void;
|
|
451
454
|
getComponent(): any;
|
|
@@ -453,10 +456,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
453
456
|
calculateHighlightBox(root?: any): void;
|
|
454
457
|
resetHighlightBox(root: any): void;
|
|
455
458
|
updateState(state: any, replace?: boolean): void;
|
|
456
|
-
setWidthMutable(value: any): void;
|
|
457
|
-
* 根据当前分类和关键字获取预置组件
|
|
458
|
-
* 备注:组件面板展示需要
|
|
459
|
-
*/
|
|
459
|
+
setWidthMutable(value: any): void;
|
|
460
460
|
setHeightMutable(value: any): void;
|
|
461
461
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
462
462
|
theme: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -467,7 +467,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
467
467
|
activeId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
468
468
|
activeRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
469
469
|
activeElement: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
470
|
-
mouseMoveRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
471
470
|
selections: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<string[], string[], string[]>, [undefined]>;
|
|
472
471
|
contextId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
473
472
|
dragMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -538,7 +537,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
538
537
|
isContextOn(id: string): boolean | "";
|
|
539
538
|
readonly activeContainerId: string;
|
|
540
539
|
isRegionHighlighted(id: string, region: string): boolean;
|
|
541
|
-
isRegionHighlightHover(id: string, region: string): boolean;
|
|
542
540
|
isRegionActive(id: string, region: string): boolean;
|
|
543
541
|
isRegionDragEnter(id: string, region: string): boolean;
|
|
544
542
|
readonly highlightNodes: ({
|
|
@@ -909,6 +907,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
909
907
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
910
908
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
911
909
|
updateSchema(value: any): void;
|
|
910
|
+
/** 获取自定义组件
|
|
911
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
912
|
+
*/
|
|
912
913
|
updateSchemaStyle(value: any): void;
|
|
913
914
|
setComponent(value: any): void;
|
|
914
915
|
getComponent(): any;
|
|
@@ -916,10 +917,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
916
917
|
calculateHighlightBox(root?: any): void;
|
|
917
918
|
resetHighlightBox(root: any): void;
|
|
918
919
|
updateState(state: any, replace?: boolean): void;
|
|
919
|
-
setWidthMutable(value: any): void;
|
|
920
|
-
* 根据当前分类和关键字获取预置组件
|
|
921
|
-
* 备注:组件面板展示需要
|
|
922
|
-
*/
|
|
920
|
+
setWidthMutable(value: any): void;
|
|
923
921
|
setHeightMutable(value: any): void;
|
|
924
922
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
925
923
|
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -1289,6 +1287,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1289
1287
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
1290
1288
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
1291
1289
|
updateSchema(value: any): void;
|
|
1290
|
+
/** 获取自定义组件
|
|
1291
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
1292
|
+
*/
|
|
1292
1293
|
updateSchemaStyle(value: any): void;
|
|
1293
1294
|
setComponent(value: any): void;
|
|
1294
1295
|
getComponent(): any;
|
|
@@ -1296,10 +1297,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1296
1297
|
calculateHighlightBox(root?: any): void;
|
|
1297
1298
|
resetHighlightBox(root: any): void;
|
|
1298
1299
|
updateState(state: any, replace?: boolean): void;
|
|
1299
|
-
setWidthMutable(value: any): void;
|
|
1300
|
-
* 根据当前分类和关键字获取预置组件
|
|
1301
|
-
* 备注:组件面板展示需要
|
|
1302
|
-
*/
|
|
1300
|
+
setWidthMutable(value: any): void;
|
|
1303
1301
|
setHeightMutable(value: any): void;
|
|
1304
1302
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
1305
1303
|
getNodeById(id: string, regionOrType?: string): EditorNodeType | undefined;
|
|
@@ -1692,6 +1690,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1692
1690
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
1693
1691
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
1694
1692
|
updateSchema(value: any): void;
|
|
1693
|
+
/** 获取自定义组件
|
|
1694
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
1695
|
+
*/
|
|
1695
1696
|
updateSchemaStyle(value: any): void;
|
|
1696
1697
|
setComponent(value: any): void;
|
|
1697
1698
|
getComponent(): any;
|
|
@@ -1699,10 +1700,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
1699
1700
|
calculateHighlightBox(root?: any): void;
|
|
1700
1701
|
resetHighlightBox(root: any): void;
|
|
1701
1702
|
updateState(state: any, replace?: boolean): void;
|
|
1702
|
-
setWidthMutable(value: any): void;
|
|
1703
|
-
* 根据当前分类和关键字获取预置组件
|
|
1704
|
-
* 备注:组件面板展示需要
|
|
1705
|
-
*/
|
|
1703
|
+
setWidthMutable(value: any): void;
|
|
1706
1704
|
setHeightMutable(value: any): void;
|
|
1707
1705
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
1708
1706
|
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -2072,6 +2070,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2072
2070
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
2073
2071
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
2074
2072
|
updateSchema(value: any): void;
|
|
2073
|
+
/** 获取自定义组件
|
|
2074
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
2075
|
+
*/
|
|
2075
2076
|
updateSchemaStyle(value: any): void;
|
|
2076
2077
|
setComponent(value: any): void;
|
|
2077
2078
|
getComponent(): any;
|
|
@@ -2079,10 +2080,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2079
2080
|
calculateHighlightBox(root?: any): void;
|
|
2080
2081
|
resetHighlightBox(root: any): void;
|
|
2081
2082
|
updateState(state: any, replace?: boolean): void;
|
|
2082
|
-
setWidthMutable(value: any): void;
|
|
2083
|
-
* 根据当前分类和关键字获取预置组件
|
|
2084
|
-
* 备注:组件面板展示需要
|
|
2085
|
-
*/
|
|
2083
|
+
setWidthMutable(value: any): void;
|
|
2086
2084
|
setHeightMutable(value: any): void;
|
|
2087
2085
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
2088
2086
|
readonly activePath: ({
|
|
@@ -2453,6 +2451,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2453
2451
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
2454
2452
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
2455
2453
|
updateSchema(value: any): void;
|
|
2454
|
+
/** 获取自定义组件
|
|
2455
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
2456
|
+
*/
|
|
2456
2457
|
updateSchemaStyle(value: any): void;
|
|
2457
2458
|
setComponent(value: any): void;
|
|
2458
2459
|
getComponent(): any;
|
|
@@ -2460,10 +2461,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2460
2461
|
calculateHighlightBox(root?: any): void;
|
|
2461
2462
|
resetHighlightBox(root: any): void;
|
|
2462
2463
|
updateState(state: any, replace?: boolean): void;
|
|
2463
|
-
setWidthMutable(value: any): void;
|
|
2464
|
-
* 根据当前分类和关键字获取预置组件
|
|
2465
|
-
* 备注:组件面板展示需要
|
|
2466
|
-
*/
|
|
2464
|
+
setWidthMutable(value: any): void;
|
|
2467
2465
|
setHeightMutable(value: any): void;
|
|
2468
2466
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
2469
2467
|
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -2833,6 +2831,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2833
2831
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
2834
2832
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
2835
2833
|
updateSchema(value: any): void;
|
|
2834
|
+
/** 获取自定义组件
|
|
2835
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
2836
|
+
*/
|
|
2836
2837
|
updateSchemaStyle(value: any): void;
|
|
2837
2838
|
setComponent(value: any): void;
|
|
2838
2839
|
getComponent(): any;
|
|
@@ -2840,10 +2841,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
2840
2841
|
calculateHighlightBox(root?: any): void;
|
|
2841
2842
|
resetHighlightBox(root: any): void;
|
|
2842
2843
|
updateState(state: any, replace?: boolean): void;
|
|
2843
|
-
setWidthMutable(value: any): void;
|
|
2844
|
-
* 根据当前分类和关键字获取预置组件
|
|
2845
|
-
* 备注:组件面板展示需要
|
|
2846
|
-
*/
|
|
2844
|
+
setWidthMutable(value: any): void;
|
|
2847
2845
|
setHeightMutable(value: any): void;
|
|
2848
2846
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
2849
2847
|
getNodePathById(id: string): ({
|
|
@@ -3214,6 +3212,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3214
3212
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
3215
3213
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
3216
3214
|
updateSchema(value: any): void;
|
|
3215
|
+
/** 获取自定义组件
|
|
3216
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
3217
|
+
*/
|
|
3217
3218
|
updateSchemaStyle(value: any): void;
|
|
3218
3219
|
setComponent(value: any): void;
|
|
3219
3220
|
getComponent(): any;
|
|
@@ -3221,10 +3222,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3221
3222
|
calculateHighlightBox(root?: any): void;
|
|
3222
3223
|
resetHighlightBox(root: any): void;
|
|
3223
3224
|
updateState(state: any, replace?: boolean): void;
|
|
3224
|
-
setWidthMutable(value: any): void;
|
|
3225
|
-
* 根据当前分类和关键字获取预置组件
|
|
3226
|
-
* 备注:组件面板展示需要
|
|
3227
|
-
*/
|
|
3225
|
+
setWidthMutable(value: any): void;
|
|
3228
3226
|
setHeightMutable(value: any): void;
|
|
3229
3227
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
3230
3228
|
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
@@ -3594,6 +3592,9 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3594
3592
|
toggleFold(e: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>): void;
|
|
3595
3593
|
patch(store: any, force?: boolean, setPatchInfo?: ((id: string, value: any) => void) | undefined, ids?: Map<string, string> | undefined): void;
|
|
3596
3594
|
updateSchema(value: any): void;
|
|
3595
|
+
/** 获取自定义组件
|
|
3596
|
+
* 备注:disabledRendererPlugin 为 true 则不在面板中展示
|
|
3597
|
+
*/
|
|
3597
3598
|
updateSchemaStyle(value: any): void;
|
|
3598
3599
|
setComponent(value: any): void;
|
|
3599
3600
|
getComponent(): any;
|
|
@@ -3601,10 +3602,7 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3601
3602
|
calculateHighlightBox(root?: any): void;
|
|
3602
3603
|
resetHighlightBox(root: any): void;
|
|
3603
3604
|
updateState(state: any, replace?: boolean): void;
|
|
3604
|
-
setWidthMutable(value: any): void;
|
|
3605
|
-
* 根据当前分类和关键字获取预置组件
|
|
3606
|
-
* 备注:组件面板展示需要
|
|
3607
|
-
*/
|
|
3605
|
+
setWidthMutable(value: any): void;
|
|
3608
3606
|
setHeightMutable(value: any): void;
|
|
3609
3607
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
3610
3608
|
readonly dragging: boolean;
|
|
@@ -3693,7 +3691,6 @@ export declare const MainStore: import("mobx-state-tree").IModelType<{
|
|
|
3693
3691
|
setSelections(ids: Array<string>): void;
|
|
3694
3692
|
clearSelection(): void;
|
|
3695
3693
|
setHoverId(id: string, region?: string): void;
|
|
3696
|
-
setMouseMoveRegion(region: string): void;
|
|
3697
3694
|
setInsertId(id: string): void;
|
|
3698
3695
|
setContextId(id: string): void;
|
|
3699
3696
|
setDragId(id: string, mode?: 'move' | 'copy', type?: string, schema?: any): void;
|
|
@@ -49,6 +49,10 @@ export default class Preview extends Component<PreviewProps> {
|
|
|
49
49
|
handleDBClick(e: MouseEvent): void;
|
|
50
50
|
handleNavSwitch(id: string): void;
|
|
51
51
|
handleMouseMove(e: MouseEvent): void;
|
|
52
|
+
getElementPoint(e: MouseEvent): {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
};
|
|
52
56
|
handleMouseLeave(): void;
|
|
53
57
|
handeMouseOver(e: MouseEvent): void;
|
|
54
58
|
handleSubmit(e: Event): void;
|
|
@@ -16,7 +16,7 @@ export default class BackTop extends React.Component<BackTopProps, BackTopStates
|
|
|
16
16
|
constructor(props: any);
|
|
17
17
|
componentDidMount(): void;
|
|
18
18
|
componentWillUnmount(): void;
|
|
19
|
-
getDefaultTarget():
|
|
19
|
+
getDefaultTarget(): (Window & typeof globalThis) | Document;
|
|
20
20
|
handleScroll(e: React.UIEvent<HTMLElement> | {
|
|
21
21
|
target: any;
|
|
22
22
|
}): void;
|
package/lib/dnd/default.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { EditorDNDManager } from '
|
|
1
|
+
import { EditorDNDManager } from './index';
|
|
2
2
|
import { EditorNodeType } from '../store/node';
|
|
3
3
|
import { DNDModeInterface } from './interface';
|
|
4
4
|
export declare class DefaultDNDMode implements DNDModeInterface {
|
|
5
5
|
readonly dnd: EditorDNDManager;
|
|
6
6
|
readonly region: EditorNodeType;
|
|
7
7
|
readonly dndContainer: HTMLElement;
|
|
8
|
-
|
|
8
|
+
readonly relativeContainer: HTMLElement;
|
|
9
|
+
dropOn?: string;
|
|
10
|
+
dropPosition?: 'top' | 'bottom' | 'left' | 'right' | 'center' | 'middle';
|
|
9
11
|
constructor(dnd: EditorDNDManager, region: EditorNodeType);
|
|
12
|
+
layoutInfo: LayoutInfo | null;
|
|
10
13
|
/**
|
|
11
14
|
* 记录上次交换时的鼠标位置。
|
|
12
15
|
*/
|
|
@@ -33,15 +36,19 @@ export declare class DefaultDNDMode implements DNDModeInterface {
|
|
|
33
36
|
* 获取当时拖动到了哪个节点上面。
|
|
34
37
|
*/
|
|
35
38
|
getTarget(e: DragEvent): HTMLElement | null;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* @param descend
|
|
41
|
-
*/
|
|
42
|
-
getChild(dom: HTMLElement, descend: HTMLElement): HTMLElement;
|
|
39
|
+
getChildren(region: HTMLElement): Array<HTMLElement>;
|
|
40
|
+
detectDropPosition(event: DragEvent, dropTarget: HTMLElement): 'top' | 'bottom' | 'left' | 'right';
|
|
41
|
+
reductionPosition(position: 'top' | 'bottom' | 'left' | 'right', isHorizontal?: boolean): "left" | "right" | "bottom" | "top";
|
|
42
|
+
updateIndicator(ghost: HTMLElement, target: HTMLElement, dropPosition: 'top' | 'bottom' | 'left' | 'right' | 'center' | 'middle'): void;
|
|
43
43
|
/**
|
|
44
44
|
* 销毁
|
|
45
45
|
*/
|
|
46
46
|
dispose(): void;
|
|
47
47
|
}
|
|
48
|
+
interface LayoutInfo {
|
|
49
|
+
type: 'flex' | 'grid' | 'block';
|
|
50
|
+
isHorizontal?: boolean;
|
|
51
|
+
isWrapped?: boolean;
|
|
52
|
+
hasColumns?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
package/lib/dnd/flex.d.ts
CHANGED
|
@@ -45,6 +45,6 @@ export declare class FlexDNDMode implements DNDModeInterface {
|
|
|
45
45
|
* 销毁
|
|
46
46
|
*/
|
|
47
47
|
dispose(): void;
|
|
48
|
-
getDropPosition(): "left" | "right" | "
|
|
48
|
+
getDropPosition(): "left" | "right" | "bottom" | "top" | undefined;
|
|
49
49
|
interruptionDrop(): boolean;
|
|
50
50
|
}
|
package/lib/dnd/index.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export declare class EditorDNDManager {
|
|
|
27
27
|
* 拖拽跟随元素
|
|
28
28
|
*/
|
|
29
29
|
dragImage?: HTMLElement;
|
|
30
|
+
/**
|
|
31
|
+
* 是否锁定自动切换
|
|
32
|
+
*/
|
|
33
|
+
lockAutoSwitch: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* 记录上次鼠标位置信息,协助拖拽计算的。
|
|
32
36
|
*/
|
|
@@ -52,7 +56,7 @@ export declare class EditorDNDManager {
|
|
|
52
56
|
* @param id
|
|
53
57
|
* @param region
|
|
54
58
|
*/
|
|
55
|
-
switchToRegion(e: DragEvent, id: string, region: string): boolean;
|
|
59
|
+
switchToRegion(e: DragEvent, id: string, region: string, lockAutoSwitch?: boolean): boolean;
|
|
56
60
|
/**
|
|
57
61
|
* 根据区域的配置,创建拖拽模式实例。
|
|
58
62
|
* 比如 table 列区域的拖拽就是放根线表示拖入的位置。
|
|
@@ -104,6 +108,7 @@ export declare class EditorDNDManager {
|
|
|
104
108
|
id: string;
|
|
105
109
|
region: string;
|
|
106
110
|
}): void;
|
|
111
|
+
isInEdgeRegion(e: DragEvent, target: HTMLElement): boolean;
|
|
107
112
|
/**
|
|
108
113
|
* 销毁函数。
|
|
109
114
|
*/
|
package/lib/dnd/position-h.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { DefaultDNDMode } from './default';
|
|
2
1
|
import { DNDModeInterface } from './interface';
|
|
3
|
-
|
|
2
|
+
import { EditorNodeType } from '../store/node';
|
|
3
|
+
import { EditorDNDManager } from './index';
|
|
4
|
+
export declare class PositionHDNDMode implements DNDModeInterface {
|
|
5
|
+
readonly dnd: EditorDNDManager;
|
|
6
|
+
readonly region: EditorNodeType;
|
|
7
|
+
readonly dndContainer: HTMLElement;
|
|
8
|
+
dropBeforeId?: string;
|
|
9
|
+
constructor(dnd: EditorDNDManager, region: EditorNodeType);
|
|
4
10
|
enter(e: DragEvent, ghost: HTMLElement): void;
|
|
5
11
|
leave(e: DragEvent, ghost: HTMLElement): void;
|
|
6
12
|
over(e: DragEvent, ghost: HTMLElement): void;
|
|
13
|
+
/**
|
|
14
|
+
* 获取当时拖动到了哪个节点上面。
|
|
15
|
+
*/
|
|
16
|
+
getTarget(e: DragEvent): HTMLElement | null;
|
|
17
|
+
getDropBeforeId(): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* 销毁
|
|
20
|
+
*/
|
|
21
|
+
dispose(): void;
|
|
7
22
|
}
|
package/lib/editor.js
CHANGED