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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.js CHANGED
@@ -32,13 +32,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  }) : target, mod));
33
33
 
34
34
  //#endregion
35
- //#region ../../node_modules/emittery/maps.js
35
+ //#region node_modules/emittery/maps.js
36
36
  const anyMap = new WeakMap();
37
37
  const eventsMap = new WeakMap();
38
38
  const producersMap = new WeakMap();
39
39
 
40
40
  //#endregion
41
- //#region ../../node_modules/emittery/index.js
41
+ //#region node_modules/emittery/index.js
42
42
  const anyProducer = Symbol("anyProducer");
43
43
  const resolvedPromise = Promise.resolve();
44
44
  const listenerAdded = Symbol("listenerAdded");
@@ -15084,11 +15084,6 @@ var WeaveStore = class {
15084
15084
  getDocument() {
15085
15085
  return this.document;
15086
15086
  }
15087
- restartDocument() {
15088
- this.latestState = { weave: {} };
15089
- this.state = syncedStore({ weave: {} });
15090
- this.document = getYjsDoc(this.state);
15091
- }
15092
15087
  loadDocument(roomData) {
15093
15088
  yjs_default.applyUpdate(this.document, roomData);
15094
15089
  }
@@ -17964,15 +17959,6 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17964
17959
  initLayer = void 0;
17965
17960
  constructor(params) {
17966
17961
  super();
17967
- const { config } = params ?? {};
17968
- this.config = {
17969
- xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17970
- yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17971
- ...config
17972
- };
17973
- this.initialize();
17974
- }
17975
- initialize() {
17976
17962
  this.timer = null;
17977
17963
  this.tapHold = false;
17978
17964
  this.contextMenuVisible = false;
@@ -17982,6 +17968,12 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17982
17968
  time: 0
17983
17969
  };
17984
17970
  this.tapHoldTimeout = WEAVE_CONTEXT_MENU_TAP_HOLD_TIMEOUT;
17971
+ const { config } = params ?? {};
17972
+ this.config = {
17973
+ xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17974
+ yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17975
+ ...config
17976
+ };
17985
17977
  this.pointers = {};
17986
17978
  }
17987
17979
  getName() {
@@ -18585,16 +18577,23 @@ const WEAVE_GRID_TYPES = {
18585
18577
  ["LINES"]: "lines",
18586
18578
  ["DOTS"]: "dots"
18587
18579
  };
18588
- const WEAVE_GRID_DEFAULT_SIZE = 50;
18589
- const WEAVE_GRID_DEFAULT_TYPE = WEAVE_GRID_TYPES.LINES;
18590
- const WEAVE_GRID_DEFAULT_COLOR = "rgba(0,0,0,0.1)";
18591
- const WEAVE_GRID_DEFAULT_ORIGIN_COLOR = "rgba(255,0,0,0.1)";
18592
- const WEAVE_GRID_DEFAULT_STROKE = .5;
18593
- const WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO = 4;
18594
- const WEAVE_GRID_DEFAULT_RADIUS = 1;
18595
- const WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO = 2;
18596
- const WEAVE_GRID_DEFAULT_MAJOR_EVERY = 10;
18597
- const WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS = 125;
18580
+ const WEAVE_GRID_DOT_TYPES = {
18581
+ ["SQUARE"]: "square",
18582
+ ["CIRCLE"]: "circle"
18583
+ };
18584
+ const WEAVE_GRID_DEFAULT_CONFIG = {
18585
+ type: WEAVE_GRID_TYPES.LINES,
18586
+ gridColor: "#b3b3b3",
18587
+ gridMajorColor: "#b3b3b3",
18588
+ gridOriginColor: "#ff746c",
18589
+ gridSize: 20,
18590
+ gridMajorEvery: 10,
18591
+ gridMajorRatio: 2,
18592
+ gridStroke: 1,
18593
+ gridDotType: WEAVE_GRID_DOT_TYPES.CIRCLE,
18594
+ gridDotRadius: 1,
18595
+ gridDotRectSize: 2
18596
+ };
18598
18597
  const WEAVE_GRID_LAYER_ID = "gridLayer";
18599
18598
 
18600
18599
  //#endregion
@@ -18625,10 +18624,7 @@ const DEFAULT_ADD_NODE_OPTIONS = { emitUserChangeEvent: false };
18625
18624
  const DEFAULT_UPDATE_NODE_OPTIONS = { emitUserChangeEvent: false };
18626
18625
  const DEFAULT_REMOVE_NODE_OPTIONS = { emitUserChangeEvent: false };
18627
18626
  const DEFAULT_MOVE_NODE_OPTIONS = { emitUserChangeEvent: false };
18628
- const WEAVE_DEFAULT_CONFIG = {
18629
- behaviors: { axisLockThreshold: 5 },
18630
- performance: { upscale: { enabled: false } }
18631
- };
18627
+ const WEAVE_DEFAULT_CONFIG = { behaviors: { axisLockThreshold: 5 } };
18632
18628
 
18633
18629
  //#endregion
18634
18630
  //#region src/plugins/users-presence/constants.ts
@@ -18657,9 +18653,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18657
18653
  constructor(params) {
18658
18654
  super();
18659
18655
  this.config = mergeExceptArrays(WEAVE_NODES_SELECTION_DEFAULT_CONFIG, params?.config ?? {});
18660
- this.initialize();
18661
- }
18662
- initialize() {
18663
18656
  this.defaultEnabledAnchors = this.config.selection?.enabledAnchors ?? [
18664
18657
  "top-left",
18665
18658
  "top-center",
@@ -18823,7 +18816,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
18823
18816
  nodeHovered = void 0;
18824
18817
  }
18825
18818
  this.instance.getStage().handleMouseover?.();
18826
- }, { signal: this.instance.getEventsController()?.signal });
18819
+ });
18827
18820
  const handleTransform = (e) => {
18828
18821
  const moved = this.checkMoved(e);
18829
18822
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
@@ -19238,11 +19231,11 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19238
19231
  });
19239
19232
  return;
19240
19233
  }
19241
- }, { signal: this.instance.getEventsController()?.signal });
19234
+ });
19242
19235
  stage.container().addEventListener("keyup", (e) => {
19243
19236
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
19244
19237
  if (e.code === "Space") this.isSpaceKeyPressed = false;
19245
- }, { signal: this.instance.getEventsController()?.signal });
19238
+ });
19246
19239
  stage.on("pointerdown", (e) => {
19247
19240
  this.setTapStart(e);
19248
19241
  this.handledClickOrTap = false;
@@ -19449,7 +19442,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
19449
19442
  if (existNode) newSelectedNodes.push(existNode);
19450
19443
  }
19451
19444
  this.tr.nodes([...newSelectedNodes]);
19452
- if (newSelectedNodes.length > 0) this.tr.forceUpdate();
19445
+ this.tr.forceUpdate();
19453
19446
  this.triggerSelectedNodesEvent();
19454
19447
  }
19455
19448
  getSelectionPlugin() {
@@ -19702,9 +19695,6 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19702
19695
  super();
19703
19696
  this.getImageBase64 = params.getImageBase64;
19704
19697
  this.config = mergeExceptArrays(WEAVE_COPY_PASTE_CONFIG_DEFAULT, params?.config);
19705
- this.initialize();
19706
- }
19707
- initialize() {
19708
19698
  this.actualInternalPaddingX = 0;
19709
19699
  this.actualInternalPaddingY = 0;
19710
19700
  this.lastInternalPasteSnapshot = "";
@@ -19810,7 +19800,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19810
19800
  this.focusPasteCatcher();
19811
19801
  if (!this.enabled) return;
19812
19802
  }
19813
- }, { signal: this.instance.getEventsController()?.signal });
19803
+ });
19814
19804
  if (catcher) catcher.addEventListener("paste", async (e) => {
19815
19805
  e.preventDefault();
19816
19806
  let items = void 0;
@@ -19829,7 +19819,7 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
19829
19819
  return;
19830
19820
  }
19831
19821
  this.sendExternalPasteEvent(void 0, items);
19832
- }, { signal: this.instance.getEventsController()?.signal });
19822
+ });
19833
19823
  }
19834
19824
  sendExternalPasteEvent(dataList, items) {
19835
19825
  const stage = this.instance.getStage();
@@ -21995,34 +21985,11 @@ var WeaveRegisterManager = class {
21995
21985
  }
21996
21986
  }
21997
21987
  }
21998
- resetNodesHandlers() {
21999
- for (const nodeHandlerId of Object.keys(this.nodesHandlers)) {
22000
- const nodeHandler = this.nodesHandlers[nodeHandlerId];
22001
- nodeHandler.initialize?.();
22002
- }
22003
- }
22004
- resetActionsHandlers() {
22005
- for (const actionHandlerId of Object.keys(this.actionsHandlers)) {
22006
- const actionHandler = this.actionsHandlers[actionHandlerId];
22007
- actionHandler.initialize?.();
22008
- }
22009
- }
22010
- resetPlugins() {
22011
- for (const pluginId of Object.keys(this.plugins)) {
22012
- const plugin = this.plugins[pluginId];
22013
- plugin.initialize?.();
22014
- }
22015
- }
22016
- reset() {
22017
- this.resetNodesHandlers();
22018
- this.resetActionsHandlers();
22019
- this.resetPlugins();
22020
- }
22021
21988
  };
22022
21989
 
22023
21990
  //#endregion
22024
21991
  //#region package.json
22025
- var version = "3.4.0-SNAPSHOT.85.1";
21992
+ var version = "3.5.0";
22026
21993
 
22027
21994
  //#endregion
22028
21995
  //#region src/managers/setup.ts
@@ -22139,11 +22106,6 @@ var WeaveStageManager = class {
22139
22106
  initialZIndex: void 0
22140
22107
  };
22141
22108
  const stage = new Konva.Stage({ ...props });
22142
- if (!this.instance.isServerSide()) {
22143
- const containerParent = stage.container().parentNode;
22144
- stage.width(containerParent.clientWidth);
22145
- stage.height(containerParent.clientHeight);
22146
- }
22147
22109
  const realContainer = stage.container();
22148
22110
  if (realContainer !== void 0 && realContainer.style?.position !== "relative") realContainer.style.position = "relative";
22149
22111
  this.setStage(stage);
@@ -22452,91 +22414,6 @@ var WeaveExportManager = class {
22452
22414
  height: imageHeight * pixelRatio
22453
22415
  };
22454
22416
  }
22455
- async exportAreaServerSide(area, options) {
22456
- const { format = WEAVE_EXPORT_FORMATS.PNG, padding = 0, pixelRatio = 1, backgroundColor = WEAVE_EXPORT_BACKGROUND_COLOR } = options;
22457
- this.getNodesSelectionPlugin()?.disable();
22458
- this.getNodesDistanceSnappingPlugin()?.disable();
22459
- this.getNodesEdgeSnappingPlugin()?.disable();
22460
- this.getStageGridPlugin()?.disable();
22461
- const stage = this.instance.getStage();
22462
- const mainLayer = this.instance.getMainLayer();
22463
- if (!mainLayer) throw new Error("Main layer not found");
22464
- const originalPosition = {
22465
- x: stage.x(),
22466
- y: stage.y()
22467
- };
22468
- const originalScale = {
22469
- x: stage.scaleX(),
22470
- y: stage.scaleY()
22471
- };
22472
- stage.scale({
22473
- x: 1,
22474
- y: 1
22475
- });
22476
- const bounds = area;
22477
- const scaleX = stage.scaleX();
22478
- const scaleY = stage.scaleY();
22479
- const unscaledBounds = {
22480
- x: bounds.x / scaleX,
22481
- y: bounds.y / scaleY,
22482
- width: bounds.width / scaleX,
22483
- height: bounds.height / scaleY
22484
- };
22485
- const background = new Konva.Rect({
22486
- x: unscaledBounds.x - padding,
22487
- y: unscaledBounds.y - padding,
22488
- width: unscaledBounds.width + 2 * padding,
22489
- height: unscaledBounds.height + 2 * padding,
22490
- strokeWidth: 0,
22491
- fill: backgroundColor
22492
- });
22493
- mainLayer.add(background);
22494
- background.moveToBottom();
22495
- const backgroundRect = background.getClientRect({ relativeTo: stage });
22496
- const composites = [];
22497
- const imageWidth = Math.round(backgroundRect.width);
22498
- const imageHeight = Math.round(backgroundRect.height);
22499
- const maxRenderSize = 1920;
22500
- const cols = Math.ceil(imageWidth / maxRenderSize);
22501
- const rows = Math.ceil(imageHeight / maxRenderSize);
22502
- const tileWidth = Math.floor(imageWidth / cols);
22503
- const tileHeight = Math.floor(imageHeight / rows);
22504
- for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22505
- const width = Math.min(tileWidth, imageWidth - x);
22506
- const height = Math.min(tileHeight, imageHeight - y);
22507
- const canvas = await mainLayer.toCanvas({
22508
- x: Math.round(backgroundRect.x) + x,
22509
- y: Math.round(backgroundRect.y) + y,
22510
- width,
22511
- height,
22512
- mimeType: format,
22513
- pixelRatio,
22514
- quality: options.quality ?? 1
22515
- });
22516
- let buffer = null;
22517
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.CANVAS) buffer = canvas.toBuffer();
22518
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.SKIA) buffer = await canvas.toBuffer();
22519
- if (!buffer) throw new Error("Failed to generate image buffer");
22520
- composites.push({
22521
- top: y * pixelRatio,
22522
- left: x * pixelRatio,
22523
- input: buffer
22524
- });
22525
- }
22526
- background.destroy();
22527
- stage.position(originalPosition);
22528
- stage.scale(originalScale);
22529
- stage.batchDraw();
22530
- this.getNodesSelectionPlugin()?.enable();
22531
- this.getNodesDistanceSnappingPlugin()?.enable();
22532
- this.getNodesEdgeSnappingPlugin()?.enable();
22533
- this.getStageGridPlugin()?.enable();
22534
- return {
22535
- composites,
22536
- width: imageWidth * pixelRatio,
22537
- height: imageHeight * pixelRatio
22538
- };
22539
- }
22540
22417
  imageToBase64(img, mimeType) {
22541
22418
  if (img.naturalWidth === 0 && img.naturalHeight === 0) throw new Error("Image has no content");
22542
22419
  const canvas = document.createElement("canvas");
@@ -22816,12 +22693,7 @@ var WeaveAsyncManager = class {
22816
22693
  this.instance.emitEvent("onAsyncElementChange");
22817
22694
  }, new Map());
22818
22695
  }
22819
- reset() {
22820
- this.asyncElements.clear();
22821
- this.asyncElementsLoadedEventEmitted = false;
22822
- }
22823
22696
  checkForAsyncElements(elements) {
22824
- this.instance.emitEvent("onAsyncElementsIdle");
22825
22697
  const amountAsyncResourcesExtracted = this.extractAsyncResources(elements);
22826
22698
  if (amountAsyncResourcesExtracted === 0 && !this.asyncElementsLoadedEventEmitted) {
22827
22699
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -22874,7 +22746,7 @@ var WeaveAsyncManager = class {
22874
22746
  status: WEAVE_ASYNC_STATUS.LOADING
22875
22747
  };
22876
22748
  this.asyncElements.set(nodeId, element);
22877
- if (!this.asyncElementsLoadedEventEmitted) this.instance.emitEvent("onAsyncElementsLoading", {
22749
+ this.instance.emitEvent("onAsyncElementsLoading", {
22878
22750
  loaded: this.getAmountAsyncElementsLoaded(),
22879
22751
  total: this.getAmountAsyncElements()
22880
22752
  });
@@ -22887,11 +22759,11 @@ var WeaveAsyncManager = class {
22887
22759
  status: WEAVE_ASYNC_STATUS.LOADED
22888
22760
  };
22889
22761
  this.asyncElements.set(nodeId, element);
22762
+ this.instance.emitEvent("onAsyncElementsLoading", {
22763
+ loaded: this.getAmountAsyncElementsLoaded(),
22764
+ total: this.getAmountAsyncElements()
22765
+ });
22890
22766
  if (!this.asyncElementsLoadedEventEmitted) {
22891
- this.instance.emitEvent("onAsyncElementsLoading", {
22892
- loaded: this.getAmountAsyncElementsLoaded(),
22893
- total: this.getAmountAsyncElements()
22894
- });
22895
22767
  const allLoaded = this.asyncElementsLoaded();
22896
22768
  if (allLoaded) {
22897
22769
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -23016,7 +22888,6 @@ var Weave = class {
23016
22888
  constructor(weaveConfig, stageConfig) {
23017
22889
  globalThis._weave_isServerSide = false;
23018
22890
  if (typeof window === "undefined") globalThis._weave_isServerSide = true;
23019
- this.eventsController = void 0;
23020
22891
  this.emitter = new Emittery();
23021
22892
  Konva.showWarnings = false;
23022
22893
  this.id = v4_default();
@@ -23062,7 +22933,6 @@ var Weave = class {
23062
22933
  this.initialized = true;
23063
22934
  this.status = WEAVE_INSTANCE_STATUS.RUNNING;
23064
22935
  this.emitEvent("onInstanceStatus", this.status);
23065
- this.emitEvent("onRender");
23066
22936
  });
23067
22937
  }
23068
22938
  setStatus(status) {
@@ -23087,7 +22957,6 @@ var Weave = class {
23087
22957
  async start() {
23088
22958
  this.moduleLogger.info("Start instance");
23089
22959
  if (!this.isServerSide()) {
23090
- this.eventsController = new AbortController();
23091
22960
  if (!window.weave) window.weave = this;
23092
22961
  }
23093
22962
  this.emitEvent("onRoomLoaded", false);
@@ -23111,39 +22980,8 @@ var Weave = class {
23111
22980
  store.setup();
23112
22981
  store.connect();
23113
22982
  }
23114
- async switchRoom() {
23115
- this.moduleLogger.info(`Switching room`);
23116
- const nodeHandlers = this.registerManager.getNodesHandlers();
23117
- for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23118
- const nodeHandler = nodeHandlers[nodeHandlerKey];
23119
- nodeHandler?.onDestroyInstance();
23120
- }
23121
- const stage = this.getStage();
23122
- if (stage) stage.destroy();
23123
- if (this.eventsController) this.eventsController.abort();
23124
- if (!this.isServerSide()) this.eventsController = new AbortController();
23125
- this.registerManager.reset();
23126
- this.asyncManager.reset();
23127
- this.moduleLogger.info("Switching room instance");
23128
- if (!this.isServerSide()) {
23129
- if (!window.weave) window.weave = this;
23130
- }
23131
- this.emitEvent("onRoomLoaded", false);
23132
- this.status = WEAVE_INSTANCE_STATUS.STARTING;
23133
- this.emitEvent("onInstanceStatus", this.status);
23134
- this.registerManager.reset();
23135
- this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23136
- this.emitEvent("onInstanceStatus", this.status);
23137
- await this.fontsManager.loadFonts();
23138
- this.setupManager.setupLog();
23139
- this.stageManager.initStage();
23140
- this.status = WEAVE_INSTANCE_STATUS.CONNECTING_TO_ROOM;
23141
- this.emitEvent("onInstanceStatus", this.status);
23142
- this.addEventListener("onStoreConnectionStatusChange", this.handleStoreConnectionStatusChange.bind(this));
23143
- }
23144
22983
  destroy() {
23145
22984
  this.moduleLogger.info(`Destroying the instance`);
23146
- if (this.eventsController) this.eventsController.abort();
23147
22985
  this.emitter.clearListeners();
23148
22986
  this.status = WEAVE_INSTANCE_STATUS.IDLE;
23149
22987
  this.emitEvent("onInstanceStatus", this.status);
@@ -23613,9 +23451,6 @@ var Weave = class {
23613
23451
  async exportNodesServerSide(nodes, boundingNodes, options) {
23614
23452
  return await this.exportManager.exportNodesServerSide(nodes, boundingNodes, options);
23615
23453
  }
23616
- async exportAreaServerSide(area, options) {
23617
- return await this.exportManager.exportAreaServerSide(area, options);
23618
- }
23619
23454
  async exportNodes(nodes, boundingNodes, options) {
23620
23455
  return await this.exportManager.exportNodesAsImage(nodes, boundingNodes, options);
23621
23456
  }
@@ -23781,9 +23616,6 @@ var Weave = class {
23781
23616
  getDragProperties() {
23782
23617
  return this.dragAndDropManager.getDragProperties();
23783
23618
  }
23784
- getEventsController() {
23785
- return this.eventsController;
23786
- }
23787
23619
  };
23788
23620
 
23789
23621
  //#endregion
@@ -23875,7 +23707,6 @@ const downscaleImageFromURL = (url, options) => {
23875
23707
  //#endregion
23876
23708
  //#region src/internal-utils/upscale.ts
23877
23709
  const setupUpscaleStage = (instance, stage) => {
23878
- if (instance.isServerSide()) return;
23879
23710
  const config = instance.getConfiguration();
23880
23711
  const doUpscale = config.performance?.upscale?.enabled ?? false;
23881
23712
  if (doUpscale) {
@@ -23907,14 +23738,7 @@ const setupUpscaleStage = (instance, stage) => {
23907
23738
  innerElement.style.transformOrigin = "0 0";
23908
23739
  innerElement.style.transform = `scale(${scaleToCover})`;
23909
23740
  }
23910
- } else {
23911
- const realContainer = stage.container();
23912
- const containerWidth = realContainer.offsetWidth;
23913
- const containerHeight = realContainer.offsetHeight;
23914
- stage.width(containerWidth);
23915
- stage.height(containerHeight);
23916
- stage.setAttrs({ upscaleScale: 1 });
23917
- }
23741
+ } else stage.setAttrs({ upscaleScale: 1 });
23918
23742
  };
23919
23743
 
23920
23744
  //#endregion
@@ -23925,7 +23749,6 @@ var WeaveStageNode = class extends WeaveNode {
23925
23749
  wheelMousePressed = false;
23926
23750
  isCmdCtrlPressed = false;
23927
23751
  globalEventsInitialized = false;
23928
- initialize = void 0;
23929
23752
  onRender(props) {
23930
23753
  const stage = new Konva.Stage({
23931
23754
  ...props,
@@ -23944,10 +23767,10 @@ var WeaveStageNode = class extends WeaveNode {
23944
23767
  container.setAttribute("tabindex", "0");
23945
23768
  stage.container().addEventListener("focus", () => {
23946
23769
  this.stageFocused = true;
23947
- }, { signal: this.instance.getEventsController()?.signal });
23770
+ });
23948
23771
  stage.container().addEventListener("blur", () => {
23949
23772
  this.stageFocused = false;
23950
- }, { signal: this.instance.getEventsController()?.signal });
23773
+ });
23951
23774
  }
23952
23775
  Konva.Stage.prototype.mode = function(mode) {
23953
23776
  if (typeof mode !== "undefined") this._mode = mode;
@@ -24017,7 +23840,7 @@ var WeaveStageNode = class extends WeaveNode {
24017
23840
  const selectedNode = transformer.nodes()[0];
24018
23841
  selectedNode.fire("onCmdCtrlPressed");
24019
23842
  }
24020
- }, { signal: this.instance.getEventsController()?.signal });
23843
+ });
24021
23844
  window.addEventListener("keyup", (e) => {
24022
23845
  if (!(e.ctrlKey || e.metaKey)) {
24023
23846
  this.isCmdCtrlPressed = false;
@@ -24028,7 +23851,7 @@ var WeaveStageNode = class extends WeaveNode {
24028
23851
  const selectedNode = transformer.nodes()[0];
24029
23852
  selectedNode.fire("onCmdCtrlReleased");
24030
23853
  }
24031
- }, { signal: this.instance.getEventsController()?.signal });
23854
+ });
24032
23855
  this.globalEventsInitialized = true;
24033
23856
  }
24034
23857
  isOnlyCtrlOrMeta(event) {
@@ -24048,7 +23871,6 @@ const WEAVE_LAYER_NODE_TYPE = "layer";
24048
23871
  //#region src/nodes/layer/layer.ts
24049
23872
  var WeaveLayerNode = class extends WeaveNode {
24050
23873
  nodeType = WEAVE_LAYER_NODE_TYPE;
24051
- initialize = void 0;
24052
23874
  onRender(props) {
24053
23875
  const layer = new Konva.Layer({ ...props });
24054
23876
  layer.canMoveToContainer = function() {
@@ -24096,7 +23918,6 @@ const WEAVE_GROUP_NODE_TYPE = "group";
24096
23918
  //#region src/nodes/group/group.ts
24097
23919
  var WeaveGroupNode = class extends WeaveNode {
24098
23920
  nodeType = WEAVE_GROUP_NODE_TYPE;
24099
- initialize = void 0;
24100
23921
  constructor(params) {
24101
23922
  super();
24102
23923
  const { config } = params ?? {};
@@ -24189,7 +24010,6 @@ const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
24189
24010
  //#region src/nodes/rectangle/rectangle.ts
24190
24011
  var WeaveRectangleNode = class extends WeaveNode {
24191
24012
  nodeType = WEAVE_RECTANGLE_NODE_TYPE;
24192
- initialize = void 0;
24193
24013
  constructor(params) {
24194
24014
  super();
24195
24015
  const { config } = params ?? {};
@@ -24233,7 +24053,6 @@ const WEAVE_ELLIPSE_NODE_TYPE = "ellipse";
24233
24053
  //#region src/nodes/ellipse/ellipse.ts
24234
24054
  var WeaveEllipseNode = class extends WeaveNode {
24235
24055
  nodeType = WEAVE_ELLIPSE_NODE_TYPE;
24236
- initialize = void 0;
24237
24056
  constructor(params) {
24238
24057
  super();
24239
24058
  const { config } = params ?? {};
@@ -24379,16 +24198,13 @@ var WeaveLineNode = class extends WeaveNode {
24379
24198
  constructor(params) {
24380
24199
  super();
24381
24200
  this.config = mergeExceptArrays(WEAVE_LINE_NODE_DEFAULT_CONFIG, params?.config ?? {});
24201
+ this.handleNodeChanges = null;
24202
+ this.handleZoomChanges = null;
24382
24203
  this.snapper = new GreedySnapper({
24383
24204
  snapAngles: this.config.snapAngles.angles,
24384
24205
  activateThreshold: this.config.snapAngles.activateThreshold,
24385
24206
  releaseThreshold: this.config.snapAngles.releaseThreshold
24386
24207
  });
24387
- this.initialize();
24388
- }
24389
- initialize() {
24390
- this.handleNodeChanges = null;
24391
- this.handleZoomChanges = null;
24392
24208
  }
24393
24209
  onRender(props) {
24394
24210
  const line = new Konva.Line({
@@ -24693,19 +24509,17 @@ const TEXT_LAYOUT = {
24693
24509
  //#region src/nodes/text/text.ts
24694
24510
  var WeaveTextNode = class extends WeaveNode {
24695
24511
  nodeType = WEAVE_TEXT_NODE_TYPE;
24512
+ editing = false;
24513
+ textAreaSuperContainer = null;
24514
+ textAreaContainer = null;
24515
+ textArea = null;
24516
+ eventsInitialized = false;
24517
+ isCtrlMetaPressed = false;
24696
24518
  constructor(params) {
24697
24519
  super();
24698
24520
  const { config } = params ?? {};
24699
24521
  this.config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, config);
24700
- this.initialize();
24701
- }
24702
- initialize() {
24703
24522
  this.keyPressHandler = void 0;
24704
- this.eventsInitialized = false;
24705
- this.isCtrlMetaPressed = false;
24706
- this.textAreaSuperContainer = null;
24707
- this.textAreaContainer = null;
24708
- this.textArea = null;
24709
24523
  this.editing = false;
24710
24524
  this.textArea = null;
24711
24525
  }
@@ -24713,10 +24527,10 @@ var WeaveTextNode = class extends WeaveNode {
24713
24527
  if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
24714
24528
  window.addEventListener("keydown", (e) => {
24715
24529
  if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
24716
- }, { signal: this.instance.getEventsController()?.signal });
24530
+ });
24717
24531
  window.addEventListener("keyup", (e) => {
24718
24532
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
24719
- }, { signal: this.instance.getEventsController()?.signal });
24533
+ });
24720
24534
  this.eventsInitialized = true;
24721
24535
  }
24722
24536
  }
@@ -24744,7 +24558,7 @@ var WeaveTextNode = class extends WeaveNode {
24744
24558
  onAdd() {
24745
24559
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24746
24560
  this.keyPressHandler = this.handleKeyPress.bind(this);
24747
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24561
+ window.addEventListener("keypress", this.keyPressHandler);
24748
24562
  }
24749
24563
  }
24750
24564
  onRender(props) {
@@ -24898,7 +24712,7 @@ var WeaveTextNode = class extends WeaveNode {
24898
24712
  });
24899
24713
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24900
24714
  this.keyPressHandler = this.handleKeyPress.bind(this);
24901
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24715
+ window.addEventListener("keypress", this.keyPressHandler);
24902
24716
  }
24903
24717
  return text;
24904
24718
  }
@@ -25157,17 +24971,17 @@ var WeaveTextNode = class extends WeaveNode {
25157
24971
  this.textAreaSuperContainer.scrollTop = 0;
25158
24972
  this.textAreaSuperContainer.scrollLeft = 0;
25159
24973
  }
25160
- }, { signal: this.instance.getEventsController()?.signal });
24974
+ });
25161
24975
  this.textAreaContainer.addEventListener("scroll", () => {
25162
24976
  if (!this.textAreaContainer) return;
25163
24977
  this.textAreaContainer.scrollTop = 0;
25164
24978
  this.textAreaContainer.scrollLeft = 0;
25165
- }, { signal: this.instance.getEventsController()?.signal });
24979
+ });
25166
24980
  this.textArea.addEventListener("scroll", () => {
25167
24981
  if (!this.textArea) return;
25168
24982
  this.textArea.scrollTop = 0;
25169
24983
  this.textArea.scrollLeft = 0;
25170
- }, { signal: this.instance.getEventsController()?.signal });
24984
+ });
25171
24985
  const rotation = textNode.getAbsoluteRotation();
25172
24986
  if (rotation) {
25173
24987
  const transform = "rotate(" + rotation + "deg)";
@@ -25216,8 +25030,8 @@ var WeaveTextNode = class extends WeaveNode {
25216
25030
  this.textAreaDomResize(textNode);
25217
25031
  }
25218
25032
  };
25219
- this.textArea.addEventListener("keydown", handleKeyDown, { signal: this.instance.getEventsController()?.signal });
25220
- this.textArea.addEventListener("keyup", handleKeyUp, { signal: this.instance.getEventsController()?.signal });
25033
+ this.textArea.addEventListener("keydown", handleKeyDown);
25034
+ this.textArea.addEventListener("keyup", handleKeyUp);
25221
25035
  this.textArea.tabIndex = 1;
25222
25036
  this.textArea.focus();
25223
25037
  const handleOutsideClick = (e) => {
@@ -25243,7 +25057,7 @@ var WeaveTextNode = class extends WeaveNode {
25243
25057
  }
25244
25058
  };
25245
25059
  setTimeout(() => {
25246
- window.addEventListener("pointerup", handleOutsideClick, { signal: this.instance.getEventsController()?.signal });
25060
+ window.addEventListener("pointerup", handleOutsideClick);
25247
25061
  }, 0);
25248
25062
  this.instance.getStage().mode(WEAVE_STAGE_TEXT_EDITION_MODE);
25249
25063
  this.editing = true;
@@ -25366,6 +25180,8 @@ const WEAVE_IMAGE_DEFAULT_CONFIG = {
25366
25180
  crossOrigin: "anonymous",
25367
25181
  useFallbackImage: true,
25368
25182
  cropMode: {
25183
+ enabled: true,
25184
+ triggers: { ctrlCmd: true },
25369
25185
  gridLines: { enabled: true },
25370
25186
  overlay: { fill: "rgba(0,0,0,0.2)" },
25371
25187
  selection: {
@@ -25577,7 +25393,7 @@ var WeaveImageCrop = class WeaveImageCrop {
25577
25393
  utilityLayer?.add(this.transformer);
25578
25394
  this.transformer?.forceUpdate();
25579
25395
  this.cropGroup.show();
25580
- window.addEventListener("keydown", this.handleHide, { signal: this.instance.getEventsController()?.signal });
25396
+ window.addEventListener("keydown", this.handleHide);
25581
25397
  if (options.cmdCtrl.triggered) {
25582
25398
  utilityLayer?.hide();
25583
25399
  const stage = this.instance.getStage();
@@ -26027,21 +25843,24 @@ const isAllowedUrl = (value) => {
26027
25843
  //#endregion
26028
25844
  //#region src/nodes/image/image.ts
26029
25845
  var WeaveImageNode = class extends WeaveNode {
25846
+ imageBitmapCache = {};
25847
+ imageSource = {};
25848
+ imageFallback = {};
25849
+ imageState = {};
25850
+ imageTryoutAttempts = {};
25851
+ imageTryoutIds = {};
26030
25852
  nodeType = WEAVE_IMAGE_NODE_TYPE;
26031
25853
  cursorsFallback = { loading: "wait" };
26032
25854
  cursors = {};
26033
25855
  constructor(params) {
26034
25856
  super();
26035
25857
  const { config } = params ?? {};
26036
- this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26037
- this.initialize();
26038
- }
26039
- initialize() {
26040
25858
  this.tapStart = {
26041
25859
  x: 0,
26042
25860
  y: 0,
26043
25861
  time: 0
26044
25862
  };
25863
+ this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26045
25864
  this.imageCrop = null;
26046
25865
  this.imageBitmapCache = {};
26047
25866
  this.imageSource = {};
@@ -26072,6 +25891,7 @@ var WeaveImageNode = class extends WeaveNode {
26072
25891
  this.logger.info(`image caching enabled: ${this.config.performance.cache.enabled}`);
26073
25892
  }
26074
25893
  triggerCrop(imageNode, options) {
25894
+ if (!this.config.cropMode.enabled) return;
26075
25895
  const stage = this.instance.getStage();
26076
25896
  if (imageNode.getAttrs().cropping ?? false) return;
26077
25897
  if (!(this.isSelecting() && this.isNodeSelected(imageNode))) return;
@@ -26097,6 +25917,7 @@ var WeaveImageNode = class extends WeaveNode {
26097
25917
  });
26098
25918
  }
26099
25919
  closeCrop = (imageNode, type) => {
25920
+ if (!this.config.cropMode.enabled) return;
26100
25921
  if (!this.imageCrop) return;
26101
25922
  const stage = this.instance.getStage();
26102
25923
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
@@ -26110,6 +25931,7 @@ var WeaveImageNode = class extends WeaveNode {
26110
25931
  }
26111
25932
  };
26112
25933
  resetCrop = (imageNode) => {
25934
+ if (!this.config.cropMode.enabled) return;
26113
25935
  const internalImage = imageNode.findOne(`#${imageNode.getAttrs().id}-image`);
26114
25936
  const cropGroup = imageNode.findOne(`#${imageNode.getAttrs().id}-cropGroup`);
26115
25937
  if (!internalImage || !cropGroup) return;
@@ -26153,19 +25975,21 @@ var WeaveImageNode = class extends WeaveNode {
26153
25975
  const image$1 = stage.findOne(`#${id}`);
26154
25976
  if (!image$1) return;
26155
25977
  };
26156
- image.triggerCrop = () => {
26157
- this.triggerCrop(image, { cmdCtrl: { triggered: false } });
26158
- };
26159
- image.closeCrop = (type) => {
26160
- this.closeCrop(image, type);
26161
- };
26162
- image.resetCrop = () => {
26163
- const stage = this.instance.getStage();
26164
- const image$1 = stage.findOne(`#${id}`);
26165
- if (!image$1) return;
26166
- const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
26167
- imageCrop.unCrop();
26168
- };
25978
+ if (this.config.cropMode.enabled) {
25979
+ image.triggerCrop = () => {
25980
+ this.triggerCrop(image, { cmdCtrl: { triggered: false } });
25981
+ };
25982
+ image.closeCrop = (type) => {
25983
+ this.closeCrop(image, type);
25984
+ };
25985
+ image.resetCrop = () => {
25986
+ const stage = this.instance.getStage();
25987
+ const image$1 = stage.findOne(`#${id}`);
25988
+ if (!image$1) return;
25989
+ const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
25990
+ imageCrop.unCrop();
25991
+ };
25992
+ }
26169
25993
  const defaultTransformerProperties = this.defaultGetTransformerProperties(this.config.transform);
26170
25994
  image.getTransformerProperties = function() {
26171
25995
  return defaultTransformerProperties;
@@ -26260,7 +26084,7 @@ var WeaveImageNode = class extends WeaveNode {
26260
26084
  };
26261
26085
  this.updateImageCrop(image);
26262
26086
  } else {
26263
- this.updatePlaceholderSize(image);
26087
+ this.updatePlaceholderSize(image, imagePlaceholder);
26264
26088
  this.loadImage(imageProps, image, true);
26265
26089
  }
26266
26090
  if (this.config.performance.cache.enabled) image.on("transformend", () => {
@@ -26272,24 +26096,26 @@ var WeaveImageNode = class extends WeaveNode {
26272
26096
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26273
26097
  }
26274
26098
  });
26275
- image.on("onCmdCtrlPressed", () => {
26276
- const transformer = this.getSelectionPlugin()?.getTransformer();
26277
- if (!transformer) return;
26278
- transformer.hide();
26279
- const utilityLayer = this.instance.getUtilityLayer();
26280
- if (!utilityLayer) return;
26281
- utilityLayer?.destroyChildren();
26282
- this.renderCropMode(utilityLayer, image);
26283
- utilityLayer?.show();
26284
- });
26285
- image.on("onCmdCtrlReleased", () => {
26286
- const transformer = this.getSelectionPlugin()?.getTransformer();
26287
- if (!transformer) return;
26288
- transformer.show();
26289
- const utilityLayer = this.instance.getUtilityLayer();
26290
- if (!utilityLayer) return;
26291
- utilityLayer?.destroyChildren();
26292
- });
26099
+ if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26100
+ image.on("onCmdCtrlPressed", () => {
26101
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26102
+ if (!transformer) return;
26103
+ transformer.hide();
26104
+ const utilityLayer = this.instance.getUtilityLayer();
26105
+ if (!utilityLayer) return;
26106
+ utilityLayer?.destroyChildren();
26107
+ this.renderCropMode(utilityLayer, image);
26108
+ utilityLayer?.show();
26109
+ });
26110
+ image.on("onCmdCtrlReleased", () => {
26111
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26112
+ if (!transformer) return;
26113
+ transformer.show();
26114
+ const utilityLayer = this.instance.getUtilityLayer();
26115
+ if (!utilityLayer) return;
26116
+ utilityLayer?.destroyChildren();
26117
+ });
26118
+ }
26293
26119
  image.on("onSelectionCleared", () => {
26294
26120
  const transformer = this.getSelectionPlugin()?.getTransformer();
26295
26121
  if (!transformer) return;
@@ -26343,6 +26169,7 @@ var WeaveImageNode = class extends WeaveNode {
26343
26169
  width: absoluteCorners[1].x - absoluteCorners[0].x,
26344
26170
  height: absoluteCorners[2].y - absoluteCorners[0].y,
26345
26171
  fill: "transparent",
26172
+ strokeScaleEnabled: false,
26346
26173
  strokeWidth: 2,
26347
26174
  stroke: "#1a1aff",
26348
26175
  draggable: false,
@@ -26355,13 +26182,6 @@ var WeaveImageNode = class extends WeaveNode {
26355
26182
  x: 1 / stageScale,
26356
26183
  y: 1 / stageScale
26357
26184
  });
26358
- stage.on("scaleXChange scaleYChange", () => {
26359
- const scale = stage.scaleX();
26360
- rect.scale({
26361
- x: 1 / scale,
26362
- y: 1 / scale
26363
- });
26364
- });
26365
26185
  }
26366
26186
  renderCropAnchor(position, node, layer, onClick) {
26367
26187
  const transform = node.getAbsoluteTransform().copy();
@@ -26647,7 +26467,7 @@ var WeaveImageNode = class extends WeaveNode {
26647
26467
  }
26648
26468
  this.loadAsyncElement(id);
26649
26469
  preloadFunction(id, realImageURL ?? "", {
26650
- onLoad: async () => {
26470
+ onLoad: () => {
26651
26471
  if (useFallback) this.imageTryoutIds[id] = setTimeout(() => {
26652
26472
  const node = this.instance.getStage().findOne(`#${id}`);
26653
26473
  if (node) {
@@ -26698,7 +26518,7 @@ var WeaveImageNode = class extends WeaveNode {
26698
26518
  error: false
26699
26519
  };
26700
26520
  this.updateImageCrop(image);
26701
- if (!useFallback) this.resolveAsyncElement(id);
26521
+ this.resolveAsyncElement(id);
26702
26522
  this.cacheNode(image);
26703
26523
  }
26704
26524
  },
@@ -26739,9 +26559,13 @@ var WeaveImageNode = class extends WeaveNode {
26739
26559
  }
26740
26560
  }, loadTryout);
26741
26561
  }
26742
- updatePlaceholderSize(image) {
26562
+ updatePlaceholderSize(image, imagePlaceholder) {
26743
26563
  const imageAttrs = image.getAttrs();
26744
26564
  if (!this.imageState[imageAttrs.id ?? ""]?.loaded) return;
26565
+ if (!imageAttrs.adding && !imageAttrs.cropInfo) {
26566
+ imagePlaceholder.width(imageAttrs.uncroppedImage.width);
26567
+ imagePlaceholder.height(imageAttrs.uncroppedImage.height);
26568
+ }
26745
26569
  }
26746
26570
  updateImageCrop(image) {
26747
26571
  const imageAttrs = image.getAttrs();
@@ -26875,7 +26699,6 @@ const WEAVE_STAR_NODE_TYPE = "star";
26875
26699
  //#region src/nodes/star/star.ts
26876
26700
  var WeaveStarNode = class extends WeaveNode {
26877
26701
  nodeType = WEAVE_STAR_NODE_TYPE;
26878
- initialize = void 0;
26879
26702
  constructor(params) {
26880
26703
  super();
26881
26704
  const { config } = params ?? {};
@@ -26961,7 +26784,6 @@ const WEAVE_ARROW_NODE_TYPE = "arrow";
26961
26784
  //#region src/nodes/arrow/arrow.ts
26962
26785
  var WeaveArrowNode = class extends WeaveNode {
26963
26786
  nodeType = WEAVE_ARROW_NODE_TYPE;
26964
- initialize = void 0;
26965
26787
  constructor(params) {
26966
26788
  super();
26967
26789
  const { config } = params ?? {};
@@ -27018,7 +26840,6 @@ const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
27018
26840
  //#region src/nodes/regular-polygon/regular-polygon.ts
27019
26841
  var WeaveRegularPolygonNode = class extends WeaveNode {
27020
26842
  nodeType = WEAVE_REGULAR_POLYGON_NODE_TYPE;
27021
- initialize = void 0;
27022
26843
  constructor(params) {
27023
26844
  super();
27024
26845
  const { config } = params ?? {};
@@ -27132,7 +26953,6 @@ var GroupFrame = class extends Konva.Group {
27132
26953
  //#region src/nodes/frame/frame.ts
27133
26954
  var WeaveFrameNode = class extends WeaveNode {
27134
26955
  nodeType = WEAVE_FRAME_NODE_TYPE;
27135
- initialize = void 0;
27136
26956
  constructor(params) {
27137
26957
  super();
27138
26958
  const { config } = params ?? {};
@@ -27433,7 +27253,6 @@ const WEAVE_STROKE_NODE_DEFAULT_CONFIG = {
27433
27253
  //#region src/nodes/stroke/stroke.ts
27434
27254
  var WeaveStrokeNode = class extends WeaveNode {
27435
27255
  nodeType = WEAVE_STROKE_NODE_TYPE;
27436
- initialize = void 0;
27437
27256
  constructor(params) {
27438
27257
  super();
27439
27258
  const { config } = params ?? {};
@@ -28010,6 +27829,8 @@ var WeaveSquareLineTipManager = class extends WeaveBaseLineTipManager {
28010
27829
  //#endregion
28011
27830
  //#region src/nodes/stroke-single/stroke-single.ts
28012
27831
  var WeaveStrokeSingleNode = class extends WeaveNode {
27832
+ startHandle = null;
27833
+ endHandle = null;
28013
27834
  nodeType = WEAVE_STROKE_SINGLE_NODE_TYPE;
28014
27835
  tipManagers = {
28015
27836
  [WEAVE_STROKE_SINGLE_NODE_TIP_TYPE.ARROW]: new WeaveArrowLineTipManager(),
@@ -28020,29 +27841,24 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28020
27841
  constructor(params) {
28021
27842
  super();
28022
27843
  this.config = mergeExceptArrays(WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, params?.config ?? {});
27844
+ this.handleNodeChanges = null;
27845
+ this.handleZoomChanges = null;
27846
+ this.shiftPressed = false;
28023
27847
  this.snapper = new GreedySnapper({
28024
27848
  snapAngles: this.config.snapAngles.angles,
28025
27849
  activateThreshold: this.config.snapAngles.activateThreshold,
28026
27850
  releaseThreshold: this.config.snapAngles.releaseThreshold
28027
27851
  });
28028
- this.initialize();
28029
- }
28030
- initialize() {
28031
27852
  this.eventsInitialized = false;
28032
- this.startHandle = null;
28033
- this.endHandle = null;
28034
- this.handleNodeChanges = null;
28035
- this.handleZoomChanges = null;
28036
- this.shiftPressed = false;
28037
27853
  }
28038
27854
  initEvents() {
28039
27855
  if (this.eventsInitialized) return;
28040
27856
  window.addEventListener("keydown", (e) => {
28041
27857
  if (e.key === "Shift") this.shiftPressed = true;
28042
- }, { signal: this.instance.getEventsController()?.signal });
27858
+ });
28043
27859
  window.addEventListener("keyup", (e) => {
28044
27860
  if (e.key === "Shift") this.shiftPressed = false;
28045
- }, { signal: this.instance.getEventsController()?.signal });
27861
+ });
28046
27862
  this.eventsInitialized = true;
28047
27863
  }
28048
27864
  onRender(props) {
@@ -28529,9 +28345,6 @@ var WeaveCommentNode = class extends WeaveNode {
28529
28345
  constructor(params) {
28530
28346
  super();
28531
28347
  this.config = mergeExceptArrays(WEAVE_COMMENT_NODE_DEFAULTS, params.config);
28532
- this.initialize();
28533
- }
28534
- initialize() {
28535
28348
  this.commentDomVisibleId = null;
28536
28349
  this.commentDomVisible = false;
28537
28350
  this.commentDomAction = null;
@@ -29160,6 +28973,10 @@ const WEAVE_VIDEO_DEFAULT_CONFIG = {
29160
28973
  //#endregion
29161
28974
  //#region src/nodes/video/video.ts
29162
28975
  var WeaveVideoNode = class extends WeaveNode {
28976
+ videoState = {};
28977
+ videoSourceFrameId = {};
28978
+ videoSource = {};
28979
+ videoPlaceholder = {};
29163
28980
  nodeType = WEAVE_VIDEO_NODE_TYPE;
29164
28981
  constructor(params) {
29165
28982
  super();
@@ -29172,13 +28989,6 @@ var WeaveVideoNode = class extends WeaveNode {
29172
28989
  this.videoIconImage.src = this.config.style.icon.dataURL;
29173
28990
  }
29174
28991
  }
29175
- initialize() {
29176
- this.videoState = {};
29177
- this.videoSource = {};
29178
- this.videoSourceFrameId = {};
29179
- this.videoPlaceholder = {};
29180
- this.videoIconImage = void 0;
29181
- }
29182
28992
  async loadPlaceholder(params, video) {
29183
28993
  const videoProps = params;
29184
28994
  const { id } = videoProps;
@@ -29673,7 +29483,6 @@ const WEAVE_MEASURE_NODE_DEFAULT_CONFIG = { style: {
29673
29483
  var WeaveMeasureNode = class extends WeaveNode {
29674
29484
  nodeType = WEAVE_MEASURE_NODE_TYPE;
29675
29485
  handlePointCircleRadius = 6;
29676
- initialize = void 0;
29677
29486
  constructor(params) {
29678
29487
  super();
29679
29488
  this.config = mergeExceptArrays(WEAVE_MEASURE_NODE_DEFAULT_CONFIG, params?.config ?? {});
@@ -30964,7 +30773,6 @@ var WeaveConnectorNode = class extends WeaveNode {
30964
30773
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.DOT]: setupNodeDecoratorDot,
30965
30774
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.ARROW]: setupNodeDecoratorArrow
30966
30775
  };
30967
- initialize = void 0;
30968
30776
  constructor(params) {
30969
30777
  super();
30970
30778
  this.config = mergeExceptArrays(WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, params?.config);
@@ -31715,6 +31523,10 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
31715
31523
  var WeaveStageZoomPlugin = class extends WeavePlugin {
31716
31524
  getLayerName = void 0;
31717
31525
  initLayer = void 0;
31526
+ pinching = false;
31527
+ zooming = false;
31528
+ isTrackpad = false;
31529
+ zoomVelocity = 0;
31718
31530
  zoomInertiaType = WEAVE_STAGE_ZOOM_TYPE.MOUSE_WHEEL;
31719
31531
  defaultStep = 3;
31720
31532
  constructor(params) {
@@ -31722,13 +31534,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
31722
31534
  const { config } = params ?? {};
31723
31535
  this.config = mergeExceptArrays(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
31724
31536
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
31725
- this.initialize();
31726
- }
31727
- initialize() {
31728
31537
  this.pinching = false;
31729
- this.zooming = false;
31730
31538
  this.isTrackpad = false;
31731
- this.zoomVelocity = 0;
31732
31539
  this.isCtrlOrMetaPressed = false;
31733
31540
  this.updatedMinimumZoom = false;
31734
31541
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
@@ -32015,15 +31822,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32015
31822
  if (box.width === 0 || box.height === 0) return;
32016
31823
  this.fitToElements(box, finalOptions);
32017
31824
  }
32018
- fitToArea(area, options) {
32019
- const finalOptions = mergeExceptArrays({
32020
- smartZoom: false,
32021
- overrideZoom: true
32022
- }, options);
32023
- if (!this.enabled) return;
32024
- if (area.width === 0 || area.height === 0) return;
32025
- this.fitToElements(area, finalOptions);
32026
- }
32027
31825
  enable() {
32028
31826
  this.enabled = true;
32029
31827
  }
@@ -32042,10 +31840,10 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32042
31840
  initEvents() {
32043
31841
  window.addEventListener("keydown", (e) => {
32044
31842
  if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32045
- }, { signal: this.instance.getEventsController()?.signal });
31843
+ });
32046
31844
  window.addEventListener("keyup", (e) => {
32047
31845
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32048
- }, { signal: this.instance.getEventsController()?.signal });
31846
+ });
32049
31847
  const stage = this.instance.getStage();
32050
31848
  let lastCenter = null;
32051
31849
  let lastDist = 0;
@@ -32070,10 +31868,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32070
31868
  return;
32071
31869
  }
32072
31870
  }
32073
- }, {
32074
- passive: false,
32075
- signal: this.instance.getEventsController()?.signal
32076
- });
31871
+ }, { passive: false });
32077
31872
  stage.getContent().addEventListener("touchmove", (e) => {
32078
31873
  e.preventDefault();
32079
31874
  if (e.touches.length === 2) {
@@ -32113,18 +31908,12 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32113
31908
  lastDist = dist;
32114
31909
  lastCenter = newCenter;
32115
31910
  }
32116
- }, {
32117
- passive: false,
32118
- signal: this.instance.getEventsController()?.signal
32119
- });
31911
+ }, { passive: false });
32120
31912
  stage.getContent().addEventListener("touchend", () => {
32121
31913
  this.pinching = false;
32122
31914
  lastDist = 0;
32123
31915
  lastCenter = null;
32124
- }, {
32125
- passive: false,
32126
- signal: this.instance.getEventsController()?.signal
32127
- });
31916
+ }, { passive: false });
32128
31917
  let doZoom = false;
32129
31918
  const handleWheelImmediate = (e) => {
32130
31919
  const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
@@ -32142,10 +31931,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32142
31931
  e.preventDefault();
32143
31932
  doZoom = true;
32144
31933
  };
32145
- window.addEventListener("wheel", handleWheelImmediate, {
32146
- signal: this.instance.getEventsController()?.signal,
32147
- passive: false
32148
- });
31934
+ window.addEventListener("wheel", handleWheelImmediate, { passive: false });
32149
31935
  const handleWheel = (e) => {
32150
31936
  if (!doZoom) return;
32151
31937
  const delta = e.deltaY > 0 ? 1 : -1;
@@ -32158,10 +31944,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32158
31944
  }
32159
31945
  };
32160
31946
  const throttledHandleWheel = (0, import_lodash.throttle)(handleWheel, DEFAULT_THROTTLE_MS);
32161
- window.addEventListener("wheel", throttledHandleWheel, {
32162
- signal: this.instance.getEventsController()?.signal,
32163
- passive: true
32164
- });
31947
+ window.addEventListener("wheel", throttledHandleWheel, { passive: true });
32165
31948
  }
32166
31949
  getInertiaScale() {
32167
31950
  const stage = this.instance.getStage();
@@ -32219,7 +32002,6 @@ const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
32219
32002
  //#region src/actions/zoom-out-tool/zoom-out-tool.ts
32220
32003
  var WeaveZoomOutToolAction = class extends WeaveAction {
32221
32004
  onPropsChange = void 0;
32222
- initialize = void 0;
32223
32005
  getName() {
32224
32006
  return ZOOM_OUT_TOOL_ACTION_NAME;
32225
32007
  }
@@ -32254,10 +32036,6 @@ const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
32254
32036
  //#region src/actions/zoom-in-tool/zoom-in-tool.ts
32255
32037
  var WeaveZoomInToolAction = class extends WeaveAction {
32256
32038
  onPropsChange = void 0;
32257
- initialize = void 0;
32258
- constructor() {
32259
- super();
32260
- }
32261
32039
  getName() {
32262
32040
  return ZOOM_IN_TOOL_ACTION_NAME;
32263
32041
  }
@@ -32292,10 +32070,6 @@ const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
32292
32070
  //#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
32293
32071
  var WeaveFitToScreenToolAction = class extends WeaveAction {
32294
32072
  onPropsChange = void 0;
32295
- initialize = void 0;
32296
- constructor() {
32297
- super();
32298
- }
32299
32073
  getName() {
32300
32074
  return FIT_TO_SCREEN_TOOL_ACTION_NAME;
32301
32075
  }
@@ -32329,10 +32103,6 @@ const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
32329
32103
  //#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
32330
32104
  var WeaveFitToSelectionToolAction = class extends WeaveAction {
32331
32105
  onPropsChange = void 0;
32332
- initialize = void 0;
32333
- constructor() {
32334
- super();
32335
- }
32336
32106
  getName() {
32337
32107
  return FIT_TO_SELECTION_TOOL_ACTION_NAME;
32338
32108
  }
@@ -32375,9 +32145,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
32375
32145
  onInit = void 0;
32376
32146
  constructor() {
32377
32147
  super();
32378
- this.initialize();
32379
- }
32380
- initialize() {
32381
32148
  this.initialized = false;
32382
32149
  this.state = MOVE_TOOL_STATE.IDLE;
32383
32150
  }
@@ -32391,7 +32158,7 @@ var WeaveMoveToolAction = class extends WeaveAction {
32391
32158
  this.cancelAction();
32392
32159
  return;
32393
32160
  }
32394
- }, { signal: this.instance.getEventsController()?.signal });
32161
+ });
32395
32162
  stage.on("pointerdown", () => {
32396
32163
  if ([MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
32397
32164
  });
@@ -32450,9 +32217,6 @@ var WeaveSelectionToolAction = class extends WeaveAction {
32450
32217
  onInit = void 0;
32451
32218
  constructor() {
32452
32219
  super();
32453
- this.initialize();
32454
- }
32455
- initialize() {
32456
32220
  this.initialized = false;
32457
32221
  this.state = SELECTION_TOOL_STATE.IDLE;
32458
32222
  }
@@ -32516,9 +32280,6 @@ var WeaveEraserToolAction = class extends WeaveAction {
32516
32280
  onInit = void 0;
32517
32281
  constructor() {
32518
32282
  super();
32519
- this.initialize();
32520
- }
32521
- initialize() {
32522
32283
  this.initialized = false;
32523
32284
  this.erasing = false;
32524
32285
  this.state = ERASER_TOOL_STATE.IDLE;
@@ -32552,7 +32313,7 @@ var WeaveEraserToolAction = class extends WeaveAction {
32552
32313
  this.cancelAction();
32553
32314
  return;
32554
32315
  }
32555
- }, { signal: this.instance.getEventsController()?.signal });
32316
+ });
32556
32317
  this.initialized = true;
32557
32318
  }
32558
32319
  setState(state) {
@@ -32619,9 +32380,6 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32619
32380
  onInit = void 0;
32620
32381
  constructor() {
32621
32382
  super();
32622
- this.initialize();
32623
- }
32624
- initialize() {
32625
32383
  this.pointers = new Map();
32626
32384
  this.initialized = false;
32627
32385
  this.state = RECTANGLE_TOOL_STATE.IDLE;
@@ -32657,7 +32415,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32657
32415
  this.cancelAction();
32658
32416
  return;
32659
32417
  }
32660
- }, { signal: this.instance.getEventsController()?.signal });
32418
+ });
32661
32419
  stage.on("pointermove", () => {
32662
32420
  if (this.state === RECTANGLE_TOOL_STATE.IDLE) return;
32663
32421
  this.setCursor();
@@ -32831,9 +32589,6 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32831
32589
  onInit = void 0;
32832
32590
  constructor() {
32833
32591
  super();
32834
- this.initialize();
32835
- }
32836
- initialize() {
32837
32592
  this.pointers = new Map();
32838
32593
  this.initialized = false;
32839
32594
  this.state = ELLIPSE_TOOL_STATE.IDLE;
@@ -32869,7 +32624,7 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32869
32624
  this.cancelAction();
32870
32625
  return;
32871
32626
  }
32872
- }, { signal: this.instance.getEventsController()?.signal });
32627
+ });
32873
32628
  stage.on("pointerdown", (e) => {
32874
32629
  this.setTapStart(e);
32875
32630
  this.pointers.set(e.evt.pointerId, {
@@ -33050,9 +32805,6 @@ var WeavePenToolAction = class extends WeaveAction {
33050
32805
  onInit = void 0;
33051
32806
  constructor() {
33052
32807
  super();
33053
- this.initialize();
33054
- }
33055
- initialize() {
33056
32808
  this.pointers = new Map();
33057
32809
  this.initialized = false;
33058
32810
  this.state = PEN_TOOL_STATE.IDLE;
@@ -33088,7 +32840,7 @@ var WeavePenToolAction = class extends WeaveAction {
33088
32840
  this.cancelAction();
33089
32841
  return;
33090
32842
  }
33091
- }, { signal: this.instance.getEventsController()?.signal });
32843
+ });
33092
32844
  stage.on("pointerdown", (e) => {
33093
32845
  this.setTapStart(e);
33094
32846
  this.pointers.set(e.evt.pointerId, {
@@ -33325,9 +33077,6 @@ var WeaveLineToolAction = class extends WeaveAction {
33325
33077
  constructor(params) {
33326
33078
  super();
33327
33079
  this.config = mergeExceptArrays(LINE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33328
- this.initialize();
33329
- }
33330
- initialize() {
33331
33080
  this.pointers = new Map();
33332
33081
  this.initialized = false;
33333
33082
  this.state = LINE_TOOL_STATE.IDLE;
@@ -33372,13 +33121,13 @@ var WeaveLineToolAction = class extends WeaveAction {
33372
33121
  this.snappedAngle = null;
33373
33122
  this.shiftPressed = true;
33374
33123
  }
33375
- }, { signal: this.instance.getEventsController()?.signal });
33124
+ });
33376
33125
  window.addEventListener("keyup", (e) => {
33377
33126
  if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
33378
33127
  this.snappedAngle = null;
33379
33128
  this.shiftPressed = false;
33380
33129
  }
33381
- }, { signal: this.instance.getEventsController()?.signal });
33130
+ });
33382
33131
  stage.on("pointerdown", (e) => {
33383
33132
  this.setTapStart(e);
33384
33133
  this.pointers.set(e.evt.pointerId, {
@@ -33593,9 +33342,6 @@ var WeaveBrushToolAction = class extends WeaveAction {
33593
33342
  constructor(params) {
33594
33343
  super();
33595
33344
  this.config = mergeExceptArrays(BRUSH_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33596
- this.initialize();
33597
- }
33598
- initialize() {
33599
33345
  this.initialized = false;
33600
33346
  this.state = BRUSH_TOOL_STATE.INACTIVE;
33601
33347
  this.strokeId = null;
@@ -33624,7 +33370,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33624
33370
  const stage = this.instance.getStage();
33625
33371
  window.addEventListener("keyup", (e) => {
33626
33372
  if (e.code === "Space" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) this.isSpacePressed = false;
33627
- }, { signal: this.instance.getEventsController()?.signal });
33373
+ });
33628
33374
  window.addEventListener("keydown", (e) => {
33629
33375
  if (e.code === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
33630
33376
  e.stopPropagation();
@@ -33640,7 +33386,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33640
33386
  e.stopPropagation();
33641
33387
  this.cancelAction();
33642
33388
  }
33643
- }, { signal: this.instance.getEventsController()?.signal });
33389
+ });
33644
33390
  const handlePointerDown = (e) => {
33645
33391
  if (this.state === BRUSH_TOOL_STATE.INACTIVE) return;
33646
33392
  if (this.state !== BRUSH_TOOL_STATE.IDLE) return;
@@ -33849,9 +33595,6 @@ var WeaveTextToolAction = class extends WeaveAction {
33849
33595
  onInit = void 0;
33850
33596
  constructor() {
33851
33597
  super();
33852
- this.initialize();
33853
- }
33854
- initialize() {
33855
33598
  this.initialized = false;
33856
33599
  this.state = TEXT_TOOL_STATE.IDLE;
33857
33600
  this.textId = null;
@@ -33881,7 +33624,7 @@ var WeaveTextToolAction = class extends WeaveAction {
33881
33624
  this.cancelAction();
33882
33625
  return;
33883
33626
  }
33884
- }, { signal: this.instance.getEventsController()?.signal });
33627
+ });
33885
33628
  stage.on("pointermove", () => {
33886
33629
  if (this.state === TEXT_TOOL_STATE.IDLE) return;
33887
33630
  this.setCursor();
@@ -34009,9 +33752,6 @@ var WeaveImageToolAction = class extends WeaveAction {
34009
33752
  constructor(params) {
34010
33753
  super();
34011
33754
  this.config = mergeExceptArrays(WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, params?.config ?? {});
34012
- this.initialize();
34013
- }
34014
- initialize() {
34015
33755
  this.pointers = new Map();
34016
33756
  this.initialized = false;
34017
33757
  this.imageId = null;
@@ -34055,7 +33795,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34055
33795
  this.cancelAction();
34056
33796
  return;
34057
33797
  }
34058
- }, { signal: this.instance.getEventsController()?.signal });
33798
+ });
34059
33799
  stage.on("pointerdown", (e) => {
34060
33800
  this.setTapStart(e);
34061
33801
  if (this.ignorePointerEvents) return;
@@ -34452,9 +34192,6 @@ var WeaveImagesToolAction = class extends WeaveAction {
34452
34192
  constructor(params) {
34453
34193
  super();
34454
34194
  this.config = mergeExceptArrays(WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, params ?? {});
34455
- this.initialize();
34456
- }
34457
- initialize() {
34458
34195
  this.pointers = new Map();
34459
34196
  this.initialized = false;
34460
34197
  this.tempPointerFeedbackNode = null;
@@ -34501,7 +34238,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34501
34238
  const stage = this.instance.getStage();
34502
34239
  stage.container().addEventListener("keydown", (e) => {
34503
34240
  if (e.key === "Escape" && this.instance.getActiveAction() === WEAVE_IMAGES_TOOL_ACTION_NAME) this.cancelAction();
34504
- }, { signal: this.instance.getEventsController()?.signal });
34241
+ });
34505
34242
  stage.on("pointerdown", (e) => {
34506
34243
  this.setTapStart(e);
34507
34244
  this.pointers.set(e.evt.pointerId, {
@@ -34883,9 +34620,6 @@ var WeaveStarToolAction = class extends WeaveAction {
34883
34620
  onInit = void 0;
34884
34621
  constructor() {
34885
34622
  super();
34886
- this.initialize();
34887
- }
34888
- initialize() {
34889
34623
  this.pointers = new Map();
34890
34624
  this.initialized = false;
34891
34625
  this.state = STAR_TOOL_STATE.IDLE;
@@ -34922,7 +34656,7 @@ var WeaveStarToolAction = class extends WeaveAction {
34922
34656
  this.cancelAction();
34923
34657
  return;
34924
34658
  }
34925
- }, { signal: this.instance.getEventsController()?.signal });
34659
+ });
34926
34660
  stage.on("pointerdown", (e) => {
34927
34661
  this.setTapStart(e);
34928
34662
  this.pointers.set(e.evt.pointerId, {
@@ -35087,8 +34821,8 @@ var WeaveStarToolAction = class extends WeaveAction {
35087
34821
 
35088
34822
  //#endregion
35089
34823
  //#region src/actions/arrow-tool/constants.ts
35090
- const WEAVE_ARROW_TOOL_ACTION_NAME = "arrowTool";
35091
- const WEAVE_ARROW_TOOL_STATE = {
34824
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
34825
+ const ARROW_TOOL_STATE = {
35092
34826
  ["IDLE"]: "idle",
35093
34827
  ["ADDING"]: "adding",
35094
34828
  ["DEFINING_SIZE"]: "definingSize",
@@ -35104,12 +34838,9 @@ var WeaveArrowToolAction = class extends WeaveAction {
35104
34838
  onInit = void 0;
35105
34839
  constructor() {
35106
34840
  super();
35107
- this.initialize();
35108
- }
35109
- initialize() {
35110
34841
  this.pointers = new Map();
35111
34842
  this.initialized = false;
35112
- this.state = WEAVE_ARROW_TOOL_STATE.IDLE;
34843
+ this.state = ARROW_TOOL_STATE.IDLE;
35113
34844
  this.arrowId = null;
35114
34845
  this.tempArrowId = null;
35115
34846
  this.tempMainArrowNode = null;
@@ -35122,7 +34853,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35122
34853
  this.props = this.initProps();
35123
34854
  }
35124
34855
  getName() {
35125
- return WEAVE_ARROW_TOOL_ACTION_NAME;
34856
+ return ARROW_TOOL_ACTION_NAME;
35126
34857
  }
35127
34858
  initProps() {
35128
34859
  return {
@@ -35139,37 +34870,40 @@ var WeaveArrowToolAction = class extends WeaveAction {
35139
34870
  setupEvents() {
35140
34871
  const stage = this.instance.getStage();
35141
34872
  window.addEventListener("keydown", (e) => {
35142
- if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
34873
+ if (e.code === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
35143
34874
  this.cancelAction();
35144
34875
  return;
35145
34876
  }
35146
- if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) this.cancelAction();
35147
- }, { signal: this.instance.getEventsController()?.signal });
34877
+ if (e.code === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34878
+ this.cancelAction();
34879
+ return;
34880
+ }
34881
+ });
35148
34882
  stage.on("pointerdown", (e) => {
35149
34883
  this.setTapStart(e);
35150
34884
  this.pointers.set(e.evt.pointerId, {
35151
34885
  x: e.evt.clientX,
35152
34886
  y: e.evt.clientY
35153
34887
  });
35154
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35155
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34888
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34889
+ this.state = ARROW_TOOL_STATE.ADDING;
35156
34890
  return;
35157
34891
  }
35158
- if (!this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.handleAdding();
35159
- if (this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.state = WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE;
34892
+ if (!this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.handleAdding();
34893
+ if (this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.state = ARROW_TOOL_STATE.DEFINING_SIZE;
35160
34894
  });
35161
34895
  stage.on("pointermove", () => {
35162
- if (this.state === WEAVE_ARROW_TOOL_STATE.IDLE) return;
34896
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
35163
34897
  this.setCursor();
35164
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35165
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34898
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34899
+ this.state = ARROW_TOOL_STATE.ADDING;
35166
34900
  return;
35167
34901
  }
35168
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
34902
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
35169
34903
  });
35170
34904
  stage.on("pointerup", (e) => {
35171
34905
  this.pointers.delete(e.evt.pointerId);
35172
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
34906
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
35173
34907
  });
35174
34908
  this.initialized = true;
35175
34909
  }
@@ -35183,7 +34917,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35183
34917
  this.tempPoint = void 0;
35184
34918
  this.tempNextPoint = void 0;
35185
34919
  this.clickPoint = null;
35186
- this.setState(WEAVE_ARROW_TOOL_STATE.ADDING);
34920
+ this.setState(ARROW_TOOL_STATE.ADDING);
35187
34921
  }
35188
34922
  handleAdding() {
35189
34923
  const stage = this.instance.getStage();
@@ -35234,7 +34968,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35234
34968
  this.measureContainer?.add(this.tempNextPoint);
35235
34969
  this.tempPoint.moveToTop();
35236
34970
  this.tempNextPoint.moveToTop();
35237
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34971
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35238
34972
  }
35239
34973
  }
35240
34974
  handleSettingSize() {
@@ -35261,11 +34995,11 @@ var WeaveArrowToolAction = class extends WeaveAction {
35261
34995
  y: mousePoint.y,
35262
34996
  points: [0, 0]
35263
34997
  });
35264
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34998
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35265
34999
  }
35266
35000
  }
35267
35001
  handleMovement() {
35268
- if (this.state !== WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) return;
35002
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
35269
35003
  if (this.arrowId && this.tempArrowNode && this.measureContainer && this.tempNextPoint) {
35270
35004
  const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
35271
35005
  this.tempArrowNode.setAttrs({
@@ -35332,7 +35066,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35332
35066
  this.container = void 0;
35333
35067
  this.measureContainer = void 0;
35334
35068
  this.clickPoint = null;
35335
- this.setState(WEAVE_ARROW_TOOL_STATE.IDLE);
35069
+ this.setState(ARROW_TOOL_STATE.IDLE);
35336
35070
  }
35337
35071
  setCursor() {
35338
35072
  const stage = this.instance.getStage();
@@ -35376,15 +35110,13 @@ const WEAVE_STROKE_TOOL_DEFAULT_CONFIG = { snapAngles: {
35376
35110
  var WeaveStrokeToolAction = class extends WeaveAction {
35377
35111
  initialized = false;
35378
35112
  initialCursor = null;
35113
+ snappedAngle = null;
35379
35114
  shiftPressed = false;
35380
35115
  onPropsChange = void 0;
35381
35116
  onInit = void 0;
35382
35117
  constructor(params) {
35383
35118
  super();
35384
35119
  this.config = mergeExceptArrays(WEAVE_STROKE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
35385
- this.initialize();
35386
- }
35387
- initialize() {
35388
35120
  this.pointers = new Map();
35389
35121
  this.initialized = false;
35390
35122
  this.state = WEAVE_STROKE_TOOL_STATE.IDLE;
@@ -35393,6 +35125,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35393
35125
  this.tempLineId = null;
35394
35126
  this.tempLineNode = null;
35395
35127
  this.container = void 0;
35128
+ this.snappedAngle = null;
35396
35129
  this.measureContainer = void 0;
35397
35130
  this.clickPoint = null;
35398
35131
  this.snapper = new GreedySnapper({
@@ -35405,9 +35138,6 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35405
35138
  getName() {
35406
35139
  return WEAVE_STROKE_TOOL_ACTION_NAME;
35407
35140
  }
35408
- getNames() {
35409
- return [WEAVE_STROKE_TOOL_ACTION_NAME, ...WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES];
35410
- }
35411
35141
  hasAliases() {
35412
35142
  return true;
35413
35143
  }
@@ -35426,26 +35156,32 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35426
35156
  setupEvents() {
35427
35157
  const stage = this.instance.getStage();
35428
35158
  window.addEventListener("keydown", (e) => {
35429
- if (e.code === "Enter" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35159
+ if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35430
35160
  this.cancelAction();
35431
35161
  return;
35432
35162
  }
35433
- if (e.code === "Escape" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35163
+ if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35434
35164
  this.cancelAction();
35435
35165
  return;
35436
35166
  }
35437
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = true;
35438
- }, { signal: this.instance.getEventsController()?.signal });
35167
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35168
+ this.snappedAngle = null;
35169
+ this.shiftPressed = true;
35170
+ }
35171
+ });
35439
35172
  window.addEventListener("keyup", (e) => {
35440
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = false;
35441
- }, { signal: this.instance.getEventsController()?.signal });
35173
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35174
+ this.snappedAngle = null;
35175
+ this.shiftPressed = false;
35176
+ }
35177
+ });
35442
35178
  stage.on("pointerdown", (e) => {
35443
35179
  this.setTapStart(e);
35444
35180
  this.pointers.set(e.evt.pointerId, {
35445
35181
  x: e.evt.clientX,
35446
35182
  y: e.evt.clientY
35447
35183
  });
35448
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35184
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35449
35185
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35450
35186
  return;
35451
35187
  }
@@ -35455,7 +35191,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35455
35191
  stage.on("pointermove", () => {
35456
35192
  if (this.state === WEAVE_STROKE_TOOL_STATE.IDLE) return;
35457
35193
  this.setCursor();
35458
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35194
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35459
35195
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35460
35196
  return;
35461
35197
  }
@@ -35473,7 +35209,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35473
35209
  addLine() {
35474
35210
  this.setCursor();
35475
35211
  this.setFocusStage();
35476
- this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35212
+ this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35477
35213
  this.shiftPressed = false;
35478
35214
  this.clickPoint = null;
35479
35215
  this.setState(WEAVE_STROKE_TOOL_STATE.ADDING);
@@ -35581,7 +35317,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35581
35317
  });
35582
35318
  delete finalLine.props.dragBoundFunc;
35583
35319
  this.instance.addNode(finalLine, this.container?.getAttrs().id);
35584
- this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35320
+ this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35585
35321
  nodeCreated = true;
35586
35322
  }
35587
35323
  }
@@ -35631,9 +35367,6 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35631
35367
  onInit = void 0;
35632
35368
  constructor() {
35633
35369
  super();
35634
- this.initialize();
35635
- }
35636
- initialize() {
35637
35370
  this.pointers = new Map();
35638
35371
  this.initialized = false;
35639
35372
  this.state = REGULAR_POLYGON_TOOL_STATE.IDLE;
@@ -35668,7 +35401,7 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35668
35401
  this.cancelAction();
35669
35402
  return;
35670
35403
  }
35671
- }, { signal: this.instance.getEventsController()?.signal });
35404
+ });
35672
35405
  stage.on("pointerdown", (e) => {
35673
35406
  this.setTapStart(e);
35674
35407
  this.pointers.set(e.evt.pointerId, {
@@ -35842,9 +35575,6 @@ var WeaveFrameToolAction = class extends WeaveAction {
35842
35575
  onInit = void 0;
35843
35576
  constructor() {
35844
35577
  super();
35845
- this.initialize();
35846
- }
35847
- initialize() {
35848
35578
  this.initialized = false;
35849
35579
  this.state = FRAME_TOOL_STATE.IDLE;
35850
35580
  this.frameId = null;
@@ -35872,7 +35602,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
35872
35602
  this.cancelAction();
35873
35603
  return;
35874
35604
  }
35875
- }, { signal: this.instance.getEventsController()?.signal });
35605
+ });
35876
35606
  stage.on("pointermove", () => {
35877
35607
  if (this.state === FRAME_TOOL_STATE.IDLE) return;
35878
35608
  this.setCursor();
@@ -35974,10 +35704,6 @@ var WeaveExportStageToolAction = class extends WeaveAction {
35974
35704
  };
35975
35705
  onPropsChange = void 0;
35976
35706
  onInit = void 0;
35977
- initialize = void 0;
35978
- constructor() {
35979
- super();
35980
- }
35981
35707
  getName() {
35982
35708
  return EXPORT_STAGE_TOOL_ACTION_NAME;
35983
35709
  }
@@ -36025,10 +35751,6 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
36025
35751
  };
36026
35752
  onPropsChange = void 0;
36027
35753
  onInit = void 0;
36028
- initialize = void 0;
36029
- constructor() {
36030
- super();
36031
- }
36032
35754
  getName() {
36033
35755
  return EXPORT_NODES_TOOL_ACTION_NAME;
36034
35756
  }
@@ -36081,9 +35803,6 @@ var WeaveAlignNodesToolAction = class extends WeaveAction {
36081
35803
  onInit = void 0;
36082
35804
  constructor() {
36083
35805
  super();
36084
- this.initialize();
36085
- }
36086
- initialize() {
36087
35806
  this.initialized = false;
36088
35807
  this.state = ALIGN_NODES_TOOL_STATE.IDLE;
36089
35808
  }
@@ -36333,9 +36052,6 @@ var WeaveCommentToolAction = class extends WeaveAction {
36333
36052
  super();
36334
36053
  const { config } = params ?? {};
36335
36054
  this.config = mergeExceptArrays(WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, config);
36336
- this.initialize();
36337
- }
36338
- initialize() {
36339
36055
  this.pointers = new Map();
36340
36056
  this.initialized = false;
36341
36057
  this.state = WEAVE_COMMENT_TOOL_STATE.IDLE;
@@ -36413,7 +36129,7 @@ var WeaveCommentToolAction = class extends WeaveAction {
36413
36129
  return;
36414
36130
  }
36415
36131
  if (e.code === "Escape" && this.state === WEAVE_COMMENT_TOOL_STATE.CREATING_COMMENT) this.setState(WEAVE_COMMENT_TOOL_STATE.ADDING);
36416
- }, { signal: this.instance.getEventsController()?.signal });
36132
+ });
36417
36133
  stage.on("pointermove", (e) => {
36418
36134
  if (this.state === WEAVE_COMMENT_TOOL_STATE.IDLE) return;
36419
36135
  if (commentNodeHandler?.isCommentViewing()) {
@@ -36564,9 +36280,6 @@ var WeaveVideoToolAction = class extends WeaveAction {
36564
36280
  update = void 0;
36565
36281
  constructor() {
36566
36282
  super();
36567
- this.initialize();
36568
- }
36569
- initialize() {
36570
36283
  this.pointers = new Map();
36571
36284
  this.initialized = false;
36572
36285
  this.state = VIDEO_TOOL_STATE.IDLE;
@@ -36613,7 +36326,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
36613
36326
  this.cancelAction();
36614
36327
  return;
36615
36328
  }
36616
- }, { signal: this.instance.getEventsController()?.signal });
36329
+ });
36617
36330
  stage.on("pointerdown", (e) => {
36618
36331
  this.setTapStart(e);
36619
36332
  this.pointers.set(e.evt.pointerId, {
@@ -36792,9 +36505,6 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36792
36505
  constructor(params) {
36793
36506
  super();
36794
36507
  this.config = mergeExceptArrays(WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
36795
- this.initialize();
36796
- }
36797
- initialize() {
36798
36508
  this.initialized = false;
36799
36509
  this.state = MEASURE_TOOL_STATE.IDLE;
36800
36510
  this.measureId = null;
@@ -36821,7 +36531,7 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36821
36531
  const stage = this.instance.getStage();
36822
36532
  window.addEventListener("keydown", (e) => {
36823
36533
  if (e.code === "Escape" && this.instance.getActiveAction() === MEASURE_TOOL_ACTION_NAME) this.cancelAction();
36824
- }, { signal: this.instance.getEventsController()?.signal });
36534
+ });
36825
36535
  stage.on("pointermove", () => {
36826
36536
  if (this.state === MEASURE_TOOL_STATE.IDLE) return;
36827
36537
  if (this.state === MEASURE_TOOL_STATE.SET_TO) {
@@ -37091,9 +36801,6 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37091
36801
  constructor(params) {
37092
36802
  super();
37093
36803
  this.config = mergeExceptArrays(CONNECTOR_TOOL_DEFAULT_CONFIG, params?.config);
37094
- this.initialize();
37095
- }
37096
- initialize() {
37097
36804
  this.pointers = new Map();
37098
36805
  this.initialized = false;
37099
36806
  this.tempLineNode = null;
@@ -37132,7 +36839,7 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37132
36839
  return;
37133
36840
  }
37134
36841
  if (e.code === "Escape" && this.instance.getActiveAction() === CONNECTOR_TOOL_ACTION_NAME) this.cancelAction();
37135
- }, { signal: this.instance.getEventsController()?.signal });
36842
+ });
37136
36843
  let nodeHovered = void 0;
37137
36844
  stage.on("pointermove", () => {
37138
36845
  if (!(this.state === CONNECTOR_TOOL_STATE.SELECTING_INITIAL || this.state === CONNECTOR_TOOL_STATE.SELECTING_FINAL)) return;
@@ -37447,17 +37154,18 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37447
37154
  //#endregion
37448
37155
  //#region src/plugins/stage-grid/stage-grid.ts
37449
37156
  var WeaveStageGridPlugin = class extends WeavePlugin {
37157
+ actStageZoomX = 1;
37158
+ actStageZoomY = 1;
37159
+ actStagePosX = 0;
37160
+ actStagePosY = 0;
37450
37161
  constructor(params) {
37451
37162
  super();
37452
37163
  const { config } = params ?? {};
37453
- this.config = {
37454
- type: WEAVE_GRID_DEFAULT_TYPE,
37455
- gridColor: WEAVE_GRID_DEFAULT_COLOR,
37456
- gridOriginColor: WEAVE_GRID_DEFAULT_ORIGIN_COLOR,
37457
- gridSize: WEAVE_GRID_DEFAULT_SIZE,
37458
- gridDotMaxDotsPerAxis: WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS,
37459
- ...config
37460
- };
37164
+ this.moveToolActive = false;
37165
+ this.isMouseMiddleButtonPressed = false;
37166
+ this.isSpaceKeyPressed = false;
37167
+ this.forceStageChange = false;
37168
+ this.config = mergeExceptArrays(WEAVE_GRID_DEFAULT_CONFIG, config);
37461
37169
  this.initialize();
37462
37170
  }
37463
37171
  initialize() {
@@ -37465,10 +37173,6 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37465
37173
  this.isMouseMiddleButtonPressed = false;
37466
37174
  this.isSpaceKeyPressed = false;
37467
37175
  this.forceStageChange = false;
37468
- this.actStagePosX = 0;
37469
- this.actStagePosY = 0;
37470
- this.actStageZoomX = 1;
37471
- this.actStageZoomY = 1;
37472
37176
  }
37473
37177
  getName() {
37474
37178
  return WEAVE_STAGE_GRID_PLUGIN_KEY;
@@ -37493,10 +37197,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37493
37197
  const stage = this.instance.getStage();
37494
37198
  window.addEventListener("keydown", (e) => {
37495
37199
  if (e.code === "Space") this.isSpaceKeyPressed = true;
37496
- }, { signal: this.instance.getEventsController()?.signal });
37200
+ });
37497
37201
  window.addEventListener("keyup", (e) => {
37498
37202
  if (e.code === "Space") this.isSpaceKeyPressed = false;
37499
- }, { signal: this.instance.getEventsController()?.signal });
37203
+ });
37500
37204
  this.instance.addEventListener("onStageMove", () => {
37501
37205
  this.onRender();
37502
37206
  });
@@ -37524,10 +37228,14 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37524
37228
  const layer = stage.findOne(`#${WEAVE_GRID_LAYER_ID}`);
37525
37229
  return layer;
37526
37230
  }
37231
+ getShapeAdaptiveSpacing(baseSpacing, scale) {
37232
+ const factor = Math.pow(2, Math.floor(Math.log2(1 / scale)));
37233
+ return baseSpacing * factor;
37234
+ }
37527
37235
  getAdaptiveSpacing(scale) {
37528
37236
  const baseGridSpacing = this.config.gridSize;
37529
- const minPixelSpacing = 8;
37530
- const maxPixelSpacing = 100;
37237
+ const minPixelSpacing = this.config.gridSize;
37238
+ const maxPixelSpacing = this.config.gridSize * 2;
37531
37239
  let spacing = baseGridSpacing;
37532
37240
  let pixelSpacing = spacing * scale;
37533
37241
  while (pixelSpacing < minPixelSpacing) {
@@ -37542,17 +37250,6 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37542
37250
  const snappedSpacing = baseGridSpacing * Math.pow(2, logFactor);
37543
37251
  return snappedSpacing;
37544
37252
  }
37545
- getAdjustedSpacing(startX, endX, startY, endY, baseSpacing = 50) {
37546
- let spacing = baseSpacing;
37547
- let dotCountX = Math.ceil((endX - startX) / spacing);
37548
- let dotCountY = Math.ceil((endY - startY) / spacing);
37549
- while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && spacing < 1e6) {
37550
- spacing *= 2;
37551
- dotCountX = Math.ceil((endX - startX) / spacing);
37552
- dotCountY = Math.ceil((endY - startY) / spacing);
37553
- }
37554
- return spacing;
37555
- }
37556
37253
  renderGridLines() {
37557
37254
  const stage = this.instance.getStage();
37558
37255
  const gridLayer = this.getLayer();
@@ -37561,7 +37258,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37561
37258
  if (!this.enabled) return;
37562
37259
  const scale = stage.scaleX();
37563
37260
  const spacing = this.getAdaptiveSpacing(scale);
37564
- const invScale = (this.config.gridStroke ?? WEAVE_GRID_DEFAULT_STROKE) / scale;
37261
+ const invScale = this.config.gridStroke / scale;
37565
37262
  const offsetX = -stage.x() / stage.scaleX();
37566
37263
  const offsetY = -stage.y() / stage.scaleY();
37567
37264
  const margin = 2;
@@ -37571,11 +37268,19 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37571
37268
  const startY = Math.floor((offsetY - margin * worldHeight) / spacing) * spacing;
37572
37269
  const endX = offsetX + (1 + margin) * worldWidth;
37573
37270
  const endY = offsetY + (1 + margin) * worldHeight;
37574
- const highlightEvery = this.config.gridMajorEvery ?? WEAVE_GRID_DEFAULT_MAJOR_EVERY;
37271
+ const highlightEvery = this.config.gridMajorEvery;
37575
37272
  for (let x = startX; x <= endX; x += spacing) {
37576
37273
  const index = Math.round(x / spacing);
37577
37274
  const isHighlight = index % highlightEvery === 0;
37578
37275
  const isOrigin = Math.abs(x) < spacing / 2;
37276
+ let stroke = this.config.gridColor;
37277
+ if (isOrigin) stroke = this.config.gridOriginColor;
37278
+ else if (isHighlight) stroke = this.config.gridMajorColor;
37279
+ let strokeWidth = invScale;
37280
+ if (isHighlight || isOrigin) strokeWidth = invScale * this.config.gridMajorRatio;
37281
+ let zIndex = 1;
37282
+ if (isOrigin) zIndex = 3;
37283
+ else if (isHighlight) zIndex = 2;
37579
37284
  const line = new Konva.Line({
37580
37285
  points: [
37581
37286
  x,
@@ -37583,9 +37288,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37583
37288
  x,
37584
37289
  endY
37585
37290
  ],
37586
- stroke: isOrigin ? this.config.gridOriginColor : this.config.gridColor,
37587
- strokeWidth: !isHighlight && !isOrigin ? invScale : invScale * (this.config.gridMajorRatio ?? WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO),
37588
- listening: false
37291
+ stroke,
37292
+ strokeWidth,
37293
+ listening: false,
37294
+ zIndex
37589
37295
  });
37590
37296
  gridLayer.add(line);
37591
37297
  }
@@ -37593,6 +37299,14 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37593
37299
  const index = Math.round(y / spacing);
37594
37300
  const isHighlight = index % highlightEvery === 0;
37595
37301
  const isOrigin = Math.abs(y) < spacing / 2;
37302
+ let stroke = this.config.gridColor;
37303
+ if (isOrigin) stroke = this.config.gridOriginColor;
37304
+ else if (isHighlight) stroke = this.config.gridMajorColor;
37305
+ let strokeWidth = invScale;
37306
+ if (isHighlight || isOrigin) strokeWidth = invScale * this.config.gridMajorRatio;
37307
+ let zIndex = 1;
37308
+ if (isOrigin) zIndex = 3;
37309
+ else if (isHighlight) zIndex = 2;
37596
37310
  const line = new Konva.Line({
37597
37311
  points: [
37598
37312
  startX,
@@ -37600,9 +37314,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37600
37314
  endX,
37601
37315
  y
37602
37316
  ],
37603
- stroke: isOrigin ? this.config.gridOriginColor : this.config.gridColor,
37604
- strokeWidth: !isHighlight && !isOrigin ? invScale : invScale * 2,
37605
- listening: false
37317
+ stroke,
37318
+ strokeWidth,
37319
+ listening: false,
37320
+ zIndex
37606
37321
  });
37607
37322
  gridLayer.add(line);
37608
37323
  }
@@ -37613,67 +37328,78 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37613
37328
  if (!gridLayer) return;
37614
37329
  gridLayer.destroyChildren();
37615
37330
  if (!this.enabled) return;
37616
- const scale = stage.scaleX();
37617
- const spacing = this.getAdaptiveSpacing(scale);
37618
- const invScale = (this.config.gridDotRadius ?? WEAVE_GRID_DEFAULT_RADIUS) / scale;
37619
- const position = stage.position();
37620
- const offsetX = -position.x * invScale;
37621
- const offsetY = -position.y * invScale;
37622
- const margin = 2;
37623
- const worldWidth = stage.width() * invScale;
37624
- const worldHeight = stage.height() * invScale;
37625
- let startX = Math.floor((offsetX - margin * worldWidth) / spacing) * spacing;
37626
- const endX = offsetX + (1 + margin) * worldWidth;
37627
- let startY = Math.floor((offsetY - margin * worldHeight) / spacing) * spacing;
37628
- const endY = offsetY + (1 + margin) * worldHeight;
37629
- let adjustedSpacing = spacing;
37630
- let dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
37631
- let dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
37632
- while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && adjustedSpacing < 1e6) {
37633
- adjustedSpacing *= 2;
37634
- dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
37635
- dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
37636
- }
37637
- this.getAdjustedSpacing(startX, endX, startY, endY, spacing);
37638
- startX = Math.floor((offsetX - margin * worldWidth) / adjustedSpacing) * adjustedSpacing;
37639
- startY = Math.floor((offsetY - margin * worldHeight) / adjustedSpacing) * adjustedSpacing;
37640
- const highlightEvery = this.config.gridMajorEvery ?? WEAVE_GRID_DEFAULT_MAJOR_EVERY;
37641
- const majorColor = this.config.gridColor;
37642
- const gridMajorRatio = this.config.gridMajorRatio ?? WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO;
37643
- const majorShape = new Konva.Shape({ sceneFunc: function(context) {
37644
- context.beginPath();
37645
- for (let x = startX; x <= endX; x += adjustedSpacing) for (let y = startY; y <= endY; y += adjustedSpacing) {
37646
- if (Math.abs(x) < spacing / 2 || Math.abs(y) < spacing / 2) continue;
37647
- const indexX = Math.round(x / spacing);
37648
- const indexY = Math.round(y / spacing);
37649
- const isHighlightX = indexX % highlightEvery === 0;
37650
- const isHighlightY = indexY % highlightEvery === 0;
37651
- const radius = !(isHighlightX || isHighlightY) ? invScale : invScale * gridMajorRatio;
37652
- context.moveTo(x + radius, y);
37653
- context.arc(x, y, radius, 0, Math.PI * 2, false);
37654
- }
37655
- context.fillStyle = majorColor;
37656
- context.fill();
37657
- } });
37658
- gridLayer.add(majorShape);
37659
- const originColor = this.config.gridOriginColor;
37660
- const originShape = new Konva.Shape({ sceneFunc: function(context) {
37661
- context.beginPath();
37662
- for (let x = startX; x <= endX; x += adjustedSpacing) {
37663
- const radius = invScale * gridMajorRatio;
37664
- context.moveTo(x + radius, 0);
37665
- context.arc(x, 0, radius, 0, Math.PI * 2);
37666
- }
37667
- for (let y = startY; y <= endY; y += adjustedSpacing) {
37668
- const radius = invScale * gridMajorRatio;
37669
- if (Math.abs(y) < spacing / 2) continue;
37670
- context.moveTo(0 + radius, y);
37671
- context.arc(0, y, radius, 0, Math.PI * 2);
37672
- }
37673
- context.fillStyle = originColor;
37674
- context.fill();
37675
- } });
37676
- gridLayer.add(originShape);
37331
+ const grid = new Konva.Shape({
37332
+ listening: false,
37333
+ sceneFunc: (ctx) => {
37334
+ const dotType = this.config.gridDotType;
37335
+ const scale = stage.scaleX();
37336
+ const pos = stage.position();
37337
+ const baseSpacing = this.config.gridSize;
37338
+ const spacing = this.getShapeAdaptiveSpacing(baseSpacing, scale);
37339
+ const highlightEvery = this.config.gridMajorEvery;
37340
+ const defaultColor = this.config.gridColor;
37341
+ const majorColor = this.config.gridMajorColor;
37342
+ const centerColor = this.config.gridOriginColor;
37343
+ if (dotType === WEAVE_GRID_DOT_TYPES.CIRCLE) {
37344
+ const scale$1 = stage.scaleX();
37345
+ const pos$1 = stage.position();
37346
+ const topLeftX = -pos$1.x / scale$1;
37347
+ const topLeftY = -pos$1.y / scale$1;
37348
+ const viewWidth = stage.width() / scale$1;
37349
+ const viewHeight = stage.height() / scale$1;
37350
+ const startX = Math.floor(topLeftX / spacing) * spacing;
37351
+ const startY = Math.floor(topLeftY / spacing) * spacing;
37352
+ const dotRadius = this.config.gridDotRadius;
37353
+ const dotMajorRadius = dotRadius * this.config.gridMajorRatio;
37354
+ for (let x = startX; x < topLeftX + viewWidth; x += spacing) for (let y = startY; y < topLeftY + viewHeight; y += spacing) {
37355
+ const indexX = Math.round(x / spacing);
37356
+ const indexY = Math.round(y / spacing);
37357
+ const isHighlightX = indexX % highlightEvery === 0;
37358
+ const isHighlightY = indexY % highlightEvery === 0;
37359
+ const isHighlight = isHighlightX || isHighlightY;
37360
+ const isOriginX = Math.abs(x) < spacing / 2;
37361
+ const isOriginY = Math.abs(y) < spacing / 2;
37362
+ const isOrigin = isOriginX || isOriginY;
37363
+ let fillStyle = defaultColor;
37364
+ if (isOrigin) fillStyle = centerColor;
37365
+ else if (isHighlight) fillStyle = majorColor;
37366
+ ctx.fillStyle = fillStyle;
37367
+ ctx.beginPath();
37368
+ ctx.arc(x, y, (isHighlight ? dotMajorRadius : dotRadius) / scale$1, 0, Math.PI * 2);
37369
+ ctx.fill();
37370
+ }
37371
+ }
37372
+ if (dotType === WEAVE_GRID_DOT_TYPES.SQUARE) {
37373
+ const topLeftX = -pos.x / scale;
37374
+ const topLeftY = -pos.y / scale;
37375
+ const viewWidth = stage.width() / scale;
37376
+ const viewHeight = stage.height() / scale;
37377
+ const startX = Math.floor(topLeftX / spacing) * spacing;
37378
+ const startY = Math.floor(topLeftY / spacing) * spacing;
37379
+ const defaultSize = this.config.gridDotRectSize;
37380
+ const majorSize = defaultSize * this.config.gridMajorRatio;
37381
+ for (let x = startX; x < topLeftX + viewWidth; x += spacing) for (let y = startY; y < topLeftY + viewHeight; y += spacing) {
37382
+ const sx = Math.round(x * scale) / scale;
37383
+ const sy = Math.round(y * scale) / scale;
37384
+ const indexX = Math.round(sx / spacing);
37385
+ const indexY = Math.round(sy / spacing);
37386
+ const isHighlightX = indexX % highlightEvery === 0;
37387
+ const isHighlightY = indexY % highlightEvery === 0;
37388
+ const isHighlight = isHighlightX || isHighlightY;
37389
+ const isOriginX = Math.abs(sx) < spacing / 2;
37390
+ const isOriginY = Math.abs(sy) < spacing / 2;
37391
+ const isOrigin = isOriginX || isOriginY;
37392
+ let fillStyle = defaultColor;
37393
+ if (isOrigin) fillStyle = centerColor;
37394
+ else if (isHighlight) fillStyle = majorColor;
37395
+ ctx.fillStyle = fillStyle;
37396
+ const size = (isHighlight ? majorSize : defaultSize) / scale;
37397
+ ctx.fillRect(sx - size / 2, sy - size / 2, size, size);
37398
+ }
37399
+ }
37400
+ }
37401
+ });
37402
+ gridLayer.add(grid);
37677
37403
  }
37678
37404
  hasStageChanged() {
37679
37405
  if (this.forceStageChange) {
@@ -37710,11 +37436,13 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37710
37436
  enable() {
37711
37437
  this.enabled = true;
37712
37438
  this.getLayer()?.show();
37439
+ this.forceStageChange = true;
37713
37440
  this.onRender();
37714
37441
  }
37715
37442
  disable() {
37716
37443
  this.enabled = false;
37717
37444
  this.getLayer()?.hide();
37445
+ this.forceStageChange = true;
37718
37446
  this.onRender();
37719
37447
  }
37720
37448
  getType() {
@@ -37725,19 +37453,28 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37725
37453
  this.forceStageChange = true;
37726
37454
  this.onRender();
37727
37455
  }
37456
+ getDotsType() {
37457
+ return this.config.gridDotType;
37458
+ }
37459
+ setDotsType(type) {
37460
+ this.config.gridDotType = type;
37461
+ this.forceStageChange = true;
37462
+ this.onRender();
37463
+ }
37728
37464
  };
37729
37465
 
37730
37466
  //#endregion
37731
37467
  //#region src/plugins/stage-panning/stage-panning.ts
37732
37468
  var WeaveStagePanningPlugin = class extends WeavePlugin {
37469
+ panning = false;
37470
+ currentPointer = null;
37471
+ stageScrollInterval = void 0;
37472
+ panEdgeTargets = {};
37733
37473
  getLayerName = void 0;
37734
37474
  initLayer = void 0;
37735
37475
  constructor(params) {
37736
37476
  super();
37737
37477
  this.config = mergeExceptArrays(WEAVE_STAGE_PANNING_DEFAULT_CONFIG, params?.config ?? {});
37738
- this.initialize();
37739
- }
37740
- initialize() {
37741
37478
  this.pointers = new Map();
37742
37479
  this.panning = false;
37743
37480
  this.isDragging = false;
@@ -37749,9 +37486,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37749
37486
  this.isCtrlOrMetaPressed = false;
37750
37487
  this.isSpaceKeyPressed = false;
37751
37488
  this.previousPointer = null;
37752
- this.currentPointer = null;
37753
- this.stageScrollInterval = void 0;
37754
- this.panEdgeTargets = {};
37755
37489
  }
37756
37490
  getName() {
37757
37491
  return WEAVE_STAGE_PANNING_KEY;
@@ -37785,7 +37519,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37785
37519
  this.isSpaceKeyPressed = true;
37786
37520
  this.setCursor();
37787
37521
  }
37788
- }, { signal: this.instance.getEventsController()?.signal });
37522
+ });
37789
37523
  window.addEventListener("keyup", (e) => {
37790
37524
  if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
37791
37525
  if (e.code === "Space") {
@@ -37796,7 +37530,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37796
37530
  this.isSpaceKeyPressed = false;
37797
37531
  this.disableMove();
37798
37532
  }
37799
- }, { signal: this.instance.getEventsController()?.signal });
37533
+ });
37800
37534
  let lastPos = null;
37801
37535
  stage.on("pointerdown", (e) => {
37802
37536
  this.pointers.set(e.evt.pointerId, {
@@ -37869,10 +37603,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37869
37603
  this.instance.emitEvent("onStageMove");
37870
37604
  };
37871
37605
  const handleWheelThrottled = (0, import_lodash.throttle)(handleWheel, WEAVE_STAGE_PANNING_THROTTLE_MS);
37872
- window.addEventListener("wheel", handleWheelThrottled, {
37873
- passive: true,
37874
- signal: this.instance.getEventsController()?.signal
37875
- });
37606
+ window.addEventListener("wheel", handleWheelThrottled, { passive: true });
37876
37607
  stage.on("dragstart", (e) => {
37877
37608
  const duration = 1e3 / 60;
37878
37609
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
@@ -37930,10 +37661,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37930
37661
  stage.container().style.setProperty("-webkit-user-drag", "none");
37931
37662
  stage.getContent().addEventListener("touchmove", function(e) {
37932
37663
  e.preventDefault();
37933
- }, {
37934
- passive: false,
37935
- signal: this.instance.getEventsController()?.signal
37936
- });
37664
+ }, { passive: false });
37937
37665
  }
37938
37666
  isPanning() {
37939
37667
  return this.panning;
@@ -38011,9 +37739,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
38011
37739
  constructor(params) {
38012
37740
  super();
38013
37741
  this.config = mergeExceptArrays(STAGE_MINIMAP_DEFAULT_CONFIG, params.config);
38014
- this.initialize();
38015
- }
38016
- initialize() {
38017
37742
  this.initialized = false;
38018
37743
  }
38019
37744
  getName() {
@@ -38191,7 +37916,6 @@ const WEAVE_STAGE_RESIZE_KEY = "stageResize";
38191
37916
  var WeaveStageResizePlugin = class extends WeavePlugin {
38192
37917
  getLayerName = void 0;
38193
37918
  initLayer = void 0;
38194
- initialize = void 0;
38195
37919
  getName() {
38196
37920
  return WEAVE_STAGE_RESIZE_KEY;
38197
37921
  }
@@ -38211,10 +37935,6 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38211
37935
  const pluginInstance = plugins[pluginId];
38212
37936
  pluginInstance.onRender?.();
38213
37937
  }
38214
- this.instance.emitEvent("onStageResize", {
38215
- width: stage.width(),
38216
- height: stage.height()
38217
- });
38218
37938
  }
38219
37939
  }
38220
37940
  onInit() {
@@ -38223,7 +37943,7 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38223
37943
  }, DEFAULT_THROTTLE_MS);
38224
37944
  window.addEventListener("resize", () => {
38225
37945
  throttledResize();
38226
- }, { signal: this.instance.getEventsController()?.signal });
37946
+ });
38227
37947
  const resizeObserver = new ResizeObserver(() => {
38228
37948
  throttledResize();
38229
37949
  });
@@ -38241,12 +37961,10 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38241
37961
  //#endregion
38242
37962
  //#region src/plugins/nodes-multi-selection-feedback/nodes-multi-selection-feedback.ts
38243
37963
  var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
37964
+ selectedHalos = {};
38244
37965
  constructor(params) {
38245
37966
  super();
38246
37967
  this.config = mergeExceptArrays(WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, params?.config ?? {});
38247
- this.initialize();
38248
- }
38249
- initialize() {
38250
37968
  this.selectedHalos = {};
38251
37969
  }
38252
37970
  getName() {
@@ -38412,14 +38130,12 @@ var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
38412
38130
  //#endregion
38413
38131
  //#region src/plugins/connected-users/connected-users.ts
38414
38132
  var WeaveConnectedUsersPlugin = class extends WeavePlugin {
38133
+ connectedUsers = {};
38415
38134
  getLayerName = void 0;
38416
38135
  constructor(params) {
38417
38136
  super();
38418
38137
  const { config } = params ?? {};
38419
38138
  this.config = config;
38420
- this.initialize();
38421
- }
38422
- initialize() {
38423
38139
  this.connectedUsers = {};
38424
38140
  }
38425
38141
  getName() {
@@ -38466,9 +38182,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
38466
38182
  this.config = config;
38467
38183
  this.config.getUser = memoize(this.config.getUser);
38468
38184
  this.config.getUserColor = memoize(this.config.getUserColor);
38469
- this.initialize();
38470
- }
38471
- initialize() {
38472
38185
  this.usersSelection = {};
38473
38186
  }
38474
38187
  getName() {
@@ -38661,9 +38374,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
38661
38374
  this.config.getUser = memoize(this.config.getUser);
38662
38375
  this.config.getUserBackgroundColor = memoize(this.config.getUserBackgroundColor);
38663
38376
  this.config.getUserForegroundColor = memoize(this.config.getUserForegroundColor);
38664
- this.initialize();
38665
- }
38666
- initialize() {
38667
38377
  this.usersPointers = {};
38668
38378
  this.usersOperations = {};
38669
38379
  }
@@ -38874,9 +38584,6 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
38874
38584
  super();
38875
38585
  const { config } = params;
38876
38586
  this.config = mergeExceptArrays(WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, config);
38877
- this.initialize();
38878
- }
38879
- initialize() {
38880
38587
  this.userPresence = {};
38881
38588
  }
38882
38589
  getName() {
@@ -38952,9 +38659,6 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38952
38659
  initLayer = void 0;
38953
38660
  constructor() {
38954
38661
  super();
38955
- this.initialize();
38956
- }
38957
- initialize() {
38958
38662
  this.enabled = true;
38959
38663
  }
38960
38664
  getName() {
@@ -38968,20 +38672,14 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38968
38672
  stage.container().addEventListener("dragover", (e) => {
38969
38673
  e.preventDefault();
38970
38674
  e.stopPropagation();
38971
- }, { signal: this.instance.getEventsController()?.signal });
38675
+ });
38972
38676
  stage.container().addEventListener("drop", (e) => {
38973
38677
  e.preventDefault();
38974
38678
  e.stopPropagation();
38975
38679
  this.instance.emitEvent("onStageDrop", e);
38976
- }, { signal: this.instance.getEventsController()?.signal });
38977
- window.addEventListener("dragover", (e) => e.preventDefault(), {
38978
- signal: this.instance.getEventsController()?.signal,
38979
- passive: false
38980
- });
38981
- window.addEventListener("drop", (e) => e.preventDefault(), {
38982
- signal: this.instance.getEventsController()?.signal,
38983
- passive: false
38984
38680
  });
38681
+ window.addEventListener("dragover", (e) => e.preventDefault(), { passive: false });
38682
+ window.addEventListener("drop", (e) => e.preventDefault(), { passive: false });
38985
38683
  }
38986
38684
  enable() {
38987
38685
  this.enabled = true;
@@ -39000,9 +38698,6 @@ var WeaveNodesEdgeSnappingPlugin = class extends WeavePlugin {
39000
38698
  this.guideLineConfig = config?.guideLine ?? GUIDE_LINE_DEFAULT_CONFIG;
39001
38699
  this.dragSnappingThreshold = config?.dragSnappingThreshold ?? GUIDE_LINE_DRAG_SNAPPING_THRESHOLD;
39002
38700
  this.transformSnappingThreshold = config?.transformSnappingThreshold ?? GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD;
39003
- this.initialize();
39004
- }
39005
- initialize() {
39006
38701
  this.enabled = true;
39007
38702
  }
39008
38703
  getName() {
@@ -39379,9 +39074,6 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39379
39074
  this.enterSnappingTolerance = config?.enterSnappingTolerance ?? GUIDE_ENTER_SNAPPING_TOLERANCE;
39380
39075
  this.exitSnappingTolerance = config?.exitSnappingTolerance ?? GUIDE_EXIT_SNAPPING_TOLERANCE;
39381
39076
  this.uiConfig = mergeExceptArrays(GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, config?.ui);
39382
- this.initialize();
39383
- }
39384
- initialize() {
39385
39077
  this.enabled = true;
39386
39078
  }
39387
39079
  getName() {
@@ -40028,14 +39720,12 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
40028
39720
  //#endregion
40029
39721
  //#region src/plugins/comments-renderer/comments-renderer.ts
40030
39722
  var WeaveCommentsRendererPlugin = class extends WeavePlugin {
39723
+ comments = [];
40031
39724
  getLayerName = void 0;
40032
39725
  constructor(params) {
40033
39726
  super();
40034
39727
  const { config } = params ?? {};
40035
39728
  this.config = config;
40036
- this.initialize();
40037
- }
40038
- initialize() {
40039
39729
  this.comments = [];
40040
39730
  }
40041
39731
  getName() {
@@ -40126,7 +39816,6 @@ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40126
39816
  var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40127
39817
  getLayerName = void 0;
40128
39818
  initLayer = void 0;
40129
- initialize = void 0;
40130
39819
  constructor(params) {
40131
39820
  super();
40132
39821
  this.config = mergeExceptArrays(WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, params?.config ?? {});
@@ -40165,7 +39854,7 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40165
39854
  if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40166
39855
  if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40167
39856
  if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40168
- }, { signal: this.instance.getEventsController()?.signal });
39857
+ });
40169
39858
  }
40170
39859
  enable() {
40171
39860
  this.enabled = true;
@@ -40176,5 +39865,5 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40176
39865
  };
40177
39866
 
40178
39867
  //#endregion
40179
- export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
39868
+ 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_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
40180
39869
  //# sourceMappingURL=types.js.map