@plait/mind 0.92.3 → 0.93.1

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.
@@ -1,4 +1,4 @@
1
- import { DEFAULT_COLOR, DefaultThemeColor, ColorfulThemeColor, SoftThemeColor, RetroThemeColor, DarkThemeColor, StarryThemeColor, rgbaToHEX, PlaitElement, PlaitNode, Path, isNullOrUndefined, PlaitBoard, getSelectedElements, getI18nValue, idCreator, Transforms, clearSelectedElement, addSelectedElement, distanceBetweenPointAndRectangle, RectangleClient, setDragging, depthFirstRecursion, getIsRecursionFunc, drawRoundRectangle, drawLinearPath, drawBezierPath, setStrokeLinecap, createG, createForeignObject, updateForeignObject, getRectangleByElements, toActiveRectangleFromViewBoxRectangle, ACTIVE_STROKE_WIDTH, SELECTION_RECTANGLE_CLASS_NAME, NODE_TO_PARENT, removeSelectedElement, PlaitHistoryBoard, createText, isSelectionMoving, isDragging, isMovingElements, NODE_TO_INDEX, PlaitPointerType, isMainPointer, toViewBoxPoint, toHostPoint, getHitElementByPoint, distanceBetweenPointAndPoint, CoreTransforms, toActivePointFromViewBoxPoint, BoardTransforms, throttleRAF, getElementById, isTouchDevice, isSelectedElement, isContextmenu, temporaryDisableSelection, hotkeys, createClipboardContext, WritableClipboardType, Point, ResizeCursorClass, WritableClipboardOperationType, addOrCreateClipboardContext } from '@plait/core';
1
+ import { DEFAULT_COLOR, DefaultThemeColor, ColorfulThemeColor, SoftThemeColor, RetroThemeColor, DarkThemeColor, StarryThemeColor, rgbaToHEX, PlaitElement, PlaitNode, Path, isNullOrUndefined, PlaitBoard, getSelectedElements, getI18nValue, idCreator, Transforms, clearSelectedElement, addSelectedElement, distanceBetweenPointAndRectangle, RectangleClient, setDragging, depthFirstRecursion, getIsRecursionFunc, drawRoundRectangle, drawLinearPath, drawBezierPath, setStrokeLinecap, createG, createForeignObject, updateForeignObject, getRectangleByElements, toActiveRectangleFromViewBoxRectangle, ACTIVE_STROKE_WIDTH, SELECTION_RECTANGLE_CLASS_NAME, NODE_TO_PARENT, removeSelectedElement, PlaitHistoryBoard, createText, isSelectionMoving, isDragging, isMovingElements, NODE_TO_INDEX, PlaitPointerType, isMainPointer, toViewBoxPoint, toHostPoint, getHitElementByPoint, distanceBetweenPointAndPoint, CoreTransforms, toActivePointFromViewBoxPoint, BoardTransforms, throttleRAF, createDebugGenerator, getElementById, isTouchDevice, isSelectedElement, isContextmenu, temporaryDisableSelection, hotkeys, createClipboardContext, WritableClipboardType, Point, ResizeCursorClass, WritableClipboardOperationType, addOrCreateClipboardContext } from '@plait/core';
2
2
  import { MindLayoutType, AbstractNode, isIndentedLayout, isHorizontalLogicLayout, ConnectingPosition, isHorizontalLayout, getNonAbstractChildren, isStandardLayout, isLeftLayout, isRightLayout, isVerticalLogicLayout, isTopLayout, isBottomLayout, getCorrectStartEnd, getAbstractLayout, GlobalLayout } from '@plait/layouts';
3
3
  import { StrokeStyle, getFirstTextManage, buildText, getElementSize, DEFAULT_FONT_FAMILY, RESIZE_HANDLE_DIAMETER, getRectangleResizeHandleRefs, addElementOfFocusedImage, ImageGenerator, removeElementOfFocusedImage, getStrokeLineDash, getXDistanceBetweenPoint, moveXOfPoint, moveYOfPoint, Generator, PropertyTransforms, TRANSPARENT, measureElement, isResizing, CommonElementFlavour, WithTextPluginKey, TextManage, isDrawingMode, isDndMode, setCreationMode, BoardCreationMode, isExpandHotkey, isTabHotkey, isEnterHotkey, isVirtualKey, isDelete, isSpaceHotkey, getElementOfFocusedImage, acceptImageTypes, buildImage, withResize, getElementsText } from '@plait/common';
4
4
  import { DEFAULT_FONT_SIZE, PlaitMarkEditor, MarkTypes, FontSizes } from '@plait/text-plugins';
@@ -267,7 +267,7 @@ const getCorrespondingAbstract = (element) => {
267
267
  if (!parent)
268
268
  return undefined;
269
269
  const elementIndex = parent.children.indexOf(element);
270
- return parent.children.find(child => {
270
+ return parent.children.find((child) => {
271
271
  return AbstractNode.isAbstract(child) && elementIndex >= child.start && elementIndex <= child.end;
272
272
  });
273
273
  };
@@ -276,7 +276,7 @@ const getBehindAbstracts = (element) => {
276
276
  if (!parent)
277
277
  return [];
278
278
  const index = parent.children.indexOf(element);
279
- return parent.children.filter(child => AbstractNode.isAbstract(child) && child.start > index);
279
+ return parent.children.filter((child) => AbstractNode.isAbstract(child) && child.start > index);
280
280
  };
281
281
  /**
282
282
  * return corresponding abstract that is not child of elements
@@ -284,13 +284,15 @@ const getBehindAbstracts = (element) => {
284
284
  const getOverallAbstracts = (board, elements) => {
285
285
  const overallAbstracts = [];
286
286
  elements
287
- .filter(value => !AbstractNode.isAbstract(value) && !PlaitMind.isMind(value))
288
- .forEach(value => {
287
+ .filter((value) => !AbstractNode.isAbstract(value) && !PlaitMind.isMind(value))
288
+ .forEach((value) => {
289
289
  const abstract = getCorrespondingAbstract(value);
290
290
  if (abstract && elements.indexOf(abstract) === -1 && overallAbstracts.indexOf(abstract) === -1) {
291
291
  const { start, end } = abstract;
292
292
  const parent = MindElement.getParent(value);
293
- const isOverall = parent.children.slice(start, end + 1).every(includedElement => elements.indexOf(includedElement) > -1);
293
+ const isOverall = parent.children
294
+ .slice(start, end + 1)
295
+ .every((includedElement) => elements.indexOf(includedElement) > -1);
294
296
  if (isOverall) {
295
297
  overallAbstracts.push(abstract);
296
298
  }
@@ -304,11 +306,11 @@ const getOverallAbstracts = (board, elements) => {
304
306
  const getValidAbstractRefs = (board, elements) => {
305
307
  const validAbstractRefs = [];
306
308
  elements
307
- .filter(value => !AbstractNode.isAbstract(value) && !PlaitMind.isMind(value))
308
- .forEach(value => {
309
+ .filter((value) => !AbstractNode.isAbstract(value) && !PlaitMind.isMind(value))
310
+ .forEach((value) => {
309
311
  const abstract = getCorrespondingAbstract(value);
310
312
  if (abstract && elements.indexOf(abstract) > 0) {
311
- const index = validAbstractRefs.findIndex(value => value.abstract === abstract);
313
+ const index = validAbstractRefs.findIndex((value) => value.abstract === abstract);
312
314
  if (index === -1) {
313
315
  validAbstractRefs.push({
314
316
  abstract: abstract,
@@ -334,14 +336,14 @@ isExtendPreviousNode = true, effectedAbstracts = new Map()) => {
334
336
  const hasPreviousNode = path[path.length - 1] !== 0;
335
337
  let behindAbstracts;
336
338
  if (!hasPreviousNode) {
337
- behindAbstracts = parent.children.filter(child => AbstractNode.isAbstract(child));
339
+ behindAbstracts = parent.children.filter((child) => AbstractNode.isAbstract(child));
338
340
  }
339
341
  else {
340
342
  const selectedElement = PlaitNode.get(board, Path.previous(path));
341
343
  behindAbstracts = getBehindAbstracts(selectedElement);
342
344
  }
343
345
  if (behindAbstracts.length) {
344
- behindAbstracts.forEach(abstract => {
346
+ behindAbstracts.forEach((abstract) => {
345
347
  let newProperties = effectedAbstracts.get(abstract);
346
348
  if (!newProperties) {
347
349
  newProperties = { start: 0, end: 0 };
@@ -368,11 +370,11 @@ isExtendPreviousNode = true, effectedAbstracts = new Map()) => {
368
370
  return effectedAbstracts;
369
371
  };
370
372
  const deleteElementHandleAbstract = (board, deletableElements, effectedAbstracts = new Map()) => {
371
- deletableElements.forEach(node => {
373
+ deletableElements.forEach((node) => {
372
374
  if (!PlaitMind.isMind(node)) {
373
- const behindAbstracts = getBehindAbstracts(node).filter(abstract => !deletableElements.includes(abstract));
375
+ const behindAbstracts = getBehindAbstracts(node).filter((abstract) => !deletableElements.includes(abstract));
374
376
  if (behindAbstracts.length) {
375
- behindAbstracts.forEach(abstract => {
377
+ behindAbstracts.forEach((abstract) => {
376
378
  let newProperties = effectedAbstracts.get(abstract);
377
379
  if (!newProperties) {
378
380
  newProperties = { start: 0, end: 0 };
@@ -397,7 +399,7 @@ const deleteElementHandleAbstract = (board, deletableElements, effectedAbstracts
397
399
  };
398
400
  const isChildOfAbstract = (board, element) => {
399
401
  const ancestors = MindElement.getAncestors(board, element);
400
- return !!ancestors.find(value => AbstractNode.isAbstract(value));
402
+ return !!ancestors.find((value) => AbstractNode.isAbstract(value));
401
403
  };
402
404
 
403
405
  /**
@@ -446,7 +448,7 @@ const getDefaultBranchColorByIndex = (board, index) => {
446
448
  };
447
449
  const getMindThemeColor = (board) => {
448
450
  const themeColors = PlaitBoard.getThemeColors(board);
449
- const themeColor = themeColors.find(val => val.mode === board.theme.themeColorMode);
451
+ const themeColor = themeColors.find((val) => val.mode === board.theme.themeColorMode);
450
452
  if (themeColor && MindThemeColor.isMindThemeColor(themeColor)) {
451
453
  return themeColor;
452
454
  }
@@ -487,21 +489,21 @@ const getShapeByElement = (board, element) => {
487
489
 
488
490
  function editTopic(element) {
489
491
  const textManage = getFirstTextManage(element);
490
- textManage?.edit(() => { }, event => {
492
+ textManage?.edit(() => { }, (event) => {
491
493
  const keyboardEvent = event;
492
494
  return keyboardEvent.key === 'Enter' && !keyboardEvent.shiftKey;
493
495
  });
494
496
  }
495
497
  const getSelectedMindElements = (board, elements) => {
496
498
  const selectedElements = elements?.length ? elements : getSelectedElements(board);
497
- return selectedElements.filter(value => MindElement.isMindElement(board, value));
499
+ return selectedElements.filter((value) => MindElement.isMindElement(board, value));
498
500
  };
499
501
 
500
502
  const getBranchDirectionsByLayouts = (branchLayouts) => {
501
503
  const branchDirections = [];
502
- branchLayouts.forEach(l => {
504
+ branchLayouts.forEach((l) => {
503
505
  const directions = LayoutDirectionsMap[l];
504
- directions.forEach(d => {
506
+ directions.forEach((d) => {
505
507
  if (!branchDirections.includes(d) && !branchDirections.includes(getLayoutReverseDirection(d))) {
506
508
  branchDirections.push(d);
507
509
  }
@@ -522,7 +524,7 @@ const getInCorrectLayoutDirection = (rootLayout, layout) => {
522
524
  if (!subLayoutDirections) {
523
525
  throw new Error(`unexpected layout: ${layout} on correct layout`);
524
526
  }
525
- return subLayoutDirections.find(d => directions.includes(getLayoutReverseDirection(d)));
527
+ return subLayoutDirections.find((d) => directions.includes(getLayoutReverseDirection(d)));
526
528
  };
527
529
  const correctLayoutByDirection = (layout, direction) => {
528
530
  const isHorizontal = direction === LayoutDirection.left || direction === LayoutDirection.right ? true : false;
@@ -569,8 +571,8 @@ const getAvailableSubLayoutsByLayoutDirections = (directions) => {
569
571
  const layout = MindLayoutType[key];
570
572
  const layoutDirections = LayoutDirectionsMap[layout];
571
573
  if (layoutDirections) {
572
- const hasSameDirection = layoutDirections.some(d => directions.includes(d));
573
- const hasReverseDirection = layoutDirections.some(r => reverseDirections.includes(r));
574
+ const hasSameDirection = layoutDirections.some((d) => directions.includes(d));
575
+ const hasReverseDirection = layoutDirections.some((r) => reverseDirections.includes(r));
574
576
  if (hasSameDirection && !hasReverseDirection) {
575
577
  result.push(layout);
576
578
  }
@@ -1042,7 +1044,7 @@ const isHitImage = (board, element, point) => {
1042
1044
  const getHitImageResizeHandleDirection = (board, element, point) => {
1043
1045
  const imageRectangle = getImageForeignRectangle(board, element);
1044
1046
  const resizeHandleRefs = getRectangleResizeHandleRefs(imageRectangle, RESIZE_HANDLE_DIAMETER);
1045
- const result = resizeHandleRefs.find(resizeHandleRef => {
1047
+ const result = resizeHandleRefs.find((resizeHandleRef) => {
1046
1048
  return RectangleClient.isHit(RectangleClient.getRectangleByPoints([point, point]), resizeHandleRef.rectangle);
1047
1049
  });
1048
1050
  return result;
@@ -1109,14 +1111,14 @@ const getNewNodeHeight = (board, element, newNodeDynamicWidth) => {
1109
1111
  const addActiveOnDragOrigin = (activeElement) => {
1110
1112
  PlaitElement.getElementG(activeElement).classList.add('dragging-node');
1111
1113
  !activeElement.isCollapsed &&
1112
- activeElement.children.forEach(child => {
1114
+ activeElement.children.forEach((child) => {
1113
1115
  addActiveOnDragOrigin(child);
1114
1116
  });
1115
1117
  };
1116
1118
  const removeActiveOnDragOrigin = (activeElement) => {
1117
1119
  PlaitElement.getElementG(activeElement).classList.remove('dragging-node');
1118
1120
  !activeElement.isCollapsed &&
1119
- activeElement.children.forEach(child => {
1121
+ activeElement.children.forEach((child) => {
1120
1122
  removeActiveOnDragOrigin(child);
1121
1123
  });
1122
1124
  };
@@ -1598,7 +1600,7 @@ class NodeEmojisGenerator {
1598
1600
  const container = document.createElement('div');
1599
1601
  container.classList.add('node-emojis-container');
1600
1602
  foreignObject.append(container);
1601
- this.emojiGenerators = element.data.emojis.map(emojiItem => {
1603
+ this.emojiGenerators = element.data.emojis.map((emojiItem) => {
1602
1604
  const drawer = new EmojiGenerator(this.board);
1603
1605
  drawer.draw(container, emojiItem, element);
1604
1606
  return drawer;
@@ -1611,7 +1613,7 @@ class NodeEmojisGenerator {
1611
1613
  if (this.g) {
1612
1614
  this.g.remove();
1613
1615
  }
1614
- this.emojiGenerators.forEach(drawer => drawer.destroy());
1616
+ this.emojiGenerators.forEach((drawer) => drawer.destroy());
1615
1617
  this.emojiGenerators = [];
1616
1618
  }
1617
1619
  }
@@ -1959,11 +1961,11 @@ const getLocationScope = (board, handlePosition, parentChildren, element, parent
1959
1961
  const startNode = parentChildren[start];
1960
1962
  const endNode = parentChildren[end];
1961
1963
  if (handlePosition === AbstractHandlePosition.start) {
1962
- const abstractNode = parentChildren.filter(child => AbstractNode.isAbstract(child) && child.end < element.start);
1964
+ const abstractNode = parentChildren.filter((child) => AbstractNode.isAbstract(child) && child.end < element.start);
1963
1965
  let minNode;
1964
1966
  if (abstractNode.length) {
1965
1967
  const index = abstractNode
1966
- .map(node => {
1968
+ .map((node) => {
1967
1969
  const { end } = getCorrectStartEnd(node, parent);
1968
1970
  return end;
1969
1971
  })
@@ -1989,11 +1991,11 @@ const getLocationScope = (board, handlePosition, parentChildren, element, parent
1989
1991
  }
1990
1992
  }
1991
1993
  else {
1992
- const abstractNode = parentChildren.filter(child => AbstractNode.isAbstract(child) && child.start > element.end);
1994
+ const abstractNode = parentChildren.filter((child) => AbstractNode.isAbstract(child) && child.start > element.end);
1993
1995
  let maxNode;
1994
1996
  if (abstractNode.length) {
1995
1997
  const index = abstractNode
1996
- .map(node => {
1998
+ .map((node) => {
1997
1999
  const { start } = getCorrectStartEnd(node, parent);
1998
2000
  return start;
1999
2001
  })
@@ -2001,7 +2003,7 @@ const getLocationScope = (board, handlePosition, parentChildren, element, parent
2001
2003
  maxNode = parentChildren[index - 1];
2002
2004
  }
2003
2005
  else {
2004
- const children = parentChildren.filter(child => !AbstractNode.isAbstract(child));
2006
+ const children = parentChildren.filter((child) => !AbstractNode.isAbstract(child));
2005
2007
  maxNode = parentChildren[children.length - 1];
2006
2008
  }
2007
2009
  const maxNodeRectangle = getRectangleByElements(board, [maxNode], true);
@@ -2051,10 +2053,10 @@ const getAbstractHandleRectangle = (rectangle, isHorizontal, position) => {
2051
2053
  return result;
2052
2054
  };
2053
2055
  function findLocationLeftIndex(board, parentChildren, location, isHorizontal) {
2054
- const children = parentChildren.filter(child => {
2056
+ const children = parentChildren.filter((child) => {
2055
2057
  return !AbstractNode.isAbstract(child);
2056
2058
  });
2057
- const recArray = children.map(child => {
2059
+ const recArray = children.map((child) => {
2058
2060
  return getRectangleByElements(board, [child], false);
2059
2061
  });
2060
2062
  const firstRec = getRectangleByElements(board, [children[0]], true);
@@ -2085,7 +2087,7 @@ function findLocationLeftIndex(board, parentChildren, location, isHorizontal) {
2085
2087
  }
2086
2088
  function handleTouchedAbstract(board, touchedAbstract, endPoint) {
2087
2089
  let touchedHandle;
2088
- const abstract = getSelectedElements(board).filter(element => AbstractNode.isAbstract(element)).find(element => {
2090
+ const abstract = getSelectedElements(board).filter((element) => AbstractNode.isAbstract(element)).find((element) => {
2089
2091
  touchedHandle = getHitAbstractHandle(board, element, endPoint);
2090
2092
  return touchedHandle;
2091
2093
  });
@@ -2180,7 +2182,7 @@ const getCorrectLayoutByElement = (board, element) => {
2180
2182
  correctRootLayout = node.left ? MindLayoutType.left : MindLayoutType.right;
2181
2183
  }
2182
2184
  let layout = null;
2183
- const elementWithLayout = ancestors.find(value => value.layout || AbstractNode.isAbstract(value));
2185
+ const elementWithLayout = ancestors.find((value) => value.layout || AbstractNode.isAbstract(value));
2184
2186
  if (elementWithLayout) {
2185
2187
  if (AbstractNode.isAbstract(elementWithLayout)) {
2186
2188
  const parent = MindElement.getParent(elementWithLayout);
@@ -2234,7 +2236,7 @@ const getAvailableSubLayoutsByElement = (board, element) => {
2234
2236
  const parentLayout = [branchLayouts[branchLayouts.length - 1]];
2235
2237
  const parentDirections = getBranchDirectionsByLayouts(parentLayout);
2236
2238
  const parentAvailableSubLayouts = getAvailableSubLayoutsByLayoutDirections(parentDirections);
2237
- availableSubLayouts = availableSubLayouts.filter(layout => parentAvailableSubLayouts.some(parentAvailableSubLayout => parentAvailableSubLayout === layout));
2239
+ availableSubLayouts = availableSubLayouts.filter((layout) => parentAvailableSubLayouts.some((parentAvailableSubLayout) => parentAvailableSubLayout === layout));
2238
2240
  return availableSubLayouts;
2239
2241
  }
2240
2242
  return undefined;
@@ -2347,7 +2349,7 @@ function drawAbstractLink(board, node, isHorizontal) {
2347
2349
  const parent = node.parent;
2348
2350
  const branchShape = getBranchShapeByMindElement(board, node.origin);
2349
2351
  const abstractRectangle = getRectangleByNode(node);
2350
- let includedElements = parent.children.slice(node.origin.start, node.origin.end + 1).map(node => {
2352
+ let includedElements = parent.children.slice(node.origin.start, node.origin.end + 1).map((node) => {
2351
2353
  return node.origin;
2352
2354
  });
2353
2355
  const includedElementsRectangle = getRectangleByElements(board, includedElements, true);
@@ -2539,7 +2541,7 @@ const addEmoji = (board, element, emojiItem) => {
2539
2541
  Transforms.setNode(board, newElement, path);
2540
2542
  };
2541
2543
  const removeEmoji = (board, element, emojiItem) => {
2542
- const emojis = element.data.emojis.filter(value => value !== emojiItem);
2544
+ const emojis = element.data.emojis.filter((value) => value !== emojiItem);
2543
2545
  const newElement = {
2544
2546
  data: { topic: element.data.topic }
2545
2547
  };
@@ -2556,7 +2558,7 @@ const replaceEmoji = (board, element, oldEmoji, newEmoji) => {
2556
2558
  const newElement = {
2557
2559
  data: { ...element.data }
2558
2560
  };
2559
- const newEmojis = element.data.emojis.map(value => {
2561
+ const newEmojis = element.data.emojis.map((value) => {
2560
2562
  if (value === oldEmoji) {
2561
2563
  return newEmoji;
2562
2564
  }
@@ -2806,7 +2808,7 @@ const getNodeMoreKeyPosition = (board, element) => {
2806
2808
  const endPoint = moveXOfPoint(startPoint, NODE_MORE_LINE_DISTANCE, layoutDirection);
2807
2809
  const hasCollapsedIcon = element.children?.length > 0 && !isMind && !element.isCollapsed;
2808
2810
  const hasExpandedIcon = element.children?.length > 0 && !isMind && element.isCollapsed;
2809
- const hasAddIcon = !hasExpandedIcon;
2811
+ const hasAddIcon = !hasExpandedIcon && !PlaitBoard.isReadonly(board);
2810
2812
  const firstIconCenter = moveXOfPoint(endPoint, NODE_MORE_ICON_DIAMETER / 2, layoutDirection);
2811
2813
  const collapsedIconCenter = hasCollapsedIcon ? firstIconCenter : null;
2812
2814
  const expandedIconCenter = hasExpandedIcon ? firstIconCenter : null;
@@ -2831,6 +2833,13 @@ const getNodeMoreKeyPosition = (board, element) => {
2831
2833
  moveYOfPoint(expandedIconEndPoint, NODE_MORE_ICON_DIAMETER / 2, layoutDirection)
2832
2834
  ]);
2833
2835
  }
2836
+ else if (hasCollapsedIcon) {
2837
+ const collapsedIconEndPoint = moveXOfPoint(collapsedIconCenter, NODE_MORE_ICON_DIAMETER / 2, layoutDirection);
2838
+ awarenessRectangle = RectangleClient.getRectangleByPoints([
2839
+ moveYOfPoint(startPoint, -NODE_MORE_ICON_DIAMETER / 2, layoutDirection),
2840
+ moveYOfPoint(collapsedIconEndPoint, NODE_MORE_ICON_DIAMETER / 2, layoutDirection)
2841
+ ]);
2842
+ }
2834
2843
  let standardRef = null;
2835
2844
  if (hasLeftAddIcon) {
2836
2845
  const leftStartPoint = getNodeMoreStartPoint(board, element, layoutDirection, true);
@@ -3487,7 +3496,10 @@ const withMindHotkey = (baseBoard) => {
3487
3496
  const { history } = board;
3488
3497
  const { undos } = history;
3489
3498
  const previousOp = undos.length > 0 ? undos[undos.length - 1][0] : undefined;
3490
- if (previousOp && previousOp.type === 'insert_node' && MindElement.isMindElement(board, previousOp.node) && getFirstTextManage(previousOp.node).isEditing) {
3499
+ if (previousOp &&
3500
+ previousOp.type === 'insert_node' &&
3501
+ MindElement.isMindElement(board, previousOp.node) &&
3502
+ getFirstTextManage(previousOp.node).isEditing) {
3491
3503
  board.undo();
3492
3504
  }
3493
3505
  }
@@ -3497,6 +3509,7 @@ const withMindHotkey = (baseBoard) => {
3497
3509
  return board;
3498
3510
  };
3499
3511
 
3512
+ const debugGenerator = createDebugGenerator('debug:plait:node-more');
3500
3513
  const isSameNodeMoreRef = (ref1, ref2) => {
3501
3514
  if (!ref1 || !ref2) {
3502
3515
  return false;
@@ -3675,6 +3688,17 @@ const getNodeMoreRef = (board, x, y) => {
3675
3688
  const isHitStandardLeftAddIcon = hasLeftAddIcon &&
3676
3689
  standardRef &&
3677
3690
  RectangleClient.isHit(RectangleClient.getRectangleByPoints([point, point]), RectangleClient.getRectangleByCenterPoint(standardRef.addCenter, NODE_MORE_ICON_DIAMETER, NODE_MORE_ICON_DIAMETER));
3691
+ if (debugGenerator.isDebug()) {
3692
+ debugGenerator.clear();
3693
+ if (awarenessRectangle) {
3694
+ debugGenerator.drawRectangle(board, awarenessRectangle);
3695
+ }
3696
+ const data = element.data.topic;
3697
+ const string = Node$1.string(data);
3698
+ if (string === 'xxxx') {
3699
+ console.log('xxxx');
3700
+ }
3701
+ }
3678
3702
  if (isHitElement || isHitAwarenessRectangleInternal || isHitStandardLeftAwarenessRectangleInternal) {
3679
3703
  isHit = isHitElement;
3680
3704
  target = element;
@@ -4050,7 +4074,7 @@ const withMindFragment = (baseBoard) => {
4050
4074
  };
4051
4075
  board.insertFragment = (clipboardData, targetPoint, operationType) => {
4052
4076
  if (clipboardData?.elements?.length) {
4053
- const mindElements = clipboardData.elements?.filter(value => MindElement.isMindElement(board, value));
4077
+ const mindElements = clipboardData.elements?.filter((value) => MindElement.isMindElement(board, value));
4054
4078
  if (mindElements && mindElements.length > 0) {
4055
4079
  insertClipboardData(board, mindElements, targetPoint, operationType);
4056
4080
  }
@@ -4088,7 +4112,7 @@ const getNextSelectedElement = (board, firstLevelElements) => {
4088
4112
  catch (error) { }
4089
4113
  const firstElement = firstLevelElements[0];
4090
4114
  const firstElementParent = MindElement.findParent(firstElement);
4091
- const hasSameParent = firstLevelElements.every(element => {
4115
+ const hasSameParent = firstLevelElements.every((element) => {
4092
4116
  return MindElement.findParent(element) === firstElementParent;
4093
4117
  });
4094
4118
  if (firstElementParent && hasSameParent && !activeElement) {
@@ -4203,12 +4227,12 @@ const withMind = (baseBoard) => {
4203
4227
  }
4204
4228
  return isHit(element, point, isStrict);
4205
4229
  };
4206
- board.getOneHitElement = (elements) => {
4230
+ board.getOneHitElement = (elements, hitPoint) => {
4207
4231
  const isAllMindElements = elements.every((item) => MindElement.isMindElement(board, item));
4208
4232
  if (isAllMindElements) {
4209
4233
  return elements[0];
4210
4234
  }
4211
- return getOneHitElement(elements);
4235
+ return getOneHitElement(elements, hitPoint);
4212
4236
  };
4213
4237
  board.isMovable = (element) => {
4214
4238
  if (PlaitMind.isMind(element)) {