@inditextech/weave-sdk 3.7.1 → 3.8.0

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
@@ -15102,6 +15102,9 @@ var WeaveStore = class {
15102
15102
  getStateJson() {
15103
15103
  return JSON.parse(JSON.stringify(this.state, void 0, 2));
15104
15104
  }
15105
+ getRoomId() {
15106
+ return this.roomId;
15107
+ }
15105
15108
  getStateSnapshot() {
15106
15109
  const doc = this.getDocument();
15107
15110
  return yjs_default.encodeStateAsUpdate(doc);
@@ -18678,7 +18681,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18678
18681
  "bottom-right"
18679
18682
  ];
18680
18683
  this.taps = 0;
18681
- this.isCtrlMetaPressed = false;
18682
18684
  this.isSpaceKeyPressed = false;
18683
18685
  this.isDoubleTap = false;
18684
18686
  this.tapStart = null;
@@ -18778,12 +18780,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18778
18780
  }
18779
18781
  };
18780
18782
  stage.on("pointermove", (0, import_throttle.default)(handlePointerMoveInit, DEFAULT_THROTTLE_MS));
18781
- tr.on("transformstart", () => {
18783
+ tr.on("transformstart", (e) => {
18782
18784
  this.transformInProcess = true;
18783
18785
  this.triggerSelectedNodesEvent();
18784
18786
  const selectedNodes$1 = tr.nodes();
18785
18787
  for (const node of selectedNodes$1) {
18786
- node.handleMouseout();
18788
+ node.handleMouseout(e);
18787
18789
  if (node.getAttrs().strokeScaleEnabled !== false) {
18788
18790
  node.setAttr("strokeScaleEnabled", false);
18789
18791
  node.setAttr("_revertStrokeScaleEnabled", true);
@@ -18795,7 +18797,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18795
18797
  });
18796
18798
  });
18797
18799
  let nodeHovered = void 0;
18798
- tr.on("mousemove", () => {
18800
+ tr.on("mousemove", (e) => {
18799
18801
  if (this.dragInProcess) return;
18800
18802
  const pointerPos = stage.getPointerPosition();
18801
18803
  if (!pointerPos) return;
@@ -18805,13 +18807,13 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18805
18807
  if (shape) {
18806
18808
  const targetNode = this.instance.getInstanceRecursive(shape);
18807
18809
  if (targetNode && targetNode !== nodeHovered) {
18808
- this.instance.getStage().handleMouseover();
18809
- nodeHovered?.handleMouseout?.();
18810
- targetNode?.handleMouseover?.();
18810
+ this.instance.getStage().handleMouseover(e);
18811
+ nodeHovered?.handleMouseout?.(e);
18812
+ targetNode?.handleMouseover?.(e);
18811
18813
  nodeHovered = targetNode;
18812
18814
  }
18813
- targetNode?.handleMouseover?.();
18814
- } else nodeHovered?.handleMouseout?.();
18815
+ targetNode?.handleMouseover?.(e);
18816
+ } else nodeHovered?.handleMouseout?.(e);
18815
18817
  });
18816
18818
  tr.on("mouseover", () => {
18817
18819
  const nodesSelected = tr.nodes();
@@ -18820,16 +18822,16 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18820
18822
  stage.container().style.cursor = node.defineMousePointer() ?? "grab";
18821
18823
  } else stage.container().style.cursor = "grab";
18822
18824
  });
18823
- tr.on("mouseout", () => {
18824
- this.instance.getStage().handleMouseover?.();
18825
+ tr.on("mouseout", (e) => {
18826
+ this.instance.getStage().handleMouseover?.(e);
18825
18827
  nodeHovered = void 0;
18826
18828
  });
18827
- window.addEventListener("mouseout", () => {
18829
+ window.addEventListener("mouseout", (e) => {
18828
18830
  if (nodeHovered) {
18829
- nodeHovered.handleMouseout();
18831
+ nodeHovered.handleMouseout(e);
18830
18832
  nodeHovered = void 0;
18831
18833
  }
18832
- this.instance.getStage().handleMouseover?.();
18834
+ this.instance.getStage().handleMouseover?.(e);
18833
18835
  }, { signal: this.instance.getEventsController()?.signal });
18834
18836
  const handleTransform = (e) => {
18835
18837
  const moved = this.checkMoved(e);
@@ -18869,6 +18871,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18869
18871
  let selectedNodes = [];
18870
18872
  tr.on("dragstart", (e) => {
18871
18873
  this.dragInProcess = true;
18874
+ let isWheelMousePressed = false;
18875
+ if (e.evt.button === 1) isWheelMousePressed = true;
18872
18876
  const mainLayer = this.instance.getMainLayer();
18873
18877
  if (!mainLayer) return;
18874
18878
  initialPos = {
@@ -18880,7 +18884,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18880
18884
  this.saveDragSelectedNodes();
18881
18885
  if (this.getDragSelectedNodes().length > 1) this.setNodesOpacityOnDrag();
18882
18886
  selectedNodes = tr.nodes();
18883
- if (stage$1.isMouseWheelPressed()) {
18887
+ if (isWheelMousePressed) {
18884
18888
  e.cancelBubble = true;
18885
18889
  e.target.stopDrag();
18886
18890
  return;
@@ -18904,13 +18908,14 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18904
18908
  x: e.target.x(),
18905
18909
  y: e.target.y()
18906
18910
  };
18911
+ let isWheelMousePressed = false;
18912
+ if (e.evt.button === 1) isWheelMousePressed = true;
18907
18913
  e.cancelBubble = true;
18908
18914
  if (initialPos) {
18909
18915
  const moved = this.checkMovedDrag(initialPos, actualPos);
18910
18916
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
18911
18917
  }
18912
- const stage$1 = this.instance.getStage();
18913
- if (stage$1.isMouseWheelPressed()) {
18918
+ if (isWheelMousePressed) {
18914
18919
  e.cancelBubble = true;
18915
18920
  e.target.stopDrag();
18916
18921
  return;
@@ -19020,16 +19025,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19020
19025
  tr.forceUpdate();
19021
19026
  }
19022
19027
  });
19023
- this.instance.addEventListener("onRender", () => {
19024
- const point = stage.getPointerPosition();
19025
- if (point) {
19026
- const ele = this.instance.getTargetingManager().pointIntersectsElement(point);
19027
- if (ele) {
19028
- const realEle = this.instance.getTargetingManager().resolveNode(ele);
19029
- realEle?.handleMouseover();
19030
- }
19031
- }
19032
- });
19033
19028
  this.instance.addEventListener("onNodesChange", () => {
19034
19029
  const currentSelectedNodes = tr.nodes();
19035
19030
  const unselectedNodes = this.prevSelectedNodes.filter((node) => !currentSelectedNodes.map((node1) => node1.getAttrs().id).includes(node.getAttrs().id));
@@ -19236,12 +19231,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19236
19231
  initEvents() {
19237
19232
  this.selecting = false;
19238
19233
  const stage = this.instance.getStage();
19239
- window.addEventListener("blur", () => {
19240
- this.isCtrlMetaPressed = false;
19241
- this.isSpaceKeyPressed = false;
19242
- }, { signal: this.instance.getEventsController()?.signal });
19243
19234
  stage.container().addEventListener("keydown", (e) => {
19244
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
19245
19235
  if (e.code === "Space") this.isSpaceKeyPressed = true;
19246
19236
  if (e.code === "Backspace" || e.code === "Delete") {
19247
19237
  Promise.resolve().then(() => {
@@ -19251,7 +19241,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19251
19241
  }
19252
19242
  }, { signal: this.instance.getEventsController()?.signal });
19253
19243
  stage.container().addEventListener("keyup", (e) => {
19254
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
19255
19244
  if (e.code === "Space") this.isSpaceKeyPressed = false;
19256
19245
  }, { signal: this.instance.getEventsController()?.signal });
19257
19246
  stage.on("pointerdown", (e) => {
@@ -19303,7 +19292,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19303
19292
  this.selectionRectangle.width(0);
19304
19293
  this.selectionRectangle.height(0);
19305
19294
  this.selecting = true;
19306
- if (this.isCtrlMetaPressed) {
19295
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
19296
+ if (isCtrlOrMetaPressed) {
19307
19297
  const nodesSelected = this.tr.nodes();
19308
19298
  for (const node of nodesSelected) node.fire("onSelectionCleared", { bubbles: true });
19309
19299
  }
@@ -19523,7 +19513,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19523
19513
  nodeTargeted.dblClick();
19524
19514
  return;
19525
19515
  }
19526
- if (stage.isCmdCtrlPressed()) return;
19516
+ const isCtrlOrCmdPressed = e.evt.ctrlKey || e.evt.metaKey;
19517
+ if (isCtrlOrCmdPressed) return;
19527
19518
  if (!metaPressed) {
19528
19519
  this.tr.nodes([nodeTargeted]);
19529
19520
  this.tr.show();
@@ -20165,11 +20156,6 @@ const MOVE_TOOL_STATE = {
20165
20156
 
20166
20157
  //#endregion
20167
20158
  //#region src/nodes/node.ts
20168
- const augmentKonvaStageClass = () => {
20169
- Konva.Stage.prototype.isMouseWheelPressed = function() {
20170
- return false;
20171
- };
20172
- };
20173
20159
  const augmentKonvaNodeClass = (config) => {
20174
20160
  const { transform } = config ?? {};
20175
20161
  Konva.Node.prototype.getTransformerProperties = function() {
@@ -20476,6 +20462,8 @@ var WeaveNode = class {
20476
20462
  node.off("dragstart");
20477
20463
  node.on("dragstart", (e) => {
20478
20464
  const nodeTarget = e.target;
20465
+ let isWheelMousePressed = false;
20466
+ if (e.evt.button === 1) isWheelMousePressed = true;
20479
20467
  e.cancelBubble = true;
20480
20468
  this.getNodesSelectionFeedbackPlugin()?.hideSelectionHalo(nodeTarget);
20481
20469
  this.getSelectionPlugin()?.saveDragSelectedNodes();
@@ -20496,7 +20484,7 @@ var WeaveNode = class {
20496
20484
  return;
20497
20485
  }
20498
20486
  this.instance.emitEvent("onDrag", nodeTarget);
20499
- if (stage.isMouseWheelPressed()) {
20487
+ if (isWheelMousePressed) {
20500
20488
  e.cancelBubble = true;
20501
20489
  nodeTarget.stopDrag();
20502
20490
  }
@@ -20513,6 +20501,7 @@ var WeaveNode = class {
20513
20501
  originalNode = realNodeTarget.clone();
20514
20502
  originalContainer = realNodeTarget.getParent();
20515
20503
  if (originalContainer?.getAttrs().nodeId) originalContainer = stage.findOne(`#${originalContainer.getAttrs().nodeId}`);
20504
+ realNodeTarget.fire("nodeDragStart", { node: realNodeTarget });
20516
20505
  if (e.evt?.altKey) {
20517
20506
  nodeTarget.setAttrs({ isCloneOrigin: true });
20518
20507
  nodeTarget.setAttrs({ isCloned: false });
@@ -20541,19 +20530,20 @@ var WeaveNode = class {
20541
20530
  });
20542
20531
  const handleDragMove = (e) => {
20543
20532
  const nodeTarget = e.target;
20533
+ let isWheelMousePressed = false;
20534
+ if (e.evt.button === 1) isWheelMousePressed = true;
20544
20535
  e.cancelBubble = true;
20545
20536
  if (e.evt?.buttons === 0) {
20546
20537
  nodeTarget.stopDrag();
20547
20538
  return;
20548
20539
  }
20549
20540
  this.didMove = true;
20550
- const stage$1 = this.instance.getStage();
20551
20541
  const isErasing = this.instance.getActiveAction() === "eraseTool";
20552
20542
  if (isErasing) {
20553
20543
  nodeTarget.stopDrag();
20554
20544
  return;
20555
20545
  }
20556
- if (stage$1.isMouseWheelPressed()) {
20546
+ if (isWheelMousePressed) {
20557
20547
  e.cancelBubble = true;
20558
20548
  nodeTarget.stopDrag();
20559
20549
  return;
@@ -20667,11 +20657,11 @@ var WeaveNode = class {
20667
20657
  originalPosition = realNodeTarget.getAbsolutePosition();
20668
20658
  });
20669
20659
  if (!node.getAttrs().overridesMouseControl) {
20670
- node.handleMouseover = () => {
20671
- this.handleMouseOver(node);
20660
+ node.handleMouseover = (e) => {
20661
+ this.handleMouseOver(e, node);
20672
20662
  };
20673
- node.handleMouseout = () => {
20674
- this.handleMouseout(node);
20663
+ node.handleMouseout = (e) => {
20664
+ this.handleMouseout(e, node);
20675
20665
  };
20676
20666
  }
20677
20667
  node.on("xChange yChange", () => {
@@ -20699,20 +20689,21 @@ var WeaveNode = class {
20699
20689
  };
20700
20690
  node.on("pointerover", (e) => {
20701
20691
  const realNodeTarget = this.getRealSelectedNode(e.target);
20702
- realNodeTarget?.handleMouseover?.();
20703
- const doCancelBubble = this.handleMouseOver(e.target);
20692
+ realNodeTarget?.handleMouseover?.(e);
20693
+ const doCancelBubble = this.handleMouseOver(e, e.target);
20704
20694
  if (doCancelBubble) e.cancelBubble = true;
20705
20695
  });
20706
20696
  node.on("pointerleave", (e) => {
20707
20697
  const realNodeTarget = this.getRealSelectedNode(e.target);
20708
- realNodeTarget?.handleMouseout?.();
20709
- this.handleMouseout(e.target);
20698
+ realNodeTarget?.handleMouseout?.(e);
20699
+ this.handleMouseout(e, e.target);
20710
20700
  });
20711
20701
  }
20712
20702
  }
20713
- handleMouseOver(node) {
20703
+ handleMouseOver(e, node) {
20714
20704
  const stage = this.instance.getStage();
20715
- if (stage?.isCmdCtrlPressed?.()) return false;
20705
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20706
+ if (isCtrlOrMetaPressed) return false;
20716
20707
  const user = this.instance.getStore().getUser();
20717
20708
  const activeAction = this.instance.getActiveAction();
20718
20709
  const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
@@ -20746,9 +20737,9 @@ var WeaveNode = class {
20746
20737
  else this.hideHoverState();
20747
20738
  return cancelBubble;
20748
20739
  }
20749
- handleMouseout(node) {
20750
- const stage = this.instance.getStage();
20751
- if (stage?.isCmdCtrlPressed?.()) return;
20740
+ handleMouseout(e, node) {
20741
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
20742
+ if (isCtrlOrMetaPressed) return;
20752
20743
  const realNode = this.instance.getInstanceRecursive(node);
20753
20744
  if (realNode) this.hideHoverState();
20754
20745
  }
@@ -22022,7 +22013,7 @@ var WeaveRegisterManager = class {
22022
22013
 
22023
22014
  //#endregion
22024
22015
  //#region package.json
22025
- var version = "3.7.1";
22016
+ var version = "3.8.0";
22026
22017
 
22027
22018
  //#endregion
22028
22019
  //#region src/managers/setup.ts
@@ -23468,7 +23459,6 @@ var Weave = class {
23468
23459
  this.status = WEAVE_INSTANCE_STATUS.STARTING;
23469
23460
  this.emitEvent("onInstanceStatus", this.status);
23470
23461
  await this.registerManager.registerNodesHandlers();
23471
- this.augmentKonvaStageClass();
23472
23462
  this.augmentKonvaNodeClass();
23473
23463
  this.registerManager.registerPlugins();
23474
23464
  this.registerManager.registerActionsHandlers();
@@ -23540,9 +23530,6 @@ var Weave = class {
23540
23530
  getConfiguration() {
23541
23531
  return this.config;
23542
23532
  }
23543
- augmentKonvaStageClass() {
23544
- augmentKonvaStageClass();
23545
- }
23546
23533
  augmentKonvaNodeClass(config) {
23547
23534
  augmentKonvaNodeClass(config);
23548
23535
  }
@@ -24315,8 +24302,6 @@ const setupUpscaleStage = (instance, stage) => {
24315
24302
  var WeaveStageNode = class extends WeaveNode {
24316
24303
  nodeType = WEAVE_STAGE_NODE_TYPE;
24317
24304
  stageFocused = false;
24318
- wheelMousePressed = false;
24319
- isCmdCtrlPressed = false;
24320
24305
  globalEventsInitialized = false;
24321
24306
  initialize = void 0;
24322
24307
  onRender(props) {
@@ -24325,9 +24310,7 @@ var WeaveStageNode = class extends WeaveNode {
24325
24310
  mode: "default"
24326
24311
  });
24327
24312
  setupUpscaleStage(this.instance, stage);
24328
- this.wheelMousePressed = false;
24329
24313
  stage.isFocused = () => this.stageFocused;
24330
- stage.isMouseWheelPressed = () => this.wheelMousePressed;
24331
24314
  stage.position({
24332
24315
  x: 0,
24333
24316
  y: 0
@@ -24363,8 +24346,7 @@ var WeaveStageNode = class extends WeaveNode {
24363
24346
  };
24364
24347
  stage.handleMouseout = function() {};
24365
24348
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
24366
- stage.on("pointerdown", (e) => {
24367
- if (e.evt.button === 1) this.wheelMousePressed = true;
24349
+ stage.on("pointerdown", () => {
24368
24350
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
24369
24351
  });
24370
24352
  stage.on("pointermove", (e) => {
@@ -24378,9 +24360,8 @@ var WeaveStageNode = class extends WeaveNode {
24378
24360
  stage$1.container().style.cursor = "default";
24379
24361
  }
24380
24362
  });
24381
- stage.on("pointerup", (e) => {
24363
+ stage.on("pointerup", () => {
24382
24364
  const activeAction = this.instance.getActiveAction();
24383
- if (e.evt.button === 1) this.wheelMousePressed = false;
24384
24365
  if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) stage.container().style.cursor = "grab";
24385
24366
  });
24386
24367
  stage.on("pointerover", (e) => {
@@ -24392,7 +24373,6 @@ var WeaveStageNode = class extends WeaveNode {
24392
24373
  this.hideHoverState();
24393
24374
  if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
24394
24375
  });
24395
- stage.isCmdCtrlPressed = () => this.isCmdCtrlPressed;
24396
24376
  this.setupEvents();
24397
24377
  return stage;
24398
24378
  }
@@ -24400,12 +24380,8 @@ var WeaveStageNode = class extends WeaveNode {
24400
24380
  setupEvents() {
24401
24381
  if (this.globalEventsInitialized) return;
24402
24382
  if (this.instance.isServerSide()) return;
24403
- window.addEventListener("blur", () => {
24404
- this.isCmdCtrlPressed = false;
24405
- }, { signal: this.instance.getEventsController()?.signal });
24406
24383
  window.addEventListener("keydown", (e) => {
24407
24384
  if (this.isOnlyCtrlOrMeta(e)) {
24408
- this.isCmdCtrlPressed = true;
24409
24385
  this.instance.getStage().container().style.cursor = "default";
24410
24386
  const transformer = this.getSelectionPlugin()?.getTransformer();
24411
24387
  if (!transformer) return;
@@ -24416,7 +24392,6 @@ var WeaveStageNode = class extends WeaveNode {
24416
24392
  }, { signal: this.instance.getEventsController()?.signal });
24417
24393
  window.addEventListener("keyup", (e) => {
24418
24394
  if (!(e.ctrlKey || e.metaKey)) {
24419
- this.isCmdCtrlPressed = false;
24420
24395
  this.instance.getStage().container().style.cursor = "default";
24421
24396
  const transformer = this.getSelectionPlugin()?.getTransformer();
24422
24397
  if (!transformer) return;
@@ -25097,35 +25072,26 @@ var WeaveTextNode = class extends WeaveNode {
25097
25072
  }
25098
25073
  initialize() {
25099
25074
  this.keyPressHandler = void 0;
25100
- this.eventsInitialized = false;
25101
- this.isCtrlMetaPressed = false;
25102
25075
  this.textAreaSuperContainer = null;
25103
25076
  this.textAreaContainer = null;
25104
25077
  this.textArea = null;
25105
25078
  this.editing = false;
25106
25079
  this.textArea = null;
25107
25080
  }
25108
- initEvents() {
25109
- if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
25110
- window.addEventListener("blur", () => {
25111
- this.isCtrlMetaPressed = false;
25112
- }, { signal: this.instance.getEventsController()?.signal });
25113
- window.addEventListener("keydown", (e) => {
25114
- if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
25115
- }, { signal: this.instance.getEventsController()?.signal });
25116
- window.addEventListener("keyup", (e) => {
25117
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
25118
- }, { signal: this.instance.getEventsController()?.signal });
25119
- this.eventsInitialized = true;
25120
- }
25121
- }
25122
25081
  updateNode(nodeInstance) {
25123
25082
  const actNode = this.instance.getStage().findOne(`#${nodeInstance.id()}`);
25124
25083
  if (actNode) {
25125
25084
  const clonedText = actNode.clone();
25126
25085
  clonedText.setAttr("triggerEditMode", void 0);
25127
25086
  clonedText.setAttr("cancelEditMode", void 0);
25128
- this.instance.updateNode(this.serialize(clonedText));
25087
+ if (this.createNode && actNode.getAttrs().text !== "") {
25088
+ const actualContainer = actNode.getParent();
25089
+ actNode.destroy();
25090
+ const serializedNode = this.serialize(clonedText);
25091
+ this.instance.addNode(serializedNode, actualContainer?.getAttrs().id);
25092
+ } else if (this.createNode && actNode.getAttrs().text === "") actNode.destroy();
25093
+ else this.instance.updateNode(this.serialize(clonedText));
25094
+ this.createNode = false;
25129
25095
  clonedText.destroy();
25130
25096
  }
25131
25097
  }
@@ -25147,7 +25113,6 @@ var WeaveTextNode = class extends WeaveNode {
25147
25113
  }
25148
25114
  }
25149
25115
  onRender(props) {
25150
- this.initEvents();
25151
25116
  const text = new Konva.Text({
25152
25117
  ...props,
25153
25118
  name: "node",
@@ -25214,6 +25179,7 @@ var WeaveTextNode = class extends WeaveNode {
25214
25179
  text.setAttr("triggerEditMode", this.triggerEditMode.bind(this));
25215
25180
  let actualAnchor = void 0;
25216
25181
  text.on("transformstart", (e) => {
25182
+ const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
25217
25183
  this.instance.emitEvent("onTransform", e.target);
25218
25184
  actualAnchor = this.getNodesSelectionPlugin()?.getTransformer()?.getActiveAnchor();
25219
25185
  if (text.getAttrs().layout === TEXT_LAYOUT.SMART && [
@@ -25221,10 +25187,11 @@ var WeaveTextNode = class extends WeaveNode {
25221
25187
  "top-right",
25222
25188
  "bottom-left",
25223
25189
  "bottom-right"
25224
- ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && this.isCtrlMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25190
+ ].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && isCtrlOrMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
25225
25191
  else this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(false);
25226
25192
  if ([TEXT_LAYOUT.AUTO_HEIGHT, TEXT_LAYOUT.SMART].includes(text.getAttrs().layout) && ["middle-right", "middle-left"].includes(actualAnchor ?? "")) {
25227
25193
  text.wrap("word");
25194
+ text.scaleY(1);
25228
25195
  text.height(void 0);
25229
25196
  }
25230
25197
  e.cancelBubble = true;
@@ -25250,7 +25217,7 @@ var WeaveTextNode = class extends WeaveNode {
25250
25217
  text.setAttr("shouldUpdateOnTransform", false);
25251
25218
  text.getLayer()?.batchDraw();
25252
25219
  };
25253
- text.on("transform", (0, import_lodash.throttle)(handleTextTransform, DEFAULT_THROTTLE_MS));
25220
+ text.on("transform", handleTextTransform);
25254
25221
  const handleTransformEnd = () => {
25255
25222
  this.instance.emitEvent("onTransform", null);
25256
25223
  let definedSmartWidth = false;
@@ -25279,6 +25246,7 @@ var WeaveTextNode = class extends WeaveNode {
25279
25246
  definedSmartWidth = true;
25280
25247
  text.width(Math.ceil(text.width() * text.scaleX()));
25281
25248
  text.scaleX(1);
25249
+ text.scaleY(1);
25282
25250
  text.height(void 0);
25283
25251
  text.getLayer()?.batchDraw();
25284
25252
  text.height(Math.ceil(text.height()));
@@ -25293,7 +25261,7 @@ var WeaveTextNode = class extends WeaveNode {
25293
25261
  handleTransformEnd();
25294
25262
  });
25295
25263
  this.instance.addEventListener("onNodeRenderedAdded", (node) => {
25296
- if (node.id() === text.id() && node.getParent() !== text.getParent()) text.getAttr("cancelEditMode")?.();
25264
+ if (node.id() === text.id() && node.getParent() !== text.getParent() && this.editing) text.getAttr("cancelEditMode")?.();
25297
25265
  });
25298
25266
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
25299
25267
  this.keyPressHandler = this.handleKeyPress.bind(this);
@@ -25302,14 +25270,6 @@ var WeaveTextNode = class extends WeaveNode {
25302
25270
  return text;
25303
25271
  }
25304
25272
  onUpdate(nodeInstance, nextProps) {
25305
- const actualFontFamily = nodeInstance.getAttrs().fontFamily;
25306
- const actualFontSize = nodeInstance.getAttrs().fontSize;
25307
- const actualFontStyle = nodeInstance.getAttrs().fontStyle;
25308
- const actualFontVariant = nodeInstance.getAttrs().fontVariant;
25309
- const actualTextDecoration = nodeInstance.getAttrs().textDecoration;
25310
- const actualLineHeight = nodeInstance.getAttrs().lineHeight;
25311
- let updateNeeded = false;
25312
- if (actualFontFamily !== nextProps.fontFamily || actualFontSize !== nextProps.fontSize || actualFontStyle !== nextProps.fontStyle || actualFontVariant !== nextProps.fontVariant || actualTextDecoration !== nextProps.textDecoration || actualLineHeight !== nextProps.lineHeight) updateNeeded = true;
25313
25273
  nodeInstance.setAttrs({
25314
25274
  ...nextProps,
25315
25275
  ...!this.config.outline.enabled && { strokeEnabled: false },
@@ -25324,22 +25284,20 @@ var WeaveTextNode = class extends WeaveNode {
25324
25284
  let height = nextProps.height;
25325
25285
  if (nextProps.layout === TEXT_LAYOUT.AUTO_ALL) {
25326
25286
  const { width: textAreaWidth, height: textAreaHeight } = this.textRenderedSize(nextProps.text, nodeInstance);
25327
- width = textAreaWidth;
25328
- height = textAreaHeight;
25287
+ width = (textAreaWidth + 2) * nodeInstance.getAbsoluteScale().x;
25288
+ height = (textAreaHeight + 2) * nodeInstance.getAbsoluteScale().x;
25329
25289
  }
25330
25290
  if (nextProps.layout === TEXT_LAYOUT.SMART && !nextProps.smartFixedWidth) {
25331
25291
  const { width: textAreaWidth } = this.textRenderedSize(nextProps.text, nodeInstance);
25332
- width = textAreaWidth;
25292
+ width = textAreaWidth / this.instance.getStage().scaleX();
25333
25293
  height = void 0;
25334
25294
  }
25335
25295
  if (nextProps.layout === TEXT_LAYOUT.SMART && nextProps.smartFixedWidth) height = void 0;
25336
25296
  if (nextProps.layout === TEXT_LAYOUT.AUTO_HEIGHT) height = void 0;
25337
- if (nextProps.layout === TEXT_LAYOUT.FIXED) updateNeeded = false;
25338
25297
  nodeInstance.setAttrs({
25339
25298
  width,
25340
25299
  height
25341
25300
  });
25342
- if (updateNeeded) this.instance.updateNode(this.serialize(nodeInstance));
25343
25301
  if (this.editing) this.updateTextAreaDOM(nodeInstance);
25344
25302
  if (!this.editing) {
25345
25303
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -25387,14 +25345,17 @@ var WeaveTextNode = class extends WeaveNode {
25387
25345
  if (!this.textArea || !this.textAreaContainer) return;
25388
25346
  if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
25389
25347
  const { width: textAreaWidth } = this.textRenderedSize(this.textArea.value, textNode);
25390
- this.textAreaContainer.style.width = textAreaWidth * textNode.getAbsoluteScale().x + 1 + "px";
25348
+ const width = (textAreaWidth + 2) * textNode.getAbsoluteScale().x / this.instance.getStage().scaleX();
25349
+ this.textAreaContainer.style.width = width + "px";
25391
25350
  }
25392
25351
  if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.SMART) {
25393
25352
  this.textAreaContainer.style.height = "auto";
25394
- this.textAreaContainer.style.height = this.textArea.scrollHeight + textNode.getAbsoluteScale().y + "px";
25353
+ const height$1 = this.textArea.scrollHeight + textNode.getAbsoluteScale().y;
25354
+ this.textAreaContainer.style.height = height$1 + "px";
25395
25355
  }
25396
25356
  this.textArea.style.height = "auto";
25397
- this.textArea.style.height = this.textArea.scrollHeight + textNode.getAbsoluteScale().x + "px";
25357
+ const height = this.textArea.scrollHeight + textNode.getAbsoluteScale().y;
25358
+ this.textArea.style.height = height + "px";
25398
25359
  this.textArea.rows = this.textArea.value.split("\n").length;
25399
25360
  }
25400
25361
  measureMultilineText(textNode) {
@@ -25416,8 +25377,8 @@ var WeaveTextNode = class extends WeaveNode {
25416
25377
  height = height + textSize.height * (textNode.lineHeight() ?? 1);
25417
25378
  }
25418
25379
  return {
25419
- width: width * 1.01,
25420
- height
25380
+ width: width * this.instance.getStage().scaleX() * 1.01,
25381
+ height: height * this.instance.getStage().scaleX() * 1.01
25421
25382
  };
25422
25383
  }
25423
25384
  mimicTextNode(textNode) {
@@ -25426,7 +25387,7 @@ var WeaveTextNode = class extends WeaveNode {
25426
25387
  this.textArea.rows = textNode.text().split("\n").length;
25427
25388
  this.textArea.style.letterSpacing = `${textNode.letterSpacing()}`;
25428
25389
  this.textArea.style.opacity = `${textNode.getAttrs().opacity}`;
25429
- this.textArea.style.lineHeight = `${textNode.lineHeight()}`;
25390
+ this.textArea.style.lineHeight = `${textNode.lineHeight()}em`;
25430
25391
  this.textArea.style.fontFamily = textNode.fontFamily();
25431
25392
  let fontWeight = "normal";
25432
25393
  let fontStyle = "normal";
@@ -25439,6 +25400,10 @@ var WeaveTextNode = class extends WeaveNode {
25439
25400
  this.textArea.style.textDecoration = textNode.textDecoration();
25440
25401
  this.textArea.style.textAlign = textNode.align();
25441
25402
  this.textArea.style.color = `${textNode.fill()}`;
25403
+ if (this.config.outline.enabled) {
25404
+ this.textArea.style.paintOrder = "stroke fill";
25405
+ this.textArea.style.webkitTextStroke = `${this.config.outline.width * this.instance.getStage().scaleX()}px ${this.config.outline.color}`;
25406
+ }
25442
25407
  }
25443
25408
  createTextAreaDOM(textNode, position) {
25444
25409
  const stage = this.instance.getStage();
@@ -25477,19 +25442,19 @@ var WeaveTextNode = class extends WeaveNode {
25477
25442
  this.textAreaContainer.style.left = position.x * upscaleScale + "px";
25478
25443
  if (textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
25479
25444
  const rect = textNode.getClientRect({ relativeTo: stage });
25480
- this.textAreaContainer.style.width = (rect.width + 2) * stage.scaleX() + "px";
25481
- this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2 + 1) * textNode.getAbsoluteScale().x + "px";
25445
+ this.textAreaContainer.style.width = (rect.width + 2) * textNode.getAbsoluteScale().x + "px";
25446
+ this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
25482
25447
  }
25483
25448
  if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
25484
25449
  const rect = textNode.getClientRect({ relativeTo: stage });
25485
- this.textAreaContainer.style.width = (rect.width + 2) * stage.scaleX() + "px";
25486
- this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2 + 1) * textNode.getAbsoluteScale().x + "px";
25450
+ this.textAreaContainer.style.width = (rect.width + 2) * textNode.getAbsoluteScale().x + "px";
25451
+ this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
25487
25452
  }
25488
25453
  if (textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && textNode.getAttrs().smartFixedWidth) {
25489
25454
  const rect = textNode.getClientRect({ relativeTo: stage });
25490
- this.textAreaContainer.style.width = (rect.width + 10) * stage.scaleX() + "px";
25491
- if (textNode.getAttrs().smartFixedWidth) this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2 + 1) * textNode.getAbsoluteScale().x + "px";
25492
- this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2 + 1) * textNode.getAbsoluteScale().x + "px";
25455
+ this.textAreaContainer.style.width = (rect.width + 10) * textNode.getAbsoluteScale().x + "px";
25456
+ if (textNode.getAttrs().smartFixedWidth) this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
25457
+ this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
25493
25458
  }
25494
25459
  if (textNode.getAttrs().layout === TEXT_LAYOUT.FIXED) {
25495
25460
  this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
@@ -25499,6 +25464,7 @@ var WeaveTextNode = class extends WeaveNode {
25499
25464
  this.textArea.style.position = "absolute";
25500
25465
  this.textArea.style.top = "0px";
25501
25466
  this.textArea.style.left = "0px";
25467
+ this.textArea.style.lineHeight = "1em";
25502
25468
  this.textArea.style.overscrollBehavior = "contains";
25503
25469
  this.textArea.style.scrollBehavior = "auto";
25504
25470
  this.textArea.style.caretColor = "black";
@@ -25507,31 +25473,22 @@ var WeaveTextNode = class extends WeaveNode {
25507
25473
  this.textArea.style.margin = "0px";
25508
25474
  this.textArea.style.padding = "0px";
25509
25475
  this.textArea.style.paddingTop = "0px";
25510
- this.textArea.style.boxSizing = "content-box";
25476
+ this.textArea.style.boxSizing = "border-box";
25511
25477
  this.textArea.style.overflow = "hidden";
25512
25478
  this.textArea.style.background = "transparent";
25513
25479
  this.textArea.style.border = "none";
25514
25480
  this.textArea.style.outline = "none";
25515
25481
  this.textArea.style.resize = "none";
25516
25482
  this.textArea.style.overflow = "hidden";
25483
+ if (this.config.outline.enabled) {
25484
+ this.textArea.style.paintOrder = "stroke fill";
25485
+ this.textArea.style.webkitTextStroke = `${this.config.outline.width * this.instance.getStage().scaleX()}px ${this.config.outline.color}`;
25486
+ }
25517
25487
  this.textArea.style.backgroundColor = "transparent";
25518
25488
  this.textAreaContainer.style.transformOrigin = "left top";
25519
25489
  this.mimicTextNode(textNode);
25520
- const loadedFonts = this.instance.getFonts();
25521
- const fontFamily = this.textArea.style.fontFamily;
25522
- const actualFont = loadedFonts.find((f) => f.name === fontFamily);
25523
- const correctionX = (actualFont === void 0 ? 0 : actualFont.offsetX ?? 0) * stage.scaleX();
25524
- const correctionY = (actualFont === void 0 ? 0 : actualFont.offsetY ?? 0) * stage.scaleX();
25525
- this.textArea.style.left = `${correctionX - 1}px`;
25526
- this.textArea.style.top = `${correctionY}px`;
25527
- const updateTextNode = () => {
25528
- if (!this.textArea) return;
25529
- updateTextNodeSize();
25530
- textNode.text(this.textArea.value);
25531
- textNode.visible(true);
25532
- this.instance.updateNode(this.serialize(textNode));
25533
- };
25534
- const throttledUpdateTextNode = (0, import_lodash.throttle)(updateTextNode, 300);
25490
+ this.textArea.style.left = `-1px`;
25491
+ this.textArea.style.top = `-1px`;
25535
25492
  this.textArea.onfocus = () => {
25536
25493
  this.textAreaDomResize(textNode);
25537
25494
  };
@@ -25545,11 +25502,9 @@ var WeaveTextNode = class extends WeaveNode {
25545
25502
  };
25546
25503
  this.textArea.onpaste = () => {
25547
25504
  this.textAreaDomResize(textNode);
25548
- throttledUpdateTextNode();
25549
25505
  };
25550
25506
  this.textArea.oninput = () => {
25551
25507
  this.textAreaDomResize(textNode);
25552
- throttledUpdateTextNode();
25553
25508
  };
25554
25509
  this.textAreaSuperContainer.addEventListener("scroll", () => {
25555
25510
  if (this.textAreaSuperContainer) {
@@ -25576,7 +25531,8 @@ var WeaveTextNode = class extends WeaveNode {
25576
25531
  if (!this.textArea) return;
25577
25532
  if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
25578
25533
  const { width: textAreaWidth } = this.textRenderedSize(this.textArea.value, textNode);
25579
- textNode.width(textAreaWidth);
25534
+ const width = textAreaWidth / this.instance.getStage().scaleX();
25535
+ textNode.width(width);
25580
25536
  }
25581
25537
  if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART) textNode.height(this.textArea.scrollHeight * (1 / textNode.getAbsoluteScale().x));
25582
25538
  };
@@ -25697,7 +25653,8 @@ var WeaveTextNode = class extends WeaveNode {
25697
25653
  stage.container().focus();
25698
25654
  this.instance.emitEvent("onExitTextNodeEditMode", { node: textNode });
25699
25655
  }
25700
- triggerEditMode(textNode) {
25656
+ triggerEditMode(textNode, create = false) {
25657
+ if (create) this.createNode = true;
25701
25658
  const lockAcquired = this.instance.setMutexLock({
25702
25659
  nodeIds: [textNode.id()],
25703
25660
  operation: "text-edit"
@@ -26142,7 +26099,8 @@ var WeaveImageCrop = class WeaveImageCrop {
26142
26099
  this.onClose();
26143
26100
  const utilityLayer = this.instance.getUtilityLayer();
26144
26101
  utilityLayer?.destroyChildren();
26145
- if (stage.isCmdCtrlPressed() && utilityLayer) {
26102
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
26103
+ if (isCtrlOrMetaPressed && utilityLayer) {
26146
26104
  this.node.renderCropMode(utilityLayer, this.image);
26147
26105
  utilityLayer.show();
26148
26106
  }
@@ -26678,23 +26636,36 @@ var WeaveImageNode = class extends WeaveNode {
26678
26636
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26679
26637
  }
26680
26638
  });
26639
+ image.on("nodeDragStart", () => {
26640
+ const utilityLayer = this.instance.getUtilityLayer();
26641
+ if (!utilityLayer) return;
26642
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
26643
+ nodes.forEach((n) => {
26644
+ n.destroy();
26645
+ });
26646
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26647
+ if (!transformer) return;
26648
+ transformer.show();
26649
+ });
26681
26650
  if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26682
26651
  image.on("onCmdCtrlPressed", () => {
26652
+ const utilityLayer = this.instance.getUtilityLayer();
26653
+ if (!utilityLayer) return;
26654
+ if (image.isDragging()) return;
26683
26655
  const transformer = this.getSelectionPlugin()?.getTransformer();
26684
26656
  if (!transformer) return;
26685
26657
  transformer.hide();
26686
- const utilityLayer = this.instance.getUtilityLayer();
26687
- if (!utilityLayer) return;
26688
26658
  utilityLayer?.destroyChildren();
26689
26659
  this.renderCropMode(utilityLayer, image);
26690
26660
  utilityLayer?.show();
26691
26661
  });
26692
26662
  image.on("onCmdCtrlReleased", () => {
26663
+ const utilityLayer = this.instance.getUtilityLayer();
26664
+ if (!utilityLayer) return;
26665
+ if (image.isDragging()) return;
26693
26666
  const transformer = this.getSelectionPlugin()?.getTransformer();
26694
26667
  if (!transformer) return;
26695
26668
  transformer.show();
26696
- const utilityLayer = this.instance.getUtilityLayer();
26697
- if (!utilityLayer) return;
26698
26669
  utilityLayer?.destroyChildren();
26699
26670
  });
26700
26671
  }
@@ -26753,6 +26724,7 @@ var WeaveImageNode = class extends WeaveNode {
26753
26724
  fill: "transparent",
26754
26725
  strokeScaleEnabled: false,
26755
26726
  strokeWidth: 2,
26727
+ name: "cropMode",
26756
26728
  stroke: "#1a1aff",
26757
26729
  draggable: false,
26758
26730
  listening: false,
@@ -26813,6 +26785,7 @@ var WeaveImageNode = class extends WeaveNode {
26813
26785
  }));
26814
26786
  const anchor = new Konva.Rect({
26815
26787
  draggable: false,
26788
+ name: "cropMode",
26816
26789
  rotation: node.rotation()
26817
26790
  });
26818
26791
  this.config.cropMode.selection.anchorStyleFunc(anchor, position);
@@ -27255,6 +27228,11 @@ var WeaveImageNode = class extends WeaveNode {
27255
27228
  const nodeId = nodeInstance.getAttrs().id ?? "";
27256
27229
  const isMoveContainer = nodeInstance.getAttr("onMoveContainer");
27257
27230
  nodeInstance.setAttr("onMoveContainer", void 0);
27231
+ const utilityLayer = this.instance.getUtilityLayer();
27232
+ const nodes = utilityLayer?.find(".cropMode") ?? [];
27233
+ nodes.forEach((n) => {
27234
+ n.destroy();
27235
+ });
27258
27236
  if (this.imageTryoutIds[nodeId]) {
27259
27237
  clearTimeout(this.imageTryoutIds[nodeId]);
27260
27238
  delete this.imageTryoutIds[nodeId];
@@ -29859,16 +29837,16 @@ var WeaveVideoNode = class extends WeaveNode {
29859
29837
  }
29860
29838
  if (isServer()) this.instance.updateNode(this.serialize(videoGroup));
29861
29839
  const defaultHandleMouseover = videoGroup.handleMouseover;
29862
- videoGroup.handleMouseover = () => {
29863
- defaultHandleMouseover.call(this);
29840
+ videoGroup.handleMouseover = (e) => {
29841
+ defaultHandleMouseover.call(this, e);
29864
29842
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded) {
29865
29843
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29866
29844
  videoProgress?.show();
29867
29845
  }
29868
29846
  };
29869
29847
  const defaultHandleMouseout = videoGroup.handleMouseout;
29870
- videoGroup.handleMouseout = () => {
29871
- defaultHandleMouseout.call(this);
29848
+ videoGroup.handleMouseout = (e) => {
29849
+ defaultHandleMouseout.call(e, this);
29872
29850
  if (this.config.style.track.onlyOnHover && this.videoState[id].loaded && !this.videoState[id].paused) {
29873
29851
  const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
29874
29852
  videoProgress?.hide();
@@ -32138,7 +32116,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32138
32116
  this.zooming = false;
32139
32117
  this.isTrackpad = false;
32140
32118
  this.zoomVelocity = 0;
32141
- this.isCtrlOrMetaPressed = false;
32142
32119
  this.updatedMinimumZoom = false;
32143
32120
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
32144
32121
  this.actualScale = this.config.zoomSteps[this.actualStep];
@@ -32449,15 +32426,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32449
32426
  };
32450
32427
  }
32451
32428
  initEvents() {
32452
- window.addEventListener("blur", () => {
32453
- this.isCtrlOrMetaPressed = false;
32454
- }, { signal: this.instance.getEventsController()?.signal });
32455
- window.addEventListener("keydown", (e) => {
32456
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32457
- }, { signal: this.instance.getEventsController()?.signal });
32458
- window.addEventListener("keyup", (e) => {
32459
- if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32460
- }, { signal: this.instance.getEventsController()?.signal });
32461
32429
  const stage = this.instance.getStage();
32462
32430
  let lastCenter = null;
32463
32431
  let lastDist = 0;
@@ -32539,7 +32507,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32539
32507
  });
32540
32508
  let doZoom = false;
32541
32509
  const handleWheelImmediate = (e) => {
32542
- const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32510
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
32511
+ const performZoom = isCtrlOrMetaPressed || !isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
32543
32512
  const mouseX = e.clientX;
32544
32513
  const mouseY = e.clientY;
32545
32514
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -34282,6 +34251,7 @@ var WeaveTextToolAction = class extends WeaveAction {
34282
34251
  fontFamily: "Arial, sans-serif",
34283
34252
  fill: "#000000",
34284
34253
  align: "left",
34254
+ lineHeight: 1,
34285
34255
  verticalAlign: "top",
34286
34256
  strokeEnabled: false
34287
34257
  };
@@ -34335,7 +34305,8 @@ var WeaveTextToolAction = class extends WeaveAction {
34335
34305
  y: this.clickPoint?.y ?? 0,
34336
34306
  draggable: true
34337
34307
  });
34338
- this.instance.addNode(node, this.container?.getAttrs().id);
34308
+ const renderedNode = nodeHandler.onRender(node.props);
34309
+ this.container.add(renderedNode);
34339
34310
  this.instance.emitEvent("onAddedArrow");
34340
34311
  }
34341
34312
  this.setState(TEXT_TOOL_STATE.FINISHED);
@@ -34360,7 +34331,7 @@ var WeaveTextToolAction = class extends WeaveAction {
34360
34331
  this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
34361
34332
  }
34362
34333
  const node = stage.findOne(`#${this.textId}`);
34363
- if (node) node.getAttr("triggerEditMode")(node);
34334
+ if (node) node.getAttr("triggerEditMode")(node, true);
34364
34335
  this.initialCursor = null;
34365
34336
  this.textId = null;
34366
34337
  this.container = void 0;
@@ -38141,7 +38112,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38141
38112
  this.moveToolActive = false;
38142
38113
  this.isMouseLeftButtonPressed = false;
38143
38114
  this.isMouseMiddleButtonPressed = false;
38144
- this.isCtrlOrMetaPressed = false;
38145
38115
  this.isSpaceKeyPressed = false;
38146
38116
  this.previousPointer = null;
38147
38117
  this.currentPointer = null;
@@ -38170,11 +38140,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38170
38140
  }
38171
38141
  initEvents() {
38172
38142
  const stage = this.instance.getStage();
38173
- window.addEventListener("blur", () => {
38174
- this.isCtrlOrMetaPressed = false;
38175
- }, { signal: this.instance.getEventsController()?.signal });
38176
38143
  window.addEventListener("keydown", (e) => {
38177
- if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
38178
38144
  if (e.code === "Space") {
38179
38145
  this.getContextMenuPlugin()?.disable();
38180
38146
  this.getNodesSelectionPlugin()?.disable();
@@ -38185,7 +38151,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38185
38151
  }
38186
38152
  }, { signal: this.instance.getEventsController()?.signal });
38187
38153
  window.addEventListener("keyup", (e) => {
38188
- if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
38189
38154
  if (e.code === "Space") {
38190
38155
  this.getContextMenuPlugin()?.enable();
38191
38156
  this.getNodesSelectionPlugin()?.enable();
@@ -38252,7 +38217,8 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38252
38217
  this.cleanupEdgeMoveIntervals();
38253
38218
  });
38254
38219
  const handleWheel = (e) => {
38255
- const performPanning = !this.isCtrlOrMetaPressed && !e.ctrlKey;
38220
+ const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
38221
+ const performPanning = !isCtrlOrMetaPressed && !e.ctrlKey;
38256
38222
  const mouseX = e.clientX;
38257
38223
  const mouseY = e.clientY;
38258
38224
  let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
@@ -38260,7 +38226,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
38260
38226
  const shadowHost = getTopmostShadowHost(stage.container());
38261
38227
  if (shadowHost) elementUnderMouse = shadowHost.elementFromPoint(mouseX, mouseY);
38262
38228
  }
38263
- if (!this.enabled || this.isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38229
+ if (!this.enabled || isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
38264
38230
  this.getContextMenuPlugin()?.cancelLongPressTimer();
38265
38231
  stage.x(stage.x() - e.deltaX);
38266
38232
  stage.y(stage.y() - e.deltaY);
@@ -40517,7 +40483,16 @@ var WeaveCommentsRendererPlugin = class extends WeavePlugin {
40517
40483
  //#endregion
40518
40484
  //#region src/plugins/stage-keyboard-move/constants.ts
40519
40485
  const WEAVE_STAGE_KEYBOARD_MOVE_KEY = "stageKeyboardMove";
40520
- const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40486
+ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = {
40487
+ movementDelta: 1,
40488
+ shiftMovementDelta: 10
40489
+ };
40490
+ const WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION = {
40491
+ ["UP"]: "up",
40492
+ ["DOWN"]: "down",
40493
+ ["LEFT"]: "left",
40494
+ ["RIGHT"]: "right"
40495
+ };
40521
40496
 
40522
40497
  //#endregion
40523
40498
  //#region src/plugins/stage-keyboard-move/stage-keyboard-move.ts
@@ -40532,25 +40507,31 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40532
40507
  getName() {
40533
40508
  return WEAVE_STAGE_KEYBOARD_MOVE_KEY;
40534
40509
  }
40535
- handleNodesMovement(movementOrientation) {
40510
+ handleNodesMovement(movementOrientation, { isShiftPressed }) {
40536
40511
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
40537
40512
  if (nodesSelectionPlugin) {
40538
40513
  const selectedNodes = nodesSelectionPlugin.getSelectedNodes();
40514
+ const movementDelta = isShiftPressed ? this.config.shiftMovementDelta : this.config.movementDelta;
40539
40515
  for (const node of selectedNodes) {
40540
40516
  switch (movementOrientation) {
40541
- case "up":
40542
- node.y(node.y() - this.config.movementDelta);
40517
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP:
40518
+ node.y(node.y() - movementDelta);
40543
40519
  break;
40544
- case "down":
40545
- node.y(node.y() + this.config.movementDelta);
40520
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN:
40521
+ node.y(node.y() + movementDelta);
40546
40522
  break;
40547
- case "left":
40548
- node.x(node.x() - this.config.movementDelta);
40523
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT:
40524
+ node.x(node.x() - movementDelta);
40549
40525
  break;
40550
- case "right":
40551
- node.x(node.x() + this.config.movementDelta);
40526
+ case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT:
40527
+ node.x(node.x() + movementDelta);
40552
40528
  break;
40553
40529
  }
40530
+ this.instance.emitEvent("onNodeKeyboardMove", {
40531
+ node,
40532
+ orientation: movementOrientation,
40533
+ delta: movementDelta
40534
+ });
40554
40535
  const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
40555
40536
  if (!nodeHandler) break;
40556
40537
  this.instance.updateNode(nodeHandler.serialize(node));
@@ -40559,10 +40540,11 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40559
40540
  }
40560
40541
  onInit() {
40561
40542
  window.addEventListener("keydown", (e) => {
40562
- if (e.code === "ArrowUp" && e.shiftKey) this.handleNodesMovement("up");
40563
- if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40564
- if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40565
- if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40543
+ const isShiftPressed = e.shiftKey || e.code === "Shift";
40544
+ if (e.code === "ArrowUp") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP, { isShiftPressed });
40545
+ if (e.code === "ArrowLeft") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT, { isShiftPressed });
40546
+ if (e.code === "ArrowRight") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT, { isShiftPressed });
40547
+ if (e.code === "ArrowDown") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN, { isShiftPressed });
40566
40548
  }, { signal: this.instance.getEventsController()?.signal });
40567
40549
  }
40568
40550
  enable() {
@@ -40620,4 +40602,4 @@ function getJSONFromYjsBinary(actualState) {
40620
40602
  }
40621
40603
 
40622
40604
  //#endregion
40623
- export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, weavejsToYjsBinary };
40605
+ export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, weavejsToYjsBinary };