@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/fesm2015/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';
|
|
@@ -1270,6 +1270,7 @@ const drawStraightDropNodeG = (board, targetRect, detectResult, targetComponent,
|
|
|
1270
1270
|
}
|
|
1271
1271
|
};
|
|
1272
1272
|
const getHorizontalFakeY = (detectResult, targetIndex, parentNode, targetRect, layout, fakeY) => {
|
|
1273
|
+
const childrenLength = getNonAbstractChildren(parentNode).length;
|
|
1273
1274
|
if (detectResult === 'top') {
|
|
1274
1275
|
if (targetIndex === 0 && isTopLayout(layout)) {
|
|
1275
1276
|
fakeY = targetRect.y + targetRect.height;
|
|
@@ -1283,13 +1284,13 @@ const getHorizontalFakeY = (detectResult, targetIndex, parentNode, targetRect, l
|
|
|
1283
1284
|
}
|
|
1284
1285
|
if (detectResult === 'bottom') {
|
|
1285
1286
|
fakeY = targetRect.y + targetRect.height + 30;
|
|
1286
|
-
if (targetIndex <
|
|
1287
|
+
if (targetIndex < childrenLength - 1) {
|
|
1287
1288
|
const nextComponent = PlaitElement.getComponent(parentNode.origin.children[targetIndex + 1]);
|
|
1288
1289
|
const nextRect = getRectangleByNode(nextComponent.node);
|
|
1289
1290
|
const topY = targetRect.y + targetRect.height;
|
|
1290
1291
|
fakeY = topY + (nextRect.y - topY) / 5;
|
|
1291
1292
|
}
|
|
1292
|
-
if (targetIndex ===
|
|
1293
|
+
if (targetIndex === childrenLength - 1) {
|
|
1293
1294
|
fakeY = targetRect.y + targetRect.height + 30;
|
|
1294
1295
|
}
|
|
1295
1296
|
}
|
|
@@ -1884,17 +1885,21 @@ function drawLogicLink(board, node, parent, isHorizontal) {
|
|
|
1884
1885
|
return PlaitBoard.getRoughSVG(board).curve(points, { stroke: branchColor, strokeWidth });
|
|
1885
1886
|
}
|
|
1886
1887
|
|
|
1887
|
-
function getEmojisRectangle(element) {
|
|
1888
|
+
function getEmojisRectangle(board, element) {
|
|
1889
|
+
const options = board.getMindOptions();
|
|
1888
1890
|
const count = element.data.emojis.length;
|
|
1889
1891
|
const fontSize = getEmojiFontSize(element);
|
|
1890
|
-
return {
|
|
1892
|
+
return {
|
|
1893
|
+
width: fontSize * count + count * 2 * options.emojiPadding + (count - 1) * options.spaceBetweenEmojis,
|
|
1894
|
+
height: element.height
|
|
1895
|
+
};
|
|
1891
1896
|
}
|
|
1892
1897
|
function getEmojiFontSize(element) {
|
|
1893
1898
|
if (PlaitMind.isMind(element)) {
|
|
1894
|
-
return 18;
|
|
1899
|
+
return 18 + 2;
|
|
1895
1900
|
}
|
|
1896
1901
|
else {
|
|
1897
|
-
return 14;
|
|
1902
|
+
return 14 + 2;
|
|
1898
1903
|
}
|
|
1899
1904
|
}
|
|
1900
1905
|
|
|
@@ -1932,10 +1937,10 @@ const getVerticalSpaceBetweenNodeAndText = (element) => {
|
|
|
1932
1937
|
return nodeAndText;
|
|
1933
1938
|
};
|
|
1934
1939
|
const NodeSpace = {
|
|
1935
|
-
getNodeWidth(element) {
|
|
1940
|
+
getNodeWidth(board, element) {
|
|
1936
1941
|
const nodeAndText = getHorizontalSpaceBetweenNodeAndText(element);
|
|
1937
1942
|
if (MindElement.hasEmojis(element)) {
|
|
1938
|
-
return nodeAndText + getEmojisRectangle(element).width + getHorizontalSpaceEmojiAndText(element) + element.width + nodeAndText;
|
|
1943
|
+
return nodeAndText + getEmojisRectangle(board, element).width + getHorizontalSpaceEmojiAndText(element) + element.width + nodeAndText;
|
|
1939
1944
|
}
|
|
1940
1945
|
return nodeAndText + element.width + nodeAndText;
|
|
1941
1946
|
},
|
|
@@ -1943,10 +1948,10 @@ const NodeSpace = {
|
|
|
1943
1948
|
const nodeAndText = getVerticalSpaceBetweenNodeAndText(element);
|
|
1944
1949
|
return nodeAndText + element.height + nodeAndText;
|
|
1945
1950
|
},
|
|
1946
|
-
getTextHorizontalSpace(element) {
|
|
1951
|
+
getTextHorizontalSpace(board, element) {
|
|
1947
1952
|
const nodeAndText = getHorizontalSpaceBetweenNodeAndText(element);
|
|
1948
1953
|
if (MindElement.hasEmojis(element)) {
|
|
1949
|
-
return nodeAndText + getEmojisRectangle(element).width + getHorizontalSpaceEmojiAndText(element);
|
|
1954
|
+
return nodeAndText + getEmojisRectangle(board, element).width + getHorizontalSpaceEmojiAndText(element);
|
|
1950
1955
|
}
|
|
1951
1956
|
else {
|
|
1952
1957
|
return nodeAndText;
|
|
@@ -1966,9 +1971,9 @@ const NodeSpace = {
|
|
|
1966
1971
|
}
|
|
1967
1972
|
};
|
|
1968
1973
|
|
|
1969
|
-
function drawMindNodeRichtext(node, viewContainerRef) {
|
|
1974
|
+
function drawMindNodeRichtext(board, node, viewContainerRef) {
|
|
1970
1975
|
var _a, _b;
|
|
1971
|
-
const { x, y } = getRichtextRectangleByNode(node);
|
|
1976
|
+
const { x, y } = getRichtextRectangleByNode(board, node);
|
|
1972
1977
|
const classList = [];
|
|
1973
1978
|
if (node.origin.isRoot) {
|
|
1974
1979
|
classList.push('root-node');
|
|
@@ -1983,8 +1988,8 @@ function drawMindNodeRichtext(node, viewContainerRef) {
|
|
|
1983
1988
|
// COMPAT: last character can not show in safari browser
|
|
1984
1989
|
return drawRichtext(x, y, Math.ceil(node.origin.width), Math.ceil(node.origin.height), node.origin.data.topic, viewContainerRef, classList);
|
|
1985
1990
|
}
|
|
1986
|
-
function updateMindNodeTopicSize(node, g, isEditable) {
|
|
1987
|
-
const { x, y, width, height } = getRichtextRectangleByNode(node);
|
|
1991
|
+
function updateMindNodeTopicSize(board, node, g, isEditable) {
|
|
1992
|
+
const { x, y, width, height } = getRichtextRectangleByNode(board, node);
|
|
1988
1993
|
if (isEditable) {
|
|
1989
1994
|
// add 999, avoid changing lines when paste more text
|
|
1990
1995
|
updateForeignObject(g, width + 999, height + 999, x, y);
|
|
@@ -1994,9 +1999,9 @@ function updateMindNodeTopicSize(node, g, isEditable) {
|
|
|
1994
1999
|
updateForeignObject(g, Math.ceil(node.origin.width), Math.ceil(node.origin.height), x, y);
|
|
1995
2000
|
}
|
|
1996
2001
|
}
|
|
1997
|
-
function getRichtextRectangleByNode(node) {
|
|
2002
|
+
function getRichtextRectangleByNode(board, node) {
|
|
1998
2003
|
let { x, y, width, height } = getRectangleByNode(node);
|
|
1999
|
-
x = x + NodeSpace.getTextHorizontalSpace(node.origin);
|
|
2004
|
+
x = x + NodeSpace.getTextHorizontalSpace(board, node.origin);
|
|
2000
2005
|
y = y + NodeSpace.getTextVerticalSpace(node.origin);
|
|
2001
2006
|
return { width, height, x, y };
|
|
2002
2007
|
}
|
|
@@ -2064,8 +2069,8 @@ class EmojiDrawer {
|
|
|
2064
2069
|
this.componentRef = this.viewContainerRef.createComponent(componentType);
|
|
2065
2070
|
this.componentRef.instance.emojiItem = emoji;
|
|
2066
2071
|
this.componentRef.instance.board = this.board;
|
|
2067
|
-
|
|
2068
|
-
this.componentRef.instance.fontSize =
|
|
2072
|
+
this.componentRef.instance.element = element;
|
|
2073
|
+
this.componentRef.instance.fontSize = getEmojiFontSize(element);
|
|
2069
2074
|
}
|
|
2070
2075
|
get nativeElement() {
|
|
2071
2076
|
if (this.componentRef) {
|
|
@@ -2091,19 +2096,15 @@ class EmojisDrawer {
|
|
|
2091
2096
|
drawEmojis(element) {
|
|
2092
2097
|
this.destroy();
|
|
2093
2098
|
if (MindElement.hasEmojis(element)) {
|
|
2094
|
-
const node = MindElement.getNode(element);
|
|
2095
2099
|
this.g = createG();
|
|
2096
2100
|
this.g.classList.add('emojis');
|
|
2097
2101
|
let { x, y } = getRectangleByNode(MindElement.getNode(element));
|
|
2098
2102
|
x = x + NodeSpace.getEmojiHorizontalSpace(element);
|
|
2099
|
-
|
|
2100
|
-
const
|
|
2101
|
-
const fontSize = getEmojiFontSize(element);
|
|
2102
|
-
const foreignObject = createForeignObject(x, y, width, height);
|
|
2103
|
+
const { width, height } = getEmojisRectangle(this.board, element);
|
|
2104
|
+
const foreignObject = createForeignObject(x, y, width, height + NodeSpace.getEmojiVerticalSpace(element) * 2);
|
|
2103
2105
|
this.g.append(foreignObject);
|
|
2104
2106
|
const container = document.createElement('div');
|
|
2105
2107
|
container.classList.add('node-emojis-container');
|
|
2106
|
-
container.classList.add(`emoji-font-size-${fontSize}`);
|
|
2107
2108
|
foreignObject.append(container);
|
|
2108
2109
|
this.emojiDrawers = element.data.emojis.map(emojiItem => {
|
|
2109
2110
|
const drawer = new EmojiDrawer(this.board, this.viewContainerRef);
|
|
@@ -2535,10 +2536,10 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2535
2536
|
this.drawShape();
|
|
2536
2537
|
this.drawLink();
|
|
2537
2538
|
this.drawRichtext();
|
|
2538
|
-
this.drawEmojis();
|
|
2539
2539
|
this.drawActiveG();
|
|
2540
2540
|
this.updateActiveClass();
|
|
2541
2541
|
this.drawMaskG();
|
|
2542
|
+
this.drawEmojis();
|
|
2542
2543
|
this.drawExtend();
|
|
2543
2544
|
this.drawQuickInsert();
|
|
2544
2545
|
}
|
|
@@ -2747,7 +2748,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2747
2748
|
}
|
|
2748
2749
|
}
|
|
2749
2750
|
drawRichtext() {
|
|
2750
|
-
const { richtextG, richtextComponentRef, foreignObject } = drawMindNodeRichtext(this.node, this.viewContainerRef);
|
|
2751
|
+
const { richtextG, richtextComponentRef, foreignObject } = drawMindNodeRichtext(this.board, this.node, this.viewContainerRef);
|
|
2751
2752
|
this.richtextComponentRef = richtextComponentRef;
|
|
2752
2753
|
this.richtextG = richtextG;
|
|
2753
2754
|
this.foreignObject = foreignObject;
|
|
@@ -2890,7 +2891,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2890
2891
|
}
|
|
2891
2892
|
updateRichtext() {
|
|
2892
2893
|
updateRichText(this.node.origin.data.topic, this.richtextComponentRef);
|
|
2893
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
2894
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
2894
2895
|
}
|
|
2895
2896
|
startEditText(isEnd, isClear) {
|
|
2896
2897
|
if (!this.richtextComponentRef) {
|
|
@@ -2900,7 +2901,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
2900
2901
|
this.isEditable = true;
|
|
2901
2902
|
IS_TEXT_EDITABLE.set(this.board, true);
|
|
2902
2903
|
this.disabledMaskG();
|
|
2903
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
2904
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
2904
2905
|
if (richtextInstance.plaitReadonly) {
|
|
2905
2906
|
richtextInstance.plaitReadonly = false;
|
|
2906
2907
|
this.richtextComponentRef.changeDetectorRef.detectChanges();
|
|
@@ -3004,7 +3005,7 @@ class MindNodeComponent extends PlaitPluginElementComponent {
|
|
|
3004
3005
|
richtextInstance.plaitReadonly = true;
|
|
3005
3006
|
(_a = this.richtextComponentRef) === null || _a === void 0 ? void 0 : _a.changeDetectorRef.markForCheck();
|
|
3006
3007
|
this.isEditable = false;
|
|
3007
|
-
updateMindNodeTopicSize(this.node, this.richtextG, this.isEditable);
|
|
3008
|
+
updateMindNodeTopicSize(this.board, this.node, this.richtextG, this.isEditable);
|
|
3008
3009
|
IS_TEXT_EDITABLE.set(this.board, false);
|
|
3009
3010
|
};
|
|
3010
3011
|
}
|
|
@@ -3047,7 +3048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
|
|
|
3047
3048
|
}]
|
|
3048
3049
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; } });
|
|
3049
3050
|
|
|
3050
|
-
const getLayoutOptions = () => {
|
|
3051
|
+
const getLayoutOptions = (board) => {
|
|
3051
3052
|
function getMainAxle(element, parent) {
|
|
3052
3053
|
const strokeWidth = element.strokeWidth || STROKE_WIDTH;
|
|
3053
3054
|
if (element.isRoot) {
|
|
@@ -3070,7 +3071,7 @@ const getLayoutOptions = () => {
|
|
|
3070
3071
|
return NodeSpace.getNodeHeight(element);
|
|
3071
3072
|
},
|
|
3072
3073
|
getWidth(element) {
|
|
3073
|
-
return NodeSpace.getNodeWidth(element);
|
|
3074
|
+
return NodeSpace.getNodeWidth(board, element);
|
|
3074
3075
|
},
|
|
3075
3076
|
getHorizontalGap(element, parent) {
|
|
3076
3077
|
const _layout = (parent && parent.layout) || getRootLayout(element);
|
|
@@ -3126,7 +3127,7 @@ class PlaitMindComponent extends MindNodeComponent {
|
|
|
3126
3127
|
}
|
|
3127
3128
|
updateMindLayout(element = this.element) {
|
|
3128
3129
|
const mindLayoutType = element.layout || getDefaultLayout();
|
|
3129
|
-
this.root = GlobalLayout.layout(element, getLayoutOptions(), mindLayoutType);
|
|
3130
|
+
this.root = GlobalLayout.layout(element, getLayoutOptions(this.board), mindLayoutType);
|
|
3130
3131
|
this.updateMindNodeLocation(element);
|
|
3131
3132
|
}
|
|
3132
3133
|
updateMindNodeLocation(element) {
|
|
@@ -3230,9 +3231,9 @@ const withDnd = (board) => {
|
|
|
3230
3231
|
PlaitBoard.getHost(board).appendChild(fakeDragNodeG);
|
|
3231
3232
|
}
|
|
3232
3233
|
else {
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
}
|
|
3234
|
+
if (fakeDragNodeG) {
|
|
3235
|
+
fakeDragNodeG.innerHTML = '';
|
|
3236
|
+
}
|
|
3236
3237
|
fakeDropNodeG === null || fakeDropNodeG === void 0 ? void 0 : fakeDropNodeG.childNodes.forEach(node => {
|
|
3237
3238
|
node.remove();
|
|
3238
3239
|
});
|
|
@@ -3243,7 +3244,7 @@ const withDnd = (board) => {
|
|
|
3243
3244
|
const activeComponent = PlaitElement.getComponent(activeElement);
|
|
3244
3245
|
const roughSVG = PlaitBoard.getRoughSVG(board);
|
|
3245
3246
|
const fakeDraggingNode = Object.assign(Object.assign({}, activeComponent.node), { children: [], x: activeComponent.node.x + offsetX, y: activeComponent.node.y + offsetY });
|
|
3246
|
-
const textRectangle = getRichtextRectangleByNode(activeComponent.node);
|
|
3247
|
+
const textRectangle = getRichtextRectangleByNode(board, activeComponent.node);
|
|
3247
3248
|
const fakeNodeG = drawRectangleNode(board, fakeDraggingNode);
|
|
3248
3249
|
const richtextG = (_a = activeComponent.richtextG) === null || _a === void 0 ? void 0 : _a.cloneNode(true);
|
|
3249
3250
|
updateForeignObject(richtextG, textRectangle.width + BASE * 10, textRectangle.height, textRectangle.x + offsetX, textRectangle.y + offsetY);
|
|
@@ -3503,14 +3504,6 @@ const insertClipboardText = (board, parentElement, text, width, height) => {
|
|
|
3503
3504
|
return;
|
|
3504
3505
|
};
|
|
3505
3506
|
|
|
3506
|
-
const withEmoji = (board) => {
|
|
3507
|
-
const newBoard = board;
|
|
3508
|
-
newBoard.drawEmoji = (emoji, element) => {
|
|
3509
|
-
throw new Error('Not implement drawEmoji method error.');
|
|
3510
|
-
};
|
|
3511
|
-
return newBoard;
|
|
3512
|
-
};
|
|
3513
|
-
|
|
3514
3507
|
const withAbstract = (board) => {
|
|
3515
3508
|
const newBoard = board;
|
|
3516
3509
|
const { mousedown, mousemove, mouseup } = board;
|
|
@@ -3542,6 +3535,7 @@ const withAbstract = (board) => {
|
|
|
3542
3535
|
const endPoint = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3543
3536
|
touchedAbstract = handleTouchedAbstract(board, touchedAbstract, endPoint);
|
|
3544
3537
|
if (abstractHandlePosition && activeAbstractElement) {
|
|
3538
|
+
event.preventDefault();
|
|
3545
3539
|
const abstractComponent = PlaitElement.getComponent(activeAbstractElement);
|
|
3546
3540
|
const element = abstractComponent.element;
|
|
3547
3541
|
const nodeLayout = MindQueries.getCorrectLayoutByElement(activeAbstractElement);
|
|
@@ -3610,6 +3604,17 @@ const withAbstract = (board) => {
|
|
|
3610
3604
|
return board;
|
|
3611
3605
|
};
|
|
3612
3606
|
|
|
3607
|
+
const withExtendMind = (board) => {
|
|
3608
|
+
const newBoard = board;
|
|
3609
|
+
newBoard.drawEmoji = (emoji, element) => {
|
|
3610
|
+
throw new Error('Not implement drawEmoji method error.');
|
|
3611
|
+
};
|
|
3612
|
+
newBoard.getMindOptions = () => {
|
|
3613
|
+
return { spaceBetweenEmojis: 4, emojiPadding: 0 };
|
|
3614
|
+
};
|
|
3615
|
+
return newBoard;
|
|
3616
|
+
};
|
|
3617
|
+
|
|
3613
3618
|
const withMind = (board) => {
|
|
3614
3619
|
const { drawElement, dblclick, keydown, insertFragment, setFragment, deleteFragment, isHitSelection, getRectangle, isMovable, isRecursion } = board;
|
|
3615
3620
|
board.drawElement = (context) => {
|
|
@@ -3778,7 +3783,7 @@ const withMind = (board) => {
|
|
|
3778
3783
|
deleteSelectedELements(board, selectedElements);
|
|
3779
3784
|
deleteFragment(data);
|
|
3780
3785
|
};
|
|
3781
|
-
return
|
|
3786
|
+
return withExtendMind(withAbstract(withDnd(board)));
|
|
3782
3787
|
};
|
|
3783
3788
|
|
|
3784
3789
|
class MindEmojiBaseComponent {
|
|
@@ -3789,17 +3794,27 @@ class MindEmojiBaseComponent {
|
|
|
3789
3794
|
this.elementRef = elementRef;
|
|
3790
3795
|
this.fontSize = 14;
|
|
3791
3796
|
}
|
|
3797
|
+
ngOnInit() {
|
|
3798
|
+
this.elementRef.nativeElement.style.fontSize = `${this.fontSize}px`;
|
|
3799
|
+
}
|
|
3792
3800
|
}
|
|
3793
3801
|
MindEmojiBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MindEmojiBaseComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3794
|
-
MindEmojiBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: MindEmojiBaseComponent, inputs: { fontSize: "fontSize", emojiItem: "emojiItem", board: "board" }, ngImport: i0 });
|
|
3802
|
+
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 });
|
|
3795
3803
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MindEmojiBaseComponent, decorators: [{
|
|
3796
|
-
type: Directive
|
|
3804
|
+
type: Directive,
|
|
3805
|
+
args: [{
|
|
3806
|
+
host: {
|
|
3807
|
+
class: 'mind-node-emoji'
|
|
3808
|
+
}
|
|
3809
|
+
}]
|
|
3797
3810
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { fontSize: [{
|
|
3798
3811
|
type: Input
|
|
3799
3812
|
}], emojiItem: [{
|
|
3800
3813
|
type: Input
|
|
3801
3814
|
}], board: [{
|
|
3802
3815
|
type: Input
|
|
3816
|
+
}], element: [{
|
|
3817
|
+
type: Input
|
|
3803
3818
|
}] } });
|
|
3804
3819
|
|
|
3805
3820
|
/*
|
|
@@ -3810,5 +3825,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
|
|
|
3810
3825
|
* Generated bundle index. Do not edit.
|
|
3811
3826
|
*/
|
|
3812
3827
|
|
|
3813
|
-
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,
|
|
3828
|
+
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 };
|
|
3814
3829
|
//# sourceMappingURL=plait-mind.mjs.map
|