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