@plait/mind 0.2.0-next.5 → 0.2.0-next.8
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/draw/richtext.d.ts +4 -3
- package/esm2020/draw/richtext.mjs +7 -7
- package/esm2020/interfaces/options.mjs +2 -0
- package/esm2020/layout-option.mjs +3 -3
- package/esm2020/mind.component.mjs +2 -2
- package/esm2020/node.component.mjs +6 -6
- package/esm2020/plugins/emoji/emoji-base.component.mjs +13 -3
- package/esm2020/plugins/emoji/emoji.drawer.mjs +6 -10
- package/esm2020/plugins/emoji/emoji.mjs +9 -5
- package/esm2020/plugins/emoji/index.mjs +1 -2
- package/esm2020/plugins/with-abstract.mjs +2 -1
- package/esm2020/plugins/with-dnd.mjs +5 -5
- package/esm2020/plugins/with-extend-mind.mjs +11 -0
- package/esm2020/plugins/with-mind.mjs +3 -3
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/utils/draw-placeholder.mjs +5 -4
- package/esm2020/utils/node-space.mjs +5 -5
- package/fesm2015/plait-mind.mjs +64 -49
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +64 -49
- package/fesm2020/plait-mind.mjs.map +1 -1
- 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-base.component.d.ts +7 -4
- package/plugins/emoji/emoji.d.ts +3 -2
- package/plugins/emoji/emoji.drawer.d.ts +5 -5
- package/plugins/emoji/index.d.ts +0 -1
- 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/styles/styles.scss +3 -0
- package/utils/node-space.d.ts +3 -2
- package/esm2020/plugins/emoji/with-mind-emoji.mjs +0 -8
- package/plugins/emoji/with-mind-emoji.d.ts +0 -8
package/fesm2020/plait-mind.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, ChangeDetectionStrategy, NgModule, Directive, Input } from '@angular/core';
|
|
3
3
|
import * as i2 from '@plait/core';
|
|
4
4
|
import { distanceBetweenPointAndRectangle, PlaitElement, PlaitBoard, PlaitNode, NODE_TO_PARENT, Path, ELEMENT_TO_COMPONENT, Transforms, idCreator, isNullOrUndefined, clearSelectedElement, addSelectedElement, drawRoundRectangle, getRectangleByElements, RectangleClient, getSelectedElements, createG, drawAbstractRoundRectangle, PlaitPluginElementComponent, PlaitPointerType, NODE_TO_INDEX, createText, IS_TEXT_EDITABLE, MERGING, transformPoint, toPoint, depthFirstRecursion, PlaitModule, distanceBetweenPointAndPoint, CLIP_BOARD_FORMAT_KEY, BOARD_TO_HOST, removeSelectedElement, PlaitHistoryBoard, hotkeys } from '@plait/core';
|
|
5
|
-
import { AbstractNode, isChildOfAbstract, isIndentedLayout, getAbstractLayout, MindLayoutType, isStandardLayout, isTopLayout, isLeftLayout, isHorizontalLogicLayout, isVerticalLogicLayout, isBottomLayout, isRightLayout, isHorizontalLayout, getCorrectStartEnd, ConnectingPosition, GlobalLayout } from '@plait/layouts';
|
|
5
|
+
import { AbstractNode, isChildOfAbstract, isIndentedLayout, getAbstractLayout, MindLayoutType, isStandardLayout, isTopLayout, isLeftLayout, isHorizontalLogicLayout, isVerticalLogicLayout, isBottomLayout, isRightLayout, isHorizontalLayout, getNonAbstractChildren, getCorrectStartEnd, ConnectingPosition, GlobalLayout } from '@plait/layouts';
|
|
6
6
|
import { getSizeByText, ROOT_DEFAULT_HEIGHT, TEXT_DEFAULT_HEIGHT, drawRichtext, updateForeignObject, createForeignObject, updateRichText, setFullSelectionAndFocus, getRichtextContentSize, hasEditableTarget, RichtextModule } from '@plait/richtext';
|
|
7
7
|
import { fromEvent, Subject, timer } from 'rxjs';
|
|
8
8
|
import { take, takeUntil, filter, debounceTime } from 'rxjs/operators';
|
|
@@ -1273,6 +1273,7 @@ const drawStraightDropNodeG = (board, targetRect, detectResult, targetComponent,
|
|
|
1273
1273
|
}
|
|
1274
1274
|
};
|
|
1275
1275
|
const getHorizontalFakeY = (detectResult, targetIndex, parentNode, targetRect, layout, fakeY) => {
|
|
1276
|
+
const childrenLength = getNonAbstractChildren(parentNode).length;
|
|
1276
1277
|
if (detectResult === 'top') {
|
|
1277
1278
|
if (targetIndex === 0 && isTopLayout(layout)) {
|
|
1278
1279
|
fakeY = targetRect.y + targetRect.height;
|
|
@@ -1286,13 +1287,13 @@ const getHorizontalFakeY = (detectResult, targetIndex, parentNode, targetRect, l
|
|
|
1286
1287
|
}
|
|
1287
1288
|
if (detectResult === 'bottom') {
|
|
1288
1289
|
fakeY = targetRect.y + targetRect.height + 30;
|
|
1289
|
-
if (targetIndex <
|
|
1290
|
+
if (targetIndex < childrenLength - 1) {
|
|
1290
1291
|
const nextComponent = PlaitElement.getComponent(parentNode.origin.children[targetIndex + 1]);
|
|
1291
1292
|
const nextRect = getRectangleByNode(nextComponent.node);
|
|
1292
1293
|
const topY = targetRect.y + targetRect.height;
|
|
1293
1294
|
fakeY = topY + (nextRect.y - topY) / 5;
|
|
1294
1295
|
}
|
|
1295
|
-
if (targetIndex ===
|
|
1296
|
+
if (targetIndex === childrenLength - 1) {
|
|
1296
1297
|
fakeY = targetRect.y + targetRect.height + 30;
|
|
1297
1298
|
}
|
|
1298
1299
|
}
|
|
@@ -1901,17 +1902,21 @@ function drawLogicLink(board, node, parent, isHorizontal) {
|
|
|
1901
1902
|
return PlaitBoard.getRoughSVG(board).curve(points, { stroke: branchColor, strokeWidth });
|
|
1902
1903
|
}
|
|
1903
1904
|
|
|
1904
|
-
function getEmojisRectangle(element) {
|
|
1905
|
+
function getEmojisRectangle(board, element) {
|
|
1906
|
+
const options = board.getMindOptions();
|
|
1905
1907
|
const count = element.data.emojis.length;
|
|
1906
1908
|
const fontSize = getEmojiFontSize(element);
|
|
1907
|
-
return {
|
|
1909
|
+
return {
|
|
1910
|
+
width: fontSize * count + count * 2 * options.emojiPadding + (count - 1) * options.spaceBetweenEmojis,
|
|
1911
|
+
height: element.height
|
|
1912
|
+
};
|
|
1908
1913
|
}
|
|
1909
1914
|
function getEmojiFontSize(element) {
|
|
1910
1915
|
if (PlaitMind.isMind(element)) {
|
|
1911
|
-
return 18;
|
|
1916
|
+
return 18 + 2;
|
|
1912
1917
|
}
|
|
1913
1918
|
else {
|
|
1914
|
-
return 14;
|
|
1919
|
+
return 14 + 2;
|
|
1915
1920
|
}
|
|
1916
1921
|
}
|
|
1917
1922
|
|
|
@@ -1949,10 +1954,10 @@ const getVerticalSpaceBetweenNodeAndText = (element) => {
|
|
|
1949
1954
|
return nodeAndText;
|
|
1950
1955
|
};
|
|
1951
1956
|
const NodeSpace = {
|
|
1952
|
-
getNodeWidth(element) {
|
|
1957
|
+
getNodeWidth(board, element) {
|
|
1953
1958
|
const nodeAndText = getHorizontalSpaceBetweenNodeAndText(element);
|
|
1954
1959
|
if (MindElement.hasEmojis(element)) {
|
|
1955
|
-
return nodeAndText + getEmojisRectangle(element).width + getHorizontalSpaceEmojiAndText(element) + element.width + nodeAndText;
|
|
1960
|
+
return nodeAndText + getEmojisRectangle(board, element).width + getHorizontalSpaceEmojiAndText(element) + element.width + nodeAndText;
|
|
1956
1961
|
}
|
|
1957
1962
|
return nodeAndText + element.width + nodeAndText;
|
|
1958
1963
|
},
|
|
@@ -1960,10 +1965,10 @@ const NodeSpace = {
|
|
|
1960
1965
|
const nodeAndText = getVerticalSpaceBetweenNodeAndText(element);
|
|
1961
1966
|
return nodeAndText + element.height + nodeAndText;
|
|
1962
1967
|
},
|
|
1963
|
-
getTextHorizontalSpace(element) {
|
|
1968
|
+
getTextHorizontalSpace(board, element) {
|
|
1964
1969
|
const nodeAndText = getHorizontalSpaceBetweenNodeAndText(element);
|
|
1965
1970
|
if (MindElement.hasEmojis(element)) {
|
|
1966
|
-
return nodeAndText + getEmojisRectangle(element).width + getHorizontalSpaceEmojiAndText(element);
|
|
1971
|
+
return nodeAndText + getEmojisRectangle(board, element).width + getHorizontalSpaceEmojiAndText(element);
|
|
1967
1972
|
}
|
|
1968
1973
|
else {
|
|
1969
1974
|
return nodeAndText;
|
|
@@ -1983,8 +1988,8 @@ const NodeSpace = {
|
|
|
1983
1988
|
}
|
|
1984
1989
|
};
|
|
1985
1990
|
|
|
1986
|
-
function drawMindNodeRichtext(node, viewContainerRef) {
|
|
1987
|
-
const { x, y } = getRichtextRectangleByNode(node);
|
|
1991
|
+
function drawMindNodeRichtext(board, node, viewContainerRef) {
|
|
1992
|
+
const { x, y } = getRichtextRectangleByNode(board, node);
|
|
1988
1993
|
const classList = [];
|
|
1989
1994
|
if (node.origin.isRoot) {
|
|
1990
1995
|
classList.push('root-node');
|
|
@@ -1999,8 +2004,8 @@ function drawMindNodeRichtext(node, viewContainerRef) {
|
|
|
1999
2004
|
// COMPAT: last character can not show in safari browser
|
|
2000
2005
|
return drawRichtext(x, y, Math.ceil(node.origin.width), Math.ceil(node.origin.height), node.origin.data.topic, viewContainerRef, classList);
|
|
2001
2006
|
}
|
|
2002
|
-
function updateMindNodeTopicSize(node, g, isEditable) {
|
|
2003
|
-
const { x, y, width, height } = getRichtextRectangleByNode(node);
|
|
2007
|
+
function updateMindNodeTopicSize(board, node, g, isEditable) {
|
|
2008
|
+
const { x, y, width, height } = getRichtextRectangleByNode(board, node);
|
|
2004
2009
|
if (isEditable) {
|
|
2005
2010
|
// add 999, avoid changing lines when paste more text
|
|
2006
2011
|
updateForeignObject(g, width + 999, height + 999, x, y);
|
|
@@ -2010,9 +2015,9 @@ function updateMindNodeTopicSize(node, g, isEditable) {
|
|
|
2010
2015
|
updateForeignObject(g, Math.ceil(node.origin.width), Math.ceil(node.origin.height), x, y);
|
|
2011
2016
|
}
|
|
2012
2017
|
}
|
|
2013
|
-
function getRichtextRectangleByNode(node) {
|
|
2018
|
+
function getRichtextRectangleByNode(board, node) {
|
|
2014
2019
|
let { x, y, width, height } = getRectangleByNode(node);
|
|
2015
|
-
x = x + NodeSpace.getTextHorizontalSpace(node.origin);
|
|
2020
|
+
x = x + NodeSpace.getTextHorizontalSpace(board, node.origin);
|
|
2016
2021
|
y = y + NodeSpace.getTextVerticalSpace(node.origin);
|
|
2017
2022
|
return { width, height, x, y };
|
|
2018
2023
|
}
|
|
@@ -2080,8 +2085,8 @@ class EmojiDrawer {
|
|
|
2080
2085
|
this.componentRef = this.viewContainerRef.createComponent(componentType);
|
|
2081
2086
|
this.componentRef.instance.emojiItem = emoji;
|
|
2082
2087
|
this.componentRef.instance.board = this.board;
|
|
2083
|
-
|
|
2084
|
-
this.componentRef.instance.fontSize =
|
|
2088
|
+
this.componentRef.instance.element = element;
|
|
2089
|
+
this.componentRef.instance.fontSize = getEmojiFontSize(element);
|
|
2085
2090
|
}
|
|
2086
2091
|
get nativeElement() {
|
|
2087
2092
|
if (this.componentRef) {
|
|
@@ -2107,19 +2112,15 @@ class EmojisDrawer {
|
|
|
2107
2112
|
drawEmojis(element) {
|
|
2108
2113
|
this.destroy();
|
|
2109
2114
|
if (MindElement.hasEmojis(element)) {
|
|
2110
|
-
const node = MindElement.getNode(element);
|
|
2111
2115
|
this.g = createG();
|
|
2112
2116
|
this.g.classList.add('emojis');
|
|
2113
2117
|
let { x, y } = getRectangleByNode(MindElement.getNode(element));
|
|
2114
2118
|
x = x + NodeSpace.getEmojiHorizontalSpace(element);
|
|
2115
|
-
|
|
2116
|
-
const
|
|
2117
|
-
const fontSize = getEmojiFontSize(element);
|
|
2118
|
-
const foreignObject = createForeignObject(x, y, width, height);
|
|
2119
|
+
const { width, height } = getEmojisRectangle(this.board, element);
|
|
2120
|
+
const foreignObject = createForeignObject(x, y, width, height + NodeSpace.getEmojiVerticalSpace(element) * 2);
|
|
2119
2121
|
this.g.append(foreignObject);
|
|
2120
2122
|
const container = document.createElement('div');
|
|
2121
2123
|
container.classList.add('node-emojis-container');
|
|
2122
|
-
container.classList.add(`emoji-font-size-${fontSize}`);
|
|
2123
2124
|
foreignObject.append(container);
|
|
2124
2125
|
this.emojiDrawers = element.data.emojis.map(emojiItem => {
|
|
2125
2126
|
const drawer = new EmojiDrawer(this.board, this.viewContainerRef);
|
|
@@ -2549,10 +2550,10 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2549
2550
|
this.drawShape();
|
|
2550
2551
|
this.drawLink();
|
|
2551
2552
|
this.drawRichtext();
|
|
2552
|
-
this.drawEmojis();
|
|
2553
2553
|
this.drawActiveG();
|
|
2554
2554
|
this.updateActiveClass();
|
|
2555
2555
|
this.drawMaskG();
|
|
2556
|
+
this.drawEmojis();
|
|
2556
2557
|
this.drawExtend();
|
|
2557
2558
|
this.drawQuickInsert();
|
|
2558
2559
|
}
|
|
@@ -2758,7 +2759,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2758
2759
|
}
|
|
2759
2760
|
}
|
|
2760
2761
|
drawRichtext() {
|
|
2761
|
-
const { richtextG, richtextComponentRef, foreignObject } = drawMindNodeRichtext(this.node, this.viewContainerRef);
|
|
2762
|
+
const { richtextG, richtextComponentRef, foreignObject } = drawMindNodeRichtext(this.board, this.node, this.viewContainerRef);
|
|
2762
2763
|
this.richtextComponentRef = richtextComponentRef;
|
|
2763
2764
|
this.richtextG = richtextG;
|
|
2764
2765
|
this.foreignObject = foreignObject;
|
|
@@ -2900,7 +2901,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2900
2901
|
}
|
|
2901
2902
|
updateRichtext() {
|
|
2902
2903
|
updateRichText(this.node.origin.data.topic, this.richtextComponentRef);
|
|
2903
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
2904
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
2904
2905
|
}
|
|
2905
2906
|
startEditText(isEnd, isClear) {
|
|
2906
2907
|
if (!this.richtextComponentRef) {
|
|
@@ -2910,7 +2911,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2910
2911
|
this.isEditable = true;
|
|
2911
2912
|
IS_TEXT_EDITABLE.set(this.board, true);
|
|
2912
2913
|
this.disabledMaskG();
|
|
2913
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
2914
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
2914
2915
|
if (richtextInstance.plaitReadonly) {
|
|
2915
2916
|
richtextInstance.plaitReadonly = false;
|
|
2916
2917
|
this.richtextComponentRef.changeDetectorRef.detectChanges();
|
|
@@ -3013,7 +3014,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
3013
3014
|
richtextInstance.plaitReadonly = true;
|
|
3014
3015
|
this.richtextComponentRef?.changeDetectorRef.markForCheck();
|
|
3015
3016
|
this.isEditable = false;
|
|
3016
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
3017
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
3017
3018
|
IS_TEXT_EDITABLE.set(this.board, false);
|
|
3018
3019
|
};
|
|
3019
3020
|
}
|
|
@@ -3055,7 +3056,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
|
|
|
3055
3056
|
}]
|
|
3056
3057
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; } });
|
|
3057
3058
|
|
|
3058
|
-
const getLayoutOptions = () => {
|
|
3059
|
+
const getLayoutOptions = (board) => {
|
|
3059
3060
|
function getMainAxle(element, parent) {
|
|
3060
3061
|
const strokeWidth = element.strokeWidth || STROKE_WIDTH;
|
|
3061
3062
|
if (element.isRoot) {
|
|
@@ -3078,7 +3079,7 @@ const getLayoutOptions = () => {
|
|
|
3078
3079
|
return NodeSpace.getNodeHeight(element);
|
|
3079
3080
|
},
|
|
3080
3081
|
getWidth(element) {
|
|
3081
|
-
return NodeSpace.getNodeWidth(element);
|
|
3082
|
+
return NodeSpace.getNodeWidth(board, element);
|
|
3082
3083
|
},
|
|
3083
3084
|
getHorizontalGap(element, parent) {
|
|
3084
3085
|
const _layout = (parent && parent.layout) || getRootLayout(element);
|
|
@@ -3134,7 +3135,7 @@ class PlaitMindComponent extends MindNodeComponent {
|
|
|
3134
3135
|
}
|
|
3135
3136
|
updateMindLayout(element = this.element) {
|
|
3136
3137
|
const mindLayoutType = element.layout || getDefaultLayout();
|
|
3137
|
-
this.root = GlobalLayout.layout(element, getLayoutOptions(), mindLayoutType);
|
|
3138
|
+
this.root = GlobalLayout.layout(element, getLayoutOptions(this.board), mindLayoutType);
|
|
3138
3139
|
this.updateMindNodeLocation(element);
|
|
3139
3140
|
}
|
|
3140
3141
|
updateMindNodeLocation(element) {
|
|
@@ -3237,9 +3238,9 @@ const withDnd = (board) => {
|
|
|
3237
3238
|
PlaitBoard.getHost(board).appendChild(fakeDragNodeG);
|
|
3238
3239
|
}
|
|
3239
3240
|
else {
|
|
3240
|
-
fakeDragNodeG
|
|
3241
|
-
|
|
3242
|
-
}
|
|
3241
|
+
if (fakeDragNodeG) {
|
|
3242
|
+
fakeDragNodeG.innerHTML = '';
|
|
3243
|
+
}
|
|
3243
3244
|
fakeDropNodeG?.childNodes.forEach(node => {
|
|
3244
3245
|
node.remove();
|
|
3245
3246
|
});
|
|
@@ -3255,7 +3256,7 @@ const withDnd = (board) => {
|
|
|
3255
3256
|
x: activeComponent.node.x + offsetX,
|
|
3256
3257
|
y: activeComponent.node.y + offsetY
|
|
3257
3258
|
};
|
|
3258
|
-
const textRectangle = getRichtextRectangleByNode(activeComponent.node);
|
|
3259
|
+
const textRectangle = getRichtextRectangleByNode(board, activeComponent.node);
|
|
3259
3260
|
const fakeNodeG = drawRectangleNode(board, fakeDraggingNode);
|
|
3260
3261
|
const richtextG = activeComponent.richtextG?.cloneNode(true);
|
|
3261
3262
|
updateForeignObject(richtextG, textRectangle.width + BASE * 10, textRectangle.height, textRectangle.x + offsetX, textRectangle.y + offsetY);
|
|
@@ -3517,14 +3518,6 @@ const insertClipboardText = (board, parentElement, text, width, height) => {
|
|
|
3517
3518
|
return;
|
|
3518
3519
|
};
|
|
3519
3520
|
|
|
3520
|
-
const withEmoji = (board) => {
|
|
3521
|
-
const newBoard = board;
|
|
3522
|
-
newBoard.drawEmoji = (emoji, element) => {
|
|
3523
|
-
throw new Error('Not implement drawEmoji method error.');
|
|
3524
|
-
};
|
|
3525
|
-
return newBoard;
|
|
3526
|
-
};
|
|
3527
|
-
|
|
3528
3521
|
const withAbstract = (board) => {
|
|
3529
3522
|
const newBoard = board;
|
|
3530
3523
|
const { mousedown, mousemove, mouseup } = board;
|
|
@@ -3556,6 +3549,7 @@ const withAbstract = (board) => {
|
|
|
3556
3549
|
const endPoint = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3557
3550
|
touchedAbstract = handleTouchedAbstract(board, touchedAbstract, endPoint);
|
|
3558
3551
|
if (abstractHandlePosition && activeAbstractElement) {
|
|
3552
|
+
event.preventDefault();
|
|
3559
3553
|
const abstractComponent = PlaitElement.getComponent(activeAbstractElement);
|
|
3560
3554
|
const element = abstractComponent.element;
|
|
3561
3555
|
const nodeLayout = MindQueries.getCorrectLayoutByElement(activeAbstractElement);
|
|
@@ -3624,6 +3618,17 @@ const withAbstract = (board) => {
|
|
|
3624
3618
|
return board;
|
|
3625
3619
|
};
|
|
3626
3620
|
|
|
3621
|
+
const withExtendMind = (board) => {
|
|
3622
|
+
const newBoard = board;
|
|
3623
|
+
newBoard.drawEmoji = (emoji, element) => {
|
|
3624
|
+
throw new Error('Not implement drawEmoji method error.');
|
|
3625
|
+
};
|
|
3626
|
+
newBoard.getMindOptions = () => {
|
|
3627
|
+
return { spaceBetweenEmojis: 4, emojiPadding: 0 };
|
|
3628
|
+
};
|
|
3629
|
+
return newBoard;
|
|
3630
|
+
};
|
|
3631
|
+
|
|
3627
3632
|
const withMind = (board) => {
|
|
3628
3633
|
const { drawElement, dblclick, keydown, insertFragment, setFragment, deleteFragment, isHitSelection, getRectangle, isMovable, isRecursion } = board;
|
|
3629
3634
|
board.drawElement = (context) => {
|
|
@@ -3791,7 +3796,7 @@ const withMind = (board) => {
|
|
|
3791
3796
|
deleteSelectedELements(board, selectedElements);
|
|
3792
3797
|
deleteFragment(data);
|
|
3793
3798
|
};
|
|
3794
|
-
return
|
|
3799
|
+
return withExtendMind(withAbstract(withDnd(board)));
|
|
3795
3800
|
};
|
|
3796
3801
|
|
|
3797
3802
|
class MindEmojiBaseComponent {
|
|
@@ -3802,17 +3807,27 @@ class MindEmojiBaseComponent {
|
|
|
3802
3807
|
this.elementRef = elementRef;
|
|
3803
3808
|
this.fontSize = 14;
|
|
3804
3809
|
}
|
|
3810
|
+
ngOnInit() {
|
|
3811
|
+
this.elementRef.nativeElement.style.fontSize = `${this.fontSize}px`;
|
|
3812
|
+
}
|
|
3805
3813
|
}
|
|
3806
3814
|
MindEmojiBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MindEmojiBaseComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3807
|
-
MindEmojiBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: MindEmojiBaseComponent, inputs: { fontSize: "fontSize", emojiItem: "emojiItem", board: "board" }, ngImport: i0 });
|
|
3815
|
+
MindEmojiBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: MindEmojiBaseComponent, inputs: { fontSize: "fontSize", emojiItem: "emojiItem", board: "board", element: "element" }, host: { classAttribute: "mind-node-emoji" }, ngImport: i0 });
|
|
3808
3816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MindEmojiBaseComponent, decorators: [{
|
|
3809
|
-
type: Directive
|
|
3817
|
+
type: Directive,
|
|
3818
|
+
args: [{
|
|
3819
|
+
host: {
|
|
3820
|
+
class: 'mind-node-emoji'
|
|
3821
|
+
}
|
|
3822
|
+
}]
|
|
3810
3823
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { fontSize: [{
|
|
3811
3824
|
type: Input
|
|
3812
3825
|
}], emojiItem: [{
|
|
3813
3826
|
type: Input
|
|
3814
3827
|
}], board: [{
|
|
3815
3828
|
type: Input
|
|
3829
|
+
}], element: [{
|
|
3830
|
+
type: Input
|
|
3816
3831
|
}] } });
|
|
3817
3832
|
|
|
3818
3833
|
/*
|
|
@@ -3823,5 +3838,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
|
|
|
3823
3838
|
* Generated bundle index. Do not edit.
|
|
3824
3839
|
*/
|
|
3825
3840
|
|
|
3826
|
-
export { ABSTRACT_HANDLE_COLOR, ABSTRACT_HANDLE_LENGTH, ABSTRACT_HANDLE_MASK_WIDTH, ABSTRACT_INCLUDED_OUTLINE_OFFSET, AbstractHandlePosition, AbstractResizeState, BASE, COLORS, ELEMENT_TO_NODE, EXTEND_OFFSET, EXTEND_RADIUS, GRAY_COLOR, LayoutDirection, LayoutDirectionsMap, MAX_RADIUS, MINDMAP_KEY, MindElement, MindEmojiBaseComponent, MindModule, MindNode, MindNodeComponent, MindNodeShape, MindQueries, MindTransforms, NODE_FILL, NODE_MIN_WIDTH, PRIMARY_COLOR, PlaitMind, PlaitMindComponent, QUICK_INSERT_CIRCLE_COLOR, QUICK_INSERT_CIRCLE_OFFSET, QUICK_INSERT_INNER_CROSS_COLOR, ROOT_NODE_FILL, ROOT_NODE_STROKE, ROOT_TOPIC_FONT_SIZE, STROKE_WIDTH, TOPIC_COLOR, TOPIC_DEFAULT_MAX_WORD_COUNT, TOPIC_FONT_SIZE, TRANSPARENT, canSetAbstract, changeRightNodeCount, copyNewNode, correctLayoutByDirection, createDefaultMindMapElement, createMindElement, deleteSelectedELements, directionCorrector, directionDetector, divideElementByParent, drawCurvePlaceholderDropNodeG, drawIndentNodeG, drawPlaceholderDropNodeG, drawStraightDropNodeG, extractNodesText, filterChildElement, findLastChild, findLocationLeftIndex, findParentElement, findUpElement, getAbstractHandleRectangle, getAllowedDirection, getAvailableSubLayoutsByLayoutDirections, getBehindAbstracts, getBranchColorByMindElement, getBranchDirectionsByLayouts, getChildrenCount, getCorrespondingAbstract, getDefaultLayout, getEmojiFontSize, getEmojisRectangle, getHitAbstractHandle, getHorizontalFakeY, getInCorrectLayoutDirection, getIndentedFakePoint, getLayoutDirection$1 as getLayoutDirection, getLayoutReverseDirection, getLocationScope, getNextBranchColor, getNodeShapeByElement, getRectangleByNode, getRectangleByResizingLocation, getRootLayout, getStrokeByMindElement, handleAbstractIncluded, handleTouchedAbstract, hitMindElement, insertAbstractNode, insertMindElement, insertSiblingElementHandleAbstract, isChildElement, isChildRight, isChildUp, isCorrectLayout, isMixedLayout, isSetAbstract, isVirtualKey, moveAbstractPosition, readjustmentDropTarget, separateChildren, setAbstract, setAbstractByElements, shouldChangeRightNodeCount, transformAbstractToNode, transformNodeToRoot, transformRootToNode,
|
|
3841
|
+
export { ABSTRACT_HANDLE_COLOR, ABSTRACT_HANDLE_LENGTH, ABSTRACT_HANDLE_MASK_WIDTH, ABSTRACT_INCLUDED_OUTLINE_OFFSET, AbstractHandlePosition, AbstractResizeState, BASE, COLORS, ELEMENT_TO_NODE, EXTEND_OFFSET, EXTEND_RADIUS, GRAY_COLOR, LayoutDirection, LayoutDirectionsMap, MAX_RADIUS, MINDMAP_KEY, MindElement, MindEmojiBaseComponent, MindModule, MindNode, MindNodeComponent, MindNodeShape, MindQueries, MindTransforms, NODE_FILL, NODE_MIN_WIDTH, PRIMARY_COLOR, PlaitMind, PlaitMindComponent, QUICK_INSERT_CIRCLE_COLOR, QUICK_INSERT_CIRCLE_OFFSET, QUICK_INSERT_INNER_CROSS_COLOR, ROOT_NODE_FILL, ROOT_NODE_STROKE, ROOT_TOPIC_FONT_SIZE, STROKE_WIDTH, TOPIC_COLOR, TOPIC_DEFAULT_MAX_WORD_COUNT, TOPIC_FONT_SIZE, TRANSPARENT, canSetAbstract, changeRightNodeCount, copyNewNode, correctLayoutByDirection, createDefaultMindMapElement, createMindElement, deleteSelectedELements, directionCorrector, directionDetector, divideElementByParent, drawCurvePlaceholderDropNodeG, drawIndentNodeG, drawPlaceholderDropNodeG, drawStraightDropNodeG, extractNodesText, filterChildElement, findLastChild, findLocationLeftIndex, findParentElement, findUpElement, getAbstractHandleRectangle, getAllowedDirection, getAvailableSubLayoutsByLayoutDirections, getBehindAbstracts, getBranchColorByMindElement, getBranchDirectionsByLayouts, getChildrenCount, getCorrespondingAbstract, getDefaultLayout, getEmojiFontSize, getEmojisRectangle, getHitAbstractHandle, getHorizontalFakeY, getInCorrectLayoutDirection, getIndentedFakePoint, getLayoutDirection$1 as getLayoutDirection, getLayoutReverseDirection, getLocationScope, getNextBranchColor, getNodeShapeByElement, getRectangleByNode, getRectangleByResizingLocation, getRootLayout, getStrokeByMindElement, handleAbstractIncluded, handleTouchedAbstract, hitMindElement, insertAbstractNode, insertMindElement, insertSiblingElementHandleAbstract, isChildElement, isChildRight, isChildUp, isCorrectLayout, isMixedLayout, isSetAbstract, isVirtualKey, moveAbstractPosition, readjustmentDropTarget, separateChildren, setAbstract, setAbstractByElements, shouldChangeRightNodeCount, transformAbstractToNode, transformNodeToRoot, transformRootToNode, withExtendMind, withMind };
|
|
3827
3842
|
//# sourceMappingURL=plait-mind.mjs.map
|