@inditextech/weave-sdk 3.4.0-SNAPSHOT.85.1 → 3.4.0

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