@inditextech/weave-sdk 4.1.0 → 4.1.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.js CHANGED
@@ -17872,7 +17872,8 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17872
17872
  const actualContainerAttrs = nodeActualContainer.getAttrs();
17873
17873
  let layerToMove = void 0;
17874
17874
  if (actualContainerAttrs.id !== containerToMove.getAttrs().id && !invalidOriginsTypes.includes(node.getAttrs().nodeType)) layerToMove = containerToMove;
17875
- if (layerToMove && actualContainerAttrs.id !== layerToMove.getAttrs().id && actualContainerAttrs.id !== layerToMove.getAttrs().containerId) {
17875
+ const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17876
+ if (layerToMove && actualContainerAttrs.id !== layerToMove.getAttrs().id && actualContainerAttrs.id !== layerToMove.getAttrs().containerId && nodeHandler) {
17876
17877
  const layerToMoveAttrs = layerToMove.getAttrs();
17877
17878
  const nodePos = node.getAbsolutePosition();
17878
17879
  const nodeRotation = node.getAbsoluteRotation();
@@ -17881,7 +17882,6 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17881
17882
  node.rotation(nodeRotation);
17882
17883
  node.x(node.x() - (layerToMoveAttrs.containerOffsetX ?? 0));
17883
17884
  node.y(node.y() - (layerToMoveAttrs.containerOffsetY ?? 0));
17884
- node.destroy();
17885
17885
  const newNode = node.clone();
17886
17886
  instance.emitEvent("onNodeMovedToContainer", {
17887
17887
  node: newNode,
@@ -17889,17 +17889,15 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17889
17889
  originalNode,
17890
17890
  originalContainer
17891
17891
  });
17892
- const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17893
- if (nodeHandler) {
17894
- const actualNodeState = nodeHandler.serialize(node);
17895
- const newNodeState = nodeHandler.serialize(newNode);
17896
- instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17897
- instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17898
- emitUserChangeEvent: false,
17899
- overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17900
- });
17901
- return true;
17902
- }
17892
+ const actualNodeState = nodeHandler.serialize(node);
17893
+ const newNodeState = nodeHandler.serialize(newNode);
17894
+ node.destroy();
17895
+ instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17896
+ instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17897
+ emitUserChangeEvent: false,
17898
+ overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17899
+ });
17900
+ return true;
17903
17901
  }
17904
17902
  return false;
17905
17903
  }
@@ -19431,10 +19429,10 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19431
19429
  }
19432
19430
  const isStage = e.target instanceof Konva.Stage;
19433
19431
  const isTransformer = e.target?.getParent() instanceof Konva.Transformer;
19434
- const isTargetable = e.target.getAttrs().isTargetable !== false;
19432
+ const canBeTargeted = e.target.getAttrs().canBeTargeted !== false;
19435
19433
  const isContainerEmptyArea = e.target.getAttrs().isContainerPrincipal !== void 0 && !e.target.getAttrs().isContainerPrincipal;
19436
19434
  if (isTransformer) return;
19437
- if (!isStage && !isContainerEmptyArea && isTargetable) {
19435
+ if (!isStage && !isContainerEmptyArea && canBeTargeted) {
19438
19436
  this.selecting = false;
19439
19437
  this.stopPanLoop();
19440
19438
  this.hideSelectorArea();
@@ -20534,6 +20532,9 @@ var WeaveNode = class {
20534
20532
  mutexUserId: void 0
20535
20533
  });
20536
20534
  };
20535
+ const isLocked = node.getAttrs().locked ?? false;
20536
+ if (isLocked) node.listening(false);
20537
+ else node.listening(true);
20537
20538
  }
20538
20539
  isNodeSelected(ele) {
20539
20540
  const selectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -20907,27 +20908,27 @@ var WeaveNode = class {
20907
20908
  const activeAction = this.instance.getActiveAction();
20908
20909
  const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
20909
20910
  const realNode = this.instance.getInstanceRecursive(node);
20910
- const isTargetable = node.getAttrs().isTargetable !== false;
20911
- const isLocked = node.getAttrs().locked ?? false;
20911
+ const canBeTargeted = realNode.getAttrs().canBeTargeted !== false;
20912
+ const isLocked = realNode.getAttrs().locked ?? false;
20912
20913
  const isMutexLocked = realNode.getAttrs().mutexLocked && realNode.getAttrs().mutexUserId !== user.id;
20913
20914
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return false;
20914
20915
  let showHover = false;
20915
20916
  let cancelBubble = false;
20916
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && (isLocked || isMutexLocked)) {
20917
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && realNode.hasName("node") && (isLocked || isMutexLocked)) {
20917
20918
  stage.container().style.cursor = "default";
20918
20919
  cancelBubble = true;
20919
20920
  }
20920
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20921
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && canBeTargeted && realNode.hasName("node") && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20921
20922
  showHover = true;
20922
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "pointer";
20923
+ stage.container().style.cursor = (typeof realNode?.defineMousePointer === "function" ? realNode.defineMousePointer() : null) ?? "pointer";
20923
20924
  cancelBubble = true;
20924
20925
  }
20925
- if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20926
+ if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && realNode.hasName("node") && canBeTargeted && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20926
20927
  showHover = true;
20927
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
20928
+ stage.container().style.cursor = (typeof realNode?.defineMousePointer === "function" ? realNode.defineMousePointer() : null) ?? "grab";
20928
20929
  cancelBubble = true;
20929
20930
  }
20930
- if (!isTargetable) cancelBubble = true;
20931
+ if (!canBeTargeted) cancelBubble = true;
20931
20932
  if (this.isPasting()) {
20932
20933
  stage.container().style.cursor = "crosshair";
20933
20934
  cancelBubble = true;
@@ -21015,7 +21016,12 @@ var WeaveNode = class {
21015
21016
  }
21016
21017
  lock(instance) {
21017
21018
  if (instance.getAttrs().nodeType !== this.getNodeType()) return;
21018
- instance.setAttrs({ locked: true });
21019
+ const isListening = instance.listening();
21020
+ instance.setAttrs({
21021
+ locked: true,
21022
+ listening: false,
21023
+ previousListening: isListening
21024
+ });
21019
21025
  this.instance.updateNode(this.serialize(instance));
21020
21026
  const selectionPlugin = this.getSelectionPlugin();
21021
21027
  if (selectionPlugin) {
@@ -21033,7 +21039,12 @@ var WeaveNode = class {
21033
21039
  let realInstance = instance;
21034
21040
  if (instance.getAttrs().nodeId) realInstance = this.instance.getStage().findOne(`#${instance.getAttrs().nodeId}`);
21035
21041
  if (!realInstance) return;
21036
- realInstance.setAttrs({ locked: false });
21042
+ const previousListening = realInstance.getAttrs().previousListening ?? true;
21043
+ realInstance.setAttrs({
21044
+ locked: false,
21045
+ listening: previousListening,
21046
+ previousListening: void 0
21047
+ });
21037
21048
  this.instance.updateNode(this.serialize(realInstance));
21038
21049
  this.setupDefaultNodeEvents(realInstance);
21039
21050
  const stage = this.instance.getStage();
@@ -22188,7 +22199,7 @@ var WeaveRegisterManager = class {
22188
22199
 
22189
22200
  //#endregion
22190
22201
  //#region package.json
22191
- var version = "4.1.0";
22202
+ var version = "4.1.1";
22192
22203
 
22193
22204
  //#endregion
22194
22205
  //#region src/managers/setup.ts
@@ -24339,6 +24350,7 @@ async function downscaleImageFile(file, ratio) {
24339
24350
  ctx.drawImage(bitmap, 0, 0, width, height);
24340
24351
  return new Promise((resolve) => {
24341
24352
  canvas.toBlob((blob) => resolve(blob), file.type, .9);
24353
+ canvas.remove();
24342
24354
  });
24343
24355
  }
24344
24356
  function getImageSizeFromFile(file) {
@@ -24394,7 +24406,9 @@ const downscaleImageFromURL = (url, options) => {
24394
24406
  canvas.height = height;
24395
24407
  const ctx = canvas.getContext("2d");
24396
24408
  ctx.drawImage(img, 0, 0, width, height);
24397
- resolve(canvas.toDataURL(type));
24409
+ const dataURL = canvas.toDataURL(type);
24410
+ canvas.remove();
24411
+ resolve(dataURL);
24398
24412
  };
24399
24413
  img.onerror = () => {
24400
24414
  reject(new Error("Invalid image", { cause: "InvalidImage" }));
@@ -24456,7 +24470,8 @@ var WeaveStageNode = class extends WeaveNode {
24456
24470
  globalEventsInitialized = false;
24457
24471
  initialize = void 0;
24458
24472
  onRender(props) {
24459
- const stage = new Konva.Stage({
24473
+ let stage = this.instance.getStage();
24474
+ if (!stage) stage = new Konva.Stage({
24460
24475
  ...props,
24461
24476
  mode: "default"
24462
24477
  });
@@ -26628,6 +26643,7 @@ const doPreloadCursors = async (cursorsToPreload, setCursor, getFallbackCursor,
26628
26643
  const ctx = canvas.getContext("2d");
26629
26644
  ctx?.drawImage(img, 0, 0);
26630
26645
  const dataURL = canvas.toDataURL("image/png");
26646
+ canvas.remove();
26631
26647
  const tokens = value.split(" ");
26632
26648
  tokens[0] = `url(${dataURL})`;
26633
26649
  setCursor(state, tokens.join(" "));
@@ -28184,7 +28200,7 @@ var WeaveFrameNode = class extends WeaveNode {
28184
28200
  strokeScaleEnabled: true,
28185
28201
  listening: true,
28186
28202
  draggable: false,
28187
- isTargetable: false
28203
+ canBeTargeted: false
28188
28204
  });
28189
28205
  frameInternal.clip({
28190
28206
  x: 0 * frameInternal.scaleX(),
@@ -29512,7 +29528,7 @@ var WeaveCommentNode = class extends WeaveNode {
29512
29528
  const commentNode = new Konva.Group({
29513
29529
  ...commentParams,
29514
29530
  name: "comment",
29515
- isTargetable: false,
29531
+ canBeTargeted: false,
29516
29532
  isExpanded: false,
29517
29533
  commentAction: null,
29518
29534
  listening: true,
@@ -29523,7 +29539,7 @@ var WeaveCommentNode = class extends WeaveNode {
29523
29539
  id: `${id}-bg`,
29524
29540
  x: 0,
29525
29541
  y: -heightContracted,
29526
- isTargetable: false,
29542
+ canBeTargeted: false,
29527
29543
  fill: commentParams.userBackgroundColor ?? "#0000FF",
29528
29544
  stroke: this.config.style.stroke,
29529
29545
  strokeWidth: this.config.style.strokeWidth,
@@ -39800,10 +39816,8 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39800
39816
  skipStroke: true
39801
39817
  });
39802
39818
  if (box.width === 0 || box.height === 0) return;
39803
- console.log("update minimap viewport reference", this.minimapStage);
39804
39819
  const width = this.minimapStage?.width();
39805
39820
  const height = this.minimapStage?.height();
39806
- console.log("update minimap viewport reference", width, height);
39807
39821
  const fitScale = Math.min(width / box.width, height / box.height);
39808
39822
  const centerOffset = {
39809
39823
  x: (width - box.width * fitScale) / 2,
package/dist/sdk.node.js CHANGED
@@ -17871,7 +17871,8 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17871
17871
  const actualContainerAttrs = nodeActualContainer.getAttrs();
17872
17872
  let layerToMove = void 0;
17873
17873
  if (actualContainerAttrs.id !== containerToMove.getAttrs().id && !invalidOriginsTypes.includes(node.getAttrs().nodeType)) layerToMove = containerToMove;
17874
- if (layerToMove && actualContainerAttrs.id !== layerToMove.getAttrs().id && actualContainerAttrs.id !== layerToMove.getAttrs().containerId) {
17874
+ const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17875
+ if (layerToMove && actualContainerAttrs.id !== layerToMove.getAttrs().id && actualContainerAttrs.id !== layerToMove.getAttrs().containerId && nodeHandler) {
17875
17876
  const layerToMoveAttrs = layerToMove.getAttrs();
17876
17877
  const nodePos = node.getAbsolutePosition();
17877
17878
  const nodeRotation = node.getAbsoluteRotation();
@@ -17880,7 +17881,6 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17880
17881
  node.rotation(nodeRotation);
17881
17882
  node.x(node.x() - (layerToMoveAttrs.containerOffsetX ?? 0));
17882
17883
  node.y(node.y() - (layerToMoveAttrs.containerOffsetY ?? 0));
17883
- node.destroy();
17884
17884
  const newNode = node.clone();
17885
17885
  instance.emitEvent("onNodeMovedToContainer", {
17886
17886
  node: newNode,
@@ -17888,17 +17888,15 @@ function moveNodeToContainerNT(instance, node, containerToMove, originalNode, or
17888
17888
  originalNode,
17889
17889
  originalContainer
17890
17890
  });
17891
- const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
17892
- if (nodeHandler) {
17893
- const actualNodeState = nodeHandler.serialize(node);
17894
- const newNodeState = nodeHandler.serialize(newNode);
17895
- instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17896
- instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17897
- emitUserChangeEvent: false,
17898
- overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17899
- });
17900
- return true;
17901
- }
17891
+ const actualNodeState = nodeHandler.serialize(node);
17892
+ const newNodeState = nodeHandler.serialize(newNode);
17893
+ node.destroy();
17894
+ instance.removeNodeNT(actualNodeState, { emitUserChangeEvent: false });
17895
+ instance.addNodeNT(newNodeState, layerToMoveAttrs.id, {
17896
+ emitUserChangeEvent: false,
17897
+ overrideUserChangeType: WEAVE_NODE_CHANGE_TYPE.UPDATE
17898
+ });
17899
+ return true;
17902
17900
  }
17903
17901
  return false;
17904
17902
  }
@@ -19430,10 +19428,10 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19430
19428
  }
19431
19429
  const isStage = e.target instanceof Konva.Stage;
19432
19430
  const isTransformer = e.target?.getParent() instanceof Konva.Transformer;
19433
- const isTargetable = e.target.getAttrs().isTargetable !== false;
19431
+ const canBeTargeted = e.target.getAttrs().canBeTargeted !== false;
19434
19432
  const isContainerEmptyArea = e.target.getAttrs().isContainerPrincipal !== void 0 && !e.target.getAttrs().isContainerPrincipal;
19435
19433
  if (isTransformer) return;
19436
- if (!isStage && !isContainerEmptyArea && isTargetable) {
19434
+ if (!isStage && !isContainerEmptyArea && canBeTargeted) {
19437
19435
  this.selecting = false;
19438
19436
  this.stopPanLoop();
19439
19437
  this.hideSelectorArea();
@@ -20533,6 +20531,9 @@ var WeaveNode = class {
20533
20531
  mutexUserId: void 0
20534
20532
  });
20535
20533
  };
20534
+ const isLocked = node.getAttrs().locked ?? false;
20535
+ if (isLocked) node.listening(false);
20536
+ else node.listening(true);
20536
20537
  }
20537
20538
  isNodeSelected(ele) {
20538
20539
  const selectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -20906,27 +20907,27 @@ var WeaveNode = class {
20906
20907
  const activeAction = this.instance.getActiveAction();
20907
20908
  const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
20908
20909
  const realNode = this.instance.getInstanceRecursive(node);
20909
- const isTargetable = node.getAttrs().isTargetable !== false;
20910
- const isLocked = node.getAttrs().locked ?? false;
20910
+ const canBeTargeted = realNode.getAttrs().canBeTargeted !== false;
20911
+ const isLocked = realNode.getAttrs().locked ?? false;
20911
20912
  const isMutexLocked = realNode.getAttrs().mutexLocked && realNode.getAttrs().mutexUserId !== user.id;
20912
20913
  if ([MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) return false;
20913
20914
  let showHover = false;
20914
20915
  let cancelBubble = false;
20915
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && (isLocked || isMutexLocked)) {
20916
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && realNode.hasName("node") && (isLocked || isMutexLocked)) {
20916
20917
  stage.container().style.cursor = "default";
20917
20918
  cancelBubble = true;
20918
20919
  }
20919
- if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20920
+ if (isNodeSelectionEnabled && this.isSelecting() && !this.isNodeSelected(realNode) && !this.isPasting() && canBeTargeted && realNode.hasName("node") && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20920
20921
  showHover = true;
20921
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "pointer";
20922
+ stage.container().style.cursor = (typeof realNode?.defineMousePointer === "function" ? realNode.defineMousePointer() : null) ?? "pointer";
20922
20923
  cancelBubble = true;
20923
20924
  }
20924
- if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && isTargetable && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20925
+ if (isNodeSelectionEnabled && this.isSelecting() && this.isNodeSelected(realNode) && !this.isPasting() && realNode.hasName("node") && canBeTargeted && !(isLocked || isMutexLocked) && stage.mode() === WEAVE_STAGE_DEFAULT_MODE) {
20925
20926
  showHover = true;
20926
- stage.container().style.cursor = (typeof node?.defineMousePointer === "function" ? node.defineMousePointer() : null) ?? "grab";
20927
+ stage.container().style.cursor = (typeof realNode?.defineMousePointer === "function" ? realNode.defineMousePointer() : null) ?? "grab";
20927
20928
  cancelBubble = true;
20928
20929
  }
20929
- if (!isTargetable) cancelBubble = true;
20930
+ if (!canBeTargeted) cancelBubble = true;
20930
20931
  if (this.isPasting()) {
20931
20932
  stage.container().style.cursor = "crosshair";
20932
20933
  cancelBubble = true;
@@ -21014,7 +21015,12 @@ var WeaveNode = class {
21014
21015
  }
21015
21016
  lock(instance) {
21016
21017
  if (instance.getAttrs().nodeType !== this.getNodeType()) return;
21017
- instance.setAttrs({ locked: true });
21018
+ const isListening = instance.listening();
21019
+ instance.setAttrs({
21020
+ locked: true,
21021
+ listening: false,
21022
+ previousListening: isListening
21023
+ });
21018
21024
  this.instance.updateNode(this.serialize(instance));
21019
21025
  const selectionPlugin = this.getSelectionPlugin();
21020
21026
  if (selectionPlugin) {
@@ -21032,7 +21038,12 @@ var WeaveNode = class {
21032
21038
  let realInstance = instance;
21033
21039
  if (instance.getAttrs().nodeId) realInstance = this.instance.getStage().findOne(`#${instance.getAttrs().nodeId}`);
21034
21040
  if (!realInstance) return;
21035
- realInstance.setAttrs({ locked: false });
21041
+ const previousListening = realInstance.getAttrs().previousListening ?? true;
21042
+ realInstance.setAttrs({
21043
+ locked: false,
21044
+ listening: previousListening,
21045
+ previousListening: void 0
21046
+ });
21036
21047
  this.instance.updateNode(this.serialize(realInstance));
21037
21048
  this.setupDefaultNodeEvents(realInstance);
21038
21049
  const stage = this.instance.getStage();
@@ -22187,7 +22198,7 @@ var WeaveRegisterManager = class {
22187
22198
 
22188
22199
  //#endregion
22189
22200
  //#region package.json
22190
- var version = "4.1.0";
22201
+ var version = "4.1.1";
22191
22202
 
22192
22203
  //#endregion
22193
22204
  //#region src/managers/setup.ts
@@ -24338,6 +24349,7 @@ async function downscaleImageFile(file, ratio) {
24338
24349
  ctx.drawImage(bitmap, 0, 0, width, height);
24339
24350
  return new Promise((resolve) => {
24340
24351
  canvas.toBlob((blob) => resolve(blob), file.type, .9);
24352
+ canvas.remove();
24341
24353
  });
24342
24354
  }
24343
24355
  function getImageSizeFromFile(file) {
@@ -24393,7 +24405,9 @@ const downscaleImageFromURL = (url, options) => {
24393
24405
  canvas.height = height;
24394
24406
  const ctx = canvas.getContext("2d");
24395
24407
  ctx.drawImage(img, 0, 0, width, height);
24396
- resolve(canvas.toDataURL(type));
24408
+ const dataURL = canvas.toDataURL(type);
24409
+ canvas.remove();
24410
+ resolve(dataURL);
24397
24411
  };
24398
24412
  img.onerror = () => {
24399
24413
  reject(new Error("Invalid image", { cause: "InvalidImage" }));
@@ -24455,7 +24469,8 @@ var WeaveStageNode = class extends WeaveNode {
24455
24469
  globalEventsInitialized = false;
24456
24470
  initialize = void 0;
24457
24471
  onRender(props) {
24458
- const stage = new Konva.Stage({
24472
+ let stage = this.instance.getStage();
24473
+ if (!stage) stage = new Konva.Stage({
24459
24474
  ...props,
24460
24475
  mode: "default"
24461
24476
  });
@@ -26627,6 +26642,7 @@ const doPreloadCursors = async (cursorsToPreload, setCursor, getFallbackCursor,
26627
26642
  const ctx = canvas.getContext("2d");
26628
26643
  ctx?.drawImage(img, 0, 0);
26629
26644
  const dataURL = canvas.toDataURL("image/png");
26645
+ canvas.remove();
26630
26646
  const tokens = value.split(" ");
26631
26647
  tokens[0] = `url(${dataURL})`;
26632
26648
  setCursor(state, tokens.join(" "));
@@ -28183,7 +28199,7 @@ var WeaveFrameNode = class extends WeaveNode {
28183
28199
  strokeScaleEnabled: true,
28184
28200
  listening: true,
28185
28201
  draggable: false,
28186
- isTargetable: false
28202
+ canBeTargeted: false
28187
28203
  });
28188
28204
  frameInternal.clip({
28189
28205
  x: 0 * frameInternal.scaleX(),
@@ -29511,7 +29527,7 @@ var WeaveCommentNode = class extends WeaveNode {
29511
29527
  const commentNode = new Konva.Group({
29512
29528
  ...commentParams,
29513
29529
  name: "comment",
29514
- isTargetable: false,
29530
+ canBeTargeted: false,
29515
29531
  isExpanded: false,
29516
29532
  commentAction: null,
29517
29533
  listening: true,
@@ -29522,7 +29538,7 @@ var WeaveCommentNode = class extends WeaveNode {
29522
29538
  id: `${id}-bg`,
29523
29539
  x: 0,
29524
29540
  y: -heightContracted,
29525
- isTargetable: false,
29541
+ canBeTargeted: false,
29526
29542
  fill: commentParams.userBackgroundColor ?? "#0000FF",
29527
29543
  stroke: this.config.style.stroke,
29528
29544
  strokeWidth: this.config.style.strokeWidth,
@@ -39815,10 +39831,8 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
39815
39831
  skipStroke: true
39816
39832
  });
39817
39833
  if (box.width === 0 || box.height === 0) return;
39818
- console.log("update minimap viewport reference", this.minimapStage);
39819
39834
  const width = this.minimapStage?.width();
39820
39835
  const height = this.minimapStage?.height();
39821
- console.log("update minimap viewport reference", width, height);
39822
39836
  const fitScale = Math.min(width / box.width, height / box.height);
39823
39837
  const centerOffset = {
39824
39838
  x: (width - box.width * fitScale) / 2,