@plait/mind 0.2.0-next.7 → 0.2.0-next.9
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/abstract-node.d.ts +4 -0
- package/constants/default.d.ts +1 -2
- package/constants/index.d.ts +4 -1
- package/constants/node-rule.d.ts +1 -0
- package/constants/node-style.d.ts +17 -0
- package/constants/node-topic-style.d.ts +4 -0
- package/draw/richtext.d.ts +4 -3
- package/esm2020/constants/abstract-node.mjs +5 -0
- package/esm2020/constants/default.mjs +2 -3
- package/esm2020/constants/index.mjs +5 -2
- package/esm2020/constants/node-rule.mjs +2 -0
- package/esm2020/constants/node-style.mjs +19 -0
- package/esm2020/constants/node-topic-style.mjs +5 -0
- package/esm2020/draw/abstract.mjs +4 -3
- package/esm2020/draw/indented-link.mjs +14 -14
- package/esm2020/draw/link/abstract-link.mjs +6 -4
- package/esm2020/draw/link/logic-link.mjs +7 -7
- package/esm2020/draw/link.mjs +6 -5
- package/esm2020/draw/richtext.mjs +7 -7
- package/esm2020/draw/shape.mjs +4 -4
- package/esm2020/drawer/quick-insert.drawer.mjs +11 -12
- package/esm2020/interfaces/abstract.mjs +1 -1
- package/esm2020/interfaces/element.mjs +6 -1
- package/esm2020/interfaces/node.mjs +1 -1
- package/esm2020/interfaces/options.mjs +2 -0
- package/esm2020/layout-option.mjs +5 -5
- package/esm2020/mind.component.mjs +2 -2
- package/esm2020/node.component.mjs +15 -13
- package/esm2020/plugins/emoji/emoji.drawer.mjs +3 -4
- package/esm2020/plugins/emoji/emoji.mjs +7 -3
- package/esm2020/plugins/emoji/index.mjs +1 -2
- package/esm2020/plugins/with-abstract.mjs +2 -2
- package/esm2020/plugins/with-dnd.mjs +12 -117
- package/esm2020/plugins/with-extend-mind.mjs +11 -0
- package/esm2020/plugins/with-mind.mjs +9 -7
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/queries/get-available-sublayouts-by-element.mjs +4 -9
- package/esm2020/queries/get-branch-layouts.mjs +4 -4
- package/esm2020/queries/get-correct-layout-by-element.mjs +28 -31
- package/esm2020/queries/get-layout-by-element.mjs +10 -8
- package/esm2020/queries/index.mjs +1 -3
- package/esm2020/transforms/abstract-node.mjs +68 -0
- package/esm2020/transforms/index.mjs +6 -2
- package/esm2020/transforms/layout.mjs +3 -3
- package/esm2020/transforms/node.mjs +2 -2
- package/esm2020/utils/abstract/common.mjs +90 -70
- package/esm2020/utils/abstract/resize.mjs +3 -3
- package/esm2020/utils/clipboard.mjs +54 -14
- package/esm2020/utils/direction-corrector.mjs +11 -11
- package/esm2020/utils/dnd.mjs +118 -0
- package/esm2020/utils/draw-placeholder.mjs +5 -5
- package/esm2020/utils/drop-target-corrector.mjs +11 -10
- package/esm2020/utils/layout.mjs +1 -1
- package/esm2020/utils/mind.mjs +23 -58
- package/esm2020/utils/node-space.mjs +5 -5
- package/esm2020/utils/node-style/branch.mjs +33 -6
- package/esm2020/utils/node-style/node.mjs +6 -5
- package/esm2020/utils/path.mjs +4 -3
- package/esm2020/utils/shape.mjs +3 -3
- package/fesm2015/plait-mind.mjs +724 -602
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +726 -600
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/interfaces/abstract.d.ts +3 -0
- package/interfaces/element.d.ts +5 -2
- package/interfaces/options.d.ts +4 -0
- package/layout-option.d.ts +2 -1
- package/mind.component.d.ts +2 -2
- package/node.component.d.ts +5 -4
- package/package.json +1 -1
- package/plugins/emoji/emoji.d.ts +2 -1
- package/plugins/emoji/emoji.drawer.d.ts +3 -3
- package/plugins/emoji/index.d.ts +0 -1
- package/plugins/with-dnd.d.ts +0 -9
- package/plugins/with-extend-mind.d.ts +10 -0
- package/plugins/with-mind.d.ts +1 -1
- package/public-api.d.ts +1 -0
- package/queries/get-available-sublayouts-by-element.d.ts +2 -6
- package/queries/get-branch-layouts.d.ts +2 -1
- package/queries/get-correct-layout-by-element.d.ts +2 -1
- package/queries/index.d.ts +3 -4
- package/styles/styles.scss +0 -3
- package/transforms/abstract-node.d.ts +6 -0
- package/transforms/index.d.ts +3 -0
- package/utils/abstract/common.d.ts +6 -8
- package/utils/direction-corrector.d.ts +2 -1
- package/utils/dnd.d.ts +16 -0
- package/utils/drop-target-corrector.d.ts +2 -1
- package/utils/mind.d.ts +3 -3
- package/utils/node-space.d.ts +3 -2
- package/utils/node-style/branch.d.ts +3 -0
- package/utils/shape.d.ts +2 -3
- package/constants/node.d.ts +0 -17
- package/esm2020/constants/node.mjs +0 -19
- package/esm2020/plugins/emoji/with-mind-emoji.mjs +0 -8
- package/esm2020/queries/get-layout-parent-by-element.mjs +0 -17
- package/plugins/emoji/with-mind-emoji.d.ts +0 -8
- package/queries/get-layout-parent-by-element.d.ts +0 -8
package/interfaces/abstract.d.ts
CHANGED
|
@@ -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'>>;
|
package/interfaces/element.d.ts
CHANGED
|
@@ -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?:
|
|
14
|
+
shape?: MindElementShape;
|
|
16
15
|
branchColor?: string;
|
|
17
16
|
branchWidth?: number;
|
|
18
17
|
layout?: MindLayoutType;
|
|
@@ -38,3 +37,7 @@ export declare const MindElement: {
|
|
|
38
37
|
hasEmojis(element: MindElement): element is MindElement<EmojiData>;
|
|
39
38
|
getEmojis(element: MindElement<EmojiData>): import("./element-data").EmojiItem[];
|
|
40
39
|
};
|
|
40
|
+
export declare enum MindElementShape {
|
|
41
|
+
roundRectangle = "round-rectangle",
|
|
42
|
+
underline = "underline"
|
|
43
|
+
}
|
package/layout-option.d.ts
CHANGED
package/mind.component.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { MindNode } from './interfaces/node';
|
|
|
4
4
|
import { BeforeContextChange, PlaitPluginElementContext } from '@plait/core';
|
|
5
5
|
import { MindNodeComponent } from './node.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class PlaitMindComponent extends MindNodeComponent
|
|
7
|
+
export declare class PlaitMindComponent extends MindNodeComponent implements OnInit, BeforeContextChange<PlaitMind> {
|
|
8
8
|
root: MindNode;
|
|
9
9
|
rootG: SVGGElement;
|
|
10
10
|
ngOnInit(): void;
|
|
11
11
|
beforeContextChange(value: PlaitPluginElementContext<PlaitMind>): void;
|
|
12
|
-
updateMindLayout(element?:
|
|
12
|
+
updateMindLayout(element?: import("./interfaces/element").MindElement<import("@plait/mind").BaseData>): void;
|
|
13
13
|
updateMindNodeLocation(element: PlaitMind): void;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaitMindComponent, never>;
|
|
15
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<PlaitMindComponent, "plait-mind", never, {}, {}, never, never, false, never>;
|
package/node.component.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { MindNode } from './interfaces/node';
|
|
|
8
8
|
import { EmojisDrawer } from './plugins/emoji/emoji.drawer';
|
|
9
9
|
import { AbstractHandlePosition } from './interfaces';
|
|
10
10
|
import { QuickInsertDrawer } from './drawer/quick-insert.drawer';
|
|
11
|
+
import { PlaitMindBoard } from './plugins/with-extend-mind';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
|
-
export declare class MindNodeComponent
|
|
13
|
+
export declare class MindNodeComponent extends PlaitPluginElementComponent<MindElement, PlaitMindBoard> implements OnInit, OnDestroy, OnContextChanged<MindElement, PlaitMindBoard> {
|
|
13
14
|
private viewContainerRef;
|
|
14
15
|
protected cdr: ChangeDetectorRef;
|
|
15
16
|
private render2;
|
|
@@ -34,7 +35,7 @@ export declare class MindNodeComponent<T extends MindElement = MindElement> exte
|
|
|
34
35
|
get handActive(): boolean;
|
|
35
36
|
constructor(viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, render2: Renderer2);
|
|
36
37
|
ngOnInit(): void;
|
|
37
|
-
onContextChanged(value: PlaitPluginElementContext<
|
|
38
|
+
onContextChanged(value: PlaitPluginElementContext<MindElement, PlaitMindBoard>, previous: PlaitPluginElementContext<MindElement, PlaitMindBoard>): void;
|
|
38
39
|
drawEmojis(): void;
|
|
39
40
|
drawQuickInsert(): void;
|
|
40
41
|
drawShape(): void;
|
|
@@ -57,6 +58,6 @@ export declare class MindNodeComponent<T extends MindElement = MindElement> exte
|
|
|
57
58
|
startEditText(isEnd: boolean, isClear: boolean): void;
|
|
58
59
|
trackBy: (index: number, node: MindNode) => string;
|
|
59
60
|
ngOnDestroy(): void;
|
|
60
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MindNodeComponent
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MindNodeComponent
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MindNodeComponent, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MindNodeComponent, "plait-mind-node", never, {}, {}, never, never, false, never>;
|
|
62
63
|
}
|
package/package.json
CHANGED
package/plugins/emoji/emoji.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EmojiData, MindElement } from '../../interfaces';
|
|
2
|
-
|
|
2
|
+
import { PlaitMindBoard } from '../with-extend-mind';
|
|
3
|
+
export declare function getEmojisRectangle(board: PlaitMindBoard, element: MindElement<EmojiData>): {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
5
6
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ComponentRef, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { EmojiData, EmojiItem, MindElement } from '../../interfaces';
|
|
3
3
|
import { MindEmojiBaseComponent } from './emoji-base.component';
|
|
4
|
-
import {
|
|
4
|
+
import { PlaitMindBoard } from '../with-extend-mind';
|
|
5
5
|
export declare class EmojiDrawer {
|
|
6
6
|
private board;
|
|
7
7
|
private viewContainerRef;
|
|
8
8
|
componentRef: ComponentRef<MindEmojiBaseComponent> | null;
|
|
9
|
-
constructor(board:
|
|
9
|
+
constructor(board: PlaitMindBoard, viewContainerRef: ViewContainerRef);
|
|
10
10
|
draw(emoji: EmojiItem, element: MindElement<EmojiData>): void;
|
|
11
11
|
get nativeElement(): HTMLElement | null;
|
|
12
12
|
destroy(): void;
|
|
@@ -16,7 +16,7 @@ export declare class EmojisDrawer {
|
|
|
16
16
|
private viewContainerRef;
|
|
17
17
|
emojiDrawers: EmojiDrawer[];
|
|
18
18
|
g?: SVGGElement;
|
|
19
|
-
constructor(board:
|
|
19
|
+
constructor(board: PlaitMindBoard, viewContainerRef: ViewContainerRef);
|
|
20
20
|
drawEmojis(element: MindElement): SVGGElement | undefined;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
}
|
package/plugins/emoji/index.d.ts
CHANGED
package/plugins/with-dnd.d.ts
CHANGED
|
@@ -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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType, PlaitBoard } from '@plait/core';
|
|
2
|
+
import { MindElement } from '../interfaces/element';
|
|
3
|
+
import { EmojiItem } from '../interfaces/element-data';
|
|
4
|
+
import { MindEmojiBaseComponent } from './emoji';
|
|
5
|
+
import { MindOptions } from '../interfaces/options';
|
|
6
|
+
export interface PlaitMindBoard extends PlaitBoard {
|
|
7
|
+
drawEmoji: (emoji: EmojiItem, element: MindElement) => ComponentType<MindEmojiBaseComponent>;
|
|
8
|
+
getMindOptions: () => MindOptions;
|
|
9
|
+
}
|
|
10
|
+
export declare const withExtendMind: (board: PlaitBoard) => PlaitBoard & PlaitMindBoard;
|
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 & import("./
|
|
2
|
+
export declare const withMind: (board: PlaitBoard) => PlaitBoard & import("./with-extend-mind").PlaitMindBoard;
|
package/public-api.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './mind.module';
|
|
|
4
4
|
export * from './utils';
|
|
5
5
|
export * from './interfaces';
|
|
6
6
|
export * from './plugins/with-mind';
|
|
7
|
+
export * from './plugins/with-extend-mind';
|
|
7
8
|
export * from './constants';
|
|
8
9
|
export * from './queries/index';
|
|
9
10
|
export * from './transforms/index';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { MindElement } from '../interfaces';
|
|
2
2
|
import { MindLayoutType } from '@plait/layouts';
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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;
|
package/queries/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
package/styles/styles.scss
CHANGED
|
@@ -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;
|
package/transforms/index.d.ts
CHANGED
|
@@ -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
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
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
|
-
|
|
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
|
-
|
|
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/mind.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MindLayoutType } from '@plait/layouts';
|
|
2
2
|
import { Path, PlaitBoard, Point } from '@plait/core';
|
|
3
|
-
import {
|
|
4
|
-
import { MindNode } from '../interfaces';
|
|
3
|
+
import { MindElementShape, MindNode } from '../interfaces';
|
|
5
4
|
import { MindElement } from '../interfaces/element';
|
|
6
5
|
export declare function findParentElement(element: MindElement): MindElement | undefined;
|
|
7
6
|
export declare function findUpElement(element: MindElement): {
|
|
@@ -25,9 +24,10 @@ export declare const createMindElement: (text: string, width: number, height: nu
|
|
|
25
24
|
fill?: string;
|
|
26
25
|
strokeColor?: string;
|
|
27
26
|
strokeWidth?: number;
|
|
28
|
-
shape?:
|
|
27
|
+
shape?: MindElementShape;
|
|
29
28
|
layout?: MindLayoutType;
|
|
30
29
|
branchColor?: string;
|
|
30
|
+
branchWidth?: number;
|
|
31
31
|
}) => MindElement<import("../interfaces").BaseData>;
|
|
32
32
|
export declare const insertMindElement: (board: PlaitBoard, inheritNode: MindElement, path: Path) => void;
|
|
33
33
|
export declare const findLastChild: (child: MindNode) => MindNode;
|
package/utils/node-space.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MindElement } from '../interfaces/element';
|
|
2
|
+
import { PlaitMindBoard } from '../plugins/with-extend-mind';
|
|
2
3
|
export declare const NodeSpace: {
|
|
3
|
-
getNodeWidth(element: MindElement): number;
|
|
4
|
+
getNodeWidth(board: PlaitMindBoard, element: MindElement): number;
|
|
4
5
|
getNodeHeight(element: MindElement): number;
|
|
5
|
-
getTextHorizontalSpace(element: MindElement): number;
|
|
6
|
+
getTextHorizontalSpace(board: PlaitMindBoard, element: MindElement): number;
|
|
6
7
|
getTextVerticalSpace(element: MindElement): number;
|
|
7
8
|
getEmojiHorizontalSpace(element: MindElement): number;
|
|
8
9
|
getEmojiVerticalSpace(element: MindElement): number;
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
import { PlaitBoard } from '@plait/core';
|
|
5
5
|
import { MindElement } from '../../interfaces/element';
|
|
6
6
|
export declare const getBranchColorByMindElement: (board: PlaitBoard, element: MindElement) => string;
|
|
7
|
+
export declare const getBranchWidthByMindElement: (board: PlaitBoard, element: MindElement) => number;
|
|
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;
|
package/utils/shape.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const getNodeShapeByElement: (element: MindElement) => MindNodeShape;
|
|
1
|
+
import { MindElement, MindElementShape } from '../interfaces';
|
|
2
|
+
export declare const getNodeShapeByElement: (element: MindElement) => MindElementShape;
|
package/constants/node.d.ts
DELETED
|
@@ -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 =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JBQ1RfSEFORExFX0NPTE9SID0gJyM2Njk4RkY4MCc7IC8vUFJJTUFSWV9DT0xPUiA1MCUg6YCP5piO5bqmXG5leHBvcnQgY29uc3QgQUJTVFJBQ1RfSU5DTFVERURfT1VUTElORV9PRkZTRVQgPSAzLjU7XG5leHBvcnQgY29uc3QgQUJTVFJBQ1RfSEFORExFX0xFTkdUSCA9IDEwO1xuXG5leHBvcnQgY29uc3QgVE9QSUNfREVGQVVMVF9NQVhfV09SRF9DT1VOVCA9IDM0O1xuZXhwb3J0IGNvbnN0IEFCU1RSQUNUX0hBTkRMRV9NQVNLX1dJRFRIID0gODtcbiJdfQ==
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const withEmoji = (board) => {
|
|
2
|
-
const newBoard = board;
|
|
3
|
-
newBoard.drawEmoji = (emoji, element) => {
|
|
4
|
-
throw new Error('Not implement drawEmoji method error.');
|
|
5
|
-
};
|
|
6
|
-
return newBoard;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aC1taW5kLWVtb2ppLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvbWluZC9zcmMvcGx1Z2lucy9lbW9qaS93aXRoLW1pbmQtZW1vamkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU0EsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLENBQUMsS0FBaUIsRUFBRSxFQUFFO0lBQzNDLE1BQU0sUUFBUSxHQUFHLEtBQXlDLENBQUM7SUFFM0QsUUFBUSxDQUFDLFNBQVMsR0FBRyxDQUFDLEtBQWdCLEVBQUUsT0FBb0IsRUFBRSxFQUFFO1FBQzVELE1BQU0sSUFBSSxLQUFLLENBQUMsdUNBQXVDLENBQUMsQ0FBQztJQUM3RCxDQUFDLENBQUM7SUFFRixPQUFPLFFBQVEsQ0FBQztBQU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
* 获取父节点布局类型
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWxheW91dC1wYXJlbnQtYnktZWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL21pbmQvc3JjL3F1ZXJpZXMvZ2V0LWxheW91dC1wYXJlbnQtYnktZWxlbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFHL0Q7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFHLENBQUMsT0FBb0IsRUFBa0IsRUFBRTtJQUM3RSxJQUFJLE1BQU0sR0FBRyxpQkFBaUIsQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUN4QyxPQUFPLE1BQU0sRUFBRTtRQUNYLElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtZQUNmLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQztTQUN4QjtRQUNELE1BQU0sR0FBRyxpQkFBaUIsQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUN0QztJQUNELE9BQU8sZ0JBQWdCLEVBQUUsQ0FBQztBQUM5QixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBNaW5kRWxlbWVudCB9IGZyb20gJy4uL2ludGVyZmFjZXMnO1xuaW1wb3J0IHsgZmluZFBhcmVudEVsZW1lbnQsIGdldERlZmF1bHRMYXlvdXQgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBNaW5kTGF5b3V0VHlwZSB9IGZyb20gJ0BwbGFpdC9sYXlvdXRzJztcblxuLyoqXG4gKiDojrflj5bniLboioLngrnluIPlsYDnsbvlnotcbiAqIEBwYXJhbSBlbGVtZW50XG4gKiBAcmV0dXJucyBNaW5kTGF5b3V0VHlwZVxuICovXG5leHBvcnQgY29uc3QgZ2V0TGF5b3V0UGFyZW50QnlFbGVtZW50ID0gKGVsZW1lbnQ6IE1pbmRFbGVtZW50KTogTWluZExheW91dFR5cGUgPT4ge1xuICAgIGxldCBwYXJlbnQgPSBmaW5kUGFyZW50RWxlbWVudChlbGVtZW50KTtcbiAgICB3aGlsZSAocGFyZW50KSB7XG4gICAgICAgIGlmIChwYXJlbnQubGF5b3V0KSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyZW50LmxheW91dDtcbiAgICAgICAgfVxuICAgICAgICBwYXJlbnQgPSBmaW5kUGFyZW50RWxlbWVudChwYXJlbnQpO1xuICAgIH1cbiAgICByZXR1cm4gZ2V0RGVmYXVsdExheW91dCgpO1xufTtcbiJdfQ==
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentType, PlaitBoard } from '@plait/core';
|
|
2
|
-
import { MindElement } from '../../interfaces/element';
|
|
3
|
-
import { EmojiItem } from '../../interfaces/element-data';
|
|
4
|
-
import { MindEmojiBaseComponent } from './emoji-base.component';
|
|
5
|
-
export interface PlaitMindEmojiBoard extends PlaitBoard {
|
|
6
|
-
drawEmoji: (emoji: EmojiItem, element: MindElement) => ComponentType<MindEmojiBaseComponent>;
|
|
7
|
-
}
|
|
8
|
-
export declare const withEmoji: (board: PlaitBoard) => PlaitBoard & PlaitMindEmojiBoard;
|