@inditextech/weave-sdk 0.42.1 → 0.42.2

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.cjs CHANGED
@@ -15879,7 +15879,6 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
15879
15879
  initEvents() {
15880
15880
  const stage = this.instance.getStage();
15881
15881
  stage.on("pointerdown", (e) => {
15882
- e.evt.preventDefault();
15883
15882
  this.setTapStart(e);
15884
15883
  this.pointers[e.evt.pointerId] = e.evt;
15885
15884
  if (e.evt.buttons === 0) return;
@@ -18674,7 +18673,7 @@ var WeaveRegisterManager = class {
18674
18673
 
18675
18674
  //#endregion
18676
18675
  //#region package.json
18677
- var version = "0.42.1";
18676
+ var version = "0.42.2";
18678
18677
 
18679
18678
  //#endregion
18680
18679
  //#region src/managers/setup.ts
package/dist/sdk.js CHANGED
@@ -15494,6 +15494,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
15494
15494
  } else root._ = _;
15495
15495
  }).call(exports);
15496
15496
  } });
15497
+ var import_lodash$1 = __toESM(require_lodash());
15497
15498
  var import_lodash = __toESM(require_lodash(), 1);
15498
15499
 
15499
15500
  //#endregion
@@ -15588,12 +15589,12 @@ var WeaveStore = class {
15588
15589
  node: JSON.parse(JSON.stringify(nodeInfo.node))
15589
15590
  });
15590
15591
  }
15591
- if (!this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) {
15592
+ if (!this.isRoomLoaded && !(0, import_lodash$1.isEmpty)(this.state.weave)) {
15592
15593
  this.instance.setupRenderer();
15593
15594
  this.isRoomLoaded = true;
15594
15595
  this.instance.emitEvent("onRoomLoaded", this.isRoomLoaded);
15595
15596
  }
15596
- if (this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) this.instance.render();
15597
+ if (this.isRoomLoaded && !(0, import_lodash$1.isEmpty)(this.state.weave)) this.instance.render();
15597
15598
  });
15598
15599
  }
15599
15600
  canUndoStateStep() {
@@ -15879,7 +15880,6 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
15879
15880
  initEvents() {
15880
15881
  const stage = this.instance.getStage();
15881
15882
  stage.on("pointerdown", (e) => {
15882
- e.evt.preventDefault();
15883
15883
  this.setTapStart(e);
15884
15884
  this.pointers[e.evt.pointerId] = e.evt;
15885
15885
  if (e.evt.buttons === 0) return;
@@ -16092,7 +16092,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
16092
16092
  if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
16093
16093
  this.triggerSelectedNodesEvent();
16094
16094
  };
16095
- tr.on("transform", (0, import_lodash.throttle)(handleTransform, 50));
16095
+ tr.on("transform", (0, import_lodash$1.throttle)(handleTransform, 50));
16096
16096
  tr.on("transformend", () => {
16097
16097
  this.triggerSelectedNodesEvent();
16098
16098
  });
@@ -16964,7 +16964,7 @@ var WeaveNode = class {
16964
16964
  if (nodesSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesSnappingPlugin.evaluateGuidelines(e);
16965
16965
  if (this.isSelecting() && this.isNodeSelected(node$1)) this.scaleReset(node$1);
16966
16966
  };
16967
- node.on("transform", (0, import_lodash.throttle)(handleTransform, 100));
16967
+ node.on("transform", (0, import_lodash$1.throttle)(handleTransform, 100));
16968
16968
  node.on("transformend", (e) => {
16969
16969
  const node$1 = e.target;
16970
16970
  this.instance.emitEvent("onTransform", null);
@@ -17017,7 +17017,7 @@ var WeaveNode = class {
17017
17017
  if (layerToMove) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { bubbles: true });
17018
17018
  }
17019
17019
  };
17020
- node.on("dragmove", (0, import_lodash.throttle)(handleDragMove, 100));
17020
+ node.on("dragmove", (0, import_lodash$1.throttle)(handleDragMove, 100));
17021
17021
  node.on("dragend", (e) => {
17022
17022
  if (!this.didMove) return;
17023
17023
  const isErasing = this.instance.getActiveAction() === "eraseTool";
@@ -18674,7 +18674,7 @@ var WeaveRegisterManager = class {
18674
18674
 
18675
18675
  //#endregion
18676
18676
  //#region package.json
18677
- var version = "0.42.1";
18677
+ var version = "0.42.2";
18678
18678
 
18679
18679
  //#endregion
18680
18680
  //#region src/managers/setup.ts
@@ -19788,7 +19788,7 @@ var WeaveTextNode = class extends WeaveNode {
19788
19788
  text.on("transformstart", (e) => {
19789
19789
  this.instance.emitEvent("onTransform", e.target);
19790
19790
  });
19791
- text.on("transform", (0, import_lodash.throttle)(handleTextTransform, 50));
19791
+ text.on("transform", (0, import_lodash$1.throttle)(handleTextTransform, 50));
19792
19792
  text.on("transformend", () => {
19793
19793
  this.instance.emitEvent("onTransform", null);
19794
19794
  });
@@ -21076,7 +21076,7 @@ var WeaveImageNode = class extends WeaveNode {
21076
21076
  const stage = this.instance.getStage();
21077
21077
  const image = stage.findOne(`#${imageAttrs.id}`);
21078
21078
  const internalImage = image?.findOne(`#${imageAttrs.id}-image`);
21079
- if (image && internalImage && !imageAttrs.adding && imageAttrs.cropInfo && !(0, import_lodash.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
21079
+ if (image && internalImage && !imageAttrs.adding && imageAttrs.cropInfo && !(0, import_lodash$1.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
21080
21080
  const actualScale = imageAttrs.uncroppedImage.width / imageAttrs.imageInfo.width;
21081
21081
  internalImage.width(imageAttrs.uncroppedImage.width);
21082
21082
  internalImage.height(imageAttrs.uncroppedImage.height);
@@ -21093,7 +21093,7 @@ var WeaveImageNode = class extends WeaveNode {
21093
21093
  internalImage.height(imageAttrs.cropSize.height);
21094
21094
  this.cachedCropInfo[imageAttrs.id ?? ""] = imageAttrs.cropInfo;
21095
21095
  }
21096
- if (image && internalImage && !imageAttrs.adding && !imageAttrs.cropInfo && !(0, import_lodash.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
21096
+ if (image && internalImage && !imageAttrs.adding && !imageAttrs.cropInfo && !(0, import_lodash$1.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
21097
21097
  internalImage.width(imageAttrs.uncroppedImage.width);
21098
21098
  internalImage.height(imageAttrs.uncroppedImage.height);
21099
21099
  internalImage.rotation(0);
@@ -23392,7 +23392,7 @@ var require_hammer = __commonJS({ "../../node_modules/hammerjs/hammer.js"(export
23392
23392
  else window$1[exportName] = Hammer;
23393
23393
  })(window, document, "Hammer");
23394
23394
  } });
23395
- var import_hammer = __toESM(require_hammer(), 1);
23395
+ var import_hammer = __toESM(require_hammer());
23396
23396
 
23397
23397
  //#endregion
23398
23398
  //#region src/plugins/stage-zoom/stage-zoom.ts
@@ -23414,7 +23414,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
23414
23414
  constructor(params) {
23415
23415
  super();
23416
23416
  const { config } = params ?? {};
23417
- this.config = (0, import_lodash.merge)(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
23417
+ this.config = (0, import_lodash$1.merge)(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
23418
23418
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
23419
23419
  this.threshold = .2;
23420
23420
  this.pinching = false;
@@ -23443,7 +23443,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
23443
23443
  this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
23444
23444
  }
23445
23445
  };
23446
- mainLayer?.on("draw", (0, import_lodash.throttle)(handleDraw, 50));
23446
+ mainLayer?.on("draw", (0, import_lodash$1.throttle)(handleDraw, 50));
23447
23447
  this.setZoom(this.config.zoomSteps[this.actualStep]);
23448
23448
  }
23449
23449
  setZoom(scale, centered = true, pointer) {
@@ -26284,7 +26284,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
26284
26284
  if (!this.enabled || !(this.isSpaceKeyPressed || this.isMouseMiddleButtonPressed || this.moveToolActive)) return;
26285
26285
  this.onRender();
26286
26286
  };
26287
- stage.on("pointermove", (0, import_lodash.throttle)(handleMouseMove, 50));
26287
+ stage.on("pointermove", (0, import_lodash$1.throttle)(handleMouseMove, 50));
26288
26288
  stage.on("pointermove", () => {
26289
26289
  if (this.enabled) this.onRender();
26290
26290
  });
@@ -26856,7 +26856,7 @@ var WeaveConnectedUsersPlugin = class extends WeavePlugin {
26856
26856
  newConnectedUsers[userInformation.id] = userInformation;
26857
26857
  }
26858
26858
  }
26859
- if (!(0, import_lodash.isEqual)(this.connectedUsers, newConnectedUsers)) this.instance.emitEvent("onConnectedUsersChange", newConnectedUsers);
26859
+ if (!(0, import_lodash$1.isEqual)(this.connectedUsers, newConnectedUsers)) this.instance.emitEvent("onConnectedUsersChange", newConnectedUsers);
26860
26860
  this.connectedUsers = newConnectedUsers;
26861
26861
  });
26862
26862
  }