@plait/mind 0.5.0 → 0.7.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/constants/node-style.d.ts +0 -6
- package/constants/theme.d.ts +6 -0
- 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 +57 -0
- package/esm2020/node.component.mjs +4 -3
- package/esm2020/plugins/with-mind-hotkey.mjs +28 -0
- package/esm2020/plugins/with-mind.mjs +18 -2
- package/esm2020/utils/draw/node-dnd.mjs +2 -3
- 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 -9
- package/esm2020/utils/node/create-node.mjs +19 -29
- package/esm2020/utils/node-style/branch.mjs +19 -8
- package/esm2020/utils/node-style/common.mjs +2 -11
- package/esm2020/utils/node-style/shape.mjs +6 -12
- package/fesm2015/plait-mind.mjs +199 -75
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +229 -75
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/interfaces/index.d.ts +1 -0
- package/interfaces/theme-color.d.ts +17 -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 +4 -0
- package/utils/mind.d.ts +5 -5
- package/utils/node/create-node.d.ts +6 -3
- package/utils/node-style/branch.d.ts +4 -2
- package/utils/node-style/shape.d.ts +1 -1
package/interfaces/index.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
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[];
|
|
15
|
+
export declare const MindThemeColor: {
|
|
16
|
+
isMindThemeColor(value: any): value is MindThemeColor;
|
|
17
|
+
};
|
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
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,6 @@ 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
|
+
}
|
|
17
|
+
export declare const INHERIT_ATTRIBUTE_KEYS: string[];
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
2
|
import { MindElement, MindElementShape } from '../../interfaces/element';
|
|
3
|
-
export declare const getStrokeByMindElement: (board: PlaitBoard, element: MindElement) =>
|
|
3
|
+
export declare const getStrokeByMindElement: (board: PlaitBoard, element: MindElement) => any;
|
|
4
4
|
export declare const getShapeByElement: (board: PlaitBoard, element: MindElement) => MindElementShape;
|