@plait/mind 0.4.0 → 0.6.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/base/emoji-base.component.d.ts +1 -0
- package/constants/node-style.d.ts +0 -6
- package/constants/theme.d.ts +6 -0
- package/esm2020/base/emoji-base.component.mjs +16 -3
- package/esm2020/constants/node-style.mjs +4 -10
- package/esm2020/constants/theme.mjs +73 -0
- package/esm2020/drawer/emojis.drawer.mjs +2 -3
- package/esm2020/drawer/quick-insert.drawer.mjs +4 -2
- package/esm2020/interfaces/index.mjs +2 -1
- package/esm2020/interfaces/theme-color.mjs +47 -0
- package/esm2020/node.component.mjs +4 -3
- package/esm2020/plugins/with-mind-create.mjs +15 -3
- package/esm2020/plugins/with-mind-hotkey.mjs +28 -0
- package/esm2020/plugins/with-mind.mjs +20 -8
- package/esm2020/plugins/with-node-dnd.mjs +36 -22
- package/esm2020/utils/dnd/common.mjs +25 -29
- package/esm2020/utils/dnd/detector.mjs +10 -86
- package/esm2020/utils/draw/node-dnd.mjs +27 -8
- package/esm2020/utils/draw/node-link/indented-link.mjs +2 -2
- package/esm2020/utils/draw/node-link/logic-link.mjs +2 -2
- package/esm2020/utils/draw/node-shape.mjs +5 -3
- package/esm2020/utils/draw/node-topic.mjs +3 -3
- package/esm2020/utils/mind.mjs +8 -8
- package/esm2020/utils/node/create-node.mjs +6 -21
- package/esm2020/utils/node-style/branch.mjs +16 -10
- package/esm2020/utils/node-style/shape.mjs +4 -4
- package/fesm2015/plait-mind.mjs +286 -193
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +315 -193
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/interfaces/index.d.ts +1 -0
- package/interfaces/theme-color.d.ts +14 -0
- package/package.json +1 -1
- package/plugins/with-mind-hotkey.d.ts +3 -0
- package/plugins/with-mind.d.ts +1 -1
- package/styles/mixins.scss +31 -0
- package/styles/styles.scss +5 -2
- package/utils/dnd/common.d.ts +11 -3
- package/utils/dnd/detector.d.ts +0 -7
- package/utils/draw/node-dnd.d.ts +6 -4
- package/utils/mind.d.ts +5 -5
- package/utils/node/create-node.d.ts +5 -3
- package/utils/node-style/branch.d.ts +4 -2
package/interfaces/index.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ThemeColor, ThemeColorMode } from '@plait/core';
|
|
2
|
+
export interface MindThemeColor extends ThemeColor {
|
|
3
|
+
mode: ThemeColorMode | string;
|
|
4
|
+
branchColors: string[];
|
|
5
|
+
rootFill: string;
|
|
6
|
+
rootTextColor: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MindDefaultThemeColor: MindThemeColor;
|
|
9
|
+
export declare const MindColorfulThemeColor: MindThemeColor;
|
|
10
|
+
export declare const MindSoftThemeColor: MindThemeColor;
|
|
11
|
+
export declare const MindRetroThemeColor: MindThemeColor;
|
|
12
|
+
export declare const MindDarkThemeColor: MindThemeColor;
|
|
13
|
+
export declare const MindStarryThemeColor: MindThemeColor;
|
|
14
|
+
export declare const MindThemeColors: MindThemeColor[];
|
package/package.json
CHANGED
package/plugins/with-mind.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
|
-
export declare const withMind: (board: PlaitBoard) => PlaitBoard
|
|
2
|
+
export declare const withMind: (board: PlaitBoard) => PlaitBoard;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@mixin node-color{
|
|
2
|
+
&.theme-default,
|
|
3
|
+
&.theme-soft {
|
|
4
|
+
.root-node {
|
|
5
|
+
color: #333333;
|
|
6
|
+
}
|
|
7
|
+
.child-node {
|
|
8
|
+
color: #333333;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.theme-colorful,
|
|
13
|
+
&.theme-retro {
|
|
14
|
+
.root-node {
|
|
15
|
+
color: #ffffff;
|
|
16
|
+
}
|
|
17
|
+
.child-node {
|
|
18
|
+
color: #333333;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.theme-dark,
|
|
23
|
+
&.theme-starry {
|
|
24
|
+
.root-node {
|
|
25
|
+
color: #333333;
|
|
26
|
+
}
|
|
27
|
+
.child-node {
|
|
28
|
+
color: #ffffff;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
package/styles/styles.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use './mixins.scss' as mixins;
|
|
2
|
+
|
|
1
3
|
$primary: #4e8afa;
|
|
2
4
|
|
|
3
5
|
g[plait-mindmap='true'] {
|
|
@@ -21,8 +23,7 @@ g[plait-mindmap='true'] {
|
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
.dragging-
|
|
25
|
-
.dragging-child {
|
|
26
|
+
.dragging-node {
|
|
26
27
|
opacity: 0.6;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -115,4 +116,6 @@ g[plait-mindmap='true'] {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
}
|
|
119
|
+
|
|
120
|
+
@include mixins.node-color();
|
|
118
121
|
}
|
package/utils/dnd/common.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { MindElement } from '../../interfaces/element';
|
|
2
2
|
import { Path, PlaitBoard } from '@plait/core';
|
|
3
|
+
import { DetectResult } from '../../interfaces/node';
|
|
3
4
|
export declare const IS_DRAGGING: WeakMap<PlaitBoard, boolean>;
|
|
4
|
-
export declare const addActiveOnDragOrigin: (activeElement: MindElement
|
|
5
|
-
export declare const removeActiveOnDragOrigin: (activeElement: MindElement
|
|
5
|
+
export declare const addActiveOnDragOrigin: (activeElement: MindElement) => void;
|
|
6
|
+
export declare const removeActiveOnDragOrigin: (activeElement: MindElement) => void;
|
|
6
7
|
export declare const isDragging: (board: PlaitBoard) => boolean;
|
|
7
8
|
export declare const setIsDragging: (board: PlaitBoard, state: boolean) => void;
|
|
8
|
-
export declare const hasPreviousOrNextOfDropPath: (parent: MindElement,
|
|
9
|
+
export declare const hasPreviousOrNextOfDropPath: (parent: MindElement, dropTarget: {
|
|
10
|
+
target: MindElement;
|
|
11
|
+
detectResult: DetectResult;
|
|
12
|
+
}, dropPath: Path) => {
|
|
9
13
|
hasPreviousNode: boolean;
|
|
10
14
|
hasNextNode: boolean;
|
|
11
15
|
};
|
|
16
|
+
export declare const isDropStandardRight: (parent: MindElement, dropTarget: {
|
|
17
|
+
target: MindElement;
|
|
18
|
+
detectResult: DetectResult;
|
|
19
|
+
}) => boolean;
|
package/utils/dnd/detector.d.ts
CHANGED
|
@@ -11,13 +11,6 @@ export declare const detectDropTarget: (board: PlaitBoard, detectPoint: Point, d
|
|
|
11
11
|
detectResult: DetectResult;
|
|
12
12
|
} | null;
|
|
13
13
|
export declare const directionDetector: (targetNode: MindNode, centerPoint: Point) => DetectResult[] | null;
|
|
14
|
-
export declare const readjustmentDropTarget: (board: PlaitBoard, dropTarget: {
|
|
15
|
-
target: MindElement;
|
|
16
|
-
detectResult: DetectResult;
|
|
17
|
-
}) => {
|
|
18
|
-
target: MindElement;
|
|
19
|
-
detectResult: DetectResult;
|
|
20
|
-
};
|
|
21
14
|
export declare const isValidTarget: (origin: MindElement, target: MindElement) => boolean;
|
|
22
15
|
export declare const getPathByDropTarget: (board: PlaitBoard, dropTarget: {
|
|
23
16
|
target: MindElement;
|
package/utils/draw/node-dnd.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { MindElement } from '../../interfaces';
|
|
2
|
-
import { MindNodeComponent } from '../../node.component';
|
|
1
|
+
import { DetectResult, MindElement } from '../../interfaces';
|
|
3
2
|
import { PlaitBoard, Path } from '@plait/core';
|
|
4
|
-
export declare const drawFakeDragNode: (board: PlaitBoard,
|
|
5
|
-
export declare const drawFakeDropNode: (board: PlaitBoard,
|
|
3
|
+
export declare const drawFakeDragNode: (board: PlaitBoard, element: MindElement, offsetX: number, offsetY: number) => SVGGElement;
|
|
4
|
+
export declare const drawFakeDropNode: (board: PlaitBoard, dropTarget: {
|
|
5
|
+
target: MindElement;
|
|
6
|
+
detectResult: DetectResult;
|
|
7
|
+
}, path: Path) => SVGGElement;
|
package/utils/mind.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Path, PlaitBoard } from '@plait/core';
|
|
2
|
-
import { MindNode } from '../interfaces';
|
|
3
2
|
import { MindElement } from '../interfaces/element';
|
|
3
|
+
import { MindNode } from '../interfaces/node';
|
|
4
4
|
export declare const getChildrenCount: (element: MindElement) => number;
|
|
5
5
|
export declare const isChildElement: (origin: MindElement, child: MindElement) => boolean;
|
|
6
|
-
export declare const getFirstLevelElement: (elements: MindElement[]) => MindElement<import("
|
|
6
|
+
export declare const getFirstLevelElement: (elements: MindElement[]) => MindElement<import("@plait/mind").BaseData>[];
|
|
7
7
|
export declare const isChildRight: (node: MindNode, child: MindNode) => boolean;
|
|
8
8
|
export declare const isChildUp: (node: MindNode, child: MindNode) => boolean;
|
|
9
|
-
export declare const copyNewNode: (node: MindElement) => MindElement<import("
|
|
9
|
+
export declare const copyNewNode: (node: MindElement) => MindElement<import("@plait/mind").BaseData>;
|
|
10
10
|
export declare const extractNodesText: (node: MindElement) => string;
|
|
11
11
|
export declare const insertMindElement: (board: PlaitBoard, inheritNode: MindElement, path: Path) => void;
|
|
12
12
|
export declare const findLastChild: (child: MindNode) => MindNode;
|
|
13
13
|
export declare const divideElementByParent: (elements: MindElement[]) => {
|
|
14
|
-
parentElements: MindElement<import("
|
|
15
|
-
abstractIncludedGroups: MindElement<import("
|
|
14
|
+
parentElements: MindElement<import("@plait/mind").BaseData>[];
|
|
15
|
+
abstractIncludedGroups: MindElement<import("@plait/mind").BaseData>[][];
|
|
16
16
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PlaitBoard, Point } from '@plait/core';
|
|
2
2
|
import { MindLayoutType } from '@plait/layouts';
|
|
3
|
-
import { MindElement, MindElementShape } from '../../interfaces/element';
|
|
3
|
+
import { BranchShape, MindElement, MindElementShape } from '../../interfaces/element';
|
|
4
4
|
export declare const createEmptyMind: (board: PlaitBoard, point: Point) => MindElement<import("@plait/mind").BaseData>;
|
|
5
5
|
export declare const createDefaultMind: (point: Point, rightNodeCount: number, layout: MindLayoutType) => MindElement<import("@plait/mind").BaseData>;
|
|
6
|
-
export declare const createMindElement: (text: string, width: number, height: number, options:
|
|
6
|
+
export declare const createMindElement: (text: string, width: number, height: number, options: InheritAttribute) => MindElement<import("@plait/mind").BaseData>;
|
|
7
|
+
export interface InheritAttribute {
|
|
7
8
|
fill?: string;
|
|
8
9
|
strokeColor?: string;
|
|
9
10
|
strokeWidth?: number;
|
|
@@ -11,4 +12,5 @@ export declare const createMindElement: (text: string, width: number, height: nu
|
|
|
11
12
|
layout?: MindLayoutType;
|
|
12
13
|
branchColor?: string;
|
|
13
14
|
branchWidth?: number;
|
|
14
|
-
|
|
15
|
+
branchShape?: BranchShape;
|
|
16
|
+
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { PlaitBoard } from '@plait/core';
|
|
5
5
|
import { MindElement } from '../../interfaces/element';
|
|
6
|
+
import { MindThemeColor } from '../../interfaces/theme-color';
|
|
6
7
|
export declare const getBranchColorByMindElement: (board: PlaitBoard, element: MindElement) => any;
|
|
7
8
|
export declare const getBranchShapeByMindElement: (board: PlaitBoard, element: MindElement) => any;
|
|
8
9
|
export declare const getBranchWidthByMindElement: (board: PlaitBoard, element: MindElement) => any;
|
|
9
10
|
export declare const getAbstractBranchWidth: (board: PlaitBoard, element: MindElement) => number | undefined;
|
|
10
11
|
export declare const getAbstractBranchColor: (board: PlaitBoard, element: MindElement) => string;
|
|
11
|
-
export declare const getNextBranchColor: (root: MindElement) => string;
|
|
12
|
+
export declare const getNextBranchColor: (board: PlaitBoard, root: MindElement) => string;
|
|
12
13
|
export declare const getDefaultBranchColor: (board: PlaitBoard, element: MindElement) => string;
|
|
13
|
-
export declare const getDefaultBranchColorByIndex: (index: number) => string;
|
|
14
|
+
export declare const getDefaultBranchColorByIndex: (board: PlaitBoard, index: number) => string;
|
|
15
|
+
export declare const getMindThemeColor: (board: PlaitBoard) => MindThemeColor;
|