@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/sdk.node.js CHANGED
@@ -15101,6 +15101,9 @@ var WeaveStore = class {
15101
15101
  getStateJson() {
15102
15102
  return JSON.parse(JSON.stringify(this.state, void 0, 2));
15103
15103
  }
15104
+ getRoomId() {
15105
+ return this.roomId;
15106
+ }
15104
15107
  getStateSnapshot() {
15105
15108
  const doc = this.getDocument();
15106
15109
  return yjs_default.encodeStateAsUpdate(doc);
@@ -17675,19 +17678,20 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17675
17678
  node.rotation(nodeRotation);
17676
17679
  node.x(node.x() - (layerToMoveAttrs.containerOffsetX ?? 0));
17677
17680
  node.y(node.y() - (layerToMoveAttrs.containerOffsetY ?? 0));
17678
- node.movedToContainer(layerToMove);
17681
+ node.destroy();
17682
+ const newNode = node.clone();
17679
17683
  instance.emitEvent("onNodeMovedToContainer", {
17680
- node: node.clone(),
17684
+ node: newNode,
17681
17685
  container: layerToMove,
17682
17686
  originalNode,
17683
17687
  originalContainer
17684
17688
  });
17685
17689
  const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17686
17690
  if (nodeHandler) {
17687
- node.setAttrs({ onMoveContainer: true });
17688
- const actualNode = nodeHandler.serialize(node);
17689
- instance.removeNodeNT(actualNode, { emitUserChangeEvent: false });
17690
- instance.addNodeNT(actualNode, layerToMoveAttrs.id, {
17691
+ const actualNodeState = nodeHandler.serialize(node);
17692
+ const newNodeState = nodeHandler.serialize(newNode);
17693
+ instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17694
+ instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17691
17695
  emitUserChangeEvent: false,
17692
17696
  overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17693
17697
  });
@@ -17916,17 +17920,6 @@ function isIOS() {
17916
17920
  return /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
17917
17921
  }
17918
17922
  const isServer = () => typeof window === "undefined";
17919
- const getPositionRelativeToContainerOnPosition = (instance) => {
17920
- let position = instance.getStage().getRelativePointerPosition();
17921
- if (!position) return position;
17922
- const container = containerOverCursor(instance, [], position);
17923
- if (container) if (container.getAttrs().containerId) {
17924
- const containerNode = container.findOne(`#${container.getAttrs().containerId}`);
17925
- if (containerNode) position = containerNode?.getRelativePointerPosition();
17926
- } else position = container?.getRelativePointerPosition();
17927
- if (!position) return position;
17928
- return position;
17929
- };
17930
17923
  const canComposite = (node) => {
17931
17924
  const parent = node.getParent();
17932
17925
  return parent?.getClassName() === "Group" && parent?.getAttrs().nodeType !== "frame" && parent?.getAttrs().nodeId === void 0;
@@ -18607,12 +18600,10 @@ const WEAVE_GRID_LAYER_ID = "gridLayer";
18607
18600
  //#region src/plugins/stage-panning/constants.ts
18608
18601
  const WEAVE_STAGE_PANNING_KEY = "stagePanning";
18609
18602
  const WEAVE_STAGE_PANNING_THROTTLE_MS = 20;
18610
- const WEAVE_STAGE_PANNING_DEFAULT_CONFIG = {
18611
- edgePanOffset: 25,
18612
- edgePanMinSpeed: 2,
18613
- edgePanSpeed: 10,
18614
- edgePanMaxSpeed: 30
18615
- };
18603
+ const WEAVE_STAGE_PANNING_DEFAULT_CONFIG = { edgePan: {
18604
+ offset: 25,
18605
+ speed: 20
18606
+ } };
18616
18607
 
18617
18608
  //#endregion
18618
18609
  //#region src/plugins/nodes-multi-selection-feedback/constants.ts
@@ -18677,7 +18668,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18677
18668
  "bottom-right"
18678
18669
  ];
18679
18670
  this.taps = 0;
18680
- this.isCtrlMetaPressed = false;
18681
18671
  this.isSpaceKeyPressed = false;
18682
18672
  this.isDoubleTap = false;
18683
18673
  this.tapStart = null;
@@ -18777,12 +18767,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18777
18767
  }
18778
18768
  };
18779
18769
  stage.on("pointermove", (0, import_throttle.default)(handlePointerMoveInit, DEFAULT_THROTTLE_MS));
18780
- tr.on("transformstart", () => {
18770
+ tr.on("transformstart", (e) => {
18781
18771
  this.transformInProcess = true;
18782
18772
  this.triggerSelectedNodesEvent();
18783
18773
  const selectedNodes$1 = tr.nodes();
18784
18774
  for (const node of selectedNodes$1) {
18785
- node.handleMouseout();
18775
+ node.handleMouseout(e);
18786
18776
  if (node.getAttrs().strokeScaleEnabled !== false) {
18787
18777
  node.setAttr("strokeScaleEnabled", false);
18788
18778
  node.setAttr("_revertStrokeScaleEnabled", true);
@@ -18794,7 +18784,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18794
18784
  });
18795
18785
  });
18796
18786
  let nodeHovered = void 0;
18797
- tr.on("mousemove", () => {
18787
+ tr.on("mousemove", (e) => {
18798
18788
  if (this.dragInProcess) return;
18799
18789
  const pointerPos = stage.getPointerPosition();
18800
18790
  if (!pointerPos) return;
@@ -18804,13 +18794,13 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18804
18794
  if (shape) {
18805
18795
  const targetNode = this.instance.getInstanceRecursive(shape);
18806
18796
  if (targetNode && targetNode !== nodeHovered) {
18807
- this.instance.getStage().handleMouseover();
18808
- nodeHovered?.handleMouseout?.();
18809
- targetNode?.handleMouseover?.();
18797
+ this.instance.getStage().handleMouseover(e);
18798
+ nodeHovered?.handleMouseout?.(e);
18799
+ targetNode?.handleMouseover?.(e);
18810
18800
  nodeHovered = targetNode;
18811
18801
  }
18812
- targetNode?.handleMouseover?.();
18813
- } else nodeHovered?.handleMouseout?.();
18802
+ targetNode?.handleMouseover?.(e);
18803
+ } else nodeHovered?.handleMouseout?.(e);
18814
18804
  });
18815
18805
  tr.on("mouseover", () => {
18816
18806
  const nodesSelected = tr.nodes();
@@ -18819,32 +18809,37 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18819
18809
  stage.container().style.cursor = node.defineMousePointer() ?? "grab";
18820
18810
  } else stage.container().style.cursor = "grab";
18821
18811
  });
18822
- tr.on("mouseout", () => {
18823
- this.instance.getStage().handleMouseover?.();
18812
+ tr.on("mouseout", (e) => {
18813
+ this.instance.getStage().handleMouseover?.(e);
18824
18814
  nodeHovered = void 0;
18825
18815
  });
18826
- window.addEventListener("mouseout", () => {
18816
+ window.addEventListener("mouseout", (e) => {
18827
18817
  if (nodeHovered) {
18828
- nodeHovered.handleMouseout();
18818
+ nodeHovered.handleMouseout(e);
18829
18819
  nodeHovered = void 0;
18830
18820
  }
18831
- this.instance.getStage().handleMouseover?.();
18821
+ this.instance.getStage().handleMouseover?.(e);
18832
18822
  }, { signal: this.instance.getEventsController()?.signal });
18833
18823
  const handleTransform = (e) => {
18834
18824
  const moved = this.checkMoved(e);
18835
18825
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18836
18826
  this.triggerSelectedNodesEvent();
18837
18827
  if (this.getUsersPresencePlugin()) {
18838
- for (const node of tr.nodes()) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18839
- x: node.x(),
18840
- y: node.y(),
18841
- width: node.width(),
18842
- height: node.height(),
18843
- scaleX: node.scaleX(),
18844
- scaleY: node.scaleY(),
18845
- rotation: node.rotation(),
18846
- strokeScaleEnabled: false
18847
- }, false);
18828
+ for (const node of tr.nodes()) {
18829
+ let parentId = node.getParent()?.id() ?? "";
18830
+ const parent = node.getParent();
18831
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
18832
+ this.getUsersPresencePlugin()?.setPresence(node.id(), parentId, {
18833
+ x: node.x(),
18834
+ y: node.y(),
18835
+ width: node.width(),
18836
+ height: node.height(),
18837
+ scaleX: node.scaleX(),
18838
+ scaleY: node.scaleY(),
18839
+ rotation: node.rotation(),
18840
+ strokeScaleEnabled: false
18841
+ }, false);
18842
+ }
18848
18843
  this.getUsersPresencePlugin()?.forceSendPresence();
18849
18844
  }
18850
18845
  };
@@ -18868,6 +18863,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18868
18863
  let selectedNodes = [];
18869
18864
  tr.on("dragstart", (e) => {
18870
18865
  this.dragInProcess = true;
18866
+ let isWheelMousePressed = false;
18867
+ if (e.evt.button === 1) isWheelMousePressed = true;
18871
18868
  const mainLayer = this.instance.getMainLayer();
18872
18869
  if (!mainLayer) return;
18873
18870
  initialPos = {
@@ -18877,9 +18874,9 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18877
18874
  this.didMove = false;
18878
18875
  const stage$1 = this.instance.getStage();
18879
18876
  this.saveDragSelectedNodes();
18880
- if (this.getDragSelectedNodes().length > 1) this.setNodesOpacityOnDrag();
18877
+ this.setNodesOpacityOnDrag();
18881
18878
  selectedNodes = tr.nodes();
18882
- if (stage$1.isMouseWheelPressed()) {
18879
+ if (isWheelMousePressed) {
18883
18880
  e.cancelBubble = true;
18884
18881
  e.target.stopDrag();
18885
18882
  return;
@@ -18903,13 +18900,14 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18903
18900
  x: e.target.x(),
18904
18901
  y: e.target.y()
18905
18902
  };
18903
+ let isWheelMousePressed = false;
18904
+ if (e.evt.button === 1) isWheelMousePressed = true;
18906
18905
  e.cancelBubble = true;
18907
18906
  if (initialPos) {
18908
18907
  const moved = this.checkMovedDrag(initialPos, actualPos);
18909
18908
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18910
18909
  }
18911
- const stage$1 = this.instance.getStage();
18912
- if (stage$1.isMouseWheelPressed()) {
18910
+ if (isWheelMousePressed) {
18913
18911
  e.cancelBubble = true;
18914
18912
  e.target.stopDrag();
18915
18913
  return;
@@ -18929,10 +18927,15 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18929
18927
  clearContainerTargets(this.instance);
18930
18928
  const layerToMove = containerOverCursor(this.instance, selectedNodes);
18931
18929
  if (this.getUsersPresencePlugin() && this.dragInProcess) {
18932
- for (const node of selectedNodes) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18933
- x: node.x(),
18934
- y: node.y()
18935
- }, false);
18930
+ for (const node of selectedNodes) {
18931
+ let parentId = node.getParent()?.id() ?? "";
18932
+ const parent = node.getParent();
18933
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
18934
+ this.getUsersPresencePlugin()?.setPresence(node.id(), parentId, {
18935
+ x: node.x(),
18936
+ y: node.y()
18937
+ }, false);
18938
+ }
18936
18939
  this.getUsersPresencePlugin()?.forceSendPresence();
18937
18940
  }
18938
18941
  if (layerToMove && !selectionContainsFrames) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { bubbles: true });
@@ -18946,7 +18949,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18946
18949
  if (!mainLayer) return;
18947
18950
  this.instance.getSelectionLayer()?.hitGraphEnabled(true);
18948
18951
  this.instance.getMainLayer()?.hitGraphEnabled(true);
18949
- if (this.getDragSelectedNodes().length > 1) this.restoreNodesOpacityOnDrag();
18950
18952
  if (!this.didMove) return;
18951
18953
  if (selectedNodes.length > 1) this.instance.releaseMutexLock();
18952
18954
  e.cancelBubble = true;
@@ -19019,16 +19021,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19019
19021
  tr.forceUpdate();
19020
19022
  }
19021
19023
  });
19022
- this.instance.addEventListener("onRender", () => {
19023
- const point = stage.getPointerPosition();
19024
- if (point) {
19025
- const ele = this.instance.getTargetingManager().pointIntersectsElement(point);
19026
- if (ele) {
19027
- const realEle = this.instance.getTargetingManager().resolveNode(ele);
19028
- realEle?.handleMouseover();
19029
- }
19030
- }
19031
- });
19032
19024
  this.instance.addEventListener("onNodesChange", () => {
19033
19025
  const currentSelectedNodes = tr.nodes();
19034
19026
  const unselectedNodes = this.prevSelectedNodes.filter((node) => !currentSelectedNodes.map((node1) => node1.getAttrs().id).includes(node.getAttrs().id));
@@ -19235,12 +19227,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19235
19227
  initEvents() {
19236
19228
  this.selecting = false;
19237
19229
  const stage = this.instance.getStage();
19238
- window.addEventListener("blur", () => {
19239
- this.isCtrlMetaPressed = false;
19240
- this.isSpaceKeyPressed = false;
19241
- }, { signal: this.instance.getEventsController()?.signal });
19242
19230
  stage.container().addEventListener("keydown", (e) => {
19243
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
19244
19231
  if (e.code === "Space") this.isSpaceKeyPressed = true;
19245
19232
  if (e.code === "Backspace" || e.code === "Delete") {
19246
19233
  Promise.resolve().then(() => {
@@ -19250,7 +19237,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19250
19237
  }
19251
19238
  }, { signal: this.instance.getEventsController()?.signal });
19252
19239
  stage.container().addEventListener("keyup", (e) => {
19253
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
19254
19240
  if (e.code === "Space") this.isSpaceKeyPressed = false;
19255
19241
  }, { signal: this.instance.getEventsController()?.signal });
19256
19242
  stage.on("pointerdown", (e) => {
@@ -19302,7 +19288,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19302
19288
  this.selectionRectangle.width(0);
19303
19289
  this.selectionRectangle.height(0);
19304
19290
  this.selecting = true;
19305
- if (this.isCtrlMetaPressed) {
19291
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
19292
+ if (isCtrlOrMetaPressed) {
19306
19293
  const nodesSelected = this.tr.nodes();
19307
19294
  for (const node of nodesSelected) node.fire("onSelectionCleared", { bubbles: true });
19308
19295
  }
@@ -19522,7 +19509,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19522
19509
  nodeTargeted.dblClick();
19523
19510
  return;
19524
19511
  }
19525
- if (stage.isCmdCtrlPressed()) return;
19512
+ const isCtrlOrCmdPressed = e.evt.ctrlKey || e.evt.metaKey;
19513
+ if (isCtrlOrCmdPressed) return;
19526
19514
  if (!metaPressed) {
19527
19515
  this.tr.nodes([nodeTargeted]);
19528
19516
  this.tr.show();
@@ -19699,11 +19687,18 @@ const COPY_PASTE_NODES_PLUGIN_STATE = {
19699
19687
  ["IDLE"]: "idle",
19700
19688
  ["PASTING"]: "pasting"
19701
19689
  };
19702
- const WEAVE_COPY_PASTE_CONFIG_DEFAULT = { paddingOnPaste: {
19703
- enabled: false,
19704
- paddingX: 0,
19705
- paddingY: 0
19706
- } };
19690
+ const WEAVE_COPY_PASTE_CONFIG_DEFAULT = {
19691
+ canPasteOnto: (node, atTarget) => {
19692
+ const targetType = atTarget.getAttrs().nodeType;
19693
+ if (targetType === "frame" && node.type === "frame") return false;
19694
+ return true;
19695
+ },
19696
+ paddingOnPaste: {
19697
+ enabled: false,
19698
+ paddingX: 0,
19699
+ paddingY: 0
19700
+ }
19701
+ };
19707
19702
 
19708
19703
  //#endregion
19709
19704
  //#region src/plugins/copy-paste-nodes/copy-paste-nodes.ts
@@ -19930,6 +19925,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19930
19925
  }
19931
19926
  };
19932
19927
  this.instance.addEventListener("onNodeRenderedAdded", handleOnNodeAdded);
19928
+ const nodesToPaste = [];
19933
19929
  for (const element of Object.keys(this.toPaste.weave)) {
19934
19930
  const node = this.toPaste.weave[element].element;
19935
19931
  const posRelativeToSelection = this.toPaste.weave[element].posRelativeToSelection;
@@ -19970,12 +19966,22 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19970
19966
  containerId = this.instance.getMainLayer()?.getAttrs().id ?? "";
19971
19967
  containerNode = this.instance.getMainLayer();
19972
19968
  }
19973
- if (containerId) {
19969
+ const canPasteNodeOntoTarget = this.config.canPasteOnto(node, containerNode);
19970
+ if (!canPasteNodeOntoTarget) throw new Error(`Cannot paste node ${node.key} onto target container: ${containerId}`, { cause: "InvalidPasteTarget" });
19971
+ if (containerId && canPasteNodeOntoTarget) {
19974
19972
  nodesToSelect.push(newNodeId);
19975
- this.instance.addNodeNT(node, containerId);
19973
+ nodesToPaste.push({
19974
+ node,
19975
+ containerId
19976
+ });
19976
19977
  }
19977
19978
  this.getStageGridPlugin()?.onRender();
19978
19979
  }
19980
+ for (const elementToPaste of nodesToPaste) {
19981
+ const { node, containerId } = elementToPaste;
19982
+ this.instance.addNodeNT(node, containerId);
19983
+ this.getStageGridPlugin()?.onRender();
19984
+ }
19979
19985
  });
19980
19986
  }
19981
19987
  async finishHandleCopy() {
@@ -20067,6 +20073,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
20067
20073
  }
20068
20074
  } catch (ex) {
20069
20075
  this.instance.emitEvent("onPaste", { error: ex });
20076
+ if (ex instanceof Error && ex.cause === "InvalidPasteTarget") return;
20070
20077
  }
20071
20078
  try {
20072
20079
  const items = await navigator.clipboard.read();
@@ -20164,11 +20171,6 @@ const MOVE_TOOL_STATE = {
20164
20171
 
20165
20172
  //#endregion
20166
20173
  //#region src/nodes/node.ts
20167
- const augmentKonvaStageClass = () => {
20168
- Konva.Stage.prototype.isMouseWheelPressed = function() {
20169
- return false;
20170
- };
20171
- };
20172
20174
  const augmentKonvaNodeClass = (config) => {
20173
20175
  const { transform } = config ?? {};
20174
20176
  Konva.Node.prototype.getTransformerProperties = function() {
@@ -20180,7 +20182,6 @@ const augmentKonvaNodeClass = (config) => {
20180
20182
  Konva.Node.prototype.getRealClientRect = function(config$1) {
20181
20183
  return this.getClientRect(config$1);
20182
20184
  };
20183
- Konva.Node.prototype.movedToContainer = function() {};
20184
20185
  Konva.Node.prototype.updatePosition = function() {};
20185
20186
  Konva.Node.prototype.triggerCrop = function() {};
20186
20187
  Konva.Node.prototype.closeCrop = function() {};
@@ -20230,7 +20231,6 @@ var WeaveNode = class {
20230
20231
  "bottom-right"
20231
20232
  ];
20232
20233
  };
20233
- node.movedToContainer = function() {};
20234
20234
  node.updatePosition = function() {};
20235
20235
  node.resetCrop = function() {};
20236
20236
  node.handleMouseover = function() {};
@@ -20419,7 +20419,10 @@ var WeaveNode = class {
20419
20419
  const nodesEdgeSnappingPlugin = this.getNodesEdgeSnappingPlugin();
20420
20420
  if (nodesSelectionPlugin && this.isSelecting() && this.isNodeSelected(node$1)) nodesSelectionPlugin.getTransformer().forceUpdate();
20421
20421
  if (nodesEdgeSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesEdgeSnappingPlugin.evaluateGuidelines(e);
20422
- this.getUsersPresencePlugin()?.setPresence(node$1.id(), {
20422
+ let parentId = node$1.getParent()?.id() ?? "";
20423
+ const parent = node$1.getParent();
20424
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
20425
+ this.getUsersPresencePlugin()?.setPresence(node$1.id(), parentId, {
20423
20426
  x: node$1.x(),
20424
20427
  y: node$1.y(),
20425
20428
  width: node$1.width(),
@@ -20475,10 +20478,9 @@ var WeaveNode = class {
20475
20478
  node.off("dragstart");
20476
20479
  node.on("dragstart", (e) => {
20477
20480
  const nodeTarget = e.target;
20478
- e.cancelBubble = true;
20481
+ let isWheelMousePressed = false;
20482
+ if (e.evt.button === 1) isWheelMousePressed = true;
20479
20483
  this.getNodesSelectionFeedbackPlugin()?.hideSelectionHalo(nodeTarget);
20480
- this.getSelectionPlugin()?.saveDragSelectedNodes();
20481
- if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.setNodesOpacityOnDrag();
20482
20484
  const canMove = nodeTarget?.canDrag() ?? false;
20483
20485
  if (!canMove) {
20484
20486
  nodeTarget.stopDrag();
@@ -20495,7 +20497,7 @@ var WeaveNode = class {
20495
20497
  return;
20496
20498
  }
20497
20499
  this.instance.emitEvent("onDrag", nodeTarget);
20498
- if (stage.isMouseWheelPressed()) {
20500
+ if (isWheelMousePressed) {
20499
20501
  e.cancelBubble = true;
20500
20502
  nodeTarget.stopDrag();
20501
20503
  }
@@ -20512,6 +20514,7 @@ var WeaveNode = class {
20512
20514
  originalNode = realNodeTarget.clone();
20513
20515
  originalContainer = realNodeTarget.getParent();
20514
20516
  if (originalContainer?.getAttrs().nodeId) originalContainer = stage.findOne(`#${originalContainer.getAttrs().nodeId}`);
20517
+ realNodeTarget.fire("nodeDragStart", { node: realNodeTarget });
20515
20518
  if (e.evt?.altKey) {
20516
20519
  nodeTarget.setAttrs({ isCloneOrigin: true });
20517
20520
  nodeTarget.setAttrs({ isCloned: false });
@@ -20540,19 +20543,20 @@ var WeaveNode = class {
20540
20543
  });
20541
20544
  const handleDragMove = (e) => {
20542
20545
  const nodeTarget = e.target;
20546
+ let isWheelMousePressed = false;
20547
+ if (e.evt.button === 1) isWheelMousePressed = true;
20543
20548
  e.cancelBubble = true;
20544
20549
  if (e.evt?.buttons === 0) {
20545
20550
  nodeTarget.stopDrag();
20546
20551
  return;
20547
20552
  }
20548
20553
  this.didMove = true;
20549
- const stage$1 = this.instance.getStage();
20550
20554
  const isErasing = this.instance.getActiveAction() === "eraseTool";
20551
20555
  if (isErasing) {
20552
20556
  nodeTarget.stopDrag();
20553
20557
  return;
20554
20558
  }
20555
- if (stage$1.isMouseWheelPressed()) {
20559
+ if (isWheelMousePressed) {
20556
20560
  e.cancelBubble = true;
20557
20561
  nodeTarget.stopDrag();
20558
20562
  return;
@@ -20567,7 +20571,10 @@ var WeaveNode = class {
20567
20571
  }
20568
20572
  if (this.isSelecting() && this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
20569
20573
  clearContainerTargets(this.instance);
20570
- this.getUsersPresencePlugin()?.setPresence(realNodeTarget.id(), {
20574
+ let parentId = realNodeTarget.getParent()?.id() ?? "";
20575
+ const parent = realNodeTarget.getParent();
20576
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
20577
+ this.getUsersPresencePlugin()?.setPresence(realNodeTarget.id(), parentId, {
20571
20578
  x: realNodeTarget.x(),
20572
20579
  y: realNodeTarget.y()
20573
20580
  });
@@ -20602,7 +20609,7 @@ var WeaveNode = class {
20602
20609
  startPosition = null;
20603
20610
  lockedAxis = null;
20604
20611
  isShiftPressed = false;
20605
- if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.restoreNodesOpacityOnDrag();
20612
+ this.getSelectionPlugin()?.restoreNodesOpacityOnDrag();
20606
20613
  if (this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
20607
20614
  this.instance.releaseMutexLock();
20608
20615
  this.getNodesSelectionFeedbackPlugin()?.showSelectionHalo(nodeTarget);
@@ -20666,11 +20673,11 @@ var WeaveNode = class {
20666
20673
  originalPosition = realNodeTarget.getAbsolutePosition();
20667
20674
  });
20668
20675
  if (!node.getAttrs().overridesMouseControl) {
20669
- node.handleMouseover = () => {
20670
- this.handleMouseOver(node);
20676
+ node.handleMouseover = (e) => {
20677
+ this.handleMouseOver(e, node);
20671
20678
  };
20672
- node.handleMouseout = () => {
20673
- this.handleMouseout(node);
20679
+ node.handleMouseout = (e) => {
20680
+ this.handleMouseout(e, node);
20674
20681
  };
20675
20682
  }
20676
20683
  node.on("xChange yChange", () => {
@@ -20698,20 +20705,21 @@ var WeaveNode = class {
20698
20705
  };
20699
20706
  node.on("pointerover", (e) => {
20700
20707
  const realNodeTarget = this.getRealSelectedNode(e.target);
20701
- realNodeTarget?.handleMouseover?.();
20702
- const doCancelBubble = this.handleMouseOver(e.target);
20708
+ realNodeTarget?.handleMouseover?.(e);
20709
+ const doCancelBubble = this.handleMouseOver(e, e.target);
20703
20710
  if (doCancelBubble) e.cancelBubble = true;
20704
20711
  });
20705
20712
  node.on("pointerleave", (e) => {
20706
20713
  const realNodeTarget = this.getRealSelectedNode(e.target);
20707
- realNodeTarget?.handleMouseout?.();
20708
- this.handleMouseout(e.target);
20714
+ realNodeTarget?.handleMouseout?.(e);
20715
+ this.handleMouseout(e, e.target);
20709
20716
  });
20710
20717
  }
20711
20718
  }
20712
- handleMouseOver(node) {
20719
+ handleMouseOver(e, node) {
20713
20720
  const stage = this.instance.getStage();
20714
- if (stage?.isCmdCtrlPressed?.()) return false;
20721
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20722
+ if (isCtrlOrMetaPressed) return false;
20715
20723
  const user = this.instance.getStore().getUser();
20716
20724
  const activeAction = this.instance.getActiveAction();
20717
20725
  const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
@@ -20745,9 +20753,9 @@ var WeaveNode = class {
20745
20753
  else this.hideHoverState();
20746
20754
  return cancelBubble;
20747
20755
  }
20748
- handleMouseout(node) {
20749
- const stage = this.instance.getStage();
20750
- if (stage?.isCmdCtrlPressed?.()) return;
20756
+ handleMouseout(e, node) {
20757
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20758
+ if (isCtrlOrMetaPressed) return;
20751
20759
  const realNode = this.instance.getInstanceRecursive(node);
20752
20760
  if (realNode) this.hideHoverState();
20753
20761
  }
@@ -20779,7 +20787,6 @@ var WeaveNode = class {
20779
20787
  delete cleanedAttrs.mutexUserId;
20780
20788
  delete cleanedAttrs.draggable;
20781
20789
  delete cleanedAttrs.overridesMouseControl;
20782
- delete cleanedAttrs.onMoveContainer;
20783
20790
  delete cleanedAttrs.dragBoundFunc;
20784
20791
  return {
20785
20792
  key: attrs.id ?? "",
@@ -21394,45 +21401,24 @@ var WeaveTargetingManager = class {
21394
21401
  }
21395
21402
  getMousePointer(point) {
21396
21403
  this.logger.debug({ point }, "getMousePointer");
21397
- const stage = this.instance.getStage();
21398
21404
  const mainLayer = this.instance.getMainLayer();
21399
21405
  let relativeMousePointer = typeof point !== "undefined" ? point : mainLayer?.getRelativePointerPosition() ?? {
21400
21406
  x: 0,
21401
21407
  y: 0
21402
21408
  };
21403
- let measureContainer = mainLayer;
21404
- let container = mainLayer;
21405
21409
  const utilityLayer = this.instance.getUtilityLayer();
21406
21410
  if (utilityLayer) utilityLayer.visible(false);
21411
+ let containerAlt = containerOverCursor(this.instance, [], relativeMousePointer);
21412
+ if (!containerAlt) containerAlt = this.instance.getMainLayer();
21407
21413
  const nodesSelection = this.instance.getPlugin("nodesSelection");
21408
21414
  if (nodesSelection) nodesSelection.getTransformer().visible(false);
21409
- const dummyRect = new Konva.Rect({
21410
- width: 10,
21411
- height: 10,
21412
- x: relativeMousePointer.x,
21413
- y: relativeMousePointer.y
21414
- });
21415
- mainLayer?.add(dummyRect);
21416
- const intersectedNode = this.nodeIntersectsContainerElement(dummyRect);
21417
- if (intersectedNode) {
21418
- const containerOfNode = stage.findOne(`#${intersectedNode.getAttrs().containerId}`);
21419
- if (containerOfNode) {
21420
- container = intersectedNode;
21421
- measureContainer = containerOfNode;
21422
- }
21423
- }
21424
- if (typeof point === "undefined" && container?.getAttrs().nodeType !== "layer") relativeMousePointer = measureContainer?.getRelativePointerPosition() ?? relativeMousePointer;
21425
- if (typeof point === "undefined" && container?.getAttrs().nodeType === "layer") relativeMousePointer = measureContainer?.getRelativePointerPosition() ?? {
21426
- x: 0,
21427
- y: 0
21428
- };
21415
+ relativeMousePointer = containerAlt?.getRelativePointerPosition() ?? relativeMousePointer;
21429
21416
  if (utilityLayer) utilityLayer.visible(true);
21430
21417
  if (nodesSelection) nodesSelection.getTransformer().visible(true);
21431
- dummyRect.destroy();
21432
21418
  return {
21433
21419
  mousePoint: relativeMousePointer,
21434
- container,
21435
- measureContainer
21420
+ container: containerAlt,
21421
+ measureContainer: containerAlt
21436
21422
  };
21437
21423
  }
21438
21424
  getMousePointerRelativeToContainer(container) {
@@ -22021,7 +22007,7 @@ var WeaveRegisterManager = class {
22021
22007
 
22022
22008
  //#endregion
22023
22009
  //#region package.json
22024
- var version = "3.7.2";
22010
+ var version = "3.8.1-SNAPSHOT.191.1";
22025
22011
 
22026
22012
  //#endregion
22027
22013
  //#region src/managers/setup.ts
@@ -23461,13 +23447,12 @@ var Weave = class {
23461
23447
  this.moduleLogger.info("Start instance");
23462
23448
  if (!this.isServerSide()) {
23463
23449
  this.eventsController = new AbortController();
23464
- if (!window.weave) window.weave = this;
23450
+ window.weave = this;
23465
23451
  }
23466
23452
  this.emitEvent("onRoomLoaded", false);
23467
23453
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23468
23454
  this.emitEvent("onInstanceStatus", this.status);
23469
23455
  await this.registerManager.registerNodesHandlers();
23470
- this.augmentKonvaStageClass();
23471
23456
  this.augmentKonvaNodeClass();
23472
23457
  this.registerManager.registerPlugins();
23473
23458
  this.registerManager.registerActionsHandlers();
@@ -23539,9 +23524,6 @@ var Weave = class {
23539
23524
  getConfiguration() {
23540
23525
  return this.config;
23541
23526
  }
23542
- augmentKonvaStageClass() {
23543
- augmentKonvaStageClass();
23544
- }
23545
23527
  augmentKonvaNodeClass(config) {
23546
23528
  augmentKonvaNodeClass(config);
23547
23529
  }
@@ -24314,8 +24296,6 @@ const setupUpscaleStage = (instance, stage) => {
24314
24296
  var WeaveStageNode = class extends WeaveNode {
24315
24297
  nodeType = WEAVE_STAGE_NODE_TYPE;
24316
24298
  stageFocused = false;
24317
- wheelMousePressed = false;
24318
- isCmdCtrlPressed = false;
24319
24299
  globalEventsInitialized = false;
24320
24300
  initialize = void 0;
24321
24301
  onRender(props) {
@@ -24324,9 +24304,7 @@ var WeaveStageNode = class extends WeaveNode {
24324
24304
  mode: "default"
24325
24305
  });
24326
24306
  setupUpscaleStage(this.instance, stage);
24327
- this.wheelMousePressed = false;
24328
24307
  stage.isFocused = () => this.stageFocused;
24329
- stage.isMouseWheelPressed = () => this.wheelMousePressed;
24330
24308
  stage.position({
24331
24309
  x: 0,
24332
24310
  y: 0
@@ -24362,8 +24340,7 @@ var WeaveStageNode = class extends WeaveNode {
24362
24340
  };
24363
24341
  stage.handleMouseout = function() {};
24364
24342
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
24365
- stage.on("pointerdown", (e) => {
24366
- if (e.evt.button === 1) this.wheelMousePressed = true;
24343
+ stage.on("pointerdown", () => {
24367
24344
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
24368
24345
  });
24369
24346
  stage.on("pointermove", (e) => {
@@ -24377,9 +24354,8 @@ var WeaveStageNode = class extends WeaveNode {
24377
24354
  stage$1.container().style.cursor = "default";
24378
24355
  }
24379
24356
  });
24380
- stage.on("pointerup", (e) => {
24357
+ stage.on("pointerup", () => {
24381
24358
  const activeAction = this.instance.getActiveAction();
24382
- if (e.evt.button === 1) this.wheelMousePressed = false;
24383
24359
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) stage.container().style.cursor = "grab";
24384
24360
  });
24385
24361
  stage.on("pointerover", (e) => {
@@ -24391,7 +24367,6 @@ var WeaveStageNode = class extends WeaveNode {
24391
24367
  this.hideHoverState();
24392
24368
  if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24393
24369
  });
24394
- stage.isCmdCtrlPressed = () => this.isCmdCtrlPressed;
24395
24370
  this.setupEvents();
24396
24371
  return stage;
24397
24372
  }
@@ -24399,12 +24374,8 @@ var WeaveStageNode = class extends WeaveNode {
24399
24374
  setupEvents() {
24400
24375
  if (this.globalEventsInitialized) return;
24401
24376
  if (this.instance.isServerSide()) return;
24402
- window.addEventListener("blur", () => {
24403
- this.isCmdCtrlPressed = false;
24404
- }, { signal: this.instance.getEventsController()?.signal });
24405
24377
  window.addEventListener("keydown", (e) => {
24406
24378
  if (this.isOnlyCtrlOrMeta(e)) {
24407
- this.isCmdCtrlPressed = true;
24408
24379
  this.instance.getStage().container().style.cursor = "default";
24409
24380
  const transformer = this.getSelectionPlugin()?.getTransformer();
24410
24381
  if (!transformer) return;
@@ -24415,7 +24386,6 @@ var WeaveStageNode = class extends WeaveNode {
24415
24386
  }, { signal: this.instance.getEventsController()?.signal });
24416
24387
  window.addEventListener("keyup", (e) => {
24417
24388
  if (!(e.ctrlKey || e.metaKey)) {
24418
- this.isCmdCtrlPressed = false;
24419
24389
  this.instance.getStage().container().style.cursor = "default";
24420
24390
  const transformer = this.getSelectionPlugin()?.getTransformer();
24421
24391
  if (!transformer) return;
@@ -24468,7 +24438,6 @@ var WeaveLayerNode = class extends WeaveNode {
24468
24438
  delete cleanedAttrs.mutexUserId;
24469
24439
  delete cleanedAttrs.draggable;
24470
24440
  delete cleanedAttrs.overridesMouseControl;
24471
- delete cleanedAttrs.onMoveContainer;
24472
24441
  delete cleanedAttrs.dragBoundFunc;
24473
24442
  return {
24474
24443
  key: attrs.id ?? "",
@@ -24553,7 +24522,6 @@ var WeaveGroupNode = class extends WeaveNode {
24553
24522
  delete cleanedAttrs.mutexUserId;
24554
24523
  delete cleanedAttrs.draggable;
24555
24524
  delete cleanedAttrs.overridesMouseControl;
24556
- delete cleanedAttrs.onMoveContainer;
24557
24525
  delete cleanedAttrs.dragBoundFunc;
24558
24526
  return {
24559
24527
  key: attrs.id ?? "",
@@ -25096,28 +25064,12 @@ var WeaveTextNode = class extends WeaveNode {
25096
25064
  }
25097
25065
  initialize() {
25098
25066
  this.keyPressHandler = void 0;
25099
- this.eventsInitialized = false;
25100
- this.isCtrlMetaPressed = false;
25101
25067
  this.textAreaSuperContainer = null;
25102
25068
  this.textAreaContainer = null;
25103
25069
  this.textArea = null;
25104
25070
  this.editing = false;
25105
25071
  this.textArea = null;
25106
25072
  }
25107
- initEvents() {
25108
- if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
25109
- window.addEventListener("blur", () => {
25110
- this.isCtrlMetaPressed = false;
25111
- }, { signal: this.instance.getEventsController()?.signal });
25112
- window.addEventListener("keydown", (e) => {
25113
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
25114
- }, { signal: this.instance.getEventsController()?.signal });
25115
- window.addEventListener("keyup", (e) => {
25116
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
25117
- }, { signal: this.instance.getEventsController()?.signal });
25118
- this.eventsInitialized = true;
25119
- }
25120
- }
25121
25073
  updateNode(nodeInstance) {
25122
25074
  const actNode = this.instance.getStage().findOne(`#${nodeInstance.id()}`);
25123
25075
  if (actNode) {
@@ -25153,7 +25105,6 @@ var WeaveTextNode = class extends WeaveNode {
25153
25105
  }
25154
25106
  }
25155
25107
  onRender(props) {
25156
- this.initEvents();
25157
25108
  const text = new Konva.Text({
25158
25109
  ...props,
25159
25110
  name: "node",
@@ -25220,6 +25171,7 @@ var WeaveTextNode = class extends WeaveNode {
25220
25171
  text.setAttr("triggerEditMode", this.triggerEditMode.bind(this));
25221
25172
  let actualAnchor = void 0;
25222
25173
  text.on("transformstart", (e) => {
25174
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
25223
25175
  this.instance.emitEvent("onTransform", e.target);
25224
25176
  actualAnchor = this.getNodesSelectionPlugin()?.getTransformer()?.getActiveAnchor();
25225
25177
  if (text.getAttrs().layout === TEXT_LAYOUT.SMART && [
@@ -25227,7 +25179,7 @@ var WeaveTextNode = class extends WeaveNode {
25227
25179
  "top-right",
25228
25180
  "bottom-left",
25229
25181
  "bottom-right"
25230
- ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && this.isCtrlMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25182
+ ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && isCtrlOrMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25231
25183
  else this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(false);
25232
25184
  if ([TEXT_LAYOUT.AUTO_HEIGHT, TEXT_LAYOUT.SMART].includes(text.getAttrs().layout) && ["middle-right", "middle-left"].includes(actualAnchor ?? "")) {
25233
25185
  text.wrap("word");
@@ -25358,7 +25310,6 @@ var WeaveTextNode = class extends WeaveNode {
25358
25310
  delete cleanedAttrs.measureMultilineText;
25359
25311
  delete cleanedAttrs.overridesMouseControl;
25360
25312
  delete cleanedAttrs.shouldUpdateOnTransform;
25361
- delete cleanedAttrs.onMoveContainer;
25362
25313
  delete cleanedAttrs.dragBoundFunc;
25363
25314
  return {
25364
25315
  key: attrs.id ?? "",
@@ -25750,13 +25701,14 @@ const WEAVE_IMAGE_CROP_ANCHOR_POSITION = {
25750
25701
  ["BOTTOM_CENTER"]: "bottom-center"
25751
25702
  };
25752
25703
  const WEAVE_IMAGE_DEFAULT_CONFIG = {
25704
+ cleanup: { intervalMs: 60 * 1e3 },
25753
25705
  performance: { cache: { enabled: false } },
25754
25706
  style: {
25755
25707
  placeholder: { fill: "#aaaaaa" },
25756
25708
  cursor: { loading: "wait" }
25757
25709
  },
25758
25710
  imageLoading: {
25759
- maxRetryAttempts: 15,
25711
+ maxRetryAttempts: 3,
25760
25712
  retryDelayMs: 2e3
25761
25713
  },
25762
25714
  crossOrigin: "anonymous",
@@ -26139,7 +26091,8 @@ var WeaveImageCrop = class WeaveImageCrop {
26139
26091
  this.onClose();
26140
26092
  const utilityLayer = this.instance.getUtilityLayer();
26141
26093
  utilityLayer?.destroyChildren();
26142
- if (stage.isCmdCtrlPressed() && utilityLayer) {
26094
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
26095
+ if (isCtrlOrMetaPressed && utilityLayer) {
26143
26096
  this.node.renderCropMode(utilityLayer, this.image);
26144
26097
  utilityLayer.show();
26145
26098
  }
@@ -26448,6 +26401,25 @@ var WeaveImageNode = class extends WeaveNode {
26448
26401
  this.imageTryoutAttempts = {};
26449
26402
  this.imageFallback = {};
26450
26403
  }
26404
+ setupNotUsedImagesCleanup() {
26405
+ const cleanupHandler = () => {
26406
+ this.notUsedImagesCleanup = null;
26407
+ const stage = this.instance.getStage();
26408
+ const nodesIds = Object.keys(this.imageState);
26409
+ for (const nodeId of nodesIds) {
26410
+ const node = stage.findOne(`#${nodeId}`);
26411
+ if (!node) {
26412
+ delete this.imageSource[nodeId];
26413
+ delete this.imageState[nodeId];
26414
+ delete this.imageTryoutAttempts[nodeId];
26415
+ delete this.imageFallback[nodeId];
26416
+ }
26417
+ }
26418
+ this.setupNotUsedImagesCleanup();
26419
+ };
26420
+ const bindedCleanupHandler = cleanupHandler.bind(this);
26421
+ if (!this.notUsedImagesCleanup) setTimeout(bindedCleanupHandler, this.config.cleanup.intervalMs);
26422
+ }
26451
26423
  preloadCursors() {
26452
26424
  return new Promise((resolve) => {
26453
26425
  (async () => {
@@ -26524,6 +26496,7 @@ var WeaveImageNode = class extends WeaveNode {
26524
26496
  this.instance.resolveAsyncElement(nodeId, WEAVE_IMAGE_NODE_TYPE);
26525
26497
  }
26526
26498
  onRender(props) {
26499
+ this.setupNotUsedImagesCleanup();
26527
26500
  const imageProperties = props.imageProperties;
26528
26501
  const imageProps = props;
26529
26502
  const { id } = imageProps;
@@ -26549,11 +26522,6 @@ var WeaveImageNode = class extends WeaveNode {
26549
26522
  if (this.isSelecting() && selectedNodes.includes(image)) return "grab";
26550
26523
  return "pointer";
26551
26524
  };
26552
- image.movedToContainer = () => {
26553
- const stage = this.instance.getStage();
26554
- const image$1 = stage.findOne(`#${id}`);
26555
- if (!image$1) return;
26556
- };
26557
26525
  if (this.config.cropMode.enabled) {
26558
26526
  image.triggerCrop = () => {
26559
26527
  this.triggerCrop(image, { cmdCtrl: { triggered: false } });
@@ -26675,23 +26643,36 @@ var WeaveImageNode = class extends WeaveNode {
26675
26643
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26676
26644
  }
26677
26645
  });
26646
+ image.on("nodeDragStart", () => {
26647
+ const utilityLayer = this.instance.getUtilityLayer();
26648
+ if (!utilityLayer) return;
26649
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
26650
+ nodes.forEach((n) => {
26651
+ n.destroy();
26652
+ });
26653
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26654
+ if (!transformer) return;
26655
+ transformer.show();
26656
+ });
26678
26657
  if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26679
26658
  image.on("onCmdCtrlPressed", () => {
26659
+ const utilityLayer = this.instance.getUtilityLayer();
26660
+ if (!utilityLayer) return;
26661
+ if (image.isDragging()) return;
26680
26662
  const transformer = this.getSelectionPlugin()?.getTransformer();
26681
26663
  if (!transformer) return;
26682
26664
  transformer.hide();
26683
- const utilityLayer = this.instance.getUtilityLayer();
26684
- if (!utilityLayer) return;
26685
26665
  utilityLayer?.destroyChildren();
26686
26666
  this.renderCropMode(utilityLayer, image);
26687
26667
  utilityLayer?.show();
26688
26668
  });
26689
26669
  image.on("onCmdCtrlReleased", () => {
26670
+ const utilityLayer = this.instance.getUtilityLayer();
26671
+ if (!utilityLayer) return;
26672
+ if (image.isDragging()) return;
26690
26673
  const transformer = this.getSelectionPlugin()?.getTransformer();
26691
26674
  if (!transformer) return;
26692
26675
  transformer.show();
26693
- const utilityLayer = this.instance.getUtilityLayer();
26694
- if (!utilityLayer) return;
26695
26676
  utilityLayer?.destroyChildren();
26696
26677
  });
26697
26678
  }
@@ -26750,6 +26731,7 @@ var WeaveImageNode = class extends WeaveNode {
26750
26731
  fill: "transparent",
26751
26732
  strokeScaleEnabled: false,
26752
26733
  strokeWidth: 2,
26734
+ name: "cropMode",
26753
26735
  stroke: "#1a1aff",
26754
26736
  draggable: false,
26755
26737
  listening: false,
@@ -26810,6 +26792,7 @@ var WeaveImageNode = class extends WeaveNode {
26810
26792
  }));
26811
26793
  const anchor = new Konva.Rect({
26812
26794
  draggable: false,
26795
+ name: "cropMode",
26813
26796
  rotation: node.rotation()
26814
26797
  });
26815
26798
  this.config.cropMode.selection.anchorStyleFunc(anchor, position);
@@ -27250,20 +27233,15 @@ var WeaveImageNode = class extends WeaveNode {
27250
27233
  }
27251
27234
  onDestroy(nodeInstance) {
27252
27235
  const nodeId = nodeInstance.getAttrs().id ?? "";
27253
- const isMoveContainer = nodeInstance.getAttr("onMoveContainer");
27254
- nodeInstance.setAttr("onMoveContainer", void 0);
27255
27236
  const utilityLayer = this.instance.getUtilityLayer();
27256
- utilityLayer?.destroyChildren();
27237
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
27238
+ nodes.forEach((n) => {
27239
+ n.destroy();
27240
+ });
27257
27241
  if (this.imageTryoutIds[nodeId]) {
27258
27242
  clearTimeout(this.imageTryoutIds[nodeId]);
27259
27243
  delete this.imageTryoutIds[nodeId];
27260
27244
  }
27261
- if (!isMoveContainer) {
27262
- delete this.imageSource[nodeId];
27263
- delete this.imageState[nodeId];
27264
- delete this.imageTryoutAttempts[nodeId];
27265
- delete this.imageFallback[nodeId];
27266
- }
27267
27245
  nodeInstance.destroy();
27268
27246
  }
27269
27247
  };
@@ -27810,7 +27788,6 @@ var WeaveFrameNode = class extends WeaveNode {
27810
27788
  delete cleanedAttrs.draggable;
27811
27789
  delete cleanedAttrs.onTargetEnter;
27812
27790
  delete cleanedAttrs.overridesMouseControl;
27813
- delete cleanedAttrs.onMoveContainer;
27814
27791
  delete cleanedAttrs.dragBoundFunc;
27815
27792
  return {
27816
27793
  key: realAttrs?.id ?? "",
@@ -28049,7 +28026,6 @@ var WeaveStrokeNode = class extends WeaveNode {
28049
28026
  delete cleanedAttrs.sceneFunc;
28050
28027
  delete cleanedAttrs.hitFunc;
28051
28028
  delete cleanedAttrs.overridesMouseControl;
28052
- delete cleanedAttrs.onMoveContainer;
28053
28029
  delete cleanedAttrs.dragBoundFunc;
28054
28030
  return {
28055
28031
  key: attrs.id ?? "",
@@ -29594,6 +29570,7 @@ var WeaveVideoNode = class extends WeaveNode {
29594
29570
  const videoIconGroup = video.findOne(`#${id}-video-icon-group`);
29595
29571
  if (!videoPlaceholder || !videoIconGroup) return;
29596
29572
  const realVideoPlaceholderURL = this.config.urlTransformer?.(videoProps.videoPlaceholderURL ?? "", video) ?? videoProps.videoPlaceholderURL;
29573
+ if (!this.videoPlaceholder) this.initialize();
29597
29574
  this.videoPlaceholder[id] = Konva.Util.createImageElement();
29598
29575
  this.videoPlaceholder[id].crossOrigin = this.config.crossOrigin;
29599
29576
  this.videoPlaceholder[id].src = realVideoPlaceholderURL;
@@ -29858,16 +29835,16 @@ var WeaveVideoNode = class extends WeaveNode {
29858
29835
  }
29859
29836
  if (isServer()) this.instance.updateNode(this.serialize(videoGroup));
29860
29837
  const defaultHandleMouseover = videoGroup.handleMouseover;
29861
- videoGroup.handleMouseover = () => {
29862
- defaultHandleMouseover.call(this);
29838
+ videoGroup.handleMouseover = (e) => {
29839
+ defaultHandleMouseover.call(this, e);
29863
29840
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded) {
29864
29841
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29865
29842
  videoProgress?.show();
29866
29843
  }
29867
29844
  };
29868
29845
  const defaultHandleMouseout = videoGroup.handleMouseout;
29869
- videoGroup.handleMouseout = () => {
29870
- defaultHandleMouseout.call(this);
29846
+ videoGroup.handleMouseout = (e) => {
29847
+ defaultHandleMouseout.call(e, this);
29871
29848
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded && !this.videoState[id].paused) {
29872
29849
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29873
29850
  videoProgress?.hide();
@@ -31981,7 +31958,6 @@ var WeaveConnectorNode = class extends WeaveNode {
31981
31958
  delete cleanedAttrs.startInfoLoaded;
31982
31959
  delete cleanedAttrs.endInfoLoaded;
31983
31960
  delete cleanedAttrs.overridesMouseControl;
31984
- delete cleanedAttrs.onMoveContainer;
31985
31961
  delete cleanedAttrs.dragBoundFunc;
31986
31962
  return {
31987
31963
  key: attrs.id ?? "",
@@ -32137,7 +32113,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32137
32113
  this.zooming = false;
32138
32114
  this.isTrackpad = false;
32139
32115
  this.zoomVelocity = 0;
32140
- this.isCtrlOrMetaPressed = false;
32141
32116
  this.updatedMinimumZoom = false;
32142
32117
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
32143
32118
  this.actualScale = this.config.zoomSteps[this.actualStep];
@@ -32448,15 +32423,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32448
32423
  };
32449
32424
  }
32450
32425
  initEvents() {
32451
- window.addEventListener("blur", () => {
32452
- this.isCtrlOrMetaPressed = false;
32453
- }, { signal: this.instance.getEventsController()?.signal });
32454
- window.addEventListener("keydown", (e) => {
32455
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32456
- }, { signal: this.instance.getEventsController()?.signal });
32457
- window.addEventListener("keyup", (e) => {
32458
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32459
- }, { signal: this.instance.getEventsController()?.signal });
32460
32426
  const stage = this.instance.getStage();
32461
32427
  let lastCenter = null;
32462
32428
  let lastDist = 0;
@@ -32538,7 +32504,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32538
32504
  });
32539
32505
  let doZoom = false;
32540
32506
  const handleWheelImmediate = (e) => {
32541
- const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32507
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
32508
+ const performZoom = isCtrlOrMetaPressed || !isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32542
32509
  const mouseX = e.clientX;
32543
32510
  const mouseY = e.clientY;
32544
32511
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -34449,7 +34416,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34449
34416
  const dragProperties = this.instance.getDragProperties();
34450
34417
  if (dragProperties && dragId === WEAVE_IMAGE_TOOL_ACTION_NAME) {
34451
34418
  this.instance.getStage().setPointersPositions(e);
34452
- const position = getPositionRelativeToContainerOnPosition(this.instance);
34419
+ const position = this.instance.getStage().getRelativePointerPosition();
34453
34420
  if (!position) return;
34454
34421
  this.instance.triggerAction(WEAVE_IMAGE_TOOL_ACTION_NAME, {
34455
34422
  type: WEAVE_IMAGE_TOOL_UPLOAD_TYPE.IMAGE_URL,
@@ -34899,7 +34866,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34899
34866
  const dragProperties = this.instance.getDragProperties();
34900
34867
  if (dragProperties && dragId === WEAVE_IMAGES_TOOL_ACTION_NAME) {
34901
34868
  this.instance.getStage().setPointersPositions(e);
34902
- const position = getPositionRelativeToContainerOnPosition(this.instance);
34869
+ const position = this.instance.getStage().getRelativePointerPosition();
34903
34870
  if (!position) return;
34904
34871
  this.instance.triggerAction(WEAVE_IMAGES_TOOL_ACTION_NAME, {
34905
34872
  type: WEAVE_IMAGES_TOOL_UPLOAD_TYPE.IMAGE_URL,
@@ -37010,7 +36977,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
37010
36977
  const dragProperties = this.instance.getDragProperties();
37011
36978
  if (dragProperties && dragId === VIDEO_TOOL_ACTION_NAME) {
37012
36979
  this.instance.getStage().setPointersPositions(e);
37013
- const position = getPositionRelativeToContainerOnPosition(this.instance);
36980
+ const position = this.instance.getStage().getRelativePointerPosition();
37014
36981
  this.instance.triggerAction(VIDEO_TOOL_ACTION_NAME, {
37015
36982
  videoId: dragProperties.videoId,
37016
36983
  videoParams: dragProperties.videoParams,
@@ -38142,7 +38109,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38142
38109
  this.moveToolActive = false;
38143
38110
  this.isMouseLeftButtonPressed = false;
38144
38111
  this.isMouseMiddleButtonPressed = false;
38145
- this.isCtrlOrMetaPressed = false;
38146
38112
  this.isSpaceKeyPressed = false;
38147
38113
  this.previousPointer = null;
38148
38114
  this.currentPointer = null;
@@ -38171,11 +38137,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38171
38137
  }
38172
38138
  initEvents() {
38173
38139
  const stage = this.instance.getStage();
38174
- window.addEventListener("blur", () => {
38175
- this.isCtrlOrMetaPressed = false;
38176
- }, { signal: this.instance.getEventsController()?.signal });
38177
38140
  window.addEventListener("keydown", (e) => {
38178
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
38179
38141
  if (e.code === "Space") {
38180
38142
  this.getContextMenuPlugin()?.disable();
38181
38143
  this.getNodesSelectionPlugin()?.disable();
@@ -38186,7 +38148,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38186
38148
  }
38187
38149
  }, { signal: this.instance.getEventsController()?.signal });
38188
38150
  window.addEventListener("keyup", (e) => {
38189
- if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
38190
38151
  if (e.code === "Space") {
38191
38152
  this.getContextMenuPlugin()?.enable();
38192
38153
  this.getNodesSelectionPlugin()?.enable();
@@ -38253,7 +38214,8 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38253
38214
  this.cleanupEdgeMoveIntervals();
38254
38215
  });
38255
38216
  const handleWheel = (e) => {
38256
- const performPanning = !this.isCtrlOrMetaPressed && !e.ctrlKey;
38217
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
38218
+ const performPanning = !isCtrlOrMetaPressed && !e.ctrlKey;
38257
38219
  const mouseX = e.clientX;
38258
38220
  const mouseY = e.clientY;
38259
38221
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -38261,7 +38223,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38261
38223
  const shadowHost = getTopmostShadowHost(stage.container());
38262
38224
  if (shadowHost) elementUnderMouse = shadowHost.elementFromPoint(mouseX, mouseY);
38263
38225
  }
38264
- if (!this.enabled || this.isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38226
+ if (!this.enabled || isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38265
38227
  this.getContextMenuPlugin()?.cancelLongPressTimer();
38266
38228
  stage.x(stage.x() - e.deltaX);
38267
38229
  stage.y(stage.y() - e.deltaY);
@@ -38277,13 +38239,12 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38277
38239
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
38278
38240
  this.panEdgeTargets[e.target.getAttrs().id ?? ""] = e.target;
38279
38241
  if (this.stageScrollInterval !== void 0) return;
38242
+ const speed = this.config.edgePan.speed;
38280
38243
  this.stageScrollInterval = setInterval(() => {
38281
38244
  const pos = stage.getPointerPosition();
38282
- const offset = this.config.edgePanOffset;
38245
+ const offset = this.config.edgePan.offset;
38283
38246
  if (!pos) return;
38284
38247
  const { width, height } = stage.size();
38285
- const scale = stage.scaleX();
38286
- const speed = Math.max(this.config.edgePanMinSpeed, Math.min(this.config.edgePanMaxSpeed, this.config.edgePanSpeed / scale));
38287
38248
  let isNearLeft = false;
38288
38249
  let isNearRight = false;
38289
38250
  let isNearTop = false;
@@ -39293,7 +39254,11 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
39293
39254
  const presenceInfo = userPresence[nodeId];
39294
39255
  if (this.config.getUser().id === presenceInfo.userId) continue;
39295
39256
  const nodeInstance = stage.findOne(`#${presenceInfo.nodeId}`);
39296
- if (nodeInstance) {
39257
+ if (!nodeInstance) continue;
39258
+ let parentId = nodeInstance.getParent()?.id() ?? "";
39259
+ const parent = nodeInstance.getParent();
39260
+ if (parent?.getAttrs().nodeId) parentId = parent.getAttrs().nodeId;
39261
+ if (nodeInstance && presenceInfo.parentId === parentId) {
39297
39262
  const newProps = {
39298
39263
  ...nodeInstance.getAttrs(),
39299
39264
  ...presenceInfo.attrs
@@ -39308,10 +39273,11 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
39308
39273
  const store = this.instance.getStore();
39309
39274
  store.setAwarenessInfo(WEAVE_USER_PRESENCE_KEY, this.userPresence);
39310
39275
  }
39311
- setPresence(nodeId, attrs, forceUpdate = true) {
39276
+ setPresence(nodeId, parentId, attrs, forceUpdate = true) {
39312
39277
  const userInfo = this.config.getUser();
39313
39278
  this.userPresence[nodeId] = {
39314
39279
  userId: userInfo.id,
39280
+ parentId,
39315
39281
  nodeId,
39316
39282
  attrs
39317
39283
  };
@@ -40518,7 +40484,16 @@ var WeaveCommentsRendererPlugin = class extends WeavePlugin {
40518
40484
  //#endregion
40519
40485
  //#region src/plugins/stage-keyboard-move/constants.ts
40520
40486
  const WEAVE_STAGE_KEYBOARD_MOVE_KEY = "stageKeyboardMove";
40521
- const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40487
+ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = {
40488
+ movementDelta: 1,
40489
+ shiftMovementDelta: 10
40490
+ };
40491
+ const WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION = {
40492
+ ["UP"]: "up",
40493
+ ["DOWN"]: "down",
40494
+ ["LEFT"]: "left",
40495
+ ["RIGHT"]: "right"
40496
+ };
40522
40497
 
40523
40498
  //#endregion
40524
40499
  //#region src/plugins/stage-keyboard-move/stage-keyboard-move.ts
@@ -40533,25 +40508,31 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40533
40508
  getName() {
40534
40509
  return WEAVE_STAGE_KEYBOARD_MOVE_KEY;
40535
40510
  }
40536
- handleNodesMovement(movementOrientation) {
40511
+ handleNodesMovement(movementOrientation, { isShiftPressed }) {
40537
40512
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
40538
40513
  if (nodesSelectionPlugin) {
40539
40514
  const selectedNodes = nodesSelectionPlugin.getSelectedNodes();
40515
+ const movementDelta = isShiftPressed ? this.config.shiftMovementDelta : this.config.movementDelta;
40540
40516
  for (const node of selectedNodes) {
40541
40517
  switch (movementOrientation) {
40542
- case "up":
40543
- node.y(node.y() - this.config.movementDelta);
40518
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP:
40519
+ node.y(node.y() - movementDelta);
40544
40520
  break;
40545
- case "down":
40546
- node.y(node.y() + this.config.movementDelta);
40521
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN:
40522
+ node.y(node.y() + movementDelta);
40547
40523
  break;
40548
- case "left":
40549
- node.x(node.x() - this.config.movementDelta);
40524
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT:
40525
+ node.x(node.x() - movementDelta);
40550
40526
  break;
40551
- case "right":
40552
- node.x(node.x() + this.config.movementDelta);
40527
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT:
40528
+ node.x(node.x() + movementDelta);
40553
40529
  break;
40554
40530
  }
40531
+ this.instance.emitEvent("onNodeKeyboardMove", {
40532
+ node,
40533
+ orientation: movementOrientation,
40534
+ delta: movementDelta
40535
+ });
40555
40536
  const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
40556
40537
  if (!nodeHandler) break;
40557
40538
  this.instance.updateNode(nodeHandler.serialize(node));
@@ -40560,10 +40541,11 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40560
40541
  }
40561
40542
  onInit() {
40562
40543
  window.addEventListener("keydown", (e) => {
40563
- if (e.code === "ArrowUp" && e.shiftKey) this.handleNodesMovement("up");
40564
- if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40565
- if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40566
- if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40544
+ const isShiftPressed = e.shiftKey || e.code === "Shift";
40545
+ if (e.code === "ArrowUp") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP, { isShiftPressed });
40546
+ if (e.code === "ArrowLeft") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT, { isShiftPressed });
40547
+ if (e.code === "ArrowRight") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT, { isShiftPressed });
40548
+ if (e.code === "ArrowDown") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN, { isShiftPressed });
40567
40549
  }, { signal: this.instance.getEventsController()?.signal });
40568
40550
  }
40569
40551
  enable() {
@@ -40586,4 +40568,4 @@ const setupCanvasBackend = async () => {
40586
40568
  };
40587
40569
 
40588
40570
  //#endregion
40589
- 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, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, loadImageSource, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend };
40571
+ 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, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, loadImageSource, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend };