@plait/mind 0.89.2 → 0.90.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.
- package/fesm2022/plait-mind.mjs +201 -102
- package/fesm2022/plait-mind.mjs.map +1 -1
- package/generators/node-more.generator.d.ts +25 -12
- package/package.json +1 -1
- package/plugins/with-node-more.d.ts +8 -4
- package/utils/path.d.ts +2 -0
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { PlaitBoard, Point } from '@plait/core';
|
|
1
|
+
import { PlaitBoard, Point, RectangleClient } from '@plait/core';
|
|
2
2
|
import { MindElement, BaseData, LayoutDirection } from '../interfaces';
|
|
3
3
|
import { Generator } from '@plait/common';
|
|
4
4
|
export interface NodeMoreExtraData {
|
|
5
5
|
isSelected: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
isHit?: boolean;
|
|
7
|
+
isHitAwarenessRectangle?: boolean | null;
|
|
8
|
+
isHitCollapseArea?: boolean;
|
|
9
|
+
isHitExpandArea?: boolean;
|
|
10
|
+
isHitAddArea?: boolean;
|
|
10
11
|
isShowCollapseAnimation?: boolean;
|
|
11
12
|
isShowAddAnimation?: boolean;
|
|
13
|
+
isHitStandardLeftAddArea?: boolean;
|
|
14
|
+
isHitStandardLeftAwarenessRectangle?: boolean;
|
|
12
15
|
}
|
|
13
16
|
export declare class NodeMoreGenerator extends Generator<MindElement, NodeMoreExtraData> {
|
|
14
17
|
static key: string;
|
|
@@ -16,15 +19,25 @@ export declare class NodeMoreGenerator extends Generator<MindElement, NodeMoreEx
|
|
|
16
19
|
expandG: SVGGElement | undefined | null;
|
|
17
20
|
canDraw(element: MindElement<BaseData>, extraData: NodeMoreExtraData): boolean;
|
|
18
21
|
draw(element: MindElement<BaseData>, extraData: NodeMoreExtraData): SVGGElement;
|
|
19
|
-
|
|
22
|
+
toggleCollapseAndAdd(center: Point, addCenter: Point | null, standardLeftAddCenter: Point | null | undefined, stroke: string, parentG: SVGGElement, isShowCollapse: boolean, isShowAdd: boolean, isShowStandardLeftAdd: boolean, isHitAddArea: boolean, isHitStandardLeftAdd: boolean, isShowCollapseAnimation: boolean, isShowAddAnimation: boolean): void;
|
|
20
23
|
toggleExpandBadge(element: MindElement, moreStartAndEnd: [Point, Point], center: Point, stroke: string, parentG: SVGGElement, isCollapsed: boolean, isHoveredExpandIcon: boolean): void;
|
|
21
24
|
}
|
|
22
|
-
export declare const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
export declare const getNodeMoreKeyPosition: (board: PlaitBoard, element: MindElement) => {
|
|
26
|
+
startPoint: Point;
|
|
27
|
+
endPoint: Point;
|
|
28
|
+
hasCollapsedIcon: boolean;
|
|
29
|
+
hasExpandedIcon: boolean | undefined;
|
|
30
|
+
hasAddIcon: boolean;
|
|
31
|
+
collapsedIconCenter: Point | null;
|
|
32
|
+
expandedIconCenter: Point | null;
|
|
33
|
+
addCenter: Point | null;
|
|
34
|
+
awarenessRectangle: RectangleClient | null;
|
|
35
|
+
hasLeftAddIcon: boolean;
|
|
36
|
+
standardRef: {
|
|
37
|
+
addCenter: Point;
|
|
38
|
+
awarenessRectangle: RectangleClient;
|
|
39
|
+
} | null;
|
|
25
40
|
};
|
|
26
|
-
export declare const getAddCenterByCollapseOrExpandCenter: (target: MindElement, collapseOrExpandCenter: Point, layoutDirection: LayoutDirection) => Point;
|
|
27
41
|
export declare const getNodeMoreLayoutDirection: (board: PlaitBoard, element: MindElement) => LayoutDirection;
|
|
28
|
-
export declare const
|
|
29
|
-
export declare const isLastSelectedMindElement: (board: PlaitBoard, element: MindElement) => boolean;
|
|
42
|
+
export declare const getNodeMoreStartPoint: (board: PlaitBoard, element: MindElement, linkLineDirection: LayoutDirection, isLeft?: boolean) => Point;
|
|
30
43
|
export declare const canHandleNodeMore: (board: PlaitBoard) => boolean;
|
package/package.json
CHANGED
|
@@ -2,9 +2,13 @@ import { PlaitBoard } from '@plait/core';
|
|
|
2
2
|
import { MindElement } from '../interfaces';
|
|
3
3
|
export interface NodeMoreRef {
|
|
4
4
|
target: MindElement;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
isHit: boolean;
|
|
6
|
+
isHitAwarenessRectangle: boolean;
|
|
7
|
+
isHitCollapseArea: boolean;
|
|
8
|
+
isHitExpandArea: boolean;
|
|
9
|
+
isHitAddArea: boolean;
|
|
10
|
+
isHitStandardLeftAddArea: boolean;
|
|
11
|
+
isHitStandardLeftAwarenessRectangle: boolean;
|
|
9
12
|
}
|
|
13
|
+
export declare const isSameNodeMoreRef: (ref1: NodeMoreRef | null, ref2: NodeMoreRef | null) => boolean;
|
|
10
14
|
export declare const withNodeMore: (board: PlaitBoard) => PlaitBoard;
|
package/utils/path.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement } from '@plait/core';
|
|
2
2
|
import { Path } from 'slate';
|
|
3
|
+
import { PlaitMind } from '../interfaces';
|
|
3
4
|
export declare function findNewChildNodePath(board: PlaitBoard, element: PlaitElement): number[];
|
|
5
|
+
export declare function findNewRightChildNodePath(board: PlaitBoard, element: PlaitMind, rightNodeCount: number): number[];
|
|
4
6
|
export declare function findNewSiblingNodePath(board: PlaitBoard, element: PlaitElement): Path;
|