@plait/mind 0.2.0-next.8 → 0.2.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.
Files changed (93) hide show
  1. package/constants/abstract-node.d.ts +4 -0
  2. package/constants/default.d.ts +1 -2
  3. package/constants/index.d.ts +4 -1
  4. package/constants/node-rule.d.ts +1 -0
  5. package/constants/node-style.d.ts +17 -0
  6. package/constants/node-topic-style.d.ts +4 -0
  7. package/draw/richtext.d.ts +1 -1
  8. package/esm2020/constants/abstract-node.mjs +5 -0
  9. package/esm2020/constants/default.mjs +2 -3
  10. package/esm2020/constants/index.mjs +5 -2
  11. package/esm2020/constants/node-rule.mjs +2 -0
  12. package/esm2020/constants/node-style.mjs +19 -0
  13. package/esm2020/constants/node-topic-style.mjs +5 -0
  14. package/esm2020/draw/abstract.mjs +4 -3
  15. package/esm2020/draw/indented-link.mjs +15 -15
  16. package/esm2020/draw/link/abstract-link.mjs +6 -4
  17. package/esm2020/draw/link/logic-link.mjs +10 -8
  18. package/esm2020/draw/link.mjs +8 -7
  19. package/esm2020/draw/richtext.mjs +10 -8
  20. package/esm2020/draw/shape.mjs +5 -5
  21. package/esm2020/drawer/quick-insert.drawer.mjs +13 -14
  22. package/esm2020/interfaces/abstract.mjs +1 -1
  23. package/esm2020/interfaces/element.mjs +20 -1
  24. package/esm2020/interfaces/node.mjs +1 -10
  25. package/esm2020/layout-option.mjs +3 -3
  26. package/esm2020/node.component.mjs +43 -34
  27. package/esm2020/plugins/emoji/emoji.drawer.mjs +4 -8
  28. package/esm2020/plugins/emoji/emoji.mjs +31 -3
  29. package/esm2020/plugins/with-abstract.mjs +2 -2
  30. package/esm2020/plugins/with-dnd.mjs +23 -123
  31. package/esm2020/plugins/with-mind.mjs +37 -29
  32. package/esm2020/queries/get-available-sublayouts-by-element.mjs +5 -10
  33. package/esm2020/queries/get-branch-layouts.mjs +7 -7
  34. package/esm2020/queries/get-correct-layout-by-element.mjs +28 -31
  35. package/esm2020/queries/get-layout-by-element.mjs +11 -9
  36. package/esm2020/queries/index.mjs +1 -3
  37. package/esm2020/transforms/abstract-node.mjs +68 -0
  38. package/esm2020/transforms/index.mjs +6 -2
  39. package/esm2020/transforms/layout.mjs +3 -3
  40. package/esm2020/transforms/node.mjs +2 -2
  41. package/esm2020/utils/abstract/common.mjs +90 -70
  42. package/esm2020/utils/abstract/resize.mjs +3 -3
  43. package/esm2020/utils/clipboard.mjs +54 -14
  44. package/esm2020/utils/direction-corrector.mjs +11 -11
  45. package/esm2020/utils/dnd.mjs +122 -0
  46. package/esm2020/utils/draw-placeholder.mjs +11 -9
  47. package/esm2020/utils/drop-target-corrector.mjs +11 -10
  48. package/esm2020/utils/index.mjs +1 -2
  49. package/esm2020/utils/layout.mjs +1 -1
  50. package/esm2020/utils/mind.mjs +30 -72
  51. package/esm2020/utils/node-space.mjs +23 -18
  52. package/esm2020/utils/node-style/branch.mjs +34 -20
  53. package/esm2020/utils/node-style/common.mjs +13 -0
  54. package/esm2020/utils/node-style/index.mjs +3 -2
  55. package/esm2020/utils/node-style/shape.mjs +21 -0
  56. package/esm2020/utils/path.mjs +4 -3
  57. package/fesm2015/plait-mind.mjs +862 -713
  58. package/fesm2015/plait-mind.mjs.map +1 -1
  59. package/fesm2020/plait-mind.mjs +865 -711
  60. package/fesm2020/plait-mind.mjs.map +1 -1
  61. package/interfaces/abstract.d.ts +3 -0
  62. package/interfaces/element.d.ts +7 -2
  63. package/interfaces/node.d.ts +0 -1
  64. package/node.component.d.ts +0 -1
  65. package/package.json +1 -1
  66. package/plugins/emoji/emoji.d.ts +5 -1
  67. package/plugins/with-dnd.d.ts +0 -9
  68. package/queries/get-available-sublayouts-by-element.d.ts +2 -6
  69. package/queries/get-branch-layouts.d.ts +2 -1
  70. package/queries/get-correct-layout-by-element.d.ts +2 -1
  71. package/queries/index.d.ts +3 -4
  72. package/styles/styles.scss +19 -19
  73. package/transforms/abstract-node.d.ts +6 -0
  74. package/transforms/index.d.ts +3 -0
  75. package/utils/abstract/common.d.ts +6 -8
  76. package/utils/direction-corrector.d.ts +2 -1
  77. package/utils/dnd.d.ts +16 -0
  78. package/utils/drop-target-corrector.d.ts +2 -1
  79. package/utils/index.d.ts +0 -1
  80. package/utils/mind.d.ts +4 -5
  81. package/utils/node-space.d.ts +5 -4
  82. package/utils/node-style/branch.d.ts +6 -1
  83. package/utils/node-style/common.d.ts +3 -0
  84. package/utils/node-style/index.d.ts +2 -1
  85. package/utils/node-style/shape.d.ts +4 -0
  86. package/constants/node.d.ts +0 -17
  87. package/esm2020/constants/node.mjs +0 -19
  88. package/esm2020/queries/get-layout-parent-by-element.mjs +0 -17
  89. package/esm2020/utils/node-style/node.mjs +0 -22
  90. package/esm2020/utils/shape.mjs +0 -17
  91. package/queries/get-layout-parent-by-element.d.ts +0 -8
  92. package/utils/node-style/node.d.ts +0 -3
  93. package/utils/shape.d.ts +0 -3
@@ -1,4 +1,6 @@
1
1
  import { PlaitBoard } from '@plait/core';
2
+ import { MindElement } from './element';
3
+ import { AbstractNode } from '@plait/layouts';
2
4
  export declare enum AbstractHandlePosition {
3
5
  start = "start",
4
6
  end = "end"
@@ -11,3 +13,4 @@ export declare enum AbstractResizeState {
11
13
  export interface PlaitAbstractBoard extends PlaitBoard {
12
14
  abstractResize?: (state: AbstractResizeState) => void;
13
15
  }
16
+ export type AbstractRefs = Map<MindElement, Pick<AbstractNode, 'start' | 'end'>>;
@@ -1,4 +1,3 @@
1
- import { MindNodeShape } from '../constants/node';
2
1
  import { MindLayoutType } from '@plait/layouts';
3
2
  import { PlaitBoard, PlaitElement, Point } from '@plait/core';
4
3
  import { BaseData, EmojiData } from './element-data';
@@ -12,7 +11,7 @@ export interface MindElement<T = BaseData> extends PlaitElement {
12
11
  fill?: string;
13
12
  strokeColor?: string;
14
13
  strokeWidth?: number;
15
- shape?: MindNodeShape;
14
+ shape?: MindElementShape;
16
15
  branchColor?: string;
17
16
  branchWidth?: number;
18
17
  layout?: MindLayoutType;
@@ -32,9 +31,15 @@ export declare const MindElement: {
32
31
  isIndentedLayout(value: MindElement): boolean;
33
32
  isMindElement(board: PlaitBoard, element: PlaitElement): element is MindElement<BaseData>;
34
33
  getParent(node: MindElement): MindElement<BaseData>;
34
+ findParent(node: MindElement): MindElement<BaseData> | undefined;
35
35
  getRoot(board: PlaitBoard, element: MindElement): PlaitMind;
36
36
  getAncestors(board: PlaitBoard, element: MindElement): PlaitElement[];
37
37
  getNode(element: MindElement): import("@plait/mind").MindNode;
38
+ findParentNode(element: MindElement): import("@plait/mind").MindNode | undefined;
38
39
  hasEmojis(element: MindElement): element is MindElement<EmojiData>;
39
40
  getEmojis(element: MindElement<EmojiData>): import("./element-data").EmojiItem[];
40
41
  };
42
+ export declare enum MindElementShape {
43
+ roundRectangle = "round-rectangle",
44
+ underline = "underline"
45
+ }
@@ -17,7 +17,6 @@ export interface MindNode {
17
17
  }
18
18
  export declare const MindNode: {
19
19
  get(root: MindNode, path: Path): MindNode;
20
- isEquals(node: MindNode, otherNode: MindNode): boolean;
21
20
  };
22
21
  export type ExtendLayoutType = Exclude<MindLayoutType, MindLayoutType.standard>;
23
22
  export type CoordinateType = {
@@ -17,7 +17,6 @@ export declare class MindNodeComponent extends PlaitPluginElementComponent<MindE
17
17
  isEditable: boolean;
18
18
  roughSVG: RoughSVG;
19
19
  node: MindNode;
20
- parent: MindNode;
21
20
  index: number;
22
21
  abstractIncludedOutlineG?: SVGGElement;
23
22
  parentG: SVGGElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/mind",
3
- "version": "0.2.0-next.8",
3
+ "version": "0.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.3.0",
6
6
  "@angular/core": "^13.3.0"
@@ -1,7 +1,11 @@
1
+ import { PlaitBoard, Point, RectangleClient } from '@plait/core';
1
2
  import { EmojiData, MindElement } from '../../interfaces';
2
3
  import { PlaitMindBoard } from '../with-extend-mind';
3
- export declare function getEmojisRectangle(board: PlaitMindBoard, element: MindElement<EmojiData>): {
4
+ export declare function getEmojisWidthHeight(board: PlaitMindBoard, element: MindElement<EmojiData>): {
4
5
  width: number;
5
6
  height: number;
6
7
  };
7
8
  export declare function getEmojiFontSize(element: MindElement<EmojiData>): number;
9
+ export declare function getEmojiRectangle(board: PlaitMindBoard, element: MindElement<EmojiData>): RectangleClient;
10
+ export declare function getEmojiForeignRectangle(board: PlaitMindBoard, element: MindElement<EmojiData>): RectangleClient;
11
+ export declare const isHitEmojis: (board: PlaitBoard, element: MindElement<EmojiData>, point: Point) => boolean;
@@ -1,11 +1,2 @@
1
1
  import { PlaitBoard } from '@plait/core';
2
- import { MindElement } from '../interfaces/element';
3
- import { DetectResult } from '../interfaces/node';
4
- import { MindNodeComponent } from '../node.component';
5
2
  export declare const withDnd: (board: PlaitBoard) => PlaitBoard;
6
- export declare const isValidTarget: (origin: MindElement, target: MindElement) => boolean;
7
- export declare const addActiveOnDragOrigin: (activeElement: MindElement, isOrigin?: boolean) => void;
8
- export declare const removeActiveOnDragOrigin: (activeElement: MindElement, isOrigin?: boolean) => void;
9
- export declare const updateRightNodeCount: (board: PlaitBoard, activeComponent: MindNodeComponent, targetComponent: MindNodeComponent, detectResult: DetectResult) => void;
10
- export declare const isDragging: (board: PlaitBoard) => boolean;
11
- export declare const setIsDragging: (board: PlaitBoard, state: boolean) => void;
@@ -1,8 +1,4 @@
1
1
  import { MindElement } from '../interfaces';
2
2
  import { MindLayoutType } from '@plait/layouts';
3
- /**
4
- * get available sub layouts by element
5
- * @param element
6
- * @returns MindLayoutType[]
7
- */
8
- export declare const getAvailableSubLayoutsByElement: (element: MindElement) => MindLayoutType[] | undefined;
3
+ import { PlaitBoard } from '@plait/core';
4
+ export declare const getAvailableSubLayoutsByElement: (board: PlaitBoard, element: MindElement) => MindLayoutType[] | undefined;
@@ -1,3 +1,4 @@
1
1
  import { MindElement } from '../interfaces';
2
2
  import { MindLayoutType } from '@plait/layouts';
3
- export declare const getBranchLayouts: (element: MindElement) => MindLayoutType[];
3
+ import { PlaitBoard } from '@plait/core';
4
+ export declare const getBranchLayouts: (board: PlaitBoard, element: MindElement) => MindLayoutType[];
@@ -1,3 +1,4 @@
1
+ import { PlaitBoard } from '@plait/core';
1
2
  import { MindElement } from '../interfaces';
2
3
  import { MindLayoutType } from '@plait/layouts';
3
4
  /**
@@ -6,4 +7,4 @@ import { MindLayoutType } from '@plait/layouts';
6
7
  * 2. correct layout by incorrect layout direction
7
8
  * @param element
8
9
  */
9
- export declare const getCorrectLayoutByElement: (element: MindElement) => MindLayoutType;
10
+ export declare const getCorrectLayoutByElement: (board: PlaitBoard, element: MindElement) => MindLayoutType;
@@ -1,7 +1,6 @@
1
1
  export declare const MindQueries: {
2
- getAvailableSubLayoutsByElement: (element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType[] | undefined;
3
- getLayoutParentByElement: (element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType;
4
- getBranchLayouts: (element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType[];
2
+ getAvailableSubLayoutsByElement: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType[] | undefined;
3
+ getBranchLayouts: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType[];
5
4
  getLayoutByElement: (element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType;
6
- getCorrectLayoutByElement: (element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType;
5
+ getCorrectLayoutByElement: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => import("@plait/layouts").MindLayoutType;
7
6
  };
@@ -25,20 +25,6 @@ g[plait-mindmap='true'] {
25
25
  .dragging-child {
26
26
  opacity: 0.6;
27
27
  }
28
-
29
- .node-emojis-container {
30
- display: flex;
31
- position: initial;
32
- align-items: center;
33
- height: 100%;
34
- ::-moz-selection {
35
- /* Code for Firefox */
36
- background: none;
37
- }
38
- ::selection {
39
- background: none;
40
- }
41
- }
42
28
  }
43
29
 
44
30
  .plait-board-container {
@@ -105,11 +91,25 @@ g[plait-mindmap='true'] {
105
91
  &.abstract-resizing-vertical {
106
92
  cursor: ew-resize;
107
93
  }
108
- }
109
94
 
110
- .fake-node {
111
- .dragging {
112
- cursor: pointer;
113
- opacity: 0.6;
95
+ .node-emojis-container {
96
+ display: flex;
97
+ position: initial;
98
+ align-items: center;
99
+ height: 100%;
100
+ ::-moz-selection {
101
+ /* Code for Firefox */
102
+ background: none;
103
+ }
104
+ ::selection {
105
+ background: none;
106
+ }
107
+ }
108
+
109
+ .fake-node {
110
+ &.dragging {
111
+ cursor: pointer;
112
+ opacity: 0.6;
113
+ }
114
114
  }
115
115
  }
@@ -0,0 +1,6 @@
1
+ import { PlaitBoard, PlaitElement } from '@plait/core';
2
+ import { AbstractRefs } from '../interfaces/abstract';
3
+ import { MindElement } from '../interfaces/element';
4
+ export declare const setAbstractsByRefs: (board: PlaitBoard, abstractRefs: AbstractRefs) => void;
5
+ export declare const setAbstractByStandardLayout: (board: PlaitBoard, element: MindElement) => void;
6
+ export declare const insertAbstract: (board: PlaitBoard, elements: PlaitElement[]) => void;
@@ -5,4 +5,7 @@ export declare const MindTransforms: {
5
5
  addEmoji: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>, emojiItem: import("@plait/mind").EmojiItem) => void;
6
6
  removeEmoji: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").EmojiData>, emojiItem: import("@plait/mind").EmojiItem) => void;
7
7
  replaceEmoji: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").EmojiData>, oldEmoji: import("@plait/mind").EmojiItem, newEmoji: import("@plait/mind").EmojiItem) => void;
8
+ insertAbstract: (board: import("@plait/core").PlaitBoard, elements: import("@plait/core").PlaitElement[]) => void;
9
+ setAbstractsByRefs: (board: import("@plait/core").PlaitBoard, abstractRefs: import("@plait/mind").AbstractRefs) => void;
10
+ setAbstractByStandardLayout: (board: import("@plait/core").PlaitBoard, element: import("@plait/mind").MindElement<import("@plait/mind").BaseData>) => void;
8
11
  };
@@ -1,3 +1,4 @@
1
+ import { AbstractNode } from '@plait/layouts';
1
2
  import { MindElement } from '../../interfaces/element';
2
3
  import { Path, PlaitBoard, PlaitElement } from '@plait/core';
3
4
  export declare const separateChildren: (parentElement: MindElement) => {
@@ -6,11 +7,8 @@ export declare const separateChildren: (parentElement: MindElement) => {
6
7
  };
7
8
  export declare const isSetAbstract: (element: PlaitElement) => boolean;
8
9
  export declare const canSetAbstract: (element: PlaitElement) => boolean;
9
- export declare const setAbstract: (board: PlaitBoard, elements: PlaitElement[]) => void;
10
- export declare const setAbstractByElements: (board: PlaitBoard, groupParent: MindElement, group: MindElement[]) => void;
11
- export declare const insertAbstractNode: (board: PlaitBoard, path: Path, start: number, end: number) => void;
12
- export declare const handleAbstractIncluded: (board: PlaitBoard, element: MindElement) => void;
13
- export declare const getCorrespondingAbstract: (element: MindElement) => MindElement<import("@plait/mind").BaseData> | undefined;
14
- export declare const getBehindAbstracts: (element: MindElement) => MindElement<import("@plait/mind").BaseData>[];
15
- export declare const insertSiblingElementHandleAbstract: (board: PlaitBoard, selectedElement: MindElement) => void;
16
- export declare const moveAbstractPosition: (board: PlaitBoard, abstracts: MindElement[], step: number) => void;
10
+ export declare const getCorrespondingAbstract: (parent: MindElement, element: MindElement) => MindElement<import("@plait/mind").BaseData> | undefined;
11
+ export declare const getBehindAbstracts: (parent: MindElement, element: MindElement) => MindElement<import("@plait/mind").BaseData>[];
12
+ export declare const getOverallAbstracts: (board: PlaitBoard, elements: MindElement[]) => (MindElement<import("@plait/mind").BaseData> & AbstractNode)[];
13
+ export declare const insertElementHandleAbstract: (board: PlaitBoard, path: Path, isExtendPreviousNode?: boolean, abstractRefs?: Map<MindElement<import("@plait/mind").BaseData>, Pick<AbstractNode, "end" | "start">>) => Map<MindElement<import("@plait/mind").BaseData>, Pick<AbstractNode, "end" | "start">>;
14
+ export declare const deleteElementHandleAbstract: (board: PlaitBoard, deletableElements: MindElement[], abstractRefs?: Map<MindElement<import("@plait/mind").BaseData>, Pick<AbstractNode, "end" | "start">>) => Map<MindElement<import("@plait/mind").BaseData>, Pick<AbstractNode, "end" | "start">>;
@@ -1,3 +1,4 @@
1
1
  import { DetectResult, MindNode } from '../interfaces';
2
- export declare const directionCorrector: (node: MindNode, detectResults: DetectResult[]) => DetectResult[] | null;
2
+ import { PlaitBoard } from '@plait/core';
3
+ export declare const directionCorrector: (board: PlaitBoard, node: MindNode, detectResults: DetectResult[]) => DetectResult[] | null;
3
4
  export declare const getAllowedDirection: (detectResults: DetectResult[], illegalDirections: DetectResult[]) => DetectResult[] | null;
package/utils/dnd.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { MindElement } from '../interfaces/element';
2
+ import { MindNodeComponent } from '../node.component';
3
+ import { Path, PlaitBoard } from '@plait/core';
4
+ import { MindLayoutType } from '@plait/layouts';
5
+ import { DetectResult } from '../interfaces/node';
6
+ export declare const isValidTarget: (origin: MindElement, target: MindElement) => boolean;
7
+ export declare const addActiveOnDragOrigin: (activeElement: MindElement, isOrigin?: boolean) => void;
8
+ export declare const removeActiveOnDragOrigin: (activeElement: MindElement, isOrigin?: boolean) => void;
9
+ export declare const updatePathByLayoutAndDropTarget: (targetPath: Path, layout: MindLayoutType, dropTarget: {
10
+ target: MindElement;
11
+ detectResult: DetectResult;
12
+ }) => Path;
13
+ export declare const updateRightNodeCount: (board: PlaitBoard, activeComponent: MindNodeComponent, targetComponent: MindNodeComponent, detectResult: DetectResult) => void;
14
+ export declare const isDragging: (board: PlaitBoard) => boolean;
15
+ export declare const setIsDragging: (board: PlaitBoard, state: boolean) => void;
16
+ export declare const updateAbstractInDnd: (board: PlaitBoard, deletableElements: MindElement[], originPath: Path) => void;
@@ -1,5 +1,6 @@
1
1
  import { DetectResult, MindElement } from '../interfaces';
2
- export declare const readjustmentDropTarget: (dropTarget: {
2
+ import { PlaitBoard } from '@plait/core';
3
+ export declare const readjustmentDropTarget: (board: PlaitBoard, dropTarget: {
3
4
  target: MindElement;
4
5
  detectResult: DetectResult;
5
6
  }) => {
package/utils/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export * from './graph';
2
2
  export * from './weak-maps';
3
3
  export * from './mind';
4
4
  export * from './layout';
5
- export * from './shape';
6
5
  export * from './node-style';
7
6
  export * from './is-virtual-key';
8
7
  export * from './draw-placeholder';
package/utils/mind.d.ts CHANGED
@@ -1,16 +1,14 @@
1
1
  import { MindLayoutType } from '@plait/layouts';
2
2
  import { Path, PlaitBoard, Point } from '@plait/core';
3
- import { MindNodeShape } from '../constants/node';
4
- import { MindNode } from '../interfaces';
3
+ import { MindElementShape, MindNode } from '../interfaces';
5
4
  import { MindElement } from '../interfaces/element';
6
- export declare function findParentElement(element: MindElement): MindElement | undefined;
7
5
  export declare function findUpElement(element: MindElement): {
8
6
  root: MindElement;
9
7
  branch?: MindElement;
10
8
  };
11
9
  export declare const getChildrenCount: (element: MindElement) => number;
12
10
  export declare const isChildElement: (origin: MindElement, child: MindElement) => boolean;
13
- export declare const filterChildElement: (elements: MindElement[]) => MindElement<import("../interfaces").BaseData>[];
11
+ export declare const getFirstLevelElement: (elements: MindElement[]) => MindElement<import("../interfaces").BaseData>[];
14
12
  export declare const isChildRight: (node: MindNode, child: MindNode) => boolean;
15
13
  export declare const isChildUp: (node: MindNode, child: MindNode) => boolean;
16
14
  export declare const copyNewNode: (node: MindElement) => MindElement<import("../interfaces").BaseData>;
@@ -25,9 +23,10 @@ export declare const createMindElement: (text: string, width: number, height: nu
25
23
  fill?: string;
26
24
  strokeColor?: string;
27
25
  strokeWidth?: number;
28
- shape?: MindNodeShape;
26
+ shape?: MindElementShape;
29
27
  layout?: MindLayoutType;
30
28
  branchColor?: string;
29
+ branchWidth?: number;
31
30
  }) => MindElement<import("../interfaces").BaseData>;
32
31
  export declare const insertMindElement: (board: PlaitBoard, inheritNode: MindElement, path: Path) => void;
33
32
  export declare const findLastChild: (child: MindNode) => MindNode;
@@ -1,10 +1,11 @@
1
1
  import { MindElement } from '../interfaces/element';
2
2
  import { PlaitMindBoard } from '../plugins/with-extend-mind';
3
+ import { EmojiData } from '../interfaces/element-data';
3
4
  export declare const NodeSpace: {
4
5
  getNodeWidth(board: PlaitMindBoard, element: MindElement): number;
5
6
  getNodeHeight(element: MindElement): number;
6
- getTextHorizontalSpace(board: PlaitMindBoard, element: MindElement): number;
7
- getTextVerticalSpace(element: MindElement): number;
8
- getEmojiHorizontalSpace(element: MindElement): number;
9
- getEmojiVerticalSpace(element: MindElement): number;
7
+ getTextLeftSpace(board: PlaitMindBoard, element: MindElement): number;
8
+ getTextTopSpace(element: MindElement): number;
9
+ getEmojiLeftSpace(board: PlaitMindBoard, element: MindElement<EmojiData>): number;
10
+ getEmojiTopSpace(element: MindElement): number;
10
11
  };
@@ -3,5 +3,10 @@
3
3
  */
4
4
  import { PlaitBoard } from '@plait/core';
5
5
  import { MindElement } from '../../interfaces/element';
6
- export declare const getBranchColorByMindElement: (board: PlaitBoard, element: MindElement) => string;
6
+ export declare const getBranchColorByMindElement: (board: PlaitBoard, element: MindElement) => any;
7
+ export declare const getBranchWidthByMindElement: (board: PlaitBoard, element: MindElement) => any;
8
+ export declare const getAbstractBranchWidth: (board: PlaitBoard, element: MindElement) => number | undefined;
9
+ export declare const getAbstractBranchColor: (board: PlaitBoard, element: MindElement) => string;
7
10
  export declare const getNextBranchColor: (root: MindElement) => string;
11
+ export declare const getDefaultBranchColor: (board: PlaitBoard, element: MindElement) => string;
12
+ export declare const getDefaultBranchColorByIndex: (index: number) => string;
@@ -0,0 +1,3 @@
1
+ import { PlaitBoard } from '@plait/core';
2
+ import { MindElement } from '../../interfaces/element';
3
+ export declare const getAvailableProperty: (board: PlaitBoard, element: MindElement, propertyKey: keyof MindElement) => any;
@@ -1,2 +1,3 @@
1
1
  export * from './branch';
2
- export * from './node';
2
+ export * from './shape';
3
+ export * from './shape';
@@ -0,0 +1,4 @@
1
+ import { PlaitBoard } from '@plait/core';
2
+ import { MindElement, MindElementShape } from '../../interfaces/element';
3
+ export declare const getStrokeByMindElement: (board: PlaitBoard, element: MindElement) => string;
4
+ export declare const getShapeByElement: (board: PlaitBoard, element: MindElement) => MindElementShape;
@@ -1,17 +0,0 @@
1
- export declare const TOPIC_COLOR = "#333";
2
- export declare const TOPIC_FONT_SIZE = 14;
3
- export declare const NODE_FILL = "#FFFFFF";
4
- export declare const ROOT_NODE_FILL = "#F5F5F5";
5
- export declare const ROOT_NODE_STROKE = "#F5F5F5";
6
- export declare const ROOT_TOPIC_FONT_SIZE = 18;
7
- export declare const NODE_MIN_WIDTH = 18;
8
- export declare const COLORS: string[];
9
- export declare enum MindNodeShape {
10
- roundRectangle = "round-rectangle",
11
- underline = "underline"
12
- }
13
- export declare const ABSTRACT_HANDLE_COLOR = "#6698FF80";
14
- export declare const ABSTRACT_INCLUDED_OUTLINE_OFFSET = 3.5;
15
- export declare const ABSTRACT_HANDLE_LENGTH = 10;
16
- export declare const TOPIC_DEFAULT_MAX_WORD_COUNT = 34;
17
- export declare const ABSTRACT_HANDLE_MASK_WIDTH = 8;
@@ -1,19 +0,0 @@
1
- export const TOPIC_COLOR = '#333';
2
- export const TOPIC_FONT_SIZE = 14;
3
- export const NODE_FILL = '#FFFFFF';
4
- export const ROOT_NODE_FILL = '#F5F5F5';
5
- export const ROOT_NODE_STROKE = '#F5F5F5';
6
- export const ROOT_TOPIC_FONT_SIZE = 18;
7
- export const NODE_MIN_WIDTH = 18;
8
- export const COLORS = ['#A287E1', '#6F81DB', '#6EC4C4', '#DFB85D', '#B1C774', '#77C386', '#C28976', '#E48484', '#E482D4', '#69B1E4'];
9
- export var MindNodeShape;
10
- (function (MindNodeShape) {
11
- MindNodeShape["roundRectangle"] = "round-rectangle";
12
- MindNodeShape["underline"] = "underline";
13
- })(MindNodeShape || (MindNodeShape = {}));
14
- export const ABSTRACT_HANDLE_COLOR = '#6698FF80'; //PRIMARY_COLOR 50% 透明度
15
- export const ABSTRACT_INCLUDED_OUTLINE_OFFSET = 3.5;
16
- export const ABSTRACT_HANDLE_LENGTH = 10;
17
- export const TOPIC_DEFAULT_MAX_WORD_COUNT = 34;
18
- export const ABSTRACT_HANDLE_MASK_WIDTH = 8;
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL21pbmQvc3JjL2NvbnN0YW50cy9ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxNQUFNLENBQUM7QUFDbEMsTUFBTSxDQUFDLE1BQU0sZUFBZSxHQUFHLEVBQUUsQ0FBQztBQUNsQyxNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsU0FBUyxDQUFDO0FBQ25DLE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyxTQUFTLENBQUM7QUFDeEMsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsU0FBUyxDQUFDO0FBQzFDLE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFHLEVBQUUsQ0FBQztBQUN2QyxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsRUFBRSxDQUFDO0FBRWpDLE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxDQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSx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yM2OUIxRTQnXTtcblxuZXhwb3J0IGVudW0gTWluZE5vZGVTaGFwZSB7XG4gICAgcm91bmRSZWN0YW5nbGUgPSAncm91bmQtcmVjdGFuZ2xlJyxcbiAgICB1bmRlcmxpbmUgPSAndW5kZXJsaW5lJ1xufVxuXG5leHBvcnQgY29uc3QgQUJTVFJBQ1RfSEFORExFX0NPTE9SID0gJyM2Njk4RkY4MCc7IC8vUFJJTUFSWV9DT0xPUiA1MCUg6YCP5piO5bqmXG5leHBvcnQgY29uc3QgQUJTVFJBQ1RfSU5DTFVERURfT1VUTElORV9PRkZTRVQgPSAzLjU7XG5leHBvcnQgY29uc3QgQUJTVFJBQ1RfSEFORExFX0xFTkdUSCA9IDEwO1xuXG5leHBvcnQgY29uc3QgVE9QSUNfREVGQVVMVF9NQVhfV09SRF9DT1VOVCA9IDM0O1xuZXhwb3J0IGNvbnN0IEFCU1RSQUNUX0hBTkRMRV9NQVNLX1dJRFRIID0gODtcbiJdfQ==
@@ -1,17 +0,0 @@
1
- import { findParentElement, getDefaultLayout } from '../utils';
2
- /**
3
- * 获取父节点布局类型
4
- * @param element
5
- * @returns MindLayoutType
6
- */
7
- export const getLayoutParentByElement = (element) => {
8
- let parent = findParentElement(element);
9
- while (parent) {
10
- if (parent.layout) {
11
- return parent.layout;
12
- }
13
- parent = findParentElement(parent);
14
- }
15
- return getDefaultLayout();
16
- };
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWxheW91dC1wYXJlbnQtYnktZWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL21pbmQvc3JjL3F1ZXJpZXMvZ2V0LWxheW91dC1wYXJlbnQtYnktZWxlbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTS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QgPSBmaW5kUGFyZW50RWxlbWVudChwYXJlbnQpO1xuICAgIH1cbiAgICByZXR1cm4gZ2V0RGVmYXVsdExheW91dCgpO1xufTtcbiJdfQ==
@@ -1,22 +0,0 @@
1
- import { MindElement } from '../../interfaces/element';
2
- import { COLORS, ROOT_NODE_STROKE } from '../../constants/node';
3
- export const getStrokeByMindElement = (board, element) => {
4
- const ancestors = MindElement.getAncestors(board, element);
5
- ancestors.unshift(element);
6
- const ancestor = ancestors.find(value => value.strokeColor);
7
- if (ancestor && ancestor.strokeColor) {
8
- return ancestor.strokeColor;
9
- }
10
- const root = ancestors[ancestors.length - 1];
11
- const branch = ancestors[ancestors.length - 2];
12
- if (branch) {
13
- const index = root.children.indexOf(branch);
14
- const length = COLORS.length;
15
- const remainder = index % length;
16
- return COLORS[remainder];
17
- }
18
- else {
19
- return ROOT_NODE_STROKE;
20
- }
21
- };
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL21pbmQvc3JjL3V0aWxzL25vZGUtc3R5bGUvbm9kZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDdkQsT0FBTyxFQUFFLE1BQU0sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRWhFLE1BQU0sQ0FBQyxNQUFNLHNCQUFzQixHQUFHLENBQUMsS0FBaUIsRUFBRSxPQUFvQixFQUFFLEVBQUU7SUFDOUUsTUFBTSxTQUFTLEdBQUcsV0FBVyxDQUFDLFlBQVksQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFrQixDQUFDO0lBQzVFLFNBQVMsQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7SUF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6IFBsYWl0Qm9hcmQsIGVsZW1lbnQ6IE1pbmRFbGVtZW50KSA9PiB7XG4gICAgY29uc3QgYW5jZXN0b3JzID0gTWluZEVsZW1lbnQuZ2V0QW5jZXN0b3JzKGJvYXJkLCBlbGVtZW50KSBhcyBNaW5kRWxlbWVudFtdO1xuICAgIGFuY2VzdG9ycy51bnNoaWZ0KGVsZW1lbnQpO1xuICAgIGNvbnN0IGFuY2VzdG9yID0gYW5jZXN0b3JzLmZpbmQodmFsdWUgPT4gdmFsdWUuc3Ryb2tlQ29sb3IpO1xuICAgIGlmIChhbmNlc3RvciAmJiBhbmNlc3Rvci5zdHJva2VDb2xvcikge1xuICAgICAgICByZXR1cm4gYW5jZXN0b3Iuc3Ryb2tlQ29sb3I7XG4gICAgfVxuXG4gICAgY29uc3Qgcm9vdCA9IGFuY2VzdG9yc1thbmNlc3RvcnMubGVuZ3RoIC0gMV07XG4gICAgY29uc3QgYnJhbmNoID0gYW5jZXN0b3JzW2FuY2VzdG9ycy5sZW5ndGggLSAyXTtcbiAgICBpZiAoYnJhbmNoKSB7XG4gICAgICAgIGNvbnN0IGluZGV4ID0gcm9vdC5jaGlsZHJlbi5pbmRleE9mKGJyYW5jaCk7XG4gICAgICAgIGNvbnN0IGxlbmd0aCA9IENPTE9SUy5sZW5ndGg7XG4gICAgICAgIGNvbnN0IHJlbWFpbmRlciA9IGluZGV4ICUgbGVuZ3RoO1xuICAgICAgICByZXR1cm4gQ09MT1JTW3JlbWFpbmRlcl07XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIFJPT1RfTk9ERV9TVFJPS0U7XG4gICAgfVxufTtcbiJdfQ==
@@ -1,17 +0,0 @@
1
- import { MindNodeShape } from '../constants';
2
- import { findParentElement } from './mind';
3
- export const getNodeShapeByElement = (element) => {
4
- let nodeShape = element.shape;
5
- if (nodeShape) {
6
- return nodeShape;
7
- }
8
- let parent = findParentElement(element);
9
- while (parent) {
10
- if (parent.shape) {
11
- return parent.shape;
12
- }
13
- parent = findParentElement(parent);
14
- }
15
- return MindNodeShape.roundRectangle;
16
- };
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9taW5kL3NyYy91dGlscy9zaGFwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRTdDLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUUzQyxNQUFNLENBQUMsTUFBTSxxQkFBcUIsR0FBRyxDQUFDLE9BQW9CLEVBQWlCLEVBQUU7SUFDekUsSUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQztJQUM5QixJQUFJLFNBQVMsRUFBRTtRQUNYLE9BQU8sU0FBUyxDQUFDO0tBQ3BCO0lBQ0QsSUFBSSxNQUFNLEdBQUcsaUJBQWlCLENBQUMsT0FBTyxDQUFDLENBQUM7SUFFeEMsT0FBTyxNQUFNLEVBQUU7UUFDWCxJQUFJLE1BQU0sQ0FBQyxLQUFLLEVBQUU7WUFDZCxPQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUM7U0FDdkI7UUFDRCxNQUFNLEdBQUcsaUJBQWlCLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDdEM7SUFDRCxPQUFPLGFBQWEsQ0FBQyxjQUFjLENBQUM7QUFDeEMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTWluZE5vZGVTaGFwZSB9IGZyb20gJy4uL2NvbnN0YW50cyc7XG5pbXBvcnQgeyBNaW5kRWxlbWVudCB9IGZyb20gJy4uL2ludGVyZmFjZXMnO1xuaW1wb3J0IHsgZmluZFBhcmVudEVsZW1lbnQgfSBmcm9tICcuL21pbmQnO1xuXG5leHBvcnQgY29uc3QgZ2V0Tm9kZVNoYXBlQnlFbGVtZW50ID0gKGVsZW1lbnQ6IE1pbmRFbGVtZW50KTogTWluZE5vZGVTaGFwZSA9PiB7XG4gICAgbGV0IG5vZGVTaGFwZSA9IGVsZW1lbnQuc2hhcGU7XG4gICAgaWYgKG5vZGVTaGFwZSkge1xuICAgICAgICByZXR1cm4gbm9kZVNoYXBlO1xuICAgIH1cbiAgICBsZXQgcGFyZW50ID0gZmluZFBhcmVudEVsZW1lbnQoZWxlbWVudCk7XG5cbiAgICB3aGlsZSAocGFyZW50KSB7XG4gICAgICAgIGlmIChwYXJlbnQuc2hhcGUpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJlbnQuc2hhcGU7XG4gICAgICAgIH1cbiAgICAgICAgcGFyZW50ID0gZmluZFBhcmVudEVsZW1lbnQocGFyZW50KTtcbiAgICB9XG4gICAgcmV0dXJuIE1pbmROb2RlU2hhcGUucm91bmRSZWN0YW5nbGU7XG59O1xuIl19
@@ -1,8 +0,0 @@
1
- import { MindElement } from '../interfaces';
2
- import { MindLayoutType } from '@plait/layouts';
3
- /**
4
- * 获取父节点布局类型
5
- * @param element
6
- * @returns MindLayoutType
7
- */
8
- export declare const getLayoutParentByElement: (element: MindElement) => MindLayoutType;
@@ -1,3 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { MindElement } from '../../interfaces/element';
3
- export declare const getStrokeByMindElement: (board: PlaitBoard, element: MindElement) => string;
package/utils/shape.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { MindNodeShape } from '../constants';
2
- import { MindElement } from '../interfaces';
3
- export declare const getNodeShapeByElement: (element: MindElement) => MindNodeShape;