@inditextech/weave-sdk 2.23.0 → 3.0.0-SNAPSHOT.14.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
@@ -18635,6 +18635,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18635
18635
  panLoopId = null;
18636
18636
  prevSelectedNodes = [];
18637
18637
  handledClickOrTap = false;
18638
+ dragInProcess = false;
18639
+ dragSelectedNodes = [];
18638
18640
  constructor(params) {
18639
18641
  super();
18640
18642
  this.config = mergeExceptArrays(WEAVE_NODES_SELECTION_DEFAULT_CONFIG, params?.config ?? {});
@@ -18662,6 +18664,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18662
18664
  this.pointers = {};
18663
18665
  this.panLoopId = null;
18664
18666
  this.tapTimeoutId = null;
18667
+ this.dragSelectedNodes = [];
18668
+ this.dragInProcess = false;
18665
18669
  }
18666
18670
  getName() {
18667
18671
  return WEAVE_NODES_SELECTION_KEY;
@@ -18722,7 +18726,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18722
18726
  listening: false
18723
18727
  });
18724
18728
  selectionLayer?.add(trHover);
18725
- stage.on("pointermove", () => {
18729
+ const handlePointerMoveInit = () => {
18730
+ if (this.dragInProcess) return;
18726
18731
  if (tr.nodes().length === 1 && tr.nodes()[0].getAttrs().isContainerPrincipal) {
18727
18732
  const pos = stage.getPointerPosition();
18728
18733
  if (!pos) return;
@@ -18744,7 +18749,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18744
18749
  tr.forceUpdate();
18745
18750
  }
18746
18751
  }
18747
- });
18752
+ };
18753
+ stage.on("pointermove", (0, import_throttle.default)(handlePointerMoveInit, DEFAULT_THROTTLE_MS));
18748
18754
  tr.on("transformstart", () => {
18749
18755
  this.triggerSelectedNodesEvent();
18750
18756
  const selectedNodes = tr.nodes();
@@ -18759,6 +18765,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18759
18765
  });
18760
18766
  let nodeHovered = void 0;
18761
18767
  tr.on("mousemove", () => {
18768
+ if (this.dragInProcess) return;
18762
18769
  const pointerPos = stage.getPointerPosition();
18763
18770
  if (!pointerPos) return;
18764
18771
  this.disable();
@@ -18793,16 +18800,19 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18793
18800
  const moved = this.checkMoved(e);
18794
18801
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18795
18802
  this.triggerSelectedNodesEvent();
18796
- if (this.getUsersPresencePlugin()) for (const node of tr.nodes()) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18797
- x: node.x(),
18798
- y: node.y(),
18799
- width: node.width(),
18800
- height: node.height(),
18801
- scaleX: node.scaleX(),
18802
- scaleY: node.scaleY(),
18803
- rotation: node.rotation(),
18804
- strokeScaleEnabled: false
18805
- });
18803
+ if (this.getUsersPresencePlugin()) {
18804
+ for (const node of tr.nodes()) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18805
+ x: node.x(),
18806
+ y: node.y(),
18807
+ width: node.width(),
18808
+ height: node.height(),
18809
+ scaleX: node.scaleX(),
18810
+ scaleY: node.scaleY(),
18811
+ rotation: node.rotation(),
18812
+ strokeScaleEnabled: false
18813
+ }, false);
18814
+ this.getUsersPresencePlugin()?.forceSendPresence();
18815
+ }
18806
18816
  };
18807
18817
  tr.on("transform", (0, import_throttle.default)(handleTransform, DEFAULT_THROTTLE_MS));
18808
18818
  tr.on("transformend", () => {
@@ -18811,7 +18821,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18811
18821
  for (const node of selectedNodes) {
18812
18822
  if (node.getAttrs()._revertStrokeScaleEnabled === true) node.setAttr("strokeScaleEnabled", true);
18813
18823
  node.setAttr("_revertStrokeScaleEnabled", void 0);
18814
- if (this.getUsersPresencePlugin()) this.getUsersPresencePlugin()?.removePresence(node.id());
18815
18824
  }
18816
18825
  this.triggerSelectedNodesEvent();
18817
18826
  });
@@ -18819,23 +18828,23 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18819
18828
  let originalNodes = {};
18820
18829
  let originalContainers = {};
18821
18830
  tr.on("dragstart", (e) => {
18831
+ this.dragInProcess = true;
18832
+ tr.visible(false);
18833
+ const mainLayer = this.instance.getMainLayer();
18834
+ if (!mainLayer) return;
18822
18835
  initialPos = {
18823
18836
  x: e.target.x(),
18824
18837
  y: e.target.y()
18825
18838
  };
18826
18839
  this.didMove = false;
18827
18840
  const stage$1 = this.instance.getStage();
18841
+ this.saveDragSelectedNodes();
18842
+ if (this.getDragSelectedNodes().length > 1) this.setNodesOpacityOnDrag();
18828
18843
  if (stage$1.isMouseWheelPressed()) {
18829
18844
  e.cancelBubble = true;
18830
18845
  e.target.stopDrag();
18831
18846
  return;
18832
18847
  }
18833
- const nodes = tr.nodes();
18834
- if (nodes.length > 1) for (const node of nodes) {
18835
- const originalNodeOpacity = node.getAttrs().opacity ?? 1;
18836
- node.setAttr("dragStartOpacity", originalNodeOpacity);
18837
- node.opacity(this.getDragOpacity());
18838
- }
18839
18848
  const selectedNodes = tr.nodes();
18840
18849
  for (const node of selectedNodes) {
18841
18850
  const originalNode = node.clone();
@@ -18882,27 +18891,30 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18882
18891
  if (this.isSelecting() && selectedNodes.length > 1) {
18883
18892
  clearContainerTargets(this.instance);
18884
18893
  const layerToMove = containerOverCursor(this.instance, selectedNodes);
18885
- if (this.getUsersPresencePlugin()) for (const node of selectedNodes) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18886
- x: node.x(),
18887
- y: node.y()
18888
- });
18894
+ if (this.getUsersPresencePlugin() && this.dragInProcess) {
18895
+ console.log("sending presence user");
18896
+ for (const node of selectedNodes) this.getUsersPresencePlugin()?.setPresence(node.id(), {
18897
+ x: node.x(),
18898
+ y: node.y()
18899
+ }, false);
18900
+ this.getUsersPresencePlugin()?.forceSendPresence();
18901
+ }
18889
18902
  if (layerToMove && !selectionContainsFrames) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { bubbles: true });
18890
18903
  }
18891
18904
  tr.forceUpdate();
18892
18905
  };
18893
- tr.on("dragmove", handleDragMove);
18906
+ tr.on("dragmove", (0, import_throttle.default)(handleDragMove, DEFAULT_THROTTLE_MS));
18894
18907
  tr.on("dragend", (e) => {
18908
+ this.dragInProcess = false;
18909
+ const mainLayer = this.instance.getMainLayer();
18910
+ if (!mainLayer) return;
18911
+ tr.visible(true);
18912
+ this.instance.getSelectionLayer()?.hitGraphEnabled(true);
18913
+ this.instance.getMainLayer()?.hitGraphEnabled(true);
18914
+ if (this.getDragSelectedNodes().length > 1) this.restoreNodesOpacityOnDrag();
18895
18915
  if (!this.didMove) return;
18896
18916
  if (this.getSelectedNodes().length > 1) this.instance.releaseMutexLock();
18897
18917
  e.cancelBubble = true;
18898
- if (tr.nodes().length > 1) {
18899
- const nodes$1 = tr.nodes();
18900
- for (const node of nodes$1) {
18901
- this.getNodesSelectionFeedbackPlugin()?.showSelectionHalo(node);
18902
- this.getNodesSelectionFeedbackPlugin()?.updateSelectionHalo(node);
18903
- this.getUsersPresencePlugin()?.removePresence(node.id());
18904
- }
18905
- }
18906
18918
  this.instance.getCloningManager().cleanupClones();
18907
18919
  this.getStagePanningPlugin()?.cleanupEdgeMoveIntervals();
18908
18920
  const selectedNodes = tr.nodes();
@@ -18912,12 +18924,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18912
18924
  selectionContainsFrames = selectionContainsFrames || hasFrames(node);
18913
18925
  node.updatePosition(node.getAbsolutePosition());
18914
18926
  }
18915
- const nodes = tr.nodes();
18916
- if (nodes.length > 1) for (const node of nodes) {
18917
- const dragStartOpacity = node.getAttr("dragStartOpacity") ?? 1;
18918
- node.opacity(dragStartOpacity);
18919
- node.setAttr("dragStartOpacity", void 0);
18920
- }
18921
18927
  if (this.isSelecting() && tr.nodes().length > 1) this.instance.stateTransactional(() => {
18922
18928
  const actualCursor = stage.container().style.cursor;
18923
18929
  stage.container().style.cursor = "wait";
@@ -18953,7 +18959,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18953
18959
  clearContainerTargets(this.instance);
18954
18960
  toSelect.push(node.getAttrs().id ?? "");
18955
18961
  const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
18956
- if (nodeHandler) this.instance.updateNode(nodeHandler.serialize(node));
18957
18962
  if (!nodeHandler) return;
18958
18963
  toSelect.push(node.getAttrs().id ?? "");
18959
18964
  toUpdate.push(nodeHandler.serialize(node));
@@ -19186,7 +19191,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19186
19191
  stage.container().addEventListener("keydown", (e) => {
19187
19192
  if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
19188
19193
  if (e.code === "Space") this.isSpaceKeyPressed = true;
19189
- if ((e.code === "Backspace" || e.code === "Delete") && Object.keys(window.weaveTextEditing).length === 0) {
19194
+ if (e.code === "Backspace" || e.code === "Delete") {
19190
19195
  Promise.resolve().then(() => {
19191
19196
  this.removeSelectedNodes();
19192
19197
  });
@@ -19269,7 +19274,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19269
19274
  this.updateSelectionRect();
19270
19275
  this.updatePanDirection();
19271
19276
  };
19272
- stage.on("pointermove", handleMouseMove);
19277
+ stage.on("pointermove", (0, import_throttle.default)(handleMouseMove, DEFAULT_THROTTLE_MS));
19273
19278
  this.panLoop();
19274
19279
  stage.on("pointerup", (e) => {
19275
19280
  const store = this.instance.getStore();
@@ -19592,6 +19597,26 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19592
19597
  getSelectorConfig() {
19593
19598
  return this.config.selection;
19594
19599
  }
19600
+ saveDragSelectedNodes() {
19601
+ this.dragSelectedNodes = this.tr.nodes();
19602
+ }
19603
+ getDragSelectedNodes() {
19604
+ return this.dragSelectedNodes;
19605
+ }
19606
+ setNodesOpacityOnDrag() {
19607
+ for (const node of this.dragSelectedNodes) {
19608
+ const originalNodeOpacity = node.getAttrs().opacity ?? 1;
19609
+ node.setAttr("dragStartOpacity", originalNodeOpacity);
19610
+ node.opacity(this.getDragOpacity());
19611
+ }
19612
+ }
19613
+ restoreNodesOpacityOnDrag() {
19614
+ for (const node of this.dragSelectedNodes) {
19615
+ const dragStartOpacity = node.getAttr("dragStartOpacity") ?? 1;
19616
+ node.opacity(dragStartOpacity);
19617
+ node.setAttr("dragStartOpacity", void 0);
19618
+ }
19619
+ }
19595
19620
  getDragOpacity() {
19596
19621
  return this.config.style.dragOpacity;
19597
19622
  }
@@ -20319,7 +20344,6 @@ var WeaveNode = class {
20319
20344
  node.on("transformend", (e) => {
20320
20345
  const node$1 = e.target;
20321
20346
  if (this.getSelectionPlugin()?.getSelectedNodes().length === 1) this.instance.releaseMutexLock();
20322
- this.getUsersPresencePlugin()?.removePresence(node$1.id());
20323
20347
  if (e.target.getAttrs()._revertStrokeScaleEnabled === true) e.target.setAttr("strokeScaleEnabled", true);
20324
20348
  e.target.setAttr("_revertStrokeScaleEnabled", void 0);
20325
20349
  this.instance.emitEvent("onTransform", null);
@@ -20356,6 +20380,8 @@ var WeaveNode = class {
20356
20380
  node.on("dragstart", (e) => {
20357
20381
  const nodeTarget = e.target;
20358
20382
  this.getNodesSelectionFeedbackPlugin()?.hideSelectionHalo(nodeTarget);
20383
+ this.getSelectionPlugin()?.saveDragSelectedNodes();
20384
+ if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.setNodesOpacityOnDrag();
20359
20385
  const canMove = nodeTarget.canDrag();
20360
20386
  if (!canMove) {
20361
20387
  nodeTarget.stopDrag();
@@ -20386,10 +20412,6 @@ var WeaveNode = class {
20386
20412
  startPosition = null;
20387
20413
  isShiftPressed = false;
20388
20414
  }
20389
- if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1 && realNodeTarget.getAttr("dragStartOpacity") === void 0) {
20390
- realNodeTarget.setAttr("dragStartOpacity", realNodeTarget.opacity());
20391
- realNodeTarget.opacity(this.getNodesSelectionPlugin()?.getDragOpacity());
20392
- }
20393
20415
  originalNode = realNodeTarget.clone();
20394
20416
  originalContainer = realNodeTarget.getParent();
20395
20417
  if (originalContainer?.getAttrs().nodeId) originalContainer = stage.findOne(`#${originalContainer.getAttrs().nodeId}`);
@@ -20399,9 +20421,6 @@ var WeaveNode = class {
20399
20421
  nodeTarget.stopDrag(e.evt);
20400
20422
  e.cancelBubble = true;
20401
20423
  const clone = this.instance.getCloningManager().cloneNode(realNodeTarget);
20402
- const originalNodeOpacity = realNodeTarget.getAttr("dragStartOpacity") ?? 1;
20403
- realNodeTarget.setAttrs({ opacity: originalNodeOpacity });
20404
- realNodeTarget.setAttr("dragStartOpacity", void 0);
20405
20424
  if (clone && !this.instance.getCloningManager().isClone(clone)) {
20406
20425
  clone.setAttrs({
20407
20426
  isCloneOrigin: false,
@@ -20484,6 +20503,7 @@ var WeaveNode = class {
20484
20503
  startPosition = null;
20485
20504
  lockedAxis = null;
20486
20505
  isShiftPressed = false;
20506
+ if (this.getSelectionPlugin()?.getDragSelectedNodes().length === 1) this.getSelectionPlugin()?.restoreNodesOpacityOnDrag();
20487
20507
  if (this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
20488
20508
  this.instance.releaseMutexLock();
20489
20509
  this.getNodesSelectionFeedbackPlugin()?.showSelectionHalo(nodeTarget);
@@ -20505,12 +20525,6 @@ var WeaveNode = class {
20505
20525
  }
20506
20526
  this.instance.emitEvent("onDrag", null);
20507
20527
  const realNodeTarget = this.getRealSelectedNode(nodeTarget);
20508
- this.getUsersPresencePlugin()?.removePresence(realNodeTarget.id());
20509
- if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1 && realNodeTarget.getAttr("dragStartOpacity") !== void 0) {
20510
- const originalNodeOpacity = realNodeTarget.getAttr("dragStartOpacity") ?? 1;
20511
- realNodeTarget.setAttrs({ opacity: originalNodeOpacity });
20512
- realNodeTarget.setAttr("dragStartOpacity", void 0);
20513
- }
20514
20528
  if (this.isSelecting() && this.getSelectionPlugin()?.getSelectedNodes().length === 1 && (realNodeTarget.getAttrs().lockToContainer === void 0 || !realNodeTarget.getAttrs().lockToContainer)) this.instance.stateTransactional(() => {
20515
20529
  clearContainerTargets(this.instance);
20516
20530
  const nodesEdgeSnappingPlugin = this.getNodesEdgeSnappingPlugin();
@@ -21206,171 +21220,175 @@ var WeaveGroupsManager = class {
21206
21220
  };
21207
21221
  }
21208
21222
  group(nodes) {
21209
- this.logger.debug({ nodes }, "Grouping nodes");
21210
- const stage = this.instance.getStage();
21211
- const state = this.instance.getStore().getState();
21212
- const mainLayer = this.instance.getMainLayer();
21213
- if ((0, import_lodash.isEmpty)(state.weave)) {
21214
- this.logger.warn({ nodes }, "State is empty, cannot group nodes");
21215
- return;
21216
- }
21217
- const { realNodes, parentId } = this.allNodesInSameParent(nodes);
21218
- const selectionPlugin = this.instance.getPlugin("nodesSelection");
21219
- if (selectionPlugin) {
21220
- const tr = selectionPlugin.getTransformer();
21221
- tr.hide();
21222
- selectionPlugin.setSelectedNodes([]);
21223
- }
21224
- let parentNodeId = parentId ?? WEAVE_NODE_LAYER_ID;
21225
- if (typeof parentNodeId === "undefined") parentNodeId = WEAVE_NODE_LAYER_ID;
21226
- const parentLayer = stage.findOne(`#${parentNodeId}`);
21227
- const groupId = v4_default();
21228
- const groupInstance = new Konva.Group({
21229
- id: v4_default(),
21230
- nodeType: "group",
21231
- draggable: true
21232
- });
21233
- parentLayer?.add(groupInstance);
21234
- const groupHandler = this.instance.getNodeHandler("group");
21235
- if (groupHandler) {
21236
- const groupNode$1 = groupHandler.create(groupId, { draggable: true });
21237
- this.instance.addNode(groupNode$1, parentNodeId, { emitUserChangeEvent: false });
21238
- }
21239
- const nodesWithZIndex = realNodes.map((node) => {
21240
- const instance = mainLayer?.findOne(`#${node.key}`);
21241
- return {
21242
- node,
21243
- zIndex: instance?.zIndex() ?? -1
21244
- };
21245
- }).filter((node) => node.zIndex !== -1);
21246
- const sortedNodesByZIndex = (0, import_lodash.orderBy)(nodesWithZIndex, ["zIndex"], ["asc"]).map((node) => node.node);
21247
- for (const [index, node] of sortedNodesByZIndex.entries()) {
21248
- if (node.type === "group") {
21249
- const groupChild = node;
21250
- const konvaGroup = mainLayer?.findOne(`#${groupChild.key}`);
21251
- if (konvaGroup) {
21252
- const nodePos = konvaGroup.getAbsolutePosition();
21253
- const nodeRotation = konvaGroup.getAbsoluteRotation();
21254
- konvaGroup.moveTo(groupInstance);
21255
- konvaGroup.setAbsolutePosition(nodePos);
21256
- konvaGroup.rotation(nodeRotation);
21257
- konvaGroup.zIndex(index);
21258
- konvaGroup.setAttr("id", v4_default());
21259
- konvaGroup.setAttr("draggable", false);
21260
- const handler = this.instance.getNodeHandler("group");
21223
+ this.instance.stateTransactional(() => {
21224
+ this.logger.debug({ nodes }, "Grouping nodes");
21225
+ const stage = this.instance.getStage();
21226
+ const state = this.instance.getStore().getState();
21227
+ const mainLayer = this.instance.getMainLayer();
21228
+ if ((0, import_lodash.isEmpty)(state.weave)) {
21229
+ this.logger.warn({ nodes }, "State is empty, cannot group nodes");
21230
+ return;
21231
+ }
21232
+ const { realNodes, parentId } = this.allNodesInSameParent(nodes);
21233
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21234
+ if (selectionPlugin) {
21235
+ const tr = selectionPlugin.getTransformer();
21236
+ tr.hide();
21237
+ selectionPlugin.setSelectedNodes([]);
21238
+ }
21239
+ let parentNodeId = parentId ?? WEAVE_NODE_LAYER_ID;
21240
+ if (typeof parentNodeId === "undefined") parentNodeId = WEAVE_NODE_LAYER_ID;
21241
+ const parentLayer = stage.findOne(`#${parentNodeId}`);
21242
+ const groupId = v4_default();
21243
+ const groupInstance = new Konva.Group({
21244
+ id: v4_default(),
21245
+ nodeType: "group",
21246
+ draggable: true
21247
+ });
21248
+ parentLayer?.add(groupInstance);
21249
+ const groupHandler = this.instance.getNodeHandler("group");
21250
+ if (groupHandler) {
21251
+ const groupNode$1 = groupHandler.create(groupId, { draggable: true });
21252
+ this.instance.addNodeNT(groupNode$1, parentNodeId, { emitUserChangeEvent: false });
21253
+ }
21254
+ const nodesWithZIndex = realNodes.map((node) => {
21255
+ const instance = mainLayer?.findOne(`#${node.key}`);
21256
+ return {
21257
+ node,
21258
+ zIndex: instance?.zIndex() ?? -1
21259
+ };
21260
+ }).filter((node) => node.zIndex !== -1);
21261
+ const sortedNodesByZIndex = (0, import_lodash.orderBy)(nodesWithZIndex, ["zIndex"], ["asc"]).map((node) => node.node);
21262
+ for (const [index, node] of sortedNodesByZIndex.entries()) {
21263
+ if (node.type === "group") {
21264
+ const groupChild = node;
21265
+ const konvaGroup = mainLayer?.findOne(`#${groupChild.key}`);
21266
+ if (konvaGroup) {
21267
+ const nodePos = konvaGroup.getAbsolutePosition();
21268
+ const nodeRotation = konvaGroup.getAbsoluteRotation();
21269
+ konvaGroup.moveTo(groupInstance);
21270
+ konvaGroup.setAbsolutePosition(nodePos);
21271
+ konvaGroup.rotation(nodeRotation);
21272
+ konvaGroup.zIndex(index);
21273
+ konvaGroup.setAttr("id", v4_default());
21274
+ konvaGroup.setAttr("draggable", false);
21275
+ const handler = this.instance.getNodeHandler("group");
21276
+ if (handler) {
21277
+ const stateNode = handler.serialize(konvaGroup);
21278
+ this.instance.addNodeNT(stateNode, groupId, { emitUserChangeEvent: false });
21279
+ }
21280
+ }
21281
+ continue;
21282
+ }
21283
+ const konvaNode = mainLayer?.findOne(`#${node.key}`);
21284
+ if (konvaNode) {
21285
+ const nodePos = konvaNode.getAbsolutePosition();
21286
+ const nodeRotation = konvaNode.getAbsoluteRotation();
21287
+ konvaNode.moveTo(groupInstance);
21288
+ konvaNode.setAbsolutePosition(nodePos);
21289
+ konvaNode.rotation(nodeRotation);
21290
+ konvaNode.zIndex(index);
21291
+ konvaNode.setAttr("id", v4_default());
21292
+ konvaNode.setAttr("draggable", false);
21293
+ const handler = this.instance.getNodeHandler(konvaNode.getAttrs().nodeType);
21261
21294
  if (handler) {
21262
- const stateNode = handler.serialize(konvaGroup);
21263
- this.instance.addNode(stateNode, groupId, { emitUserChangeEvent: false });
21295
+ const stateNode = handler.serialize(konvaNode);
21296
+ this.instance.addNodeNT(stateNode, groupId, { emitUserChangeEvent: false });
21264
21297
  }
21265
21298
  }
21266
- continue;
21267
21299
  }
21268
- const konvaNode = mainLayer?.findOne(`#${node.key}`);
21269
- if (konvaNode) {
21270
- const nodePos = konvaNode.getAbsolutePosition();
21271
- const nodeRotation = konvaNode.getAbsoluteRotation();
21272
- konvaNode.moveTo(groupInstance);
21273
- konvaNode.setAbsolutePosition(nodePos);
21274
- konvaNode.rotation(nodeRotation);
21275
- konvaNode.zIndex(index);
21276
- konvaNode.setAttr("id", v4_default());
21277
- konvaNode.setAttr("draggable", false);
21278
- const handler = this.instance.getNodeHandler(konvaNode.getAttrs().nodeType);
21279
- if (handler) {
21280
- const stateNode = handler.serialize(konvaNode);
21281
- this.instance.addNode(stateNode, groupId, { emitUserChangeEvent: false });
21300
+ this.instance.removeNodes(sortedNodesByZIndex);
21301
+ groupInstance.destroy();
21302
+ const groupNode = stage.findOne(`#${groupId}`);
21303
+ if (groupHandler && groupNode) this.instance.updateNodeNT(groupHandler.serialize(groupNode));
21304
+ setTimeout(() => {
21305
+ this.getNodesMultiSelectionFeedbackPlugin()?.cleanupSelectedHalos();
21306
+ const groupNode$1 = stage.findOne(`#${groupId}`);
21307
+ const selectionPlugin$1 = this.instance.getPlugin("nodesSelection");
21308
+ if (groupNode$1 && selectionPlugin$1) {
21309
+ const tr = selectionPlugin$1.getTransformer();
21310
+ selectionPlugin$1.setSelectedNodes([groupNode$1]);
21311
+ tr.show();
21312
+ tr.forceUpdate();
21282
21313
  }
21283
- }
21284
- }
21285
- this.instance.removeNodes(sortedNodesByZIndex);
21286
- groupInstance.destroy();
21287
- const groupNode = stage.findOne(`#${groupId}`);
21288
- if (groupHandler && groupNode) this.instance.updateNode(groupHandler.serialize(groupNode));
21289
- setTimeout(() => {
21290
- this.getNodesMultiSelectionFeedbackPlugin()?.cleanupSelectedHalos();
21291
- const groupNode$1 = stage.findOne(`#${groupId}`);
21292
- const selectionPlugin$1 = this.instance.getPlugin("nodesSelection");
21293
- if (groupNode$1 && selectionPlugin$1) {
21294
- const tr = selectionPlugin$1.getTransformer();
21295
- selectionPlugin$1.setSelectedNodes([groupNode$1]);
21296
- tr.show();
21297
- tr.forceUpdate();
21298
- }
21299
- }, 0);
21314
+ }, 0);
21315
+ });
21300
21316
  }
21301
21317
  unGroup(group) {
21302
- this.logger.debug({ group }, "Un-grouping group");
21303
- const stage = this.instance.getStage();
21304
- const konvaGroup = stage.findOne(`#${group.props.id}`);
21305
- if (!konvaGroup) {
21306
- this.logger.debug({ group }, "Group instance doesn't exists, cannot un-group");
21307
- return;
21308
- }
21309
- let nodeId = void 0;
21310
- let newLayer = this.instance.getMainLayer();
21311
- if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Group && konvaGroup.getParent()?.getAttrs().nodeId) {
21312
- nodeId = konvaGroup.getParent()?.getAttrs().nodeId;
21313
- newLayer = konvaGroup.getParent();
21314
- }
21315
- if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Group && !konvaGroup.getParent()?.getAttrs().nodeId) newLayer = konvaGroup.getParent();
21316
- if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Layer) newLayer = konvaGroup.getParent();
21317
- if (!newLayer) {
21318
- this.logger.debug({ group }, "Group target container doesn't exists, cannot un-group");
21319
- return;
21320
- }
21321
- const newLayerChildrenAmount = newLayer?.getChildren().length ?? 0;
21322
- let newChildId = void 0;
21323
- const children = [...konvaGroup.getChildren()];
21324
- for (const child of children) {
21325
- const absPos = child.getAbsolutePosition();
21326
- const absScale = child.getAbsoluteScale();
21327
- const absRotation = child.getAbsoluteRotation();
21328
- child.moveTo(newLayer);
21329
- child.position({
21330
- x: 0,
21331
- y: 0
21332
- });
21333
- child.scale({
21334
- x: 1,
21335
- y: 1
21336
- });
21337
- child.rotation(0);
21338
- child.offset({
21339
- x: 0,
21340
- y: 0
21341
- });
21342
- child.setAbsolutePosition(absPos);
21343
- child.scale({
21344
- x: absScale.x / stage.scaleX(),
21345
- y: absScale.y / stage.scaleY()
21346
- });
21347
- child.rotation(absRotation);
21348
- child.zIndex(newLayerChildrenAmount - 1 + child.zIndex());
21349
- child.setAttr("draggable", true);
21350
- newChildId = child.getAttrs().id;
21351
- const handler = this.instance.getNodeHandler(child.getAttrs().nodeType);
21352
- if (handler) {
21353
- const node = handler.serialize(child);
21354
- const newNodeId = v4_default();
21355
- const oldId = node.key;
21356
- node.key = newNodeId;
21357
- node.props.id = newNodeId;
21358
- for (const prop of Object.keys(node.props)) if (typeof node.props[prop] === "string") node.props[prop] = node.props[prop].replace(oldId, newNodeId);
21359
- this.instance.addNode(node, nodeId ?? newLayer.getAttrs().id);
21318
+ this.instance.stateTransactional(() => {
21319
+ this.logger.debug({ group }, "Un-grouping group");
21320
+ const stage = this.instance.getStage();
21321
+ const konvaGroup = stage.findOne(`#${group.props.id}`);
21322
+ if (!konvaGroup) {
21323
+ this.logger.debug({ group }, "Group instance doesn't exists, cannot un-group");
21324
+ return;
21360
21325
  }
21361
- child.destroy();
21362
- }
21363
- const groupHandler = this.instance.getNodeHandler("group");
21364
- if (groupHandler) {
21365
- const groupNode = groupHandler.serialize(konvaGroup);
21366
- this.instance.removeNode(groupNode, { emitUserChangeEvent: false });
21367
- }
21368
- setTimeout(() => {
21369
- this.getNodesMultiSelectionFeedbackPlugin()?.cleanupSelectedHalos();
21370
- const firstElement = newLayer.findOne(`#${newChildId}`);
21371
- const selectionPlugin = this.instance.getPlugin("nodesSelection");
21372
- if (firstElement && selectionPlugin) selectionPlugin.setSelectedNodes([firstElement]);
21373
- }, 0);
21326
+ let nodeId = void 0;
21327
+ let newLayer = this.instance.getMainLayer();
21328
+ if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Group && konvaGroup.getParent()?.getAttrs().nodeId) {
21329
+ nodeId = konvaGroup.getParent()?.getAttrs().nodeId;
21330
+ newLayer = konvaGroup.getParent();
21331
+ }
21332
+ if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Group && !konvaGroup.getParent()?.getAttrs().nodeId) newLayer = konvaGroup.getParent();
21333
+ if (konvaGroup.getParent() && konvaGroup.getParent() instanceof Konva.Layer) newLayer = konvaGroup.getParent();
21334
+ if (!newLayer) {
21335
+ this.logger.debug({ group }, "Group target container doesn't exists, cannot un-group");
21336
+ return;
21337
+ }
21338
+ const newLayerChildrenAmount = newLayer?.getChildren().length ?? 0;
21339
+ let newChildId = void 0;
21340
+ const children = [...konvaGroup.getChildren()];
21341
+ for (const child of children) {
21342
+ const absPos = child.getAbsolutePosition();
21343
+ const absScale = child.getAbsoluteScale();
21344
+ const absRotation = child.getAbsoluteRotation();
21345
+ child.moveTo(newLayer);
21346
+ child.position({
21347
+ x: 0,
21348
+ y: 0
21349
+ });
21350
+ child.scale({
21351
+ x: 1,
21352
+ y: 1
21353
+ });
21354
+ child.rotation(0);
21355
+ child.offset({
21356
+ x: 0,
21357
+ y: 0
21358
+ });
21359
+ child.setAbsolutePosition(absPos);
21360
+ child.scale({
21361
+ x: absScale.x / stage.scaleX(),
21362
+ y: absScale.y / stage.scaleY()
21363
+ });
21364
+ child.rotation(absRotation);
21365
+ child.zIndex(newLayerChildrenAmount - 1 + child.zIndex());
21366
+ child.setAttr("draggable", true);
21367
+ newChildId = child.getAttrs().id;
21368
+ const handler = this.instance.getNodeHandler(child.getAttrs().nodeType);
21369
+ if (handler) {
21370
+ const node = handler.serialize(child);
21371
+ const newNodeId = v4_default();
21372
+ const oldId = node.key;
21373
+ node.key = newNodeId;
21374
+ node.props.id = newNodeId;
21375
+ for (const prop of Object.keys(node.props)) if (typeof node.props[prop] === "string") node.props[prop] = node.props[prop].replace(oldId, newNodeId);
21376
+ this.instance.addNodeNT(node, nodeId ?? newLayer.getAttrs().id);
21377
+ }
21378
+ child.destroy();
21379
+ }
21380
+ const groupHandler = this.instance.getNodeHandler("group");
21381
+ if (groupHandler) {
21382
+ const groupNode = groupHandler.serialize(konvaGroup);
21383
+ this.instance.removeNodeNT(groupNode, { emitUserChangeEvent: false });
21384
+ }
21385
+ setTimeout(() => {
21386
+ this.getNodesMultiSelectionFeedbackPlugin()?.cleanupSelectedHalos();
21387
+ const firstElement = newLayer.findOne(`#${newChildId}`);
21388
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21389
+ if (firstElement && selectionPlugin) selectionPlugin.setSelectedNodes([firstElement]);
21390
+ }, 0);
21391
+ });
21374
21392
  }
21375
21393
  extractTransformFromMatrix(m) {
21376
21394
  const a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5];
@@ -22168,7 +22186,7 @@ var WeaveRegisterManager = class {
22168
22186
 
22169
22187
  //#endregion
22170
22188
  //#region package.json
22171
- var version = "2.23.0";
22189
+ var version = "3.0.0-SNAPSHOT.14.1";
22172
22190
 
22173
22191
  //#endregion
22174
22192
  //#region src/managers/setup.ts
@@ -23014,6 +23032,41 @@ var WeaveUsersManager = class {
23014
23032
  }
23015
23033
  };
23016
23034
 
23035
+ //#endregion
23036
+ //#region src/managers/drag-and-drop.ts
23037
+ var WeaveDragAndDropManager = class {
23038
+ constructor(instance) {
23039
+ this.instance = instance;
23040
+ this.logger = this.instance.getChildLogger("drag-and-drop-manager");
23041
+ this.logger.debug("Drag and drop manager created");
23042
+ this.dragStarted = null;
23043
+ this.properties = null;
23044
+ }
23045
+ getDragStartedId() {
23046
+ return this.dragStarted;
23047
+ }
23048
+ isDragStarted() {
23049
+ return this.dragStarted !== null;
23050
+ }
23051
+ startDrag(id) {
23052
+ if (this.dragStarted !== null) throw new Error(`Drag already started with id ${this.dragStarted}`);
23053
+ this.dragStarted = id;
23054
+ this.properties = null;
23055
+ }
23056
+ getDragProperties() {
23057
+ return this.properties;
23058
+ }
23059
+ setDragProperties(properties) {
23060
+ if (this.dragStarted === null) throw new Error("Trying to set drag and drop properties without starting drag");
23061
+ this.properties = properties;
23062
+ }
23063
+ endDrag(id) {
23064
+ if (this.dragStarted !== id && this.dragStarted !== null) throw new Error(`Trying to end drag with id ${id} but drag started with id ${this.dragStarted}`);
23065
+ this.dragStarted = null;
23066
+ this.properties = null;
23067
+ }
23068
+ };
23069
+
23017
23070
  //#endregion
23018
23071
  //#region src/weave.ts
23019
23072
  var Weave = class {
@@ -23052,6 +23105,7 @@ var Weave = class {
23052
23105
  this.mutexManager = new WeaveMutexManager(this);
23053
23106
  this.asyncManager = new WeaveAsyncManager(this);
23054
23107
  this.hooksManager = new WeaveHooksManager(this);
23108
+ this.dragAndDropManager = new WeaveDragAndDropManager(this);
23055
23109
  this.setupManager.welcomeLog();
23056
23110
  }
23057
23111
  getRenderer() {
@@ -23092,8 +23146,6 @@ var Weave = class {
23092
23146
  this.moduleLogger.info("Start instance");
23093
23147
  if (!this.isServerSide()) {
23094
23148
  if (!window.weave) window.weave = this;
23095
- window.weaveTextEditing = {};
23096
- window.weaveDragImageURL = void 0;
23097
23149
  }
23098
23150
  this.emitEvent("onRoomLoaded", false);
23099
23151
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
@@ -23722,6 +23774,24 @@ var Weave = class {
23722
23774
  getUsers() {
23723
23775
  return this.usersManager.getUsers();
23724
23776
  }
23777
+ getDragStartedId() {
23778
+ return this.dragAndDropManager.getDragStartedId();
23779
+ }
23780
+ isDragStarted() {
23781
+ return this.dragAndDropManager.isDragStarted();
23782
+ }
23783
+ startDrag(id) {
23784
+ this.dragAndDropManager.startDrag(id);
23785
+ }
23786
+ endDrag(id) {
23787
+ this.dragAndDropManager.endDrag(id);
23788
+ }
23789
+ setDragProperties(properties) {
23790
+ this.dragAndDropManager.setDragProperties(properties);
23791
+ }
23792
+ getDragProperties() {
23793
+ return this.dragAndDropManager.getDragProperties();
23794
+ }
23725
23795
  };
23726
23796
 
23727
23797
  //#endregion
@@ -24553,7 +24623,7 @@ var WeaveTextNode = class extends WeaveNode {
24553
24623
  const nodeSelected = selectionPlugin?.getSelectedNodes().length === 1 && selectionPlugin?.getSelectedNodes()[0].getAttrs().nodeType === WEAVE_TEXT_NODE_TYPE ? selectionPlugin?.getSelectedNodes()[0] : null;
24554
24624
  if (this.isSelecting() && nodeSelected) {
24555
24625
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
24556
- if (nodesSelectionPlugin && nodesSelectionPlugin.getSelectedNodes().length === 1 && nodesSelectionPlugin.getSelectedNodes()[0].getAttrs().nodeType === WEAVE_TEXT_NODE_TYPE && !window.weaveTextEditing[nodesSelectionPlugin.getSelectedNodes()[0].id()]) this.triggerEditMode(nodesSelectionPlugin.getSelectedNodes()[0]);
24626
+ if (nodesSelectionPlugin && nodesSelectionPlugin.getSelectedNodes().length === 1 && nodesSelectionPlugin.getSelectedNodes()[0].getAttrs().nodeType === WEAVE_TEXT_NODE_TYPE && !this.editing) this.triggerEditMode(nodesSelectionPlugin.getSelectedNodes()[0]);
24557
24627
  }
24558
24628
  }
24559
24629
  };
@@ -24799,7 +24869,6 @@ var WeaveTextNode = class extends WeaveNode {
24799
24869
  this.textArea.style.pointerEvents = "auto";
24800
24870
  this.instance.addEventListener("onZoomChange", this.onZoomChangeHandler(textNode).bind(this));
24801
24871
  this.instance.addEventListener("onStageMove", this.onStageMoveHandler(textNode).bind(this));
24802
- window.weaveTextEditing[textNode.id()] = "editing";
24803
24872
  const upscaleScale = stage.getAttr("upscaleScale");
24804
24873
  this.textArea.value = textNode.text();
24805
24874
  this.textArea.id = textNode.id();
@@ -24866,10 +24935,12 @@ var WeaveTextNode = class extends WeaveNode {
24866
24935
  this.textArea.onfocus = () => {
24867
24936
  this.textAreaDomResize(textNode);
24868
24937
  };
24869
- this.textArea.onkeydown = () => {
24938
+ this.textArea.onkeydown = (e) => {
24939
+ e.stopPropagation();
24870
24940
  this.textAreaDomResize(textNode);
24871
24941
  };
24872
- this.textArea.onkeyup = () => {
24942
+ this.textArea.onkeyup = (e) => {
24943
+ e.stopPropagation();
24873
24944
  this.textAreaDomResize(textNode);
24874
24945
  };
24875
24946
  this.textArea.onpaste = () => {
@@ -25010,7 +25081,6 @@ var WeaveTextNode = class extends WeaveNode {
25010
25081
  this.instance.getStage().mode(WEAVE_STAGE_DEFAULT_MODE);
25011
25082
  this.editing = false;
25012
25083
  const stage = this.instance.getStage();
25013
- delete window.weaveTextEditing[textNode.id()];
25014
25084
  if (this.textAreaSuperContainer) this.textAreaSuperContainer.remove();
25015
25085
  textNode.visible(true);
25016
25086
  this.updateNode(textNode);
@@ -25076,6 +25146,7 @@ const WEAVE_IMAGE_CROP_ANCHOR_POSITION = {
25076
25146
  };
25077
25147
  const WEAVE_IMAGE_DEFAULT_CONFIG = {
25078
25148
  performance: { cache: { enabled: false } },
25149
+ style: { placeholder: { fill: "#aaaaaa" } },
25079
25150
  crossOrigin: "anonymous",
25080
25151
  cropMode: {
25081
25152
  gridLines: { enabled: true },
@@ -25647,6 +25718,7 @@ var WeaveImageNode = class extends WeaveNode {
25647
25718
  imageBitmapCache = {};
25648
25719
  imageSource = {};
25649
25720
  imageState = {};
25721
+ imageIconSource = null;
25650
25722
  nodeType = WEAVE_IMAGE_NODE_TYPE;
25651
25723
  constructor(params) {
25652
25724
  super();
@@ -25780,7 +25852,7 @@ var WeaveImageNode = class extends WeaveNode {
25780
25852
  rotation: 0,
25781
25853
  width: imageProps.width || 0,
25782
25854
  height: imageProps.height || 0,
25783
- fill: "#ccccccff",
25855
+ fill: this.config.style.placeholder.fill,
25784
25856
  strokeWidth: 0,
25785
25857
  draggable: false,
25786
25858
  visible: true
@@ -33403,12 +33475,15 @@ var WeaveTextToolAction = class extends WeaveAction {
33403
33475
  const IMAGE_TOOL_ACTION_NAME = "imageTool";
33404
33476
  const IMAGE_TOOL_STATE = {
33405
33477
  ["IDLE"]: "idle",
33406
- ["UPLOADING"]: "uploading",
33407
33478
  ["DEFINING_POSITION"]: "definingPosition",
33408
33479
  ["SELECTED_POSITION"]: "selectedPosition",
33409
33480
  ["ADDING"]: "adding",
33410
33481
  ["FINISHED"]: "finished"
33411
33482
  };
33483
+ const IMAGE_TOOL_LOAD_FROM = {
33484
+ ["DATAURL"]: "dataURL",
33485
+ ["URL"]: "url"
33486
+ };
33412
33487
 
33413
33488
  //#endregion
33414
33489
  //#region src/actions/image-tool/image-tool.ts
@@ -33444,16 +33519,18 @@ var WeaveImageToolAction = class extends WeaveAction {
33444
33519
  }
33445
33520
  onInit() {
33446
33521
  this.instance.addEventListener("onStageDrop", (e) => {
33447
- if (window.weaveDragImageURL) {
33522
+ const dragId = this.instance.getDragStartedId();
33523
+ const dragProperties = this.instance.getDragProperties();
33524
+ if (dragProperties && dragId === IMAGE_TOOL_ACTION_NAME) {
33448
33525
  this.instance.getStage().setPointersPositions(e);
33449
33526
  const position = getPositionRelativeToContainerOnPosition(this.instance);
33450
33527
  this.instance.triggerAction(IMAGE_TOOL_ACTION_NAME, {
33451
- imageURL: window.weaveDragImageURL,
33452
- imageId: window.weaveDragImageId,
33528
+ imageURL: dragProperties.imageURL,
33529
+ ...dragProperties.imageId && { imageId: dragProperties.imageId },
33530
+ ...dragProperties.imageWidth && { imageWidth: dragProperties.imageWidth },
33531
+ ...dragProperties.imageHeight && { imageHeight: dragProperties.imageHeight },
33453
33532
  position
33454
33533
  });
33455
- window.weaveDragImageURL = void 0;
33456
- window.weaveDragImageId = void 0;
33457
33534
  }
33458
33535
  });
33459
33536
  }
@@ -33501,17 +33578,29 @@ var WeaveImageToolAction = class extends WeaveAction {
33501
33578
  setState(state) {
33502
33579
  this.state = state;
33503
33580
  }
33504
- loadImage(imageURL, position) {
33581
+ loadImage(imageData, kind, position) {
33505
33582
  this.setCursor();
33506
33583
  this.setFocusStage();
33507
- this.imageId = v4_default();
33508
- this.imageURL = imageURL;
33584
+ if (!this.imageId) {
33585
+ this.cancelAction();
33586
+ return;
33587
+ }
33588
+ this.imageURL = kind === IMAGE_TOOL_LOAD_FROM.DATAURL ? "not-defined" : imageData;
33509
33589
  const imageNodeHandler = this.getImageNodeHandler();
33510
33590
  if (!imageNodeHandler) {
33511
33591
  this.cancelAction();
33512
33592
  return;
33513
33593
  }
33514
- imageNodeHandler.preloadImage(this.imageId, imageURL, {
33594
+ if (IMAGE_TOOL_LOAD_FROM.URL === kind) {
33595
+ this.props = {
33596
+ ...this.props,
33597
+ imageURL: this.imageURL,
33598
+ width: this.props.loadImageWidth,
33599
+ height: this.props.loadImageHeight
33600
+ };
33601
+ this.addImageNode(position);
33602
+ }
33603
+ imageNodeHandler.preloadImage(this.imageId, imageData, {
33515
33604
  onLoad: () => {
33516
33605
  this.instance.emitEvent("onImageLoadEnd", void 0);
33517
33606
  const imageSource = imageNodeHandler.getImageSource(this.imageId);
@@ -33578,10 +33667,6 @@ var WeaveImageToolAction = class extends WeaveAction {
33578
33667
  this.clickPoint = null;
33579
33668
  this.setState(IMAGE_TOOL_STATE.DEFINING_POSITION);
33580
33669
  }
33581
- addImage(position) {
33582
- if (position) this.clickPoint = position;
33583
- this.setState(IMAGE_TOOL_STATE.UPLOADING);
33584
- }
33585
33670
  handleAdding(position) {
33586
33671
  if (this.imageId) {
33587
33672
  const imageNodeHandler = this.getImageNodeHandler();
@@ -33590,7 +33675,7 @@ var WeaveImageToolAction = class extends WeaveAction {
33590
33675
  return;
33591
33676
  }
33592
33677
  const imageSource = imageNodeHandler.getImageSource(this.imageId);
33593
- if (!imageSource) {
33678
+ if (!imageSource && !position) {
33594
33679
  this.cancelAction();
33595
33680
  return;
33596
33681
  }
@@ -33598,6 +33683,8 @@ var WeaveImageToolAction = class extends WeaveAction {
33598
33683
  this.clickPoint = mousePoint;
33599
33684
  this.container = container;
33600
33685
  const nodeHandler = this.instance.getNodeHandler("image");
33686
+ const imageWidth = this.props.loadImageWidth ? this.props.loadImageWidth : imageSource?.width;
33687
+ const imageHeight = this.props.loadImageHeight ? this.props.loadImageHeight : imageSource?.height;
33601
33688
  if (nodeHandler) {
33602
33689
  const node = nodeHandler.create(this.imageId, {
33603
33690
  ...this.props,
@@ -33609,11 +33696,11 @@ var WeaveImageToolAction = class extends WeaveAction {
33609
33696
  stroke: "#000000ff",
33610
33697
  strokeWidth: 0,
33611
33698
  strokeScaleEnabled: true,
33612
- imageWidth: imageSource.width,
33613
- imageHeight: imageSource.height,
33699
+ imageWidth,
33700
+ imageHeight,
33614
33701
  imageInfo: {
33615
- width: imageSource.width,
33616
- height: imageSource.height
33702
+ width: imageWidth,
33703
+ height: imageHeight
33617
33704
  }
33618
33705
  });
33619
33706
  this.instance.addNode(node, this.forceMainContainer ? this.instance.getMainLayer()?.getAttrs().id : this.container?.getAttrs().id);
@@ -33633,14 +33720,31 @@ var WeaveImageToolAction = class extends WeaveAction {
33633
33720
  const selectionPlugin = this.instance.getPlugin("nodesSelection");
33634
33721
  if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
33635
33722
  this.forceMainContainer = params?.forceMainContainer ?? false;
33723
+ this.imageId = v4_default();
33724
+ this.props = this.initProps();
33636
33725
  if (params?.imageId) this.updateProps({ imageId: params.imageId });
33637
- if (params?.imageURL) {
33638
- this.loadImage(params.imageURL, params?.position ?? void 0);
33639
- return;
33726
+ if (params?.imageId) this.updateProps({ loadImageWidth: params.imageWidth });
33727
+ if (params?.imageId) this.updateProps({ loadImageHeight: params.imageHeight });
33728
+ if (params.imageData) this.loadImage(params.imageData, IMAGE_TOOL_LOAD_FROM.DATAURL, params?.position ?? void 0);
33729
+ if (params.imageURL) this.loadImage(params.imageURL, IMAGE_TOOL_LOAD_FROM.URL, params?.position ?? void 0);
33730
+ return {
33731
+ nodeId: this.imageId,
33732
+ finishUploadCallback: (nodeId, imageURL) => {
33733
+ return this.saveImageUrl.bind(this)(nodeId, imageURL);
33734
+ }
33735
+ };
33736
+ }
33737
+ saveImageUrl(nodeId, imageURL) {
33738
+ this.imageURL = imageURL;
33739
+ if (this.state !== IMAGE_TOOL_STATE.DEFINING_POSITION) {
33740
+ const stage = this.instance.getStage();
33741
+ const nodeHandler = this.instance.getNodeHandler("image");
33742
+ const node = stage.findOne(`#${nodeId}`);
33743
+ if (nodeHandler && node) {
33744
+ node.setAttr("imageURL", imageURL);
33745
+ this.instance.updateNode(nodeHandler.serialize(node));
33746
+ }
33640
33747
  }
33641
- this.props = this.initProps();
33642
- this.addImage();
33643
- return { finishUploadCallback: this.loadImage.bind(this) };
33644
33748
  }
33645
33749
  cleanup() {
33646
33750
  const stage = this.instance.getStage();
@@ -33652,6 +33756,7 @@ var WeaveImageToolAction = class extends WeaveAction {
33652
33756
  this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
33653
33757
  }
33654
33758
  stage.container().style.cursor = "default";
33759
+ this.instance.endDrag(IMAGE_TOOL_ACTION_NAME);
33655
33760
  this.initialCursor = null;
33656
33761
  this.imageId = null;
33657
33762
  this.forceMainContainer = false;
@@ -33674,6 +33779,10 @@ var WeaveImageToolAction = class extends WeaveAction {
33674
33779
  stage.container().blur();
33675
33780
  stage.container().focus();
33676
33781
  }
33782
+ setDragAndDropProperties(properties) {
33783
+ this.instance.startDrag(IMAGE_TOOL_ACTION_NAME);
33784
+ this.instance.setDragProperties(properties);
33785
+ }
33677
33786
  };
33678
33787
 
33679
33788
  //#endregion
@@ -35413,16 +35522,16 @@ var WeaveVideoToolAction = class extends WeaveAction {
35413
35522
  }
35414
35523
  onInit() {
35415
35524
  this.instance.addEventListener("onStageDrop", (e) => {
35416
- if (window.weaveDragVideoId && window.weaveDragVideoParams) {
35525
+ const dragId = this.instance.getDragStartedId();
35526
+ const dragProperties = this.instance.getDragProperties();
35527
+ if (dragProperties && dragId === VIDEO_TOOL_ACTION_NAME) {
35417
35528
  this.instance.getStage().setPointersPositions(e);
35418
35529
  const position = getPositionRelativeToContainerOnPosition(this.instance);
35419
35530
  this.instance.triggerAction(VIDEO_TOOL_ACTION_NAME, {
35420
- videoId: window.weaveDragVideoId,
35421
- videoParams: window.weaveDragVideoParams,
35531
+ videoId: dragProperties.videoId,
35532
+ videoParams: dragProperties.videoParams,
35422
35533
  position
35423
35534
  });
35424
- window.weaveDragVideoParams = void 0;
35425
- window.weaveDragVideoId = void 0;
35426
35535
  }
35427
35536
  });
35428
35537
  }
@@ -35525,6 +35634,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
35525
35634
  if (node) selectionPlugin.setSelectedNodes([node]);
35526
35635
  this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
35527
35636
  }
35637
+ this.instance.endDrag(VIDEO_TOOL_ACTION_NAME);
35528
35638
  stage.container().style.cursor = "default";
35529
35639
  this.initialCursor = null;
35530
35640
  this.videoId = null;
@@ -35538,6 +35648,10 @@ var WeaveVideoToolAction = class extends WeaveAction {
35538
35648
  const stage = this.instance.getStage();
35539
35649
  stage.container().style.cursor = "crosshair";
35540
35650
  }
35651
+ setDragAndDropProperties(properties) {
35652
+ this.instance.startDrag(VIDEO_TOOL_ACTION_NAME);
35653
+ this.instance.setDragProperties(properties);
35654
+ }
35541
35655
  };
35542
35656
 
35543
35657
  //#endregion
@@ -37597,7 +37711,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
37597
37711
  //#endregion
37598
37712
  //#region src/plugins/users-presence/users-presence.ts
37599
37713
  var WeaveUsersPresencePlugin = class extends WeavePlugin {
37600
- userPresence = {};
37601
37714
  onRender = void 0;
37602
37715
  constructor(params) {
37603
37716
  super();
@@ -37608,19 +37721,8 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
37608
37721
  getName() {
37609
37722
  return WEAVE_USERS_PRESENCE_PLUGIN_KEY;
37610
37723
  }
37611
- registerHooks() {
37612
- this.instance.registerHook("onPresenceUpdate:usersPresencePlugin", ({ node, presenceData }) => {
37613
- const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
37614
- const newProps = {
37615
- ...node.getAttrs(),
37616
- ...presenceData
37617
- };
37618
- nodeHandler?.onUpdate(node, newProps);
37619
- });
37620
- }
37621
37724
  onInit() {
37622
37725
  const stage = this.instance.getStage();
37623
- this.registerHooks();
37624
37726
  this.instance.addEventListener("onAwarenessChange", (changes) => {
37625
37727
  for (const change of changes) {
37626
37728
  if (!change[WEAVE_USER_PRESENCE_KEY]) continue;
@@ -37631,12 +37733,13 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
37631
37733
  const presenceInfo = userPresence[nodeId];
37632
37734
  if (this.config.getUser().id === presenceInfo.userId) continue;
37633
37735
  const nodeInstance = stage.findOne(`#${presenceInfo.nodeId}`);
37634
- if (nodeInstance) this.instance.runPhaseHooks("onPresenceUpdate", (hook) => {
37635
- hook({
37636
- node: nodeInstance,
37637
- presenceData: presenceInfo.attrs
37638
- });
37639
- });
37736
+ if (nodeInstance) {
37737
+ const newProps = {
37738
+ ...nodeInstance.getAttrs(),
37739
+ ...presenceInfo.attrs
37740
+ };
37741
+ nodeInstance.setAttrs(newProps);
37742
+ }
37640
37743
  }
37641
37744
  }
37642
37745
  });
@@ -37645,18 +37748,29 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
37645
37748
  const store = this.instance.getStore();
37646
37749
  store.setAwarenessInfo(WEAVE_USER_PRESENCE_KEY, this.userPresence);
37647
37750
  }
37648
- setPresence(nodeId, attrs) {
37751
+ setPresence(nodeId, attrs, forceUpdate = true) {
37649
37752
  const userInfo = this.config.getUser();
37650
37753
  this.userPresence[nodeId] = {
37651
37754
  userId: userInfo.id,
37652
37755
  nodeId,
37653
37756
  attrs
37654
37757
  };
37655
- this.sendPresence();
37758
+ if (forceUpdate) {
37759
+ this.sendPresence();
37760
+ setTimeout(() => {
37761
+ if (this.userPresence) {
37762
+ this.userPresence = {};
37763
+ this.sendPresence();
37764
+ }
37765
+ }, 250);
37766
+ }
37656
37767
  }
37657
- removePresence(nodeId) {
37658
- if (this.userPresence[nodeId]) delete this.userPresence[nodeId];
37768
+ forceSendPresence() {
37659
37769
  this.sendPresence();
37770
+ setTimeout(() => {
37771
+ this.userPresence = {};
37772
+ this.sendPresence();
37773
+ }, 250);
37660
37774
  }
37661
37775
  enable() {
37662
37776
  this.enabled = true;
@@ -38848,5 +38962,5 @@ function getJSONFromYjsBinary(actualState) {
38848
38962
  }
38849
38963
 
38850
38964
  //#endregion
38851
- export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, ARROW_TOOL_ACTION_NAME, ARROW_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, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, 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_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_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_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_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_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, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, 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, getBoundingBox, getExportBoundingBox, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, resetScale, weavejsToYjsBinary };
38965
+ export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, ARROW_TOOL_ACTION_NAME, ARROW_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, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_LOAD_FROM, IMAGE_TOOL_STATE, 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_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_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_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_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_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, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, 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, getBoundingBox, getExportBoundingBox, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, resetScale, weavejsToYjsBinary };
38852
38966
  //# sourceMappingURL=sdk.js.map