@inditextech/weave-sdk 0.21.2 → 0.22.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.cjs CHANGED
@@ -15789,7 +15789,7 @@ function moveNodeToContainer(instance, node) {
15789
15789
  let layerToMove = void 0;
15790
15790
  if (!nodeAttrs.containerId && nodeIntersected && actualContainerAttrs.id !== nodeIntersected.getAttrs().id) layerToMove = nodeIntersected;
15791
15791
  if (!nodeIntersected && actualContainerAttrs.id !== __inditextech_weave_types.WEAVE_NODE_LAYER_ID) layerToMove = instance.getMainLayer();
15792
- if (layerToMove) {
15792
+ if (layerToMove && actualContainerAttrs.id !== layerToMove.getAttrs().id && actualContainerAttrs.id !== layerToMove.getAttrs().containerId) {
15793
15793
  const layerToMoveAttrs = layerToMove.getAttrs();
15794
15794
  const nodePos = node.getAbsolutePosition();
15795
15795
  const nodeRotation = node.getAbsoluteRotation();
@@ -15798,12 +15798,14 @@ function moveNodeToContainer(instance, node) {
15798
15798
  node.rotation(nodeRotation);
15799
15799
  node.x(node.x() - (layerToMoveAttrs.containerOffsetX ?? 0));
15800
15800
  node.y(node.y() - (layerToMoveAttrs.containerOffsetY ?? 0));
15801
+ node.movedToContainer(layerToMove);
15801
15802
  const nodeHandler = instance.getNodeHandler(node.getAttrs().nodeType);
15802
15803
  const actualNode = nodeHandler.serialize(node);
15803
15804
  instance.removeNode(actualNode);
15804
15805
  instance.addNode(actualNode, layerToMoveAttrs.id);
15806
+ return layerToMove;
15805
15807
  }
15806
- return layerToMove;
15808
+ return void 0;
15807
15809
  }
15808
15810
 
15809
15811
  //#endregion
@@ -15954,6 +15956,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
15954
15956
  this.triggerSelectedNodesEvent();
15955
15957
  });
15956
15958
  tr.on("dragstart", (e) => {
15959
+ const stage$1 = this.instance.getStage();
15960
+ if (stage$1.isMouseWheelPressed()) {
15961
+ e.cancelBubble = true;
15962
+ e.target.stopDrag();
15963
+ return;
15964
+ }
15957
15965
  const selectedNodes = tr.nodes();
15958
15966
  for (let i = 0; i < selectedNodes.length; i++) {
15959
15967
  const node = selectedNodes[i];
@@ -15963,6 +15971,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
15963
15971
  e.cancelBubble = true;
15964
15972
  });
15965
15973
  const handleDragMove = (e) => {
15974
+ const stage$1 = this.instance.getStage();
15975
+ if (stage$1.isMouseWheelPressed()) {
15976
+ e.cancelBubble = true;
15977
+ e.target.stopDrag();
15978
+ return;
15979
+ }
15966
15980
  const selectedNodes = tr.nodes();
15967
15981
  for (let i = 0; i < selectedNodes.length; i++) {
15968
15982
  const node = selectedNodes[i];
@@ -16495,6 +16509,11 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
16495
16509
 
16496
16510
  //#endregion
16497
16511
  //#region src/nodes/node.ts
16512
+ const setStageDefaultConfiguration = () => {
16513
+ konva.default.Stage.prototype.isMouseWheelPressed = function() {
16514
+ return false;
16515
+ };
16516
+ };
16498
16517
  const setNodesDefaultConfiguration = (config) => {
16499
16518
  const { transform } = config ?? {};
16500
16519
  konva.default.Node.prototype.getTransformerProperties = function() {
@@ -16503,6 +16522,7 @@ const setNodesDefaultConfiguration = (config) => {
16503
16522
  ...transform
16504
16523
  };
16505
16524
  };
16525
+ konva.default.Node.prototype.movedToContainer = function() {};
16506
16526
  konva.default.Node.prototype.updatePosition = function() {};
16507
16527
  konva.default.Node.prototype.resetCrop = function() {};
16508
16528
  };
@@ -16537,31 +16557,8 @@ var WeaveNode = class {
16537
16557
  return selected;
16538
16558
  }
16539
16559
  scaleReset(node) {
16540
- if (node.getAttrs().nodeType === "line") {
16541
- const lineNode = node;
16542
- const oldPoints = lineNode.points();
16543
- const newPoints = [];
16544
- for (let i = 0; i < oldPoints.length / 2; i++) {
16545
- const point = {
16546
- x: oldPoints[i * 2] * lineNode.scaleX(),
16547
- y: oldPoints[i * 2 + 1] * lineNode.scaleY()
16548
- };
16549
- newPoints.push(point.x, point.y);
16550
- }
16551
- lineNode.points(newPoints);
16552
- }
16553
- const widthNotNormalized = node.width();
16554
- const heightNotNormalized = node.height();
16555
16560
  node.width(Math.max(5, node.width() * node.scaleX()));
16556
16561
  node.height(Math.max(5, node.height() * node.scaleY()));
16557
- if (node.getAttrs().nodeType === "image") {
16558
- const uncroppedWidth = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.width : widthNotNormalized;
16559
- const uncroppedHeight = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.height : heightNotNormalized;
16560
- node.setAttrs({ uncroppedImage: {
16561
- width: uncroppedWidth * node.scaleX(),
16562
- height: uncroppedHeight * node.scaleY()
16563
- } });
16564
- }
16565
16562
  node.scaleX(1);
16566
16563
  node.scaleY(1);
16567
16564
  }
@@ -16602,7 +16599,21 @@ var WeaveNode = class {
16602
16599
  const nodeHandler = this.instance.getNodeHandler(node$1.getAttrs().nodeType);
16603
16600
  this.instance.updateNode(nodeHandler.serialize(node$1));
16604
16601
  });
16602
+ node.on("dragstart", (e) => {
16603
+ const stage = this.instance.getStage();
16604
+ if (stage.isMouseWheelPressed()) {
16605
+ e.cancelBubble = true;
16606
+ node.stopDrag();
16607
+ return;
16608
+ }
16609
+ });
16605
16610
  const handleDragMove = (e) => {
16611
+ const stage = this.instance.getStage();
16612
+ if (stage.isMouseWheelPressed()) {
16613
+ e.cancelBubble = true;
16614
+ node.stopDrag();
16615
+ return;
16616
+ }
16606
16617
  if (this.isSelecting() && this.isNodeSelected(node)) {
16607
16618
  clearContainerTargets(this.instance);
16608
16619
  const layerToMove = checkIfOverContainer(this.instance, e.target);
@@ -18091,7 +18102,7 @@ var WeaveRegisterManager = class {
18091
18102
 
18092
18103
  //#endregion
18093
18104
  //#region package.json
18094
- var version = "0.21.2";
18105
+ var version = "0.22.0";
18095
18106
 
18096
18107
  //#endregion
18097
18108
  //#region src/managers/setup.ts
@@ -18532,6 +18543,9 @@ var Weave = class extends Emittery {
18532
18543
  getConfiguration() {
18533
18544
  return this.config;
18534
18545
  }
18546
+ setStageDefaultConfiguration() {
18547
+ setStageDefaultConfiguration();
18548
+ }
18535
18549
  setNodesDefaultConfiguration(config) {
18536
18550
  setNodesDefaultConfiguration(config);
18537
18551
  }
@@ -18760,8 +18774,17 @@ const WEAVE_STAGE_NODE_TYPE = "stage";
18760
18774
  //#region src/nodes/stage/stage.ts
18761
18775
  var WeaveStageNode = class extends WeaveNode {
18762
18776
  nodeType = WEAVE_STAGE_NODE_TYPE;
18777
+ wheelMousePressed = false;
18763
18778
  onRender(props) {
18764
18779
  const stage = new konva.default.Stage({ ...props });
18780
+ this.wheelMousePressed = false;
18781
+ stage.isMouseWheelPressed = () => this.wheelMousePressed;
18782
+ stage.on("mousedown", (e) => {
18783
+ if (e.evt.button === 1) this.wheelMousePressed = true;
18784
+ });
18785
+ stage.on("mouseup", (e) => {
18786
+ if (e.evt.button === 1) this.wheelMousePressed = false;
18787
+ });
18765
18788
  stage.batchDraw();
18766
18789
  return stage;
18767
18790
  }
@@ -18891,6 +18914,65 @@ var WeaveRectangleNode = class extends WeaveNode {
18891
18914
  }
18892
18915
  };
18893
18916
 
18917
+ //#endregion
18918
+ //#region src/nodes/ellipse/constants.ts
18919
+ const WEAVE_ELLIPSE_NODE_TYPE = "ellipse";
18920
+
18921
+ //#endregion
18922
+ //#region src/nodes/ellipse/ellipse.ts
18923
+ var WeaveEllipseNode = class extends WeaveNode {
18924
+ nodeType = WEAVE_ELLIPSE_NODE_TYPE;
18925
+ constructor(params) {
18926
+ super();
18927
+ const { config } = params ?? {};
18928
+ this.config = { transform: {
18929
+ ...__inditextech_weave_types.WEAVE_DEFAULT_TRANSFORM_PROPERTIES,
18930
+ ...config?.transform
18931
+ } };
18932
+ }
18933
+ onRender(props) {
18934
+ const rectangle = new konva.default.Ellipse({
18935
+ ...props,
18936
+ name: "node",
18937
+ radiusX: props.radiusX,
18938
+ radiusY: props.radiusY
18939
+ });
18940
+ rectangle.getTransformerProperties = () => {
18941
+ const stage = this.instance.getStage();
18942
+ const node = stage.findOne(`#${props.id}`);
18943
+ if (node && node.getAttrs().keepAspectRatio) return {
18944
+ ...this.config.transform,
18945
+ enabledAnchors: [
18946
+ "top-left",
18947
+ "top-right",
18948
+ "bottom-left",
18949
+ "bottom-right"
18950
+ ],
18951
+ keepRatio: true
18952
+ };
18953
+ return this.config.transform;
18954
+ };
18955
+ this.setupDefaultNodeEvents(rectangle);
18956
+ return rectangle;
18957
+ }
18958
+ onUpdate(nodeInstance, nextProps) {
18959
+ nodeInstance.setAttrs({ ...nextProps });
18960
+ const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
18961
+ if (nodesSelectionPlugin) {
18962
+ const actualSelectedNodes = nodesSelectionPlugin.getSelectedNodes();
18963
+ nodesSelectionPlugin.setSelectedNodes(actualSelectedNodes);
18964
+ nodesSelectionPlugin.getTransformer().forceUpdate();
18965
+ }
18966
+ }
18967
+ scaleReset(node) {
18968
+ const ellipseNode = node;
18969
+ ellipseNode.radiusX(Math.max(5, ellipseNode.radiusX() * ellipseNode.scaleX()));
18970
+ ellipseNode.radiusY(Math.max(5, ellipseNode.radiusY() * ellipseNode.scaleY()));
18971
+ node.scaleX(1);
18972
+ node.scaleY(1);
18973
+ }
18974
+ };
18975
+
18894
18976
  //#endregion
18895
18977
  //#region src/nodes/line/constants.ts
18896
18978
  const WEAVE_LINE_NODE_TYPE = "line";
@@ -18923,6 +19005,25 @@ var WeaveLineNode = class extends WeaveNode {
18923
19005
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
18924
19006
  if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
18925
19007
  }
19008
+ scaleReset(node) {
19009
+ if (node.getAttrs().nodeType === "line") {
19010
+ const lineNode = node;
19011
+ const oldPoints = lineNode.points();
19012
+ const newPoints = [];
19013
+ for (let i = 0; i < oldPoints.length / 2; i++) {
19014
+ const point = {
19015
+ x: oldPoints[i * 2] * lineNode.scaleX(),
19016
+ y: oldPoints[i * 2 + 1] * lineNode.scaleY()
19017
+ };
19018
+ newPoints.push(point.x, point.y);
19019
+ }
19020
+ lineNode.points(newPoints);
19021
+ }
19022
+ node.width(Math.max(5, node.width() * node.scaleX()));
19023
+ node.height(Math.max(5, node.height() * node.scaleY()));
19024
+ node.scaleX(1);
19025
+ node.scaleY(1);
19026
+ }
18926
19027
  };
18927
19028
 
18928
19029
  //#endregion
@@ -19469,7 +19570,7 @@ var WeaveImageToolAction = class extends WeaveAction {
19469
19570
  imageURL: this.imageURL,
19470
19571
  stroke: "#000000ff",
19471
19572
  strokeWidth: 0,
19472
- strokeScaleEnabled: false,
19573
+ strokeScaleEnabled: true,
19473
19574
  listening: false
19474
19575
  });
19475
19576
  this.instance.addNode(node, this.container?.getAttrs().id);
@@ -19496,7 +19597,7 @@ var WeaveImageToolAction = class extends WeaveAction {
19496
19597
  imageURL: this.imageURL,
19497
19598
  stroke: "#000000ff",
19498
19599
  strokeWidth: 0,
19499
- strokeScaleEnabled: false,
19600
+ strokeScaleEnabled: true,
19500
19601
  imageWidth: this.preloadImgs[this.imageId].width,
19501
19602
  imageHeight: this.preloadImgs[this.imageId].height,
19502
19603
  imageInfo: {
@@ -19900,6 +20001,12 @@ var WeaveImageNode = class extends WeaveNode {
19900
20001
  id,
19901
20002
  name: "node"
19902
20003
  });
20004
+ image.movedToContainer = () => {
20005
+ const stage = this.instance.getStage();
20006
+ const image$1 = stage.findOne(`#${id}`);
20007
+ if (!image$1) return;
20008
+ this.cachedCropInfo[image$1.getAttrs().id ?? ""] = void 0;
20009
+ };
19903
20010
  image.resetCrop = () => {
19904
20011
  const stage = this.instance.getStage();
19905
20012
  const image$1 = stage.findOne(`#${id}`);
@@ -19942,7 +20049,7 @@ var WeaveImageNode = class extends WeaveNode {
19942
20049
  height: 0,
19943
20050
  stroke: "#ff0000ff",
19944
20051
  strokeWidth: 0,
19945
- strokeScaleEnabled: false,
20052
+ strokeScaleEnabled: true,
19946
20053
  draggable: false,
19947
20054
  visible: false
19948
20055
  });
@@ -20058,7 +20165,7 @@ var WeaveImageNode = class extends WeaveNode {
20058
20165
  draggable: false,
20059
20166
  zIndex: 0
20060
20167
  });
20061
- this.updateCrop(nextProps);
20168
+ this.updateImageCrop(nextProps);
20062
20169
  }
20063
20170
  try {
20064
20171
  const selectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -20114,14 +20221,14 @@ var WeaveImageNode = class extends WeaveNode {
20114
20221
  width: imageRect.width,
20115
20222
  height: imageRect.height
20116
20223
  });
20117
- this.updateCrop(imageProps);
20224
+ this.updateImageCrop(imageProps);
20118
20225
  const nodeHandler = this.instance.getNodeHandler(image.getAttrs().nodeType);
20119
20226
  this.instance.updateNode(nodeHandler.serialize(image));
20120
20227
  }
20121
20228
  };
20122
20229
  if (imageProps.imageURL) imageObj.src = imageProps.imageURL;
20123
20230
  }
20124
- updateCrop(nextProps) {
20231
+ updateImageCrop(nextProps) {
20125
20232
  const imageAttrs = nextProps;
20126
20233
  const stage = this.instance.getStage();
20127
20234
  const image = stage.findOne(`#${imageAttrs.id}`);
@@ -20160,6 +20267,134 @@ var WeaveImageNode = class extends WeaveNode {
20160
20267
  if (!imageToolAction) throw new Error("Image Tool action not found");
20161
20268
  return imageToolAction;
20162
20269
  }
20270
+ scaleReset(node) {
20271
+ const widthNotNormalized = node.width();
20272
+ const heightNotNormalized = node.height();
20273
+ node.width(Math.max(5, node.width() * node.scaleX()));
20274
+ node.height(Math.max(5, node.height() * node.scaleY()));
20275
+ const uncroppedWidth = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.width : widthNotNormalized;
20276
+ const uncroppedHeight = node.getAttrs().uncroppedImage ? node.getAttrs().uncroppedImage.height : heightNotNormalized;
20277
+ node.setAttrs({ uncroppedImage: {
20278
+ width: uncroppedWidth * node.scaleX(),
20279
+ height: uncroppedHeight * node.scaleY()
20280
+ } });
20281
+ node.scaleX(1);
20282
+ node.scaleY(1);
20283
+ }
20284
+ };
20285
+
20286
+ //#endregion
20287
+ //#region src/nodes/star/constants.ts
20288
+ const WEAVE_STAR_NODE_TYPE = "star";
20289
+
20290
+ //#endregion
20291
+ //#region src/nodes/star/star.ts
20292
+ var WeaveStarNode = class extends WeaveNode {
20293
+ nodeType = WEAVE_STAR_NODE_TYPE;
20294
+ constructor(params) {
20295
+ super();
20296
+ const { config } = params ?? {};
20297
+ this.config = { transform: {
20298
+ ...__inditextech_weave_types.WEAVE_DEFAULT_TRANSFORM_PROPERTIES,
20299
+ ...config?.transform
20300
+ } };
20301
+ }
20302
+ onRender(props) {
20303
+ const rectangle = new konva.default.Star({
20304
+ ...props,
20305
+ name: "node",
20306
+ numPoints: props.numPoints,
20307
+ innerRadius: props.innerRadius,
20308
+ outerRadius: props.outerRadius
20309
+ });
20310
+ rectangle.getTransformerProperties = () => {
20311
+ const stage = this.instance.getStage();
20312
+ const node = stage.findOne(`#${props.id}`);
20313
+ if (node && node.getAttrs().keepAspectRatio) return {
20314
+ ...this.config.transform,
20315
+ enabledAnchors: [
20316
+ "top-left",
20317
+ "top-right",
20318
+ "bottom-left",
20319
+ "bottom-right"
20320
+ ],
20321
+ keepRatio: true
20322
+ };
20323
+ return this.config.transform;
20324
+ };
20325
+ this.setupDefaultNodeEvents(rectangle);
20326
+ return rectangle;
20327
+ }
20328
+ onUpdate(nodeInstance, nextProps) {
20329
+ nodeInstance.setAttrs({ ...nextProps });
20330
+ const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
20331
+ if (nodesSelectionPlugin) {
20332
+ const actualSelectedNodes = nodesSelectionPlugin.getSelectedNodes();
20333
+ nodesSelectionPlugin.setSelectedNodes(actualSelectedNodes);
20334
+ nodesSelectionPlugin.getTransformer().forceUpdate();
20335
+ }
20336
+ }
20337
+ scaleReset(node) {
20338
+ const starNode = node;
20339
+ starNode.innerRadius(Math.max(5, starNode.innerRadius() * starNode.scaleX()));
20340
+ starNode.outerRadius(Math.max(5, starNode.outerRadius() * starNode.scaleY()));
20341
+ node.scaleX(1);
20342
+ node.scaleY(1);
20343
+ }
20344
+ };
20345
+
20346
+ //#endregion
20347
+ //#region src/nodes/arrow/constants.ts
20348
+ const WEAVE_ARROW_NODE_TYPE = "arrow";
20349
+
20350
+ //#endregion
20351
+ //#region src/nodes/arrow/arrow.ts
20352
+ var WeaveArrowNode = class extends WeaveNode {
20353
+ nodeType = WEAVE_ARROW_NODE_TYPE;
20354
+ constructor(params) {
20355
+ super();
20356
+ const { config } = params ?? {};
20357
+ this.config = { transform: {
20358
+ ...__inditextech_weave_types.WEAVE_DEFAULT_TRANSFORM_PROPERTIES,
20359
+ ...config?.transform
20360
+ } };
20361
+ }
20362
+ onRender(props) {
20363
+ const line = new konva.default.Arrow({
20364
+ ...props,
20365
+ name: "node",
20366
+ points: props.points
20367
+ });
20368
+ line.getTransformerProperties = () => {
20369
+ return this.config.transform;
20370
+ };
20371
+ this.setupDefaultNodeEvents(line);
20372
+ return line;
20373
+ }
20374
+ onUpdate(nodeInstance, nextProps) {
20375
+ nodeInstance.setAttrs({ ...nextProps });
20376
+ const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
20377
+ if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
20378
+ }
20379
+ scaleReset(node) {
20380
+ if (node.getAttrs().nodeType === "arrow") {
20381
+ const lineNode = node;
20382
+ const oldPoints = lineNode.points();
20383
+ const newPoints = [];
20384
+ for (let i = 0; i < oldPoints.length / 2; i++) {
20385
+ const point = {
20386
+ x: oldPoints[i * 2] * lineNode.scaleX(),
20387
+ y: oldPoints[i * 2 + 1] * lineNode.scaleY()
20388
+ };
20389
+ newPoints.push(point.x, point.y);
20390
+ }
20391
+ lineNode.points(newPoints);
20392
+ }
20393
+ node.width(Math.max(5, node.width() * node.scaleX()));
20394
+ node.height(Math.max(5, node.height() * node.scaleY()));
20395
+ node.scaleX(1);
20396
+ node.scaleY(1);
20397
+ }
20163
20398
  };
20164
20399
 
20165
20400
  //#endregion
@@ -20293,7 +20528,7 @@ var WeaveFrameNode = class extends WeaveNode {
20293
20528
  id,
20294
20529
  containerId: `${id}-group-internal`,
20295
20530
  containerOffsetX: 0,
20296
- containerOffsetY: titleHeight,
20531
+ containerOffsetY: borderWidth,
20297
20532
  width: props.frameWidth,
20298
20533
  height: props.frameHeight,
20299
20534
  fill: "transparent",
@@ -20306,7 +20541,7 @@ var WeaveFrameNode = class extends WeaveNode {
20306
20541
  y: 0,
20307
20542
  width: props.frameWidth,
20308
20543
  height: props.frameHeight,
20309
- strokeScaleEnabled: false,
20544
+ strokeScaleEnabled: true,
20310
20545
  draggable: false
20311
20546
  });
20312
20547
  frame.add(frameInternalGroup);
@@ -20318,7 +20553,7 @@ var WeaveFrameNode = class extends WeaveNode {
20318
20553
  width: props.frameWidth,
20319
20554
  stroke: borderColor,
20320
20555
  strokeWidth: borderWidth,
20321
- strokeScaleEnabled: false,
20556
+ strokeScaleEnabled: true,
20322
20557
  shadowForStrokeEnabled: false,
20323
20558
  height: props.frameHeight,
20324
20559
  fill: "#ffffffff",
@@ -20339,7 +20574,7 @@ var WeaveFrameNode = class extends WeaveNode {
20339
20574
  text: props.title,
20340
20575
  stroke: "#000000ff",
20341
20576
  strokeWidth: 1,
20342
- strokeScaleEnabled: false,
20577
+ strokeScaleEnabled: true,
20343
20578
  listening: false,
20344
20579
  draggable: false
20345
20580
  });
@@ -20428,17 +20663,17 @@ var WeaveFrameNode = class extends WeaveNode {
20428
20663
  const frameInternal = new konva.default.Group({
20429
20664
  id: `${id}-group-internal`,
20430
20665
  nodeId: id,
20431
- x: 0,
20432
- y: titleHeight,
20433
- width: props.frameWidth,
20434
- height: props.frameHeight,
20435
- strokeScaleEnabled: false,
20666
+ x: borderWidth,
20667
+ y: borderWidth,
20668
+ width: props.frameWidth - borderWidth * 2,
20669
+ height: props.frameHeight - borderWidth * 2,
20670
+ strokeScaleEnabled: true,
20436
20671
  draggable: false
20437
20672
  });
20438
20673
  frameInternal.clipFunc((ctx) => {
20439
- const width = frameInternal.width() * frameInternal.scaleX();
20440
- const height = frameInternal.height() * frameInternal.scaleY();
20441
- ctx.rect(0, -titleHeight, width, height);
20674
+ const width = (frameInternal.width() + borderWidth) * frameInternal.scaleX();
20675
+ const height = (frameInternal.height() + borderWidth) * frameInternal.scaleY();
20676
+ ctx.rect(-(borderWidth / 2) * frameInternal.scaleX(), -(borderWidth / 2) * frameInternal.scaleY(), width, height);
20442
20677
  });
20443
20678
  frameInternalGroup.add(frameInternal);
20444
20679
  this.setupDefaultNodeEvents(frame);
@@ -20464,9 +20699,11 @@ var WeaveFrameNode = class extends WeaveNode {
20464
20699
  const { id } = nextProps;
20465
20700
  const frameNode = nodeInstance;
20466
20701
  const newProps = { ...nextProps };
20467
- const { titleHeight } = this.config;
20702
+ const { titleHeight, borderWidth } = this.config;
20468
20703
  nodeInstance.setAttrs({
20469
20704
  ...newProps,
20705
+ containerOffsetX: 0,
20706
+ containerOffsetY: borderWidth,
20470
20707
  clip: void 0
20471
20708
  });
20472
20709
  const selectorArea = frameNode.findOne(`#${id}-selector-area`);
@@ -20499,14 +20736,15 @@ var WeaveFrameNode = class extends WeaveNode {
20499
20736
  x: 0,
20500
20737
  y: -titleHeight,
20501
20738
  text: nextProps.title,
20502
- width: width * selectorArea.scaleX()
20739
+ width: width * selectorArea.scaleX(),
20740
+ height: titleHeight * selectorArea.scaleY()
20503
20741
  });
20504
20742
  const frameInternal = frameNode.findOne(`#${id}-group-internal`);
20505
20743
  if (frameInternal) frameInternal.setAttrs({
20506
- x: 0,
20507
- y: titleHeight,
20508
- width: width * selectorArea.scaleX(),
20509
- height: height * selectorArea.scaleY()
20744
+ x: borderWidth,
20745
+ y: borderWidth,
20746
+ width: (width - borderWidth * 2) * selectorArea.scaleX(),
20747
+ height: (height - borderWidth * 2) * selectorArea.scaleY()
20510
20748
  });
20511
20749
  }
20512
20750
  const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
@@ -20546,10 +20784,6 @@ var WeaveFrameNode = class extends WeaveNode {
20546
20784
  const WEAVE_STAGE_ZOOM_KEY = "stageZoom";
20547
20785
  const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
20548
20786
  zoomSteps: [
20549
- .1,
20550
- .2,
20551
- .3,
20552
- .4,
20553
20787
  .5,
20554
20788
  .6,
20555
20789
  .7,
@@ -20564,7 +20798,11 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
20564
20798
  4,
20565
20799
  6,
20566
20800
  8,
20567
- 10
20801
+ 10,
20802
+ 20,
20803
+ 50,
20804
+ 100,
20805
+ 250
20568
20806
  ],
20569
20807
  defaultZoom: 1,
20570
20808
  fitToScreen: { padding: 40 },
@@ -20586,6 +20824,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20586
20824
  };
20587
20825
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
20588
20826
  this.isCtrlOrMetaPressed = false;
20827
+ this.updatedMinimumZoom = false;
20589
20828
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
20590
20829
  this.actualScale = this.config.zoomSteps[this.actualStep];
20591
20830
  this.defaultStep = this.actualStep;
@@ -20595,9 +20834,27 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20595
20834
  }
20596
20835
  onInit() {
20597
20836
  this.initEvents();
20837
+ const minimumZoom = this.minimumZoom();
20838
+ if (minimumZoom < this.config.zoomSteps[0]) {
20839
+ this.updatedMinimumZoom = true;
20840
+ this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
20841
+ }
20842
+ const mainLayer = this.instance.getMainLayer();
20843
+ mainLayer?.on("draw", () => {
20844
+ const minimumZoom$1 = this.minimumZoom();
20845
+ if (this.updatedMinimumZoom && minimumZoom$1 < this.config.zoomSteps[0]) {
20846
+ this.updatedMinimumZoom = true;
20847
+ this.config.zoomSteps.shift();
20848
+ this.config.zoomSteps = [minimumZoom$1, ...this.config.zoomSteps];
20849
+ }
20850
+ if (!this.updatedMinimumZoom && minimumZoom$1 < this.config.zoomSteps[0]) {
20851
+ this.updatedMinimumZoom = true;
20852
+ this.config.zoomSteps = [minimumZoom$1, ...this.config.zoomSteps];
20853
+ }
20854
+ });
20598
20855
  this.setZoom(this.config.zoomSteps[this.actualStep]);
20599
20856
  }
20600
- setZoom(scale, centered = true) {
20857
+ setZoom(scale, centered = true, pointer) {
20601
20858
  const stage = this.instance.getStage();
20602
20859
  const mainLayer = this.instance.getMainLayer();
20603
20860
  if (mainLayer) {
@@ -20622,6 +20879,17 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20622
20879
  };
20623
20880
  stage.position(newPos);
20624
20881
  }
20882
+ if (!centered && pointer) {
20883
+ const mousePointTo = {
20884
+ x: (pointer.x - stage.x()) / oldScale,
20885
+ y: (pointer.y - stage.y()) / oldScale
20886
+ };
20887
+ const newPos = {
20888
+ x: pointer.x - mousePointTo.x * scale,
20889
+ y: pointer.y - mousePointTo.y * scale
20890
+ };
20891
+ stage.position(newPos);
20892
+ }
20625
20893
  const plugins = this.instance.getPlugins();
20626
20894
  for (const pluginId of Object.keys(plugins)) {
20627
20895
  const pluginInstance = plugins[pluginId];
@@ -20642,7 +20910,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20642
20910
  if (!this.enabled) return false;
20643
20911
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20644
20912
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
20645
- return this.actualStep - 1 > 0;
20913
+ return this.actualStep - 1 >= 0;
20646
20914
  }
20647
20915
  canZoomIn() {
20648
20916
  if (!this.enabled) return false;
@@ -20660,65 +20928,85 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20660
20928
  const nextValue = this.config.zoomSteps.filter((scale) => direction === "zoomIn" ? scale >= this.actualScale : scale <= this.actualScale).sort((a, b) => direction === "zoomIn" ? a - b : b - a)[0];
20661
20929
  return this.config.zoomSteps.findIndex((scale) => scale === nextValue);
20662
20930
  }
20663
- zoomIn() {
20931
+ zoomIn(pointer) {
20664
20932
  if (!this.enabled) return;
20665
20933
  if (!this.canZoomIn()) return;
20666
20934
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20667
20935
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomIn");
20668
20936
  else this.actualStep += 1;
20669
- this.setZoom(this.config.zoomSteps[this.actualStep]);
20937
+ this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
20670
20938
  }
20671
- zoomOut() {
20939
+ zoomOut(pointer) {
20672
20940
  if (!this.enabled) return;
20673
20941
  if (!this.canZoomOut()) return;
20674
20942
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20675
20943
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
20676
20944
  else this.actualStep -= 1;
20677
- this.setZoom(this.config.zoomSteps[this.actualStep]);
20945
+ this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
20946
+ }
20947
+ minimumZoom() {
20948
+ if (!this.enabled) return -1;
20949
+ const mainLayer = this.instance.getMainLayer();
20950
+ if (!mainLayer) return -1;
20951
+ if (mainLayer.getChildren().length === 0) return this.config.zoomSteps[this.defaultStep];
20952
+ const stage = this.instance.getStage();
20953
+ const box = mainLayer.getClientRect({
20954
+ relativeTo: stage,
20955
+ skipStroke: true
20956
+ });
20957
+ const stageBox = {
20958
+ width: stage.width(),
20959
+ height: stage.height()
20960
+ };
20961
+ const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
20962
+ const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
20963
+ const scaleX = availableScreenWidth / box.width;
20964
+ const scaleY = availableScreenHeight / box.height;
20965
+ const scale = Math.min(scaleX, scaleY);
20966
+ return scale;
20678
20967
  }
20679
20968
  fitToScreen() {
20680
20969
  if (!this.enabled) return;
20681
20970
  const mainLayer = this.instance.getMainLayer();
20971
+ if (!mainLayer) return;
20682
20972
  if (mainLayer?.getChildren().length === 0) {
20683
20973
  this.setZoom(this.config.zoomSteps[this.defaultStep]);
20684
20974
  return;
20685
20975
  }
20686
20976
  const stage = this.instance.getStage();
20687
- if (mainLayer) {
20688
- const box = mainLayer.getClientRect({
20689
- relativeTo: stage,
20690
- skipStroke: true
20691
- });
20692
- const stageBox = {
20693
- width: stage.width(),
20694
- height: stage.height()
20695
- };
20696
- const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
20697
- const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
20698
- const scaleX = availableScreenWidth / box.width;
20699
- const scaleY = availableScreenHeight / box.height;
20700
- const scale = Math.min(scaleX, scaleY);
20701
- stage.scale({
20702
- x: scale,
20703
- y: scale
20704
- });
20705
- const selectionCenterX = box.x + box.width / 2;
20706
- const selectionCenterY = box.y + box.height / 2;
20707
- const canvasCenterX = stage.width() / (2 * scale);
20708
- const canvasCenterY = stage.height() / (2 * scale);
20709
- const stageX = (canvasCenterX - selectionCenterX) * scale;
20710
- const stageY = (canvasCenterY - selectionCenterY) * scale;
20711
- stage.position({
20712
- x: stageX,
20713
- y: stageY
20714
- });
20715
- this.setZoom(scale, false);
20716
- }
20717
- }
20718
- fitToSelection() {
20719
- if (!this.enabled) return;
20720
- const stage = this.instance.getStage();
20721
- const selectionPlugin = this.instance.getPlugin("nodesSelection");
20977
+ const box = mainLayer.getClientRect({
20978
+ relativeTo: stage,
20979
+ skipStroke: true
20980
+ });
20981
+ const stageBox = {
20982
+ width: stage.width(),
20983
+ height: stage.height()
20984
+ };
20985
+ const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
20986
+ const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
20987
+ const scaleX = availableScreenWidth / box.width;
20988
+ const scaleY = availableScreenHeight / box.height;
20989
+ const scale = Math.min(scaleX, scaleY);
20990
+ stage.scale({
20991
+ x: scale,
20992
+ y: scale
20993
+ });
20994
+ const selectionCenterX = box.x + box.width / 2;
20995
+ const selectionCenterY = box.y + box.height / 2;
20996
+ const canvasCenterX = stage.width() / (2 * scale);
20997
+ const canvasCenterY = stage.height() / (2 * scale);
20998
+ const stageX = (canvasCenterX - selectionCenterX) * scale;
20999
+ const stageY = (canvasCenterY - selectionCenterY) * scale;
21000
+ stage.position({
21001
+ x: stageX,
21002
+ y: stageY
21003
+ });
21004
+ this.setZoom(scale, false);
21005
+ }
21006
+ fitToSelection() {
21007
+ if (!this.enabled) return;
21008
+ const stage = this.instance.getStage();
21009
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
20722
21010
  const nodes = selectionPlugin.getTransformer().getNodes();
20723
21011
  if (nodes.length === 0) return;
20724
21012
  let zoomTransformer = stage.findOne("#zoomTransformer");
@@ -20786,8 +21074,11 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20786
21074
  });
20787
21075
  window.addEventListener("wheel", (e) => {
20788
21076
  if (!this.enabled || !this.isCtrlOrMetaPressed) return;
20789
- if (e.deltaY > 0) this.zoomOut();
20790
- if (e.deltaY < 0) this.zoomIn();
21077
+ const stage = this.instance.getStage();
21078
+ const pointer = stage.getPointerPosition();
21079
+ if (!pointer) return;
21080
+ if (e.deltaY > 0) this.zoomOut(pointer);
21081
+ if (e.deltaY < 0) this.zoomIn(pointer);
20791
21082
  });
20792
21083
  }
20793
21084
  };
@@ -21209,7 +21500,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
21209
21500
  const nodeHandler = this.instance.getNodeHandler("rectangle");
21210
21501
  const node = nodeHandler.create(this.rectId, {
21211
21502
  ...this.props,
21212
- strokeScaleEnabled: false,
21503
+ strokeScaleEnabled: true,
21213
21504
  x: this.clickPoint?.x ?? 0,
21214
21505
  y: this.clickPoint?.y ?? 0,
21215
21506
  width: 0,
@@ -21291,6 +21582,192 @@ var WeaveRectangleToolAction = class extends WeaveAction {
21291
21582
  }
21292
21583
  };
21293
21584
 
21585
+ //#endregion
21586
+ //#region src/actions/ellipse-tool/constants.ts
21587
+ const ELLIPSE_TOOL_ACTION_NAME = "ellipseTool";
21588
+ const ELLIPSE_TOOL_STATE = {
21589
+ ["IDLE"]: "idle",
21590
+ ["ADDING"]: "adding",
21591
+ ["DEFINING_SIZE"]: "definingSize",
21592
+ ["ADDED"]: "added"
21593
+ };
21594
+
21595
+ //#endregion
21596
+ //#region src/actions/ellipse-tool/ellipse-tool.ts
21597
+ var WeaveEllipseToolAction = class extends WeaveAction {
21598
+ initialized = false;
21599
+ onPropsChange = void 0;
21600
+ onInit = void 0;
21601
+ constructor() {
21602
+ super();
21603
+ this.initialized = false;
21604
+ this.state = ELLIPSE_TOOL_STATE.IDLE;
21605
+ this.ellipseId = null;
21606
+ this.creating = false;
21607
+ this.moved = false;
21608
+ this.container = void 0;
21609
+ this.clickPoint = null;
21610
+ this.props = this.initProps();
21611
+ }
21612
+ getName() {
21613
+ return ELLIPSE_TOOL_ACTION_NAME;
21614
+ }
21615
+ initProps() {
21616
+ return {
21617
+ opacity: 1,
21618
+ fill: "#71717aff",
21619
+ stroke: "#000000ff",
21620
+ strokeWidth: 1,
21621
+ radiusX: 50,
21622
+ radiusY: 50,
21623
+ keepAspectRatio: false
21624
+ };
21625
+ }
21626
+ setupEvents() {
21627
+ const stage = this.instance.getStage();
21628
+ stage.container().addEventListener("keydown", (e) => {
21629
+ if (e.key === "Enter" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
21630
+ this.cancelAction();
21631
+ return;
21632
+ }
21633
+ if (e.key === "Escape" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
21634
+ this.cancelAction();
21635
+ return;
21636
+ }
21637
+ });
21638
+ stage.on("mousedown touchstart", (e) => {
21639
+ e.evt.preventDefault();
21640
+ if (this.state === ELLIPSE_TOOL_STATE.ADDING) {
21641
+ this.creating = true;
21642
+ this.handleAdding();
21643
+ }
21644
+ });
21645
+ stage.on("mousemove touchmove", (e) => {
21646
+ e.evt.preventDefault();
21647
+ if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
21648
+ this.moved = true;
21649
+ this.handleMovement();
21650
+ }
21651
+ });
21652
+ stage.on("mouseup touchend", (e) => {
21653
+ e.evt.preventDefault();
21654
+ if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
21655
+ this.creating = false;
21656
+ this.handleSettingSize();
21657
+ }
21658
+ });
21659
+ this.initialized = true;
21660
+ }
21661
+ setState(state) {
21662
+ this.state = state;
21663
+ }
21664
+ addEllipse() {
21665
+ const stage = this.instance.getStage();
21666
+ stage.container().style.cursor = "crosshair";
21667
+ stage.container().focus();
21668
+ this.clickPoint = null;
21669
+ this.setState(ELLIPSE_TOOL_STATE.ADDING);
21670
+ }
21671
+ handleAdding() {
21672
+ const { mousePoint, container } = this.instance.getMousePointer();
21673
+ this.clickPoint = mousePoint;
21674
+ this.container = container;
21675
+ this.ellipseId = v4_default();
21676
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21677
+ const node = nodeHandler.create(this.ellipseId, {
21678
+ ...this.props,
21679
+ strokeScaleEnabled: true,
21680
+ x: this.clickPoint?.x ?? 0,
21681
+ y: this.clickPoint?.y ?? 0,
21682
+ radiusX: 0,
21683
+ radiusY: 0
21684
+ });
21685
+ this.instance.addNode(node, this.container?.getAttrs().id);
21686
+ this.setState(ELLIPSE_TOOL_STATE.DEFINING_SIZE);
21687
+ }
21688
+ handleSettingSize() {
21689
+ const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
21690
+ if (this.ellipseId && this.clickPoint && this.container && ellipse) {
21691
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
21692
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21693
+ const ellipsePos = {
21694
+ x: this.clickPoint.x,
21695
+ y: this.clickPoint.y
21696
+ };
21697
+ let ellipseRadiusX = this.props.radiusY;
21698
+ let ellipseRadiusY = this.props.radiusY;
21699
+ if (this.moved) {
21700
+ ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
21701
+ ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
21702
+ ellipseRadiusX = Math.abs(this.clickPoint.x - mousePoint.x);
21703
+ ellipseRadiusY = Math.abs(this.clickPoint.y - mousePoint.y);
21704
+ }
21705
+ ellipse.setAttrs({
21706
+ ...this.props,
21707
+ x: ellipsePos.x + ellipseRadiusX / 2,
21708
+ y: ellipsePos.y + ellipseRadiusY / 2,
21709
+ radiusX: ellipseRadiusX,
21710
+ radiusY: ellipseRadiusY
21711
+ });
21712
+ this.instance.updateNode(nodeHandler.serialize(ellipse));
21713
+ }
21714
+ this.cancelAction();
21715
+ }
21716
+ handleMovement() {
21717
+ if (this.state !== ELLIPSE_TOOL_STATE.DEFINING_SIZE) return;
21718
+ const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
21719
+ if (this.ellipseId && this.container && this.clickPoint && ellipse) {
21720
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
21721
+ const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
21722
+ const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
21723
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21724
+ const ellipsePos = {
21725
+ x: this.clickPoint.x,
21726
+ y: this.clickPoint.y
21727
+ };
21728
+ if (this.moved) {
21729
+ ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
21730
+ ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
21731
+ }
21732
+ ellipse.setAttrs({
21733
+ x: ellipsePos.x + deltaX / 2,
21734
+ y: ellipsePos.y + deltaY / 2,
21735
+ radiusX: deltaX,
21736
+ radiusY: deltaY
21737
+ });
21738
+ this.instance.updateNode(nodeHandler.serialize(ellipse));
21739
+ }
21740
+ }
21741
+ trigger(cancelAction) {
21742
+ if (!this.instance) throw new Error("Instance not defined");
21743
+ if (!this.initialized) this.setupEvents();
21744
+ const stage = this.instance.getStage();
21745
+ stage.container().tabIndex = 1;
21746
+ stage.container().focus();
21747
+ this.cancelAction = cancelAction;
21748
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21749
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
21750
+ this.props = this.initProps();
21751
+ this.addEllipse();
21752
+ }
21753
+ cleanup() {
21754
+ const stage = this.instance.getStage();
21755
+ stage.container().style.cursor = "default";
21756
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21757
+ if (selectionPlugin) {
21758
+ const node = stage.findOne(`#${this.ellipseId}`);
21759
+ if (node) selectionPlugin.setSelectedNodes([node]);
21760
+ this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
21761
+ }
21762
+ this.ellipseId = null;
21763
+ this.creating = false;
21764
+ this.moved = false;
21765
+ this.container = void 0;
21766
+ this.clickPoint = null;
21767
+ this.setState(ELLIPSE_TOOL_STATE.IDLE);
21768
+ }
21769
+ };
21770
+
21294
21771
  //#endregion
21295
21772
  //#region src/actions/pen-tool/constants.ts
21296
21773
  const PEN_TOOL_ACTION_NAME = "penTool";
@@ -21387,7 +21864,7 @@ var WeavePenToolAction = class extends WeaveAction {
21387
21864
  const nodeHandler = this.instance.getNodeHandler("line");
21388
21865
  const node = nodeHandler.create(this.lineId, {
21389
21866
  ...this.props,
21390
- strokeScaleEnabled: false,
21867
+ strokeScaleEnabled: true,
21391
21868
  x: this.clickPoint?.x ?? 0,
21392
21869
  y: this.clickPoint?.y ?? 0,
21393
21870
  points: [0, 0]
@@ -21397,7 +21874,7 @@ var WeavePenToolAction = class extends WeaveAction {
21397
21874
  x: this.clickPoint?.x ?? 0,
21398
21875
  y: this.clickPoint?.y ?? 0,
21399
21876
  radius: 5 / stage.scaleX(),
21400
- strokeScaleEnabled: false,
21877
+ strokeScaleEnabled: true,
21401
21878
  stroke: "#cccccc",
21402
21879
  strokeWidth: 0,
21403
21880
  fill: "#cccccc"
@@ -21407,7 +21884,7 @@ var WeavePenToolAction = class extends WeaveAction {
21407
21884
  ...this.props,
21408
21885
  x: this.clickPoint?.x ?? 0,
21409
21886
  y: this.clickPoint?.y ?? 0,
21410
- strokeScaleEnabled: false,
21887
+ strokeScaleEnabled: true,
21411
21888
  points: [0, 0]
21412
21889
  });
21413
21890
  this.instance.addNode(tempLine, this.container?.getAttrs().id);
@@ -21415,7 +21892,7 @@ var WeavePenToolAction = class extends WeaveAction {
21415
21892
  x: this.clickPoint?.x ?? 0,
21416
21893
  y: this.clickPoint?.y ?? 0,
21417
21894
  radius: 5 / stage.scaleX(),
21418
- strokeScaleEnabled: false,
21895
+ strokeScaleEnabled: true,
21419
21896
  stroke: "#cccccc",
21420
21897
  strokeWidth: 0,
21421
21898
  fill: "#cccccc"
@@ -21611,7 +22088,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
21611
22088
  const nodeHandler = this.instance.getNodeHandler("line");
21612
22089
  const node = nodeHandler.create(this.strokeId, {
21613
22090
  ...this.props,
21614
- strokeScaleEnabled: false,
22091
+ strokeScaleEnabled: true,
21615
22092
  x: this.clickPoint?.x ?? 0,
21616
22093
  y: this.clickPoint?.y ?? 0,
21617
22094
  points: [0, 0]
@@ -21751,7 +22228,7 @@ var WeaveTextToolAction = class extends WeaveAction {
21751
22228
  strokeEnabled: false,
21752
22229
  stroke: "#000000ff",
21753
22230
  strokeWidth: 1,
21754
- strokeScaleEnabled: false,
22231
+ strokeScaleEnabled: true,
21755
22232
  align: "left",
21756
22233
  verticalAlign: "top",
21757
22234
  opacity: 1,
@@ -21788,6 +22265,444 @@ var WeaveTextToolAction = class extends WeaveAction {
21788
22265
  }
21789
22266
  };
21790
22267
 
22268
+ //#endregion
22269
+ //#region src/actions/star-tool/constants.ts
22270
+ const STAR_TOOL_ACTION_NAME = "starTool";
22271
+ const STAR_TOOL_STATE = {
22272
+ ["IDLE"]: "idle",
22273
+ ["ADDING"]: "adding",
22274
+ ["DEFINING_SIZE"]: "definingSize",
22275
+ ["ADDED"]: "added"
22276
+ };
22277
+
22278
+ //#endregion
22279
+ //#region src/actions/star-tool/star-tool.ts
22280
+ var WeaveStarToolAction = class extends WeaveAction {
22281
+ initialized = false;
22282
+ onPropsChange = void 0;
22283
+ onInit = void 0;
22284
+ constructor() {
22285
+ super();
22286
+ this.initialized = false;
22287
+ this.state = STAR_TOOL_STATE.IDLE;
22288
+ this.starId = null;
22289
+ this.creating = false;
22290
+ this.moved = false;
22291
+ this.container = void 0;
22292
+ this.clickPoint = null;
22293
+ this.props = this.initProps();
22294
+ }
22295
+ getName() {
22296
+ return STAR_TOOL_ACTION_NAME;
22297
+ }
22298
+ initProps() {
22299
+ return {
22300
+ opacity: 1,
22301
+ fill: "#71717aff",
22302
+ stroke: "#000000ff",
22303
+ strokeWidth: 1,
22304
+ numPoints: 5,
22305
+ innerRadius: 70,
22306
+ outerRadius: 184,
22307
+ keepAspectRatio: false
22308
+ };
22309
+ }
22310
+ setupEvents() {
22311
+ const stage = this.instance.getStage();
22312
+ stage.container().addEventListener("keydown", (e) => {
22313
+ if (e.key === "Enter" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
22314
+ this.cancelAction();
22315
+ return;
22316
+ }
22317
+ if (e.key === "Escape" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
22318
+ this.cancelAction();
22319
+ return;
22320
+ }
22321
+ });
22322
+ stage.on("mousedown touchstart", (e) => {
22323
+ e.evt.preventDefault();
22324
+ if (this.state === STAR_TOOL_STATE.ADDING) {
22325
+ this.creating = true;
22326
+ this.handleAdding();
22327
+ }
22328
+ });
22329
+ stage.on("mousemove touchmove", (e) => {
22330
+ e.evt.preventDefault();
22331
+ if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
22332
+ this.moved = true;
22333
+ this.handleMovement();
22334
+ }
22335
+ });
22336
+ stage.on("mouseup touchend", (e) => {
22337
+ e.evt.preventDefault();
22338
+ if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
22339
+ this.creating = false;
22340
+ this.handleSettingSize();
22341
+ }
22342
+ });
22343
+ this.initialized = true;
22344
+ }
22345
+ setState(state) {
22346
+ this.state = state;
22347
+ }
22348
+ addStar() {
22349
+ const stage = this.instance.getStage();
22350
+ stage.container().style.cursor = "crosshair";
22351
+ stage.container().focus();
22352
+ this.clickPoint = null;
22353
+ this.setState(STAR_TOOL_STATE.ADDING);
22354
+ }
22355
+ handleAdding() {
22356
+ const { mousePoint, container } = this.instance.getMousePointer();
22357
+ this.clickPoint = mousePoint;
22358
+ this.container = container;
22359
+ this.starId = v4_default();
22360
+ const nodeHandler = this.instance.getNodeHandler("star");
22361
+ const node = nodeHandler.create(this.starId, {
22362
+ ...this.props,
22363
+ strokeScaleEnabled: true,
22364
+ x: this.clickPoint?.x ?? 0,
22365
+ y: this.clickPoint?.y ?? 0,
22366
+ numPoints: 5,
22367
+ innerRadius: 0,
22368
+ outerRadius: 0
22369
+ });
22370
+ this.instance.addNode(node, this.container?.getAttrs().id);
22371
+ this.setState(STAR_TOOL_STATE.DEFINING_SIZE);
22372
+ }
22373
+ handleSettingSize() {
22374
+ const star = this.instance.getStage().findOne(`#${this.starId}`);
22375
+ if (this.starId && this.clickPoint && this.container && star) {
22376
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22377
+ const nodeHandler = this.instance.getNodeHandler("star");
22378
+ const starPos = {
22379
+ x: this.clickPoint.x,
22380
+ y: this.clickPoint.y
22381
+ };
22382
+ let starOuterRadius = this.props.outerRadius;
22383
+ let starInnerRadius = this.props.innerRadius;
22384
+ if (this.moved) {
22385
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22386
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22387
+ starOuterRadius = Math.abs(this.clickPoint.x - mousePoint.x);
22388
+ starInnerRadius = Math.abs(this.clickPoint.y - mousePoint.y);
22389
+ }
22390
+ star.setAttrs({
22391
+ ...this.props,
22392
+ x: starPos.x + starOuterRadius / 2,
22393
+ y: starPos.y + starOuterRadius / 2,
22394
+ outerRadius: starOuterRadius,
22395
+ innerRadius: starInnerRadius
22396
+ });
22397
+ this.instance.updateNode(nodeHandler.serialize(star));
22398
+ }
22399
+ this.cancelAction();
22400
+ }
22401
+ handleMovement() {
22402
+ if (this.state !== STAR_TOOL_STATE.DEFINING_SIZE) return;
22403
+ const star = this.instance.getStage().findOne(`#${this.starId}`);
22404
+ if (this.starId && this.container && this.clickPoint && star) {
22405
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22406
+ const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
22407
+ const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
22408
+ const nodeHandler = this.instance.getNodeHandler("star");
22409
+ const starPos = {
22410
+ x: this.clickPoint.x,
22411
+ y: this.clickPoint.y
22412
+ };
22413
+ if (this.moved) {
22414
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22415
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22416
+ }
22417
+ star.setAttrs({
22418
+ x: starPos.x + deltaX / 2,
22419
+ y: starPos.y + deltaX / 2,
22420
+ outerRadius: deltaX,
22421
+ innerRadius: deltaY
22422
+ });
22423
+ this.instance.updateNode(nodeHandler.serialize(star));
22424
+ }
22425
+ }
22426
+ trigger(cancelAction) {
22427
+ if (!this.instance) throw new Error("Instance not defined");
22428
+ if (!this.initialized) this.setupEvents();
22429
+ const stage = this.instance.getStage();
22430
+ stage.container().tabIndex = 1;
22431
+ stage.container().focus();
22432
+ this.cancelAction = cancelAction;
22433
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22434
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
22435
+ this.props = this.initProps();
22436
+ this.addStar();
22437
+ }
22438
+ cleanup() {
22439
+ const stage = this.instance.getStage();
22440
+ stage.container().style.cursor = "default";
22441
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22442
+ if (selectionPlugin) {
22443
+ const node = stage.findOne(`#${this.starId}`);
22444
+ if (node) selectionPlugin.setSelectedNodes([node]);
22445
+ this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
22446
+ }
22447
+ this.starId = null;
22448
+ this.creating = false;
22449
+ this.moved = false;
22450
+ this.container = void 0;
22451
+ this.clickPoint = null;
22452
+ this.setState(STAR_TOOL_STATE.IDLE);
22453
+ }
22454
+ };
22455
+
22456
+ //#endregion
22457
+ //#region src/actions/arrow-tool/constants.ts
22458
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
22459
+ const ARROW_TOOL_STATE = {
22460
+ ["IDLE"]: "idle",
22461
+ ["ADDING"]: "adding",
22462
+ ["DEFINING_SIZE"]: "definingSize",
22463
+ ["ADDED"]: "added"
22464
+ };
22465
+
22466
+ //#endregion
22467
+ //#region src/actions/arrow-tool/arrow-tool.ts
22468
+ var WeaveArrowToolAction = class extends WeaveAction {
22469
+ initialized = false;
22470
+ initialCursor = null;
22471
+ onPropsChange = void 0;
22472
+ onInit = void 0;
22473
+ constructor() {
22474
+ super();
22475
+ this.initialized = false;
22476
+ this.state = ARROW_TOOL_STATE.IDLE;
22477
+ this.arrowId = null;
22478
+ this.tempArrowId = null;
22479
+ this.container = void 0;
22480
+ this.measureContainer = void 0;
22481
+ this.clickPoint = null;
22482
+ this.tempPoint = void 0;
22483
+ this.tempNextPoint = void 0;
22484
+ this.props = this.initProps();
22485
+ }
22486
+ getName() {
22487
+ return ARROW_TOOL_ACTION_NAME;
22488
+ }
22489
+ initProps() {
22490
+ return {
22491
+ fill: "#000000ff",
22492
+ stroke: "#000000ff",
22493
+ strokeWidth: 1,
22494
+ opacity: 1,
22495
+ pointerLength: 10,
22496
+ pointerWidth: 10,
22497
+ pointerAtBeginning: false,
22498
+ pointerAtEnding: true
22499
+ };
22500
+ }
22501
+ setupEvents() {
22502
+ const stage = this.instance.getStage();
22503
+ stage.container().addEventListener("keydown", (e) => {
22504
+ if (e.key === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
22505
+ this.cancelAction();
22506
+ return;
22507
+ }
22508
+ if (e.key === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
22509
+ this.cancelAction();
22510
+ return;
22511
+ }
22512
+ });
22513
+ stage.on("dblclick dbltap", (e) => {
22514
+ e.evt.preventDefault();
22515
+ this.cancelAction();
22516
+ });
22517
+ stage.on("click tap", (e) => {
22518
+ e.evt.preventDefault();
22519
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
22520
+ if (this.state === ARROW_TOOL_STATE.ADDING) {
22521
+ this.handleAdding();
22522
+ return;
22523
+ }
22524
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) {
22525
+ this.handleSettingSize();
22526
+ return;
22527
+ }
22528
+ });
22529
+ stage.on("mousemove touchmove", (e) => {
22530
+ e.evt.preventDefault();
22531
+ this.handleMovement();
22532
+ });
22533
+ this.initialized = true;
22534
+ }
22535
+ setState(state) {
22536
+ this.state = state;
22537
+ }
22538
+ addArrow() {
22539
+ const stage = this.instance.getStage();
22540
+ stage.container().style.cursor = "crosshair";
22541
+ this.tempPoint = void 0;
22542
+ this.tempNextPoint = void 0;
22543
+ this.clickPoint = null;
22544
+ this.setState(ARROW_TOOL_STATE.ADDING);
22545
+ }
22546
+ handleAdding() {
22547
+ const stage = this.instance.getStage();
22548
+ const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
22549
+ this.clickPoint = mousePoint;
22550
+ this.container = container;
22551
+ this.measureContainer = measureContainer;
22552
+ this.arrowId = v4_default();
22553
+ this.tempArrowId = v4_default();
22554
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22555
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22556
+ const node = lineNodeHandler.create(this.arrowId, {
22557
+ ...this.props,
22558
+ strokeScaleEnabled: true,
22559
+ x: this.clickPoint?.x ?? 0,
22560
+ y: this.clickPoint?.y ?? 0,
22561
+ points: [0, 0]
22562
+ });
22563
+ this.instance.addNode(node, this.container?.getAttrs().id);
22564
+ this.tempPoint = new konva.default.Circle({
22565
+ x: this.clickPoint?.x ?? 0,
22566
+ y: this.clickPoint?.y ?? 0,
22567
+ radius: 5 / stage.scaleX(),
22568
+ strokeScaleEnabled: true,
22569
+ stroke: "#cccccc",
22570
+ strokeWidth: 0,
22571
+ fill: "#cccccc"
22572
+ });
22573
+ this.measureContainer?.add(this.tempPoint);
22574
+ const tempArrow = nodeHandler.create(this.tempArrowId, {
22575
+ ...this.props,
22576
+ x: this.clickPoint?.x ?? 0,
22577
+ y: this.clickPoint?.y ?? 0,
22578
+ strokeScaleEnabled: true,
22579
+ points: [0, 0]
22580
+ });
22581
+ this.instance.addNode(tempArrow, this.container?.getAttrs().id);
22582
+ this.tempNextPoint = new konva.default.Circle({
22583
+ x: this.clickPoint?.x ?? 0,
22584
+ y: this.clickPoint?.y ?? 0,
22585
+ radius: 5 / stage.scaleX(),
22586
+ strokeScaleEnabled: true,
22587
+ stroke: "#cccccc",
22588
+ strokeWidth: 0,
22589
+ fill: "#cccccc"
22590
+ });
22591
+ this.measureContainer?.add(this.tempNextPoint);
22592
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
22593
+ }
22594
+ handleSettingSize() {
22595
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22596
+ const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
22597
+ if (this.arrowId && this.tempPoint && this.tempNextPoint && this.measureContainer && tempMainArrow && tempArrow) {
22598
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
22599
+ const newPoints = [...tempMainArrow.points()];
22600
+ newPoints.push(mousePoint.x - tempMainArrow.x());
22601
+ newPoints.push(mousePoint.y - tempMainArrow.y());
22602
+ tempMainArrow.setAttrs({
22603
+ ...this.props,
22604
+ points: newPoints
22605
+ });
22606
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22607
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22608
+ this.instance.updateNode(lineNodeHandler.serialize(tempMainArrow));
22609
+ this.tempPoint.setAttrs({
22610
+ x: mousePoint.x,
22611
+ y: mousePoint.y
22612
+ });
22613
+ this.tempNextPoint.setAttrs({
22614
+ x: mousePoint.x,
22615
+ y: mousePoint.y
22616
+ });
22617
+ tempArrow.setAttrs({
22618
+ ...this.props,
22619
+ x: mousePoint.x,
22620
+ y: mousePoint.y,
22621
+ points: [0, 0]
22622
+ });
22623
+ this.instance.updateNode(nodeHandler.serialize(tempArrow));
22624
+ }
22625
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
22626
+ }
22627
+ handleMovement() {
22628
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
22629
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22630
+ if (this.arrowId && this.measureContainer && this.tempNextPoint && tempArrow) {
22631
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
22632
+ tempArrow.setAttrs({
22633
+ ...this.props,
22634
+ points: [
22635
+ tempArrow.points()[0],
22636
+ tempArrow.points()[1],
22637
+ mousePoint.x - tempArrow.x(),
22638
+ mousePoint.y - tempArrow.y()
22639
+ ]
22640
+ });
22641
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22642
+ this.instance.updateNode(nodeHandler.serialize(tempArrow));
22643
+ this.tempNextPoint.setAttrs({
22644
+ x: mousePoint.x,
22645
+ y: mousePoint.y
22646
+ });
22647
+ }
22648
+ }
22649
+ trigger(cancelAction) {
22650
+ if (!this.instance) throw new Error("Instance not defined");
22651
+ if (!this.initialized) this.setupEvents();
22652
+ const stage = this.instance.getStage();
22653
+ stage.container().tabIndex = 1;
22654
+ stage.container().focus();
22655
+ this.cancelAction = cancelAction;
22656
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22657
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
22658
+ this.props = this.initProps();
22659
+ this.addArrow();
22660
+ }
22661
+ cleanup() {
22662
+ const stage = this.instance.getStage();
22663
+ this.tempPoint?.destroy();
22664
+ this.tempNextPoint?.destroy();
22665
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22666
+ const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
22667
+ if (tempArrow) {
22668
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22669
+ this.instance.removeNode(nodeHandler.serialize(tempArrow));
22670
+ }
22671
+ if (this.arrowId && tempMainArrow && tempMainArrow.points().length < 4) {
22672
+ const nodeHandler = this.instance.getNodeHandler("line");
22673
+ this.instance.removeNode(nodeHandler.serialize(tempMainArrow));
22674
+ }
22675
+ if (this.arrowId && tempMainArrow && tempMainArrow.points().length >= 4) {
22676
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22677
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22678
+ const finalArrow = nodeHandler.create(this.arrowId, {
22679
+ ...tempMainArrow.getAttrs(),
22680
+ ...this.props,
22681
+ strokeScaleEnabled: true,
22682
+ strokeWidth: 1,
22683
+ hitStrokeWidth: 16
22684
+ });
22685
+ this.instance.removeNode(lineNodeHandler.serialize(tempMainArrow));
22686
+ this.instance.addNode(finalArrow, this.container?.getAttrs().id);
22687
+ }
22688
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22689
+ if (selectionPlugin) {
22690
+ const node = stage.findOne(`#${this.arrowId}`);
22691
+ if (node) selectionPlugin.setSelectedNodes([node]);
22692
+ this.instance.triggerAction("selectionTool");
22693
+ }
22694
+ stage.container().style.cursor = "default";
22695
+ this.initialCursor = null;
22696
+ this.tempPoint = void 0;
22697
+ this.tempNextPoint = void 0;
22698
+ this.arrowId = null;
22699
+ this.tempArrowId = null;
22700
+ this.container = void 0;
22701
+ this.clickPoint = null;
22702
+ this.setState(ARROW_TOOL_STATE.IDLE);
22703
+ }
22704
+ };
22705
+
21791
22706
  //#endregion
21792
22707
  //#region src/actions/frame-tool/constants.ts
21793
22708
  const FRAME_TOOL_ACTION_NAME = "frameTool";
@@ -23224,9 +24139,13 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
23224
24139
  };
23225
24140
 
23226
24141
  //#endregion
24142
+ exports.ARROW_TOOL_ACTION_NAME = ARROW_TOOL_ACTION_NAME
24143
+ exports.ARROW_TOOL_STATE = ARROW_TOOL_STATE
23227
24144
  exports.BRUSH_TOOL_ACTION_NAME = BRUSH_TOOL_ACTION_NAME
23228
24145
  exports.BRUSH_TOOL_STATE = BRUSH_TOOL_STATE
23229
24146
  exports.COPY_PASTE_NODES_PLUGIN_STATE = COPY_PASTE_NODES_PLUGIN_STATE
24147
+ exports.ELLIPSE_TOOL_ACTION_NAME = ELLIPSE_TOOL_ACTION_NAME
24148
+ exports.ELLIPSE_TOOL_STATE = ELLIPSE_TOOL_STATE
23230
24149
  exports.ERASER_TOOL_ACTION_NAME = ERASER_TOOL_ACTION_NAME
23231
24150
  exports.ERASER_TOOL_STATE = ERASER_TOOL_STATE
23232
24151
  exports.FRAME_TOOL_ACTION_NAME = FRAME_TOOL_ACTION_NAME
@@ -23247,11 +24166,15 @@ exports.RECTANGLE_TOOL_ACTION_NAME = RECTANGLE_TOOL_ACTION_NAME
23247
24166
  exports.RECTANGLE_TOOL_STATE = RECTANGLE_TOOL_STATE
23248
24167
  exports.SELECTION_TOOL_ACTION_NAME = SELECTION_TOOL_ACTION_NAME
23249
24168
  exports.SELECTION_TOOL_STATE = SELECTION_TOOL_STATE
24169
+ exports.STAR_TOOL_ACTION_NAME = STAR_TOOL_ACTION_NAME
24170
+ exports.STAR_TOOL_STATE = STAR_TOOL_STATE
23250
24171
  exports.TEXT_LAYOUT = TEXT_LAYOUT
23251
24172
  exports.TEXT_TOOL_ACTION_NAME = TEXT_TOOL_ACTION_NAME
23252
24173
  exports.TEXT_TOOL_STATE = TEXT_TOOL_STATE
24174
+ exports.WEAVE_ARROW_NODE_TYPE = WEAVE_ARROW_NODE_TYPE
23253
24175
  exports.WEAVE_COPY_PASTE_NODES_KEY = WEAVE_COPY_PASTE_NODES_KEY
23254
24176
  exports.WEAVE_DEFAULT_USER_INFO_FUNCTION = WEAVE_DEFAULT_USER_INFO_FUNCTION
24177
+ exports.WEAVE_ELLIPSE_NODE_TYPE = WEAVE_ELLIPSE_NODE_TYPE
23255
24178
  exports.WEAVE_FRAME_NODE_DEFAULT_CONFIG = WEAVE_FRAME_NODE_DEFAULT_CONFIG
23256
24179
  exports.WEAVE_FRAME_NODE_DEFAULT_PROPS = WEAVE_FRAME_NODE_DEFAULT_PROPS
23257
24180
  exports.WEAVE_FRAME_NODE_SIZES = WEAVE_FRAME_NODE_SIZES
@@ -23265,10 +24188,18 @@ exports.WEAVE_GRID_DEFAULT_SIZE = WEAVE_GRID_DEFAULT_SIZE
23265
24188
  exports.WEAVE_GRID_DEFAULT_TYPE = WEAVE_GRID_DEFAULT_TYPE
23266
24189
  exports.WEAVE_GRID_LAYER_ID = WEAVE_GRID_LAYER_ID
23267
24190
  exports.WEAVE_GRID_TYPES = WEAVE_GRID_TYPES
24191
+ exports.WEAVE_GROUP_NODE_TYPE = WEAVE_GROUP_NODE_TYPE
24192
+ exports.WEAVE_IMAGE_NODE_TYPE = WEAVE_IMAGE_NODE_TYPE
24193
+ exports.WEAVE_LAYER_NODE_TYPE = WEAVE_LAYER_NODE_TYPE
24194
+ exports.WEAVE_LINE_NODE_TYPE = WEAVE_LINE_NODE_TYPE
23268
24195
  exports.WEAVE_NODES_SELECTION_KEY = WEAVE_NODES_SELECTION_KEY
23269
24196
  exports.WEAVE_NODES_SELECTION_LAYER_ID = WEAVE_NODES_SELECTION_LAYER_ID
23270
24197
  exports.WEAVE_NODES_SNAPPING_KEY = WEAVE_NODES_SNAPPING_KEY
24198
+ exports.WEAVE_RECTANGLE_NODE_TYPE = WEAVE_RECTANGLE_NODE_TYPE
23271
24199
  exports.WEAVE_STAGE_GRID_KEY = WEAVE_STAGE_GRID_KEY
24200
+ exports.WEAVE_STAGE_NODE_TYPE = WEAVE_STAGE_NODE_TYPE
24201
+ exports.WEAVE_STAR_NODE_TYPE = WEAVE_STAR_NODE_TYPE
24202
+ exports.WEAVE_TEXT_NODE_TYPE = WEAVE_TEXT_NODE_TYPE
23272
24203
  exports.WEAVE_USERS_POINTERS_KEY = WEAVE_USERS_POINTERS_KEY
23273
24204
  exports.WEAVE_USERS_SELECTION_KEY = WEAVE_USERS_SELECTION_KEY
23274
24205
  exports.WEAVE_USER_POINTERS_DEFAULT_PROPS = WEAVE_USER_POINTERS_DEFAULT_PROPS
@@ -23276,10 +24207,14 @@ exports.WEAVE_USER_POINTER_KEY = WEAVE_USER_POINTER_KEY
23276
24207
  exports.WEAVE_USER_SELECTION_KEY = WEAVE_USER_SELECTION_KEY
23277
24208
  exports.Weave = Weave
23278
24209
  exports.WeaveAction = WeaveAction
24210
+ exports.WeaveArrowNode = WeaveArrowNode
24211
+ exports.WeaveArrowToolAction = WeaveArrowToolAction
23279
24212
  exports.WeaveBrushToolAction = WeaveBrushToolAction
23280
24213
  exports.WeaveConnectedUsersPlugin = WeaveConnectedUsersPlugin
23281
24214
  exports.WeaveContextMenuPlugin = WeaveContextMenuPlugin
23282
24215
  exports.WeaveCopyPasteNodesPlugin = WeaveCopyPasteNodesPlugin
24216
+ exports.WeaveEllipseNode = WeaveEllipseNode
24217
+ exports.WeaveEllipseToolAction = WeaveEllipseToolAction
23283
24218
  exports.WeaveEraserToolAction = WeaveEraserToolAction
23284
24219
  exports.WeaveExportNodeToolAction = WeaveExportNodeToolAction
23285
24220
  exports.WeaveExportStageToolAction = WeaveExportStageToolAction
@@ -23307,6 +24242,8 @@ exports.WeaveStageNode = WeaveStageNode
23307
24242
  exports.WeaveStagePanningPlugin = WeaveStagePanningPlugin
23308
24243
  exports.WeaveStageResizePlugin = WeaveStageResizePlugin
23309
24244
  exports.WeaveStageZoomPlugin = WeaveStageZoomPlugin
24245
+ exports.WeaveStarNode = WeaveStarNode
24246
+ exports.WeaveStarToolAction = WeaveStarToolAction
23310
24247
  exports.WeaveStore = WeaveStore
23311
24248
  exports.WeaveTextNode = WeaveTextNode
23312
24249
  exports.WeaveTextToolAction = WeaveTextToolAction