@inditextech/weave-sdk 3.4.0-SNAPSHOT.85.1 → 3.4.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
@@ -32,13 +32,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  }) : target, mod));
33
33
 
34
34
  //#endregion
35
- //#region ../../node_modules/emittery/maps.js
35
+ //#region node_modules/emittery/maps.js
36
36
  const anyMap = new WeakMap();
37
37
  const eventsMap = new WeakMap();
38
38
  const producersMap = new WeakMap();
39
39
 
40
40
  //#endregion
41
- //#region ../../node_modules/emittery/index.js
41
+ //#region node_modules/emittery/index.js
42
42
  const anyProducer = Symbol("anyProducer");
43
43
  const resolvedPromise = Promise.resolve();
44
44
  const listenerAdded = Symbol("listenerAdded");
@@ -15084,11 +15084,6 @@ var WeaveStore = class {
15084
15084
  getDocument() {
15085
15085
  return this.document;
15086
15086
  }
15087
- restartDocument() {
15088
- this.latestState = { weave: {} };
15089
- this.state = syncedStore({ weave: {} });
15090
- this.document = getYjsDoc(this.state);
15091
- }
15092
15087
  loadDocument(roomData) {
15093
15088
  yjs_default.applyUpdate(this.document, roomData);
15094
15089
  }
@@ -17964,15 +17959,6 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17964
17959
  initLayer = void 0;
17965
17960
  constructor(params) {
17966
17961
  super();
17967
- const { config } = params ?? {};
17968
- this.config = {
17969
- xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17970
- yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17971
- ...config
17972
- };
17973
- this.initialize();
17974
- }
17975
- initialize() {
17976
17962
  this.timer = null;
17977
17963
  this.tapHold = false;
17978
17964
  this.contextMenuVisible = false;
@@ -17982,6 +17968,12 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17982
17968
  time: 0
17983
17969
  };
17984
17970
  this.tapHoldTimeout = WEAVE_CONTEXT_MENU_TAP_HOLD_TIMEOUT;
17971
+ const { config } = params ?? {};
17972
+ this.config = {
17973
+ xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17974
+ yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17975
+ ...config
17976
+ };
17985
17977
  this.pointers = {};
17986
17978
  }
17987
17979
  getName() {
@@ -18625,10 +18617,7 @@ const DEFAULT_ADD_NODE_OPTIONS = { emitUserChangeEvent: false };
18625
18617
  const DEFAULT_UPDATE_NODE_OPTIONS = { emitUserChangeEvent: false };
18626
18618
  const DEFAULT_REMOVE_NODE_OPTIONS = { emitUserChangeEvent: false };
18627
18619
  const DEFAULT_MOVE_NODE_OPTIONS = { emitUserChangeEvent: false };
18628
- const WEAVE_DEFAULT_CONFIG = {
18629
- behaviors: { axisLockThreshold: 5 },
18630
- performance: { upscale: { enabled: false } }
18631
- };
18620
+ const WEAVE_DEFAULT_CONFIG = { behaviors: { axisLockThreshold: 5 } };
18632
18621
 
18633
18622
  //#endregion
18634
18623
  //#region src/plugins/users-presence/constants.ts
@@ -18657,9 +18646,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18657
18646
  constructor(params) {
18658
18647
  super();
18659
18648
  this.config = mergeExceptArrays(WEAVE_NODES_SELECTION_DEFAULT_CONFIG, params?.config ?? {});
18660
- this.initialize();
18661
- }
18662
- initialize() {
18663
18649
  this.defaultEnabledAnchors = this.config.selection?.enabledAnchors ?? [
18664
18650
  "top-left",
18665
18651
  "top-center",
@@ -18823,7 +18809,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18823
18809
  nodeHovered = void 0;
18824
18810
  }
18825
18811
  this.instance.getStage().handleMouseover?.();
18826
- }, { signal: this.instance.getEventsController()?.signal });
18812
+ });
18827
18813
  const handleTransform = (e) => {
18828
18814
  const moved = this.checkMoved(e);
18829
18815
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
@@ -19238,11 +19224,11 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19238
19224
  });
19239
19225
  return;
19240
19226
  }
19241
- }, { signal: this.instance.getEventsController()?.signal });
19227
+ });
19242
19228
  stage.container().addEventListener("keyup", (e) => {
19243
19229
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
19244
19230
  if (e.code === "Space") this.isSpaceKeyPressed = false;
19245
- }, { signal: this.instance.getEventsController()?.signal });
19231
+ });
19246
19232
  stage.on("pointerdown", (e) => {
19247
19233
  this.setTapStart(e);
19248
19234
  this.handledClickOrTap = false;
@@ -19449,7 +19435,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19449
19435
  if (existNode) newSelectedNodes.push(existNode);
19450
19436
  }
19451
19437
  this.tr.nodes([...newSelectedNodes]);
19452
- if (newSelectedNodes.length > 0) this.tr.forceUpdate();
19438
+ this.tr.forceUpdate();
19453
19439
  this.triggerSelectedNodesEvent();
19454
19440
  }
19455
19441
  getSelectionPlugin() {
@@ -19702,9 +19688,6 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19702
19688
  super();
19703
19689
  this.getImageBase64 = params.getImageBase64;
19704
19690
  this.config = mergeExceptArrays(WEAVE_COPY_PASTE_CONFIG_DEFAULT, params?.config);
19705
- this.initialize();
19706
- }
19707
- initialize() {
19708
19691
  this.actualInternalPaddingX = 0;
19709
19692
  this.actualInternalPaddingY = 0;
19710
19693
  this.lastInternalPasteSnapshot = "";
@@ -19810,7 +19793,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19810
19793
  this.focusPasteCatcher();
19811
19794
  if (!this.enabled) return;
19812
19795
  }
19813
- }, { signal: this.instance.getEventsController()?.signal });
19796
+ });
19814
19797
  if (catcher) catcher.addEventListener("paste", async (e) => {
19815
19798
  e.preventDefault();
19816
19799
  let items = void 0;
@@ -19829,7 +19812,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19829
19812
  return;
19830
19813
  }
19831
19814
  this.sendExternalPasteEvent(void 0, items);
19832
- }, { signal: this.instance.getEventsController()?.signal });
19815
+ });
19833
19816
  }
19834
19817
  sendExternalPasteEvent(dataList, items) {
19835
19818
  const stage = this.instance.getStage();
@@ -21984,34 +21967,11 @@ var WeaveRegisterManager = class {
21984
21967
  }
21985
21968
  }
21986
21969
  }
21987
- resetNodesHandlers() {
21988
- for (const nodeHandlerId of Object.keys(this.nodesHandlers)) {
21989
- const nodeHandler = this.nodesHandlers[nodeHandlerId];
21990
- nodeHandler.initialize?.();
21991
- }
21992
- }
21993
- resetActionsHandlers() {
21994
- for (const actionHandlerId of Object.keys(this.actionsHandlers)) {
21995
- const actionHandler = this.actionsHandlers[actionHandlerId];
21996
- actionHandler.initialize?.();
21997
- }
21998
- }
21999
- resetPlugins() {
22000
- for (const pluginId of Object.keys(this.plugins)) {
22001
- const plugin = this.plugins[pluginId];
22002
- plugin.initialize?.();
22003
- }
22004
- }
22005
- reset() {
22006
- this.resetNodesHandlers();
22007
- this.resetActionsHandlers();
22008
- this.resetPlugins();
22009
- }
22010
21970
  };
22011
21971
 
22012
21972
  //#endregion
22013
21973
  //#region package.json
22014
- var version = "3.4.0-SNAPSHOT.85.1";
21974
+ var version = "3.4.0";
22015
21975
 
22016
21976
  //#endregion
22017
21977
  //#region src/managers/setup.ts
@@ -22128,11 +22088,6 @@ var WeaveStageManager = class {
22128
22088
  initialZIndex: void 0
22129
22089
  };
22130
22090
  const stage = new Konva.Stage({ ...props });
22131
- if (!this.instance.isServerSide()) {
22132
- const containerParent = stage.container().parentNode;
22133
- stage.width(containerParent.clientWidth);
22134
- stage.height(containerParent.clientHeight);
22135
- }
22136
22091
  const realContainer = stage.container();
22137
22092
  if (realContainer !== void 0 && realContainer.style?.position !== "relative") realContainer.style.position = "relative";
22138
22093
  this.setStage(stage);
@@ -22441,91 +22396,6 @@ var WeaveExportManager = class {
22441
22396
  height: imageHeight * pixelRatio
22442
22397
  };
22443
22398
  }
22444
- async exportAreaServerSide(area, options) {
22445
- const { format = WEAVE_EXPORT_FORMATS.PNG, padding = 0, pixelRatio = 1, backgroundColor = WEAVE_EXPORT_BACKGROUND_COLOR } = options;
22446
- this.getNodesSelectionPlugin()?.disable();
22447
- this.getNodesDistanceSnappingPlugin()?.disable();
22448
- this.getNodesEdgeSnappingPlugin()?.disable();
22449
- this.getStageGridPlugin()?.disable();
22450
- const stage = this.instance.getStage();
22451
- const mainLayer = this.instance.getMainLayer();
22452
- if (!mainLayer) throw new Error("Main layer not found");
22453
- const originalPosition = {
22454
- x: stage.x(),
22455
- y: stage.y()
22456
- };
22457
- const originalScale = {
22458
- x: stage.scaleX(),
22459
- y: stage.scaleY()
22460
- };
22461
- stage.scale({
22462
- x: 1,
22463
- y: 1
22464
- });
22465
- const bounds = area;
22466
- const scaleX = stage.scaleX();
22467
- const scaleY = stage.scaleY();
22468
- const unscaledBounds = {
22469
- x: bounds.x / scaleX,
22470
- y: bounds.y / scaleY,
22471
- width: bounds.width / scaleX,
22472
- height: bounds.height / scaleY
22473
- };
22474
- const background = new Konva.Rect({
22475
- x: unscaledBounds.x - padding,
22476
- y: unscaledBounds.y - padding,
22477
- width: unscaledBounds.width + 2 * padding,
22478
- height: unscaledBounds.height + 2 * padding,
22479
- strokeWidth: 0,
22480
- fill: backgroundColor
22481
- });
22482
- mainLayer.add(background);
22483
- background.moveToBottom();
22484
- const backgroundRect = background.getClientRect({ relativeTo: stage });
22485
- const composites = [];
22486
- const imageWidth = Math.round(backgroundRect.width);
22487
- const imageHeight = Math.round(backgroundRect.height);
22488
- const maxRenderSize = 1920;
22489
- const cols = Math.ceil(imageWidth / maxRenderSize);
22490
- const rows = Math.ceil(imageHeight / maxRenderSize);
22491
- const tileWidth = Math.floor(imageWidth / cols);
22492
- const tileHeight = Math.floor(imageHeight / rows);
22493
- for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22494
- const width = Math.min(tileWidth, imageWidth - x);
22495
- const height = Math.min(tileHeight, imageHeight - y);
22496
- const canvas = await mainLayer.toCanvas({
22497
- x: Math.round(backgroundRect.x) + x,
22498
- y: Math.round(backgroundRect.y) + y,
22499
- width,
22500
- height,
22501
- mimeType: format,
22502
- pixelRatio,
22503
- quality: options.quality ?? 1
22504
- });
22505
- let buffer = null;
22506
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.CANVAS) buffer = canvas.toBuffer();
22507
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.SKIA) buffer = await canvas.toBuffer();
22508
- if (!buffer) throw new Error("Failed to generate image buffer");
22509
- composites.push({
22510
- top: y * pixelRatio,
22511
- left: x * pixelRatio,
22512
- input: buffer
22513
- });
22514
- }
22515
- background.destroy();
22516
- stage.position(originalPosition);
22517
- stage.scale(originalScale);
22518
- stage.batchDraw();
22519
- this.getNodesSelectionPlugin()?.enable();
22520
- this.getNodesDistanceSnappingPlugin()?.enable();
22521
- this.getNodesEdgeSnappingPlugin()?.enable();
22522
- this.getStageGridPlugin()?.enable();
22523
- return {
22524
- composites,
22525
- width: imageWidth * pixelRatio,
22526
- height: imageHeight * pixelRatio
22527
- };
22528
- }
22529
22399
  imageToBase64(img, mimeType) {
22530
22400
  if (img.naturalWidth === 0 && img.naturalHeight === 0) throw new Error("Image has no content");
22531
22401
  const canvas = document.createElement("canvas");
@@ -22805,12 +22675,7 @@ var WeaveAsyncManager = class {
22805
22675
  this.instance.emitEvent("onAsyncElementChange");
22806
22676
  }, new Map());
22807
22677
  }
22808
- reset() {
22809
- this.asyncElements.clear();
22810
- this.asyncElementsLoadedEventEmitted = false;
22811
- }
22812
22678
  checkForAsyncElements(elements) {
22813
- this.instance.emitEvent("onAsyncElementsIdle");
22814
22679
  const amountAsyncResourcesExtracted = this.extractAsyncResources(elements);
22815
22680
  if (amountAsyncResourcesExtracted === 0 && !this.asyncElementsLoadedEventEmitted) {
22816
22681
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -22863,7 +22728,7 @@ var WeaveAsyncManager = class {
22863
22728
  status: WEAVE_ASYNC_STATUS.LOADING
22864
22729
  };
22865
22730
  this.asyncElements.set(nodeId, element);
22866
- if (!this.asyncElementsLoadedEventEmitted) this.instance.emitEvent("onAsyncElementsLoading", {
22731
+ this.instance.emitEvent("onAsyncElementsLoading", {
22867
22732
  loaded: this.getAmountAsyncElementsLoaded(),
22868
22733
  total: this.getAmountAsyncElements()
22869
22734
  });
@@ -22876,11 +22741,11 @@ var WeaveAsyncManager = class {
22876
22741
  status: WEAVE_ASYNC_STATUS.LOADED
22877
22742
  };
22878
22743
  this.asyncElements.set(nodeId, element);
22744
+ this.instance.emitEvent("onAsyncElementsLoading", {
22745
+ loaded: this.getAmountAsyncElementsLoaded(),
22746
+ total: this.getAmountAsyncElements()
22747
+ });
22879
22748
  if (!this.asyncElementsLoadedEventEmitted) {
22880
- this.instance.emitEvent("onAsyncElementsLoading", {
22881
- loaded: this.getAmountAsyncElementsLoaded(),
22882
- total: this.getAmountAsyncElements()
22883
- });
22884
22749
  const allLoaded = this.asyncElementsLoaded();
22885
22750
  if (allLoaded) {
22886
22751
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -23005,7 +22870,6 @@ var Weave = class {
23005
22870
  constructor(weaveConfig, stageConfig) {
23006
22871
  globalThis._weave_isServerSide = false;
23007
22872
  if (typeof window === "undefined") globalThis._weave_isServerSide = true;
23008
- this.eventsController = void 0;
23009
22873
  this.emitter = new Emittery();
23010
22874
  Konva.showWarnings = false;
23011
22875
  this.id = v4_default();
@@ -23051,7 +22915,6 @@ var Weave = class {
23051
22915
  this.initialized = true;
23052
22916
  this.status = WEAVE_INSTANCE_STATUS.RUNNING;
23053
22917
  this.emitEvent("onInstanceStatus", this.status);
23054
- this.emitEvent("onRender");
23055
22918
  });
23056
22919
  }
23057
22920
  setStatus(status) {
@@ -23076,7 +22939,6 @@ var Weave = class {
23076
22939
  async start() {
23077
22940
  this.moduleLogger.info("Start instance");
23078
22941
  if (!this.isServerSide()) {
23079
- this.eventsController = new AbortController();
23080
22942
  if (!window.weave) window.weave = this;
23081
22943
  }
23082
22944
  this.emitEvent("onRoomLoaded", false);
@@ -23100,39 +22962,8 @@ var Weave = class {
23100
22962
  store.setup();
23101
22963
  store.connect();
23102
22964
  }
23103
- async switchRoom() {
23104
- this.moduleLogger.info(`Switching room`);
23105
- const nodeHandlers = this.registerManager.getNodesHandlers();
23106
- for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23107
- const nodeHandler = nodeHandlers[nodeHandlerKey];
23108
- nodeHandler?.onDestroyInstance();
23109
- }
23110
- const stage = this.getStage();
23111
- if (stage) stage.destroy();
23112
- if (this.eventsController) this.eventsController.abort();
23113
- if (!this.isServerSide()) this.eventsController = new AbortController();
23114
- this.registerManager.reset();
23115
- this.asyncManager.reset();
23116
- this.moduleLogger.info("Switching room instance");
23117
- if (!this.isServerSide()) {
23118
- if (!window.weave) window.weave = this;
23119
- }
23120
- this.emitEvent("onRoomLoaded", false);
23121
- this.status = WEAVE_INSTANCE_STATUS.STARTING;
23122
- this.emitEvent("onInstanceStatus", this.status);
23123
- this.registerManager.reset();
23124
- this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23125
- this.emitEvent("onInstanceStatus", this.status);
23126
- await this.fontsManager.loadFonts();
23127
- this.setupManager.setupLog();
23128
- this.stageManager.initStage();
23129
- this.status = WEAVE_INSTANCE_STATUS.CONNECTING_TO_ROOM;
23130
- this.emitEvent("onInstanceStatus", this.status);
23131
- this.addEventListener("onStoreConnectionStatusChange", this.handleStoreConnectionStatusChange.bind(this));
23132
- }
23133
22965
  destroy() {
23134
22966
  this.moduleLogger.info(`Destroying the instance`);
23135
- if (this.eventsController) this.eventsController.abort();
23136
22967
  this.emitter.clearListeners();
23137
22968
  this.status = WEAVE_INSTANCE_STATUS.IDLE;
23138
22969
  this.emitEvent("onInstanceStatus", this.status);
@@ -23602,9 +23433,6 @@ var Weave = class {
23602
23433
  async exportNodesServerSide(nodes, boundingNodes, options) {
23603
23434
  return await this.exportManager.exportNodesServerSide(nodes, boundingNodes, options);
23604
23435
  }
23605
- async exportAreaServerSide(area, options) {
23606
- return await this.exportManager.exportAreaServerSide(area, options);
23607
- }
23608
23436
  async exportNodes(nodes, boundingNodes, options) {
23609
23437
  return await this.exportManager.exportNodesAsImage(nodes, boundingNodes, options);
23610
23438
  }
@@ -23770,9 +23598,6 @@ var Weave = class {
23770
23598
  getDragProperties() {
23771
23599
  return this.dragAndDropManager.getDragProperties();
23772
23600
  }
23773
- getEventsController() {
23774
- return this.eventsController;
23775
- }
23776
23601
  };
23777
23602
 
23778
23603
  //#endregion
@@ -23864,7 +23689,6 @@ const downscaleImageFromURL = (url, options) => {
23864
23689
  //#endregion
23865
23690
  //#region src/internal-utils/upscale.ts
23866
23691
  const setupUpscaleStage = (instance, stage) => {
23867
- if (instance.isServerSide()) return;
23868
23692
  const config = instance.getConfiguration();
23869
23693
  const doUpscale = config.performance?.upscale?.enabled ?? false;
23870
23694
  if (doUpscale) {
@@ -23896,14 +23720,7 @@ const setupUpscaleStage = (instance, stage) => {
23896
23720
  innerElement.style.transformOrigin = "0 0";
23897
23721
  innerElement.style.transform = `scale(${scaleToCover})`;
23898
23722
  }
23899
- } else {
23900
- const realContainer = stage.container();
23901
- const containerWidth = realContainer.offsetWidth;
23902
- const containerHeight = realContainer.offsetHeight;
23903
- stage.width(containerWidth);
23904
- stage.height(containerHeight);
23905
- stage.setAttrs({ upscaleScale: 1 });
23906
- }
23723
+ } else stage.setAttrs({ upscaleScale: 1 });
23907
23724
  };
23908
23725
 
23909
23726
  //#endregion
@@ -23914,7 +23731,6 @@ var WeaveStageNode = class extends WeaveNode {
23914
23731
  wheelMousePressed = false;
23915
23732
  isCmdCtrlPressed = false;
23916
23733
  globalEventsInitialized = false;
23917
- initialize = void 0;
23918
23734
  onRender(props) {
23919
23735
  const stage = new Konva.Stage({
23920
23736
  ...props,
@@ -23933,10 +23749,10 @@ var WeaveStageNode = class extends WeaveNode {
23933
23749
  container.setAttribute("tabindex", "0");
23934
23750
  stage.container().addEventListener("focus", () => {
23935
23751
  this.stageFocused = true;
23936
- }, { signal: this.instance.getEventsController()?.signal });
23752
+ });
23937
23753
  stage.container().addEventListener("blur", () => {
23938
23754
  this.stageFocused = false;
23939
- }, { signal: this.instance.getEventsController()?.signal });
23755
+ });
23940
23756
  }
23941
23757
  Konva.Stage.prototype.mode = function(mode) {
23942
23758
  if (typeof mode !== "undefined") this._mode = mode;
@@ -24006,7 +23822,7 @@ var WeaveStageNode = class extends WeaveNode {
24006
23822
  const selectedNode = transformer.nodes()[0];
24007
23823
  selectedNode.fire("onCmdCtrlPressed");
24008
23824
  }
24009
- }, { signal: this.instance.getEventsController()?.signal });
23825
+ });
24010
23826
  window.addEventListener("keyup", (e) => {
24011
23827
  if (!(e.ctrlKey || e.metaKey)) {
24012
23828
  this.isCmdCtrlPressed = false;
@@ -24017,7 +23833,7 @@ var WeaveStageNode = class extends WeaveNode {
24017
23833
  const selectedNode = transformer.nodes()[0];
24018
23834
  selectedNode.fire("onCmdCtrlReleased");
24019
23835
  }
24020
- }, { signal: this.instance.getEventsController()?.signal });
23836
+ });
24021
23837
  this.globalEventsInitialized = true;
24022
23838
  }
24023
23839
  isOnlyCtrlOrMeta(event) {
@@ -24037,7 +23853,6 @@ const WEAVE_LAYER_NODE_TYPE = "layer";
24037
23853
  //#region src/nodes/layer/layer.ts
24038
23854
  var WeaveLayerNode = class extends WeaveNode {
24039
23855
  nodeType = WEAVE_LAYER_NODE_TYPE;
24040
- initialize = void 0;
24041
23856
  onRender(props) {
24042
23857
  const layer = new Konva.Layer({ ...props });
24043
23858
  layer.canMoveToContainer = function() {
@@ -24085,7 +23900,6 @@ const WEAVE_GROUP_NODE_TYPE = "group";
24085
23900
  //#region src/nodes/group/group.ts
24086
23901
  var WeaveGroupNode = class extends WeaveNode {
24087
23902
  nodeType = WEAVE_GROUP_NODE_TYPE;
24088
- initialize = void 0;
24089
23903
  constructor(params) {
24090
23904
  super();
24091
23905
  const { config } = params ?? {};
@@ -24178,7 +23992,6 @@ const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
24178
23992
  //#region src/nodes/rectangle/rectangle.ts
24179
23993
  var WeaveRectangleNode = class extends WeaveNode {
24180
23994
  nodeType = WEAVE_RECTANGLE_NODE_TYPE;
24181
- initialize = void 0;
24182
23995
  constructor(params) {
24183
23996
  super();
24184
23997
  const { config } = params ?? {};
@@ -24222,7 +24035,6 @@ const WEAVE_ELLIPSE_NODE_TYPE = "ellipse";
24222
24035
  //#region src/nodes/ellipse/ellipse.ts
24223
24036
  var WeaveEllipseNode = class extends WeaveNode {
24224
24037
  nodeType = WEAVE_ELLIPSE_NODE_TYPE;
24225
- initialize = void 0;
24226
24038
  constructor(params) {
24227
24039
  super();
24228
24040
  const { config } = params ?? {};
@@ -24368,16 +24180,13 @@ var WeaveLineNode = class extends WeaveNode {
24368
24180
  constructor(params) {
24369
24181
  super();
24370
24182
  this.config = mergeExceptArrays(WEAVE_LINE_NODE_DEFAULT_CONFIG, params?.config ?? {});
24183
+ this.handleNodeChanges = null;
24184
+ this.handleZoomChanges = null;
24371
24185
  this.snapper = new GreedySnapper({
24372
24186
  snapAngles: this.config.snapAngles.angles,
24373
24187
  activateThreshold: this.config.snapAngles.activateThreshold,
24374
24188
  releaseThreshold: this.config.snapAngles.releaseThreshold
24375
24189
  });
24376
- this.initialize();
24377
- }
24378
- initialize() {
24379
- this.handleNodeChanges = null;
24380
- this.handleZoomChanges = null;
24381
24190
  }
24382
24191
  onRender(props) {
24383
24192
  const line = new Konva.Line({
@@ -24682,19 +24491,17 @@ const TEXT_LAYOUT = {
24682
24491
  //#region src/nodes/text/text.ts
24683
24492
  var WeaveTextNode = class extends WeaveNode {
24684
24493
  nodeType = WEAVE_TEXT_NODE_TYPE;
24494
+ editing = false;
24495
+ textAreaSuperContainer = null;
24496
+ textAreaContainer = null;
24497
+ textArea = null;
24498
+ eventsInitialized = false;
24499
+ isCtrlMetaPressed = false;
24685
24500
  constructor(params) {
24686
24501
  super();
24687
24502
  const { config } = params ?? {};
24688
24503
  this.config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, config);
24689
- this.initialize();
24690
- }
24691
- initialize() {
24692
24504
  this.keyPressHandler = void 0;
24693
- this.eventsInitialized = false;
24694
- this.isCtrlMetaPressed = false;
24695
- this.textAreaSuperContainer = null;
24696
- this.textAreaContainer = null;
24697
- this.textArea = null;
24698
24505
  this.editing = false;
24699
24506
  this.textArea = null;
24700
24507
  }
@@ -24702,10 +24509,10 @@ var WeaveTextNode = class extends WeaveNode {
24702
24509
  if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
24703
24510
  window.addEventListener("keydown", (e) => {
24704
24511
  if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
24705
- }, { signal: this.instance.getEventsController()?.signal });
24512
+ });
24706
24513
  window.addEventListener("keyup", (e) => {
24707
24514
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
24708
- }, { signal: this.instance.getEventsController()?.signal });
24515
+ });
24709
24516
  this.eventsInitialized = true;
24710
24517
  }
24711
24518
  }
@@ -24733,7 +24540,7 @@ var WeaveTextNode = class extends WeaveNode {
24733
24540
  onAdd() {
24734
24541
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24735
24542
  this.keyPressHandler = this.handleKeyPress.bind(this);
24736
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24543
+ window.addEventListener("keypress", this.keyPressHandler);
24737
24544
  }
24738
24545
  }
24739
24546
  onRender(props) {
@@ -24887,7 +24694,7 @@ var WeaveTextNode = class extends WeaveNode {
24887
24694
  });
24888
24695
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24889
24696
  this.keyPressHandler = this.handleKeyPress.bind(this);
24890
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24697
+ window.addEventListener("keypress", this.keyPressHandler);
24891
24698
  }
24892
24699
  return text;
24893
24700
  }
@@ -25146,17 +24953,17 @@ var WeaveTextNode = class extends WeaveNode {
25146
24953
  this.textAreaSuperContainer.scrollTop = 0;
25147
24954
  this.textAreaSuperContainer.scrollLeft = 0;
25148
24955
  }
25149
- }, { signal: this.instance.getEventsController()?.signal });
24956
+ });
25150
24957
  this.textAreaContainer.addEventListener("scroll", () => {
25151
24958
  if (!this.textAreaContainer) return;
25152
24959
  this.textAreaContainer.scrollTop = 0;
25153
24960
  this.textAreaContainer.scrollLeft = 0;
25154
- }, { signal: this.instance.getEventsController()?.signal });
24961
+ });
25155
24962
  this.textArea.addEventListener("scroll", () => {
25156
24963
  if (!this.textArea) return;
25157
24964
  this.textArea.scrollTop = 0;
25158
24965
  this.textArea.scrollLeft = 0;
25159
- }, { signal: this.instance.getEventsController()?.signal });
24966
+ });
25160
24967
  const rotation = textNode.getAbsoluteRotation();
25161
24968
  if (rotation) {
25162
24969
  const transform = "rotate(" + rotation + "deg)";
@@ -25205,8 +25012,8 @@ var WeaveTextNode = class extends WeaveNode {
25205
25012
  this.textAreaDomResize(textNode);
25206
25013
  }
25207
25014
  };
25208
- this.textArea.addEventListener("keydown", handleKeyDown, { signal: this.instance.getEventsController()?.signal });
25209
- this.textArea.addEventListener("keyup", handleKeyUp, { signal: this.instance.getEventsController()?.signal });
25015
+ this.textArea.addEventListener("keydown", handleKeyDown);
25016
+ this.textArea.addEventListener("keyup", handleKeyUp);
25210
25017
  this.textArea.tabIndex = 1;
25211
25018
  this.textArea.focus();
25212
25019
  const handleOutsideClick = (e) => {
@@ -25232,7 +25039,7 @@ var WeaveTextNode = class extends WeaveNode {
25232
25039
  }
25233
25040
  };
25234
25041
  setTimeout(() => {
25235
- window.addEventListener("pointerup", handleOutsideClick, { signal: this.instance.getEventsController()?.signal });
25042
+ window.addEventListener("pointerup", handleOutsideClick);
25236
25043
  }, 0);
25237
25044
  this.instance.getStage().mode(WEAVE_STAGE_TEXT_EDITION_MODE);
25238
25045
  this.editing = true;
@@ -25355,6 +25162,8 @@ const WEAVE_IMAGE_DEFAULT_CONFIG = {
25355
25162
  crossOrigin: "anonymous",
25356
25163
  useFallbackImage: true,
25357
25164
  cropMode: {
25165
+ enabled: true,
25166
+ triggers: { ctrlCmd: true },
25358
25167
  gridLines: { enabled: true },
25359
25168
  overlay: { fill: "rgba(0,0,0,0.2)" },
25360
25169
  selection: {
@@ -25566,7 +25375,7 @@ var WeaveImageCrop = class WeaveImageCrop {
25566
25375
  utilityLayer?.add(this.transformer);
25567
25376
  this.transformer?.forceUpdate();
25568
25377
  this.cropGroup.show();
25569
- window.addEventListener("keydown", this.handleHide, { signal: this.instance.getEventsController()?.signal });
25378
+ window.addEventListener("keydown", this.handleHide);
25570
25379
  if (options.cmdCtrl.triggered) {
25571
25380
  utilityLayer?.hide();
25572
25381
  const stage = this.instance.getStage();
@@ -26016,21 +25825,24 @@ const isAllowedUrl = (value) => {
26016
25825
  //#endregion
26017
25826
  //#region src/nodes/image/image.ts
26018
25827
  var WeaveImageNode = class extends WeaveNode {
25828
+ imageBitmapCache = {};
25829
+ imageSource = {};
25830
+ imageFallback = {};
25831
+ imageState = {};
25832
+ imageTryoutAttempts = {};
25833
+ imageTryoutIds = {};
26019
25834
  nodeType = WEAVE_IMAGE_NODE_TYPE;
26020
25835
  cursorsFallback = { loading: "wait" };
26021
25836
  cursors = {};
26022
25837
  constructor(params) {
26023
25838
  super();
26024
25839
  const { config } = params ?? {};
26025
- this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26026
- this.initialize();
26027
- }
26028
- initialize() {
26029
25840
  this.tapStart = {
26030
25841
  x: 0,
26031
25842
  y: 0,
26032
25843
  time: 0
26033
25844
  };
25845
+ this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26034
25846
  this.imageCrop = null;
26035
25847
  this.imageBitmapCache = {};
26036
25848
  this.imageSource = {};
@@ -26061,6 +25873,7 @@ var WeaveImageNode = class extends WeaveNode {
26061
25873
  this.logger.info(`image caching enabled: ${this.config.performance.cache.enabled}`);
26062
25874
  }
26063
25875
  triggerCrop(imageNode, options) {
25876
+ if (!this.config.cropMode.enabled) return;
26064
25877
  const stage = this.instance.getStage();
26065
25878
  if (imageNode.getAttrs().cropping ?? false) return;
26066
25879
  if (!(this.isSelecting() && this.isNodeSelected(imageNode))) return;
@@ -26086,6 +25899,7 @@ var WeaveImageNode = class extends WeaveNode {
26086
25899
  });
26087
25900
  }
26088
25901
  closeCrop = (imageNode, type) => {
25902
+ if (!this.config.cropMode.enabled) return;
26089
25903
  if (!this.imageCrop) return;
26090
25904
  const stage = this.instance.getStage();
26091
25905
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
@@ -26099,6 +25913,7 @@ var WeaveImageNode = class extends WeaveNode {
26099
25913
  }
26100
25914
  };
26101
25915
  resetCrop = (imageNode) => {
25916
+ if (!this.config.cropMode.enabled) return;
26102
25917
  const internalImage = imageNode.findOne(`#${imageNode.getAttrs().id}-image`);
26103
25918
  const cropGroup = imageNode.findOne(`#${imageNode.getAttrs().id}-cropGroup`);
26104
25919
  if (!internalImage || !cropGroup) return;
@@ -26142,19 +25957,21 @@ var WeaveImageNode = class extends WeaveNode {
26142
25957
  const image$1 = stage.findOne(`#${id}`);
26143
25958
  if (!image$1) return;
26144
25959
  };
26145
- image.triggerCrop = () => {
26146
- this.triggerCrop(image, { cmdCtrl: { triggered: false } });
26147
- };
26148
- image.closeCrop = (type) => {
26149
- this.closeCrop(image, type);
26150
- };
26151
- image.resetCrop = () => {
26152
- const stage = this.instance.getStage();
26153
- const image$1 = stage.findOne(`#${id}`);
26154
- if (!image$1) return;
26155
- const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
26156
- imageCrop.unCrop();
26157
- };
25960
+ if (this.config.cropMode.enabled) {
25961
+ image.triggerCrop = () => {
25962
+ this.triggerCrop(image, { cmdCtrl: { triggered: false } });
25963
+ };
25964
+ image.closeCrop = (type) => {
25965
+ this.closeCrop(image, type);
25966
+ };
25967
+ image.resetCrop = () => {
25968
+ const stage = this.instance.getStage();
25969
+ const image$1 = stage.findOne(`#${id}`);
25970
+ if (!image$1) return;
25971
+ const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
25972
+ imageCrop.unCrop();
25973
+ };
25974
+ }
26158
25975
  const defaultTransformerProperties = this.defaultGetTransformerProperties(this.config.transform);
26159
25976
  image.getTransformerProperties = function() {
26160
25977
  return defaultTransformerProperties;
@@ -26249,7 +26066,7 @@ var WeaveImageNode = class extends WeaveNode {
26249
26066
  };
26250
26067
  this.updateImageCrop(image);
26251
26068
  } else {
26252
- this.updatePlaceholderSize(image);
26069
+ this.updatePlaceholderSize(image, imagePlaceholder);
26253
26070
  this.loadImage(imageProps, image, true);
26254
26071
  }
26255
26072
  if (this.config.performance.cache.enabled) image.on("transformend", () => {
@@ -26261,24 +26078,26 @@ var WeaveImageNode = class extends WeaveNode {
26261
26078
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26262
26079
  }
26263
26080
  });
26264
- image.on("onCmdCtrlPressed", () => {
26265
- const transformer = this.getSelectionPlugin()?.getTransformer();
26266
- if (!transformer) return;
26267
- transformer.hide();
26268
- const utilityLayer = this.instance.getUtilityLayer();
26269
- if (!utilityLayer) return;
26270
- utilityLayer?.destroyChildren();
26271
- this.renderCropMode(utilityLayer, image);
26272
- utilityLayer?.show();
26273
- });
26274
- image.on("onCmdCtrlReleased", () => {
26275
- const transformer = this.getSelectionPlugin()?.getTransformer();
26276
- if (!transformer) return;
26277
- transformer.show();
26278
- const utilityLayer = this.instance.getUtilityLayer();
26279
- if (!utilityLayer) return;
26280
- utilityLayer?.destroyChildren();
26281
- });
26081
+ if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26082
+ image.on("onCmdCtrlPressed", () => {
26083
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26084
+ if (!transformer) return;
26085
+ transformer.hide();
26086
+ const utilityLayer = this.instance.getUtilityLayer();
26087
+ if (!utilityLayer) return;
26088
+ utilityLayer?.destroyChildren();
26089
+ this.renderCropMode(utilityLayer, image);
26090
+ utilityLayer?.show();
26091
+ });
26092
+ image.on("onCmdCtrlReleased", () => {
26093
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26094
+ if (!transformer) return;
26095
+ transformer.show();
26096
+ const utilityLayer = this.instance.getUtilityLayer();
26097
+ if (!utilityLayer) return;
26098
+ utilityLayer?.destroyChildren();
26099
+ });
26100
+ }
26282
26101
  image.on("onSelectionCleared", () => {
26283
26102
  const transformer = this.getSelectionPlugin()?.getTransformer();
26284
26103
  if (!transformer) return;
@@ -26332,6 +26151,7 @@ var WeaveImageNode = class extends WeaveNode {
26332
26151
  width: absoluteCorners[1].x - absoluteCorners[0].x,
26333
26152
  height: absoluteCorners[2].y - absoluteCorners[0].y,
26334
26153
  fill: "transparent",
26154
+ strokeScaleEnabled: false,
26335
26155
  strokeWidth: 2,
26336
26156
  stroke: "#1a1aff",
26337
26157
  draggable: false,
@@ -26344,13 +26164,6 @@ var WeaveImageNode = class extends WeaveNode {
26344
26164
  x: 1 / stageScale,
26345
26165
  y: 1 / stageScale
26346
26166
  });
26347
- stage.on("scaleXChange scaleYChange", () => {
26348
- const scale = stage.scaleX();
26349
- rect.scale({
26350
- x: 1 / scale,
26351
- y: 1 / scale
26352
- });
26353
- });
26354
26167
  }
26355
26168
  renderCropAnchor(position, node, layer, onClick) {
26356
26169
  const transform = node.getAbsoluteTransform().copy();
@@ -26636,7 +26449,7 @@ var WeaveImageNode = class extends WeaveNode {
26636
26449
  }
26637
26450
  this.loadAsyncElement(id);
26638
26451
  preloadFunction(id, realImageURL ?? "", {
26639
- onLoad: async () => {
26452
+ onLoad: () => {
26640
26453
  if (useFallback) this.imageTryoutIds[id] = setTimeout(() => {
26641
26454
  const node = this.instance.getStage().findOne(`#${id}`);
26642
26455
  if (node) {
@@ -26687,7 +26500,7 @@ var WeaveImageNode = class extends WeaveNode {
26687
26500
  error: false
26688
26501
  };
26689
26502
  this.updateImageCrop(image);
26690
- if (!useFallback) this.resolveAsyncElement(id);
26503
+ this.resolveAsyncElement(id);
26691
26504
  this.cacheNode(image);
26692
26505
  }
26693
26506
  },
@@ -26728,9 +26541,13 @@ var WeaveImageNode = class extends WeaveNode {
26728
26541
  }
26729
26542
  }, loadTryout);
26730
26543
  }
26731
- updatePlaceholderSize(image) {
26544
+ updatePlaceholderSize(image, imagePlaceholder) {
26732
26545
  const imageAttrs = image.getAttrs();
26733
26546
  if (!this.imageState[imageAttrs.id ?? ""]?.loaded) return;
26547
+ if (!imageAttrs.adding && !imageAttrs.cropInfo) {
26548
+ imagePlaceholder.width(imageAttrs.uncroppedImage.width);
26549
+ imagePlaceholder.height(imageAttrs.uncroppedImage.height);
26550
+ }
26734
26551
  }
26735
26552
  updateImageCrop(image) {
26736
26553
  const imageAttrs = image.getAttrs();
@@ -26864,7 +26681,6 @@ const WEAVE_STAR_NODE_TYPE = "star";
26864
26681
  //#region src/nodes/star/star.ts
26865
26682
  var WeaveStarNode = class extends WeaveNode {
26866
26683
  nodeType = WEAVE_STAR_NODE_TYPE;
26867
- initialize = void 0;
26868
26684
  constructor(params) {
26869
26685
  super();
26870
26686
  const { config } = params ?? {};
@@ -26950,7 +26766,6 @@ const WEAVE_ARROW_NODE_TYPE = "arrow";
26950
26766
  //#region src/nodes/arrow/arrow.ts
26951
26767
  var WeaveArrowNode = class extends WeaveNode {
26952
26768
  nodeType = WEAVE_ARROW_NODE_TYPE;
26953
- initialize = void 0;
26954
26769
  constructor(params) {
26955
26770
  super();
26956
26771
  const { config } = params ?? {};
@@ -27007,7 +26822,6 @@ const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
27007
26822
  //#region src/nodes/regular-polygon/regular-polygon.ts
27008
26823
  var WeaveRegularPolygonNode = class extends WeaveNode {
27009
26824
  nodeType = WEAVE_REGULAR_POLYGON_NODE_TYPE;
27010
- initialize = void 0;
27011
26825
  constructor(params) {
27012
26826
  super();
27013
26827
  const { config } = params ?? {};
@@ -27121,7 +26935,6 @@ var GroupFrame = class extends Konva.Group {
27121
26935
  //#region src/nodes/frame/frame.ts
27122
26936
  var WeaveFrameNode = class extends WeaveNode {
27123
26937
  nodeType = WEAVE_FRAME_NODE_TYPE;
27124
- initialize = void 0;
27125
26938
  constructor(params) {
27126
26939
  super();
27127
26940
  const { config } = params ?? {};
@@ -27422,7 +27235,6 @@ const WEAVE_STROKE_NODE_DEFAULT_CONFIG = {
27422
27235
  //#region src/nodes/stroke/stroke.ts
27423
27236
  var WeaveStrokeNode = class extends WeaveNode {
27424
27237
  nodeType = WEAVE_STROKE_NODE_TYPE;
27425
- initialize = void 0;
27426
27238
  constructor(params) {
27427
27239
  super();
27428
27240
  const { config } = params ?? {};
@@ -27999,6 +27811,8 @@ var WeaveSquareLineTipManager = class extends WeaveBaseLineTipManager {
27999
27811
  //#endregion
28000
27812
  //#region src/nodes/stroke-single/stroke-single.ts
28001
27813
  var WeaveStrokeSingleNode = class extends WeaveNode {
27814
+ startHandle = null;
27815
+ endHandle = null;
28002
27816
  nodeType = WEAVE_STROKE_SINGLE_NODE_TYPE;
28003
27817
  tipManagers = {
28004
27818
  [WEAVE_STROKE_SINGLE_NODE_TIP_TYPE.ARROW]: new WeaveArrowLineTipManager(),
@@ -28009,29 +27823,24 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28009
27823
  constructor(params) {
28010
27824
  super();
28011
27825
  this.config = mergeExceptArrays(WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, params?.config ?? {});
27826
+ this.handleNodeChanges = null;
27827
+ this.handleZoomChanges = null;
27828
+ this.shiftPressed = false;
28012
27829
  this.snapper = new GreedySnapper({
28013
27830
  snapAngles: this.config.snapAngles.angles,
28014
27831
  activateThreshold: this.config.snapAngles.activateThreshold,
28015
27832
  releaseThreshold: this.config.snapAngles.releaseThreshold
28016
27833
  });
28017
- this.initialize();
28018
- }
28019
- initialize() {
28020
27834
  this.eventsInitialized = false;
28021
- this.startHandle = null;
28022
- this.endHandle = null;
28023
- this.handleNodeChanges = null;
28024
- this.handleZoomChanges = null;
28025
- this.shiftPressed = false;
28026
27835
  }
28027
27836
  initEvents() {
28028
27837
  if (this.eventsInitialized) return;
28029
27838
  window.addEventListener("keydown", (e) => {
28030
27839
  if (e.key === "Shift") this.shiftPressed = true;
28031
- }, { signal: this.instance.getEventsController()?.signal });
27840
+ });
28032
27841
  window.addEventListener("keyup", (e) => {
28033
27842
  if (e.key === "Shift") this.shiftPressed = false;
28034
- }, { signal: this.instance.getEventsController()?.signal });
27843
+ });
28035
27844
  this.eventsInitialized = true;
28036
27845
  }
28037
27846
  onRender(props) {
@@ -28518,9 +28327,6 @@ var WeaveCommentNode = class extends WeaveNode {
28518
28327
  constructor(params) {
28519
28328
  super();
28520
28329
  this.config = mergeExceptArrays(WEAVE_COMMENT_NODE_DEFAULTS, params.config);
28521
- this.initialize();
28522
- }
28523
- initialize() {
28524
28330
  this.commentDomVisibleId = null;
28525
28331
  this.commentDomVisible = false;
28526
28332
  this.commentDomAction = null;
@@ -29149,6 +28955,10 @@ const WEAVE_VIDEO_DEFAULT_CONFIG = {
29149
28955
  //#endregion
29150
28956
  //#region src/nodes/video/video.ts
29151
28957
  var WeaveVideoNode = class extends WeaveNode {
28958
+ videoState = {};
28959
+ videoSourceFrameId = {};
28960
+ videoSource = {};
28961
+ videoPlaceholder = {};
29152
28962
  nodeType = WEAVE_VIDEO_NODE_TYPE;
29153
28963
  constructor(params) {
29154
28964
  super();
@@ -29161,13 +28971,6 @@ var WeaveVideoNode = class extends WeaveNode {
29161
28971
  this.videoIconImage.src = this.config.style.icon.dataURL;
29162
28972
  }
29163
28973
  }
29164
- initialize() {
29165
- this.videoState = {};
29166
- this.videoSource = {};
29167
- this.videoSourceFrameId = {};
29168
- this.videoPlaceholder = {};
29169
- this.videoIconImage = void 0;
29170
- }
29171
28974
  async loadPlaceholder(params, video) {
29172
28975
  const videoProps = params;
29173
28976
  const { id } = videoProps;
@@ -29662,7 +29465,6 @@ const WEAVE_MEASURE_NODE_DEFAULT_CONFIG = { style: {
29662
29465
  var WeaveMeasureNode = class extends WeaveNode {
29663
29466
  nodeType = WEAVE_MEASURE_NODE_TYPE;
29664
29467
  handlePointCircleRadius = 6;
29665
- initialize = void 0;
29666
29468
  constructor(params) {
29667
29469
  super();
29668
29470
  this.config = mergeExceptArrays(WEAVE_MEASURE_NODE_DEFAULT_CONFIG, params?.config ?? {});
@@ -30953,7 +30755,6 @@ var WeaveConnectorNode = class extends WeaveNode {
30953
30755
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.DOT]: setupNodeDecoratorDot,
30954
30756
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.ARROW]: setupNodeDecoratorArrow
30955
30757
  };
30956
- initialize = void 0;
30957
30758
  constructor(params) {
30958
30759
  super();
30959
30760
  this.config = mergeExceptArrays(WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, params?.config);
@@ -31704,6 +31505,10 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
31704
31505
  var WeaveStageZoomPlugin = class extends WeavePlugin {
31705
31506
  getLayerName = void 0;
31706
31507
  initLayer = void 0;
31508
+ pinching = false;
31509
+ zooming = false;
31510
+ isTrackpad = false;
31511
+ zoomVelocity = 0;
31707
31512
  zoomInertiaType = WEAVE_STAGE_ZOOM_TYPE.MOUSE_WHEEL;
31708
31513
  defaultStep = 3;
31709
31514
  constructor(params) {
@@ -31711,13 +31516,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
31711
31516
  const { config } = params ?? {};
31712
31517
  this.config = mergeExceptArrays(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
31713
31518
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
31714
- this.initialize();
31715
- }
31716
- initialize() {
31717
31519
  this.pinching = false;
31718
- this.zooming = false;
31719
31520
  this.isTrackpad = false;
31720
- this.zoomVelocity = 0;
31721
31521
  this.isCtrlOrMetaPressed = false;
31722
31522
  this.updatedMinimumZoom = false;
31723
31523
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
@@ -32004,15 +31804,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32004
31804
  if (box.width === 0 || box.height === 0) return;
32005
31805
  this.fitToElements(box, finalOptions);
32006
31806
  }
32007
- fitToArea(area, options) {
32008
- const finalOptions = mergeExceptArrays({
32009
- smartZoom: false,
32010
- overrideZoom: true
32011
- }, options);
32012
- if (!this.enabled) return;
32013
- if (area.width === 0 || area.height === 0) return;
32014
- this.fitToElements(area, finalOptions);
32015
- }
32016
31807
  enable() {
32017
31808
  this.enabled = true;
32018
31809
  }
@@ -32031,10 +31822,10 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32031
31822
  initEvents() {
32032
31823
  window.addEventListener("keydown", (e) => {
32033
31824
  if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32034
- }, { signal: this.instance.getEventsController()?.signal });
31825
+ });
32035
31826
  window.addEventListener("keyup", (e) => {
32036
31827
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32037
- }, { signal: this.instance.getEventsController()?.signal });
31828
+ });
32038
31829
  const stage = this.instance.getStage();
32039
31830
  let lastCenter = null;
32040
31831
  let lastDist = 0;
@@ -32059,10 +31850,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32059
31850
  return;
32060
31851
  }
32061
31852
  }
32062
- }, {
32063
- passive: false,
32064
- signal: this.instance.getEventsController()?.signal
32065
- });
31853
+ }, { passive: false });
32066
31854
  stage.getContent().addEventListener("touchmove", (e) => {
32067
31855
  e.preventDefault();
32068
31856
  if (e.touches.length === 2) {
@@ -32102,18 +31890,12 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32102
31890
  lastDist = dist;
32103
31891
  lastCenter = newCenter;
32104
31892
  }
32105
- }, {
32106
- passive: false,
32107
- signal: this.instance.getEventsController()?.signal
32108
- });
31893
+ }, { passive: false });
32109
31894
  stage.getContent().addEventListener("touchend", () => {
32110
31895
  this.pinching = false;
32111
31896
  lastDist = 0;
32112
31897
  lastCenter = null;
32113
- }, {
32114
- passive: false,
32115
- signal: this.instance.getEventsController()?.signal
32116
- });
31898
+ }, { passive: false });
32117
31899
  let doZoom = false;
32118
31900
  const handleWheelImmediate = (e) => {
32119
31901
  const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
@@ -32131,10 +31913,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32131
31913
  e.preventDefault();
32132
31914
  doZoom = true;
32133
31915
  };
32134
- window.addEventListener("wheel", handleWheelImmediate, {
32135
- signal: this.instance.getEventsController()?.signal,
32136
- passive: false
32137
- });
31916
+ window.addEventListener("wheel", handleWheelImmediate, { passive: false });
32138
31917
  const handleWheel = (e) => {
32139
31918
  if (!doZoom) return;
32140
31919
  const delta = e.deltaY > 0 ? 1 : -1;
@@ -32147,10 +31926,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32147
31926
  }
32148
31927
  };
32149
31928
  const throttledHandleWheel = (0, import_lodash.throttle)(handleWheel, DEFAULT_THROTTLE_MS);
32150
- window.addEventListener("wheel", throttledHandleWheel, {
32151
- signal: this.instance.getEventsController()?.signal,
32152
- passive: true
32153
- });
31929
+ window.addEventListener("wheel", throttledHandleWheel, { passive: true });
32154
31930
  }
32155
31931
  getInertiaScale() {
32156
31932
  const stage = this.instance.getStage();
@@ -32208,7 +31984,6 @@ const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
32208
31984
  //#region src/actions/zoom-out-tool/zoom-out-tool.ts
32209
31985
  var WeaveZoomOutToolAction = class extends WeaveAction {
32210
31986
  onPropsChange = void 0;
32211
- initialize = void 0;
32212
31987
  getName() {
32213
31988
  return ZOOM_OUT_TOOL_ACTION_NAME;
32214
31989
  }
@@ -32243,10 +32018,6 @@ const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
32243
32018
  //#region src/actions/zoom-in-tool/zoom-in-tool.ts
32244
32019
  var WeaveZoomInToolAction = class extends WeaveAction {
32245
32020
  onPropsChange = void 0;
32246
- initialize = void 0;
32247
- constructor() {
32248
- super();
32249
- }
32250
32021
  getName() {
32251
32022
  return ZOOM_IN_TOOL_ACTION_NAME;
32252
32023
  }
@@ -32281,10 +32052,6 @@ const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
32281
32052
  //#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
32282
32053
  var WeaveFitToScreenToolAction = class extends WeaveAction {
32283
32054
  onPropsChange = void 0;
32284
- initialize = void 0;
32285
- constructor() {
32286
- super();
32287
- }
32288
32055
  getName() {
32289
32056
  return FIT_TO_SCREEN_TOOL_ACTION_NAME;
32290
32057
  }
@@ -32318,10 +32085,6 @@ const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
32318
32085
  //#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
32319
32086
  var WeaveFitToSelectionToolAction = class extends WeaveAction {
32320
32087
  onPropsChange = void 0;
32321
- initialize = void 0;
32322
- constructor() {
32323
- super();
32324
- }
32325
32088
  getName() {
32326
32089
  return FIT_TO_SELECTION_TOOL_ACTION_NAME;
32327
32090
  }
@@ -32364,9 +32127,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
32364
32127
  onInit = void 0;
32365
32128
  constructor() {
32366
32129
  super();
32367
- this.initialize();
32368
- }
32369
- initialize() {
32370
32130
  this.initialized = false;
32371
32131
  this.state = MOVE_TOOL_STATE.IDLE;
32372
32132
  }
@@ -32380,7 +32140,7 @@ var WeaveMoveToolAction = class extends WeaveAction {
32380
32140
  this.cancelAction();
32381
32141
  return;
32382
32142
  }
32383
- }, { signal: this.instance.getEventsController()?.signal });
32143
+ });
32384
32144
  stage.on("pointerdown", () => {
32385
32145
  if ([MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
32386
32146
  });
@@ -32439,9 +32199,6 @@ var WeaveSelectionToolAction = class extends WeaveAction {
32439
32199
  onInit = void 0;
32440
32200
  constructor() {
32441
32201
  super();
32442
- this.initialize();
32443
- }
32444
- initialize() {
32445
32202
  this.initialized = false;
32446
32203
  this.state = SELECTION_TOOL_STATE.IDLE;
32447
32204
  }
@@ -32505,9 +32262,6 @@ var WeaveEraserToolAction = class extends WeaveAction {
32505
32262
  onInit = void 0;
32506
32263
  constructor() {
32507
32264
  super();
32508
- this.initialize();
32509
- }
32510
- initialize() {
32511
32265
  this.initialized = false;
32512
32266
  this.erasing = false;
32513
32267
  this.state = ERASER_TOOL_STATE.IDLE;
@@ -32541,7 +32295,7 @@ var WeaveEraserToolAction = class extends WeaveAction {
32541
32295
  this.cancelAction();
32542
32296
  return;
32543
32297
  }
32544
- }, { signal: this.instance.getEventsController()?.signal });
32298
+ });
32545
32299
  this.initialized = true;
32546
32300
  }
32547
32301
  setState(state) {
@@ -32608,9 +32362,6 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32608
32362
  onInit = void 0;
32609
32363
  constructor() {
32610
32364
  super();
32611
- this.initialize();
32612
- }
32613
- initialize() {
32614
32365
  this.pointers = new Map();
32615
32366
  this.initialized = false;
32616
32367
  this.state = RECTANGLE_TOOL_STATE.IDLE;
@@ -32646,7 +32397,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32646
32397
  this.cancelAction();
32647
32398
  return;
32648
32399
  }
32649
- }, { signal: this.instance.getEventsController()?.signal });
32400
+ });
32650
32401
  stage.on("pointermove", () => {
32651
32402
  if (this.state === RECTANGLE_TOOL_STATE.IDLE) return;
32652
32403
  this.setCursor();
@@ -32820,9 +32571,6 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32820
32571
  onInit = void 0;
32821
32572
  constructor() {
32822
32573
  super();
32823
- this.initialize();
32824
- }
32825
- initialize() {
32826
32574
  this.pointers = new Map();
32827
32575
  this.initialized = false;
32828
32576
  this.state = ELLIPSE_TOOL_STATE.IDLE;
@@ -32858,7 +32606,7 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32858
32606
  this.cancelAction();
32859
32607
  return;
32860
32608
  }
32861
- }, { signal: this.instance.getEventsController()?.signal });
32609
+ });
32862
32610
  stage.on("pointerdown", (e) => {
32863
32611
  this.setTapStart(e);
32864
32612
  this.pointers.set(e.evt.pointerId, {
@@ -33039,9 +32787,6 @@ var WeavePenToolAction = class extends WeaveAction {
33039
32787
  onInit = void 0;
33040
32788
  constructor() {
33041
32789
  super();
33042
- this.initialize();
33043
- }
33044
- initialize() {
33045
32790
  this.pointers = new Map();
33046
32791
  this.initialized = false;
33047
32792
  this.state = PEN_TOOL_STATE.IDLE;
@@ -33077,7 +32822,7 @@ var WeavePenToolAction = class extends WeaveAction {
33077
32822
  this.cancelAction();
33078
32823
  return;
33079
32824
  }
33080
- }, { signal: this.instance.getEventsController()?.signal });
32825
+ });
33081
32826
  stage.on("pointerdown", (e) => {
33082
32827
  this.setTapStart(e);
33083
32828
  this.pointers.set(e.evt.pointerId, {
@@ -33314,9 +33059,6 @@ var WeaveLineToolAction = class extends WeaveAction {
33314
33059
  constructor(params) {
33315
33060
  super();
33316
33061
  this.config = mergeExceptArrays(LINE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33317
- this.initialize();
33318
- }
33319
- initialize() {
33320
33062
  this.pointers = new Map();
33321
33063
  this.initialized = false;
33322
33064
  this.state = LINE_TOOL_STATE.IDLE;
@@ -33361,13 +33103,13 @@ var WeaveLineToolAction = class extends WeaveAction {
33361
33103
  this.snappedAngle = null;
33362
33104
  this.shiftPressed = true;
33363
33105
  }
33364
- }, { signal: this.instance.getEventsController()?.signal });
33106
+ });
33365
33107
  window.addEventListener("keyup", (e) => {
33366
33108
  if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
33367
33109
  this.snappedAngle = null;
33368
33110
  this.shiftPressed = false;
33369
33111
  }
33370
- }, { signal: this.instance.getEventsController()?.signal });
33112
+ });
33371
33113
  stage.on("pointerdown", (e) => {
33372
33114
  this.setTapStart(e);
33373
33115
  this.pointers.set(e.evt.pointerId, {
@@ -33582,9 +33324,6 @@ var WeaveBrushToolAction = class extends WeaveAction {
33582
33324
  constructor(params) {
33583
33325
  super();
33584
33326
  this.config = mergeExceptArrays(BRUSH_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33585
- this.initialize();
33586
- }
33587
- initialize() {
33588
33327
  this.initialized = false;
33589
33328
  this.state = BRUSH_TOOL_STATE.INACTIVE;
33590
33329
  this.strokeId = null;
@@ -33613,7 +33352,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33613
33352
  const stage = this.instance.getStage();
33614
33353
  window.addEventListener("keyup", (e) => {
33615
33354
  if (e.code === "Space" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) this.isSpacePressed = false;
33616
- }, { signal: this.instance.getEventsController()?.signal });
33355
+ });
33617
33356
  window.addEventListener("keydown", (e) => {
33618
33357
  if (e.code === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
33619
33358
  e.stopPropagation();
@@ -33629,7 +33368,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33629
33368
  e.stopPropagation();
33630
33369
  this.cancelAction();
33631
33370
  }
33632
- }, { signal: this.instance.getEventsController()?.signal });
33371
+ });
33633
33372
  const handlePointerDown = (e) => {
33634
33373
  if (this.state === BRUSH_TOOL_STATE.INACTIVE) return;
33635
33374
  if (this.state !== BRUSH_TOOL_STATE.IDLE) return;
@@ -33838,9 +33577,6 @@ var WeaveTextToolAction = class extends WeaveAction {
33838
33577
  onInit = void 0;
33839
33578
  constructor() {
33840
33579
  super();
33841
- this.initialize();
33842
- }
33843
- initialize() {
33844
33580
  this.initialized = false;
33845
33581
  this.state = TEXT_TOOL_STATE.IDLE;
33846
33582
  this.textId = null;
@@ -33870,7 +33606,7 @@ var WeaveTextToolAction = class extends WeaveAction {
33870
33606
  this.cancelAction();
33871
33607
  return;
33872
33608
  }
33873
- }, { signal: this.instance.getEventsController()?.signal });
33609
+ });
33874
33610
  stage.on("pointermove", () => {
33875
33611
  if (this.state === TEXT_TOOL_STATE.IDLE) return;
33876
33612
  this.setCursor();
@@ -33998,9 +33734,6 @@ var WeaveImageToolAction = class extends WeaveAction {
33998
33734
  constructor(params) {
33999
33735
  super();
34000
33736
  this.config = mergeExceptArrays(WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, params?.config ?? {});
34001
- this.initialize();
34002
- }
34003
- initialize() {
34004
33737
  this.pointers = new Map();
34005
33738
  this.initialized = false;
34006
33739
  this.imageId = null;
@@ -34044,7 +33777,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34044
33777
  this.cancelAction();
34045
33778
  return;
34046
33779
  }
34047
- }, { signal: this.instance.getEventsController()?.signal });
33780
+ });
34048
33781
  stage.on("pointerdown", (e) => {
34049
33782
  this.setTapStart(e);
34050
33783
  if (this.ignorePointerEvents) return;
@@ -34441,9 +34174,6 @@ var WeaveImagesToolAction = class extends WeaveAction {
34441
34174
  constructor(params) {
34442
34175
  super();
34443
34176
  this.config = mergeExceptArrays(WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, params ?? {});
34444
- this.initialize();
34445
- }
34446
- initialize() {
34447
34177
  this.pointers = new Map();
34448
34178
  this.initialized = false;
34449
34179
  this.tempPointerFeedbackNode = null;
@@ -34490,7 +34220,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34490
34220
  const stage = this.instance.getStage();
34491
34221
  stage.container().addEventListener("keydown", (e) => {
34492
34222
  if (e.key === "Escape" && this.instance.getActiveAction() === WEAVE_IMAGES_TOOL_ACTION_NAME) this.cancelAction();
34493
- }, { signal: this.instance.getEventsController()?.signal });
34223
+ });
34494
34224
  stage.on("pointerdown", (e) => {
34495
34225
  this.setTapStart(e);
34496
34226
  this.pointers.set(e.evt.pointerId, {
@@ -34872,9 +34602,6 @@ var WeaveStarToolAction = class extends WeaveAction {
34872
34602
  onInit = void 0;
34873
34603
  constructor() {
34874
34604
  super();
34875
- this.initialize();
34876
- }
34877
- initialize() {
34878
34605
  this.pointers = new Map();
34879
34606
  this.initialized = false;
34880
34607
  this.state = STAR_TOOL_STATE.IDLE;
@@ -34911,7 +34638,7 @@ var WeaveStarToolAction = class extends WeaveAction {
34911
34638
  this.cancelAction();
34912
34639
  return;
34913
34640
  }
34914
- }, { signal: this.instance.getEventsController()?.signal });
34641
+ });
34915
34642
  stage.on("pointerdown", (e) => {
34916
34643
  this.setTapStart(e);
34917
34644
  this.pointers.set(e.evt.pointerId, {
@@ -35076,8 +34803,8 @@ var WeaveStarToolAction = class extends WeaveAction {
35076
34803
 
35077
34804
  //#endregion
35078
34805
  //#region src/actions/arrow-tool/constants.ts
35079
- const WEAVE_ARROW_TOOL_ACTION_NAME = "arrowTool";
35080
- const WEAVE_ARROW_TOOL_STATE = {
34806
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
34807
+ const ARROW_TOOL_STATE = {
35081
34808
  ["IDLE"]: "idle",
35082
34809
  ["ADDING"]: "adding",
35083
34810
  ["DEFINING_SIZE"]: "definingSize",
@@ -35093,12 +34820,9 @@ var WeaveArrowToolAction = class extends WeaveAction {
35093
34820
  onInit = void 0;
35094
34821
  constructor() {
35095
34822
  super();
35096
- this.initialize();
35097
- }
35098
- initialize() {
35099
34823
  this.pointers = new Map();
35100
34824
  this.initialized = false;
35101
- this.state = WEAVE_ARROW_TOOL_STATE.IDLE;
34825
+ this.state = ARROW_TOOL_STATE.IDLE;
35102
34826
  this.arrowId = null;
35103
34827
  this.tempArrowId = null;
35104
34828
  this.tempMainArrowNode = null;
@@ -35111,7 +34835,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35111
34835
  this.props = this.initProps();
35112
34836
  }
35113
34837
  getName() {
35114
- return WEAVE_ARROW_TOOL_ACTION_NAME;
34838
+ return ARROW_TOOL_ACTION_NAME;
35115
34839
  }
35116
34840
  initProps() {
35117
34841
  return {
@@ -35128,37 +34852,40 @@ var WeaveArrowToolAction = class extends WeaveAction {
35128
34852
  setupEvents() {
35129
34853
  const stage = this.instance.getStage();
35130
34854
  window.addEventListener("keydown", (e) => {
35131
- if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
34855
+ if (e.code === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
35132
34856
  this.cancelAction();
35133
34857
  return;
35134
34858
  }
35135
- if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) this.cancelAction();
35136
- }, { signal: this.instance.getEventsController()?.signal });
34859
+ if (e.code === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34860
+ this.cancelAction();
34861
+ return;
34862
+ }
34863
+ });
35137
34864
  stage.on("pointerdown", (e) => {
35138
34865
  this.setTapStart(e);
35139
34866
  this.pointers.set(e.evt.pointerId, {
35140
34867
  x: e.evt.clientX,
35141
34868
  y: e.evt.clientY
35142
34869
  });
35143
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35144
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34870
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34871
+ this.state = ARROW_TOOL_STATE.ADDING;
35145
34872
  return;
35146
34873
  }
35147
- if (!this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.handleAdding();
35148
- if (this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.state = WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE;
34874
+ if (!this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.handleAdding();
34875
+ if (this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.state = ARROW_TOOL_STATE.DEFINING_SIZE;
35149
34876
  });
35150
34877
  stage.on("pointermove", () => {
35151
- if (this.state === WEAVE_ARROW_TOOL_STATE.IDLE) return;
34878
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
35152
34879
  this.setCursor();
35153
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35154
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34880
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34881
+ this.state = ARROW_TOOL_STATE.ADDING;
35155
34882
  return;
35156
34883
  }
35157
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
34884
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
35158
34885
  });
35159
34886
  stage.on("pointerup", (e) => {
35160
34887
  this.pointers.delete(e.evt.pointerId);
35161
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
34888
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
35162
34889
  });
35163
34890
  this.initialized = true;
35164
34891
  }
@@ -35172,7 +34899,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35172
34899
  this.tempPoint = void 0;
35173
34900
  this.tempNextPoint = void 0;
35174
34901
  this.clickPoint = null;
35175
- this.setState(WEAVE_ARROW_TOOL_STATE.ADDING);
34902
+ this.setState(ARROW_TOOL_STATE.ADDING);
35176
34903
  }
35177
34904
  handleAdding() {
35178
34905
  const stage = this.instance.getStage();
@@ -35223,7 +34950,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35223
34950
  this.measureContainer?.add(this.tempNextPoint);
35224
34951
  this.tempPoint.moveToTop();
35225
34952
  this.tempNextPoint.moveToTop();
35226
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34953
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35227
34954
  }
35228
34955
  }
35229
34956
  handleSettingSize() {
@@ -35250,11 +34977,11 @@ var WeaveArrowToolAction = class extends WeaveAction {
35250
34977
  y: mousePoint.y,
35251
34978
  points: [0, 0]
35252
34979
  });
35253
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34980
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35254
34981
  }
35255
34982
  }
35256
34983
  handleMovement() {
35257
- if (this.state !== WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) return;
34984
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
35258
34985
  if (this.arrowId && this.tempArrowNode && this.measureContainer && this.tempNextPoint) {
35259
34986
  const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
35260
34987
  this.tempArrowNode.setAttrs({
@@ -35321,7 +35048,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35321
35048
  this.container = void 0;
35322
35049
  this.measureContainer = void 0;
35323
35050
  this.clickPoint = null;
35324
- this.setState(WEAVE_ARROW_TOOL_STATE.IDLE);
35051
+ this.setState(ARROW_TOOL_STATE.IDLE);
35325
35052
  }
35326
35053
  setCursor() {
35327
35054
  const stage = this.instance.getStage();
@@ -35365,15 +35092,13 @@ const WEAVE_STROKE_TOOL_DEFAULT_CONFIG = { snapAngles: {
35365
35092
  var WeaveStrokeToolAction = class extends WeaveAction {
35366
35093
  initialized = false;
35367
35094
  initialCursor = null;
35095
+ snappedAngle = null;
35368
35096
  shiftPressed = false;
35369
35097
  onPropsChange = void 0;
35370
35098
  onInit = void 0;
35371
35099
  constructor(params) {
35372
35100
  super();
35373
35101
  this.config = mergeExceptArrays(WEAVE_STROKE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
35374
- this.initialize();
35375
- }
35376
- initialize() {
35377
35102
  this.pointers = new Map();
35378
35103
  this.initialized = false;
35379
35104
  this.state = WEAVE_STROKE_TOOL_STATE.IDLE;
@@ -35382,6 +35107,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35382
35107
  this.tempLineId = null;
35383
35108
  this.tempLineNode = null;
35384
35109
  this.container = void 0;
35110
+ this.snappedAngle = null;
35385
35111
  this.measureContainer = void 0;
35386
35112
  this.clickPoint = null;
35387
35113
  this.snapper = new GreedySnapper({
@@ -35394,9 +35120,6 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35394
35120
  getName() {
35395
35121
  return WEAVE_STROKE_TOOL_ACTION_NAME;
35396
35122
  }
35397
- getNames() {
35398
- return [WEAVE_STROKE_TOOL_ACTION_NAME, ...WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES];
35399
- }
35400
35123
  hasAliases() {
35401
35124
  return true;
35402
35125
  }
@@ -35415,26 +35138,32 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35415
35138
  setupEvents() {
35416
35139
  const stage = this.instance.getStage();
35417
35140
  window.addEventListener("keydown", (e) => {
35418
- if (e.code === "Enter" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35141
+ if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35419
35142
  this.cancelAction();
35420
35143
  return;
35421
35144
  }
35422
- if (e.code === "Escape" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35145
+ if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35423
35146
  this.cancelAction();
35424
35147
  return;
35425
35148
  }
35426
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = true;
35427
- }, { signal: this.instance.getEventsController()?.signal });
35149
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35150
+ this.snappedAngle = null;
35151
+ this.shiftPressed = true;
35152
+ }
35153
+ });
35428
35154
  window.addEventListener("keyup", (e) => {
35429
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = false;
35430
- }, { signal: this.instance.getEventsController()?.signal });
35155
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35156
+ this.snappedAngle = null;
35157
+ this.shiftPressed = false;
35158
+ }
35159
+ });
35431
35160
  stage.on("pointerdown", (e) => {
35432
35161
  this.setTapStart(e);
35433
35162
  this.pointers.set(e.evt.pointerId, {
35434
35163
  x: e.evt.clientX,
35435
35164
  y: e.evt.clientY
35436
35165
  });
35437
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35166
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35438
35167
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35439
35168
  return;
35440
35169
  }
@@ -35444,7 +35173,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35444
35173
  stage.on("pointermove", () => {
35445
35174
  if (this.state === WEAVE_STROKE_TOOL_STATE.IDLE) return;
35446
35175
  this.setCursor();
35447
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35176
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35448
35177
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35449
35178
  return;
35450
35179
  }
@@ -35462,7 +35191,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35462
35191
  addLine() {
35463
35192
  this.setCursor();
35464
35193
  this.setFocusStage();
35465
- this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35194
+ this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35466
35195
  this.shiftPressed = false;
35467
35196
  this.clickPoint = null;
35468
35197
  this.setState(WEAVE_STROKE_TOOL_STATE.ADDING);
@@ -35570,7 +35299,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35570
35299
  });
35571
35300
  delete finalLine.props.dragBoundFunc;
35572
35301
  this.instance.addNode(finalLine, this.container?.getAttrs().id);
35573
- this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35302
+ this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35574
35303
  nodeCreated = true;
35575
35304
  }
35576
35305
  }
@@ -35620,9 +35349,6 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35620
35349
  onInit = void 0;
35621
35350
  constructor() {
35622
35351
  super();
35623
- this.initialize();
35624
- }
35625
- initialize() {
35626
35352
  this.pointers = new Map();
35627
35353
  this.initialized = false;
35628
35354
  this.state = REGULAR_POLYGON_TOOL_STATE.IDLE;
@@ -35657,7 +35383,7 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35657
35383
  this.cancelAction();
35658
35384
  return;
35659
35385
  }
35660
- }, { signal: this.instance.getEventsController()?.signal });
35386
+ });
35661
35387
  stage.on("pointerdown", (e) => {
35662
35388
  this.setTapStart(e);
35663
35389
  this.pointers.set(e.evt.pointerId, {
@@ -35831,9 +35557,6 @@ var WeaveFrameToolAction = class extends WeaveAction {
35831
35557
  onInit = void 0;
35832
35558
  constructor() {
35833
35559
  super();
35834
- this.initialize();
35835
- }
35836
- initialize() {
35837
35560
  this.initialized = false;
35838
35561
  this.state = FRAME_TOOL_STATE.IDLE;
35839
35562
  this.frameId = null;
@@ -35861,7 +35584,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
35861
35584
  this.cancelAction();
35862
35585
  return;
35863
35586
  }
35864
- }, { signal: this.instance.getEventsController()?.signal });
35587
+ });
35865
35588
  stage.on("pointermove", () => {
35866
35589
  if (this.state === FRAME_TOOL_STATE.IDLE) return;
35867
35590
  this.setCursor();
@@ -35963,10 +35686,6 @@ var WeaveExportStageToolAction = class extends WeaveAction {
35963
35686
  };
35964
35687
  onPropsChange = void 0;
35965
35688
  onInit = void 0;
35966
- initialize = void 0;
35967
- constructor() {
35968
- super();
35969
- }
35970
35689
  getName() {
35971
35690
  return EXPORT_STAGE_TOOL_ACTION_NAME;
35972
35691
  }
@@ -36014,10 +35733,6 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
36014
35733
  };
36015
35734
  onPropsChange = void 0;
36016
35735
  onInit = void 0;
36017
- initialize = void 0;
36018
- constructor() {
36019
- super();
36020
- }
36021
35736
  getName() {
36022
35737
  return EXPORT_NODES_TOOL_ACTION_NAME;
36023
35738
  }
@@ -36070,9 +35785,6 @@ var WeaveAlignNodesToolAction = class extends WeaveAction {
36070
35785
  onInit = void 0;
36071
35786
  constructor() {
36072
35787
  super();
36073
- this.initialize();
36074
- }
36075
- initialize() {
36076
35788
  this.initialized = false;
36077
35789
  this.state = ALIGN_NODES_TOOL_STATE.IDLE;
36078
35790
  }
@@ -36322,9 +36034,6 @@ var WeaveCommentToolAction = class extends WeaveAction {
36322
36034
  super();
36323
36035
  const { config } = params ?? {};
36324
36036
  this.config = mergeExceptArrays(WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, config);
36325
- this.initialize();
36326
- }
36327
- initialize() {
36328
36037
  this.pointers = new Map();
36329
36038
  this.initialized = false;
36330
36039
  this.state = WEAVE_COMMENT_TOOL_STATE.IDLE;
@@ -36402,7 +36111,7 @@ var WeaveCommentToolAction = class extends WeaveAction {
36402
36111
  return;
36403
36112
  }
36404
36113
  if (e.code === "Escape" && this.state === WEAVE_COMMENT_TOOL_STATE.CREATING_COMMENT) this.setState(WEAVE_COMMENT_TOOL_STATE.ADDING);
36405
- }, { signal: this.instance.getEventsController()?.signal });
36114
+ });
36406
36115
  stage.on("pointermove", (e) => {
36407
36116
  if (this.state === WEAVE_COMMENT_TOOL_STATE.IDLE) return;
36408
36117
  if (commentNodeHandler?.isCommentViewing()) {
@@ -36553,9 +36262,6 @@ var WeaveVideoToolAction = class extends WeaveAction {
36553
36262
  update = void 0;
36554
36263
  constructor() {
36555
36264
  super();
36556
- this.initialize();
36557
- }
36558
- initialize() {
36559
36265
  this.pointers = new Map();
36560
36266
  this.initialized = false;
36561
36267
  this.state = VIDEO_TOOL_STATE.IDLE;
@@ -36602,7 +36308,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
36602
36308
  this.cancelAction();
36603
36309
  return;
36604
36310
  }
36605
- }, { signal: this.instance.getEventsController()?.signal });
36311
+ });
36606
36312
  stage.on("pointerdown", (e) => {
36607
36313
  this.setTapStart(e);
36608
36314
  this.pointers.set(e.evt.pointerId, {
@@ -36735,9 +36441,6 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36735
36441
  constructor(params) {
36736
36442
  super();
36737
36443
  this.config = mergeExceptArrays(WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
36738
- this.initialize();
36739
- }
36740
- initialize() {
36741
36444
  this.initialized = false;
36742
36445
  this.state = MEASURE_TOOL_STATE.IDLE;
36743
36446
  this.measureId = null;
@@ -36764,7 +36467,7 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36764
36467
  const stage = this.instance.getStage();
36765
36468
  window.addEventListener("keydown", (e) => {
36766
36469
  if (e.code === "Escape" && this.instance.getActiveAction() === MEASURE_TOOL_ACTION_NAME) this.cancelAction();
36767
- }, { signal: this.instance.getEventsController()?.signal });
36470
+ });
36768
36471
  stage.on("pointermove", () => {
36769
36472
  if (this.state === MEASURE_TOOL_STATE.IDLE) return;
36770
36473
  if (this.state === MEASURE_TOOL_STATE.SET_TO) {
@@ -37034,9 +36737,6 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37034
36737
  constructor(params) {
37035
36738
  super();
37036
36739
  this.config = mergeExceptArrays(CONNECTOR_TOOL_DEFAULT_CONFIG, params?.config);
37037
- this.initialize();
37038
- }
37039
- initialize() {
37040
36740
  this.pointers = new Map();
37041
36741
  this.initialized = false;
37042
36742
  this.tempLineNode = null;
@@ -37075,7 +36775,7 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37075
36775
  return;
37076
36776
  }
37077
36777
  if (e.code === "Escape" && this.instance.getActiveAction() === CONNECTOR_TOOL_ACTION_NAME) this.cancelAction();
37078
- }, { signal: this.instance.getEventsController()?.signal });
36778
+ });
37079
36779
  let nodeHovered = void 0;
37080
36780
  stage.on("pointermove", () => {
37081
36781
  if (!(this.state === CONNECTOR_TOOL_STATE.SELECTING_INITIAL || this.state === CONNECTOR_TOOL_STATE.SELECTING_FINAL)) return;
@@ -37390,9 +37090,16 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37390
37090
  //#endregion
37391
37091
  //#region src/plugins/stage-grid/stage-grid.ts
37392
37092
  var WeaveStageGridPlugin = class extends WeavePlugin {
37093
+ actStageZoomX = 1;
37094
+ actStageZoomY = 1;
37095
+ actStagePosX = 0;
37096
+ actStagePosY = 0;
37393
37097
  constructor(params) {
37394
37098
  super();
37395
37099
  const { config } = params ?? {};
37100
+ this.moveToolActive = false;
37101
+ this.isMouseMiddleButtonPressed = false;
37102
+ this.isSpaceKeyPressed = false;
37396
37103
  this.config = {
37397
37104
  type: WEAVE_GRID_DEFAULT_TYPE,
37398
37105
  gridColor: WEAVE_GRID_DEFAULT_COLOR,
@@ -37401,17 +37108,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37401
37108
  gridDotMaxDotsPerAxis: WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS,
37402
37109
  ...config
37403
37110
  };
37404
- this.initialize();
37405
- }
37406
- initialize() {
37407
- this.moveToolActive = false;
37408
- this.isMouseMiddleButtonPressed = false;
37409
- this.isSpaceKeyPressed = false;
37410
37111
  this.forceStageChange = false;
37411
- this.actStagePosX = 0;
37412
- this.actStagePosY = 0;
37413
- this.actStageZoomX = 1;
37414
- this.actStageZoomY = 1;
37415
37112
  }
37416
37113
  getName() {
37417
37114
  return WEAVE_STAGE_GRID_PLUGIN_KEY;
@@ -37436,10 +37133,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37436
37133
  const stage = this.instance.getStage();
37437
37134
  window.addEventListener("keydown", (e) => {
37438
37135
  if (e.code === "Space") this.isSpaceKeyPressed = true;
37439
- }, { signal: this.instance.getEventsController()?.signal });
37136
+ });
37440
37137
  window.addEventListener("keyup", (e) => {
37441
37138
  if (e.code === "Space") this.isSpaceKeyPressed = false;
37442
- }, { signal: this.instance.getEventsController()?.signal });
37139
+ });
37443
37140
  this.instance.addEventListener("onStageMove", () => {
37444
37141
  this.onRender();
37445
37142
  });
@@ -37673,14 +37370,15 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37673
37370
  //#endregion
37674
37371
  //#region src/plugins/stage-panning/stage-panning.ts
37675
37372
  var WeaveStagePanningPlugin = class extends WeavePlugin {
37373
+ panning = false;
37374
+ currentPointer = null;
37375
+ stageScrollInterval = void 0;
37376
+ panEdgeTargets = {};
37676
37377
  getLayerName = void 0;
37677
37378
  initLayer = void 0;
37678
37379
  constructor(params) {
37679
37380
  super();
37680
37381
  this.config = mergeExceptArrays(WEAVE_STAGE_PANNING_DEFAULT_CONFIG, params?.config ?? {});
37681
- this.initialize();
37682
- }
37683
- initialize() {
37684
37382
  this.pointers = new Map();
37685
37383
  this.panning = false;
37686
37384
  this.isDragging = false;
@@ -37692,9 +37390,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37692
37390
  this.isCtrlOrMetaPressed = false;
37693
37391
  this.isSpaceKeyPressed = false;
37694
37392
  this.previousPointer = null;
37695
- this.currentPointer = null;
37696
- this.stageScrollInterval = void 0;
37697
- this.panEdgeTargets = {};
37698
37393
  }
37699
37394
  getName() {
37700
37395
  return WEAVE_STAGE_PANNING_KEY;
@@ -37728,7 +37423,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37728
37423
  this.isSpaceKeyPressed = true;
37729
37424
  this.setCursor();
37730
37425
  }
37731
- }, { signal: this.instance.getEventsController()?.signal });
37426
+ });
37732
37427
  window.addEventListener("keyup", (e) => {
37733
37428
  if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
37734
37429
  if (e.code === "Space") {
@@ -37739,7 +37434,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37739
37434
  this.isSpaceKeyPressed = false;
37740
37435
  this.disableMove();
37741
37436
  }
37742
- }, { signal: this.instance.getEventsController()?.signal });
37437
+ });
37743
37438
  let lastPos = null;
37744
37439
  stage.on("pointerdown", (e) => {
37745
37440
  this.pointers.set(e.evt.pointerId, {
@@ -37812,10 +37507,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37812
37507
  this.instance.emitEvent("onStageMove");
37813
37508
  };
37814
37509
  const handleWheelThrottled = (0, import_lodash.throttle)(handleWheel, WEAVE_STAGE_PANNING_THROTTLE_MS);
37815
- window.addEventListener("wheel", handleWheelThrottled, {
37816
- passive: true,
37817
- signal: this.instance.getEventsController()?.signal
37818
- });
37510
+ window.addEventListener("wheel", handleWheelThrottled, { passive: true });
37819
37511
  stage.on("dragstart", (e) => {
37820
37512
  const duration = 1e3 / 60;
37821
37513
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
@@ -37873,10 +37565,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37873
37565
  stage.container().style.setProperty("-webkit-user-drag", "none");
37874
37566
  stage.getContent().addEventListener("touchmove", function(e) {
37875
37567
  e.preventDefault();
37876
- }, {
37877
- passive: false,
37878
- signal: this.instance.getEventsController()?.signal
37879
- });
37568
+ }, { passive: false });
37880
37569
  }
37881
37570
  isPanning() {
37882
37571
  return this.panning;
@@ -37954,9 +37643,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
37954
37643
  constructor(params) {
37955
37644
  super();
37956
37645
  this.config = mergeExceptArrays(STAGE_MINIMAP_DEFAULT_CONFIG, params.config);
37957
- this.initialize();
37958
- }
37959
- initialize() {
37960
37646
  this.initialized = false;
37961
37647
  }
37962
37648
  getName() {
@@ -38134,7 +37820,6 @@ const WEAVE_STAGE_RESIZE_KEY = "stageResize";
38134
37820
  var WeaveStageResizePlugin = class extends WeavePlugin {
38135
37821
  getLayerName = void 0;
38136
37822
  initLayer = void 0;
38137
- initialize = void 0;
38138
37823
  getName() {
38139
37824
  return WEAVE_STAGE_RESIZE_KEY;
38140
37825
  }
@@ -38154,10 +37839,6 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38154
37839
  const pluginInstance = plugins[pluginId];
38155
37840
  pluginInstance.onRender?.();
38156
37841
  }
38157
- this.instance.emitEvent("onStageResize", {
38158
- width: stage.width(),
38159
- height: stage.height()
38160
- });
38161
37842
  }
38162
37843
  }
38163
37844
  onInit() {
@@ -38166,7 +37847,7 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38166
37847
  }, DEFAULT_THROTTLE_MS);
38167
37848
  window.addEventListener("resize", () => {
38168
37849
  throttledResize();
38169
- }, { signal: this.instance.getEventsController()?.signal });
37850
+ });
38170
37851
  const resizeObserver = new ResizeObserver(() => {
38171
37852
  throttledResize();
38172
37853
  });
@@ -38184,12 +37865,10 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38184
37865
  //#endregion
38185
37866
  //#region src/plugins/nodes-multi-selection-feedback/nodes-multi-selection-feedback.ts
38186
37867
  var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
37868
+ selectedHalos = {};
38187
37869
  constructor(params) {
38188
37870
  super();
38189
37871
  this.config = mergeExceptArrays(WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, params?.config ?? {});
38190
- this.initialize();
38191
- }
38192
- initialize() {
38193
37872
  this.selectedHalos = {};
38194
37873
  }
38195
37874
  getName() {
@@ -38355,14 +38034,12 @@ var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
38355
38034
  //#endregion
38356
38035
  //#region src/plugins/connected-users/connected-users.ts
38357
38036
  var WeaveConnectedUsersPlugin = class extends WeavePlugin {
38037
+ connectedUsers = {};
38358
38038
  getLayerName = void 0;
38359
38039
  constructor(params) {
38360
38040
  super();
38361
38041
  const { config } = params ?? {};
38362
38042
  this.config = config;
38363
- this.initialize();
38364
- }
38365
- initialize() {
38366
38043
  this.connectedUsers = {};
38367
38044
  }
38368
38045
  getName() {
@@ -38409,9 +38086,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
38409
38086
  this.config = config;
38410
38087
  this.config.getUser = memoize(this.config.getUser);
38411
38088
  this.config.getUserColor = memoize(this.config.getUserColor);
38412
- this.initialize();
38413
- }
38414
- initialize() {
38415
38089
  this.usersSelection = {};
38416
38090
  }
38417
38091
  getName() {
@@ -38604,9 +38278,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
38604
38278
  this.config.getUser = memoize(this.config.getUser);
38605
38279
  this.config.getUserBackgroundColor = memoize(this.config.getUserBackgroundColor);
38606
38280
  this.config.getUserForegroundColor = memoize(this.config.getUserForegroundColor);
38607
- this.initialize();
38608
- }
38609
- initialize() {
38610
38281
  this.usersPointers = {};
38611
38282
  this.usersOperations = {};
38612
38283
  }
@@ -38817,9 +38488,6 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
38817
38488
  super();
38818
38489
  const { config } = params;
38819
38490
  this.config = mergeExceptArrays(WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, config);
38820
- this.initialize();
38821
- }
38822
- initialize() {
38823
38491
  this.userPresence = {};
38824
38492
  }
38825
38493
  getName() {
@@ -38895,9 +38563,6 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38895
38563
  initLayer = void 0;
38896
38564
  constructor() {
38897
38565
  super();
38898
- this.initialize();
38899
- }
38900
- initialize() {
38901
38566
  this.enabled = true;
38902
38567
  }
38903
38568
  getName() {
@@ -38911,20 +38576,14 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38911
38576
  stage.container().addEventListener("dragover", (e) => {
38912
38577
  e.preventDefault();
38913
38578
  e.stopPropagation();
38914
- }, { signal: this.instance.getEventsController()?.signal });
38579
+ });
38915
38580
  stage.container().addEventListener("drop", (e) => {
38916
38581
  e.preventDefault();
38917
38582
  e.stopPropagation();
38918
38583
  this.instance.emitEvent("onStageDrop", e);
38919
- }, { signal: this.instance.getEventsController()?.signal });
38920
- window.addEventListener("dragover", (e) => e.preventDefault(), {
38921
- signal: this.instance.getEventsController()?.signal,
38922
- passive: false
38923
- });
38924
- window.addEventListener("drop", (e) => e.preventDefault(), {
38925
- signal: this.instance.getEventsController()?.signal,
38926
- passive: false
38927
38584
  });
38585
+ window.addEventListener("dragover", (e) => e.preventDefault(), { passive: false });
38586
+ window.addEventListener("drop", (e) => e.preventDefault(), { passive: false });
38928
38587
  }
38929
38588
  enable() {
38930
38589
  this.enabled = true;
@@ -38943,9 +38602,6 @@ var WeaveNodesEdgeSnappingPlugin = class extends WeavePlugin {
38943
38602
  this.guideLineConfig = config?.guideLine ?? GUIDE_LINE_DEFAULT_CONFIG;
38944
38603
  this.dragSnappingThreshold = config?.dragSnappingThreshold ?? GUIDE_LINE_DRAG_SNAPPING_THRESHOLD;
38945
38604
  this.transformSnappingThreshold = config?.transformSnappingThreshold ?? GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD;
38946
- this.initialize();
38947
- }
38948
- initialize() {
38949
38605
  this.enabled = true;
38950
38606
  }
38951
38607
  getName() {
@@ -39322,9 +38978,6 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39322
38978
  this.enterSnappingTolerance = config?.enterSnappingTolerance ?? GUIDE_ENTER_SNAPPING_TOLERANCE;
39323
38979
  this.exitSnappingTolerance = config?.exitSnappingTolerance ?? GUIDE_EXIT_SNAPPING_TOLERANCE;
39324
38980
  this.uiConfig = mergeExceptArrays(GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, config?.ui);
39325
- this.initialize();
39326
- }
39327
- initialize() {
39328
38981
  this.enabled = true;
39329
38982
  }
39330
38983
  getName() {
@@ -39971,14 +39624,12 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39971
39624
  //#endregion
39972
39625
  //#region src/plugins/comments-renderer/comments-renderer.ts
39973
39626
  var WeaveCommentsRendererPlugin = class extends WeavePlugin {
39627
+ comments = [];
39974
39628
  getLayerName = void 0;
39975
39629
  constructor(params) {
39976
39630
  super();
39977
39631
  const { config } = params ?? {};
39978
39632
  this.config = config;
39979
- this.initialize();
39980
- }
39981
- initialize() {
39982
39633
  this.comments = [];
39983
39634
  }
39984
39635
  getName() {
@@ -40069,7 +39720,6 @@ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40069
39720
  var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40070
39721
  getLayerName = void 0;
40071
39722
  initLayer = void 0;
40072
- initialize = void 0;
40073
39723
  constructor(params) {
40074
39724
  super();
40075
39725
  this.config = mergeExceptArrays(WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, params?.config ?? {});
@@ -40108,7 +39758,7 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40108
39758
  if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40109
39759
  if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40110
39760
  if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40111
- }, { signal: this.instance.getEventsController()?.signal });
39761
+ });
40112
39762
  }
40113
39763
  enable() {
40114
39764
  this.enabled = true;
@@ -40165,4 +39815,4 @@ function getJSONFromYjsBinary(actualState) {
40165
39815
  }
40166
39816
 
40167
39817
  //#endregion
40168
- 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_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_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 };
39818
+ 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, 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_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 };