@inditextech/weave-sdk 3.7.2 → 3.8.1-SNAPSHOT.191.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.
package/dist/types.js CHANGED
@@ -15102,6 +15102,9 @@ var WeaveStore = class {
15102
15102
  getStateJson() {
15103
15103
  return JSON.parse(JSON.stringify(this.state, void 0, 2));
15104
15104
  }
15105
+ getRoomId() {
15106
+ return this.roomId;
15107
+ }
15105
15108
  getStateSnapshot() {
15106
15109
  const doc = this.getDocument();
15107
15110
  return yjs_default.encodeStateAsUpdate(doc);
@@ -17676,19 +17679,20 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17676
17679
  node.rotation(nodeRotation);
17677
17680
  node.x(node.x() - (layerToMoveAttrs.containerOffsetX ?? 0));
17678
17681
  node.y(node.y() - (layerToMoveAttrs.containerOffsetY ?? 0));
17679
- node.movedToContainer(layerToMove);
17682
+ node.destroy();
17683
+ const newNode = node.clone();
17680
17684
  instance.emitEvent("onNodeMovedToContainer", {
17681
- node: node.clone(),
17685
+ node: newNode,
17682
17686
  container: layerToMove,
17683
17687
  originalNode,
17684
17688
  originalContainer
17685
17689
  });
17686
17690
  const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17687
17691
  if (nodeHandler) {
17688
- node.setAttrs({ onMoveContainer: true });
17689
- const actualNode = nodeHandler.serialize(node);
17690
- instance.removeNodeNT(actualNode, { emitUserChangeEvent: false });
17691
- instance.addNodeNT(actualNode, layerToMoveAttrs.id, {
17692
+ const actualNodeState = nodeHandler.serialize(node);
17693
+ const newNodeState = nodeHandler.serialize(newNode);
17694
+ instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17695
+ instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17692
17696
  emitUserChangeEvent: false,
17693
17697
  overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17694
17698
  });
@@ -17917,17 +17921,6 @@ function isIOS() {
17917
17921
  return /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
17918
17922
  }
17919
17923
  const isServer = () => typeof window === "undefined";
17920
- const getPositionRelativeToContainerOnPosition = (instance) => {
17921
- let position = instance.getStage().getRelativePointerPosition();
17922
- if (!position) return position;
17923
- const container = containerOverCursor(instance, [], position);
17924
- if (container) if (container.getAttrs().containerId) {
17925
- const containerNode = container.findOne(`#${container.getAttrs().containerId}`);
17926
- if (containerNode) position = containerNode?.getRelativePointerPosition();
17927
- } else position = container?.getRelativePointerPosition();
17928
- if (!position) return position;
17929
- return position;
17930
- };
17931
17924
  const canComposite = (node) => {
17932
17925
  const parent = node.getParent();
17933
17926
  return parent?.getClassName() === "Group" && parent?.getAttrs().nodeType !== "frame" && parent?.getAttrs().nodeId === void 0;
@@ -18608,12 +18601,10 @@ const WEAVE_GRID_LAYER_ID = "gridLayer";
18608
18601
  //#region src/plugins/stage-panning/constants.ts
18609
18602
  const WEAVE_STAGE_PANNING_KEY = "stagePanning";
18610
18603
  const WEAVE_STAGE_PANNING_THROTTLE_MS = 20;
18611
- const WEAVE_STAGE_PANNING_DEFAULT_CONFIG = {
18612
- edgePanOffset: 25,
18613
- edgePanMinSpeed: 2,
18614
- edgePanSpeed: 10,
18615
- edgePanMaxSpeed: 30
18616
- };
18604
+ const WEAVE_STAGE_PANNING_DEFAULT_CONFIG = { edgePan: {
18605
+ offset: 25,
18606
+ speed: 20
18607
+ } };
18617
18608
 
18618
18609
  //#endregion
18619
18610
  //#region src/plugins/nodes-multi-selection-feedback/constants.ts
@@ -18678,7 +18669,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18678
18669
  "bottom-right"
18679
18670
  ];
18680
18671
  this.taps = 0;
18681
- this.isCtrlMetaPressed = false;
18682
18672
  this.isSpaceKeyPressed = false;
18683
18673
  this.isDoubleTap = false;
18684
18674
  this.tapStart = null;
@@ -18778,12 +18768,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18778
18768
  }
18779
18769
  };
18780
18770
  stage.on("pointermove", (0, import_throttle.default)(handlePointerMoveInit, DEFAULT_THROTTLE_MS));
18781
- tr.on("transformstart", () => {
18771
+ tr.on("transformstart", (e) => {
18782
18772
  this.transformInProcess = true;
18783
18773
  this.triggerSelectedNodesEvent();
18784
18774
  const selectedNodes$1 = tr.nodes();
18785
18775
  for (const node of selectedNodes$1) {
18786
- node.handleMouseout();
18776
+ node.handleMouseout(e);
18787
18777
  if (node.getAttrs().strokeScaleEnabled !== false) {
18788
18778
  node.setAttr("strokeScaleEnabled", false);
18789
18779
  node.setAttr("_revertStrokeScaleEnabled", true);
@@ -18795,7 +18785,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18795
18785
  });
18796
18786
  });
18797
18787
  let nodeHovered = void 0;
18798
- tr.on("mousemove", () => {
18788
+ tr.on("mousemove", (e) => {
18799
18789
  if (this.dragInProcess) return;
18800
18790
  const pointerPos = stage.getPointerPosition();
18801
18791
  if (!pointerPos) return;
@@ -18805,13 +18795,13 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18805
18795
  if (shape) {
18806
18796
  const targetNode = this.instance.getInstanceRecursive(shape);
18807
18797
  if (targetNode && targetNode !== nodeHovered) {
18808
- this.instance.getStage().handleMouseover();
18809
- nodeHovered?.handleMouseout?.();
18810
- targetNode?.handleMouseover?.();
18798
+ this.instance.getStage().handleMouseover(e);
18799
+ nodeHovered?.handleMouseout?.(e);
18800
+ targetNode?.handleMouseover?.(e);
18811
18801
  nodeHovered = targetNode;
18812
18802
  }
18813
- targetNode?.handleMouseover?.();
18814
- } else nodeHovered?.handleMouseout?.();
18803
+ targetNode?.handleMouseover?.(e);
18804
+ } else nodeHovered?.handleMouseout?.(e);
18815
18805
  });
18816
18806
  tr.on("mouseover", () => {
18817
18807
  const nodesSelected = tr.nodes();
@@ -18820,32 +18810,37 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18820
18810
  stage.container().style.cursor = node.defineMousePointer() ?? "grab";
18821
18811
  } else stage.container().style.cursor = "grab";
18822
18812
  });
18823
- tr.on("mouseout", () => {
18824
- this.instance.getStage().handleMouseover?.();
18813
+ tr.on("mouseout", (e) => {
18814
+ this.instance.getStage().handleMouseover?.(e);
18825
18815
  nodeHovered = void 0;
18826
18816
  });
18827
- window.addEventListener("mouseout", () => {
18817
+ window.addEventListener("mouseout", (e) => {
18828
18818
  if (nodeHovered) {
18829
- nodeHovered.handleMouseout();
18819
+ nodeHovered.handleMouseout(e);
18830
18820
  nodeHovered = void 0;
18831
18821
  }
18832
- this.instance.getStage().handleMouseover?.();
18822
+ this.instance.getStage().handleMouseover?.(e);
18833
18823
  }, { signal: this.instance.getEventsController()?.signal });
18834
18824
  const handleTransform = (e) => {
18835
18825
  const moved = this.checkMoved(e);
18836
18826
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18837
18827
  this.triggerSelectedNodesEvent();
18838
18828
  if (this.getUsersPresencePlugin()) {
18839
- for (const node of tr.nodes()) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18840
- x: node.x(),
18841
- y: node.y(),
18842
- width: node.width(),
18843
- height: node.height(),
18844
- scaleX: node.scaleX(),
18845
- scaleY: node.scaleY(),
18846
- rotation: node.rotation(),
18847
- strokeScaleEnabled: false
18848
- }, false);
18829
+ for (const node of tr.nodes()) {
18830
+ let parentId = node.getParent()?.id() ?? "";
18831
+ const parent = node.getParent();
18832
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
18833
+ this.getUsersPresencePlugin()?.setPresence(node.id(), parentId, {
18834
+ x: node.x(),
18835
+ y: node.y(),
18836
+ width: node.width(),
18837
+ height: node.height(),
18838
+ scaleX: node.scaleX(),
18839
+ scaleY: node.scaleY(),
18840
+ rotation: node.rotation(),
18841
+ strokeScaleEnabled: false
18842
+ }, false);
18843
+ }
18849
18844
  this.getUsersPresencePlugin()?.forceSendPresence();
18850
18845
  }
18851
18846
  };
@@ -18869,6 +18864,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18869
18864
  let selectedNodes = [];
18870
18865
  tr.on("dragstart", (e) => {
18871
18866
  this.dragInProcess = true;
18867
+ let isWheelMousePressed = false;
18868
+ if (e.evt.button === 1) isWheelMousePressed = true;
18872
18869
  const mainLayer = this.instance.getMainLayer();
18873
18870
  if (!mainLayer) return;
18874
18871
  initialPos = {
@@ -18878,9 +18875,9 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18878
18875
  this.didMove = false;
18879
18876
  const stage$1 = this.instance.getStage();
18880
18877
  this.saveDragSelectedNodes();
18881
- if (this.getDragSelectedNodes().length > 1) this.setNodesOpacityOnDrag();
18878
+ this.setNodesOpacityOnDrag();
18882
18879
  selectedNodes = tr.nodes();
18883
- if (stage$1.isMouseWheelPressed()) {
18880
+ if (isWheelMousePressed) {
18884
18881
  e.cancelBubble = true;
18885
18882
  e.target.stopDrag();
18886
18883
  return;
@@ -18904,13 +18901,14 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18904
18901
  x: e.target.x(),
18905
18902
  y: e.target.y()
18906
18903
  };
18904
+ let isWheelMousePressed = false;
18905
+ if (e.evt.button === 1) isWheelMousePressed = true;
18907
18906
  e.cancelBubble = true;
18908
18907
  if (initialPos) {
18909
18908
  const moved = this.checkMovedDrag(initialPos, actualPos);
18910
18909
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18911
18910
  }
18912
- const stage$1 = this.instance.getStage();
18913
- if (stage$1.isMouseWheelPressed()) {
18911
+ if (isWheelMousePressed) {
18914
18912
  e.cancelBubble = true;
18915
18913
  e.target.stopDrag();
18916
18914
  return;
@@ -18930,10 +18928,15 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18930
18928
  clearContainerTargets(this.instance);
18931
18929
  const layerToMove = containerOverCursor(this.instance, selectedNodes);
18932
18930
  if (this.getUsersPresencePlugin() && this.dragInProcess) {
18933
- for (const node of selectedNodes) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18934
- x: node.x(),
18935
- y: node.y()
18936
- }, false);
18931
+ for (const node of selectedNodes) {
18932
+ let parentId = node.getParent()?.id() ?? "";
18933
+ const parent = node.getParent();
18934
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
18935
+ this.getUsersPresencePlugin()?.setPresence(node.id(), parentId, {
18936
+ x: node.x(),
18937
+ y: node.y()
18938
+ }, false);
18939
+ }
18937
18940
  this.getUsersPresencePlugin()?.forceSendPresence();
18938
18941
  }
18939
18942
  if (layerToMove && !selectionContainsFrames) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { bubbles: true });
@@ -18947,7 +18950,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18947
18950
  if (!mainLayer) return;
18948
18951
  this.instance.getSelectionLayer()?.hitGraphEnabled(true);
18949
18952
  this.instance.getMainLayer()?.hitGraphEnabled(true);
18950
- if (this.getDragSelectedNodes().length > 1) this.restoreNodesOpacityOnDrag();
18951
18953
  if (!this.didMove) return;
18952
18954
  if (selectedNodes.length > 1) this.instance.releaseMutexLock();
18953
18955
  e.cancelBubble = true;
@@ -19020,16 +19022,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19020
19022
  tr.forceUpdate();
19021
19023
  }
19022
19024
  });
19023
- this.instance.addEventListener("onRender", () => {
19024
- const point = stage.getPointerPosition();
19025
- if (point) {
19026
- const ele = this.instance.getTargetingManager().pointIntersectsElement(point);
19027
- if (ele) {
19028
- const realEle = this.instance.getTargetingManager().resolveNode(ele);
19029
- realEle?.handleMouseover();
19030
- }
19031
- }
19032
- });
19033
19025
  this.instance.addEventListener("onNodesChange", () => {
19034
19026
  const currentSelectedNodes = tr.nodes();
19035
19027
  const unselectedNodes = this.prevSelectedNodes.filter((node) => !currentSelectedNodes.map((node1) => node1.getAttrs().id).includes(node.getAttrs().id));
@@ -19236,12 +19228,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19236
19228
  initEvents() {
19237
19229
  this.selecting = false;
19238
19230
  const stage = this.instance.getStage();
19239
- window.addEventListener("blur", () => {
19240
- this.isCtrlMetaPressed = false;
19241
- this.isSpaceKeyPressed = false;
19242
- }, { signal: this.instance.getEventsController()?.signal });
19243
19231
  stage.container().addEventListener("keydown", (e) => {
19244
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
19245
19232
  if (e.code === "Space") this.isSpaceKeyPressed = true;
19246
19233
  if (e.code === "Backspace" || e.code === "Delete") {
19247
19234
  Promise.resolve().then(() => {
@@ -19251,7 +19238,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19251
19238
  }
19252
19239
  }, { signal: this.instance.getEventsController()?.signal });
19253
19240
  stage.container().addEventListener("keyup", (e) => {
19254
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
19255
19241
  if (e.code === "Space") this.isSpaceKeyPressed = false;
19256
19242
  }, { signal: this.instance.getEventsController()?.signal });
19257
19243
  stage.on("pointerdown", (e) => {
@@ -19303,7 +19289,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19303
19289
  this.selectionRectangle.width(0);
19304
19290
  this.selectionRectangle.height(0);
19305
19291
  this.selecting = true;
19306
- if (this.isCtrlMetaPressed) {
19292
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
19293
+ if (isCtrlOrMetaPressed) {
19307
19294
  const nodesSelected = this.tr.nodes();
19308
19295
  for (const node of nodesSelected) node.fire("onSelectionCleared", { bubbles: true });
19309
19296
  }
@@ -19523,7 +19510,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19523
19510
  nodeTargeted.dblClick();
19524
19511
  return;
19525
19512
  }
19526
- if (stage.isCmdCtrlPressed()) return;
19513
+ const isCtrlOrCmdPressed = e.evt.ctrlKey || e.evt.metaKey;
19514
+ if (isCtrlOrCmdPressed) return;
19527
19515
  if (!metaPressed) {
19528
19516
  this.tr.nodes([nodeTargeted]);
19529
19517
  this.tr.show();
@@ -19700,11 +19688,18 @@ const COPY_PASTE_NODES_PLUGIN_STATE = {
19700
19688
  ["IDLE"]: "idle",
19701
19689
  ["PASTING"]: "pasting"
19702
19690
  };
19703
- const WEAVE_COPY_PASTE_CONFIG_DEFAULT = { paddingOnPaste: {
19704
- enabled: false,
19705
- paddingX: 0,
19706
- paddingY: 0
19707
- } };
19691
+ const WEAVE_COPY_PASTE_CONFIG_DEFAULT = {
19692
+ canPasteOnto: (node, atTarget) => {
19693
+ const targetType = atTarget.getAttrs().nodeType;
19694
+ if (targetType === "frame" && node.type === "frame") return false;
19695
+ return true;
19696
+ },
19697
+ paddingOnPaste: {
19698
+ enabled: false,
19699
+ paddingX: 0,
19700
+ paddingY: 0
19701
+ }
19702
+ };
19708
19703
 
19709
19704
  //#endregion
19710
19705
  //#region src/plugins/copy-paste-nodes/copy-paste-nodes.ts
@@ -19931,6 +19926,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19931
19926
  }
19932
19927
  };
19933
19928
  this.instance.addEventListener("onNodeRenderedAdded", handleOnNodeAdded);
19929
+ const nodesToPaste = [];
19934
19930
  for (const element of Object.keys(this.toPaste.weave)) {
19935
19931
  const node = this.toPaste.weave[element].element;
19936
19932
  const posRelativeToSelection = this.toPaste.weave[element].posRelativeToSelection;
@@ -19971,12 +19967,22 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19971
19967
  containerId = this.instance.getMainLayer()?.getAttrs().id ?? "";
19972
19968
  containerNode = this.instance.getMainLayer();
19973
19969
  }
19974
- if (containerId) {
19970
+ const canPasteNodeOntoTarget = this.config.canPasteOnto(node, containerNode);
19971
+ if (!canPasteNodeOntoTarget) throw new Error(`Cannot paste node ${node.key} onto target container: ${containerId}`, { cause: "InvalidPasteTarget" });
19972
+ if (containerId && canPasteNodeOntoTarget) {
19975
19973
  nodesToSelect.push(newNodeId);
19976
- this.instance.addNodeNT(node, containerId);
19974
+ nodesToPaste.push({
19975
+ node,
19976
+ containerId
19977
+ });
19977
19978
  }
19978
19979
  this.getStageGridPlugin()?.onRender();
19979
19980
  }
19981
+ for (const elementToPaste of nodesToPaste) {
19982
+ const { node, containerId } = elementToPaste;
19983
+ this.instance.addNodeNT(node, containerId);
19984
+ this.getStageGridPlugin()?.onRender();
19985
+ }
19980
19986
  });
19981
19987
  }
19982
19988
  async finishHandleCopy() {
@@ -20068,6 +20074,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
20068
20074
  }
20069
20075
  } catch (ex) {
20070
20076
  this.instance.emitEvent("onPaste", { error: ex });
20077
+ if (ex instanceof Error && ex.cause === "InvalidPasteTarget") return;
20071
20078
  }
20072
20079
  try {
20073
20080
  const items = await navigator.clipboard.read();
@@ -20165,11 +20172,6 @@ const MOVE_TOOL_STATE = {
20165
20172
 
20166
20173
  //#endregion
20167
20174
  //#region src/nodes/node.ts
20168
- const augmentKonvaStageClass = () => {
20169
- Konva.Stage.prototype.isMouseWheelPressed = function() {
20170
- return false;
20171
- };
20172
- };
20173
20175
  const augmentKonvaNodeClass = (config) => {
20174
20176
  const { transform } = config ?? {};
20175
20177
  Konva.Node.prototype.getTransformerProperties = function() {
@@ -20181,7 +20183,6 @@ const augmentKonvaNodeClass = (config) => {
20181
20183
  Konva.Node.prototype.getRealClientRect = function(config$1) {
20182
20184
  return this.getClientRect(config$1);
20183
20185
  };
20184
- Konva.Node.prototype.movedToContainer = function() {};
20185
20186
  Konva.Node.prototype.updatePosition = function() {};
20186
20187
  Konva.Node.prototype.triggerCrop = function() {};
20187
20188
  Konva.Node.prototype.closeCrop = function() {};
@@ -20231,7 +20232,6 @@ var WeaveNode = class {
20231
20232
  "bottom-right"
20232
20233
  ];
20233
20234
  };
20234
- node.movedToContainer = function() {};
20235
20235
  node.updatePosition = function() {};
20236
20236
  node.resetCrop = function() {};
20237
20237
  node.handleMouseover = function() {};
@@ -20420,7 +20420,10 @@ var WeaveNode = class {
20420
20420
  const nodesEdgeSnappingPlugin = this.getNodesEdgeSnappingPlugin();
20421
20421
  if (nodesSelectionPlugin && this.isSelecting() && this.isNodeSelected(node$1)) nodesSelectionPlugin.getTransformer().forceUpdate();
20422
20422
  if (nodesEdgeSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesEdgeSnappingPlugin.evaluateGuidelines(e);
20423
- this.getUsersPresencePlugin()?.setPresence(node$1.id(), {
20423
+ let parentId = node$1.getParent()?.id() ?? "";
20424
+ const parent = node$1.getParent();
20425
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
20426
+ this.getUsersPresencePlugin()?.setPresence(node$1.id(), parentId, {
20424
20427
  x: node$1.x(),
20425
20428
  y: node$1.y(),
20426
20429
  width: node$1.width(),
@@ -20476,10 +20479,9 @@ var WeaveNode = class {
20476
20479
  node.off("dragstart");
20477
20480
  node.on("dragstart", (e) => {
20478
20481
  const nodeTarget = e.target;
20479
- e.cancelBubble = true;
20482
+ let isWheelMousePressed = false;
20483
+ if (e.evt.button === 1) isWheelMousePressed = true;
20480
20484
  this.getNodesSelectionFeedbackPlugin()?.hideSelectionHalo(nodeTarget);
20481
- this.getSelectionPlugin()?.saveDragSelectedNodes();
20482
- if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.setNodesOpacityOnDrag();
20483
20485
  const canMove = nodeTarget?.canDrag() ?? false;
20484
20486
  if (!canMove) {
20485
20487
  nodeTarget.stopDrag();
@@ -20496,7 +20498,7 @@ var WeaveNode = class {
20496
20498
  return;
20497
20499
  }
20498
20500
  this.instance.emitEvent("onDrag", nodeTarget);
20499
- if (stage.isMouseWheelPressed()) {
20501
+ if (isWheelMousePressed) {
20500
20502
  e.cancelBubble = true;
20501
20503
  nodeTarget.stopDrag();
20502
20504
  }
@@ -20513,6 +20515,7 @@ var WeaveNode = class {
20513
20515
  originalNode = realNodeTarget.clone();
20514
20516
  originalContainer = realNodeTarget.getParent();
20515
20517
  if (originalContainer?.getAttrs().nodeId) originalContainer = stage.findOne(`#${originalContainer.getAttrs().nodeId}`);
20518
+ realNodeTarget.fire("nodeDragStart", { node: realNodeTarget });
20516
20519
  if (e.evt?.altKey) {
20517
20520
  nodeTarget.setAttrs({ isCloneOrigin: true });
20518
20521
  nodeTarget.setAttrs({ isCloned: false });
@@ -20541,19 +20544,20 @@ var WeaveNode = class {
20541
20544
  });
20542
20545
  const handleDragMove = (e) => {
20543
20546
  const nodeTarget = e.target;
20547
+ let isWheelMousePressed = false;
20548
+ if (e.evt.button === 1) isWheelMousePressed = true;
20544
20549
  e.cancelBubble = true;
20545
20550
  if (e.evt?.buttons === 0) {
20546
20551
  nodeTarget.stopDrag();
20547
20552
  return;
20548
20553
  }
20549
20554
  this.didMove = true;
20550
- const stage$1 = this.instance.getStage();
20551
20555
  const isErasing = this.instance.getActiveAction() === "eraseTool";
20552
20556
  if (isErasing) {
20553
20557
  nodeTarget.stopDrag();
20554
20558
  return;
20555
20559
  }
20556
- if (stage$1.isMouseWheelPressed()) {
20560
+ if (isWheelMousePressed) {
20557
20561
  e.cancelBubble = true;
20558
20562
  nodeTarget.stopDrag();
20559
20563
  return;
@@ -20568,7 +20572,10 @@ var WeaveNode = class {
20568
20572
  }
20569
20573
  if (this.isSelecting() && this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
20570
20574
  clearContainerTargets(this.instance);
20571
- this.getUsersPresencePlugin()?.setPresence(realNodeTarget.id(), {
20575
+ let parentId = realNodeTarget.getParent()?.id() ?? "";
20576
+ const parent = realNodeTarget.getParent();
20577
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
20578
+ this.getUsersPresencePlugin()?.setPresence(realNodeTarget.id(), parentId, {
20572
20579
  x: realNodeTarget.x(),
20573
20580
  y: realNodeTarget.y()
20574
20581
  });
@@ -20603,7 +20610,7 @@ var WeaveNode = class {
20603
20610
  startPosition = null;
20604
20611
  lockedAxis = null;
20605
20612
  isShiftPressed = false;
20606
- if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.restoreNodesOpacityOnDrag();
20613
+ this.getSelectionPlugin()?.restoreNodesOpacityOnDrag();
20607
20614
  if (this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
20608
20615
  this.instance.releaseMutexLock();
20609
20616
  this.getNodesSelectionFeedbackPlugin()?.showSelectionHalo(nodeTarget);
@@ -20667,11 +20674,11 @@ var WeaveNode = class {
20667
20674
  originalPosition = realNodeTarget.getAbsolutePosition();
20668
20675
  });
20669
20676
  if (!node.getAttrs().overridesMouseControl) {
20670
- node.handleMouseover = () => {
20671
- this.handleMouseOver(node);
20677
+ node.handleMouseover = (e) => {
20678
+ this.handleMouseOver(e, node);
20672
20679
  };
20673
- node.handleMouseout = () => {
20674
- this.handleMouseout(node);
20680
+ node.handleMouseout = (e) => {
20681
+ this.handleMouseout(e, node);
20675
20682
  };
20676
20683
  }
20677
20684
  node.on("xChange yChange", () => {
@@ -20699,20 +20706,21 @@ var WeaveNode = class {
20699
20706
  };
20700
20707
  node.on("pointerover", (e) => {
20701
20708
  const realNodeTarget = this.getRealSelectedNode(e.target);
20702
- realNodeTarget?.handleMouseover?.();
20703
- const doCancelBubble = this.handleMouseOver(e.target);
20709
+ realNodeTarget?.handleMouseover?.(e);
20710
+ const doCancelBubble = this.handleMouseOver(e, e.target);
20704
20711
  if (doCancelBubble) e.cancelBubble = true;
20705
20712
  });
20706
20713
  node.on("pointerleave", (e) => {
20707
20714
  const realNodeTarget = this.getRealSelectedNode(e.target);
20708
- realNodeTarget?.handleMouseout?.();
20709
- this.handleMouseout(e.target);
20715
+ realNodeTarget?.handleMouseout?.(e);
20716
+ this.handleMouseout(e, e.target);
20710
20717
  });
20711
20718
  }
20712
20719
  }
20713
- handleMouseOver(node) {
20720
+ handleMouseOver(e, node) {
20714
20721
  const stage = this.instance.getStage();
20715
- if (stage?.isCmdCtrlPressed?.()) return false;
20722
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20723
+ if (isCtrlOrMetaPressed) return false;
20716
20724
  const user = this.instance.getStore().getUser();
20717
20725
  const activeAction = this.instance.getActiveAction();
20718
20726
  const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
@@ -20746,9 +20754,9 @@ var WeaveNode = class {
20746
20754
  else this.hideHoverState();
20747
20755
  return cancelBubble;
20748
20756
  }
20749
- handleMouseout(node) {
20750
- const stage = this.instance.getStage();
20751
- if (stage?.isCmdCtrlPressed?.()) return;
20757
+ handleMouseout(e, node) {
20758
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20759
+ if (isCtrlOrMetaPressed) return;
20752
20760
  const realNode = this.instance.getInstanceRecursive(node);
20753
20761
  if (realNode) this.hideHoverState();
20754
20762
  }
@@ -20780,7 +20788,6 @@ var WeaveNode = class {
20780
20788
  delete cleanedAttrs.mutexUserId;
20781
20789
  delete cleanedAttrs.draggable;
20782
20790
  delete cleanedAttrs.overridesMouseControl;
20783
- delete cleanedAttrs.onMoveContainer;
20784
20791
  delete cleanedAttrs.dragBoundFunc;
20785
20792
  return {
20786
20793
  key: attrs.id ?? "",
@@ -21406,45 +21413,24 @@ var WeaveTargetingManager = class {
21406
21413
  }
21407
21414
  getMousePointer(point) {
21408
21415
  this.logger.debug({ point }, "getMousePointer");
21409
- const stage = this.instance.getStage();
21410
21416
  const mainLayer = this.instance.getMainLayer();
21411
21417
  let relativeMousePointer = typeof point !== "undefined" ? point : mainLayer?.getRelativePointerPosition() ?? {
21412
21418
  x: 0,
21413
21419
  y: 0
21414
21420
  };
21415
- let measureContainer = mainLayer;
21416
- let container = mainLayer;
21417
21421
  const utilityLayer = this.instance.getUtilityLayer();
21418
21422
  if (utilityLayer) utilityLayer.visible(false);
21423
+ let containerAlt = containerOverCursor(this.instance, [], relativeMousePointer);
21424
+ if (!containerAlt) containerAlt = this.instance.getMainLayer();
21419
21425
  const nodesSelection = this.instance.getPlugin("nodesSelection");
21420
21426
  if (nodesSelection) nodesSelection.getTransformer().visible(false);
21421
- const dummyRect = new Konva.Rect({
21422
- width: 10,
21423
- height: 10,
21424
- x: relativeMousePointer.x,
21425
- y: relativeMousePointer.y
21426
- });
21427
- mainLayer?.add(dummyRect);
21428
- const intersectedNode = this.nodeIntersectsContainerElement(dummyRect);
21429
- if (intersectedNode) {
21430
- const containerOfNode = stage.findOne(`#${intersectedNode.getAttrs().containerId}`);
21431
- if (containerOfNode) {
21432
- container = intersectedNode;
21433
- measureContainer = containerOfNode;
21434
- }
21435
- }
21436
- if (typeof point === "undefined" && container?.getAttrs().nodeType !== "layer") relativeMousePointer = measureContainer?.getRelativePointerPosition() ?? relativeMousePointer;
21437
- if (typeof point === "undefined" && container?.getAttrs().nodeType === "layer") relativeMousePointer = measureContainer?.getRelativePointerPosition() ?? {
21438
- x: 0,
21439
- y: 0
21440
- };
21427
+ relativeMousePointer = containerAlt?.getRelativePointerPosition() ?? relativeMousePointer;
21441
21428
  if (utilityLayer) utilityLayer.visible(true);
21442
21429
  if (nodesSelection) nodesSelection.getTransformer().visible(true);
21443
- dummyRect.destroy();
21444
21430
  return {
21445
21431
  mousePoint: relativeMousePointer,
21446
- container,
21447
- measureContainer
21432
+ container: containerAlt,
21433
+ measureContainer: containerAlt
21448
21434
  };
21449
21435
  }
21450
21436
  getMousePointerRelativeToContainer(container) {
@@ -22033,7 +22019,7 @@ var WeaveRegisterManager = class {
22033
22019
 
22034
22020
  //#endregion
22035
22021
  //#region package.json
22036
- var version = "3.7.2";
22022
+ var version = "3.8.1-SNAPSHOT.191.1";
22037
22023
 
22038
22024
  //#endregion
22039
22025
  //#region src/managers/setup.ts
@@ -23473,13 +23459,12 @@ var Weave = class {
23473
23459
  this.moduleLogger.info("Start instance");
23474
23460
  if (!this.isServerSide()) {
23475
23461
  this.eventsController = new AbortController();
23476
- if (!window.weave) window.weave = this;
23462
+ window.weave = this;
23477
23463
  }
23478
23464
  this.emitEvent("onRoomLoaded", false);
23479
23465
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23480
23466
  this.emitEvent("onInstanceStatus", this.status);
23481
23467
  await this.registerManager.registerNodesHandlers();
23482
- this.augmentKonvaStageClass();
23483
23468
  this.augmentKonvaNodeClass();
23484
23469
  this.registerManager.registerPlugins();
23485
23470
  this.registerManager.registerActionsHandlers();
@@ -23551,9 +23536,6 @@ var Weave = class {
23551
23536
  getConfiguration() {
23552
23537
  return this.config;
23553
23538
  }
23554
- augmentKonvaStageClass() {
23555
- augmentKonvaStageClass();
23556
- }
23557
23539
  augmentKonvaNodeClass(config) {
23558
23540
  augmentKonvaNodeClass(config);
23559
23541
  }
@@ -24326,8 +24308,6 @@ const setupUpscaleStage = (instance, stage) => {
24326
24308
  var WeaveStageNode = class extends WeaveNode {
24327
24309
  nodeType = WEAVE_STAGE_NODE_TYPE;
24328
24310
  stageFocused = false;
24329
- wheelMousePressed = false;
24330
- isCmdCtrlPressed = false;
24331
24311
  globalEventsInitialized = false;
24332
24312
  initialize = void 0;
24333
24313
  onRender(props) {
@@ -24336,9 +24316,7 @@ var WeaveStageNode = class extends WeaveNode {
24336
24316
  mode: "default"
24337
24317
  });
24338
24318
  setupUpscaleStage(this.instance, stage);
24339
- this.wheelMousePressed = false;
24340
24319
  stage.isFocused = () => this.stageFocused;
24341
- stage.isMouseWheelPressed = () => this.wheelMousePressed;
24342
24320
  stage.position({
24343
24321
  x: 0,
24344
24322
  y: 0
@@ -24374,8 +24352,7 @@ var WeaveStageNode = class extends WeaveNode {
24374
24352
  };
24375
24353
  stage.handleMouseout = function() {};
24376
24354
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
24377
- stage.on("pointerdown", (e) => {
24378
- if (e.evt.button === 1) this.wheelMousePressed = true;
24355
+ stage.on("pointerdown", () => {
24379
24356
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
24380
24357
  });
24381
24358
  stage.on("pointermove", (e) => {
@@ -24389,9 +24366,8 @@ var WeaveStageNode = class extends WeaveNode {
24389
24366
  stage$1.container().style.cursor = "default";
24390
24367
  }
24391
24368
  });
24392
- stage.on("pointerup", (e) => {
24369
+ stage.on("pointerup", () => {
24393
24370
  const activeAction = this.instance.getActiveAction();
24394
- if (e.evt.button === 1) this.wheelMousePressed = false;
24395
24371
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) stage.container().style.cursor = "grab";
24396
24372
  });
24397
24373
  stage.on("pointerover", (e) => {
@@ -24403,7 +24379,6 @@ var WeaveStageNode = class extends WeaveNode {
24403
24379
  this.hideHoverState();
24404
24380
  if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24405
24381
  });
24406
- stage.isCmdCtrlPressed = () => this.isCmdCtrlPressed;
24407
24382
  this.setupEvents();
24408
24383
  return stage;
24409
24384
  }
@@ -24411,12 +24386,8 @@ var WeaveStageNode = class extends WeaveNode {
24411
24386
  setupEvents() {
24412
24387
  if (this.globalEventsInitialized) return;
24413
24388
  if (this.instance.isServerSide()) return;
24414
- window.addEventListener("blur", () => {
24415
- this.isCmdCtrlPressed = false;
24416
- }, { signal: this.instance.getEventsController()?.signal });
24417
24389
  window.addEventListener("keydown", (e) => {
24418
24390
  if (this.isOnlyCtrlOrMeta(e)) {
24419
- this.isCmdCtrlPressed = true;
24420
24391
  this.instance.getStage().container().style.cursor = "default";
24421
24392
  const transformer = this.getSelectionPlugin()?.getTransformer();
24422
24393
  if (!transformer) return;
@@ -24427,7 +24398,6 @@ var WeaveStageNode = class extends WeaveNode {
24427
24398
  }, { signal: this.instance.getEventsController()?.signal });
24428
24399
  window.addEventListener("keyup", (e) => {
24429
24400
  if (!(e.ctrlKey || e.metaKey)) {
24430
- this.isCmdCtrlPressed = false;
24431
24401
  this.instance.getStage().container().style.cursor = "default";
24432
24402
  const transformer = this.getSelectionPlugin()?.getTransformer();
24433
24403
  if (!transformer) return;
@@ -24480,7 +24450,6 @@ var WeaveLayerNode = class extends WeaveNode {
24480
24450
  delete cleanedAttrs.mutexUserId;
24481
24451
  delete cleanedAttrs.draggable;
24482
24452
  delete cleanedAttrs.overridesMouseControl;
24483
- delete cleanedAttrs.onMoveContainer;
24484
24453
  delete cleanedAttrs.dragBoundFunc;
24485
24454
  return {
24486
24455
  key: attrs.id ?? "",
@@ -24565,7 +24534,6 @@ var WeaveGroupNode = class extends WeaveNode {
24565
24534
  delete cleanedAttrs.mutexUserId;
24566
24535
  delete cleanedAttrs.draggable;
24567
24536
  delete cleanedAttrs.overridesMouseControl;
24568
- delete cleanedAttrs.onMoveContainer;
24569
24537
  delete cleanedAttrs.dragBoundFunc;
24570
24538
  return {
24571
24539
  key: attrs.id ?? "",
@@ -25108,28 +25076,12 @@ var WeaveTextNode = class extends WeaveNode {
25108
25076
  }
25109
25077
  initialize() {
25110
25078
  this.keyPressHandler = void 0;
25111
- this.eventsInitialized = false;
25112
- this.isCtrlMetaPressed = false;
25113
25079
  this.textAreaSuperContainer = null;
25114
25080
  this.textAreaContainer = null;
25115
25081
  this.textArea = null;
25116
25082
  this.editing = false;
25117
25083
  this.textArea = null;
25118
25084
  }
25119
- initEvents() {
25120
- if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
25121
- window.addEventListener("blur", () => {
25122
- this.isCtrlMetaPressed = false;
25123
- }, { signal: this.instance.getEventsController()?.signal });
25124
- window.addEventListener("keydown", (e) => {
25125
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
25126
- }, { signal: this.instance.getEventsController()?.signal });
25127
- window.addEventListener("keyup", (e) => {
25128
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
25129
- }, { signal: this.instance.getEventsController()?.signal });
25130
- this.eventsInitialized = true;
25131
- }
25132
- }
25133
25085
  updateNode(nodeInstance) {
25134
25086
  const actNode = this.instance.getStage().findOne(`#${nodeInstance.id()}`);
25135
25087
  if (actNode) {
@@ -25165,7 +25117,6 @@ var WeaveTextNode = class extends WeaveNode {
25165
25117
  }
25166
25118
  }
25167
25119
  onRender(props) {
25168
- this.initEvents();
25169
25120
  const text = new Konva.Text({
25170
25121
  ...props,
25171
25122
  name: "node",
@@ -25232,6 +25183,7 @@ var WeaveTextNode = class extends WeaveNode {
25232
25183
  text.setAttr("triggerEditMode", this.triggerEditMode.bind(this));
25233
25184
  let actualAnchor = void 0;
25234
25185
  text.on("transformstart", (e) => {
25186
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
25235
25187
  this.instance.emitEvent("onTransform", e.target);
25236
25188
  actualAnchor = this.getNodesSelectionPlugin()?.getTransformer()?.getActiveAnchor();
25237
25189
  if (text.getAttrs().layout === TEXT_LAYOUT.SMART && [
@@ -25239,7 +25191,7 @@ var WeaveTextNode = class extends WeaveNode {
25239
25191
  "top-right",
25240
25192
  "bottom-left",
25241
25193
  "bottom-right"
25242
- ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && this.isCtrlMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25194
+ ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && isCtrlOrMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25243
25195
  else this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(false);
25244
25196
  if ([TEXT_LAYOUT.AUTO_HEIGHT, TEXT_LAYOUT.SMART].includes(text.getAttrs().layout) && ["middle-right", "middle-left"].includes(actualAnchor ?? "")) {
25245
25197
  text.wrap("word");
@@ -25370,7 +25322,6 @@ var WeaveTextNode = class extends WeaveNode {
25370
25322
  delete cleanedAttrs.measureMultilineText;
25371
25323
  delete cleanedAttrs.overridesMouseControl;
25372
25324
  delete cleanedAttrs.shouldUpdateOnTransform;
25373
- delete cleanedAttrs.onMoveContainer;
25374
25325
  delete cleanedAttrs.dragBoundFunc;
25375
25326
  return {
25376
25327
  key: attrs.id ?? "",
@@ -25762,13 +25713,14 @@ const WEAVE_IMAGE_CROP_ANCHOR_POSITION = {
25762
25713
  ["BOTTOM_CENTER"]: "bottom-center"
25763
25714
  };
25764
25715
  const WEAVE_IMAGE_DEFAULT_CONFIG = {
25716
+ cleanup: { intervalMs: 60 * 1e3 },
25765
25717
  performance: { cache: { enabled: false } },
25766
25718
  style: {
25767
25719
  placeholder: { fill: "#aaaaaa" },
25768
25720
  cursor: { loading: "wait" }
25769
25721
  },
25770
25722
  imageLoading: {
25771
- maxRetryAttempts: 15,
25723
+ maxRetryAttempts: 3,
25772
25724
  retryDelayMs: 2e3
25773
25725
  },
25774
25726
  crossOrigin: "anonymous",
@@ -26151,7 +26103,8 @@ var WeaveImageCrop = class WeaveImageCrop {
26151
26103
  this.onClose();
26152
26104
  const utilityLayer = this.instance.getUtilityLayer();
26153
26105
  utilityLayer?.destroyChildren();
26154
- if (stage.isCmdCtrlPressed() && utilityLayer) {
26106
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
26107
+ if (isCtrlOrMetaPressed && utilityLayer) {
26155
26108
  this.node.renderCropMode(utilityLayer, this.image);
26156
26109
  utilityLayer.show();
26157
26110
  }
@@ -26460,6 +26413,25 @@ var WeaveImageNode = class extends WeaveNode {
26460
26413
  this.imageTryoutAttempts = {};
26461
26414
  this.imageFallback = {};
26462
26415
  }
26416
+ setupNotUsedImagesCleanup() {
26417
+ const cleanupHandler = () => {
26418
+ this.notUsedImagesCleanup = null;
26419
+ const stage = this.instance.getStage();
26420
+ const nodesIds = Object.keys(this.imageState);
26421
+ for (const nodeId of nodesIds) {
26422
+ const node = stage.findOne(`#${nodeId}`);
26423
+ if (!node) {
26424
+ delete this.imageSource[nodeId];
26425
+ delete this.imageState[nodeId];
26426
+ delete this.imageTryoutAttempts[nodeId];
26427
+ delete this.imageFallback[nodeId];
26428
+ }
26429
+ }
26430
+ this.setupNotUsedImagesCleanup();
26431
+ };
26432
+ const bindedCleanupHandler = cleanupHandler.bind(this);
26433
+ if (!this.notUsedImagesCleanup) setTimeout(bindedCleanupHandler, this.config.cleanup.intervalMs);
26434
+ }
26463
26435
  preloadCursors() {
26464
26436
  return new Promise((resolve) => {
26465
26437
  (async () => {
@@ -26536,6 +26508,7 @@ var WeaveImageNode = class extends WeaveNode {
26536
26508
  this.instance.resolveAsyncElement(nodeId, WEAVE_IMAGE_NODE_TYPE);
26537
26509
  }
26538
26510
  onRender(props) {
26511
+ this.setupNotUsedImagesCleanup();
26539
26512
  const imageProperties = props.imageProperties;
26540
26513
  const imageProps = props;
26541
26514
  const { id } = imageProps;
@@ -26561,11 +26534,6 @@ var WeaveImageNode = class extends WeaveNode {
26561
26534
  if (this.isSelecting() && selectedNodes.includes(image)) return "grab";
26562
26535
  return "pointer";
26563
26536
  };
26564
- image.movedToContainer = () => {
26565
- const stage = this.instance.getStage();
26566
- const image$1 = stage.findOne(`#${id}`);
26567
- if (!image$1) return;
26568
- };
26569
26537
  if (this.config.cropMode.enabled) {
26570
26538
  image.triggerCrop = () => {
26571
26539
  this.triggerCrop(image, { cmdCtrl: { triggered: false } });
@@ -26687,23 +26655,36 @@ var WeaveImageNode = class extends WeaveNode {
26687
26655
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26688
26656
  }
26689
26657
  });
26658
+ image.on("nodeDragStart", () => {
26659
+ const utilityLayer = this.instance.getUtilityLayer();
26660
+ if (!utilityLayer) return;
26661
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
26662
+ nodes.forEach((n) => {
26663
+ n.destroy();
26664
+ });
26665
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26666
+ if (!transformer) return;
26667
+ transformer.show();
26668
+ });
26690
26669
  if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26691
26670
  image.on("onCmdCtrlPressed", () => {
26671
+ const utilityLayer = this.instance.getUtilityLayer();
26672
+ if (!utilityLayer) return;
26673
+ if (image.isDragging()) return;
26692
26674
  const transformer = this.getSelectionPlugin()?.getTransformer();
26693
26675
  if (!transformer) return;
26694
26676
  transformer.hide();
26695
- const utilityLayer = this.instance.getUtilityLayer();
26696
- if (!utilityLayer) return;
26697
26677
  utilityLayer?.destroyChildren();
26698
26678
  this.renderCropMode(utilityLayer, image);
26699
26679
  utilityLayer?.show();
26700
26680
  });
26701
26681
  image.on("onCmdCtrlReleased", () => {
26682
+ const utilityLayer = this.instance.getUtilityLayer();
26683
+ if (!utilityLayer) return;
26684
+ if (image.isDragging()) return;
26702
26685
  const transformer = this.getSelectionPlugin()?.getTransformer();
26703
26686
  if (!transformer) return;
26704
26687
  transformer.show();
26705
- const utilityLayer = this.instance.getUtilityLayer();
26706
- if (!utilityLayer) return;
26707
26688
  utilityLayer?.destroyChildren();
26708
26689
  });
26709
26690
  }
@@ -26762,6 +26743,7 @@ var WeaveImageNode = class extends WeaveNode {
26762
26743
  fill: "transparent",
26763
26744
  strokeScaleEnabled: false,
26764
26745
  strokeWidth: 2,
26746
+ name: "cropMode",
26765
26747
  stroke: "#1a1aff",
26766
26748
  draggable: false,
26767
26749
  listening: false,
@@ -26822,6 +26804,7 @@ var WeaveImageNode = class extends WeaveNode {
26822
26804
  }));
26823
26805
  const anchor = new Konva.Rect({
26824
26806
  draggable: false,
26807
+ name: "cropMode",
26825
26808
  rotation: node.rotation()
26826
26809
  });
26827
26810
  this.config.cropMode.selection.anchorStyleFunc(anchor, position);
@@ -27262,20 +27245,15 @@ var WeaveImageNode = class extends WeaveNode {
27262
27245
  }
27263
27246
  onDestroy(nodeInstance) {
27264
27247
  const nodeId = nodeInstance.getAttrs().id ?? "";
27265
- const isMoveContainer = nodeInstance.getAttr("onMoveContainer");
27266
- nodeInstance.setAttr("onMoveContainer", void 0);
27267
27248
  const utilityLayer = this.instance.getUtilityLayer();
27268
- utilityLayer?.destroyChildren();
27249
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
27250
+ nodes.forEach((n) => {
27251
+ n.destroy();
27252
+ });
27269
27253
  if (this.imageTryoutIds[nodeId]) {
27270
27254
  clearTimeout(this.imageTryoutIds[nodeId]);
27271
27255
  delete this.imageTryoutIds[nodeId];
27272
27256
  }
27273
- if (!isMoveContainer) {
27274
- delete this.imageSource[nodeId];
27275
- delete this.imageState[nodeId];
27276
- delete this.imageTryoutAttempts[nodeId];
27277
- delete this.imageFallback[nodeId];
27278
- }
27279
27257
  nodeInstance.destroy();
27280
27258
  }
27281
27259
  };
@@ -27822,7 +27800,6 @@ var WeaveFrameNode = class extends WeaveNode {
27822
27800
  delete cleanedAttrs.draggable;
27823
27801
  delete cleanedAttrs.onTargetEnter;
27824
27802
  delete cleanedAttrs.overridesMouseControl;
27825
- delete cleanedAttrs.onMoveContainer;
27826
27803
  delete cleanedAttrs.dragBoundFunc;
27827
27804
  return {
27828
27805
  key: realAttrs?.id ?? "",
@@ -28061,7 +28038,6 @@ var WeaveStrokeNode = class extends WeaveNode {
28061
28038
  delete cleanedAttrs.sceneFunc;
28062
28039
  delete cleanedAttrs.hitFunc;
28063
28040
  delete cleanedAttrs.overridesMouseControl;
28064
- delete cleanedAttrs.onMoveContainer;
28065
28041
  delete cleanedAttrs.dragBoundFunc;
28066
28042
  return {
28067
28043
  key: attrs.id ?? "",
@@ -29606,6 +29582,7 @@ var WeaveVideoNode = class extends WeaveNode {
29606
29582
  const videoIconGroup = video.findOne(`#${id}-video-icon-group`);
29607
29583
  if (!videoPlaceholder || !videoIconGroup) return;
29608
29584
  const realVideoPlaceholderURL = this.config.urlTransformer?.(videoProps.videoPlaceholderURL ?? "", video) ?? videoProps.videoPlaceholderURL;
29585
+ if (!this.videoPlaceholder) this.initialize();
29609
29586
  this.videoPlaceholder[id] = Konva.Util.createImageElement();
29610
29587
  this.videoPlaceholder[id].crossOrigin = this.config.crossOrigin;
29611
29588
  this.videoPlaceholder[id].src = realVideoPlaceholderURL;
@@ -29870,16 +29847,16 @@ var WeaveVideoNode = class extends WeaveNode {
29870
29847
  }
29871
29848
  if (isServer()) this.instance.updateNode(this.serialize(videoGroup));
29872
29849
  const defaultHandleMouseover = videoGroup.handleMouseover;
29873
- videoGroup.handleMouseover = () => {
29874
- defaultHandleMouseover.call(this);
29850
+ videoGroup.handleMouseover = (e) => {
29851
+ defaultHandleMouseover.call(this, e);
29875
29852
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded) {
29876
29853
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29877
29854
  videoProgress?.show();
29878
29855
  }
29879
29856
  };
29880
29857
  const defaultHandleMouseout = videoGroup.handleMouseout;
29881
- videoGroup.handleMouseout = () => {
29882
- defaultHandleMouseout.call(this);
29858
+ videoGroup.handleMouseout = (e) => {
29859
+ defaultHandleMouseout.call(e, this);
29883
29860
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded && !this.videoState[id].paused) {
29884
29861
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29885
29862
  videoProgress?.hide();
@@ -31993,7 +31970,6 @@ var WeaveConnectorNode = class extends WeaveNode {
31993
31970
  delete cleanedAttrs.startInfoLoaded;
31994
31971
  delete cleanedAttrs.endInfoLoaded;
31995
31972
  delete cleanedAttrs.overridesMouseControl;
31996
- delete cleanedAttrs.onMoveContainer;
31997
31973
  delete cleanedAttrs.dragBoundFunc;
31998
31974
  return {
31999
31975
  key: attrs.id ?? "",
@@ -32149,7 +32125,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32149
32125
  this.zooming = false;
32150
32126
  this.isTrackpad = false;
32151
32127
  this.zoomVelocity = 0;
32152
- this.isCtrlOrMetaPressed = false;
32153
32128
  this.updatedMinimumZoom = false;
32154
32129
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
32155
32130
  this.actualScale = this.config.zoomSteps[this.actualStep];
@@ -32460,15 +32435,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32460
32435
  };
32461
32436
  }
32462
32437
  initEvents() {
32463
- window.addEventListener("blur", () => {
32464
- this.isCtrlOrMetaPressed = false;
32465
- }, { signal: this.instance.getEventsController()?.signal });
32466
- window.addEventListener("keydown", (e) => {
32467
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32468
- }, { signal: this.instance.getEventsController()?.signal });
32469
- window.addEventListener("keyup", (e) => {
32470
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32471
- }, { signal: this.instance.getEventsController()?.signal });
32472
32438
  const stage = this.instance.getStage();
32473
32439
  let lastCenter = null;
32474
32440
  let lastDist = 0;
@@ -32550,7 +32516,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32550
32516
  });
32551
32517
  let doZoom = false;
32552
32518
  const handleWheelImmediate = (e) => {
32553
- const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32519
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
32520
+ const performZoom = isCtrlOrMetaPressed || !isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32554
32521
  const mouseX = e.clientX;
32555
32522
  const mouseY = e.clientY;
32556
32523
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -34461,7 +34428,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34461
34428
  const dragProperties = this.instance.getDragProperties();
34462
34429
  if (dragProperties && dragId === WEAVE_IMAGE_TOOL_ACTION_NAME) {
34463
34430
  this.instance.getStage().setPointersPositions(e);
34464
- const position = getPositionRelativeToContainerOnPosition(this.instance);
34431
+ const position = this.instance.getStage().getRelativePointerPosition();
34465
34432
  if (!position) return;
34466
34433
  this.instance.triggerAction(WEAVE_IMAGE_TOOL_ACTION_NAME, {
34467
34434
  type: WEAVE_IMAGE_TOOL_UPLOAD_TYPE.IMAGE_URL,
@@ -34911,7 +34878,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34911
34878
  const dragProperties = this.instance.getDragProperties();
34912
34879
  if (dragProperties && dragId === WEAVE_IMAGES_TOOL_ACTION_NAME) {
34913
34880
  this.instance.getStage().setPointersPositions(e);
34914
- const position = getPositionRelativeToContainerOnPosition(this.instance);
34881
+ const position = this.instance.getStage().getRelativePointerPosition();
34915
34882
  if (!position) return;
34916
34883
  this.instance.triggerAction(WEAVE_IMAGES_TOOL_ACTION_NAME, {
34917
34884
  type: WEAVE_IMAGES_TOOL_UPLOAD_TYPE.IMAGE_URL,
@@ -37022,7 +36989,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
37022
36989
  const dragProperties = this.instance.getDragProperties();
37023
36990
  if (dragProperties && dragId === VIDEO_TOOL_ACTION_NAME) {
37024
36991
  this.instance.getStage().setPointersPositions(e);
37025
- const position = getPositionRelativeToContainerOnPosition(this.instance);
36992
+ const position = this.instance.getStage().getRelativePointerPosition();
37026
36993
  this.instance.triggerAction(VIDEO_TOOL_ACTION_NAME, {
37027
36994
  videoId: dragProperties.videoId,
37028
36995
  videoParams: dragProperties.videoParams,
@@ -38200,7 +38167,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38200
38167
  this.moveToolActive = false;
38201
38168
  this.isMouseLeftButtonPressed = false;
38202
38169
  this.isMouseMiddleButtonPressed = false;
38203
- this.isCtrlOrMetaPressed = false;
38204
38170
  this.isSpaceKeyPressed = false;
38205
38171
  this.previousPointer = null;
38206
38172
  this.currentPointer = null;
@@ -38229,11 +38195,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38229
38195
  }
38230
38196
  initEvents() {
38231
38197
  const stage = this.instance.getStage();
38232
- window.addEventListener("blur", () => {
38233
- this.isCtrlOrMetaPressed = false;
38234
- }, { signal: this.instance.getEventsController()?.signal });
38235
38198
  window.addEventListener("keydown", (e) => {
38236
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
38237
38199
  if (e.code === "Space") {
38238
38200
  this.getContextMenuPlugin()?.disable();
38239
38201
  this.getNodesSelectionPlugin()?.disable();
@@ -38244,7 +38206,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38244
38206
  }
38245
38207
  }, { signal: this.instance.getEventsController()?.signal });
38246
38208
  window.addEventListener("keyup", (e) => {
38247
- if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
38248
38209
  if (e.code === "Space") {
38249
38210
  this.getContextMenuPlugin()?.enable();
38250
38211
  this.getNodesSelectionPlugin()?.enable();
@@ -38311,7 +38272,8 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38311
38272
  this.cleanupEdgeMoveIntervals();
38312
38273
  });
38313
38274
  const handleWheel = (e) => {
38314
- const performPanning = !this.isCtrlOrMetaPressed && !e.ctrlKey;
38275
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
38276
+ const performPanning = !isCtrlOrMetaPressed && !e.ctrlKey;
38315
38277
  const mouseX = e.clientX;
38316
38278
  const mouseY = e.clientY;
38317
38279
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -38319,7 +38281,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38319
38281
  const shadowHost = getTopmostShadowHost(stage.container());
38320
38282
  if (shadowHost) elementUnderMouse = shadowHost.elementFromPoint(mouseX, mouseY);
38321
38283
  }
38322
- if (!this.enabled || this.isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38284
+ if (!this.enabled || isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38323
38285
  this.getContextMenuPlugin()?.cancelLongPressTimer();
38324
38286
  stage.x(stage.x() - e.deltaX);
38325
38287
  stage.y(stage.y() - e.deltaY);
@@ -38335,13 +38297,12 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38335
38297
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
38336
38298
  this.panEdgeTargets[e.target.getAttrs().id ?? ""] = e.target;
38337
38299
  if (this.stageScrollInterval !== void 0) return;
38300
+ const speed = this.config.edgePan.speed;
38338
38301
  this.stageScrollInterval = setInterval(() => {
38339
38302
  const pos = stage.getPointerPosition();
38340
- const offset = this.config.edgePanOffset;
38303
+ const offset = this.config.edgePan.offset;
38341
38304
  if (!pos) return;
38342
38305
  const { width, height } = stage.size();
38343
- const scale = stage.scaleX();
38344
- const speed = Math.max(this.config.edgePanMinSpeed, Math.min(this.config.edgePanMaxSpeed, this.config.edgePanSpeed / scale));
38345
38306
  let isNearLeft = false;
38346
38307
  let isNearRight = false;
38347
38308
  let isNearTop = false;
@@ -39351,7 +39312,11 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
39351
39312
  const presenceInfo = userPresence[nodeId];
39352
39313
  if (this.config.getUser().id === presenceInfo.userId) continue;
39353
39314
  const nodeInstance = stage.findOne(`#${presenceInfo.nodeId}`);
39354
- if (nodeInstance) {
39315
+ if (!nodeInstance) continue;
39316
+ let parentId = nodeInstance.getParent()?.id() ?? "";
39317
+ const parent = nodeInstance.getParent();
39318
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
39319
+ if (nodeInstance && presenceInfo.parentId === parentId) {
39355
39320
  const newProps = {
39356
39321
  ...nodeInstance.getAttrs(),
39357
39322
  ...presenceInfo.attrs
@@ -39366,10 +39331,11 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
39366
39331
  const store = this.instance.getStore();
39367
39332
  store.setAwarenessInfo(WEAVE_USER_PRESENCE_KEY, this.userPresence);
39368
39333
  }
39369
- setPresence(nodeId, attrs, forceUpdate = true) {
39334
+ setPresence(nodeId, parentId, attrs, forceUpdate = true) {
39370
39335
  const userInfo = this.config.getUser();
39371
39336
  this.userPresence[nodeId] = {
39372
39337
  userId: userInfo.id,
39338
+ parentId,
39373
39339
  nodeId,
39374
39340
  attrs
39375
39341
  };
@@ -40576,7 +40542,16 @@ var WeaveCommentsRendererPlugin = class extends WeavePlugin {
40576
40542
  //#endregion
40577
40543
  //#region src/plugins/stage-keyboard-move/constants.ts
40578
40544
  const WEAVE_STAGE_KEYBOARD_MOVE_KEY = "stageKeyboardMove";
40579
- const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40545
+ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = {
40546
+ movementDelta: 1,
40547
+ shiftMovementDelta: 10
40548
+ };
40549
+ const WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION = {
40550
+ ["UP"]: "up",
40551
+ ["DOWN"]: "down",
40552
+ ["LEFT"]: "left",
40553
+ ["RIGHT"]: "right"
40554
+ };
40580
40555
 
40581
40556
  //#endregion
40582
40557
  //#region src/plugins/stage-keyboard-move/stage-keyboard-move.ts
@@ -40591,25 +40566,31 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40591
40566
  getName() {
40592
40567
  return WEAVE_STAGE_KEYBOARD_MOVE_KEY;
40593
40568
  }
40594
- handleNodesMovement(movementOrientation) {
40569
+ handleNodesMovement(movementOrientation, { isShiftPressed }) {
40595
40570
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
40596
40571
  if (nodesSelectionPlugin) {
40597
40572
  const selectedNodes = nodesSelectionPlugin.getSelectedNodes();
40573
+ const movementDelta = isShiftPressed ? this.config.shiftMovementDelta : this.config.movementDelta;
40598
40574
  for (const node of selectedNodes) {
40599
40575
  switch (movementOrientation) {
40600
- case "up":
40601
- node.y(node.y() - this.config.movementDelta);
40576
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP:
40577
+ node.y(node.y() - movementDelta);
40602
40578
  break;
40603
- case "down":
40604
- node.y(node.y() + this.config.movementDelta);
40579
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN:
40580
+ node.y(node.y() + movementDelta);
40605
40581
  break;
40606
- case "left":
40607
- node.x(node.x() - this.config.movementDelta);
40582
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT:
40583
+ node.x(node.x() - movementDelta);
40608
40584
  break;
40609
- case "right":
40610
- node.x(node.x() + this.config.movementDelta);
40585
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT:
40586
+ node.x(node.x() + movementDelta);
40611
40587
  break;
40612
40588
  }
40589
+ this.instance.emitEvent("onNodeKeyboardMove", {
40590
+ node,
40591
+ orientation: movementOrientation,
40592
+ delta: movementDelta
40593
+ });
40613
40594
  const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
40614
40595
  if (!nodeHandler) break;
40615
40596
  this.instance.updateNode(nodeHandler.serialize(node));
@@ -40618,10 +40599,11 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40618
40599
  }
40619
40600
  onInit() {
40620
40601
  window.addEventListener("keydown", (e) => {
40621
- if (e.code === "ArrowUp" && e.shiftKey) this.handleNodesMovement("up");
40622
- if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40623
- if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40624
- if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40602
+ const isShiftPressed = e.shiftKey || e.code === "Shift";
40603
+ if (e.code === "ArrowUp") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP, { isShiftPressed });
40604
+ if (e.code === "ArrowLeft") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT, { isShiftPressed });
40605
+ if (e.code === "ArrowRight") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT, { isShiftPressed });
40606
+ if (e.code === "ArrowDown") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN, { isShiftPressed });
40625
40607
  }, { signal: this.instance.getEventsController()?.signal });
40626
40608
  }
40627
40609
  enable() {
@@ -40633,5 +40615,5 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40633
40615
  };
40634
40616
 
40635
40617
  //#endregion
40636
- export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
40618
+ export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
40637
40619
  //# sourceMappingURL=types.js.map