@plait/mind 0.87.0-next.0 → 0.87.0-next.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.
@@ -3885,6 +3885,9 @@ const insertClipboardData = (board, elements, targetPoint, operationType) => {
3885
3885
  const targetParent = selectedElements[0];
3886
3886
  const targetParentPath = targetParent && PlaitBoard.findPath(board, targetParent);
3887
3887
  const nonAbstractChildrenLength = targetParent && getNonAbstractChildren(targetParent).length;
3888
+ if (targetParent && targetParent.isCollapsed) {
3889
+ Transforms.setNode(board, { isCollapsed: false }, targetParentPath);
3890
+ }
3888
3891
  elements.forEach((item, index) => {
3889
3892
  newElement = copyNewNode(item);
3890
3893
  if (hasTargetParent && operationType !== WritableClipboardOperationType.duplicate) {
@@ -3917,7 +3920,11 @@ const insertClipboardData = (board, elements, targetPoint, operationType) => {
3917
3920
  };
3918
3921
  const insertClipboardText = (board, targetParent, text) => {
3919
3922
  const newElement = createMindElement(text, {});
3923
+ const path = PlaitBoard.findPath(board, targetParent);
3920
3924
  Transforms.insertNode(board, newElement, findNewChildNodePath(board, targetParent));
3925
+ if (targetParent.isCollapsed) {
3926
+ Transforms.setNode(board, { isCollapsed: false }, path);
3927
+ }
3921
3928
  Transforms.addSelectionWithTemporaryElements(board, [newElement]);
3922
3929
  };
3923
3930