@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/sdk.js CHANGED
@@ -32,13 +32,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  }) : target, mod));
33
33
 
34
34
  //#endregion
35
- //#region ../../node_modules/emittery/maps.js
35
+ //#region node_modules/emittery/maps.js
36
36
  const anyMap = new WeakMap();
37
37
  const eventsMap = new WeakMap();
38
38
  const producersMap = new WeakMap();
39
39
 
40
40
  //#endregion
41
- //#region ../../node_modules/emittery/index.js
41
+ //#region node_modules/emittery/index.js
42
42
  const anyProducer = Symbol("anyProducer");
43
43
  const resolvedPromise = Promise.resolve();
44
44
  const listenerAdded = Symbol("listenerAdded");
@@ -15084,11 +15084,6 @@ var WeaveStore = class {
15084
15084
  getDocument() {
15085
15085
  return this.document;
15086
15086
  }
15087
- restartDocument() {
15088
- this.latestState = { weave: {} };
15089
- this.state = syncedStore({ weave: {} });
15090
- this.document = getYjsDoc(this.state);
15091
- }
15092
15087
  loadDocument(roomData) {
15093
15088
  yjs_default.applyUpdate(this.document, roomData);
15094
15089
  }
@@ -17964,15 +17959,6 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17964
17959
  initLayer = void 0;
17965
17960
  constructor(params) {
17966
17961
  super();
17967
- const { config } = params ?? {};
17968
- this.config = {
17969
- xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17970
- yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17971
- ...config
17972
- };
17973
- this.initialize();
17974
- }
17975
- initialize() {
17976
17962
  this.timer = null;
17977
17963
  this.tapHold = false;
17978
17964
  this.contextMenuVisible = false;
@@ -17982,6 +17968,12 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
17982
17968
  time: 0
17983
17969
  };
17984
17970
  this.tapHoldTimeout = WEAVE_CONTEXT_MENU_TAP_HOLD_TIMEOUT;
17971
+ const { config } = params ?? {};
17972
+ this.config = {
17973
+ xOffset: WEAVE_CONTEXT_MENU_X_OFFSET_DEFAULT,
17974
+ yOffset: WEAVE_CONTEXT_MENU_Y_OFFSET_DEFAULT,
17975
+ ...config
17976
+ };
17985
17977
  this.pointers = {};
17986
17978
  }
17987
17979
  getName() {
@@ -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();
@@ -21984,34 +21974,11 @@ var WeaveRegisterManager = class {
21984
21974
  }
21985
21975
  }
21986
21976
  }
21987
- resetNodesHandlers() {
21988
- for (const nodeHandlerId of Object.keys(this.nodesHandlers)) {
21989
- const nodeHandler = this.nodesHandlers[nodeHandlerId];
21990
- nodeHandler.initialize?.();
21991
- }
21992
- }
21993
- resetActionsHandlers() {
21994
- for (const actionHandlerId of Object.keys(this.actionsHandlers)) {
21995
- const actionHandler = this.actionsHandlers[actionHandlerId];
21996
- actionHandler.initialize?.();
21997
- }
21998
- }
21999
- resetPlugins() {
22000
- for (const pluginId of Object.keys(this.plugins)) {
22001
- const plugin = this.plugins[pluginId];
22002
- plugin.initialize?.();
22003
- }
22004
- }
22005
- reset() {
22006
- this.resetNodesHandlers();
22007
- this.resetActionsHandlers();
22008
- this.resetPlugins();
22009
- }
22010
21977
  };
22011
21978
 
22012
21979
  //#endregion
22013
21980
  //#region package.json
22014
- var version = "3.4.0-SNAPSHOT.85.1";
21981
+ var version = "3.5.0";
22015
21982
 
22016
21983
  //#endregion
22017
21984
  //#region src/managers/setup.ts
@@ -22128,11 +22095,6 @@ var WeaveStageManager = class {
22128
22095
  initialZIndex: void 0
22129
22096
  };
22130
22097
  const stage = new Konva.Stage({ ...props });
22131
- if (!this.instance.isServerSide()) {
22132
- const containerParent = stage.container().parentNode;
22133
- stage.width(containerParent.clientWidth);
22134
- stage.height(containerParent.clientHeight);
22135
- }
22136
22098
  const realContainer = stage.container();
22137
22099
  if (realContainer !== void 0 && realContainer.style?.position !== "relative") realContainer.style.position = "relative";
22138
22100
  this.setStage(stage);
@@ -22441,91 +22403,6 @@ var WeaveExportManager = class {
22441
22403
  height: imageHeight * pixelRatio
22442
22404
  };
22443
22405
  }
22444
- async exportAreaServerSide(area, options) {
22445
- const { format = WEAVE_EXPORT_FORMATS.PNG, padding = 0, pixelRatio = 1, backgroundColor = WEAVE_EXPORT_BACKGROUND_COLOR } = options;
22446
- this.getNodesSelectionPlugin()?.disable();
22447
- this.getNodesDistanceSnappingPlugin()?.disable();
22448
- this.getNodesEdgeSnappingPlugin()?.disable();
22449
- this.getStageGridPlugin()?.disable();
22450
- const stage = this.instance.getStage();
22451
- const mainLayer = this.instance.getMainLayer();
22452
- if (!mainLayer) throw new Error("Main layer not found");
22453
- const originalPosition = {
22454
- x: stage.x(),
22455
- y: stage.y()
22456
- };
22457
- const originalScale = {
22458
- x: stage.scaleX(),
22459
- y: stage.scaleY()
22460
- };
22461
- stage.scale({
22462
- x: 1,
22463
- y: 1
22464
- });
22465
- const bounds = area;
22466
- const scaleX = stage.scaleX();
22467
- const scaleY = stage.scaleY();
22468
- const unscaledBounds = {
22469
- x: bounds.x / scaleX,
22470
- y: bounds.y / scaleY,
22471
- width: bounds.width / scaleX,
22472
- height: bounds.height / scaleY
22473
- };
22474
- const background = new Konva.Rect({
22475
- x: unscaledBounds.x - padding,
22476
- y: unscaledBounds.y - padding,
22477
- width: unscaledBounds.width + 2 * padding,
22478
- height: unscaledBounds.height + 2 * padding,
22479
- strokeWidth: 0,
22480
- fill: backgroundColor
22481
- });
22482
- mainLayer.add(background);
22483
- background.moveToBottom();
22484
- const backgroundRect = background.getClientRect({ relativeTo: stage });
22485
- const composites = [];
22486
- const imageWidth = Math.round(backgroundRect.width);
22487
- const imageHeight = Math.round(backgroundRect.height);
22488
- const maxRenderSize = 1920;
22489
- const cols = Math.ceil(imageWidth / maxRenderSize);
22490
- const rows = Math.ceil(imageHeight / maxRenderSize);
22491
- const tileWidth = Math.floor(imageWidth / cols);
22492
- const tileHeight = Math.floor(imageHeight / rows);
22493
- for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22494
- const width = Math.min(tileWidth, imageWidth - x);
22495
- const height = Math.min(tileHeight, imageHeight - y);
22496
- const canvas = await mainLayer.toCanvas({
22497
- x: Math.round(backgroundRect.x) + x,
22498
- y: Math.round(backgroundRect.y) + y,
22499
- width,
22500
- height,
22501
- mimeType: format,
22502
- pixelRatio,
22503
- quality: options.quality ?? 1
22504
- });
22505
- let buffer = null;
22506
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.CANVAS) buffer = canvas.toBuffer();
22507
- if (globalThis._weave_serverSideBackend === WEAVE_KONVA_BACKEND.SKIA) buffer = await canvas.toBuffer();
22508
- if (!buffer) throw new Error("Failed to generate image buffer");
22509
- composites.push({
22510
- top: y * pixelRatio,
22511
- left: x * pixelRatio,
22512
- input: buffer
22513
- });
22514
- }
22515
- background.destroy();
22516
- stage.position(originalPosition);
22517
- stage.scale(originalScale);
22518
- stage.batchDraw();
22519
- this.getNodesSelectionPlugin()?.enable();
22520
- this.getNodesDistanceSnappingPlugin()?.enable();
22521
- this.getNodesEdgeSnappingPlugin()?.enable();
22522
- this.getStageGridPlugin()?.enable();
22523
- return {
22524
- composites,
22525
- width: imageWidth * pixelRatio,
22526
- height: imageHeight * pixelRatio
22527
- };
22528
- }
22529
22406
  imageToBase64(img, mimeType) {
22530
22407
  if (img.naturalWidth === 0 && img.naturalHeight === 0) throw new Error("Image has no content");
22531
22408
  const canvas = document.createElement("canvas");
@@ -22805,12 +22682,7 @@ var WeaveAsyncManager = class {
22805
22682
  this.instance.emitEvent("onAsyncElementChange");
22806
22683
  }, new Map());
22807
22684
  }
22808
- reset() {
22809
- this.asyncElements.clear();
22810
- this.asyncElementsLoadedEventEmitted = false;
22811
- }
22812
22685
  checkForAsyncElements(elements) {
22813
- this.instance.emitEvent("onAsyncElementsIdle");
22814
22686
  const amountAsyncResourcesExtracted = this.extractAsyncResources(elements);
22815
22687
  if (amountAsyncResourcesExtracted === 0 && !this.asyncElementsLoadedEventEmitted) {
22816
22688
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -22863,7 +22735,7 @@ var WeaveAsyncManager = class {
22863
22735
  status: WEAVE_ASYNC_STATUS.LOADING
22864
22736
  };
22865
22737
  this.asyncElements.set(nodeId, element);
22866
- if (!this.asyncElementsLoadedEventEmitted) this.instance.emitEvent("onAsyncElementsLoading", {
22738
+ this.instance.emitEvent("onAsyncElementsLoading", {
22867
22739
  loaded: this.getAmountAsyncElementsLoaded(),
22868
22740
  total: this.getAmountAsyncElements()
22869
22741
  });
@@ -22876,11 +22748,11 @@ var WeaveAsyncManager = class {
22876
22748
  status: WEAVE_ASYNC_STATUS.LOADED
22877
22749
  };
22878
22750
  this.asyncElements.set(nodeId, element);
22751
+ this.instance.emitEvent("onAsyncElementsLoading", {
22752
+ loaded: this.getAmountAsyncElementsLoaded(),
22753
+ total: this.getAmountAsyncElements()
22754
+ });
22879
22755
  if (!this.asyncElementsLoadedEventEmitted) {
22880
- this.instance.emitEvent("onAsyncElementsLoading", {
22881
- loaded: this.getAmountAsyncElementsLoaded(),
22882
- total: this.getAmountAsyncElements()
22883
- });
22884
22756
  const allLoaded = this.asyncElementsLoaded();
22885
22757
  if (allLoaded) {
22886
22758
  this.instance.emitEvent("onAsyncElementsLoaded");
@@ -23005,7 +22877,6 @@ var Weave = class {
23005
22877
  constructor(weaveConfig, stageConfig) {
23006
22878
  globalThis._weave_isServerSide = false;
23007
22879
  if (typeof window === "undefined") globalThis._weave_isServerSide = true;
23008
- this.eventsController = void 0;
23009
22880
  this.emitter = new Emittery();
23010
22881
  Konva.showWarnings = false;
23011
22882
  this.id = v4_default();
@@ -23051,7 +22922,6 @@ var Weave = class {
23051
22922
  this.initialized = true;
23052
22923
  this.status = WEAVE_INSTANCE_STATUS.RUNNING;
23053
22924
  this.emitEvent("onInstanceStatus", this.status);
23054
- this.emitEvent("onRender");
23055
22925
  });
23056
22926
  }
23057
22927
  setStatus(status) {
@@ -23076,7 +22946,6 @@ var Weave = class {
23076
22946
  async start() {
23077
22947
  this.moduleLogger.info("Start instance");
23078
22948
  if (!this.isServerSide()) {
23079
- this.eventsController = new AbortController();
23080
22949
  if (!window.weave) window.weave = this;
23081
22950
  }
23082
22951
  this.emitEvent("onRoomLoaded", false);
@@ -23100,39 +22969,8 @@ var Weave = class {
23100
22969
  store.setup();
23101
22970
  store.connect();
23102
22971
  }
23103
- async switchRoom() {
23104
- this.moduleLogger.info(`Switching room`);
23105
- const nodeHandlers = this.registerManager.getNodesHandlers();
23106
- for (const nodeHandlerKey of Object.keys(nodeHandlers)) {
23107
- const nodeHandler = nodeHandlers[nodeHandlerKey];
23108
- nodeHandler?.onDestroyInstance();
23109
- }
23110
- const stage = this.getStage();
23111
- if (stage) stage.destroy();
23112
- if (this.eventsController) this.eventsController.abort();
23113
- if (!this.isServerSide()) this.eventsController = new AbortController();
23114
- this.registerManager.reset();
23115
- this.asyncManager.reset();
23116
- this.moduleLogger.info("Switching room instance");
23117
- if (!this.isServerSide()) {
23118
- if (!window.weave) window.weave = this;
23119
- }
23120
- this.emitEvent("onRoomLoaded", false);
23121
- this.status = WEAVE_INSTANCE_STATUS.STARTING;
23122
- this.emitEvent("onInstanceStatus", this.status);
23123
- this.registerManager.reset();
23124
- this.status = WEAVE_INSTANCE_STATUS.LOADING_FONTS;
23125
- this.emitEvent("onInstanceStatus", this.status);
23126
- await this.fontsManager.loadFonts();
23127
- this.setupManager.setupLog();
23128
- this.stageManager.initStage();
23129
- this.status = WEAVE_INSTANCE_STATUS.CONNECTING_TO_ROOM;
23130
- this.emitEvent("onInstanceStatus", this.status);
23131
- this.addEventListener("onStoreConnectionStatusChange", this.handleStoreConnectionStatusChange.bind(this));
23132
- }
23133
22972
  destroy() {
23134
22973
  this.moduleLogger.info(`Destroying the instance`);
23135
- if (this.eventsController) this.eventsController.abort();
23136
22974
  this.emitter.clearListeners();
23137
22975
  this.status = WEAVE_INSTANCE_STATUS.IDLE;
23138
22976
  this.emitEvent("onInstanceStatus", this.status);
@@ -23602,9 +23440,6 @@ var Weave = class {
23602
23440
  async exportNodesServerSide(nodes, boundingNodes, options) {
23603
23441
  return await this.exportManager.exportNodesServerSide(nodes, boundingNodes, options);
23604
23442
  }
23605
- async exportAreaServerSide(area, options) {
23606
- return await this.exportManager.exportAreaServerSide(area, options);
23607
- }
23608
23443
  async exportNodes(nodes, boundingNodes, options) {
23609
23444
  return await this.exportManager.exportNodesAsImage(nodes, boundingNodes, options);
23610
23445
  }
@@ -23770,9 +23605,6 @@ var Weave = class {
23770
23605
  getDragProperties() {
23771
23606
  return this.dragAndDropManager.getDragProperties();
23772
23607
  }
23773
- getEventsController() {
23774
- return this.eventsController;
23775
- }
23776
23608
  };
23777
23609
 
23778
23610
  //#endregion
@@ -23864,7 +23696,6 @@ const downscaleImageFromURL = (url, options) => {
23864
23696
  //#endregion
23865
23697
  //#region src/internal-utils/upscale.ts
23866
23698
  const setupUpscaleStage = (instance, stage) => {
23867
- if (instance.isServerSide()) return;
23868
23699
  const config = instance.getConfiguration();
23869
23700
  const doUpscale = config.performance?.upscale?.enabled ?? false;
23870
23701
  if (doUpscale) {
@@ -23896,14 +23727,7 @@ const setupUpscaleStage = (instance, stage) => {
23896
23727
  innerElement.style.transformOrigin = "0 0";
23897
23728
  innerElement.style.transform = `scale(${scaleToCover})`;
23898
23729
  }
23899
- } else {
23900
- const realContainer = stage.container();
23901
- const containerWidth = realContainer.offsetWidth;
23902
- const containerHeight = realContainer.offsetHeight;
23903
- stage.width(containerWidth);
23904
- stage.height(containerHeight);
23905
- stage.setAttrs({ upscaleScale: 1 });
23906
- }
23730
+ } else stage.setAttrs({ upscaleScale: 1 });
23907
23731
  };
23908
23732
 
23909
23733
  //#endregion
@@ -23914,7 +23738,6 @@ var WeaveStageNode = class extends WeaveNode {
23914
23738
  wheelMousePressed = false;
23915
23739
  isCmdCtrlPressed = false;
23916
23740
  globalEventsInitialized = false;
23917
- initialize = void 0;
23918
23741
  onRender(props) {
23919
23742
  const stage = new Konva.Stage({
23920
23743
  ...props,
@@ -23933,10 +23756,10 @@ var WeaveStageNode = class extends WeaveNode {
23933
23756
  container.setAttribute("tabindex", "0");
23934
23757
  stage.container().addEventListener("focus", () => {
23935
23758
  this.stageFocused = true;
23936
- }, { signal: this.instance.getEventsController()?.signal });
23759
+ });
23937
23760
  stage.container().addEventListener("blur", () => {
23938
23761
  this.stageFocused = false;
23939
- }, { signal: this.instance.getEventsController()?.signal });
23762
+ });
23940
23763
  }
23941
23764
  Konva.Stage.prototype.mode = function(mode) {
23942
23765
  if (typeof mode !== "undefined") this._mode = mode;
@@ -24006,7 +23829,7 @@ var WeaveStageNode = class extends WeaveNode {
24006
23829
  const selectedNode = transformer.nodes()[0];
24007
23830
  selectedNode.fire("onCmdCtrlPressed");
24008
23831
  }
24009
- }, { signal: this.instance.getEventsController()?.signal });
23832
+ });
24010
23833
  window.addEventListener("keyup", (e) => {
24011
23834
  if (!(e.ctrlKey || e.metaKey)) {
24012
23835
  this.isCmdCtrlPressed = false;
@@ -24017,7 +23840,7 @@ var WeaveStageNode = class extends WeaveNode {
24017
23840
  const selectedNode = transformer.nodes()[0];
24018
23841
  selectedNode.fire("onCmdCtrlReleased");
24019
23842
  }
24020
- }, { signal: this.instance.getEventsController()?.signal });
23843
+ });
24021
23844
  this.globalEventsInitialized = true;
24022
23845
  }
24023
23846
  isOnlyCtrlOrMeta(event) {
@@ -24037,7 +23860,6 @@ const WEAVE_LAYER_NODE_TYPE = "layer";
24037
23860
  //#region src/nodes/layer/layer.ts
24038
23861
  var WeaveLayerNode = class extends WeaveNode {
24039
23862
  nodeType = WEAVE_LAYER_NODE_TYPE;
24040
- initialize = void 0;
24041
23863
  onRender(props) {
24042
23864
  const layer = new Konva.Layer({ ...props });
24043
23865
  layer.canMoveToContainer = function() {
@@ -24085,7 +23907,6 @@ const WEAVE_GROUP_NODE_TYPE = "group";
24085
23907
  //#region src/nodes/group/group.ts
24086
23908
  var WeaveGroupNode = class extends WeaveNode {
24087
23909
  nodeType = WEAVE_GROUP_NODE_TYPE;
24088
- initialize = void 0;
24089
23910
  constructor(params) {
24090
23911
  super();
24091
23912
  const { config } = params ?? {};
@@ -24178,7 +23999,6 @@ const WEAVE_RECTANGLE_NODE_TYPE = "rectangle";
24178
23999
  //#region src/nodes/rectangle/rectangle.ts
24179
24000
  var WeaveRectangleNode = class extends WeaveNode {
24180
24001
  nodeType = WEAVE_RECTANGLE_NODE_TYPE;
24181
- initialize = void 0;
24182
24002
  constructor(params) {
24183
24003
  super();
24184
24004
  const { config } = params ?? {};
@@ -24222,7 +24042,6 @@ const WEAVE_ELLIPSE_NODE_TYPE = "ellipse";
24222
24042
  //#region src/nodes/ellipse/ellipse.ts
24223
24043
  var WeaveEllipseNode = class extends WeaveNode {
24224
24044
  nodeType = WEAVE_ELLIPSE_NODE_TYPE;
24225
- initialize = void 0;
24226
24045
  constructor(params) {
24227
24046
  super();
24228
24047
  const { config } = params ?? {};
@@ -24368,16 +24187,13 @@ var WeaveLineNode = class extends WeaveNode {
24368
24187
  constructor(params) {
24369
24188
  super();
24370
24189
  this.config = mergeExceptArrays(WEAVE_LINE_NODE_DEFAULT_CONFIG, params?.config ?? {});
24190
+ this.handleNodeChanges = null;
24191
+ this.handleZoomChanges = null;
24371
24192
  this.snapper = new GreedySnapper({
24372
24193
  snapAngles: this.config.snapAngles.angles,
24373
24194
  activateThreshold: this.config.snapAngles.activateThreshold,
24374
24195
  releaseThreshold: this.config.snapAngles.releaseThreshold
24375
24196
  });
24376
- this.initialize();
24377
- }
24378
- initialize() {
24379
- this.handleNodeChanges = null;
24380
- this.handleZoomChanges = null;
24381
24197
  }
24382
24198
  onRender(props) {
24383
24199
  const line = new Konva.Line({
@@ -24682,19 +24498,17 @@ const TEXT_LAYOUT = {
24682
24498
  //#region src/nodes/text/text.ts
24683
24499
  var WeaveTextNode = class extends WeaveNode {
24684
24500
  nodeType = WEAVE_TEXT_NODE_TYPE;
24501
+ editing = false;
24502
+ textAreaSuperContainer = null;
24503
+ textAreaContainer = null;
24504
+ textArea = null;
24505
+ eventsInitialized = false;
24506
+ isCtrlMetaPressed = false;
24685
24507
  constructor(params) {
24686
24508
  super();
24687
24509
  const { config } = params ?? {};
24688
24510
  this.config = (0, import_lodash.merge)({}, WEAVE_TEXT_NODE_DEFAULT_CONFIG, config);
24689
- this.initialize();
24690
- }
24691
- initialize() {
24692
24511
  this.keyPressHandler = void 0;
24693
- this.eventsInitialized = false;
24694
- this.isCtrlMetaPressed = false;
24695
- this.textAreaSuperContainer = null;
24696
- this.textAreaContainer = null;
24697
- this.textArea = null;
24698
24512
  this.editing = false;
24699
24513
  this.textArea = null;
24700
24514
  }
@@ -24702,10 +24516,10 @@ var WeaveTextNode = class extends WeaveNode {
24702
24516
  if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
24703
24517
  window.addEventListener("keydown", (e) => {
24704
24518
  if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
24705
- }, { signal: this.instance.getEventsController()?.signal });
24519
+ });
24706
24520
  window.addEventListener("keyup", (e) => {
24707
24521
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
24708
- }, { signal: this.instance.getEventsController()?.signal });
24522
+ });
24709
24523
  this.eventsInitialized = true;
24710
24524
  }
24711
24525
  }
@@ -24733,7 +24547,7 @@ var WeaveTextNode = class extends WeaveNode {
24733
24547
  onAdd() {
24734
24548
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24735
24549
  this.keyPressHandler = this.handleKeyPress.bind(this);
24736
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24550
+ window.addEventListener("keypress", this.keyPressHandler);
24737
24551
  }
24738
24552
  }
24739
24553
  onRender(props) {
@@ -24887,7 +24701,7 @@ var WeaveTextNode = class extends WeaveNode {
24887
24701
  });
24888
24702
  if (!this.instance.isServerSide() && !this.keyPressHandler) {
24889
24703
  this.keyPressHandler = this.handleKeyPress.bind(this);
24890
- window.addEventListener("keypress", this.keyPressHandler, { signal: this.instance.getEventsController()?.signal });
24704
+ window.addEventListener("keypress", this.keyPressHandler);
24891
24705
  }
24892
24706
  return text;
24893
24707
  }
@@ -25146,17 +24960,17 @@ var WeaveTextNode = class extends WeaveNode {
25146
24960
  this.textAreaSuperContainer.scrollTop = 0;
25147
24961
  this.textAreaSuperContainer.scrollLeft = 0;
25148
24962
  }
25149
- }, { signal: this.instance.getEventsController()?.signal });
24963
+ });
25150
24964
  this.textAreaContainer.addEventListener("scroll", () => {
25151
24965
  if (!this.textAreaContainer) return;
25152
24966
  this.textAreaContainer.scrollTop = 0;
25153
24967
  this.textAreaContainer.scrollLeft = 0;
25154
- }, { signal: this.instance.getEventsController()?.signal });
24968
+ });
25155
24969
  this.textArea.addEventListener("scroll", () => {
25156
24970
  if (!this.textArea) return;
25157
24971
  this.textArea.scrollTop = 0;
25158
24972
  this.textArea.scrollLeft = 0;
25159
- }, { signal: this.instance.getEventsController()?.signal });
24973
+ });
25160
24974
  const rotation = textNode.getAbsoluteRotation();
25161
24975
  if (rotation) {
25162
24976
  const transform = "rotate(" + rotation + "deg)";
@@ -25205,8 +25019,8 @@ var WeaveTextNode = class extends WeaveNode {
25205
25019
  this.textAreaDomResize(textNode);
25206
25020
  }
25207
25021
  };
25208
- this.textArea.addEventListener("keydown", handleKeyDown, { signal: this.instance.getEventsController()?.signal });
25209
- this.textArea.addEventListener("keyup", handleKeyUp, { signal: this.instance.getEventsController()?.signal });
25022
+ this.textArea.addEventListener("keydown", handleKeyDown);
25023
+ this.textArea.addEventListener("keyup", handleKeyUp);
25210
25024
  this.textArea.tabIndex = 1;
25211
25025
  this.textArea.focus();
25212
25026
  const handleOutsideClick = (e) => {
@@ -25232,7 +25046,7 @@ var WeaveTextNode = class extends WeaveNode {
25232
25046
  }
25233
25047
  };
25234
25048
  setTimeout(() => {
25235
- window.addEventListener("pointerup", handleOutsideClick, { signal: this.instance.getEventsController()?.signal });
25049
+ window.addEventListener("pointerup", handleOutsideClick);
25236
25050
  }, 0);
25237
25051
  this.instance.getStage().mode(WEAVE_STAGE_TEXT_EDITION_MODE);
25238
25052
  this.editing = true;
@@ -25355,6 +25169,8 @@ const WEAVE_IMAGE_DEFAULT_CONFIG = {
25355
25169
  crossOrigin: "anonymous",
25356
25170
  useFallbackImage: true,
25357
25171
  cropMode: {
25172
+ enabled: true,
25173
+ triggers: { ctrlCmd: true },
25358
25174
  gridLines: { enabled: true },
25359
25175
  overlay: { fill: "rgba(0,0,0,0.2)" },
25360
25176
  selection: {
@@ -25566,7 +25382,7 @@ var WeaveImageCrop = class WeaveImageCrop {
25566
25382
  utilityLayer?.add(this.transformer);
25567
25383
  this.transformer?.forceUpdate();
25568
25384
  this.cropGroup.show();
25569
- window.addEventListener("keydown", this.handleHide, { signal: this.instance.getEventsController()?.signal });
25385
+ window.addEventListener("keydown", this.handleHide);
25570
25386
  if (options.cmdCtrl.triggered) {
25571
25387
  utilityLayer?.hide();
25572
25388
  const stage = this.instance.getStage();
@@ -26016,21 +25832,24 @@ const isAllowedUrl = (value) => {
26016
25832
  //#endregion
26017
25833
  //#region src/nodes/image/image.ts
26018
25834
  var WeaveImageNode = class extends WeaveNode {
25835
+ imageBitmapCache = {};
25836
+ imageSource = {};
25837
+ imageFallback = {};
25838
+ imageState = {};
25839
+ imageTryoutAttempts = {};
25840
+ imageTryoutIds = {};
26019
25841
  nodeType = WEAVE_IMAGE_NODE_TYPE;
26020
25842
  cursorsFallback = { loading: "wait" };
26021
25843
  cursors = {};
26022
25844
  constructor(params) {
26023
25845
  super();
26024
25846
  const { config } = params ?? {};
26025
- this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26026
- this.initialize();
26027
- }
26028
- initialize() {
26029
25847
  this.tapStart = {
26030
25848
  x: 0,
26031
25849
  y: 0,
26032
25850
  time: 0
26033
25851
  };
25852
+ this.config = mergeExceptArrays(WEAVE_IMAGE_DEFAULT_CONFIG, config);
26034
25853
  this.imageCrop = null;
26035
25854
  this.imageBitmapCache = {};
26036
25855
  this.imageSource = {};
@@ -26061,6 +25880,7 @@ var WeaveImageNode = class extends WeaveNode {
26061
25880
  this.logger.info(`image caching enabled: ${this.config.performance.cache.enabled}`);
26062
25881
  }
26063
25882
  triggerCrop(imageNode, options) {
25883
+ if (!this.config.cropMode.enabled) return;
26064
25884
  const stage = this.instance.getStage();
26065
25885
  if (imageNode.getAttrs().cropping ?? false) return;
26066
25886
  if (!(this.isSelecting() && this.isNodeSelected(imageNode))) return;
@@ -26086,6 +25906,7 @@ var WeaveImageNode = class extends WeaveNode {
26086
25906
  });
26087
25907
  }
26088
25908
  closeCrop = (imageNode, type) => {
25909
+ if (!this.config.cropMode.enabled) return;
26089
25910
  if (!this.imageCrop) return;
26090
25911
  const stage = this.instance.getStage();
26091
25912
  stage.mode(WEAVE_STAGE_DEFAULT_MODE);
@@ -26099,6 +25920,7 @@ var WeaveImageNode = class extends WeaveNode {
26099
25920
  }
26100
25921
  };
26101
25922
  resetCrop = (imageNode) => {
25923
+ if (!this.config.cropMode.enabled) return;
26102
25924
  const internalImage = imageNode.findOne(`#${imageNode.getAttrs().id}-image`);
26103
25925
  const cropGroup = imageNode.findOne(`#${imageNode.getAttrs().id}-cropGroup`);
26104
25926
  if (!internalImage || !cropGroup) return;
@@ -26142,19 +25964,21 @@ var WeaveImageNode = class extends WeaveNode {
26142
25964
  const image$1 = stage.findOne(`#${id}`);
26143
25965
  if (!image$1) return;
26144
25966
  };
26145
- image.triggerCrop = () => {
26146
- this.triggerCrop(image, { cmdCtrl: { triggered: false } });
26147
- };
26148
- image.closeCrop = (type) => {
26149
- this.closeCrop(image, type);
26150
- };
26151
- image.resetCrop = () => {
26152
- const stage = this.instance.getStage();
26153
- const image$1 = stage.findOne(`#${id}`);
26154
- if (!image$1) return;
26155
- const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
26156
- imageCrop.unCrop();
26157
- };
25967
+ if (this.config.cropMode.enabled) {
25968
+ image.triggerCrop = () => {
25969
+ this.triggerCrop(image, { cmdCtrl: { triggered: false } });
25970
+ };
25971
+ image.closeCrop = (type) => {
25972
+ this.closeCrop(image, type);
25973
+ };
25974
+ image.resetCrop = () => {
25975
+ const stage = this.instance.getStage();
25976
+ const image$1 = stage.findOne(`#${id}`);
25977
+ if (!image$1) return;
25978
+ const imageCrop = new WeaveImageCrop(this.instance, this, image$1, internalImage, cropGroup);
25979
+ imageCrop.unCrop();
25980
+ };
25981
+ }
26158
25982
  const defaultTransformerProperties = this.defaultGetTransformerProperties(this.config.transform);
26159
25983
  image.getTransformerProperties = function() {
26160
25984
  return defaultTransformerProperties;
@@ -26249,7 +26073,7 @@ var WeaveImageNode = class extends WeaveNode {
26249
26073
  };
26250
26074
  this.updateImageCrop(image);
26251
26075
  } else {
26252
- this.updatePlaceholderSize(image);
26076
+ this.updatePlaceholderSize(image, imagePlaceholder);
26253
26077
  this.loadImage(imageProps, image, true);
26254
26078
  }
26255
26079
  if (this.config.performance.cache.enabled) image.on("transformend", () => {
@@ -26261,24 +26085,26 @@ var WeaveImageNode = class extends WeaveNode {
26261
26085
  if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
26262
26086
  }
26263
26087
  });
26264
- image.on("onCmdCtrlPressed", () => {
26265
- const transformer = this.getSelectionPlugin()?.getTransformer();
26266
- if (!transformer) return;
26267
- transformer.hide();
26268
- const utilityLayer = this.instance.getUtilityLayer();
26269
- if (!utilityLayer) return;
26270
- utilityLayer?.destroyChildren();
26271
- this.renderCropMode(utilityLayer, image);
26272
- utilityLayer?.show();
26273
- });
26274
- image.on("onCmdCtrlReleased", () => {
26275
- const transformer = this.getSelectionPlugin()?.getTransformer();
26276
- if (!transformer) return;
26277
- transformer.show();
26278
- const utilityLayer = this.instance.getUtilityLayer();
26279
- if (!utilityLayer) return;
26280
- utilityLayer?.destroyChildren();
26281
- });
26088
+ if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
26089
+ image.on("onCmdCtrlPressed", () => {
26090
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26091
+ if (!transformer) return;
26092
+ transformer.hide();
26093
+ const utilityLayer = this.instance.getUtilityLayer();
26094
+ if (!utilityLayer) return;
26095
+ utilityLayer?.destroyChildren();
26096
+ this.renderCropMode(utilityLayer, image);
26097
+ utilityLayer?.show();
26098
+ });
26099
+ image.on("onCmdCtrlReleased", () => {
26100
+ const transformer = this.getSelectionPlugin()?.getTransformer();
26101
+ if (!transformer) return;
26102
+ transformer.show();
26103
+ const utilityLayer = this.instance.getUtilityLayer();
26104
+ if (!utilityLayer) return;
26105
+ utilityLayer?.destroyChildren();
26106
+ });
26107
+ }
26282
26108
  image.on("onSelectionCleared", () => {
26283
26109
  const transformer = this.getSelectionPlugin()?.getTransformer();
26284
26110
  if (!transformer) return;
@@ -26332,6 +26158,7 @@ var WeaveImageNode = class extends WeaveNode {
26332
26158
  width: absoluteCorners[1].x - absoluteCorners[0].x,
26333
26159
  height: absoluteCorners[2].y - absoluteCorners[0].y,
26334
26160
  fill: "transparent",
26161
+ strokeScaleEnabled: false,
26335
26162
  strokeWidth: 2,
26336
26163
  stroke: "#1a1aff",
26337
26164
  draggable: false,
@@ -26344,13 +26171,6 @@ var WeaveImageNode = class extends WeaveNode {
26344
26171
  x: 1 / stageScale,
26345
26172
  y: 1 / stageScale
26346
26173
  });
26347
- stage.on("scaleXChange scaleYChange", () => {
26348
- const scale = stage.scaleX();
26349
- rect.scale({
26350
- x: 1 / scale,
26351
- y: 1 / scale
26352
- });
26353
- });
26354
26174
  }
26355
26175
  renderCropAnchor(position, node, layer, onClick) {
26356
26176
  const transform = node.getAbsoluteTransform().copy();
@@ -26636,7 +26456,7 @@ var WeaveImageNode = class extends WeaveNode {
26636
26456
  }
26637
26457
  this.loadAsyncElement(id);
26638
26458
  preloadFunction(id, realImageURL ?? "", {
26639
- onLoad: async () => {
26459
+ onLoad: () => {
26640
26460
  if (useFallback) this.imageTryoutIds[id] = setTimeout(() => {
26641
26461
  const node = this.instance.getStage().findOne(`#${id}`);
26642
26462
  if (node) {
@@ -26687,7 +26507,7 @@ var WeaveImageNode = class extends WeaveNode {
26687
26507
  error: false
26688
26508
  };
26689
26509
  this.updateImageCrop(image);
26690
- if (!useFallback) this.resolveAsyncElement(id);
26510
+ this.resolveAsyncElement(id);
26691
26511
  this.cacheNode(image);
26692
26512
  }
26693
26513
  },
@@ -26728,9 +26548,13 @@ var WeaveImageNode = class extends WeaveNode {
26728
26548
  }
26729
26549
  }, loadTryout);
26730
26550
  }
26731
- updatePlaceholderSize(image) {
26551
+ updatePlaceholderSize(image, imagePlaceholder) {
26732
26552
  const imageAttrs = image.getAttrs();
26733
26553
  if (!this.imageState[imageAttrs.id ?? ""]?.loaded) return;
26554
+ if (!imageAttrs.adding && !imageAttrs.cropInfo) {
26555
+ imagePlaceholder.width(imageAttrs.uncroppedImage.width);
26556
+ imagePlaceholder.height(imageAttrs.uncroppedImage.height);
26557
+ }
26734
26558
  }
26735
26559
  updateImageCrop(image) {
26736
26560
  const imageAttrs = image.getAttrs();
@@ -26864,7 +26688,6 @@ const WEAVE_STAR_NODE_TYPE = "star";
26864
26688
  //#region src/nodes/star/star.ts
26865
26689
  var WeaveStarNode = class extends WeaveNode {
26866
26690
  nodeType = WEAVE_STAR_NODE_TYPE;
26867
- initialize = void 0;
26868
26691
  constructor(params) {
26869
26692
  super();
26870
26693
  const { config } = params ?? {};
@@ -26950,7 +26773,6 @@ const WEAVE_ARROW_NODE_TYPE = "arrow";
26950
26773
  //#region src/nodes/arrow/arrow.ts
26951
26774
  var WeaveArrowNode = class extends WeaveNode {
26952
26775
  nodeType = WEAVE_ARROW_NODE_TYPE;
26953
- initialize = void 0;
26954
26776
  constructor(params) {
26955
26777
  super();
26956
26778
  const { config } = params ?? {};
@@ -27007,7 +26829,6 @@ const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
27007
26829
  //#region src/nodes/regular-polygon/regular-polygon.ts
27008
26830
  var WeaveRegularPolygonNode = class extends WeaveNode {
27009
26831
  nodeType = WEAVE_REGULAR_POLYGON_NODE_TYPE;
27010
- initialize = void 0;
27011
26832
  constructor(params) {
27012
26833
  super();
27013
26834
  const { config } = params ?? {};
@@ -27121,7 +26942,6 @@ var GroupFrame = class extends Konva.Group {
27121
26942
  //#region src/nodes/frame/frame.ts
27122
26943
  var WeaveFrameNode = class extends WeaveNode {
27123
26944
  nodeType = WEAVE_FRAME_NODE_TYPE;
27124
- initialize = void 0;
27125
26945
  constructor(params) {
27126
26946
  super();
27127
26947
  const { config } = params ?? {};
@@ -27422,7 +27242,6 @@ const WEAVE_STROKE_NODE_DEFAULT_CONFIG = {
27422
27242
  //#region src/nodes/stroke/stroke.ts
27423
27243
  var WeaveStrokeNode = class extends WeaveNode {
27424
27244
  nodeType = WEAVE_STROKE_NODE_TYPE;
27425
- initialize = void 0;
27426
27245
  constructor(params) {
27427
27246
  super();
27428
27247
  const { config } = params ?? {};
@@ -27999,6 +27818,8 @@ var WeaveSquareLineTipManager = class extends WeaveBaseLineTipManager {
27999
27818
  //#endregion
28000
27819
  //#region src/nodes/stroke-single/stroke-single.ts
28001
27820
  var WeaveStrokeSingleNode = class extends WeaveNode {
27821
+ startHandle = null;
27822
+ endHandle = null;
28002
27823
  nodeType = WEAVE_STROKE_SINGLE_NODE_TYPE;
28003
27824
  tipManagers = {
28004
27825
  [WEAVE_STROKE_SINGLE_NODE_TIP_TYPE.ARROW]: new WeaveArrowLineTipManager(),
@@ -28009,29 +27830,24 @@ var WeaveStrokeSingleNode = class extends WeaveNode {
28009
27830
  constructor(params) {
28010
27831
  super();
28011
27832
  this.config = mergeExceptArrays(WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, params?.config ?? {});
27833
+ this.handleNodeChanges = null;
27834
+ this.handleZoomChanges = null;
27835
+ this.shiftPressed = false;
28012
27836
  this.snapper = new GreedySnapper({
28013
27837
  snapAngles: this.config.snapAngles.angles,
28014
27838
  activateThreshold: this.config.snapAngles.activateThreshold,
28015
27839
  releaseThreshold: this.config.snapAngles.releaseThreshold
28016
27840
  });
28017
- this.initialize();
28018
- }
28019
- initialize() {
28020
27841
  this.eventsInitialized = false;
28021
- this.startHandle = null;
28022
- this.endHandle = null;
28023
- this.handleNodeChanges = null;
28024
- this.handleZoomChanges = null;
28025
- this.shiftPressed = false;
28026
27842
  }
28027
27843
  initEvents() {
28028
27844
  if (this.eventsInitialized) return;
28029
27845
  window.addEventListener("keydown", (e) => {
28030
27846
  if (e.key === "Shift") this.shiftPressed = true;
28031
- }, { signal: this.instance.getEventsController()?.signal });
27847
+ });
28032
27848
  window.addEventListener("keyup", (e) => {
28033
27849
  if (e.key === "Shift") this.shiftPressed = false;
28034
- }, { signal: this.instance.getEventsController()?.signal });
27850
+ });
28035
27851
  this.eventsInitialized = true;
28036
27852
  }
28037
27853
  onRender(props) {
@@ -28518,9 +28334,6 @@ var WeaveCommentNode = class extends WeaveNode {
28518
28334
  constructor(params) {
28519
28335
  super();
28520
28336
  this.config = mergeExceptArrays(WEAVE_COMMENT_NODE_DEFAULTS, params.config);
28521
- this.initialize();
28522
- }
28523
- initialize() {
28524
28337
  this.commentDomVisibleId = null;
28525
28338
  this.commentDomVisible = false;
28526
28339
  this.commentDomAction = null;
@@ -29149,6 +28962,10 @@ const WEAVE_VIDEO_DEFAULT_CONFIG = {
29149
28962
  //#endregion
29150
28963
  //#region src/nodes/video/video.ts
29151
28964
  var WeaveVideoNode = class extends WeaveNode {
28965
+ videoState = {};
28966
+ videoSourceFrameId = {};
28967
+ videoSource = {};
28968
+ videoPlaceholder = {};
29152
28969
  nodeType = WEAVE_VIDEO_NODE_TYPE;
29153
28970
  constructor(params) {
29154
28971
  super();
@@ -29161,13 +28978,6 @@ var WeaveVideoNode = class extends WeaveNode {
29161
28978
  this.videoIconImage.src = this.config.style.icon.dataURL;
29162
28979
  }
29163
28980
  }
29164
- initialize() {
29165
- this.videoState = {};
29166
- this.videoSource = {};
29167
- this.videoSourceFrameId = {};
29168
- this.videoPlaceholder = {};
29169
- this.videoIconImage = void 0;
29170
- }
29171
28981
  async loadPlaceholder(params, video) {
29172
28982
  const videoProps = params;
29173
28983
  const { id } = videoProps;
@@ -29662,7 +29472,6 @@ const WEAVE_MEASURE_NODE_DEFAULT_CONFIG = { style: {
29662
29472
  var WeaveMeasureNode = class extends WeaveNode {
29663
29473
  nodeType = WEAVE_MEASURE_NODE_TYPE;
29664
29474
  handlePointCircleRadius = 6;
29665
- initialize = void 0;
29666
29475
  constructor(params) {
29667
29476
  super();
29668
29477
  this.config = mergeExceptArrays(WEAVE_MEASURE_NODE_DEFAULT_CONFIG, params?.config ?? {});
@@ -30953,7 +30762,6 @@ var WeaveConnectorNode = class extends WeaveNode {
30953
30762
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.DOT]: setupNodeDecoratorDot,
30954
30763
  [WEAVE_CONNECTOR_NODE_DECORATOR_TYPE.ARROW]: setupNodeDecoratorArrow
30955
30764
  };
30956
- initialize = void 0;
30957
30765
  constructor(params) {
30958
30766
  super();
30959
30767
  this.config = mergeExceptArrays(WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, params?.config);
@@ -31704,6 +31512,10 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
31704
31512
  var WeaveStageZoomPlugin = class extends WeavePlugin {
31705
31513
  getLayerName = void 0;
31706
31514
  initLayer = void 0;
31515
+ pinching = false;
31516
+ zooming = false;
31517
+ isTrackpad = false;
31518
+ zoomVelocity = 0;
31707
31519
  zoomInertiaType = WEAVE_STAGE_ZOOM_TYPE.MOUSE_WHEEL;
31708
31520
  defaultStep = 3;
31709
31521
  constructor(params) {
@@ -31711,13 +31523,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
31711
31523
  const { config } = params ?? {};
31712
31524
  this.config = mergeExceptArrays(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
31713
31525
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
31714
- this.initialize();
31715
- }
31716
- initialize() {
31717
31526
  this.pinching = false;
31718
- this.zooming = false;
31719
31527
  this.isTrackpad = false;
31720
- this.zoomVelocity = 0;
31721
31528
  this.isCtrlOrMetaPressed = false;
31722
31529
  this.updatedMinimumZoom = false;
31723
31530
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
@@ -32004,15 +31811,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32004
31811
  if (box.width === 0 || box.height === 0) return;
32005
31812
  this.fitToElements(box, finalOptions);
32006
31813
  }
32007
- fitToArea(area, options) {
32008
- const finalOptions = mergeExceptArrays({
32009
- smartZoom: false,
32010
- overrideZoom: true
32011
- }, options);
32012
- if (!this.enabled) return;
32013
- if (area.width === 0 || area.height === 0) return;
32014
- this.fitToElements(area, finalOptions);
32015
- }
32016
31814
  enable() {
32017
31815
  this.enabled = true;
32018
31816
  }
@@ -32031,10 +31829,10 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32031
31829
  initEvents() {
32032
31830
  window.addEventListener("keydown", (e) => {
32033
31831
  if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
32034
- }, { signal: this.instance.getEventsController()?.signal });
31832
+ });
32035
31833
  window.addEventListener("keyup", (e) => {
32036
31834
  if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
32037
- }, { signal: this.instance.getEventsController()?.signal });
31835
+ });
32038
31836
  const stage = this.instance.getStage();
32039
31837
  let lastCenter = null;
32040
31838
  let lastDist = 0;
@@ -32059,10 +31857,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32059
31857
  return;
32060
31858
  }
32061
31859
  }
32062
- }, {
32063
- passive: false,
32064
- signal: this.instance.getEventsController()?.signal
32065
- });
31860
+ }, { passive: false });
32066
31861
  stage.getContent().addEventListener("touchmove", (e) => {
32067
31862
  e.preventDefault();
32068
31863
  if (e.touches.length === 2) {
@@ -32102,18 +31897,12 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32102
31897
  lastDist = dist;
32103
31898
  lastCenter = newCenter;
32104
31899
  }
32105
- }, {
32106
- passive: false,
32107
- signal: this.instance.getEventsController()?.signal
32108
- });
31900
+ }, { passive: false });
32109
31901
  stage.getContent().addEventListener("touchend", () => {
32110
31902
  this.pinching = false;
32111
31903
  lastDist = 0;
32112
31904
  lastCenter = null;
32113
- }, {
32114
- passive: false,
32115
- signal: this.instance.getEventsController()?.signal
32116
- });
31905
+ }, { passive: false });
32117
31906
  let doZoom = false;
32118
31907
  const handleWheelImmediate = (e) => {
32119
31908
  const performZoom = this.isCtrlOrMetaPressed || !this.isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
@@ -32131,10 +31920,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32131
31920
  e.preventDefault();
32132
31921
  doZoom = true;
32133
31922
  };
32134
- window.addEventListener("wheel", handleWheelImmediate, {
32135
- signal: this.instance.getEventsController()?.signal,
32136
- passive: false
32137
- });
31923
+ window.addEventListener("wheel", handleWheelImmediate, { passive: false });
32138
31924
  const handleWheel = (e) => {
32139
31925
  if (!doZoom) return;
32140
31926
  const delta = e.deltaY > 0 ? 1 : -1;
@@ -32147,10 +31933,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
32147
31933
  }
32148
31934
  };
32149
31935
  const throttledHandleWheel = (0, import_lodash.throttle)(handleWheel, DEFAULT_THROTTLE_MS);
32150
- window.addEventListener("wheel", throttledHandleWheel, {
32151
- signal: this.instance.getEventsController()?.signal,
32152
- passive: true
32153
- });
31936
+ window.addEventListener("wheel", throttledHandleWheel, { passive: true });
32154
31937
  }
32155
31938
  getInertiaScale() {
32156
31939
  const stage = this.instance.getStage();
@@ -32208,7 +31991,6 @@ const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
32208
31991
  //#region src/actions/zoom-out-tool/zoom-out-tool.ts
32209
31992
  var WeaveZoomOutToolAction = class extends WeaveAction {
32210
31993
  onPropsChange = void 0;
32211
- initialize = void 0;
32212
31994
  getName() {
32213
31995
  return ZOOM_OUT_TOOL_ACTION_NAME;
32214
31996
  }
@@ -32243,10 +32025,6 @@ const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
32243
32025
  //#region src/actions/zoom-in-tool/zoom-in-tool.ts
32244
32026
  var WeaveZoomInToolAction = class extends WeaveAction {
32245
32027
  onPropsChange = void 0;
32246
- initialize = void 0;
32247
- constructor() {
32248
- super();
32249
- }
32250
32028
  getName() {
32251
32029
  return ZOOM_IN_TOOL_ACTION_NAME;
32252
32030
  }
@@ -32281,10 +32059,6 @@ const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
32281
32059
  //#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
32282
32060
  var WeaveFitToScreenToolAction = class extends WeaveAction {
32283
32061
  onPropsChange = void 0;
32284
- initialize = void 0;
32285
- constructor() {
32286
- super();
32287
- }
32288
32062
  getName() {
32289
32063
  return FIT_TO_SCREEN_TOOL_ACTION_NAME;
32290
32064
  }
@@ -32318,10 +32092,6 @@ const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
32318
32092
  //#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
32319
32093
  var WeaveFitToSelectionToolAction = class extends WeaveAction {
32320
32094
  onPropsChange = void 0;
32321
- initialize = void 0;
32322
- constructor() {
32323
- super();
32324
- }
32325
32095
  getName() {
32326
32096
  return FIT_TO_SELECTION_TOOL_ACTION_NAME;
32327
32097
  }
@@ -32364,9 +32134,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
32364
32134
  onInit = void 0;
32365
32135
  constructor() {
32366
32136
  super();
32367
- this.initialize();
32368
- }
32369
- initialize() {
32370
32137
  this.initialized = false;
32371
32138
  this.state = MOVE_TOOL_STATE.IDLE;
32372
32139
  }
@@ -32380,7 +32147,7 @@ var WeaveMoveToolAction = class extends WeaveAction {
32380
32147
  this.cancelAction();
32381
32148
  return;
32382
32149
  }
32383
- }, { signal: this.instance.getEventsController()?.signal });
32150
+ });
32384
32151
  stage.on("pointerdown", () => {
32385
32152
  if ([MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
32386
32153
  });
@@ -32439,9 +32206,6 @@ var WeaveSelectionToolAction = class extends WeaveAction {
32439
32206
  onInit = void 0;
32440
32207
  constructor() {
32441
32208
  super();
32442
- this.initialize();
32443
- }
32444
- initialize() {
32445
32209
  this.initialized = false;
32446
32210
  this.state = SELECTION_TOOL_STATE.IDLE;
32447
32211
  }
@@ -32505,9 +32269,6 @@ var WeaveEraserToolAction = class extends WeaveAction {
32505
32269
  onInit = void 0;
32506
32270
  constructor() {
32507
32271
  super();
32508
- this.initialize();
32509
- }
32510
- initialize() {
32511
32272
  this.initialized = false;
32512
32273
  this.erasing = false;
32513
32274
  this.state = ERASER_TOOL_STATE.IDLE;
@@ -32541,7 +32302,7 @@ var WeaveEraserToolAction = class extends WeaveAction {
32541
32302
  this.cancelAction();
32542
32303
  return;
32543
32304
  }
32544
- }, { signal: this.instance.getEventsController()?.signal });
32305
+ });
32545
32306
  this.initialized = true;
32546
32307
  }
32547
32308
  setState(state) {
@@ -32608,9 +32369,6 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32608
32369
  onInit = void 0;
32609
32370
  constructor() {
32610
32371
  super();
32611
- this.initialize();
32612
- }
32613
- initialize() {
32614
32372
  this.pointers = new Map();
32615
32373
  this.initialized = false;
32616
32374
  this.state = RECTANGLE_TOOL_STATE.IDLE;
@@ -32646,7 +32404,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
32646
32404
  this.cancelAction();
32647
32405
  return;
32648
32406
  }
32649
- }, { signal: this.instance.getEventsController()?.signal });
32407
+ });
32650
32408
  stage.on("pointermove", () => {
32651
32409
  if (this.state === RECTANGLE_TOOL_STATE.IDLE) return;
32652
32410
  this.setCursor();
@@ -32820,9 +32578,6 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32820
32578
  onInit = void 0;
32821
32579
  constructor() {
32822
32580
  super();
32823
- this.initialize();
32824
- }
32825
- initialize() {
32826
32581
  this.pointers = new Map();
32827
32582
  this.initialized = false;
32828
32583
  this.state = ELLIPSE_TOOL_STATE.IDLE;
@@ -32858,7 +32613,7 @@ var WeaveEllipseToolAction = class extends WeaveAction {
32858
32613
  this.cancelAction();
32859
32614
  return;
32860
32615
  }
32861
- }, { signal: this.instance.getEventsController()?.signal });
32616
+ });
32862
32617
  stage.on("pointerdown", (e) => {
32863
32618
  this.setTapStart(e);
32864
32619
  this.pointers.set(e.evt.pointerId, {
@@ -33039,9 +32794,6 @@ var WeavePenToolAction = class extends WeaveAction {
33039
32794
  onInit = void 0;
33040
32795
  constructor() {
33041
32796
  super();
33042
- this.initialize();
33043
- }
33044
- initialize() {
33045
32797
  this.pointers = new Map();
33046
32798
  this.initialized = false;
33047
32799
  this.state = PEN_TOOL_STATE.IDLE;
@@ -33077,7 +32829,7 @@ var WeavePenToolAction = class extends WeaveAction {
33077
32829
  this.cancelAction();
33078
32830
  return;
33079
32831
  }
33080
- }, { signal: this.instance.getEventsController()?.signal });
32832
+ });
33081
32833
  stage.on("pointerdown", (e) => {
33082
32834
  this.setTapStart(e);
33083
32835
  this.pointers.set(e.evt.pointerId, {
@@ -33314,9 +33066,6 @@ var WeaveLineToolAction = class extends WeaveAction {
33314
33066
  constructor(params) {
33315
33067
  super();
33316
33068
  this.config = mergeExceptArrays(LINE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33317
- this.initialize();
33318
- }
33319
- initialize() {
33320
33069
  this.pointers = new Map();
33321
33070
  this.initialized = false;
33322
33071
  this.state = LINE_TOOL_STATE.IDLE;
@@ -33361,13 +33110,13 @@ var WeaveLineToolAction = class extends WeaveAction {
33361
33110
  this.snappedAngle = null;
33362
33111
  this.shiftPressed = true;
33363
33112
  }
33364
- }, { signal: this.instance.getEventsController()?.signal });
33113
+ });
33365
33114
  window.addEventListener("keyup", (e) => {
33366
33115
  if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
33367
33116
  this.snappedAngle = null;
33368
33117
  this.shiftPressed = false;
33369
33118
  }
33370
- }, { signal: this.instance.getEventsController()?.signal });
33119
+ });
33371
33120
  stage.on("pointerdown", (e) => {
33372
33121
  this.setTapStart(e);
33373
33122
  this.pointers.set(e.evt.pointerId, {
@@ -33582,9 +33331,6 @@ var WeaveBrushToolAction = class extends WeaveAction {
33582
33331
  constructor(params) {
33583
33332
  super();
33584
33333
  this.config = mergeExceptArrays(BRUSH_TOOL_DEFAULT_CONFIG, params?.config ?? {});
33585
- this.initialize();
33586
- }
33587
- initialize() {
33588
33334
  this.initialized = false;
33589
33335
  this.state = BRUSH_TOOL_STATE.INACTIVE;
33590
33336
  this.strokeId = null;
@@ -33613,7 +33359,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33613
33359
  const stage = this.instance.getStage();
33614
33360
  window.addEventListener("keyup", (e) => {
33615
33361
  if (e.code === "Space" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) this.isSpacePressed = false;
33616
- }, { signal: this.instance.getEventsController()?.signal });
33362
+ });
33617
33363
  window.addEventListener("keydown", (e) => {
33618
33364
  if (e.code === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
33619
33365
  e.stopPropagation();
@@ -33629,7 +33375,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
33629
33375
  e.stopPropagation();
33630
33376
  this.cancelAction();
33631
33377
  }
33632
- }, { signal: this.instance.getEventsController()?.signal });
33378
+ });
33633
33379
  const handlePointerDown = (e) => {
33634
33380
  if (this.state === BRUSH_TOOL_STATE.INACTIVE) return;
33635
33381
  if (this.state !== BRUSH_TOOL_STATE.IDLE) return;
@@ -33838,9 +33584,6 @@ var WeaveTextToolAction = class extends WeaveAction {
33838
33584
  onInit = void 0;
33839
33585
  constructor() {
33840
33586
  super();
33841
- this.initialize();
33842
- }
33843
- initialize() {
33844
33587
  this.initialized = false;
33845
33588
  this.state = TEXT_TOOL_STATE.IDLE;
33846
33589
  this.textId = null;
@@ -33870,7 +33613,7 @@ var WeaveTextToolAction = class extends WeaveAction {
33870
33613
  this.cancelAction();
33871
33614
  return;
33872
33615
  }
33873
- }, { signal: this.instance.getEventsController()?.signal });
33616
+ });
33874
33617
  stage.on("pointermove", () => {
33875
33618
  if (this.state === TEXT_TOOL_STATE.IDLE) return;
33876
33619
  this.setCursor();
@@ -33998,9 +33741,6 @@ var WeaveImageToolAction = class extends WeaveAction {
33998
33741
  constructor(params) {
33999
33742
  super();
34000
33743
  this.config = mergeExceptArrays(WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, params?.config ?? {});
34001
- this.initialize();
34002
- }
34003
- initialize() {
34004
33744
  this.pointers = new Map();
34005
33745
  this.initialized = false;
34006
33746
  this.imageId = null;
@@ -34044,7 +33784,7 @@ var WeaveImageToolAction = class extends WeaveAction {
34044
33784
  this.cancelAction();
34045
33785
  return;
34046
33786
  }
34047
- }, { signal: this.instance.getEventsController()?.signal });
33787
+ });
34048
33788
  stage.on("pointerdown", (e) => {
34049
33789
  this.setTapStart(e);
34050
33790
  if (this.ignorePointerEvents) return;
@@ -34441,9 +34181,6 @@ var WeaveImagesToolAction = class extends WeaveAction {
34441
34181
  constructor(params) {
34442
34182
  super();
34443
34183
  this.config = mergeExceptArrays(WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, params ?? {});
34444
- this.initialize();
34445
- }
34446
- initialize() {
34447
34184
  this.pointers = new Map();
34448
34185
  this.initialized = false;
34449
34186
  this.tempPointerFeedbackNode = null;
@@ -34490,7 +34227,7 @@ var WeaveImagesToolAction = class extends WeaveAction {
34490
34227
  const stage = this.instance.getStage();
34491
34228
  stage.container().addEventListener("keydown", (e) => {
34492
34229
  if (e.key === "Escape" && this.instance.getActiveAction() === WEAVE_IMAGES_TOOL_ACTION_NAME) this.cancelAction();
34493
- }, { signal: this.instance.getEventsController()?.signal });
34230
+ });
34494
34231
  stage.on("pointerdown", (e) => {
34495
34232
  this.setTapStart(e);
34496
34233
  this.pointers.set(e.evt.pointerId, {
@@ -34872,9 +34609,6 @@ var WeaveStarToolAction = class extends WeaveAction {
34872
34609
  onInit = void 0;
34873
34610
  constructor() {
34874
34611
  super();
34875
- this.initialize();
34876
- }
34877
- initialize() {
34878
34612
  this.pointers = new Map();
34879
34613
  this.initialized = false;
34880
34614
  this.state = STAR_TOOL_STATE.IDLE;
@@ -34911,7 +34645,7 @@ var WeaveStarToolAction = class extends WeaveAction {
34911
34645
  this.cancelAction();
34912
34646
  return;
34913
34647
  }
34914
- }, { signal: this.instance.getEventsController()?.signal });
34648
+ });
34915
34649
  stage.on("pointerdown", (e) => {
34916
34650
  this.setTapStart(e);
34917
34651
  this.pointers.set(e.evt.pointerId, {
@@ -35076,8 +34810,8 @@ var WeaveStarToolAction = class extends WeaveAction {
35076
34810
 
35077
34811
  //#endregion
35078
34812
  //#region src/actions/arrow-tool/constants.ts
35079
- const WEAVE_ARROW_TOOL_ACTION_NAME = "arrowTool";
35080
- const WEAVE_ARROW_TOOL_STATE = {
34813
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
34814
+ const ARROW_TOOL_STATE = {
35081
34815
  ["IDLE"]: "idle",
35082
34816
  ["ADDING"]: "adding",
35083
34817
  ["DEFINING_SIZE"]: "definingSize",
@@ -35093,12 +34827,9 @@ var WeaveArrowToolAction = class extends WeaveAction {
35093
34827
  onInit = void 0;
35094
34828
  constructor() {
35095
34829
  super();
35096
- this.initialize();
35097
- }
35098
- initialize() {
35099
34830
  this.pointers = new Map();
35100
34831
  this.initialized = false;
35101
- this.state = WEAVE_ARROW_TOOL_STATE.IDLE;
34832
+ this.state = ARROW_TOOL_STATE.IDLE;
35102
34833
  this.arrowId = null;
35103
34834
  this.tempArrowId = null;
35104
34835
  this.tempMainArrowNode = null;
@@ -35111,7 +34842,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35111
34842
  this.props = this.initProps();
35112
34843
  }
35113
34844
  getName() {
35114
- return WEAVE_ARROW_TOOL_ACTION_NAME;
34845
+ return ARROW_TOOL_ACTION_NAME;
35115
34846
  }
35116
34847
  initProps() {
35117
34848
  return {
@@ -35128,37 +34859,40 @@ var WeaveArrowToolAction = class extends WeaveAction {
35128
34859
  setupEvents() {
35129
34860
  const stage = this.instance.getStage();
35130
34861
  window.addEventListener("keydown", (e) => {
35131
- if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
34862
+ if (e.code === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
35132
34863
  this.cancelAction();
35133
34864
  return;
35134
34865
  }
35135
- if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) this.cancelAction();
35136
- }, { signal: this.instance.getEventsController()?.signal });
34866
+ if (e.code === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34867
+ this.cancelAction();
34868
+ return;
34869
+ }
34870
+ });
35137
34871
  stage.on("pointerdown", (e) => {
35138
34872
  this.setTapStart(e);
35139
34873
  this.pointers.set(e.evt.pointerId, {
35140
34874
  x: e.evt.clientX,
35141
34875
  y: e.evt.clientY
35142
34876
  });
35143
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35144
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34877
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34878
+ this.state = ARROW_TOOL_STATE.ADDING;
35145
34879
  return;
35146
34880
  }
35147
- if (!this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.handleAdding();
35148
- if (this.tempMainArrowNode && this.state === WEAVE_ARROW_TOOL_STATE.ADDING) this.state = WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE;
34881
+ if (!this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.handleAdding();
34882
+ if (this.tempMainArrowNode && this.state === ARROW_TOOL_STATE.ADDING) this.state = ARROW_TOOL_STATE.DEFINING_SIZE;
35149
34883
  });
35150
34884
  stage.on("pointermove", () => {
35151
- if (this.state === WEAVE_ARROW_TOOL_STATE.IDLE) return;
34885
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
35152
34886
  this.setCursor();
35153
- if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_ARROW_TOOL_ACTION_NAME) {
35154
- this.state = WEAVE_ARROW_TOOL_STATE.ADDING;
34887
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
34888
+ this.state = ARROW_TOOL_STATE.ADDING;
35155
34889
  return;
35156
34890
  }
35157
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
34891
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
35158
34892
  });
35159
34893
  stage.on("pointerup", (e) => {
35160
34894
  this.pointers.delete(e.evt.pointerId);
35161
- if (this.state === WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
34895
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
35162
34896
  });
35163
34897
  this.initialized = true;
35164
34898
  }
@@ -35172,7 +34906,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35172
34906
  this.tempPoint = void 0;
35173
34907
  this.tempNextPoint = void 0;
35174
34908
  this.clickPoint = null;
35175
- this.setState(WEAVE_ARROW_TOOL_STATE.ADDING);
34909
+ this.setState(ARROW_TOOL_STATE.ADDING);
35176
34910
  }
35177
34911
  handleAdding() {
35178
34912
  const stage = this.instance.getStage();
@@ -35223,7 +34957,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35223
34957
  this.measureContainer?.add(this.tempNextPoint);
35224
34958
  this.tempPoint.moveToTop();
35225
34959
  this.tempNextPoint.moveToTop();
35226
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34960
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35227
34961
  }
35228
34962
  }
35229
34963
  handleSettingSize() {
@@ -35250,11 +34984,11 @@ var WeaveArrowToolAction = class extends WeaveAction {
35250
34984
  y: mousePoint.y,
35251
34985
  points: [0, 0]
35252
34986
  });
35253
- this.setState(WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE);
34987
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
35254
34988
  }
35255
34989
  }
35256
34990
  handleMovement() {
35257
- if (this.state !== WEAVE_ARROW_TOOL_STATE.DEFINING_SIZE) return;
34991
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
35258
34992
  if (this.arrowId && this.tempArrowNode && this.measureContainer && this.tempNextPoint) {
35259
34993
  const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
35260
34994
  this.tempArrowNode.setAttrs({
@@ -35321,7 +35055,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
35321
35055
  this.container = void 0;
35322
35056
  this.measureContainer = void 0;
35323
35057
  this.clickPoint = null;
35324
- this.setState(WEAVE_ARROW_TOOL_STATE.IDLE);
35058
+ this.setState(ARROW_TOOL_STATE.IDLE);
35325
35059
  }
35326
35060
  setCursor() {
35327
35061
  const stage = this.instance.getStage();
@@ -35365,15 +35099,13 @@ const WEAVE_STROKE_TOOL_DEFAULT_CONFIG = { snapAngles: {
35365
35099
  var WeaveStrokeToolAction = class extends WeaveAction {
35366
35100
  initialized = false;
35367
35101
  initialCursor = null;
35102
+ snappedAngle = null;
35368
35103
  shiftPressed = false;
35369
35104
  onPropsChange = void 0;
35370
35105
  onInit = void 0;
35371
35106
  constructor(params) {
35372
35107
  super();
35373
35108
  this.config = mergeExceptArrays(WEAVE_STROKE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
35374
- this.initialize();
35375
- }
35376
- initialize() {
35377
35109
  this.pointers = new Map();
35378
35110
  this.initialized = false;
35379
35111
  this.state = WEAVE_STROKE_TOOL_STATE.IDLE;
@@ -35382,6 +35114,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35382
35114
  this.tempLineId = null;
35383
35115
  this.tempLineNode = null;
35384
35116
  this.container = void 0;
35117
+ this.snappedAngle = null;
35385
35118
  this.measureContainer = void 0;
35386
35119
  this.clickPoint = null;
35387
35120
  this.snapper = new GreedySnapper({
@@ -35394,9 +35127,6 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35394
35127
  getName() {
35395
35128
  return WEAVE_STROKE_TOOL_ACTION_NAME;
35396
35129
  }
35397
- getNames() {
35398
- return [WEAVE_STROKE_TOOL_ACTION_NAME, ...WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES];
35399
- }
35400
35130
  hasAliases() {
35401
35131
  return true;
35402
35132
  }
@@ -35415,26 +35145,32 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35415
35145
  setupEvents() {
35416
35146
  const stage = this.instance.getStage();
35417
35147
  window.addEventListener("keydown", (e) => {
35418
- if (e.code === "Enter" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35148
+ if (e.code === "Enter" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35419
35149
  this.cancelAction();
35420
35150
  return;
35421
35151
  }
35422
- if (e.code === "Escape" && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35152
+ if (e.code === "Escape" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35423
35153
  this.cancelAction();
35424
35154
  return;
35425
35155
  }
35426
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = true;
35427
- }, { signal: this.instance.getEventsController()?.signal });
35156
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35157
+ this.snappedAngle = null;
35158
+ this.shiftPressed = true;
35159
+ }
35160
+ });
35428
35161
  window.addEventListener("keyup", (e) => {
35429
- if (e.key === "Shift" && this.getNames().includes(this.instance.getActiveAction() ?? "")) this.shiftPressed = false;
35430
- }, { signal: this.instance.getEventsController()?.signal });
35162
+ if (e.key === "Shift" && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35163
+ this.snappedAngle = null;
35164
+ this.shiftPressed = false;
35165
+ }
35166
+ });
35431
35167
  stage.on("pointerdown", (e) => {
35432
35168
  this.setTapStart(e);
35433
35169
  this.pointers.set(e.evt.pointerId, {
35434
35170
  x: e.evt.clientX,
35435
35171
  y: e.evt.clientY
35436
35172
  });
35437
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35173
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35438
35174
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35439
35175
  return;
35440
35176
  }
@@ -35444,7 +35180,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35444
35180
  stage.on("pointermove", () => {
35445
35181
  if (this.state === WEAVE_STROKE_TOOL_STATE.IDLE) return;
35446
35182
  this.setCursor();
35447
- if (this.pointers.size === 2 && this.getNames().includes(this.instance.getActiveAction() ?? "")) {
35183
+ if (this.pointers.size === 2 && this.instance.getActiveAction() === WEAVE_STROKE_TOOL_ACTION_NAME) {
35448
35184
  this.state = WEAVE_STROKE_TOOL_STATE.ADDING;
35449
35185
  return;
35450
35186
  }
@@ -35462,7 +35198,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35462
35198
  addLine() {
35463
35199
  this.setCursor();
35464
35200
  this.setFocusStage();
35465
- this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35201
+ this.instance.emitEvent("onAddingStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35466
35202
  this.shiftPressed = false;
35467
35203
  this.clickPoint = null;
35468
35204
  this.setState(WEAVE_STROKE_TOOL_STATE.ADDING);
@@ -35570,7 +35306,7 @@ var WeaveStrokeToolAction = class extends WeaveAction {
35570
35306
  });
35571
35307
  delete finalLine.props.dragBoundFunc;
35572
35308
  this.instance.addNode(finalLine, this.container?.getAttrs().id);
35573
- this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? "not-defined" });
35309
+ this.instance.emitEvent("onAddedStroke", { actionName: this.instance.getActiveAction() ?? WEAVE_STROKE_TOOL_ACTION_NAME });
35574
35310
  nodeCreated = true;
35575
35311
  }
35576
35312
  }
@@ -35620,9 +35356,6 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35620
35356
  onInit = void 0;
35621
35357
  constructor() {
35622
35358
  super();
35623
- this.initialize();
35624
- }
35625
- initialize() {
35626
35359
  this.pointers = new Map();
35627
35360
  this.initialized = false;
35628
35361
  this.state = REGULAR_POLYGON_TOOL_STATE.IDLE;
@@ -35657,7 +35390,7 @@ var WeaveRegularPolygonToolAction = class extends WeaveAction {
35657
35390
  this.cancelAction();
35658
35391
  return;
35659
35392
  }
35660
- }, { signal: this.instance.getEventsController()?.signal });
35393
+ });
35661
35394
  stage.on("pointerdown", (e) => {
35662
35395
  this.setTapStart(e);
35663
35396
  this.pointers.set(e.evt.pointerId, {
@@ -35831,9 +35564,6 @@ var WeaveFrameToolAction = class extends WeaveAction {
35831
35564
  onInit = void 0;
35832
35565
  constructor() {
35833
35566
  super();
35834
- this.initialize();
35835
- }
35836
- initialize() {
35837
35567
  this.initialized = false;
35838
35568
  this.state = FRAME_TOOL_STATE.IDLE;
35839
35569
  this.frameId = null;
@@ -35861,7 +35591,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
35861
35591
  this.cancelAction();
35862
35592
  return;
35863
35593
  }
35864
- }, { signal: this.instance.getEventsController()?.signal });
35594
+ });
35865
35595
  stage.on("pointermove", () => {
35866
35596
  if (this.state === FRAME_TOOL_STATE.IDLE) return;
35867
35597
  this.setCursor();
@@ -35963,10 +35693,6 @@ var WeaveExportStageToolAction = class extends WeaveAction {
35963
35693
  };
35964
35694
  onPropsChange = void 0;
35965
35695
  onInit = void 0;
35966
- initialize = void 0;
35967
- constructor() {
35968
- super();
35969
- }
35970
35696
  getName() {
35971
35697
  return EXPORT_STAGE_TOOL_ACTION_NAME;
35972
35698
  }
@@ -36014,10 +35740,6 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
36014
35740
  };
36015
35741
  onPropsChange = void 0;
36016
35742
  onInit = void 0;
36017
- initialize = void 0;
36018
- constructor() {
36019
- super();
36020
- }
36021
35743
  getName() {
36022
35744
  return EXPORT_NODES_TOOL_ACTION_NAME;
36023
35745
  }
@@ -36070,9 +35792,6 @@ var WeaveAlignNodesToolAction = class extends WeaveAction {
36070
35792
  onInit = void 0;
36071
35793
  constructor() {
36072
35794
  super();
36073
- this.initialize();
36074
- }
36075
- initialize() {
36076
35795
  this.initialized = false;
36077
35796
  this.state = ALIGN_NODES_TOOL_STATE.IDLE;
36078
35797
  }
@@ -36322,9 +36041,6 @@ var WeaveCommentToolAction = class extends WeaveAction {
36322
36041
  super();
36323
36042
  const { config } = params ?? {};
36324
36043
  this.config = mergeExceptArrays(WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, config);
36325
- this.initialize();
36326
- }
36327
- initialize() {
36328
36044
  this.pointers = new Map();
36329
36045
  this.initialized = false;
36330
36046
  this.state = WEAVE_COMMENT_TOOL_STATE.IDLE;
@@ -36402,7 +36118,7 @@ var WeaveCommentToolAction = class extends WeaveAction {
36402
36118
  return;
36403
36119
  }
36404
36120
  if (e.code === "Escape" && this.state === WEAVE_COMMENT_TOOL_STATE.CREATING_COMMENT) this.setState(WEAVE_COMMENT_TOOL_STATE.ADDING);
36405
- }, { signal: this.instance.getEventsController()?.signal });
36121
+ });
36406
36122
  stage.on("pointermove", (e) => {
36407
36123
  if (this.state === WEAVE_COMMENT_TOOL_STATE.IDLE) return;
36408
36124
  if (commentNodeHandler?.isCommentViewing()) {
@@ -36553,9 +36269,6 @@ var WeaveVideoToolAction = class extends WeaveAction {
36553
36269
  update = void 0;
36554
36270
  constructor() {
36555
36271
  super();
36556
- this.initialize();
36557
- }
36558
- initialize() {
36559
36272
  this.pointers = new Map();
36560
36273
  this.initialized = false;
36561
36274
  this.state = VIDEO_TOOL_STATE.IDLE;
@@ -36602,7 +36315,7 @@ var WeaveVideoToolAction = class extends WeaveAction {
36602
36315
  this.cancelAction();
36603
36316
  return;
36604
36317
  }
36605
- }, { signal: this.instance.getEventsController()?.signal });
36318
+ });
36606
36319
  stage.on("pointerdown", (e) => {
36607
36320
  this.setTapStart(e);
36608
36321
  this.pointers.set(e.evt.pointerId, {
@@ -36735,9 +36448,6 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36735
36448
  constructor(params) {
36736
36449
  super();
36737
36450
  this.config = mergeExceptArrays(WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
36738
- this.initialize();
36739
- }
36740
- initialize() {
36741
36451
  this.initialized = false;
36742
36452
  this.state = MEASURE_TOOL_STATE.IDLE;
36743
36453
  this.measureId = null;
@@ -36764,7 +36474,7 @@ var WeaveMeasureToolAction = class extends WeaveAction {
36764
36474
  const stage = this.instance.getStage();
36765
36475
  window.addEventListener("keydown", (e) => {
36766
36476
  if (e.code === "Escape" && this.instance.getActiveAction() === MEASURE_TOOL_ACTION_NAME) this.cancelAction();
36767
- }, { signal: this.instance.getEventsController()?.signal });
36477
+ });
36768
36478
  stage.on("pointermove", () => {
36769
36479
  if (this.state === MEASURE_TOOL_STATE.IDLE) return;
36770
36480
  if (this.state === MEASURE_TOOL_STATE.SET_TO) {
@@ -37034,9 +36744,6 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37034
36744
  constructor(params) {
37035
36745
  super();
37036
36746
  this.config = mergeExceptArrays(CONNECTOR_TOOL_DEFAULT_CONFIG, params?.config);
37037
- this.initialize();
37038
- }
37039
- initialize() {
37040
36747
  this.pointers = new Map();
37041
36748
  this.initialized = false;
37042
36749
  this.tempLineNode = null;
@@ -37075,7 +36782,7 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37075
36782
  return;
37076
36783
  }
37077
36784
  if (e.code === "Escape" && this.instance.getActiveAction() === CONNECTOR_TOOL_ACTION_NAME) this.cancelAction();
37078
- }, { signal: this.instance.getEventsController()?.signal });
36785
+ });
37079
36786
  let nodeHovered = void 0;
37080
36787
  stage.on("pointermove", () => {
37081
36788
  if (!(this.state === CONNECTOR_TOOL_STATE.SELECTING_INITIAL || this.state === CONNECTOR_TOOL_STATE.SELECTING_FINAL)) return;
@@ -37390,17 +37097,18 @@ var WeaveConnectorToolAction = class extends WeaveAction {
37390
37097
  //#endregion
37391
37098
  //#region src/plugins/stage-grid/stage-grid.ts
37392
37099
  var WeaveStageGridPlugin = class extends WeavePlugin {
37100
+ actStageZoomX = 1;
37101
+ actStageZoomY = 1;
37102
+ actStagePosX = 0;
37103
+ actStagePosY = 0;
37393
37104
  constructor(params) {
37394
37105
  super();
37395
37106
  const { config } = params ?? {};
37396
- this.config = {
37397
- type: WEAVE_GRID_DEFAULT_TYPE,
37398
- gridColor: WEAVE_GRID_DEFAULT_COLOR,
37399
- gridOriginColor: WEAVE_GRID_DEFAULT_ORIGIN_COLOR,
37400
- gridSize: WEAVE_GRID_DEFAULT_SIZE,
37401
- gridDotMaxDotsPerAxis: WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS,
37402
- ...config
37403
- };
37107
+ this.moveToolActive = false;
37108
+ this.isMouseMiddleButtonPressed = false;
37109
+ this.isSpaceKeyPressed = false;
37110
+ this.forceStageChange = false;
37111
+ this.config = mergeExceptArrays(WEAVE_GRID_DEFAULT_CONFIG, config);
37404
37112
  this.initialize();
37405
37113
  }
37406
37114
  initialize() {
@@ -37408,10 +37116,6 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37408
37116
  this.isMouseMiddleButtonPressed = false;
37409
37117
  this.isSpaceKeyPressed = false;
37410
37118
  this.forceStageChange = false;
37411
- this.actStagePosX = 0;
37412
- this.actStagePosY = 0;
37413
- this.actStageZoomX = 1;
37414
- this.actStageZoomY = 1;
37415
37119
  }
37416
37120
  getName() {
37417
37121
  return WEAVE_STAGE_GRID_PLUGIN_KEY;
@@ -37436,10 +37140,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37436
37140
  const stage = this.instance.getStage();
37437
37141
  window.addEventListener("keydown", (e) => {
37438
37142
  if (e.code === "Space") this.isSpaceKeyPressed = true;
37439
- }, { signal: this.instance.getEventsController()?.signal });
37143
+ });
37440
37144
  window.addEventListener("keyup", (e) => {
37441
37145
  if (e.code === "Space") this.isSpaceKeyPressed = false;
37442
- }, { signal: this.instance.getEventsController()?.signal });
37146
+ });
37443
37147
  this.instance.addEventListener("onStageMove", () => {
37444
37148
  this.onRender();
37445
37149
  });
@@ -37467,10 +37171,14 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37467
37171
  const layer = stage.findOne(`#${WEAVE_GRID_LAYER_ID}`);
37468
37172
  return layer;
37469
37173
  }
37174
+ getShapeAdaptiveSpacing(baseSpacing, scale) {
37175
+ const factor = Math.pow(2, Math.floor(Math.log2(1 / scale)));
37176
+ return baseSpacing * factor;
37177
+ }
37470
37178
  getAdaptiveSpacing(scale) {
37471
37179
  const baseGridSpacing = this.config.gridSize;
37472
- const minPixelSpacing = 8;
37473
- const maxPixelSpacing = 100;
37180
+ const minPixelSpacing = this.config.gridSize;
37181
+ const maxPixelSpacing = this.config.gridSize * 2;
37474
37182
  let spacing = baseGridSpacing;
37475
37183
  let pixelSpacing = spacing * scale;
37476
37184
  while (pixelSpacing < minPixelSpacing) {
@@ -37485,17 +37193,6 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37485
37193
  const snappedSpacing = baseGridSpacing * Math.pow(2, logFactor);
37486
37194
  return snappedSpacing;
37487
37195
  }
37488
- getAdjustedSpacing(startX, endX, startY, endY, baseSpacing = 50) {
37489
- let spacing = baseSpacing;
37490
- let dotCountX = Math.ceil((endX - startX) / spacing);
37491
- let dotCountY = Math.ceil((endY - startY) / spacing);
37492
- while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && spacing < 1e6) {
37493
- spacing *= 2;
37494
- dotCountX = Math.ceil((endX - startX) / spacing);
37495
- dotCountY = Math.ceil((endY - startY) / spacing);
37496
- }
37497
- return spacing;
37498
- }
37499
37196
  renderGridLines() {
37500
37197
  const stage = this.instance.getStage();
37501
37198
  const gridLayer = this.getLayer();
@@ -37504,7 +37201,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37504
37201
  if (!this.enabled) return;
37505
37202
  const scale = stage.scaleX();
37506
37203
  const spacing = this.getAdaptiveSpacing(scale);
37507
- const invScale = (this.config.gridStroke ?? WEAVE_GRID_DEFAULT_STROKE) / scale;
37204
+ const invScale = this.config.gridStroke / scale;
37508
37205
  const offsetX = -stage.x() / stage.scaleX();
37509
37206
  const offsetY = -stage.y() / stage.scaleY();
37510
37207
  const margin = 2;
@@ -37514,11 +37211,19 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37514
37211
  const startY = Math.floor((offsetY - margin * worldHeight) / spacing) * spacing;
37515
37212
  const endX = offsetX + (1 + margin) * worldWidth;
37516
37213
  const endY = offsetY + (1 + margin) * worldHeight;
37517
- const highlightEvery = this.config.gridMajorEvery ?? WEAVE_GRID_DEFAULT_MAJOR_EVERY;
37214
+ const highlightEvery = this.config.gridMajorEvery;
37518
37215
  for (let x = startX; x <= endX; x += spacing) {
37519
37216
  const index = Math.round(x / spacing);
37520
37217
  const isHighlight = index % highlightEvery === 0;
37521
37218
  const isOrigin = Math.abs(x) < spacing / 2;
37219
+ let stroke = this.config.gridColor;
37220
+ if (isOrigin) stroke = this.config.gridOriginColor;
37221
+ else if (isHighlight) stroke = this.config.gridMajorColor;
37222
+ let strokeWidth = invScale;
37223
+ if (isHighlight || isOrigin) strokeWidth = invScale * this.config.gridMajorRatio;
37224
+ let zIndex = 1;
37225
+ if (isOrigin) zIndex = 3;
37226
+ else if (isHighlight) zIndex = 2;
37522
37227
  const line = new Konva.Line({
37523
37228
  points: [
37524
37229
  x,
@@ -37526,9 +37231,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37526
37231
  x,
37527
37232
  endY
37528
37233
  ],
37529
- stroke: isOrigin ? this.config.gridOriginColor : this.config.gridColor,
37530
- strokeWidth: !isHighlight && !isOrigin ? invScale : invScale * (this.config.gridMajorRatio ?? WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO),
37531
- listening: false
37234
+ stroke,
37235
+ strokeWidth,
37236
+ listening: false,
37237
+ zIndex
37532
37238
  });
37533
37239
  gridLayer.add(line);
37534
37240
  }
@@ -37536,6 +37242,14 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37536
37242
  const index = Math.round(y / spacing);
37537
37243
  const isHighlight = index % highlightEvery === 0;
37538
37244
  const isOrigin = Math.abs(y) < spacing / 2;
37245
+ let stroke = this.config.gridColor;
37246
+ if (isOrigin) stroke = this.config.gridOriginColor;
37247
+ else if (isHighlight) stroke = this.config.gridMajorColor;
37248
+ let strokeWidth = invScale;
37249
+ if (isHighlight || isOrigin) strokeWidth = invScale * this.config.gridMajorRatio;
37250
+ let zIndex = 1;
37251
+ if (isOrigin) zIndex = 3;
37252
+ else if (isHighlight) zIndex = 2;
37539
37253
  const line = new Konva.Line({
37540
37254
  points: [
37541
37255
  startX,
@@ -37543,9 +37257,10 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37543
37257
  endX,
37544
37258
  y
37545
37259
  ],
37546
- stroke: isOrigin ? this.config.gridOriginColor : this.config.gridColor,
37547
- strokeWidth: !isHighlight && !isOrigin ? invScale : invScale * 2,
37548
- listening: false
37260
+ stroke,
37261
+ strokeWidth,
37262
+ listening: false,
37263
+ zIndex
37549
37264
  });
37550
37265
  gridLayer.add(line);
37551
37266
  }
@@ -37556,67 +37271,78 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37556
37271
  if (!gridLayer) return;
37557
37272
  gridLayer.destroyChildren();
37558
37273
  if (!this.enabled) return;
37559
- const scale = stage.scaleX();
37560
- const spacing = this.getAdaptiveSpacing(scale);
37561
- const invScale = (this.config.gridDotRadius ?? WEAVE_GRID_DEFAULT_RADIUS) / scale;
37562
- const position = stage.position();
37563
- const offsetX = -position.x * invScale;
37564
- const offsetY = -position.y * invScale;
37565
- const margin = 2;
37566
- const worldWidth = stage.width() * invScale;
37567
- const worldHeight = stage.height() * invScale;
37568
- let startX = Math.floor((offsetX - margin * worldWidth) / spacing) * spacing;
37569
- const endX = offsetX + (1 + margin) * worldWidth;
37570
- let startY = Math.floor((offsetY - margin * worldHeight) / spacing) * spacing;
37571
- const endY = offsetY + (1 + margin) * worldHeight;
37572
- let adjustedSpacing = spacing;
37573
- let dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
37574
- let dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
37575
- while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && adjustedSpacing < 1e6) {
37576
- adjustedSpacing *= 2;
37577
- dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
37578
- dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
37579
- }
37580
- this.getAdjustedSpacing(startX, endX, startY, endY, spacing);
37581
- startX = Math.floor((offsetX - margin * worldWidth) / adjustedSpacing) * adjustedSpacing;
37582
- startY = Math.floor((offsetY - margin * worldHeight) / adjustedSpacing) * adjustedSpacing;
37583
- const highlightEvery = this.config.gridMajorEvery ?? WEAVE_GRID_DEFAULT_MAJOR_EVERY;
37584
- const majorColor = this.config.gridColor;
37585
- const gridMajorRatio = this.config.gridMajorRatio ?? WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO;
37586
- const majorShape = new Konva.Shape({ sceneFunc: function(context) {
37587
- context.beginPath();
37588
- for (let x = startX; x <= endX; x += adjustedSpacing) for (let y = startY; y <= endY; y += adjustedSpacing) {
37589
- if (Math.abs(x) < spacing / 2 || Math.abs(y) < spacing / 2) continue;
37590
- const indexX = Math.round(x / spacing);
37591
- const indexY = Math.round(y / spacing);
37592
- const isHighlightX = indexX % highlightEvery === 0;
37593
- const isHighlightY = indexY % highlightEvery === 0;
37594
- const radius = !(isHighlightX || isHighlightY) ? invScale : invScale * gridMajorRatio;
37595
- context.moveTo(x + radius, y);
37596
- context.arc(x, y, radius, 0, Math.PI * 2, false);
37597
- }
37598
- context.fillStyle = majorColor;
37599
- context.fill();
37600
- } });
37601
- gridLayer.add(majorShape);
37602
- const originColor = this.config.gridOriginColor;
37603
- const originShape = new Konva.Shape({ sceneFunc: function(context) {
37604
- context.beginPath();
37605
- for (let x = startX; x <= endX; x += adjustedSpacing) {
37606
- const radius = invScale * gridMajorRatio;
37607
- context.moveTo(x + radius, 0);
37608
- context.arc(x, 0, radius, 0, Math.PI * 2);
37609
- }
37610
- for (let y = startY; y <= endY; y += adjustedSpacing) {
37611
- const radius = invScale * gridMajorRatio;
37612
- if (Math.abs(y) < spacing / 2) continue;
37613
- context.moveTo(0 + radius, y);
37614
- context.arc(0, y, radius, 0, Math.PI * 2);
37615
- }
37616
- context.fillStyle = originColor;
37617
- context.fill();
37618
- } });
37619
- gridLayer.add(originShape);
37274
+ const grid = new Konva.Shape({
37275
+ listening: false,
37276
+ sceneFunc: (ctx) => {
37277
+ const dotType = this.config.gridDotType;
37278
+ const scale = stage.scaleX();
37279
+ const pos = stage.position();
37280
+ const baseSpacing = this.config.gridSize;
37281
+ const spacing = this.getShapeAdaptiveSpacing(baseSpacing, scale);
37282
+ const highlightEvery = this.config.gridMajorEvery;
37283
+ const defaultColor = this.config.gridColor;
37284
+ const majorColor = this.config.gridMajorColor;
37285
+ const centerColor = this.config.gridOriginColor;
37286
+ if (dotType === WEAVE_GRID_DOT_TYPES.CIRCLE) {
37287
+ const scale$1 = stage.scaleX();
37288
+ const pos$1 = stage.position();
37289
+ const topLeftX = -pos$1.x / scale$1;
37290
+ const topLeftY = -pos$1.y / scale$1;
37291
+ const viewWidth = stage.width() / scale$1;
37292
+ const viewHeight = stage.height() / scale$1;
37293
+ const startX = Math.floor(topLeftX / spacing) * spacing;
37294
+ const startY = Math.floor(topLeftY / spacing) * spacing;
37295
+ const dotRadius = this.config.gridDotRadius;
37296
+ const dotMajorRadius = dotRadius * this.config.gridMajorRatio;
37297
+ for (let x = startX; x < topLeftX + viewWidth; x += spacing) for (let y = startY; y < topLeftY + viewHeight; y += spacing) {
37298
+ const indexX = Math.round(x / spacing);
37299
+ const indexY = Math.round(y / spacing);
37300
+ const isHighlightX = indexX % highlightEvery === 0;
37301
+ const isHighlightY = indexY % highlightEvery === 0;
37302
+ const isHighlight = isHighlightX || isHighlightY;
37303
+ const isOriginX = Math.abs(x) < spacing / 2;
37304
+ const isOriginY = Math.abs(y) < spacing / 2;
37305
+ const isOrigin = isOriginX || isOriginY;
37306
+ let fillStyle = defaultColor;
37307
+ if (isOrigin) fillStyle = centerColor;
37308
+ else if (isHighlight) fillStyle = majorColor;
37309
+ ctx.fillStyle = fillStyle;
37310
+ ctx.beginPath();
37311
+ ctx.arc(x, y, (isHighlight ? dotMajorRadius : dotRadius) / scale$1, 0, Math.PI * 2);
37312
+ ctx.fill();
37313
+ }
37314
+ }
37315
+ if (dotType === WEAVE_GRID_DOT_TYPES.SQUARE) {
37316
+ const topLeftX = -pos.x / scale;
37317
+ const topLeftY = -pos.y / scale;
37318
+ const viewWidth = stage.width() / scale;
37319
+ const viewHeight = stage.height() / scale;
37320
+ const startX = Math.floor(topLeftX / spacing) * spacing;
37321
+ const startY = Math.floor(topLeftY / spacing) * spacing;
37322
+ const defaultSize = this.config.gridDotRectSize;
37323
+ const majorSize = defaultSize * this.config.gridMajorRatio;
37324
+ for (let x = startX; x < topLeftX + viewWidth; x += spacing) for (let y = startY; y < topLeftY + viewHeight; y += spacing) {
37325
+ const sx = Math.round(x * scale) / scale;
37326
+ const sy = Math.round(y * scale) / scale;
37327
+ const indexX = Math.round(sx / spacing);
37328
+ const indexY = Math.round(sy / spacing);
37329
+ const isHighlightX = indexX % highlightEvery === 0;
37330
+ const isHighlightY = indexY % highlightEvery === 0;
37331
+ const isHighlight = isHighlightX || isHighlightY;
37332
+ const isOriginX = Math.abs(sx) < spacing / 2;
37333
+ const isOriginY = Math.abs(sy) < spacing / 2;
37334
+ const isOrigin = isOriginX || isOriginY;
37335
+ let fillStyle = defaultColor;
37336
+ if (isOrigin) fillStyle = centerColor;
37337
+ else if (isHighlight) fillStyle = majorColor;
37338
+ ctx.fillStyle = fillStyle;
37339
+ const size = (isHighlight ? majorSize : defaultSize) / scale;
37340
+ ctx.fillRect(sx - size / 2, sy - size / 2, size, size);
37341
+ }
37342
+ }
37343
+ }
37344
+ });
37345
+ gridLayer.add(grid);
37620
37346
  }
37621
37347
  hasStageChanged() {
37622
37348
  if (this.forceStageChange) {
@@ -37653,11 +37379,13 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37653
37379
  enable() {
37654
37380
  this.enabled = true;
37655
37381
  this.getLayer()?.show();
37382
+ this.forceStageChange = true;
37656
37383
  this.onRender();
37657
37384
  }
37658
37385
  disable() {
37659
37386
  this.enabled = false;
37660
37387
  this.getLayer()?.hide();
37388
+ this.forceStageChange = true;
37661
37389
  this.onRender();
37662
37390
  }
37663
37391
  getType() {
@@ -37668,19 +37396,28 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
37668
37396
  this.forceStageChange = true;
37669
37397
  this.onRender();
37670
37398
  }
37399
+ getDotsType() {
37400
+ return this.config.gridDotType;
37401
+ }
37402
+ setDotsType(type) {
37403
+ this.config.gridDotType = type;
37404
+ this.forceStageChange = true;
37405
+ this.onRender();
37406
+ }
37671
37407
  };
37672
37408
 
37673
37409
  //#endregion
37674
37410
  //#region src/plugins/stage-panning/stage-panning.ts
37675
37411
  var WeaveStagePanningPlugin = class extends WeavePlugin {
37412
+ panning = false;
37413
+ currentPointer = null;
37414
+ stageScrollInterval = void 0;
37415
+ panEdgeTargets = {};
37676
37416
  getLayerName = void 0;
37677
37417
  initLayer = void 0;
37678
37418
  constructor(params) {
37679
37419
  super();
37680
37420
  this.config = mergeExceptArrays(WEAVE_STAGE_PANNING_DEFAULT_CONFIG, params?.config ?? {});
37681
- this.initialize();
37682
- }
37683
- initialize() {
37684
37421
  this.pointers = new Map();
37685
37422
  this.panning = false;
37686
37423
  this.isDragging = false;
@@ -37692,9 +37429,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37692
37429
  this.isCtrlOrMetaPressed = false;
37693
37430
  this.isSpaceKeyPressed = false;
37694
37431
  this.previousPointer = null;
37695
- this.currentPointer = null;
37696
- this.stageScrollInterval = void 0;
37697
- this.panEdgeTargets = {};
37698
37432
  }
37699
37433
  getName() {
37700
37434
  return WEAVE_STAGE_PANNING_KEY;
@@ -37728,7 +37462,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37728
37462
  this.isSpaceKeyPressed = true;
37729
37463
  this.setCursor();
37730
37464
  }
37731
- }, { signal: this.instance.getEventsController()?.signal });
37465
+ });
37732
37466
  window.addEventListener("keyup", (e) => {
37733
37467
  if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
37734
37468
  if (e.code === "Space") {
@@ -37739,7 +37473,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37739
37473
  this.isSpaceKeyPressed = false;
37740
37474
  this.disableMove();
37741
37475
  }
37742
- }, { signal: this.instance.getEventsController()?.signal });
37476
+ });
37743
37477
  let lastPos = null;
37744
37478
  stage.on("pointerdown", (e) => {
37745
37479
  this.pointers.set(e.evt.pointerId, {
@@ -37812,10 +37546,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37812
37546
  this.instance.emitEvent("onStageMove");
37813
37547
  };
37814
37548
  const handleWheelThrottled = (0, import_lodash.throttle)(handleWheel, WEAVE_STAGE_PANNING_THROTTLE_MS);
37815
- window.addEventListener("wheel", handleWheelThrottled, {
37816
- passive: true,
37817
- signal: this.instance.getEventsController()?.signal
37818
- });
37549
+ window.addEventListener("wheel", handleWheelThrottled, { passive: true });
37819
37550
  stage.on("dragstart", (e) => {
37820
37551
  const duration = 1e3 / 60;
37821
37552
  if (this.panEdgeTargets[e.target.getAttrs().id ?? ""] !== void 0) return;
@@ -37873,10 +37604,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
37873
37604
  stage.container().style.setProperty("-webkit-user-drag", "none");
37874
37605
  stage.getContent().addEventListener("touchmove", function(e) {
37875
37606
  e.preventDefault();
37876
- }, {
37877
- passive: false,
37878
- signal: this.instance.getEventsController()?.signal
37879
- });
37607
+ }, { passive: false });
37880
37608
  }
37881
37609
  isPanning() {
37882
37610
  return this.panning;
@@ -37954,9 +37682,6 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
37954
37682
  constructor(params) {
37955
37683
  super();
37956
37684
  this.config = mergeExceptArrays(STAGE_MINIMAP_DEFAULT_CONFIG, params.config);
37957
- this.initialize();
37958
- }
37959
- initialize() {
37960
37685
  this.initialized = false;
37961
37686
  }
37962
37687
  getName() {
@@ -38134,7 +37859,6 @@ const WEAVE_STAGE_RESIZE_KEY = "stageResize";
38134
37859
  var WeaveStageResizePlugin = class extends WeavePlugin {
38135
37860
  getLayerName = void 0;
38136
37861
  initLayer = void 0;
38137
- initialize = void 0;
38138
37862
  getName() {
38139
37863
  return WEAVE_STAGE_RESIZE_KEY;
38140
37864
  }
@@ -38154,10 +37878,6 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38154
37878
  const pluginInstance = plugins[pluginId];
38155
37879
  pluginInstance.onRender?.();
38156
37880
  }
38157
- this.instance.emitEvent("onStageResize", {
38158
- width: stage.width(),
38159
- height: stage.height()
38160
- });
38161
37881
  }
38162
37882
  }
38163
37883
  onInit() {
@@ -38166,7 +37886,7 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38166
37886
  }, DEFAULT_THROTTLE_MS);
38167
37887
  window.addEventListener("resize", () => {
38168
37888
  throttledResize();
38169
- }, { signal: this.instance.getEventsController()?.signal });
37889
+ });
38170
37890
  const resizeObserver = new ResizeObserver(() => {
38171
37891
  throttledResize();
38172
37892
  });
@@ -38184,12 +37904,10 @@ var WeaveStageResizePlugin = class extends WeavePlugin {
38184
37904
  //#endregion
38185
37905
  //#region src/plugins/nodes-multi-selection-feedback/nodes-multi-selection-feedback.ts
38186
37906
  var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
37907
+ selectedHalos = {};
38187
37908
  constructor(params) {
38188
37909
  super();
38189
37910
  this.config = mergeExceptArrays(WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, params?.config ?? {});
38190
- this.initialize();
38191
- }
38192
- initialize() {
38193
37911
  this.selectedHalos = {};
38194
37912
  }
38195
37913
  getName() {
@@ -38355,14 +38073,12 @@ var WeaveNodesMultiSelectionFeedbackPlugin = class extends WeavePlugin {
38355
38073
  //#endregion
38356
38074
  //#region src/plugins/connected-users/connected-users.ts
38357
38075
  var WeaveConnectedUsersPlugin = class extends WeavePlugin {
38076
+ connectedUsers = {};
38358
38077
  getLayerName = void 0;
38359
38078
  constructor(params) {
38360
38079
  super();
38361
38080
  const { config } = params ?? {};
38362
38081
  this.config = config;
38363
- this.initialize();
38364
- }
38365
- initialize() {
38366
38082
  this.connectedUsers = {};
38367
38083
  }
38368
38084
  getName() {
@@ -38409,9 +38125,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
38409
38125
  this.config = config;
38410
38126
  this.config.getUser = memoize(this.config.getUser);
38411
38127
  this.config.getUserColor = memoize(this.config.getUserColor);
38412
- this.initialize();
38413
- }
38414
- initialize() {
38415
38128
  this.usersSelection = {};
38416
38129
  }
38417
38130
  getName() {
@@ -38604,9 +38317,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
38604
38317
  this.config.getUser = memoize(this.config.getUser);
38605
38318
  this.config.getUserBackgroundColor = memoize(this.config.getUserBackgroundColor);
38606
38319
  this.config.getUserForegroundColor = memoize(this.config.getUserForegroundColor);
38607
- this.initialize();
38608
- }
38609
- initialize() {
38610
38320
  this.usersPointers = {};
38611
38321
  this.usersOperations = {};
38612
38322
  }
@@ -38817,9 +38527,6 @@ var WeaveUsersPresencePlugin = class extends WeavePlugin {
38817
38527
  super();
38818
38528
  const { config } = params;
38819
38529
  this.config = mergeExceptArrays(WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, config);
38820
- this.initialize();
38821
- }
38822
- initialize() {
38823
38530
  this.userPresence = {};
38824
38531
  }
38825
38532
  getName() {
@@ -38895,9 +38602,6 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38895
38602
  initLayer = void 0;
38896
38603
  constructor() {
38897
38604
  super();
38898
- this.initialize();
38899
- }
38900
- initialize() {
38901
38605
  this.enabled = true;
38902
38606
  }
38903
38607
  getName() {
@@ -38911,20 +38615,14 @@ var WeaveStageDropAreaPlugin = class extends WeavePlugin {
38911
38615
  stage.container().addEventListener("dragover", (e) => {
38912
38616
  e.preventDefault();
38913
38617
  e.stopPropagation();
38914
- }, { signal: this.instance.getEventsController()?.signal });
38618
+ });
38915
38619
  stage.container().addEventListener("drop", (e) => {
38916
38620
  e.preventDefault();
38917
38621
  e.stopPropagation();
38918
38622
  this.instance.emitEvent("onStageDrop", e);
38919
- }, { signal: this.instance.getEventsController()?.signal });
38920
- window.addEventListener("dragover", (e) => e.preventDefault(), {
38921
- signal: this.instance.getEventsController()?.signal,
38922
- passive: false
38923
- });
38924
- window.addEventListener("drop", (e) => e.preventDefault(), {
38925
- signal: this.instance.getEventsController()?.signal,
38926
- passive: false
38927
38623
  });
38624
+ window.addEventListener("dragover", (e) => e.preventDefault(), { passive: false });
38625
+ window.addEventListener("drop", (e) => e.preventDefault(), { passive: false });
38928
38626
  }
38929
38627
  enable() {
38930
38628
  this.enabled = true;
@@ -38943,9 +38641,6 @@ var WeaveNodesEdgeSnappingPlugin = class extends WeavePlugin {
38943
38641
  this.guideLineConfig = config?.guideLine ?? GUIDE_LINE_DEFAULT_CONFIG;
38944
38642
  this.dragSnappingThreshold = config?.dragSnappingThreshold ?? GUIDE_LINE_DRAG_SNAPPING_THRESHOLD;
38945
38643
  this.transformSnappingThreshold = config?.transformSnappingThreshold ?? GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD;
38946
- this.initialize();
38947
- }
38948
- initialize() {
38949
38644
  this.enabled = true;
38950
38645
  }
38951
38646
  getName() {
@@ -39322,9 +39017,6 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39322
39017
  this.enterSnappingTolerance = config?.enterSnappingTolerance ?? GUIDE_ENTER_SNAPPING_TOLERANCE;
39323
39018
  this.exitSnappingTolerance = config?.exitSnappingTolerance ?? GUIDE_EXIT_SNAPPING_TOLERANCE;
39324
39019
  this.uiConfig = mergeExceptArrays(GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, config?.ui);
39325
- this.initialize();
39326
- }
39327
- initialize() {
39328
39020
  this.enabled = true;
39329
39021
  }
39330
39022
  getName() {
@@ -39971,14 +39663,12 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
39971
39663
  //#endregion
39972
39664
  //#region src/plugins/comments-renderer/comments-renderer.ts
39973
39665
  var WeaveCommentsRendererPlugin = class extends WeavePlugin {
39666
+ comments = [];
39974
39667
  getLayerName = void 0;
39975
39668
  constructor(params) {
39976
39669
  super();
39977
39670
  const { config } = params ?? {};
39978
39671
  this.config = config;
39979
- this.initialize();
39980
- }
39981
- initialize() {
39982
39672
  this.comments = [];
39983
39673
  }
39984
39674
  getName() {
@@ -40069,7 +39759,6 @@ const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = { movementDelta: 5 };
40069
39759
  var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40070
39760
  getLayerName = void 0;
40071
39761
  initLayer = void 0;
40072
- initialize = void 0;
40073
39762
  constructor(params) {
40074
39763
  super();
40075
39764
  this.config = mergeExceptArrays(WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, params?.config ?? {});
@@ -40108,7 +39797,7 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
40108
39797
  if (e.code === "ArrowLeft" && e.shiftKey) this.handleNodesMovement("left");
40109
39798
  if (e.code === "ArrowRight" && e.shiftKey) this.handleNodesMovement("right");
40110
39799
  if (e.code === "ArrowDown" && e.shiftKey) this.handleNodesMovement("down");
40111
- }, { signal: this.instance.getEventsController()?.signal });
39800
+ });
40112
39801
  }
40113
39802
  enable() {
40114
39803
  this.enabled = true;
@@ -40165,4 +39854,4 @@ function getJSONFromYjsBinary(actualState) {
40165
39854
  }
40166
39855
 
40167
39856
  //#endregion
40168
- export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, weavejsToYjsBinary };
39857
+ 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, weavejsToYjsBinary };