@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/types.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();
@@ -21995,34 +21978,11 @@ var WeaveRegisterManager = class {
21995
21978
  }
21996
21979
  }
21997
21980
  }
21998
- resetNodesHandlers() {
21999
- for (const nodeHandlerId of Object.keys(this.nodesHandlers)) {
22000
- const nodeHandler = this.nodesHandlers[nodeHandlerId];
22001
- nodeHandler.initialize?.();
22002
- }
22003
- }
22004
- resetActionsHandlers() {
22005
- for (const actionHandlerId of Object.keys(this.actionsHandlers)) {
22006
- const actionHandler = this.actionsHandlers[actionHandlerId];
22007
- actionHandler.initialize?.();
22008
- }
22009
- }
22010
- resetPlugins() {
22011
- for (const pluginId of Object.keys(this.plugins)) {
22012
- const plugin = this.plugins[pluginId];
22013
- plugin.initialize?.();
22014
- }
22015
- }
22016
- reset() {
22017
- this.resetNodesHandlers();
22018
- this.resetActionsHandlers();
22019
- this.resetPlugins();
22020
- }
22021
21981
  };
22022
21982
 
22023
21983
  //#endregion
22024
21984
  //#region package.json
22025
- var version = "3.4.0-SNAPSHOT.85.1";
21985
+ var version = "3.4.0";
22026
21986
 
22027
21987
  //#endregion
22028
21988
  //#region src/managers/setup.ts
@@ -22139,11 +22099,6 @@ var WeaveStageManager = class {
22139
22099
  initialZIndex: void 0
22140
22100
  };
22141
22101
  const stage = new Konva.Stage({ ...props });
22142
- if (!this.instance.isServerSide()) {
22143
- const containerParent = stage.container().parentNode;
22144
- stage.width(containerParent.clientWidth);
22145
- stage.height(containerParent.clientHeight);
22146
- }
22147
22102
  const realContainer = stage.container();
22148
22103
  if (realContainer !== void 0 && realContainer.style?.position !== "relative") realContainer.style.position = "relative";
22149
22104
  this.setStage(stage);
@@ -22452,91 +22407,6 @@ var WeaveExportManager = class {
22452
22407
  height: imageHeight * pixelRatio
22453
22408
  };
22454
22409
  }
22455
- async exportAreaServerSide(area, options) {
22456
- const { format = WEAVE_EXPORT_FORMATS.PNG, padding = 0, pixelRatio = 1, backgroundColor = WEAVE_EXPORT_BACKGROUND_COLOR } = options;
22457
- this.getNodesSelectionPlugin()?.disable();
22458
- this.getNodesDistanceSnappingPlugin()?.disable();
22459
- this.getNodesEdgeSnappingPlugin()?.disable();
22460
- this.getStageGridPlugin()?.disable();
22461
- const stage = this.instance.getStage();
22462
- const mainLayer = this.instance.getMainLayer();
22463
- if (!mainLayer) throw new Error("Main layer not found");
22464
- const originalPosition = {
22465
- x: stage.x(),
22466
- y: stage.y()
22467
- };
22468
- const originalScale = {
22469
- x: stage.scaleX(),
22470
- y: stage.scaleY()
22471
- };
22472
- stage.scale({
22473
- x: 1,
22474
- y: 1
22475
- });
22476
- const bounds = area;
22477
- const scaleX = stage.scaleX();
22478
- const scaleY = stage.scaleY();
22479
- const unscaledBounds = {
22480
- x: bounds.x / scaleX,
22481
- y: bounds.y / scaleY,
22482
- width: bounds.width / scaleX,
22483
- height: bounds.height / scaleY
22484
- };
22485
- const background = new Konva.Rect({
22486
- x: unscaledBounds.x - padding,
22487
- y: unscaledBounds.y - padding,
22488
- width: unscaledBounds.width + 2 * padding,
22489
- height: unscaledBounds.height + 2 * padding,
22490
- strokeWidth: 0,
22491
- fill: backgroundColor
22492
- });
22493
- mainLayer.add(background);
22494
- background.moveToBottom();
22495
- const backgroundRect = background.getClientRect({ relativeTo: stage });
22496
- const composites = [];
22497
- const imageWidth = Math.round(backgroundRect.width);
22498
- const imageHeight = Math.round(backgroundRect.height);
22499
- const maxRenderSize = 1920;
22500
- const cols = Math.ceil(imageWidth / maxRenderSize);
22501
- const rows = Math.ceil(imageHeight / maxRenderSize);
22502
- const tileWidth = Math.floor(imageWidth / cols);
22503
- const tileHeight = Math.floor(imageHeight / rows);
22504
- for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22505
- const width = Math.min(tileWidth, imageWidth - x);
22506
- const height = Math.min(tileHeight, imageHeight - y);
22507
- const canvas = await mainLayer.toCanvas({
22508
- x: Math.round(backgroundRect.x) + x,
22509
- y: Math.round(backgroundRect.y) + y,
22510
- width,
22511
- height,
22512
- mimeType: format,
22513
- pixelRatio,
22514
- quality: options.quality ?? 1
22515
- });
22516
- let buffer = null;
22517
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.CANVAS) buffer = canvas.toBuffer();
22518
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.SKIA) buffer = await canvas.toBuffer();
22519
- if (!buffer) throw new Error("Failed to generate image buffer");
22520
- composites.push({
22521
- top: y * pixelRatio,
22522
- left: x * pixelRatio,
22523
- input: buffer
22524
- });
22525
- }
22526
- background.destroy();
22527
- stage.position(originalPosition);
22528
- stage.scale(originalScale);
22529
- stage.batchDraw();
22530
- this.getNodesSelectionPlugin()?.enable();
22531
- this.getNodesDistanceSnappingPlugin()?.enable();
22532
- this.getNodesEdgeSnappingPlugin()?.enable();
22533
- this.getStageGridPlugin()?.enable();
22534
- return {
22535
- composites,
22536
- width: imageWidth * pixelRatio,
22537
- height: imageHeight * pixelRatio
22538
- };
22539
- }
22540
22410
  imageToBase64(img, mimeType) {
22541
22411
  if (img.naturalWidth === 0 && img.naturalHeight === 0) throw new Error("Image has no content");
22542
22412
  const canvas = document.createElement("canvas");
@@ -22816,12 +22686,7 @@ var WeaveAsyncManager = class {
22816
22686
  this.instance.emitEvent("onAsyncElementChange");
22817
22687
  }, new Map());
22818
22688
  }
22819
- reset() {
22820
- this.asyncElements.clear();
22821
- this.asyncElementsLoadedEventEmitted = false;
22822
- }
22823
22689
  checkForAsyncElements(elements) {
22824
- this.instance.emitEvent("onAsyncElementsIdle");
22825
22690
  const amountAsyncResourcesExtracted = this.extractAsyncResources(elements);
22826
22691
  if (amountAsyncResourcesExtracted === 0 && !this.asyncElementsLoadedEventEmitted) {
22827
22692
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -22874,7 +22739,7 @@ var WeaveAsyncManager = class {
22874
22739
  status: WEAVE_ASYNC_STATUS.LOADING
22875
22740
  };
22876
22741
  this.asyncElements.set(nodeId, element);
22877
- if (!this.asyncElementsLoadedEventEmitted) this.instance.emitEvent("onAsyncElementsLoading", {
22742
+ this.instance.emitEvent("onAsyncElementsLoading", {
22878
22743
  loaded: this.getAmountAsyncElementsLoaded(),
22879
22744
  total: this.getAmountAsyncElements()
22880
22745
  });
@@ -22887,11 +22752,11 @@ var WeaveAsyncManager = class {
22887
22752
  status: WEAVE_ASYNC_STATUS.LOADED
22888
22753
  };
22889
22754
  this.asyncElements.set(nodeId, element);
22755
+ this.instance.emitEvent("onAsyncElementsLoading", {
22756
+ loaded: this.getAmountAsyncElementsLoaded(),
22757
+ total: this.getAmountAsyncElements()
22758
+ });
22890
22759
  if (!this.asyncElementsLoadedEventEmitted) {
22891
- this.instance.emitEvent("onAsyncElementsLoading", {
22892
- loaded: this.getAmountAsyncElementsLoaded(),
22893
- total: this.getAmountAsyncElements()
22894
- });
22895
22760
  const allLoaded = this.asyncElementsLoaded();
22896
22761
  if (allLoaded) {
22897
22762
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -23016,7 +22881,6 @@ var Weave = class {
23016
22881
  constructor(weaveConfig, stageConfig) {
23017
22882
  globalThis._weave_isServerSide = false;
23018
22883
  if (typeof window === "undefined") globalThis._weave_isServerSide = true;
23019
- this.eventsController = void 0;
23020
22884
  this.emitter = new Emittery();
23021
22885
  Konva.showWarnings = false;
23022
22886
  this.id = v4_default();
@@ -23062,7 +22926,6 @@ var Weave = class {
23062
22926
  this.initialized = true;
23063
22927
  this.status = WEAVE_INSTANCE_STATUS.RUNNING;
23064
22928
  this.emitEvent("onInstanceStatus", this.status);
23065
- this.emitEvent("onRender");
23066
22929
  });
23067
22930
  }
23068
22931
  setStatus(status) {
@@ -23087,7 +22950,6 @@ var Weave = class {
23087
22950
  async start() {
23088
22951
  this.moduleLogger.info("Start instance");
23089
22952
  if (!this.isServerSide()) {
23090
- this.eventsController = new AbortController();
23091
22953
  if (!window.weave) window.weave = this;
23092
22954
  }
23093
22955
  this.emitEvent("onRoomLoaded", false);
@@ -23111,39 +22973,8 @@ var Weave = class {
23111
22973
  store.setup();
23112
22974
  store.connect();
23113
22975
  }
23114
- async switchRoom() {
23115
- this.moduleLogger.info(`Switching room`);
23116
- const nodeHandlers = this.registerManager.getNodesHandlers();
23117
- for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23118
- const nodeHandler = nodeHandlers[nodeHandlerKey];
23119
- nodeHandler?.onDestroyInstance();
23120
- }
23121
- const stage = this.getStage();
23122
- if (stage) stage.destroy();
23123
- if (this.eventsController) this.eventsController.abort();
23124
- if (!this.isServerSide()) this.eventsController = new AbortController();
23125
- this.registerManager.reset();
23126
- this.asyncManager.reset();
23127
- this.moduleLogger.info("Switching room instance");
23128
- if (!this.isServerSide()) {
23129
- if (!window.weave) window.weave = this;
23130
- }
23131
- this.emitEvent("onRoomLoaded", false);
23132
- this.status = WEAVE_INSTANCE_STATUS.STARTING;
23133
- this.emitEvent("onInstanceStatus", this.status);
23134
- this.registerManager.reset();
23135
- this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23136
- this.emitEvent("onInstanceStatus", this.status);
23137
- await this.fontsManager.loadFonts();
23138
- this.setupManager.setupLog();
23139
- this.stageManager.initStage();
23140
- this.status = WEAVE_INSTANCE_STATUS.CONNECTING_TO_ROOM;
23141
- this.emitEvent("onInstanceStatus", this.status);
23142
- this.addEventListener("onStoreConnectionStatusChange", this.handleStoreConnectionStatusChange.bind(this));
23143
- }
23144
22976
  destroy() {
23145
22977
  this.moduleLogger.info(`Destroying the instance`);
23146
- if (this.eventsController) this.eventsController.abort();
23147
22978
  this.emitter.clearListeners();
23148
22979
  this.status = WEAVE_INSTANCE_STATUS.IDLE;
23149
22980
  this.emitEvent("onInstanceStatus", this.status);
@@ -23613,9 +23444,6 @@ var Weave = class {
23613
23444
  async exportNodesServerSide(nodes, boundingNodes, options) {
23614
23445
  return await this.exportManager.exportNodesServerSide(nodes, boundingNodes, options);
23615
23446
  }
23616
- async exportAreaServerSide(area, options) {
23617
- return await this.exportManager.exportAreaServerSide(area, options);
23618
- }
23619
23447
  async exportNodes(nodes, boundingNodes, options) {
23620
23448
  return await this.exportManager.exportNodesAsImage(nodes, boundingNodes, options);
23621
23449
  }
@@ -23781,9 +23609,6 @@ var Weave = class {
23781
23609
  getDragProperties() {
23782
23610
  return this.dragAndDropManager.getDragProperties();
23783
23611
  }
23784
- getEventsController() {
23785
- return this.eventsController;
23786
- }
23787
23612
  };
23788
23613
 
23789
23614
  //#endregion
@@ -23875,7 +23700,6 @@ const downscaleImageFromURL = (url, options) => {
23875
23700
  //#endregion
23876
23701
  //#region src/internal-utils/upscale.ts
23877
23702
  const setupUpscaleStage = (instance, stage) => {
23878
- if (instance.isServerSide()) return;
23879
23703
  const config = instance.getConfiguration();
23880
23704
  const doUpscale = config.performance?.upscale?.enabled ?? false;
23881
23705
  if (doUpscale) {
@@ -23907,14 +23731,7 @@ const setupUpscaleStage = (instance, stage) => {
23907
23731
  innerElement.style.transformOrigin = "0 0";
23908
23732
  innerElement.style.transform = `scale(${scaleToCover})`;
23909
23733
  }
23910
- } else {
23911
- const realContainer = stage.container();
23912
- const containerWidth = realContainer.offsetWidth;
23913
- const containerHeight = realContainer.offsetHeight;
23914
- stage.width(containerWidth);
23915
- stage.height(containerHeight);
23916
- stage.setAttrs({ upscaleScale: 1 });
23917
- }
23734
+ } else stage.setAttrs({ upscaleScale: 1 });
23918
23735
  };
23919
23736
 
23920
23737
  //#endregion
@@ -23925,7 +23742,6 @@ var WeaveStageNode = class extends WeaveNode {
23925
23742
  wheelMousePressed = false;
23926
23743
  isCmdCtrlPressed = false;
23927
23744
  globalEventsInitialized = false;
23928
- initialize = void 0;
23929
23745
  onRender(props) {
23930
23746
  const stage = new Konva.Stage({
23931
23747
  ...props,
@@ -23944,10 +23760,10 @@ var WeaveStageNode = class extends WeaveNode {
23944
23760
  container.setAttribute("tabindex", "0");
23945
23761
  stage.container().addEventListener("focus", () => {
23946
23762
  this.stageFocused = true;
23947
- }, { signal: this.instance.getEventsController()?.signal });
23763
+ });
23948
23764
  stage.container().addEventListener("blur", () => {
23949
23765
  this.stageFocused = false;
23950
- }, { signal: this.instance.getEventsController()?.signal });
23766
+ });
23951
23767
  }
23952
23768
  Konva.Stage.prototype.mode = function(mode) {
23953
23769
  if (typeof mode !== "undefined") this._mode = mode;
@@ -24017,7 +23833,7 @@ var WeaveStageNode = class extends WeaveNode {
24017
23833
  const selectedNode = transformer.nodes()[0];
24018
23834
  selectedNode.fire("onCmdCtrlPressed");
24019
23835
  }
24020
- }, { signal: this.instance.getEventsController()?.signal });
23836
+ });
24021
23837
  window.addEventListener("keyup", (e) => {
24022
23838
  if (!(e.ctrlKey || e.metaKey)) {
24023
23839
  this.isCmdCtrlPressed = false;
@@ -24028,7 +23844,7 @@ var WeaveStageNode = class extends WeaveNode {
24028
23844
  const selectedNode = transformer.nodes()[0];
24029
23845
  selectedNode.fire("onCmdCtrlReleased");
24030
23846
  }
24031
- }, { signal: this.instance.getEventsController()?.signal });
23847
+ });
24032
23848
  this.globalEventsInitialized = true;
24033
23849
  }
24034
23850
  isOnlyCtrlOrMeta(event) {
@@ -24048,7 +23864,6 @@ const WEAVE_LAYER_NODE_TYPE = "layer";
24048
23864
  //#region src/nodes/layer/layer.ts
24049
23865
  var WeaveLayerNode = class extends WeaveNode {
24050
23866
  nodeType = WEAVE_LAYER_NODE_TYPE;
24051
- initialize = void 0;
24052
23867
  onRender(props) {
24053
23868
  const layer = new Konva.Layer({ ...props });
24054
23869
  layer.canMoveToContainer = function() {
@@ -24096,7 +23911,6 @@ const WEAVE_GROUP_NODE_TYPE = "group";
24096
23911
  //#region src/nodes/group/group.ts
24097
23912
  var WeaveGroupNode = class extends WeaveNode {
24098
23913
  nodeType = WEAVE_GROUP_NODE_TYPE;
24099
- initialize = void 0;
24100
23914
  constructor(params) {
24101
23915
  super();
24102
23916
  const { config } = params ?? {};
@@ -24189,7 +24003,6 @@ const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
24189
24003
  //#region src/nodes/rectangle/rectangle.ts
24190
24004
  var WeaveRectangleNode = class extends WeaveNode {
24191
24005
  nodeType = WEAVE_RECTANGLE_NODE_TYPE;
24192
- initialize = void 0;
24193
24006
  constructor(params) {
24194
24007
  super();
24195
24008
  const { config } = params ?? {};
@@ -24233,7 +24046,6 @@ const WEAVE_ELLIPSE_NODE_TYPE = "ellipse";
24233
24046
  //#region src/nodes/ellipse/ellipse.ts
24234
24047
  var WeaveEllipseNode = class extends WeaveNode {
24235
24048
  nodeType = WEAVE_ELLIPSE_NODE_TYPE;
24236
- initialize = void 0;
24237
24049
  constructor(params) {
24238
24050
  super();
24239
24051
  const { config } = params ?? {};
@@ -24379,16 +24191,13 @@ var WeaveLineNode = class extends WeaveNode {
24379
24191
  constructor(params) {
24380
24192
  super();
24381
24193
  this.config = mergeExceptArrays(WEAVE_LINE_NODE_DEFAULT_CONFIG, params?.config ?? {});
24194
+ this.handleNodeChanges = null;
24195
+ this.handleZoomChanges = null;
24382
24196
  this.snapper = new GreedySnapper({
24383
24197
  snapAngles: this.config.snapAngles.angles,
24384
24198
  activateThreshold: this.config.snapAngles.activateThreshold,
24385
24199
  releaseThreshold: this.config.snapAngles.releaseThreshold
24386
24200
  });
24387
- this.initialize();
24388
- }
24389
- initialize() {
24390
- this.handleNodeChanges = null;
24391
- this.handleZoomChanges = null;
24392
24201
  }
24393
24202
  onRender(props) {
24394
24203
  const line = new Konva.Line({
@@ -24693,19 +24502,17 @@ const TEXT_LAYOUT = {
24693
24502
  //#region src/nodes/text/text.ts
24694
24503
  var WeaveTextNode = class extends WeaveNode {
24695
24504
  nodeType = WEAVE_TEXT_NODE_TYPE;
24505
+ editing = false;
24506
+ textAreaSuperContainer = null;
24507
+ textAreaContainer = null;
24508
+ textArea = null;
24509
+ eventsInitialized = false;
24510
+ isCtrlMetaPressed = false;
24696
24511
  constructor(params) {
24697
24512
  super();
24698
24513
  const { config } = params ?? {};
24699
24514
  this.config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, config);
24700
- this.initialize();
24701
- }
24702
- initialize() {
24703
24515
  this.keyPressHandler = void 0;
24704
- this.eventsInitialized = false;
24705
- this.isCtrlMetaPressed = false;
24706
- this.textAreaSuperContainer = null;
24707
- this.textAreaContainer = null;
24708
- this.textArea = null;
24709
24516
  this.editing = false;
24710
24517
  this.textArea = null;
24711
24518
  }
@@ -24713,10 +24520,10 @@ var WeaveTextNode = class extends WeaveNode {
24713
24520
  if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
24714
24521
  window.addEventListener("keydown", (e) => {
24715
24522
  if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
24716
- }, { signal: this.instance.getEventsController()?.signal });
24523
+ });
24717
24524
  window.addEventListener("keyup", (e) => {
24718
24525
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
24719
- }, { signal: this.instance.getEventsController()?.signal });
24526
+ });
24720
24527
  this.eventsInitialized = true;
24721
24528
  }
24722
24529
  }
@@ -24744,7 +24551,7 @@ var WeaveTextNode = class extends WeaveNode {
24744
24551
  onAdd() {
24745
24552
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24746
24553
  this.keyPressHandler = this.handleKeyPress.bind(this);
24747
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24554
+ window.addEventListener("keypress", this.keyPressHandler);
24748
24555
  }
24749
24556
  }
24750
24557
  onRender(props) {
@@ -24898,7 +24705,7 @@ var WeaveTextNode = class extends WeaveNode {
24898
24705
  });
24899
24706
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24900
24707
  this.keyPressHandler = this.handleKeyPress.bind(this);
24901
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24708
+ window.addEventListener("keypress", this.keyPressHandler);
24902
24709
  }
24903
24710
  return text;
24904
24711
  }
@@ -25157,17 +24964,17 @@ var WeaveTextNode = class extends WeaveNode {
25157
24964
  this.textAreaSuperContainer.scrollTop = 0;
25158
24965
  this.textAreaSuperContainer.scrollLeft = 0;
25159
24966
  }
25160
- }, { signal: this.instance.getEventsController()?.signal });
24967
+ });
25161
24968
  this.textAreaContainer.addEventListener("scroll", () => {
25162
24969
  if (!this.textAreaContainer) return;
25163
24970
  this.textAreaContainer.scrollTop = 0;
25164
24971
  this.textAreaContainer.scrollLeft = 0;
25165
- }, { signal: this.instance.getEventsController()?.signal });
24972
+ });
25166
24973
  this.textArea.addEventListener("scroll", () => {
25167
24974
  if (!this.textArea) return;
25168
24975
  this.textArea.scrollTop = 0;
25169
24976
  this.textArea.scrollLeft = 0;
25170
- }, { signal: this.instance.getEventsController()?.signal });
24977
+ });
25171
24978
  const rotation = textNode.getAbsoluteRotation();
25172
24979
  if (rotation) {
25173
24980
  const transform = "rotate(" + rotation + "deg)";
@@ -25216,8 +25023,8 @@ var WeaveTextNode = class extends WeaveNode {
25216
25023
  this.textAreaDomResize(textNode);
25217
25024
  }
25218
25025
  };
25219
- this.textArea.addEventListener("keydown", handleKeyDown, { signal: this.instance.getEventsController()?.signal });
25220
- this.textArea.addEventListener("keyup", handleKeyUp, { signal: this.instance.getEventsController()?.signal });
25026
+ this.textArea.addEventListener("keydown", handleKeyDown);
25027
+ this.textArea.addEventListener("keyup", handleKeyUp);
25221
25028
  this.textArea.tabIndex = 1;
25222
25029
  this.textArea.focus();
25223
25030
  const handleOutsideClick = (e) => {
@@ -25243,7 +25050,7 @@ var WeaveTextNode = class extends WeaveNode {
25243
25050
  }
25244
25051
  };
25245
25052
  setTimeout(() => {
25246
- window.addEventListener("pointerup", handleOutsideClick, { signal: this.instance.getEventsController()?.signal });
25053
+ window.addEventListener("pointerup", handleOutsideClick);
25247
25054
  }, 0);
25248
25055
  this.instance.getStage().mode(WEAVE_STAGE_TEXT_EDITION_MODE);
25249
25056
  this.editing = true;
@@ -25366,6 +25173,8 @@ const WEAVE_IMAGE_DEFAULT_CONFIG = {
25366
25173
  crossOrigin: "anonymous",
25367
25174
  useFallbackImage: true,
25368
25175
  cropMode: {
25176
+ enabled: true,
25177
+ triggers: { ctrlCmd: true },
25369
25178
  gridLines: { enabled: true },
25370
25179
  overlay: { fill: "rgba(0,0,0,0.2)" },
25371
25180
  selection: {
@@ -25577,7 +25386,7 @@ var WeaveImageCrop = class WeaveImageCrop {
25577
25386
  utilityLayer?.add(this.transformer);
25578
25387
  this.transformer?.forceUpdate();
25579
25388
  this.cropGroup.show();
25580
- window.addEventListener("keydown", this.handleHide, { signal: this.instance.getEventsController()?.signal });
25389
+ window.addEventListener("keydown", this.handleHide);
25581
25390
  if (options.cmdCtrl.triggered) {
25582
25391
  utilityLayer?.hide();
25583
25392
  const stage = this.instance.getStage();
@@ -26027,21 +25836,24 @@ const isAllowedUrl = (value) => {
26027
25836
  //#endregion
26028
25837
  //#region src/nodes/image/image.ts
26029
25838
  var WeaveImageNode = class extends WeaveNode {
25839
+ imageBitmapCache = {};
25840
+ imageSource = {};
25841
+ imageFallback = {};
25842
+ imageState = {};
25843
+ imageTryoutAttempts = {};
25844
+ imageTryoutIds = {};
26030
25845
  nodeType = WEAVE_IMAGE_NODE_TYPE;
26031
25846
  cursorsFallback = { loading: "wait" };
26032
25847
  cursors = {};
26033
25848
  constructor(params) {
26034
25849
  super();
26035
25850
  const { config } = params ?? {};
26036
- this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26037
- this.initialize();
26038
- }
26039
- initialize() {
26040
25851
  this.tapStart = {
26041
25852
  x: 0,
26042
25853
  y: 0,
26043
25854
  time: 0
26044
25855
  };
25856
+ this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26045
25857
  this.imageCrop = null;
26046
25858
  this.imageBitmapCache = {};
26047
25859
  this.imageSource = {};
@@ -26072,6 +25884,7 @@ var WeaveImageNode = class extends WeaveNode {
26072
25884
  this.logger.info(`image caching enabled: ${this.config.performance.cache.enabled}`);
26073
25885
  }
26074
25886
  triggerCrop(imageNode, options) {
25887
+ if (!this.config.cropMode.enabled) return;
26075
25888
  const stage = this.instance.getStage();
26076
25889
  if (imageNode.getAttrs().cropping ?? false) return;
26077
25890
  if (!(this.isSelecting() && this.isNodeSelected(imageNode))) return;
@@ -26097,6 +25910,7 @@ var WeaveImageNode = class extends WeaveNode {
26097
25910
  });
26098
25911
  }
26099
25912
  closeCrop = (imageNode, type) => {
25913
+ if (!this.config.cropMode.enabled) return;
26100
25914
  if (!this.imageCrop) return;
26101
25915
  const stage = this.instance.getStage();
26102
25916
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
@@ -26110,6 +25924,7 @@ var WeaveImageNode = class extends WeaveNode {
26110
25924
  }
26111
25925
  };
26112
25926
  resetCrop = (imageNode) => {
25927
+ if (!this.config.cropMode.enabled) return;
26113
25928
  const internalImage = imageNode.findOne(`#${imageNode.getAttrs().id}-image`);
26114
25929
  const cropGroup = imageNode.findOne(`#${imageNode.getAttrs().id}-cropGroup`);
26115
25930
  if (!internalImage || !cropGroup) return;
@@ -26153,19 +25968,21 @@ var WeaveImageNode = class extends WeaveNode {
26153
25968
  const image$1 = stage.findOne(`#${id}`);
26154
25969
  if (!image$1) return;
26155
25970
  };
26156
- image.triggerCrop = () => {
26157
- this.triggerCrop(image, { cmdCtrl: { triggered: false } });
26158
- };
26159
- image.closeCrop = (type) => {
26160
- this.closeCrop(image, type);
26161
- };
26162
- image.resetCrop = () => {
26163
- const stage = this.instance.getStage();
26164
- const image$1 = stage.findOne(`#${id}`);
26165
- if (!image$1) return;
26166
- const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
26167
- imageCrop.unCrop();
26168
- };
25971
+ if (this.config.cropMode.enabled) {
25972
+ image.triggerCrop = () => {
25973
+ this.triggerCrop(image, { cmdCtrl: { triggered: false } });
25974
+ };
25975
+ image.closeCrop = (type) => {
25976
+ this.closeCrop(image, type);
25977
+ };
25978
+ image.resetCrop = () => {
25979
+ const stage = this.instance.getStage();
25980
+ const image$1 = stage.findOne(`#${id}`);
25981
+ if (!image$1) return;
25982
+ const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
25983
+ imageCrop.unCrop();
25984
+ };
25985
+ }
26169
25986
  const defaultTransformerProperties = this.defaultGetTransformerProperties(this.config.transform);
26170
25987
  image.getTransformerProperties = function() {
26171
25988
  return defaultTransformerProperties;
@@ -26260,7 +26077,7 @@ var WeaveImageNode = class extends WeaveNode {
26260
26077
  };
26261
26078
  this.updateImageCrop(image);
26262
26079
  } else {
26263
- this.updatePlaceholderSize(image);
26080
+ this.updatePlaceholderSize(image, imagePlaceholder);
26264
26081
  this.loadImage(imageProps, image, true);
26265
26082
  }
26266
26083
  if (this.config.performance.cache.enabled) image.on("transformend", () => {
@@ -26272,24 +26089,26 @@ var WeaveImageNode = class extends WeaveNode {
26272
26089
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26273
26090
  }
26274
26091
  });
26275
- image.on("onCmdCtrlPressed", () => {
26276
- const transformer = this.getSelectionPlugin()?.getTransformer();
26277
- if (!transformer) return;
26278
- transformer.hide();
26279
- const utilityLayer = this.instance.getUtilityLayer();
26280
- if (!utilityLayer) return;
26281
- utilityLayer?.destroyChildren();
26282
- this.renderCropMode(utilityLayer, image);
26283
- utilityLayer?.show();
26284
- });
26285
- image.on("onCmdCtrlReleased", () => {
26286
- const transformer = this.getSelectionPlugin()?.getTransformer();
26287
- if (!transformer) return;
26288
- transformer.show();
26289
- const utilityLayer = this.instance.getUtilityLayer();
26290
- if (!utilityLayer) return;
26291
- utilityLayer?.destroyChildren();
26292
- });
26092
+ if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26093
+ image.on("onCmdCtrlPressed", () => {
26094
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26095
+ if (!transformer) return;
26096
+ transformer.hide();
26097
+ const utilityLayer = this.instance.getUtilityLayer();
26098
+ if (!utilityLayer) return;
26099
+ utilityLayer?.destroyChildren();
26100
+ this.renderCropMode(utilityLayer, image);
26101
+ utilityLayer?.show();
26102
+ });
26103
+ image.on("onCmdCtrlReleased", () => {
26104
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26105
+ if (!transformer) return;
26106
+ transformer.show();
26107
+ const utilityLayer = this.instance.getUtilityLayer();
26108
+ if (!utilityLayer) return;
26109
+ utilityLayer?.destroyChildren();
26110
+ });
26111
+ }
26293
26112
  image.on("onSelectionCleared", () => {
26294
26113
  const transformer = this.getSelectionPlugin()?.getTransformer();
26295
26114
  if (!transformer) return;
@@ -26343,6 +26162,7 @@ var WeaveImageNode = class extends WeaveNode {
26343
26162
  width: absoluteCorners[1].x - absoluteCorners[0].x,
26344
26163
  height: absoluteCorners[2].y - absoluteCorners[0].y,
26345
26164
  fill: "transparent",
26165
+ strokeScaleEnabled: false,
26346
26166
  strokeWidth: 2,
26347
26167
  stroke: "#1a1aff",
26348
26168
  draggable: false,
@@ -26355,13 +26175,6 @@ var WeaveImageNode = class extends WeaveNode {
26355
26175
  x: 1 / stageScale,
26356
26176
  y: 1 / stageScale
26357
26177
  });
26358
- stage.on("scaleXChange scaleYChange", () => {
26359
- const scale = stage.scaleX();
26360
- rect.scale({
26361
- x: 1 / scale,
26362
- y: 1 / scale
26363
- });
26364
- });
26365
26178
  }
26366
26179
  renderCropAnchor(position, node, layer, onClick) {
26367
26180
  const transform = node.getAbsoluteTransform().copy();
@@ -26647,7 +26460,7 @@ var WeaveImageNode = class extends WeaveNode {
26647
26460
  }
26648
26461
  this.loadAsyncElement(id);
26649
26462
  preloadFunction(id, realImageURL ?? "", {
26650
- onLoad: async () => {
26463
+ onLoad: () => {
26651
26464
  if (useFallback) this.imageTryoutIds[id] = setTimeout(() => {
26652
26465
  const node = this.instance.getStage().findOne(`#${id}`);
26653
26466
  if (node) {
@@ -26698,7 +26511,7 @@ var WeaveImageNode = class extends WeaveNode {
26698
26511
  error: false
26699
26512
  };
26700
26513
  this.updateImageCrop(image);
26701
- if (!useFallback) this.resolveAsyncElement(id);
26514
+ this.resolveAsyncElement(id);
26702
26515
  this.cacheNode(image);
26703
26516
  }
26704
26517
  },
@@ -26739,9 +26552,13 @@ var WeaveImageNode = class extends WeaveNode {
26739
26552
  }
26740
26553
  }, loadTryout);
26741
26554
  }
26742
- updatePlaceholderSize(image) {
26555
+ updatePlaceholderSize(image, imagePlaceholder) {
26743
26556
  const imageAttrs = image.getAttrs();
26744
26557
  if (!this.imageState[imageAttrs.id ?? ""]?.loaded) return;
26558
+ if (!imageAttrs.adding && !imageAttrs.cropInfo) {
26559
+ imagePlaceholder.width(imageAttrs.uncroppedImage.width);
26560
+ imagePlaceholder.height(imageAttrs.uncroppedImage.height);
26561
+ }
26745
26562
  }
26746
26563
  updateImageCrop(image) {
26747
26564
  const imageAttrs = image.getAttrs();
@@ -26875,7 +26692,6 @@ const WEAVE_STAR_NODE_TYPE = "star";
26875
26692
  //#region src/nodes/star/star.ts
26876
26693
  var WeaveStarNode = class extends WeaveNode {
26877
26694
  nodeType = WEAVE_STAR_NODE_TYPE;
26878
- initialize = void 0;
26879
26695
  constructor(params) {
26880
26696
  super();
26881
26697
  const { config } = params ?? {};
@@ -26961,7 +26777,6 @@ const WEAVE_ARROW_NODE_TYPE = "arrow";
26961
26777
  //#region src/nodes/arrow/arrow.ts
26962
26778
  var WeaveArrowNode = class extends WeaveNode {
26963
26779
  nodeType = WEAVE_ARROW_NODE_TYPE;
26964
- initialize = void 0;
26965
26780
  constructor(params) {
26966
26781
  super();
26967
26782
  const { config } = params ?? {};
@@ -27018,7 +26833,6 @@ const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
27018
26833
  //#region src/nodes/regular-polygon/regular-polygon.ts
27019
26834
  var WeaveRegularPolygonNode = class extends WeaveNode {
27020
26835
  nodeType = WEAVE_REGULAR_POLYGON_NODE_TYPE;
27021
- initialize = void 0;
27022
26836
  constructor(params) {
27023
26837
  super();
27024
26838
  const { config } = params ?? {};
@@ -27132,7 +26946,6 @@ var GroupFrame = class extends Konva.Group {
27132
26946
  //#region src/nodes/frame/frame.ts
27133
26947
  var WeaveFrameNode = class extends WeaveNode {
27134
26948
  nodeType = WEAVE_FRAME_NODE_TYPE;
27135
- initialize = void 0;
27136
26949
  constructor(params) {
27137
26950
  super();
27138
26951
  const { config } = params ?? {};
@@ -27433,7 +27246,6 @@ const WEAVE_STROKE_NODE_DEFAULT_CONFIG = {
27433
27246
  //#region src/nodes/stroke/stroke.ts
27434
27247
  var WeaveStrokeNode = class extends WeaveNode {
27435
27248
  nodeType = WEAVE_STROKE_NODE_TYPE;
27436
- initialize = void 0;
27437
27249
  constructor(params) {
27438
27250
  super();
27439
27251
  const { config } = params ?? {};
@@ -28010,6 +27822,8 @@ var WeaveSquareLineTipManager = class extends WeaveBaseLineTipManager {
28010
27822
  //#endregion
28011
27823
  //#region src/nodes/stroke-single/stroke-single.ts
28012
27824
  var WeaveStrokeSingleNode = class extends WeaveNode {
27825
+ startHandle = null;
27826
+ endHandle = null;
28013
27827
  nodeType = WEAVE_STROKE_SINGLE_NODE_TYPE;
28014
27828
  tipManagers = {
28015
27829
  [WEAVE_STROKE_SINGLE_NODE_TIP_TYPE.ARROW]: new WeaveArrowLineTipManager(),
@@ -28020,29 +27834,24 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28020
27834
  constructor(params) {
28021
27835
  super();
28022
27836
  this.config = mergeExceptArrays(WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, params?.config ?? {});
27837
+ this.handleNodeChanges = null;
27838
+ this.handleZoomChanges = null;
27839
+ this.shiftPressed = false;
28023
27840
  this.snapper = new GreedySnapper({
28024
27841
  snapAngles: this.config.snapAngles.angles,
28025
27842
  activateThreshold: this.config.snapAngles.activateThreshold,
28026
27843
  releaseThreshold: this.config.snapAngles.releaseThreshold
28027
27844
  });
28028
- this.initialize();
28029
- }
28030
- initialize() {
28031
27845
  this.eventsInitialized = false;
28032
- this.startHandle = null;
28033
- this.endHandle = null;
28034
- this.handleNodeChanges = null;
28035
- this.handleZoomChanges = null;
28036
- this.shiftPressed = false;
28037
27846
  }
28038
27847
  initEvents() {
28039
27848
  if (this.eventsInitialized) return;
28040
27849
  window.addEventListener("keydown", (e) => {
28041
27850
  if (e.key === "Shift") this.shiftPressed = true;
28042
- }, { signal: this.instance.getEventsController()?.signal });
27851
+ });
28043
27852
  window.addEventListener("keyup", (e) => {
28044
27853
  if (e.key === "Shift") this.shiftPressed = false;
28045
- }, { signal: this.instance.getEventsController()?.signal });
27854
+ });
28046
27855
  this.eventsInitialized = true;
28047
27856
  }
28048
27857
  onRender(props) {
@@ -28529,9 +28338,6 @@ var WeaveCommentNode = class extends WeaveNode {
28529
28338
  constructor(params) {
28530
28339
  super();
28531
28340
  this.config = mergeExceptArrays(WEAVE_COMMENT_NODE_DEFAULTS, params.config);
28532
- this.initialize();
28533
- }
28534
- initialize() {
28535
28341
  this.commentDomVisibleId = null;
28536
28342
  this.commentDomVisible = false;
28537
28343
  this.commentDomAction = null;
@@ -29160,6 +28966,10 @@ const WEAVE_VIDEO_DEFAULT_CONFIG = {
29160
28966
  //#endregion
29161
28967
  //#region src/nodes/video/video.ts
29162
28968
  var WeaveVideoNode = class extends WeaveNode {
28969
+ videoState = {};
28970
+ videoSourceFrameId = {};
28971
+ videoSource = {};
28972
+ videoPlaceholder = {};
29163
28973
  nodeType = WEAVE_VIDEO_NODE_TYPE;
29164
28974
  constructor(params) {
29165
28975
  super();
@@ -29172,13 +28982,6 @@ var WeaveVideoNode = class extends WeaveNode {
29172
28982
  this.videoIconImage.src = this.config.style.icon.dataURL;
29173
28983
  }
29174
28984
  }
29175
- initialize() {
29176
- this.videoState = {};
29177
- this.videoSource = {};
29178
- this.videoSourceFrameId = {};
29179
- this.videoPlaceholder = {};
29180
- this.videoIconImage = void 0;
29181
- }
29182
28985
  async loadPlaceholder(params, video) {
29183
28986
  const videoProps = params;
29184
28987
  const { id } = videoProps;
@@ -29673,7 +29476,6 @@ const WEAVE_MEASURE_NODE_DEFAULT_CONFIG = { style: {
29673
29476
  var WeaveMeasureNode = class extends WeaveNode {
29674
29477
  nodeType = WEAVE_MEASURE_NODE_TYPE;
29675
29478
  handlePointCircleRadius = 6;
29676
- initialize = void 0;
29677
29479
  constructor(params) {
29678
29480
  super();
29679
29481
  this.config = mergeExceptArrays(WEAVE_MEASURE_NODE_DEFAULT_CONFIG, params?.config ?? {});
@@ -30964,7 +30766,6 @@ var WeaveConnectorNode = class extends WeaveNode {
30964
30766
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.DOT]: setupNodeDecoratorDot,
30965
30767
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.ARROW]: setupNodeDecoratorArrow
30966
30768
  };
30967
- initialize = void 0;
30968
30769
  constructor(params) {
30969
30770
  super();
30970
30771
  this.config = mergeExceptArrays(WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, params?.config);
@@ -31715,6 +31516,10 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
31715
31516
  var WeaveStageZoomPlugin = class extends WeavePlugin {
31716
31517
  getLayerName = void 0;
31717
31518
  initLayer = void 0;
31519
+ pinching = false;
31520
+ zooming = false;
31521
+ isTrackpad = false;
31522
+ zoomVelocity = 0;
31718
31523
  zoomInertiaType = WEAVE_STAGE_ZOOM_TYPE.MOUSE_WHEEL;
31719
31524
  defaultStep = 3;
31720
31525
  constructor(params) {
@@ -31722,13 +31527,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
31722
31527
  const { config } = params ?? {};
31723
31528
  this.config = mergeExceptArrays(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
31724
31529
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
31725
- this.initialize();
31726
- }
31727
- initialize() {
31728
31530
  this.pinching = false;
31729
- this.zooming = false;
31730
31531
  this.isTrackpad = false;
31731
- this.zoomVelocity = 0;
31732
31532
  this.isCtrlOrMetaPressed = false;
31733
31533
  this.updatedMinimumZoom = false;
31734
31534
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
@@ -32015,15 +31815,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32015
31815
  if (box.width === 0 || box.height === 0) return;
32016
31816
  this.fitToElements(box, finalOptions);
32017
31817
  }
32018
- fitToArea(area, options) {
32019
- const finalOptions = mergeExceptArrays({
32020
- smartZoom: false,
32021
- overrideZoom: true
32022
- }, options);
32023
- if (!this.enabled) return;
32024
- if (area.width === 0 || area.height === 0) return;
32025
- this.fitToElements(area, finalOptions);
32026
- }
32027
31818
  enable() {
32028
31819
  this.enabled = true;
32029
31820
  }
@@ -32042,10 +31833,10 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32042
31833
  initEvents() {
32043
31834
  window.addEventListener("keydown", (e) => {
32044
31835
  if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32045
- }, { signal: this.instance.getEventsController()?.signal });
31836
+ });
32046
31837
  window.addEventListener("keyup", (e) => {
32047
31838
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32048
- }, { signal: this.instance.getEventsController()?.signal });
31839
+ });
32049
31840
  const stage = this.instance.getStage();
32050
31841
  let lastCenter = null;
32051
31842
  let lastDist = 0;
@@ -32070,10 +31861,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32070
31861
  return;
32071
31862
  }
32072
31863
  }
32073
- }, {
32074
- passive: false,
32075
- signal: this.instance.getEventsController()?.signal
32076
- });
31864
+ }, { passive: false });
32077
31865
  stage.getContent().addEventListener("touchmove", (e) => {
32078
31866
  e.preventDefault();
32079
31867
  if (e.touches.length === 2) {
@@ -32113,18 +31901,12 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32113
31901
  lastDist = dist;
32114
31902
  lastCenter = newCenter;
32115
31903
  }
32116
- }, {
32117
- passive: false,
32118
- signal: this.instance.getEventsController()?.signal
32119
- });
31904
+ }, { passive: false });
32120
31905
  stage.getContent().addEventListener("touchend", () => {
32121
31906
  this.pinching = false;
32122
31907
  lastDist = 0;
32123
31908
  lastCenter = null;
32124
- }, {
32125
- passive: false,
32126
- signal: this.instance.getEventsController()?.signal
32127
- });
31909
+ }, { passive: false });
32128
31910
  let doZoom = false;
32129
31911
  const handleWheelImmediate = (e) => {
32130
31912
  const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
@@ -32142,10 +31924,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32142
31924
  e.preventDefault();
32143
31925
  doZoom = true;
32144
31926
  };
32145
- window.addEventListener("wheel", handleWheelImmediate, {
32146
- signal: this.instance.getEventsController()?.signal,
32147
- passive: false
32148
- });
31927
+ window.addEventListener("wheel", handleWheelImmediate, { passive: false });
32149
31928
  const handleWheel = (e) => {
32150
31929
  if (!doZoom) return;
32151
31930
  const delta = e.deltaY > 0 ? 1 : -1;
@@ -32158,10 +31937,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32158
31937
  }
32159
31938
  };
32160
31939
  const throttledHandleWheel = (0, import_lodash.throttle)(handleWheel, DEFAULT_THROTTLE_MS);
32161
- window.addEventListener("wheel", throttledHandleWheel, {
32162
- signal: this.instance.getEventsController()?.signal,
32163
- passive: true
32164
- });
31940
+ window.addEventListener("wheel", throttledHandleWheel, { passive: true });
32165
31941
  }
32166
31942
  getInertiaScale() {
32167
31943
  const stage = this.instance.getStage();
@@ -32219,7 +31995,6 @@ const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
32219
31995
  //#region src/actions/zoom-out-tool/zoom-out-tool.ts
32220
31996
  var WeaveZoomOutToolAction = class extends WeaveAction {
32221
31997
  onPropsChange = void 0;
32222
- initialize = void 0;
32223
31998
  getName() {
32224
31999
  return ZOOM_OUT_TOOL_ACTION_NAME;
32225
32000
  }
@@ -32254,10 +32029,6 @@ const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
32254
32029
  //#region src/actions/zoom-in-tool/zoom-in-tool.ts
32255
32030
  var WeaveZoomInToolAction = class extends WeaveAction {
32256
32031
  onPropsChange = void 0;
32257
- initialize = void 0;
32258
- constructor() {
32259
- super();
32260
- }
32261
32032
  getName() {
32262
32033
  return ZOOM_IN_TOOL_ACTION_NAME;
32263
32034
  }
@@ -32292,10 +32063,6 @@ const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
32292
32063
  //#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
32293
32064
  var WeaveFitToScreenToolAction = class extends WeaveAction {
32294
32065
  onPropsChange = void 0;
32295
- initialize = void 0;
32296
- constructor() {
32297
- super();
32298
- }
32299
32066
  getName() {
32300
32067
  return FIT_TO_SCREEN_TOOL_ACTION_NAME;
32301
32068
  }
@@ -32329,10 +32096,6 @@ const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
32329
32096
  //#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
32330
32097
  var WeaveFitToSelectionToolAction = class extends WeaveAction {
32331
32098
  onPropsChange = void 0;
32332
- initialize = void 0;
32333
- constructor() {
32334
- super();
32335
- }
32336
32099
  getName() {
32337
32100
  return FIT_TO_SELECTION_TOOL_ACTION_NAME;
32338
32101
  }
@@ -32375,9 +32138,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
32375
32138
  onInit = void 0;
32376
32139
  constructor() {
32377
32140
  super();
32378
- this.initialize();
32379
- }
32380
- initialize() {
32381
32141
  this.initialized = false;
32382
32142
  this.state = MOVE_TOOL_STATE.IDLE;
32383
32143
  }
@@ -32391,7 +32151,7 @@ var WeaveMoveToolAction = class extends WeaveAction {
32391
32151
  this.cancelAction();
32392
32152
  return;
32393
32153
  }
32394
- }, { signal: this.instance.getEventsController()?.signal });
32154
+ });
32395
32155
  stage.on("pointerdown", () => {
32396
32156
  if ([MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
32397
32157
  });
@@ -32450,9 +32210,6 @@ var WeaveSelectionToolAction = class extends WeaveAction {
32450
32210
  onInit = void 0;
32451
32211
  constructor() {
32452
32212
  super();
32453
- this.initialize();
32454
- }
32455
- initialize() {
32456
32213
  this.initialized = false;
32457
32214
  this.state = SELECTION_TOOL_STATE.IDLE;
32458
32215
  }
@@ -32516,9 +32273,6 @@ var WeaveEraserToolAction = class extends WeaveAction {
32516
32273
  onInit = void 0;
32517
32274
  constructor() {
32518
32275
  super();
32519
- this.initialize();
32520
- }
32521
- initialize() {
32522
32276
  this.initialized = false;
32523
32277
  this.erasing = false;
32524
32278
  this.state = ERASER_TOOL_STATE.IDLE;
@@ -32552,7 +32306,7 @@ var WeaveEraserToolAction = class extends WeaveAction {
32552
32306
  this.cancelAction();
32553
32307
  return;
32554
32308
  }
32555
- }, { signal: this.instance.getEventsController()?.signal });
32309
+ });
32556
32310
  this.initialized = true;
32557
32311
  }
32558
32312
  setState(state) {
@@ -32619,9 +32373,6 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32619
32373
  onInit = void 0;
32620
32374
  constructor() {
32621
32375
  super();
32622
- this.initialize();
32623
- }
32624
- initialize() {
32625
32376
  this.pointers = new Map();
32626
32377
  this.initialized = false;
32627
32378
  this.state = RECTANGLE_TOOL_STATE.IDLE;
@@ -32657,7 +32408,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32657
32408
  this.cancelAction();
32658
32409
  return;
32659
32410
  }
32660
- }, { signal: this.instance.getEventsController()?.signal });
32411
+ });
32661
32412
  stage.on("pointermove", () => {
32662
32413
  if (this.state === RECTANGLE_TOOL_STATE.IDLE) return;
32663
32414
  this.setCursor();
@@ -32831,9 +32582,6 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32831
32582
  onInit = void 0;
32832
32583
  constructor() {
32833
32584
  super();
32834
- this.initialize();
32835
- }
32836
- initialize() {
32837
32585
  this.pointers = new Map();
32838
32586
  this.initialized = false;
32839
32587
  this.state = ELLIPSE_TOOL_STATE.IDLE;
@@ -32869,7 +32617,7 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32869
32617
  this.cancelAction();
32870
32618
  return;
32871
32619
  }
32872
- }, { signal: this.instance.getEventsController()?.signal });
32620
+ });
32873
32621
  stage.on("pointerdown", (e) => {
32874
32622
  this.setTapStart(e);
32875
32623
  this.pointers.set(e.evt.pointerId, {
@@ -33050,9 +32798,6 @@ var WeavePenToolAction = class extends WeaveAction {
33050
32798
  onInit = void 0;
33051
32799
  constructor() {
33052
32800
  super();
33053
- this.initialize();
33054
- }
33055
- initialize() {
33056
32801
  this.pointers = new Map();
33057
32802
  this.initialized = false;
33058
32803
  this.state = PEN_TOOL_STATE.IDLE;
@@ -33088,7 +32833,7 @@ var WeavePenToolAction = class extends WeaveAction {
33088
32833
  this.cancelAction();
33089
32834
  return;
33090
32835
  }
33091
- }, { signal: this.instance.getEventsController()?.signal });
32836
+ });
33092
32837
  stage.on("pointerdown", (e) => {
33093
32838
  this.setTapStart(e);
33094
32839
  this.pointers.set(e.evt.pointerId, {
@@ -33325,9 +33070,6 @@ var WeaveLineToolAction = class extends WeaveAction {
33325
33070
  constructor(params) {
33326
33071
  super();
33327
33072
  this.config = mergeExceptArrays(LINE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33328
- this.initialize();
33329
- }
33330
- initialize() {
33331
33073
  this.pointers = new Map();
33332
33074
  this.initialized = false;
33333
33075
  this.state = LINE_TOOL_STATE.IDLE;
@@ -33372,13 +33114,13 @@ var WeaveLineToolAction = class extends WeaveAction {
33372
33114
  this.snappedAngle = null;
33373
33115
  this.shiftPressed = true;
33374
33116
  }
33375
- }, { signal: this.instance.getEventsController()?.signal });
33117
+ });
33376
33118
  window.addEventListener("keyup", (e) => {
33377
33119
  if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
33378
33120
  this.snappedAngle = null;
33379
33121
  this.shiftPressed = false;
33380
33122
  }
33381
- }, { signal: this.instance.getEventsController()?.signal });
33123
+ });
33382
33124
  stage.on("pointerdown", (e) => {
33383
33125
  this.setTapStart(e);
33384
33126
  this.pointers.set(e.evt.pointerId, {
@@ -33593,9 +33335,6 @@ var WeaveBrushToolAction = class extends WeaveAction {
33593
33335
  constructor(params) {
33594
33336
  super();
33595
33337
  this.config = mergeExceptArrays(BRUSH_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33596
- this.initialize();
33597
- }
33598
- initialize() {
33599
33338
  this.initialized = false;
33600
33339
  this.state = BRUSH_TOOL_STATE.INACTIVE;
33601
33340
  this.strokeId = null;
@@ -33624,7 +33363,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33624
33363
  const stage = this.instance.getStage();
33625
33364
  window.addEventListener("keyup", (e) => {
33626
33365
  if (e.code === "Space" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) this.isSpacePressed = false;
33627
- }, { signal: this.instance.getEventsController()?.signal });
33366
+ });
33628
33367
  window.addEventListener("keydown", (e) => {
33629
33368
  if (e.code === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
33630
33369
  e.stopPropagation();
@@ -33640,7 +33379,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33640
33379
  e.stopPropagation();
33641
33380
  this.cancelAction();
33642
33381
  }
33643
- }, { signal: this.instance.getEventsController()?.signal });
33382
+ });
33644
33383
  const handlePointerDown = (e) => {
33645
33384
  if (this.state === BRUSH_TOOL_STATE.INACTIVE) return;
33646
33385
  if (this.state !== BRUSH_TOOL_STATE.IDLE) return;
@@ -33849,9 +33588,6 @@ var WeaveTextToolAction = class extends WeaveAction {
33849
33588
  onInit = void 0;
33850
33589
  constructor() {
33851
33590
  super();
33852
- this.initialize();
33853
- }
33854
- initialize() {
33855
33591
  this.initialized = false;
33856
33592
  this.state = TEXT_TOOL_STATE.IDLE;
33857
33593
  this.textId = null;
@@ -33881,7 +33617,7 @@ var WeaveTextToolAction = class extends WeaveAction {
33881
33617
  this.cancelAction();
33882
33618
  return;
33883
33619
  }
33884
- }, { signal: this.instance.getEventsController()?.signal });
33620
+ });
33885
33621
  stage.on("pointermove", () => {
33886
33622
  if (this.state === TEXT_TOOL_STATE.IDLE) return;
33887
33623
  this.setCursor();
@@ -34009,9 +33745,6 @@ var WeaveImageToolAction = class extends WeaveAction {
34009
33745
  constructor(params) {
34010
33746
  super();
34011
33747
  this.config = mergeExceptArrays(WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, params?.config ?? {});
34012
- this.initialize();
34013
- }
34014
- initialize() {
34015
33748
  this.pointers = new Map();
34016
33749
  this.initialized = false;
34017
33750
  this.imageId = null;
@@ -34055,7 +33788,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34055
33788
  this.cancelAction();
34056
33789
  return;
34057
33790
  }
34058
- }, { signal: this.instance.getEventsController()?.signal });
33791
+ });
34059
33792
  stage.on("pointerdown", (e) => {
34060
33793
  this.setTapStart(e);
34061
33794
  if (this.ignorePointerEvents) return;
@@ -34452,9 +34185,6 @@ var WeaveImagesToolAction = class extends WeaveAction {
34452
34185
  constructor(params) {
34453
34186
  super();
34454
34187
  this.config = mergeExceptArrays(WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, params ?? {});
34455
- this.initialize();
34456
- }
34457
- initialize() {
34458
34188
  this.pointers = new Map();
34459
34189
  this.initialized = false;
34460
34190
  this.tempPointerFeedbackNode = null;
@@ -34501,7 +34231,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34501
34231
  const stage = this.instance.getStage();
34502
34232
  stage.container().addEventListener("keydown", (e) => {
34503
34233
  if (e.key === "Escape" && this.instance.getActiveAction() === WEAVE_IMAGES_TOOL_ACTION_NAME) this.cancelAction();
34504
- }, { signal: this.instance.getEventsController()?.signal });
34234
+ });
34505
34235
  stage.on("pointerdown", (e) => {
34506
34236
  this.setTapStart(e);
34507
34237
  this.pointers.set(e.evt.pointerId, {
@@ -34883,9 +34613,6 @@ var WeaveStarToolAction = class extends WeaveAction {
34883
34613
  onInit = void 0;
34884
34614
  constructor() {
34885
34615
  super();
34886
- this.initialize();
34887
- }
34888
- initialize() {
34889
34616
  this.pointers = new Map();
34890
34617
  this.initialized = false;
34891
34618
  this.state = STAR_TOOL_STATE.IDLE;
@@ -34922,7 +34649,7 @@ var WeaveStarToolAction = class extends WeaveAction {
34922
34649
  this.cancelAction();
34923
34650
  return;
34924
34651
  }
34925
- }, { signal: this.instance.getEventsController()?.signal });
34652
+ });
34926
34653
  stage.on("pointerdown", (e) => {
34927
34654
  this.setTapStart(e);
34928
34655
  this.pointers.set(e.evt.pointerId, {
@@ -35087,8 +34814,8 @@ var WeaveStarToolAction = class extends WeaveAction {
35087
34814
 
35088
34815
  //#endregion
35089
34816
  //#region src/actions/arrow-tool/constants.ts
35090
- const WEAVE_ARROW_TOOL_ACTION_NAME = "arrowTool";
35091
- const WEAVE_ARROW_TOOL_STATE = {
34817
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
34818
+ const ARROW_TOOL_STATE = {
35092
34819
  ["IDLE"]: "idle",
35093
34820
  ["ADDING"]: "adding",
35094
34821
  ["DEFINING_SIZE"]: "definingSize",
@@ -35104,12 +34831,9 @@ var WeaveArrowToolAction = class extends WeaveAction {
35104
34831
  onInit = void 0;
35105
34832
  constructor() {
35106
34833
  super();
35107
- this.initialize();
35108
- }
35109
- initialize() {
35110
34834
  this.pointers = new Map();
35111
34835
  this.initialized = false;
35112
- this.state = WEAVE_ARROW_TOOL_STATE.IDLE;
34836
+ this.state = ARROW_TOOL_STATE.IDLE;
35113
34837
  this.arrowId = null;
35114
34838
  this.tempArrowId = null;
35115
34839
  this.tempMainArrowNode = null;
@@ -35122,7 +34846,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35122
34846
  this.props = this.initProps();
35123
34847
  }
35124
34848
  getName() {
35125
- return WEAVE_ARROW_TOOL_ACTION_NAME;
34849
+ return ARROW_TOOL_ACTION_NAME;
35126
34850
  }
35127
34851
  initProps() {
35128
34852
  return {
@@ -35139,37 +34863,40 @@ var WeaveArrowToolAction = class extends WeaveAction {
35139
34863
  setupEvents() {
35140
34864
  const stage = this.instance.getStage();
35141
34865
  window.addEventListener("keydown", (e) => {
35142
- if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
34866
+ if (e.code === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
35143
34867
  this.cancelAction();
35144
34868
  return;
35145
34869
  }
35146
- if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) this.cancelAction();
35147
- }, { signal: this.instance.getEventsController()?.signal });
34870
+ if (e.code === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34871
+ this.cancelAction();
34872
+ return;
34873
+ }
34874
+ });
35148
34875
  stage.on("pointerdown", (e) => {
35149
34876
  this.setTapStart(e);
35150
34877
  this.pointers.set(e.evt.pointerId, {
35151
34878
  x: e.evt.clientX,
35152
34879
  y: e.evt.clientY
35153
34880
  });
35154
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35155
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34881
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34882
+ this.state = ARROW_TOOL_STATE.ADDING;
35156
34883
  return;
35157
34884
  }
35158
- if (!this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.handleAdding();
35159
- if (this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.state = WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE;
34885
+ if (!this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.handleAdding();
34886
+ if (this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.state = ARROW_TOOL_STATE.DEFINING_SIZE;
35160
34887
  });
35161
34888
  stage.on("pointermove", () => {
35162
- if (this.state === WEAVE_ARROW_TOOL_STATE.IDLE) return;
34889
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
35163
34890
  this.setCursor();
35164
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35165
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34891
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34892
+ this.state = ARROW_TOOL_STATE.ADDING;
35166
34893
  return;
35167
34894
  }
35168
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
34895
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
35169
34896
  });
35170
34897
  stage.on("pointerup", (e) => {
35171
34898
  this.pointers.delete(e.evt.pointerId);
35172
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
34899
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
35173
34900
  });
35174
34901
  this.initialized = true;
35175
34902
  }
@@ -35183,7 +34910,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35183
34910
  this.tempPoint = void 0;
35184
34911
  this.tempNextPoint = void 0;
35185
34912
  this.clickPoint = null;
35186
- this.setState(WEAVE_ARROW_TOOL_STATE.ADDING);
34913
+ this.setState(ARROW_TOOL_STATE.ADDING);
35187
34914
  }
35188
34915
  handleAdding() {
35189
34916
  const stage = this.instance.getStage();
@@ -35234,7 +34961,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35234
34961
  this.measureContainer?.add(this.tempNextPoint);
35235
34962
  this.tempPoint.moveToTop();
35236
34963
  this.tempNextPoint.moveToTop();
35237
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34964
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35238
34965
  }
35239
34966
  }
35240
34967
  handleSettingSize() {
@@ -35261,11 +34988,11 @@ var WeaveArrowToolAction = class extends WeaveAction {
35261
34988
  y: mousePoint.y,
35262
34989
  points: [0, 0]
35263
34990
  });
35264
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34991
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35265
34992
  }
35266
34993
  }
35267
34994
  handleMovement() {
35268
- if (this.state !== WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) return;
34995
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
35269
34996
  if (this.arrowId && this.tempArrowNode && this.measureContainer && this.tempNextPoint) {
35270
34997
  const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
35271
34998
  this.tempArrowNode.setAttrs({
@@ -35332,7 +35059,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35332
35059
  this.container = void 0;
35333
35060
  this.measureContainer = void 0;
35334
35061
  this.clickPoint = null;
35335
- this.setState(WEAVE_ARROW_TOOL_STATE.IDLE);
35062
+ this.setState(ARROW_TOOL_STATE.IDLE);
35336
35063
  }
35337
35064
  setCursor() {
35338
35065
  const stage = this.instance.getStage();
@@ -35376,15 +35103,13 @@ const WEAVE_STROKE_TOOL_DEFAULT_CONFIG = { snapAngles: {
35376
35103
  var WeaveStrokeToolAction = class extends WeaveAction {
35377
35104
  initialized = false;
35378
35105
  initialCursor = null;
35106
+ snappedAngle = null;
35379
35107
  shiftPressed = false;
35380
35108
  onPropsChange = void 0;
35381
35109
  onInit = void 0;
35382
35110
  constructor(params) {
35383
35111
  super();
35384
35112
  this.config = mergeExceptArrays(WEAVE_STROKE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
35385
- this.initialize();
35386
- }
35387
- initialize() {
35388
35113
  this.pointers = new Map();
35389
35114
  this.initialized = false;
35390
35115
  this.state = WEAVE_STROKE_TOOL_STATE.IDLE;
@@ -35393,6 +35118,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35393
35118
  this.tempLineId = null;
35394
35119
  this.tempLineNode = null;
35395
35120
  this.container = void 0;
35121
+ this.snappedAngle = null;
35396
35122
  this.measureContainer = void 0;
35397
35123
  this.clickPoint = null;
35398
35124
  this.snapper = new GreedySnapper({
@@ -35405,9 +35131,6 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35405
35131
  getName() {
35406
35132
  return WEAVE_STROKE_TOOL_ACTION_NAME;
35407
35133
  }
35408
- getNames() {
35409
- return [WEAVE_STROKE_TOOL_ACTION_NAME, ...WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES];
35410
- }
35411
35134
  hasAliases() {
35412
35135
  return true;
35413
35136
  }
@@ -35426,26 +35149,32 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35426
35149
  setupEvents() {
35427
35150
  const stage = this.instance.getStage();
35428
35151
  window.addEventListener("keydown", (e) => {
35429
- if (e.code === "Enter" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35152
+ if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35430
35153
  this.cancelAction();
35431
35154
  return;
35432
35155
  }
35433
- if (e.code === "Escape" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35156
+ if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35434
35157
  this.cancelAction();
35435
35158
  return;
35436
35159
  }
35437
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = true;
35438
- }, { signal: this.instance.getEventsController()?.signal });
35160
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35161
+ this.snappedAngle = null;
35162
+ this.shiftPressed = true;
35163
+ }
35164
+ });
35439
35165
  window.addEventListener("keyup", (e) => {
35440
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = false;
35441
- }, { signal: this.instance.getEventsController()?.signal });
35166
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35167
+ this.snappedAngle = null;
35168
+ this.shiftPressed = false;
35169
+ }
35170
+ });
35442
35171
  stage.on("pointerdown", (e) => {
35443
35172
  this.setTapStart(e);
35444
35173
  this.pointers.set(e.evt.pointerId, {
35445
35174
  x: e.evt.clientX,
35446
35175
  y: e.evt.clientY
35447
35176
  });
35448
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35177
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35449
35178
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35450
35179
  return;
35451
35180
  }
@@ -35455,7 +35184,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35455
35184
  stage.on("pointermove", () => {
35456
35185
  if (this.state === WEAVE_STROKE_TOOL_STATE.IDLE) return;
35457
35186
  this.setCursor();
35458
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35187
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35459
35188
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35460
35189
  return;
35461
35190
  }
@@ -35473,7 +35202,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35473
35202
  addLine() {
35474
35203
  this.setCursor();
35475
35204
  this.setFocusStage();
35476
- this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35205
+ this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35477
35206
  this.shiftPressed = false;
35478
35207
  this.clickPoint = null;
35479
35208
  this.setState(WEAVE_STROKE_TOOL_STATE.ADDING);
@@ -35581,7 +35310,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35581
35310
  });
35582
35311
  delete finalLine.props.dragBoundFunc;
35583
35312
  this.instance.addNode(finalLine, this.container?.getAttrs().id);
35584
- this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35313
+ this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35585
35314
  nodeCreated = true;
35586
35315
  }
35587
35316
  }
@@ -35631,9 +35360,6 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35631
35360
  onInit = void 0;
35632
35361
  constructor() {
35633
35362
  super();
35634
- this.initialize();
35635
- }
35636
- initialize() {
35637
35363
  this.pointers = new Map();
35638
35364
  this.initialized = false;
35639
35365
  this.state = REGULAR_POLYGON_TOOL_STATE.IDLE;
@@ -35668,7 +35394,7 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35668
35394
  this.cancelAction();
35669
35395
  return;
35670
35396
  }
35671
- }, { signal: this.instance.getEventsController()?.signal });
35397
+ });
35672
35398
  stage.on("pointerdown", (e) => {
35673
35399
  this.setTapStart(e);
35674
35400
  this.pointers.set(e.evt.pointerId, {
@@ -35842,9 +35568,6 @@ var WeaveFrameToolAction = class extends WeaveAction {
35842
35568
  onInit = void 0;
35843
35569
  constructor() {
35844
35570
  super();
35845
- this.initialize();
35846
- }
35847
- initialize() {
35848
35571
  this.initialized = false;
35849
35572
  this.state = FRAME_TOOL_STATE.IDLE;
35850
35573
  this.frameId = null;
@@ -35872,7 +35595,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
35872
35595
  this.cancelAction();
35873
35596
  return;
35874
35597
  }
35875
- }, { signal: this.instance.getEventsController()?.signal });
35598
+ });
35876
35599
  stage.on("pointermove", () => {
35877
35600
  if (this.state === FRAME_TOOL_STATE.IDLE) return;
35878
35601
  this.setCursor();
@@ -35974,10 +35697,6 @@ var WeaveExportStageToolAction = class extends WeaveAction {
35974
35697
  };
35975
35698
  onPropsChange = void 0;
35976
35699
  onInit = void 0;
35977
- initialize = void 0;
35978
- constructor() {
35979
- super();
35980
- }
35981
35700
  getName() {
35982
35701
  return EXPORT_STAGE_TOOL_ACTION_NAME;
35983
35702
  }
@@ -36025,10 +35744,6 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
36025
35744
  };
36026
35745
  onPropsChange = void 0;
36027
35746
  onInit = void 0;
36028
- initialize = void 0;
36029
- constructor() {
36030
- super();
36031
- }
36032
35747
  getName() {
36033
35748
  return EXPORT_NODES_TOOL_ACTION_NAME;
36034
35749
  }
@@ -36081,9 +35796,6 @@ var WeaveAlignNodesToolAction = class extends WeaveAction {
36081
35796
  onInit = void 0;
36082
35797
  constructor() {
36083
35798
  super();
36084
- this.initialize();
36085
- }
36086
- initialize() {
36087
35799
  this.initialized = false;
36088
35800
  this.state = ALIGN_NODES_TOOL_STATE.IDLE;
36089
35801
  }
@@ -36333,9 +36045,6 @@ var WeaveCommentToolAction = class extends WeaveAction {
36333
36045
  super();
36334
36046
  const { config } = params ?? {};
36335
36047
  this.config = mergeExceptArrays(WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, config);
36336
- this.initialize();
36337
- }
36338
- initialize() {
36339
36048
  this.pointers = new Map();
36340
36049
  this.initialized = false;
36341
36050
  this.state = WEAVE_COMMENT_TOOL_STATE.IDLE;
@@ -36413,7 +36122,7 @@ var WeaveCommentToolAction = class extends WeaveAction {
36413
36122
  return;
36414
36123
  }
36415
36124
  if (e.code === "Escape" && this.state === WEAVE_COMMENT_TOOL_STATE.CREATING_COMMENT) this.setState(WEAVE_COMMENT_TOOL_STATE.ADDING);
36416
- }, { signal: this.instance.getEventsController()?.signal });
36125
+ });
36417
36126
  stage.on("pointermove", (e) => {
36418
36127
  if (this.state === WEAVE_COMMENT_TOOL_STATE.IDLE) return;
36419
36128
  if (commentNodeHandler?.isCommentViewing()) {
@@ -36564,9 +36273,6 @@ var WeaveVideoToolAction = class extends WeaveAction {
36564
36273
  update = void 0;
36565
36274
  constructor() {
36566
36275
  super();
36567
- this.initialize();
36568
- }
36569
- initialize() {
36570
36276
  this.pointers = new Map();
36571
36277
  this.initialized = false;
36572
36278
  this.state = VIDEO_TOOL_STATE.IDLE;
@@ -36613,7 +36319,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
36613
36319
  this.cancelAction();
36614
36320
  return;
36615
36321
  }
36616
- }, { signal: this.instance.getEventsController()?.signal });
36322
+ });
36617
36323
  stage.on("pointerdown", (e) => {
36618
36324
  this.setTapStart(e);
36619
36325
  this.pointers.set(e.evt.pointerId, {
@@ -36792,9 +36498,6 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36792
36498
  constructor(params) {
36793
36499
  super();
36794
36500
  this.config = mergeExceptArrays(WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
36795
- this.initialize();
36796
- }
36797
- initialize() {
36798
36501
  this.initialized = false;
36799
36502
  this.state = MEASURE_TOOL_STATE.IDLE;
36800
36503
  this.measureId = null;
@@ -36821,7 +36524,7 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36821
36524
  const stage = this.instance.getStage();
36822
36525
  window.addEventListener("keydown", (e) => {
36823
36526
  if (e.code === "Escape" && this.instance.getActiveAction() === MEASURE_TOOL_ACTION_NAME) this.cancelAction();
36824
- }, { signal: this.instance.getEventsController()?.signal });
36527
+ });
36825
36528
  stage.on("pointermove", () => {
36826
36529
  if (this.state === MEASURE_TOOL_STATE.IDLE) return;
36827
36530
  if (this.state === MEASURE_TOOL_STATE.SET_TO) {
@@ -37091,9 +36794,6 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37091
36794
  constructor(params) {
37092
36795
  super();
37093
36796
  this.config = mergeExceptArrays(CONNECTOR_TOOL_DEFAULT_CONFIG, params?.config);
37094
- this.initialize();
37095
- }
37096
- initialize() {
37097
36797
  this.pointers = new Map();
37098
36798
  this.initialized = false;
37099
36799
  this.tempLineNode = null;
@@ -37132,7 +36832,7 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37132
36832
  return;
37133
36833
  }
37134
36834
  if (e.code === "Escape" && this.instance.getActiveAction() === CONNECTOR_TOOL_ACTION_NAME) this.cancelAction();
37135
- }, { signal: this.instance.getEventsController()?.signal });
36835
+ });
37136
36836
  let nodeHovered = void 0;
37137
36837
  stage.on("pointermove", () => {
37138
36838
  if (!(this.state === CONNECTOR_TOOL_STATE.SELECTING_INITIAL || this.state === CONNECTOR_TOOL_STATE.SELECTING_FINAL)) return;
@@ -37447,9 +37147,16 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37447
37147
  //#endregion
37448
37148
  //#region src/plugins/stage-grid/stage-grid.ts
37449
37149
  var WeaveStageGridPlugin = class extends WeavePlugin {
37150
+ actStageZoomX = 1;
37151
+ actStageZoomY = 1;
37152
+ actStagePosX = 0;
37153
+ actStagePosY = 0;
37450
37154
  constructor(params) {
37451
37155
  super();
37452
37156
  const { config } = params ?? {};
37157
+ this.moveToolActive = false;
37158
+ this.isMouseMiddleButtonPressed = false;
37159
+ this.isSpaceKeyPressed = false;
37453
37160
  this.config = {
37454
37161
  type: WEAVE_GRID_DEFAULT_TYPE,
37455
37162
  gridColor: WEAVE_GRID_DEFAULT_COLOR,
@@ -37458,17 +37165,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37458
37165
  gridDotMaxDotsPerAxis: WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS,
37459
37166
  ...config
37460
37167
  };
37461
- this.initialize();
37462
- }
37463
- initialize() {
37464
- this.moveToolActive = false;
37465
- this.isMouseMiddleButtonPressed = false;
37466
- this.isSpaceKeyPressed = false;
37467
37168
  this.forceStageChange = false;
37468
- this.actStagePosX = 0;
37469
- this.actStagePosY = 0;
37470
- this.actStageZoomX = 1;
37471
- this.actStageZoomY = 1;
37472
37169
  }
37473
37170
  getName() {
37474
37171
  return WEAVE_STAGE_GRID_PLUGIN_KEY;
@@ -37493,10 +37190,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37493
37190
  const stage = this.instance.getStage();
37494
37191
  window.addEventListener("keydown", (e) => {
37495
37192
  if (e.code === "Space") this.isSpaceKeyPressed = true;
37496
- }, { signal: this.instance.getEventsController()?.signal });
37193
+ });
37497
37194
  window.addEventListener("keyup", (e) => {
37498
37195
  if (e.code === "Space") this.isSpaceKeyPressed = false;
37499
- }, { signal: this.instance.getEventsController()?.signal });
37196
+ });
37500
37197
  this.instance.addEventListener("onStageMove", () => {
37501
37198
  this.onRender();
37502
37199
  });
@@ -37730,14 +37427,15 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37730
37427
  //#endregion
37731
37428
  //#region src/plugins/stage-panning/stage-panning.ts
37732
37429
  var WeaveStagePanningPlugin = class extends WeavePlugin {
37430
+ panning = false;
37431
+ currentPointer = null;
37432
+ stageScrollInterval = void 0;
37433
+ panEdgeTargets = {};
37733
37434
  getLayerName = void 0;
37734
37435
  initLayer = void 0;
37735
37436
  constructor(params) {
37736
37437
  super();
37737
37438
  this.config = mergeExceptArrays(WEAVE_STAGE_PANNING_DEFAULT_CONFIG, params?.config ?? {});
37738
- this.initialize();
37739
- }
37740
- initialize() {
37741
37439
  this.pointers = new Map();
37742
37440
  this.panning = false;
37743
37441
  this.isDragging = false;
@@ -37749,9 +37447,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37749
37447
  this.isCtrlOrMetaPressed = false;
37750
37448
  this.isSpaceKeyPressed = false;
37751
37449
  this.previousPointer = null;
37752
- this.currentPointer = null;
37753
- this.stageScrollInterval = void 0;
37754
- this.panEdgeTargets = {};
37755
37450
  }
37756
37451
  getName() {
37757
37452
  return WEAVE_STAGE_PANNING_KEY;
@@ -37785,7 +37480,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37785
37480
  this.isSpaceKeyPressed = true;
37786
37481
  this.setCursor();
37787
37482
  }
37788
- }, { signal: this.instance.getEventsController()?.signal });
37483
+ });
37789
37484
  window.addEventListener("keyup", (e) => {
37790
37485
  if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
37791
37486
  if (e.code === "Space") {
@@ -37796,7 +37491,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37796
37491
  this.isSpaceKeyPressed = false;
37797
37492
  this.disableMove();
37798
37493
  }
37799
- }, { signal: this.instance.getEventsController()?.signal });
37494
+ });
37800
37495
  let lastPos = null;
37801
37496
  stage.on("pointerdown", (e) => {
37802
37497
  this.pointers.set(e.evt.pointerId, {
@@ -37869,10 +37564,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37869
37564
  this.instance.emitEvent("onStageMove");
37870
37565
  };
37871
37566
  const handleWheelThrottled = (0, import_lodash.throttle)(handleWheel, WEAVE_STAGE_PANNING_THROTTLE_MS);
37872
- window.addEventListener("wheel", handleWheelThrottled, {
37873
- passive: true,
37874
- signal: this.instance.getEventsController()?.signal
37875
- });
37567
+ window.addEventListener("wheel", handleWheelThrottled, { passive: true });
37876
37568
  stage.on("dragstart", (e) => {
37877
37569
  const duration = 1e3 / 60;
37878
37570
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
@@ -37930,10 +37622,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37930
37622
  stage.container().style.setProperty("-webkit-user-drag", "none");
37931
37623
  stage.getContent().addEventListener("touchmove", function(e) {
37932
37624
  e.preventDefault();
37933
- }, {
37934
- passive: false,
37935
- signal: this.instance.getEventsController()?.signal
37936
- });
37625
+ }, { passive: false });
37937
37626
  }
37938
37627
  isPanning() {
37939
37628
  return this.panning;
@@ -38011,9 +37700,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
38011
37700
  constructor(params) {
38012
37701
  super();
38013
37702
  this.config = mergeExceptArrays(STAGE_MINIMAP_DEFAULT_CONFIG, params.config);
38014
- this.initialize();
38015
- }
38016
- initialize() {
38017
37703
  this.initialized = false;
38018
37704
  }
38019
37705
  getName() {
@@ -38191,7 +37877,6 @@ const WEAVE_STAGE_RESIZE_KEY = "stageResize";
38191
37877
  var WeaveStageResizePlugin = class extends WeavePlugin {
38192
37878
  getLayerName = void 0;
38193
37879
  initLayer = void 0;
38194
- initialize = void 0;
38195
37880
  getName() {
38196
37881
  return WEAVE_STAGE_RESIZE_KEY;
38197
37882
  }
@@ -38211,10 +37896,6 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38211
37896
  const pluginInstance = plugins[pluginId];
38212
37897
  pluginInstance.onRender?.();
38213
37898
  }
38214
- this.instance.emitEvent("onStageResize", {
38215
- width: stage.width(),
38216
- height: stage.height()
38217
- });
38218
37899
  }
38219
37900
  }
38220
37901
  onInit() {
@@ -38223,7 +37904,7 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38223
37904
  }, DEFAULT_THROTTLE_MS);
38224
37905
  window.addEventListener("resize", () => {
38225
37906
  throttledResize();
38226
- }, { signal: this.instance.getEventsController()?.signal });
37907
+ });
38227
37908
  const resizeObserver = new ResizeObserver(() => {
38228
37909
  throttledResize();
38229
37910
  });
@@ -38241,12 +37922,10 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38241
37922
  //#endregion
38242
37923
  //#region src/plugins/nodes-multi-selection-feedback/nodes-multi-selection-feedback.ts
38243
37924
  var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
37925
+ selectedHalos = {};
38244
37926
  constructor(params) {
38245
37927
  super();
38246
37928
  this.config = mergeExceptArrays(WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, params?.config ?? {});
38247
- this.initialize();
38248
- }
38249
- initialize() {
38250
37929
  this.selectedHalos = {};
38251
37930
  }
38252
37931
  getName() {
@@ -38412,14 +38091,12 @@ var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
38412
38091
  //#endregion
38413
38092
  //#region src/plugins/connected-users/connected-users.ts
38414
38093
  var WeaveConnectedUsersPlugin = class extends WeavePlugin {
38094
+ connectedUsers = {};
38415
38095
  getLayerName = void 0;
38416
38096
  constructor(params) {
38417
38097
  super();
38418
38098
  const { config } = params ?? {};
38419
38099
  this.config = config;
38420
- this.initialize();
38421
- }
38422
- initialize() {
38423
38100
  this.connectedUsers = {};
38424
38101
  }
38425
38102
  getName() {
@@ -38466,9 +38143,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
38466
38143
  this.config = config;
38467
38144
  this.config.getUser = memoize(this.config.getUser);
38468
38145
  this.config.getUserColor = memoize(this.config.getUserColor);
38469
- this.initialize();
38470
- }
38471
- initialize() {
38472
38146
  this.usersSelection = {};
38473
38147
  }
38474
38148
  getName() {
@@ -38661,9 +38335,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
38661
38335
  this.config.getUser = memoize(this.config.getUser);
38662
38336
  this.config.getUserBackgroundColor = memoize(this.config.getUserBackgroundColor);
38663
38337
  this.config.getUserForegroundColor = memoize(this.config.getUserForegroundColor);
38664
- this.initialize();
38665
- }
38666
- initialize() {
38667
38338
  this.usersPointers = {};
38668
38339
  this.usersOperations = {};
38669
38340
  }
@@ -38874,9 +38545,6 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
38874
38545
  super();
38875
38546
  const { config } = params;
38876
38547
  this.config = mergeExceptArrays(WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, config);
38877
- this.initialize();
38878
- }
38879
- initialize() {
38880
38548
  this.userPresence = {};
38881
38549
  }
38882
38550
  getName() {
@@ -38952,9 +38620,6 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38952
38620
  initLayer = void 0;
38953
38621
  constructor() {
38954
38622
  super();
38955
- this.initialize();
38956
- }
38957
- initialize() {
38958
38623
  this.enabled = true;
38959
38624
  }
38960
38625
  getName() {
@@ -38968,20 +38633,14 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38968
38633
  stage.container().addEventListener("dragover", (e) => {
38969
38634
  e.preventDefault();
38970
38635
  e.stopPropagation();
38971
- }, { signal: this.instance.getEventsController()?.signal });
38636
+ });
38972
38637
  stage.container().addEventListener("drop", (e) => {
38973
38638
  e.preventDefault();
38974
38639
  e.stopPropagation();
38975
38640
  this.instance.emitEvent("onStageDrop", e);
38976
- }, { signal: this.instance.getEventsController()?.signal });
38977
- window.addEventListener("dragover", (e) => e.preventDefault(), {
38978
- signal: this.instance.getEventsController()?.signal,
38979
- passive: false
38980
- });
38981
- window.addEventListener("drop", (e) => e.preventDefault(), {
38982
- signal: this.instance.getEventsController()?.signal,
38983
- passive: false
38984
38641
  });
38642
+ window.addEventListener("dragover", (e) => e.preventDefault(), { passive: false });
38643
+ window.addEventListener("drop", (e) => e.preventDefault(), { passive: false });
38985
38644
  }
38986
38645
  enable() {
38987
38646
  this.enabled = true;
@@ -39000,9 +38659,6 @@ var WeaveNodesEdgeSnappingPlugin = class extends WeavePlugin {
39000
38659
  this.guideLineConfig = config?.guideLine ?? GUIDE_LINE_DEFAULT_CONFIG;
39001
38660
  this.dragSnappingThreshold = config?.dragSnappingThreshold ?? GUIDE_LINE_DRAG_SNAPPING_THRESHOLD;
39002
38661
  this.transformSnappingThreshold = config?.transformSnappingThreshold ?? GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD;
39003
- this.initialize();
39004
- }
39005
- initialize() {
39006
38662
  this.enabled = true;
39007
38663
  }
39008
38664
  getName() {
@@ -39379,9 +39035,6 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39379
39035
  this.enterSnappingTolerance = config?.enterSnappingTolerance ?? GUIDE_ENTER_SNAPPING_TOLERANCE;
39380
39036
  this.exitSnappingTolerance = config?.exitSnappingTolerance ?? GUIDE_EXIT_SNAPPING_TOLERANCE;
39381
39037
  this.uiConfig = mergeExceptArrays(GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, config?.ui);
39382
- this.initialize();
39383
- }
39384
- initialize() {
39385
39038
  this.enabled = true;
39386
39039
  }
39387
39040
  getName() {
@@ -40028,14 +39681,12 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
40028
39681
  //#endregion
40029
39682
  //#region src/plugins/comments-renderer/comments-renderer.ts
40030
39683
  var WeaveCommentsRendererPlugin = class extends WeavePlugin {
39684
+ comments = [];
40031
39685
  getLayerName = void 0;
40032
39686
  constructor(params) {
40033
39687
  super();
40034
39688
  const { config } = params ?? {};
40035
39689
  this.config = config;
40036
- this.initialize();
40037
- }
40038
- initialize() {
40039
39690
  this.comments = [];
40040
39691
  }
40041
39692
  getName() {
@@ -40126,7 +39777,6 @@ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40126
39777
  var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40127
39778
  getLayerName = void 0;
40128
39779
  initLayer = void 0;
40129
- initialize = void 0;
40130
39780
  constructor(params) {
40131
39781
  super();
40132
39782
  this.config = mergeExceptArrays(WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, params?.config ?? {});
@@ -40165,7 +39815,7 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40165
39815
  if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40166
39816
  if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40167
39817
  if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40168
- }, { signal: this.instance.getEventsController()?.signal });
39818
+ });
40169
39819
  }
40170
39820
  enable() {
40171
39821
  this.enabled = true;
@@ -40176,5 +39826,5 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40176
39826
  };
40177
39827
 
40178
39828
  //#endregion
40179
- 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, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
39829
+ 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, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
40180
39830
  //# sourceMappingURL=types.js.map