@plait/mind 0.17.0 → 0.18.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 +9 -4
- package/esm2020/constants/node-style.mjs +11 -6
- package/esm2020/drawer/node-active.drawer.mjs +10 -9
- package/esm2020/node.component.mjs +1 -1
- package/esm2020/plugins/with-mind.mjs +2 -10
- package/esm2020/utils/draw/abstract-outline.mjs +44 -2
- package/esm2020/utils/draw/node-link/logic-link.mjs +2 -2
- package/esm2020/utils/draw/node-shape.mjs +5 -5
- package/esm2020/utils/node-style/shape.mjs +8 -4
- package/fesm2015/plait-mind.mjs +71 -27
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +71 -27
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/draw/abstract-outline.d.ts +2 -0
- package/utils/node-style/shape.d.ts +1 -0
|
@@ -3,20 +3,24 @@ import { getAvailableProperty } from './common';
|
|
|
3
3
|
import { getDefaultBranchColor, getMindThemeColor } from './branch';
|
|
4
4
|
import { AbstractNode } from '@plait/layouts';
|
|
5
5
|
import { isChildOfAbstract } from '../abstract/common';
|
|
6
|
-
import { DefaultAbstractNodeStyle } from '../../constants/node-style';
|
|
6
|
+
import { DefaultAbstractNodeStyle, DefaultNodeStyle } from '../../constants/node-style';
|
|
7
7
|
export const getStrokeByMindElement = (board, element) => {
|
|
8
8
|
if (PlaitMind.isMind(element)) {
|
|
9
9
|
const defaultRootStroke = getMindThemeColor(board).rootFill;
|
|
10
10
|
return element.strokeColor || defaultRootStroke;
|
|
11
11
|
}
|
|
12
12
|
if (AbstractNode.isAbstract(element) || isChildOfAbstract(board, element)) {
|
|
13
|
-
return element.strokeColor || DefaultAbstractNodeStyle.strokeColor;
|
|
14
|
-
;
|
|
13
|
+
return element.strokeColor || DefaultAbstractNodeStyle.shape.strokeColor;
|
|
15
14
|
}
|
|
16
15
|
return getAvailableProperty(board, element, 'strokeColor') || getDefaultBranchColor(board, element);
|
|
17
16
|
};
|
|
17
|
+
export const getStrokeWidthByElement = (board, element) => {
|
|
18
|
+
const strokeWidth = element.strokeWidth ||
|
|
19
|
+
(AbstractNode.isAbstract(element) ? DefaultAbstractNodeStyle.shape.strokeWidth : DefaultNodeStyle.shape.strokeWidth);
|
|
20
|
+
return strokeWidth;
|
|
21
|
+
};
|
|
18
22
|
export const getShapeByElement = (board, element) => {
|
|
19
23
|
const shape = getAvailableProperty(board, element, 'shape');
|
|
20
24
|
return shape || MindElementShape.roundRectangle;
|
|
21
25
|
};
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9taW5kL3NyYy91dGlscy9ub2RlLXN0eWxlL3NoYXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBZSxnQkFBZ0IsRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRixPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDaEQsT0FBTyxFQUFFLHFCQUFxQixFQUFFLGlCQUFpQixFQUFFLE1BQU0sVUFBVSxDQUFDO0FBQ3BFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUN2RCxPQUFPLEVBQUUsd0JBQXdCLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUV4RixNQUFNLENBQUMsTUFBTSxzQkFBc0IsR0FBRyxDQUFDLEtBQWlCLEVBQUUsT0FBb0IsRUFBR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WxlbWVudFNoYXBlLnJvdW5kUmVjdGFuZ2xlO1xufTtcbiJdfQ==
|
package/fesm2015/plait-mind.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, Input, Component, ChangeDetectionStrategy, NgModule, NgZone, HostListener } from '@angular/core';
|
|
3
3
|
import * as i2 from '@plait/core';
|
|
4
|
-
import { DefaultThemeColor, ColorfulThemeColor, SoftThemeColor, RetroThemeColor, DarkThemeColor, StarryThemeColor, RectangleClient, PlaitElement, idCreator, isNullOrUndefined, Transforms, clearSelectedElement, addSelectedElement, PlaitNode, Path, PlaitBoard, depthFirstRecursion, drawLinearPath, drawBezierPath, createG, updateForeignObject, drawRoundRectangle, getRectangleByElements, getSelectedElements, NODE_TO_PARENT, distanceBetweenPointAndRectangle, createForeignObject,
|
|
4
|
+
import { DefaultThemeColor, ColorfulThemeColor, SoftThemeColor, RetroThemeColor, DarkThemeColor, StarryThemeColor, RectangleClient, PlaitElement, idCreator, isNullOrUndefined, Transforms, clearSelectedElement, addSelectedElement, PlaitNode, Path, PlaitBoard, depthFirstRecursion, drawLinearPath, drawBezierPath, createG, updateForeignObject, drawRoundRectangle, getRectangleByElements, getSelectedElements, NODE_TO_PARENT, distanceBetweenPointAndRectangle, createForeignObject, createText, PlaitPointerType, PlaitPluginElementComponent, NODE_TO_INDEX, PlaitModule, transformPoint, toPoint, getHitElements, distanceBetweenPointAndPoint, CLIP_BOARD_FORMAT_KEY, isMainPointer, BOARD_TO_HOST, PlaitPluginKey, throttleRAF, BoardTransforms, removeSelectedElement, PlaitHistoryBoard, hotkeys } from '@plait/core';
|
|
5
5
|
import { MindLayoutType, isIndentedLayout, AbstractNode, getNonAbstractChildren, isStandardLayout, isLeftLayout, isRightLayout, isVerticalLogicLayout, isHorizontalLogicLayout, isTopLayout, isBottomLayout, isHorizontalLayout, getCorrectStartEnd, getAbstractLayout, ConnectingPosition, GlobalLayout } from '@plait/layouts';
|
|
6
6
|
import { TEXT_DEFAULT_HEIGHT, buildText, getTextSize, TextManage, ExitOrigin, TextModule, getTextFromClipboard } from '@plait/text';
|
|
7
7
|
import { fromEvent, Subject } from 'rxjs';
|
|
@@ -626,15 +626,20 @@ const adjustNodeToRoot = (board, node) => {
|
|
|
626
626
|
};
|
|
627
627
|
|
|
628
628
|
const DefaultAbstractNodeStyle = {
|
|
629
|
-
strokeColor: GRAY_COLOR,
|
|
630
|
-
strokeWidth: 2,
|
|
631
629
|
branchColor: GRAY_COLOR,
|
|
632
|
-
branchWidth: 2
|
|
630
|
+
branchWidth: 2,
|
|
631
|
+
shape: {
|
|
632
|
+
strokeColor: GRAY_COLOR,
|
|
633
|
+
strokeWidth: 2
|
|
634
|
+
}
|
|
633
635
|
};
|
|
634
636
|
const DefaultNodeStyle = {
|
|
635
|
-
strokeWidth: 3,
|
|
636
637
|
branchWidth: 3,
|
|
637
|
-
|
|
638
|
+
shape: {
|
|
639
|
+
rectangleRadius: 4,
|
|
640
|
+
strokeWidth: 3,
|
|
641
|
+
fill: 'none'
|
|
642
|
+
}
|
|
638
643
|
};
|
|
639
644
|
|
|
640
645
|
const getAvailableProperty = (board, element, propertyKey) => {
|
|
@@ -869,11 +874,15 @@ const getStrokeByMindElement = (board, element) => {
|
|
|
869
874
|
return element.strokeColor || defaultRootStroke;
|
|
870
875
|
}
|
|
871
876
|
if (AbstractNode.isAbstract(element) || isChildOfAbstract(board, element)) {
|
|
872
|
-
return element.strokeColor || DefaultAbstractNodeStyle.strokeColor;
|
|
873
|
-
;
|
|
877
|
+
return element.strokeColor || DefaultAbstractNodeStyle.shape.strokeColor;
|
|
874
878
|
}
|
|
875
879
|
return getAvailableProperty(board, element, 'strokeColor') || getDefaultBranchColor(board, element);
|
|
876
880
|
};
|
|
881
|
+
const getStrokeWidthByElement = (board, element) => {
|
|
882
|
+
const strokeWidth = element.strokeWidth ||
|
|
883
|
+
(AbstractNode.isAbstract(element) ? DefaultAbstractNodeStyle.shape.strokeWidth : DefaultNodeStyle.shape.strokeWidth);
|
|
884
|
+
return strokeWidth;
|
|
885
|
+
};
|
|
877
886
|
const getShapeByElement = (board, element) => {
|
|
878
887
|
const shape = getAvailableProperty(board, element, 'shape');
|
|
879
888
|
return shape || MindElementShape.roundRectangle;
|
|
@@ -1314,7 +1323,7 @@ function drawLogicLink(board, parent, node, isHorizontal, defaultStroke = null,
|
|
|
1314
1323
|
const branchWidth = defaultStrokeWidth || getBranchWidthByMindElement(board, parent.origin);
|
|
1315
1324
|
const hasStraightLine = branchShape === BranchShape.polyline ? true : !parent.origin.isRoot;
|
|
1316
1325
|
const parentShape = getShapeByElement(board, parent.origin);
|
|
1317
|
-
const shape =
|
|
1326
|
+
const shape = getShapeByElement(board, node.origin);
|
|
1318
1327
|
const hasUnderlineShape = shape === MindElementShape.underline;
|
|
1319
1328
|
const hasUnderlineShapeOfParent = parentShape === MindElementShape.underline;
|
|
1320
1329
|
const nodeClient = getRectangleByNode(node);
|
|
@@ -1980,15 +1989,15 @@ function drawRoundRectangleByNode(board, node) {
|
|
|
1980
1989
|
}
|
|
1981
1990
|
function drawRoundRectangleByElement(board, nodeRectangle, element) {
|
|
1982
1991
|
const defaultRootFill = getMindThemeColor(board).rootFill;
|
|
1983
|
-
const fill = element.fill ? element.fill : element.isRoot ? defaultRootFill : DefaultNodeStyle.fill;
|
|
1992
|
+
const fill = element.fill ? element.fill : element.isRoot ? defaultRootFill : DefaultNodeStyle.shape.fill;
|
|
1984
1993
|
const stroke = getStrokeByMindElement(board, element);
|
|
1985
|
-
const strokeWidth =
|
|
1994
|
+
const strokeWidth = getStrokeWidthByElement(board, element);
|
|
1986
1995
|
const nodeG = drawRoundRectangle(PlaitBoard.getRoughSVG(board), nodeRectangle.x, nodeRectangle.y, nodeRectangle.x + nodeRectangle.width, nodeRectangle.y + nodeRectangle.height, {
|
|
1987
1996
|
stroke,
|
|
1988
1997
|
strokeWidth,
|
|
1989
1998
|
fill,
|
|
1990
1999
|
fillStyle: 'solid'
|
|
1991
|
-
});
|
|
2000
|
+
}, false, DefaultNodeStyle.shape.rectangleRadius);
|
|
1992
2001
|
return nodeG;
|
|
1993
2002
|
}
|
|
1994
2003
|
|
|
@@ -2500,6 +2509,48 @@ function handleBoardClass(board, activeHandlePosition, isHorizontal) {
|
|
|
2500
2509
|
PlaitBoard.getBoardContainer(board).classList.remove('abstract-resizing-vertical');
|
|
2501
2510
|
}
|
|
2502
2511
|
}
|
|
2512
|
+
function drawAbstractRoundRectangle(rs, x1, y1, x2, y2, isHorizontal, options) {
|
|
2513
|
+
const width = Math.abs(x1 - x2);
|
|
2514
|
+
const height = Math.abs(y1 - y2);
|
|
2515
|
+
const radius = 5;
|
|
2516
|
+
const handleGap = 4;
|
|
2517
|
+
const handleLength = 10;
|
|
2518
|
+
const handleSpace = handleLength + handleGap * 2;
|
|
2519
|
+
if (isHorizontal) {
|
|
2520
|
+
const handleSideLine = (width - handleSpace - radius * 2) / 2;
|
|
2521
|
+
const sideLine = height - radius * 2;
|
|
2522
|
+
return rs.path(`M${x1 + radius},${y1}
|
|
2523
|
+
l${handleSideLine},0
|
|
2524
|
+
m${handleSpace},0
|
|
2525
|
+
l${handleSideLine},0
|
|
2526
|
+
a${radius},${radius},0,0,1,${radius},${radius}
|
|
2527
|
+
l0,${sideLine}
|
|
2528
|
+
a${radius},${radius},0,0,1,-${radius},${radius}
|
|
2529
|
+
l-${handleSideLine},0
|
|
2530
|
+
m-${handleSpace},0
|
|
2531
|
+
l-${handleSideLine},0
|
|
2532
|
+
a${radius},${radius},0,0,1,-${radius},-${radius}
|
|
2533
|
+
l0,-${sideLine}
|
|
2534
|
+
a${radius},${radius},0,0,1,${radius},-${radius}`, options);
|
|
2535
|
+
}
|
|
2536
|
+
else {
|
|
2537
|
+
const handleSideLine = (height - handleSpace - radius * 2) / 2;
|
|
2538
|
+
const sideLine = width - radius * 2;
|
|
2539
|
+
return rs.path(`M${x1 + radius},${y1}
|
|
2540
|
+
l${sideLine},0
|
|
2541
|
+
a${radius},${radius},0,0,1,${radius},${radius}
|
|
2542
|
+
l0,${handleSideLine}
|
|
2543
|
+
m0,${handleSpace}
|
|
2544
|
+
l0,${handleSideLine}
|
|
2545
|
+
a${radius},${radius},0,0,1,-${radius},${radius}
|
|
2546
|
+
l-${sideLine},0
|
|
2547
|
+
a${radius},${radius},0,0,1,-${radius},-${radius}
|
|
2548
|
+
l0,-${handleSideLine}
|
|
2549
|
+
m0,-${handleSpace}
|
|
2550
|
+
l0,-${handleSideLine}
|
|
2551
|
+
a${radius},${radius},0,0,1,${radius},-${radius}`, options);
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2503
2554
|
|
|
2504
2555
|
class NodeActiveDrawer extends BaseDrawer {
|
|
2505
2556
|
canDraw(element, data) {
|
|
@@ -2518,14 +2569,13 @@ class NodeActiveDrawer extends BaseDrawer {
|
|
|
2518
2569
|
activeG.append(this.abstractOutlineG);
|
|
2519
2570
|
}
|
|
2520
2571
|
const node = MindElement.getNode(element);
|
|
2521
|
-
|
|
2522
|
-
const
|
|
2572
|
+
const rectangle = getRectangleByNode(node);
|
|
2573
|
+
const activeStrokeWidth = 2;
|
|
2574
|
+
// add 0.1 to avoid white gap
|
|
2575
|
+
const offset = (getStrokeWidthByElement(this.board, element) + activeStrokeWidth) / 2 - 0.1;
|
|
2576
|
+
const activeRectangle = RectangleClient.getOutlineRectangle(rectangle, -offset);
|
|
2577
|
+
const strokeG = drawRoundRectangle(PlaitBoard.getRoughSVG(this.board), activeRectangle.x, activeRectangle.y, activeRectangle.x + activeRectangle.width, activeRectangle.y + activeRectangle.height, { stroke: PRIMARY_COLOR, strokeWidth: activeStrokeWidth, fill: '' }, true, DefaultNodeStyle.shape.rectangleRadius + offset);
|
|
2523
2578
|
this.g.appendChild(strokeG);
|
|
2524
|
-
if (!data.isEditing) {
|
|
2525
|
-
const fillG = drawRoundRectangle(PlaitBoard.getRoughSVG(this.board), x - 2, y - 2, x + width + 2, y + height + 2, { stroke: PRIMARY_COLOR, fill: PRIMARY_COLOR, fillStyle: 'solid' }, true);
|
|
2526
|
-
fillG.style.opacity = '0.15';
|
|
2527
|
-
this.g.appendChild(fillG);
|
|
2528
|
-
}
|
|
2529
2579
|
return activeG;
|
|
2530
2580
|
}
|
|
2531
2581
|
updateAbstractOutline(element, activeHandlePosition, resizingLocation) {
|
|
@@ -3765,15 +3815,9 @@ const withMind = (board) => {
|
|
|
3765
3815
|
board.applyTheme = (element) => {
|
|
3766
3816
|
const mindElement = element;
|
|
3767
3817
|
const shouldClearProperty = !PlaitBoard.isBoard(element) && ((mindElement === null || mindElement === void 0 ? void 0 : mindElement.branchColor) || (mindElement === null || mindElement === void 0 ? void 0 : mindElement.fill) || (mindElement === null || mindElement === void 0 ? void 0 : mindElement.strokeColor));
|
|
3768
|
-
const isAbstract = AbstractNode.isAbstract(element);
|
|
3769
3818
|
if (shouldClearProperty) {
|
|
3770
3819
|
const path = PlaitBoard.findPath(board, element);
|
|
3771
|
-
|
|
3772
|
-
Transforms.setNode(board, { fill: null, strokeColor: DefaultAbstractNodeStyle.strokeColor, branchColor: DefaultAbstractNodeStyle.branchColor }, path);
|
|
3773
|
-
}
|
|
3774
|
-
else {
|
|
3775
|
-
Transforms.setNode(board, { fill: null, strokeColor: null, branchColor: null }, path);
|
|
3776
|
-
}
|
|
3820
|
+
Transforms.setNode(board, { fill: null, strokeColor: null, branchColor: null }, path);
|
|
3777
3821
|
}
|
|
3778
3822
|
};
|
|
3779
3823
|
board.getRectangle = element => {
|
|
@@ -3922,5 +3966,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
|
|
|
3922
3966
|
* Generated bundle index. Do not edit.
|
|
3923
3967
|
*/
|
|
3924
3968
|
|
|
3925
|
-
export { ABSTRACT_HANDLE_COLOR, ABSTRACT_HANDLE_LENGTH, ABSTRACT_HANDLE_MASK_WIDTH, ABSTRACT_INCLUDED_OUTLINE_OFFSET, AbstractHandlePosition, AbstractResizeState, BASE, BRANCH_FONT_FAMILY, BRANCH_WIDTH, BaseDrawer, BranchShape, DEFAULT_FONT_FAMILY, DefaultAbstractNodeStyle, DefaultNodeStyle, ELEMENT_TO_NODE, EXTEND_DIAMETER, EXTEND_OFFSET, GRAY_COLOR, INHERIT_ATTRIBUTE_KEYS, IS_DRAGGING, LayoutDirection, LayoutDirectionsMap, MindColorfulThemeColor, MindDarkThemeColor, MindDefaultThemeColor, MindElement, MindElementShape, MindEmojiBaseComponent, MindImageBaseComponent, MindModule, MindNode, MindNodeComponent, MindPointerType, MindQueries, MindRetroThemeColor, MindSoftThemeColor, MindStarryThemeColor, MindThemeColor, MindThemeColors, MindTransforms, NODE_MIN_WIDTH, PRIMARY_COLOR, PlaitMind, PlaitMindComponent, QUICK_INSERT_CIRCLE_COLOR, QUICK_INSERT_CIRCLE_OFFSET, QUICK_INSERT_INNER_CROSS_COLOR, ROOT_TOPIC_FONT_SIZE, ROOT_TOPIC_HEIGHT, STROKE_WIDTH, TOPIC_COLOR, TOPIC_DEFAULT_MAX_WORD_COUNT, TOPIC_FONT_SIZE, TRANSPARENT, WithMindPluginKey, addActiveOnDragOrigin, adjustAbstractToNode, adjustNodeToRoot, adjustRootToNode, canSetAbstract, copyNewNode, correctLayoutByDirection, createDefaultMind, createEmptyMind, createMindElement, deleteElementHandleAbstract, deleteElementsHandleRightNodeCount, detectDropTarget, directionCorrector, directionDetector, divideElementByParent, drawFakeDragNode, drawFakeDropNode, editTopic, extractNodesText, findLastChild, findLocationLeftIndex, getAbstractBranchColor, getAbstractBranchWidth, getAbstractHandleRectangle, getAllowedDirection, getAvailableSubLayoutsByLayoutDirections, getBehindAbstracts, getBranchColorByMindElement, getBranchDirectionsByLayouts, getBranchShapeByMindElement, getBranchWidthByMindElement, getChildrenCount, getCorrespondingAbstract, getDefaultBranchColor, getDefaultBranchColorByIndex, getDefaultLayout, getEmojiForeignRectangle, getEmojiRectangle, getFirstLevelElement, getHitAbstractHandle, getImageForeignRectangle, getInCorrectLayoutDirection, getLayoutDirection$1 as getLayoutDirection, getLayoutReverseDirection, getLocationScope, getMindThemeColor, getNextBranchColor, getOverallAbstracts, getPathByDropTarget, getRectangleByElement, getRectangleByNode, getRectangleByResizingLocation, getRelativeStartEndByAbstractRef, getRootLayout, getShapeByElement, getStrokeByMindElement, getTopicRectangleByElement, getTopicRectangleByNode, getValidAbstractRefs, handleTouchedAbstract, hasAfterDraw, hasPreviousOrNextOfDropPath, insertElementHandleAbstract, insertElementHandleRightNodeCount, insertMindElement, isChildElement, isChildOfAbstract, isChildRight, isChildUp, isCorrectLayout, isDragging, isDropStandardRight, isHitEmojis, isHitImage, isHitMindElement, isInRightBranchOfStandardLayout, isMixedLayout, isSetAbstract, isValidTarget, isVirtualKey, removeActiveOnDragOrigin, separateChildren, setIsDragging, withMind, withMindExtend };
|
|
3969
|
+
export { ABSTRACT_HANDLE_COLOR, ABSTRACT_HANDLE_LENGTH, ABSTRACT_HANDLE_MASK_WIDTH, ABSTRACT_INCLUDED_OUTLINE_OFFSET, AbstractHandlePosition, AbstractResizeState, BASE, BRANCH_FONT_FAMILY, BRANCH_WIDTH, BaseDrawer, BranchShape, DEFAULT_FONT_FAMILY, DefaultAbstractNodeStyle, DefaultNodeStyle, ELEMENT_TO_NODE, EXTEND_DIAMETER, EXTEND_OFFSET, GRAY_COLOR, INHERIT_ATTRIBUTE_KEYS, IS_DRAGGING, LayoutDirection, LayoutDirectionsMap, MindColorfulThemeColor, MindDarkThemeColor, MindDefaultThemeColor, MindElement, MindElementShape, MindEmojiBaseComponent, MindImageBaseComponent, MindModule, MindNode, MindNodeComponent, MindPointerType, MindQueries, MindRetroThemeColor, MindSoftThemeColor, MindStarryThemeColor, MindThemeColor, MindThemeColors, MindTransforms, NODE_MIN_WIDTH, PRIMARY_COLOR, PlaitMind, PlaitMindComponent, QUICK_INSERT_CIRCLE_COLOR, QUICK_INSERT_CIRCLE_OFFSET, QUICK_INSERT_INNER_CROSS_COLOR, ROOT_TOPIC_FONT_SIZE, ROOT_TOPIC_HEIGHT, STROKE_WIDTH, TOPIC_COLOR, TOPIC_DEFAULT_MAX_WORD_COUNT, TOPIC_FONT_SIZE, TRANSPARENT, WithMindPluginKey, addActiveOnDragOrigin, adjustAbstractToNode, adjustNodeToRoot, adjustRootToNode, canSetAbstract, copyNewNode, correctLayoutByDirection, createDefaultMind, createEmptyMind, createMindElement, deleteElementHandleAbstract, deleteElementsHandleRightNodeCount, detectDropTarget, directionCorrector, directionDetector, divideElementByParent, drawFakeDragNode, drawFakeDropNode, editTopic, extractNodesText, findLastChild, findLocationLeftIndex, getAbstractBranchColor, getAbstractBranchWidth, getAbstractHandleRectangle, getAllowedDirection, getAvailableSubLayoutsByLayoutDirections, getBehindAbstracts, getBranchColorByMindElement, getBranchDirectionsByLayouts, getBranchShapeByMindElement, getBranchWidthByMindElement, getChildrenCount, getCorrespondingAbstract, getDefaultBranchColor, getDefaultBranchColorByIndex, getDefaultLayout, getEmojiForeignRectangle, getEmojiRectangle, getFirstLevelElement, getHitAbstractHandle, getImageForeignRectangle, getInCorrectLayoutDirection, getLayoutDirection$1 as getLayoutDirection, getLayoutReverseDirection, getLocationScope, getMindThemeColor, getNextBranchColor, getOverallAbstracts, getPathByDropTarget, getRectangleByElement, getRectangleByNode, getRectangleByResizingLocation, getRelativeStartEndByAbstractRef, getRootLayout, getShapeByElement, getStrokeByMindElement, getStrokeWidthByElement, getTopicRectangleByElement, getTopicRectangleByNode, getValidAbstractRefs, handleTouchedAbstract, hasAfterDraw, hasPreviousOrNextOfDropPath, insertElementHandleAbstract, insertElementHandleRightNodeCount, insertMindElement, isChildElement, isChildOfAbstract, isChildRight, isChildUp, isCorrectLayout, isDragging, isDropStandardRight, isHitEmojis, isHitImage, isHitMindElement, isInRightBranchOfStandardLayout, isMixedLayout, isSetAbstract, isValidTarget, isVirtualKey, removeActiveOnDragOrigin, separateChildren, setIsDragging, withMind, withMindExtend };
|
|
3926
3970
|
//# sourceMappingURL=plait-mind.mjs.map
|