@inditextech/weave-sdk 0.21.2 → 0.22.1

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.1";
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,6 +20784,8 @@ var WeaveFrameNode = class extends WeaveNode {
20546
20784
  const WEAVE_STAGE_ZOOM_KEY = "stageZoom";
20547
20785
  const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
20548
20786
  zoomSteps: [
20787
+ .01,
20788
+ .05,
20549
20789
  .1,
20550
20790
  .2,
20551
20791
  .3,
@@ -20564,7 +20804,11 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
20564
20804
  4,
20565
20805
  6,
20566
20806
  8,
20567
- 10
20807
+ 10,
20808
+ 20,
20809
+ 50,
20810
+ 100,
20811
+ 250
20568
20812
  ],
20569
20813
  defaultZoom: 1,
20570
20814
  fitToScreen: { padding: 40 },
@@ -20586,6 +20830,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20586
20830
  };
20587
20831
  if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
20588
20832
  this.isCtrlOrMetaPressed = false;
20833
+ this.updatedMinimumZoom = false;
20589
20834
  this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
20590
20835
  this.actualScale = this.config.zoomSteps[this.actualStep];
20591
20836
  this.defaultStep = this.actualStep;
@@ -20595,9 +20840,23 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20595
20840
  }
20596
20841
  onInit() {
20597
20842
  this.initEvents();
20843
+ const mainLayer = this.instance.getMainLayer();
20844
+ const handleDraw = () => {
20845
+ const minimumZoom = this.minimumZoom();
20846
+ if (this.updatedMinimumZoom && minimumZoom < this.config.zoomSteps[0]) {
20847
+ this.updatedMinimumZoom = true;
20848
+ const [_, ...restSteps] = this.config.zoomSteps;
20849
+ this.config.zoomSteps = [minimumZoom, ...restSteps];
20850
+ }
20851
+ if (!this.updatedMinimumZoom && minimumZoom < this.config.zoomSteps[0]) {
20852
+ this.updatedMinimumZoom = true;
20853
+ this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
20854
+ }
20855
+ };
20856
+ mainLayer?.on("draw", (0, import_lodash.throttle)(handleDraw, 50));
20598
20857
  this.setZoom(this.config.zoomSteps[this.actualStep]);
20599
20858
  }
20600
- setZoom(scale, centered = true) {
20859
+ setZoom(scale, centered = true, pointer) {
20601
20860
  const stage = this.instance.getStage();
20602
20861
  const mainLayer = this.instance.getMainLayer();
20603
20862
  if (mainLayer) {
@@ -20622,6 +20881,17 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20622
20881
  };
20623
20882
  stage.position(newPos);
20624
20883
  }
20884
+ if (!centered && pointer) {
20885
+ const mousePointTo = {
20886
+ x: (pointer.x - stage.x()) / oldScale,
20887
+ y: (pointer.y - stage.y()) / oldScale
20888
+ };
20889
+ const newPos = {
20890
+ x: pointer.x - mousePointTo.x * scale,
20891
+ y: pointer.y - mousePointTo.y * scale
20892
+ };
20893
+ stage.position(newPos);
20894
+ }
20625
20895
  const plugins = this.instance.getPlugins();
20626
20896
  for (const pluginId of Object.keys(plugins)) {
20627
20897
  const pluginInstance = plugins[pluginId];
@@ -20642,7 +20912,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20642
20912
  if (!this.enabled) return false;
20643
20913
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20644
20914
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
20645
- return this.actualStep - 1 > 0;
20915
+ return this.actualStep - 1 >= 0;
20646
20916
  }
20647
20917
  canZoomIn() {
20648
20918
  if (!this.enabled) return false;
@@ -20660,66 +20930,86 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20660
20930
  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
20931
  return this.config.zoomSteps.findIndex((scale) => scale === nextValue);
20662
20932
  }
20663
- zoomIn() {
20933
+ zoomIn(pointer) {
20664
20934
  if (!this.enabled) return;
20665
20935
  if (!this.canZoomIn()) return;
20666
20936
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20667
20937
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomIn");
20668
20938
  else this.actualStep += 1;
20669
- this.setZoom(this.config.zoomSteps[this.actualStep]);
20939
+ this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
20670
20940
  }
20671
- zoomOut() {
20941
+ zoomOut(pointer) {
20672
20942
  if (!this.enabled) return;
20673
20943
  if (!this.canZoomOut()) return;
20674
20944
  const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
20675
20945
  if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
20676
20946
  else this.actualStep -= 1;
20677
- this.setZoom(this.config.zoomSteps[this.actualStep]);
20947
+ this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
20948
+ }
20949
+ minimumZoom() {
20950
+ if (!this.enabled) return -1;
20951
+ const mainLayer = this.instance.getMainLayer();
20952
+ if (!mainLayer) return -1;
20953
+ if (mainLayer.getChildren().length === 0) return this.config.zoomSteps[this.defaultStep];
20954
+ const stage = this.instance.getStage();
20955
+ const box = mainLayer.getClientRect({
20956
+ relativeTo: stage,
20957
+ skipStroke: true
20958
+ });
20959
+ const stageBox = {
20960
+ width: stage.width(),
20961
+ height: stage.height()
20962
+ };
20963
+ const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
20964
+ const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
20965
+ const scaleX = availableScreenWidth / box.width;
20966
+ const scaleY = availableScreenHeight / box.height;
20967
+ const scale = Math.min(scaleX, scaleY);
20968
+ return scale;
20678
20969
  }
20679
20970
  fitToScreen() {
20680
20971
  if (!this.enabled) return;
20681
20972
  const mainLayer = this.instance.getMainLayer();
20973
+ if (!mainLayer) return;
20682
20974
  if (mainLayer?.getChildren().length === 0) {
20683
20975
  this.setZoom(this.config.zoomSteps[this.defaultStep]);
20684
20976
  return;
20685
20977
  }
20686
20978
  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");
20722
- const nodes = selectionPlugin.getTransformer().getNodes();
20979
+ const box = mainLayer.getClientRect({
20980
+ relativeTo: stage,
20981
+ skipStroke: true
20982
+ });
20983
+ const stageBox = {
20984
+ width: stage.width(),
20985
+ height: stage.height()
20986
+ };
20987
+ const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
20988
+ const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
20989
+ const scaleX = availableScreenWidth / box.width;
20990
+ const scaleY = availableScreenHeight / box.height;
20991
+ const scale = Math.min(scaleX, scaleY);
20992
+ stage.scale({
20993
+ x: scale,
20994
+ y: scale
20995
+ });
20996
+ const selectionCenterX = box.x + box.width / 2;
20997
+ const selectionCenterY = box.y + box.height / 2;
20998
+ const canvasCenterX = stage.width() / (2 * scale);
20999
+ const canvasCenterY = stage.height() / (2 * scale);
21000
+ const stageX = (canvasCenterX - selectionCenterX) * scale;
21001
+ const stageY = (canvasCenterY - selectionCenterY) * scale;
21002
+ stage.position({
21003
+ x: stageX,
21004
+ y: stageY
21005
+ });
21006
+ this.setZoom(scale, false);
21007
+ }
21008
+ fitToSelection() {
21009
+ if (!this.enabled) return;
21010
+ const stage = this.instance.getStage();
21011
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21012
+ const nodes = selectionPlugin.getTransformer().getNodes();
20723
21013
  if (nodes.length === 0) return;
20724
21014
  let zoomTransformer = stage.findOne("#zoomTransformer");
20725
21015
  if (!zoomTransformer) {
@@ -20786,8 +21076,11 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
20786
21076
  });
20787
21077
  window.addEventListener("wheel", (e) => {
20788
21078
  if (!this.enabled || !this.isCtrlOrMetaPressed) return;
20789
- if (e.deltaY > 0) this.zoomOut();
20790
- if (e.deltaY < 0) this.zoomIn();
21079
+ const stage = this.instance.getStage();
21080
+ const pointer = stage.getPointerPosition();
21081
+ if (!pointer) return;
21082
+ if (e.deltaY > 0) this.zoomOut(pointer);
21083
+ if (e.deltaY < 0) this.zoomIn(pointer);
20791
21084
  });
20792
21085
  }
20793
21086
  };
@@ -21209,7 +21502,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
21209
21502
  const nodeHandler = this.instance.getNodeHandler("rectangle");
21210
21503
  const node = nodeHandler.create(this.rectId, {
21211
21504
  ...this.props,
21212
- strokeScaleEnabled: false,
21505
+ strokeScaleEnabled: true,
21213
21506
  x: this.clickPoint?.x ?? 0,
21214
21507
  y: this.clickPoint?.y ?? 0,
21215
21508
  width: 0,
@@ -21291,6 +21584,192 @@ var WeaveRectangleToolAction = class extends WeaveAction {
21291
21584
  }
21292
21585
  };
21293
21586
 
21587
+ //#endregion
21588
+ //#region src/actions/ellipse-tool/constants.ts
21589
+ const ELLIPSE_TOOL_ACTION_NAME = "ellipseTool";
21590
+ const ELLIPSE_TOOL_STATE = {
21591
+ ["IDLE"]: "idle",
21592
+ ["ADDING"]: "adding",
21593
+ ["DEFINING_SIZE"]: "definingSize",
21594
+ ["ADDED"]: "added"
21595
+ };
21596
+
21597
+ //#endregion
21598
+ //#region src/actions/ellipse-tool/ellipse-tool.ts
21599
+ var WeaveEllipseToolAction = class extends WeaveAction {
21600
+ initialized = false;
21601
+ onPropsChange = void 0;
21602
+ onInit = void 0;
21603
+ constructor() {
21604
+ super();
21605
+ this.initialized = false;
21606
+ this.state = ELLIPSE_TOOL_STATE.IDLE;
21607
+ this.ellipseId = null;
21608
+ this.creating = false;
21609
+ this.moved = false;
21610
+ this.container = void 0;
21611
+ this.clickPoint = null;
21612
+ this.props = this.initProps();
21613
+ }
21614
+ getName() {
21615
+ return ELLIPSE_TOOL_ACTION_NAME;
21616
+ }
21617
+ initProps() {
21618
+ return {
21619
+ opacity: 1,
21620
+ fill: "#71717aff",
21621
+ stroke: "#000000ff",
21622
+ strokeWidth: 1,
21623
+ radiusX: 50,
21624
+ radiusY: 50,
21625
+ keepAspectRatio: false
21626
+ };
21627
+ }
21628
+ setupEvents() {
21629
+ const stage = this.instance.getStage();
21630
+ stage.container().addEventListener("keydown", (e) => {
21631
+ if (e.key === "Enter" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
21632
+ this.cancelAction();
21633
+ return;
21634
+ }
21635
+ if (e.key === "Escape" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
21636
+ this.cancelAction();
21637
+ return;
21638
+ }
21639
+ });
21640
+ stage.on("mousedown touchstart", (e) => {
21641
+ e.evt.preventDefault();
21642
+ if (this.state === ELLIPSE_TOOL_STATE.ADDING) {
21643
+ this.creating = true;
21644
+ this.handleAdding();
21645
+ }
21646
+ });
21647
+ stage.on("mousemove touchmove", (e) => {
21648
+ e.evt.preventDefault();
21649
+ if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
21650
+ this.moved = true;
21651
+ this.handleMovement();
21652
+ }
21653
+ });
21654
+ stage.on("mouseup touchend", (e) => {
21655
+ e.evt.preventDefault();
21656
+ if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
21657
+ this.creating = false;
21658
+ this.handleSettingSize();
21659
+ }
21660
+ });
21661
+ this.initialized = true;
21662
+ }
21663
+ setState(state) {
21664
+ this.state = state;
21665
+ }
21666
+ addEllipse() {
21667
+ const stage = this.instance.getStage();
21668
+ stage.container().style.cursor = "crosshair";
21669
+ stage.container().focus();
21670
+ this.clickPoint = null;
21671
+ this.setState(ELLIPSE_TOOL_STATE.ADDING);
21672
+ }
21673
+ handleAdding() {
21674
+ const { mousePoint, container } = this.instance.getMousePointer();
21675
+ this.clickPoint = mousePoint;
21676
+ this.container = container;
21677
+ this.ellipseId = v4_default();
21678
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21679
+ const node = nodeHandler.create(this.ellipseId, {
21680
+ ...this.props,
21681
+ strokeScaleEnabled: true,
21682
+ x: this.clickPoint?.x ?? 0,
21683
+ y: this.clickPoint?.y ?? 0,
21684
+ radiusX: 0,
21685
+ radiusY: 0
21686
+ });
21687
+ this.instance.addNode(node, this.container?.getAttrs().id);
21688
+ this.setState(ELLIPSE_TOOL_STATE.DEFINING_SIZE);
21689
+ }
21690
+ handleSettingSize() {
21691
+ const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
21692
+ if (this.ellipseId && this.clickPoint && this.container && ellipse) {
21693
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
21694
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21695
+ const ellipsePos = {
21696
+ x: this.clickPoint.x,
21697
+ y: this.clickPoint.y
21698
+ };
21699
+ let ellipseRadiusX = this.props.radiusY;
21700
+ let ellipseRadiusY = this.props.radiusY;
21701
+ if (this.moved) {
21702
+ ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
21703
+ ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
21704
+ ellipseRadiusX = Math.abs(this.clickPoint.x - mousePoint.x);
21705
+ ellipseRadiusY = Math.abs(this.clickPoint.y - mousePoint.y);
21706
+ }
21707
+ ellipse.setAttrs({
21708
+ ...this.props,
21709
+ x: ellipsePos.x + ellipseRadiusX / 2,
21710
+ y: ellipsePos.y + ellipseRadiusY / 2,
21711
+ radiusX: ellipseRadiusX,
21712
+ radiusY: ellipseRadiusY
21713
+ });
21714
+ this.instance.updateNode(nodeHandler.serialize(ellipse));
21715
+ }
21716
+ this.cancelAction();
21717
+ }
21718
+ handleMovement() {
21719
+ if (this.state !== ELLIPSE_TOOL_STATE.DEFINING_SIZE) return;
21720
+ const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
21721
+ if (this.ellipseId && this.container && this.clickPoint && ellipse) {
21722
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
21723
+ const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
21724
+ const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
21725
+ const nodeHandler = this.instance.getNodeHandler("ellipse");
21726
+ const ellipsePos = {
21727
+ x: this.clickPoint.x,
21728
+ y: this.clickPoint.y
21729
+ };
21730
+ if (this.moved) {
21731
+ ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
21732
+ ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
21733
+ }
21734
+ ellipse.setAttrs({
21735
+ x: ellipsePos.x + deltaX / 2,
21736
+ y: ellipsePos.y + deltaY / 2,
21737
+ radiusX: deltaX,
21738
+ radiusY: deltaY
21739
+ });
21740
+ this.instance.updateNode(nodeHandler.serialize(ellipse));
21741
+ }
21742
+ }
21743
+ trigger(cancelAction) {
21744
+ if (!this.instance) throw new Error("Instance not defined");
21745
+ if (!this.initialized) this.setupEvents();
21746
+ const stage = this.instance.getStage();
21747
+ stage.container().tabIndex = 1;
21748
+ stage.container().focus();
21749
+ this.cancelAction = cancelAction;
21750
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21751
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
21752
+ this.props = this.initProps();
21753
+ this.addEllipse();
21754
+ }
21755
+ cleanup() {
21756
+ const stage = this.instance.getStage();
21757
+ stage.container().style.cursor = "default";
21758
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
21759
+ if (selectionPlugin) {
21760
+ const node = stage.findOne(`#${this.ellipseId}`);
21761
+ if (node) selectionPlugin.setSelectedNodes([node]);
21762
+ this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
21763
+ }
21764
+ this.ellipseId = null;
21765
+ this.creating = false;
21766
+ this.moved = false;
21767
+ this.container = void 0;
21768
+ this.clickPoint = null;
21769
+ this.setState(ELLIPSE_TOOL_STATE.IDLE);
21770
+ }
21771
+ };
21772
+
21294
21773
  //#endregion
21295
21774
  //#region src/actions/pen-tool/constants.ts
21296
21775
  const PEN_TOOL_ACTION_NAME = "penTool";
@@ -21387,7 +21866,7 @@ var WeavePenToolAction = class extends WeaveAction {
21387
21866
  const nodeHandler = this.instance.getNodeHandler("line");
21388
21867
  const node = nodeHandler.create(this.lineId, {
21389
21868
  ...this.props,
21390
- strokeScaleEnabled: false,
21869
+ strokeScaleEnabled: true,
21391
21870
  x: this.clickPoint?.x ?? 0,
21392
21871
  y: this.clickPoint?.y ?? 0,
21393
21872
  points: [0, 0]
@@ -21397,7 +21876,7 @@ var WeavePenToolAction = class extends WeaveAction {
21397
21876
  x: this.clickPoint?.x ?? 0,
21398
21877
  y: this.clickPoint?.y ?? 0,
21399
21878
  radius: 5 / stage.scaleX(),
21400
- strokeScaleEnabled: false,
21879
+ strokeScaleEnabled: true,
21401
21880
  stroke: "#cccccc",
21402
21881
  strokeWidth: 0,
21403
21882
  fill: "#cccccc"
@@ -21407,7 +21886,7 @@ var WeavePenToolAction = class extends WeaveAction {
21407
21886
  ...this.props,
21408
21887
  x: this.clickPoint?.x ?? 0,
21409
21888
  y: this.clickPoint?.y ?? 0,
21410
- strokeScaleEnabled: false,
21889
+ strokeScaleEnabled: true,
21411
21890
  points: [0, 0]
21412
21891
  });
21413
21892
  this.instance.addNode(tempLine, this.container?.getAttrs().id);
@@ -21415,7 +21894,7 @@ var WeavePenToolAction = class extends WeaveAction {
21415
21894
  x: this.clickPoint?.x ?? 0,
21416
21895
  y: this.clickPoint?.y ?? 0,
21417
21896
  radius: 5 / stage.scaleX(),
21418
- strokeScaleEnabled: false,
21897
+ strokeScaleEnabled: true,
21419
21898
  stroke: "#cccccc",
21420
21899
  strokeWidth: 0,
21421
21900
  fill: "#cccccc"
@@ -21611,7 +22090,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
21611
22090
  const nodeHandler = this.instance.getNodeHandler("line");
21612
22091
  const node = nodeHandler.create(this.strokeId, {
21613
22092
  ...this.props,
21614
- strokeScaleEnabled: false,
22093
+ strokeScaleEnabled: true,
21615
22094
  x: this.clickPoint?.x ?? 0,
21616
22095
  y: this.clickPoint?.y ?? 0,
21617
22096
  points: [0, 0]
@@ -21751,7 +22230,7 @@ var WeaveTextToolAction = class extends WeaveAction {
21751
22230
  strokeEnabled: false,
21752
22231
  stroke: "#000000ff",
21753
22232
  strokeWidth: 1,
21754
- strokeScaleEnabled: false,
22233
+ strokeScaleEnabled: true,
21755
22234
  align: "left",
21756
22235
  verticalAlign: "top",
21757
22236
  opacity: 1,
@@ -21788,6 +22267,444 @@ var WeaveTextToolAction = class extends WeaveAction {
21788
22267
  }
21789
22268
  };
21790
22269
 
22270
+ //#endregion
22271
+ //#region src/actions/star-tool/constants.ts
22272
+ const STAR_TOOL_ACTION_NAME = "starTool";
22273
+ const STAR_TOOL_STATE = {
22274
+ ["IDLE"]: "idle",
22275
+ ["ADDING"]: "adding",
22276
+ ["DEFINING_SIZE"]: "definingSize",
22277
+ ["ADDED"]: "added"
22278
+ };
22279
+
22280
+ //#endregion
22281
+ //#region src/actions/star-tool/star-tool.ts
22282
+ var WeaveStarToolAction = class extends WeaveAction {
22283
+ initialized = false;
22284
+ onPropsChange = void 0;
22285
+ onInit = void 0;
22286
+ constructor() {
22287
+ super();
22288
+ this.initialized = false;
22289
+ this.state = STAR_TOOL_STATE.IDLE;
22290
+ this.starId = null;
22291
+ this.creating = false;
22292
+ this.moved = false;
22293
+ this.container = void 0;
22294
+ this.clickPoint = null;
22295
+ this.props = this.initProps();
22296
+ }
22297
+ getName() {
22298
+ return STAR_TOOL_ACTION_NAME;
22299
+ }
22300
+ initProps() {
22301
+ return {
22302
+ opacity: 1,
22303
+ fill: "#71717aff",
22304
+ stroke: "#000000ff",
22305
+ strokeWidth: 1,
22306
+ numPoints: 5,
22307
+ innerRadius: 70,
22308
+ outerRadius: 184,
22309
+ keepAspectRatio: false
22310
+ };
22311
+ }
22312
+ setupEvents() {
22313
+ const stage = this.instance.getStage();
22314
+ stage.container().addEventListener("keydown", (e) => {
22315
+ if (e.key === "Enter" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
22316
+ this.cancelAction();
22317
+ return;
22318
+ }
22319
+ if (e.key === "Escape" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
22320
+ this.cancelAction();
22321
+ return;
22322
+ }
22323
+ });
22324
+ stage.on("mousedown touchstart", (e) => {
22325
+ e.evt.preventDefault();
22326
+ if (this.state === STAR_TOOL_STATE.ADDING) {
22327
+ this.creating = true;
22328
+ this.handleAdding();
22329
+ }
22330
+ });
22331
+ stage.on("mousemove touchmove", (e) => {
22332
+ e.evt.preventDefault();
22333
+ if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
22334
+ this.moved = true;
22335
+ this.handleMovement();
22336
+ }
22337
+ });
22338
+ stage.on("mouseup touchend", (e) => {
22339
+ e.evt.preventDefault();
22340
+ if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
22341
+ this.creating = false;
22342
+ this.handleSettingSize();
22343
+ }
22344
+ });
22345
+ this.initialized = true;
22346
+ }
22347
+ setState(state) {
22348
+ this.state = state;
22349
+ }
22350
+ addStar() {
22351
+ const stage = this.instance.getStage();
22352
+ stage.container().style.cursor = "crosshair";
22353
+ stage.container().focus();
22354
+ this.clickPoint = null;
22355
+ this.setState(STAR_TOOL_STATE.ADDING);
22356
+ }
22357
+ handleAdding() {
22358
+ const { mousePoint, container } = this.instance.getMousePointer();
22359
+ this.clickPoint = mousePoint;
22360
+ this.container = container;
22361
+ this.starId = v4_default();
22362
+ const nodeHandler = this.instance.getNodeHandler("star");
22363
+ const node = nodeHandler.create(this.starId, {
22364
+ ...this.props,
22365
+ strokeScaleEnabled: true,
22366
+ x: this.clickPoint?.x ?? 0,
22367
+ y: this.clickPoint?.y ?? 0,
22368
+ numPoints: 5,
22369
+ innerRadius: 0,
22370
+ outerRadius: 0
22371
+ });
22372
+ this.instance.addNode(node, this.container?.getAttrs().id);
22373
+ this.setState(STAR_TOOL_STATE.DEFINING_SIZE);
22374
+ }
22375
+ handleSettingSize() {
22376
+ const star = this.instance.getStage().findOne(`#${this.starId}`);
22377
+ if (this.starId && this.clickPoint && this.container && star) {
22378
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22379
+ const nodeHandler = this.instance.getNodeHandler("star");
22380
+ const starPos = {
22381
+ x: this.clickPoint.x,
22382
+ y: this.clickPoint.y
22383
+ };
22384
+ let starOuterRadius = this.props.outerRadius;
22385
+ let starInnerRadius = this.props.innerRadius;
22386
+ if (this.moved) {
22387
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22388
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22389
+ starOuterRadius = Math.abs(this.clickPoint.x - mousePoint.x);
22390
+ starInnerRadius = Math.abs(this.clickPoint.y - mousePoint.y);
22391
+ }
22392
+ star.setAttrs({
22393
+ ...this.props,
22394
+ x: starPos.x + starOuterRadius / 2,
22395
+ y: starPos.y + starOuterRadius / 2,
22396
+ outerRadius: starOuterRadius,
22397
+ innerRadius: starInnerRadius
22398
+ });
22399
+ this.instance.updateNode(nodeHandler.serialize(star));
22400
+ }
22401
+ this.cancelAction();
22402
+ }
22403
+ handleMovement() {
22404
+ if (this.state !== STAR_TOOL_STATE.DEFINING_SIZE) return;
22405
+ const star = this.instance.getStage().findOne(`#${this.starId}`);
22406
+ if (this.starId && this.container && this.clickPoint && star) {
22407
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22408
+ const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
22409
+ const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
22410
+ const nodeHandler = this.instance.getNodeHandler("star");
22411
+ const starPos = {
22412
+ x: this.clickPoint.x,
22413
+ y: this.clickPoint.y
22414
+ };
22415
+ if (this.moved) {
22416
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22417
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22418
+ }
22419
+ star.setAttrs({
22420
+ x: starPos.x + deltaX / 2,
22421
+ y: starPos.y + deltaX / 2,
22422
+ outerRadius: deltaX,
22423
+ innerRadius: deltaY
22424
+ });
22425
+ this.instance.updateNode(nodeHandler.serialize(star));
22426
+ }
22427
+ }
22428
+ trigger(cancelAction) {
22429
+ if (!this.instance) throw new Error("Instance not defined");
22430
+ if (!this.initialized) this.setupEvents();
22431
+ const stage = this.instance.getStage();
22432
+ stage.container().tabIndex = 1;
22433
+ stage.container().focus();
22434
+ this.cancelAction = cancelAction;
22435
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22436
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
22437
+ this.props = this.initProps();
22438
+ this.addStar();
22439
+ }
22440
+ cleanup() {
22441
+ const stage = this.instance.getStage();
22442
+ stage.container().style.cursor = "default";
22443
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22444
+ if (selectionPlugin) {
22445
+ const node = stage.findOne(`#${this.starId}`);
22446
+ if (node) selectionPlugin.setSelectedNodes([node]);
22447
+ this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
22448
+ }
22449
+ this.starId = null;
22450
+ this.creating = false;
22451
+ this.moved = false;
22452
+ this.container = void 0;
22453
+ this.clickPoint = null;
22454
+ this.setState(STAR_TOOL_STATE.IDLE);
22455
+ }
22456
+ };
22457
+
22458
+ //#endregion
22459
+ //#region src/actions/arrow-tool/constants.ts
22460
+ const ARROW_TOOL_ACTION_NAME = "arrowTool";
22461
+ const ARROW_TOOL_STATE = {
22462
+ ["IDLE"]: "idle",
22463
+ ["ADDING"]: "adding",
22464
+ ["DEFINING_SIZE"]: "definingSize",
22465
+ ["ADDED"]: "added"
22466
+ };
22467
+
22468
+ //#endregion
22469
+ //#region src/actions/arrow-tool/arrow-tool.ts
22470
+ var WeaveArrowToolAction = class extends WeaveAction {
22471
+ initialized = false;
22472
+ initialCursor = null;
22473
+ onPropsChange = void 0;
22474
+ onInit = void 0;
22475
+ constructor() {
22476
+ super();
22477
+ this.initialized = false;
22478
+ this.state = ARROW_TOOL_STATE.IDLE;
22479
+ this.arrowId = null;
22480
+ this.tempArrowId = null;
22481
+ this.container = void 0;
22482
+ this.measureContainer = void 0;
22483
+ this.clickPoint = null;
22484
+ this.tempPoint = void 0;
22485
+ this.tempNextPoint = void 0;
22486
+ this.props = this.initProps();
22487
+ }
22488
+ getName() {
22489
+ return ARROW_TOOL_ACTION_NAME;
22490
+ }
22491
+ initProps() {
22492
+ return {
22493
+ fill: "#000000ff",
22494
+ stroke: "#000000ff",
22495
+ strokeWidth: 1,
22496
+ opacity: 1,
22497
+ pointerLength: 10,
22498
+ pointerWidth: 10,
22499
+ pointerAtBeginning: false,
22500
+ pointerAtEnding: true
22501
+ };
22502
+ }
22503
+ setupEvents() {
22504
+ const stage = this.instance.getStage();
22505
+ stage.container().addEventListener("keydown", (e) => {
22506
+ if (e.key === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
22507
+ this.cancelAction();
22508
+ return;
22509
+ }
22510
+ if (e.key === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
22511
+ this.cancelAction();
22512
+ return;
22513
+ }
22514
+ });
22515
+ stage.on("dblclick dbltap", (e) => {
22516
+ e.evt.preventDefault();
22517
+ this.cancelAction();
22518
+ });
22519
+ stage.on("click tap", (e) => {
22520
+ e.evt.preventDefault();
22521
+ if (this.state === ARROW_TOOL_STATE.IDLE) return;
22522
+ if (this.state === ARROW_TOOL_STATE.ADDING) {
22523
+ this.handleAdding();
22524
+ return;
22525
+ }
22526
+ if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) {
22527
+ this.handleSettingSize();
22528
+ return;
22529
+ }
22530
+ });
22531
+ stage.on("mousemove touchmove", (e) => {
22532
+ e.evt.preventDefault();
22533
+ this.handleMovement();
22534
+ });
22535
+ this.initialized = true;
22536
+ }
22537
+ setState(state) {
22538
+ this.state = state;
22539
+ }
22540
+ addArrow() {
22541
+ const stage = this.instance.getStage();
22542
+ stage.container().style.cursor = "crosshair";
22543
+ this.tempPoint = void 0;
22544
+ this.tempNextPoint = void 0;
22545
+ this.clickPoint = null;
22546
+ this.setState(ARROW_TOOL_STATE.ADDING);
22547
+ }
22548
+ handleAdding() {
22549
+ const stage = this.instance.getStage();
22550
+ const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
22551
+ this.clickPoint = mousePoint;
22552
+ this.container = container;
22553
+ this.measureContainer = measureContainer;
22554
+ this.arrowId = v4_default();
22555
+ this.tempArrowId = v4_default();
22556
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22557
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22558
+ const node = lineNodeHandler.create(this.arrowId, {
22559
+ ...this.props,
22560
+ strokeScaleEnabled: true,
22561
+ x: this.clickPoint?.x ?? 0,
22562
+ y: this.clickPoint?.y ?? 0,
22563
+ points: [0, 0]
22564
+ });
22565
+ this.instance.addNode(node, this.container?.getAttrs().id);
22566
+ this.tempPoint = new konva.default.Circle({
22567
+ x: this.clickPoint?.x ?? 0,
22568
+ y: this.clickPoint?.y ?? 0,
22569
+ radius: 5 / stage.scaleX(),
22570
+ strokeScaleEnabled: true,
22571
+ stroke: "#cccccc",
22572
+ strokeWidth: 0,
22573
+ fill: "#cccccc"
22574
+ });
22575
+ this.measureContainer?.add(this.tempPoint);
22576
+ const tempArrow = nodeHandler.create(this.tempArrowId, {
22577
+ ...this.props,
22578
+ x: this.clickPoint?.x ?? 0,
22579
+ y: this.clickPoint?.y ?? 0,
22580
+ strokeScaleEnabled: true,
22581
+ points: [0, 0]
22582
+ });
22583
+ this.instance.addNode(tempArrow, this.container?.getAttrs().id);
22584
+ this.tempNextPoint = new konva.default.Circle({
22585
+ x: this.clickPoint?.x ?? 0,
22586
+ y: this.clickPoint?.y ?? 0,
22587
+ radius: 5 / stage.scaleX(),
22588
+ strokeScaleEnabled: true,
22589
+ stroke: "#cccccc",
22590
+ strokeWidth: 0,
22591
+ fill: "#cccccc"
22592
+ });
22593
+ this.measureContainer?.add(this.tempNextPoint);
22594
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
22595
+ }
22596
+ handleSettingSize() {
22597
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22598
+ const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
22599
+ if (this.arrowId && this.tempPoint && this.tempNextPoint && this.measureContainer && tempMainArrow && tempArrow) {
22600
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
22601
+ const newPoints = [...tempMainArrow.points()];
22602
+ newPoints.push(mousePoint.x - tempMainArrow.x());
22603
+ newPoints.push(mousePoint.y - tempMainArrow.y());
22604
+ tempMainArrow.setAttrs({
22605
+ ...this.props,
22606
+ points: newPoints
22607
+ });
22608
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22609
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22610
+ this.instance.updateNode(lineNodeHandler.serialize(tempMainArrow));
22611
+ this.tempPoint.setAttrs({
22612
+ x: mousePoint.x,
22613
+ y: mousePoint.y
22614
+ });
22615
+ this.tempNextPoint.setAttrs({
22616
+ x: mousePoint.x,
22617
+ y: mousePoint.y
22618
+ });
22619
+ tempArrow.setAttrs({
22620
+ ...this.props,
22621
+ x: mousePoint.x,
22622
+ y: mousePoint.y,
22623
+ points: [0, 0]
22624
+ });
22625
+ this.instance.updateNode(nodeHandler.serialize(tempArrow));
22626
+ }
22627
+ this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
22628
+ }
22629
+ handleMovement() {
22630
+ if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
22631
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22632
+ if (this.arrowId && this.measureContainer && this.tempNextPoint && tempArrow) {
22633
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
22634
+ tempArrow.setAttrs({
22635
+ ...this.props,
22636
+ points: [
22637
+ tempArrow.points()[0],
22638
+ tempArrow.points()[1],
22639
+ mousePoint.x - tempArrow.x(),
22640
+ mousePoint.y - tempArrow.y()
22641
+ ]
22642
+ });
22643
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22644
+ this.instance.updateNode(nodeHandler.serialize(tempArrow));
22645
+ this.tempNextPoint.setAttrs({
22646
+ x: mousePoint.x,
22647
+ y: mousePoint.y
22648
+ });
22649
+ }
22650
+ }
22651
+ trigger(cancelAction) {
22652
+ if (!this.instance) throw new Error("Instance not defined");
22653
+ if (!this.initialized) this.setupEvents();
22654
+ const stage = this.instance.getStage();
22655
+ stage.container().tabIndex = 1;
22656
+ stage.container().focus();
22657
+ this.cancelAction = cancelAction;
22658
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22659
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
22660
+ this.props = this.initProps();
22661
+ this.addArrow();
22662
+ }
22663
+ cleanup() {
22664
+ const stage = this.instance.getStage();
22665
+ this.tempPoint?.destroy();
22666
+ this.tempNextPoint?.destroy();
22667
+ const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
22668
+ const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
22669
+ if (tempArrow) {
22670
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22671
+ this.instance.removeNode(nodeHandler.serialize(tempArrow));
22672
+ }
22673
+ if (this.arrowId && tempMainArrow && tempMainArrow.points().length < 4) {
22674
+ const nodeHandler = this.instance.getNodeHandler("line");
22675
+ this.instance.removeNode(nodeHandler.serialize(tempMainArrow));
22676
+ }
22677
+ if (this.arrowId && tempMainArrow && tempMainArrow.points().length >= 4) {
22678
+ const nodeHandler = this.instance.getNodeHandler("arrow");
22679
+ const lineNodeHandler = this.instance.getNodeHandler("line");
22680
+ const finalArrow = nodeHandler.create(this.arrowId, {
22681
+ ...tempMainArrow.getAttrs(),
22682
+ ...this.props,
22683
+ strokeScaleEnabled: true,
22684
+ strokeWidth: 1,
22685
+ hitStrokeWidth: 16
22686
+ });
22687
+ this.instance.removeNode(lineNodeHandler.serialize(tempMainArrow));
22688
+ this.instance.addNode(finalArrow, this.container?.getAttrs().id);
22689
+ }
22690
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22691
+ if (selectionPlugin) {
22692
+ const node = stage.findOne(`#${this.arrowId}`);
22693
+ if (node) selectionPlugin.setSelectedNodes([node]);
22694
+ this.instance.triggerAction("selectionTool");
22695
+ }
22696
+ stage.container().style.cursor = "default";
22697
+ this.initialCursor = null;
22698
+ this.tempPoint = void 0;
22699
+ this.tempNextPoint = void 0;
22700
+ this.arrowId = null;
22701
+ this.tempArrowId = null;
22702
+ this.container = void 0;
22703
+ this.clickPoint = null;
22704
+ this.setState(ARROW_TOOL_STATE.IDLE);
22705
+ }
22706
+ };
22707
+
21791
22708
  //#endregion
21792
22709
  //#region src/actions/frame-tool/constants.ts
21793
22710
  const FRAME_TOOL_ACTION_NAME = "frameTool";
@@ -23224,9 +24141,13 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
23224
24141
  };
23225
24142
 
23226
24143
  //#endregion
24144
+ exports.ARROW_TOOL_ACTION_NAME = ARROW_TOOL_ACTION_NAME
24145
+ exports.ARROW_TOOL_STATE = ARROW_TOOL_STATE
23227
24146
  exports.BRUSH_TOOL_ACTION_NAME = BRUSH_TOOL_ACTION_NAME
23228
24147
  exports.BRUSH_TOOL_STATE = BRUSH_TOOL_STATE
23229
24148
  exports.COPY_PASTE_NODES_PLUGIN_STATE = COPY_PASTE_NODES_PLUGIN_STATE
24149
+ exports.ELLIPSE_TOOL_ACTION_NAME = ELLIPSE_TOOL_ACTION_NAME
24150
+ exports.ELLIPSE_TOOL_STATE = ELLIPSE_TOOL_STATE
23230
24151
  exports.ERASER_TOOL_ACTION_NAME = ERASER_TOOL_ACTION_NAME
23231
24152
  exports.ERASER_TOOL_STATE = ERASER_TOOL_STATE
23232
24153
  exports.FRAME_TOOL_ACTION_NAME = FRAME_TOOL_ACTION_NAME
@@ -23247,11 +24168,15 @@ exports.RECTANGLE_TOOL_ACTION_NAME = RECTANGLE_TOOL_ACTION_NAME
23247
24168
  exports.RECTANGLE_TOOL_STATE = RECTANGLE_TOOL_STATE
23248
24169
  exports.SELECTION_TOOL_ACTION_NAME = SELECTION_TOOL_ACTION_NAME
23249
24170
  exports.SELECTION_TOOL_STATE = SELECTION_TOOL_STATE
24171
+ exports.STAR_TOOL_ACTION_NAME = STAR_TOOL_ACTION_NAME
24172
+ exports.STAR_TOOL_STATE = STAR_TOOL_STATE
23250
24173
  exports.TEXT_LAYOUT = TEXT_LAYOUT
23251
24174
  exports.TEXT_TOOL_ACTION_NAME = TEXT_TOOL_ACTION_NAME
23252
24175
  exports.TEXT_TOOL_STATE = TEXT_TOOL_STATE
24176
+ exports.WEAVE_ARROW_NODE_TYPE = WEAVE_ARROW_NODE_TYPE
23253
24177
  exports.WEAVE_COPY_PASTE_NODES_KEY = WEAVE_COPY_PASTE_NODES_KEY
23254
24178
  exports.WEAVE_DEFAULT_USER_INFO_FUNCTION = WEAVE_DEFAULT_USER_INFO_FUNCTION
24179
+ exports.WEAVE_ELLIPSE_NODE_TYPE = WEAVE_ELLIPSE_NODE_TYPE
23255
24180
  exports.WEAVE_FRAME_NODE_DEFAULT_CONFIG = WEAVE_FRAME_NODE_DEFAULT_CONFIG
23256
24181
  exports.WEAVE_FRAME_NODE_DEFAULT_PROPS = WEAVE_FRAME_NODE_DEFAULT_PROPS
23257
24182
  exports.WEAVE_FRAME_NODE_SIZES = WEAVE_FRAME_NODE_SIZES
@@ -23265,10 +24190,18 @@ exports.WEAVE_GRID_DEFAULT_SIZE = WEAVE_GRID_DEFAULT_SIZE
23265
24190
  exports.WEAVE_GRID_DEFAULT_TYPE = WEAVE_GRID_DEFAULT_TYPE
23266
24191
  exports.WEAVE_GRID_LAYER_ID = WEAVE_GRID_LAYER_ID
23267
24192
  exports.WEAVE_GRID_TYPES = WEAVE_GRID_TYPES
24193
+ exports.WEAVE_GROUP_NODE_TYPE = WEAVE_GROUP_NODE_TYPE
24194
+ exports.WEAVE_IMAGE_NODE_TYPE = WEAVE_IMAGE_NODE_TYPE
24195
+ exports.WEAVE_LAYER_NODE_TYPE = WEAVE_LAYER_NODE_TYPE
24196
+ exports.WEAVE_LINE_NODE_TYPE = WEAVE_LINE_NODE_TYPE
23268
24197
  exports.WEAVE_NODES_SELECTION_KEY = WEAVE_NODES_SELECTION_KEY
23269
24198
  exports.WEAVE_NODES_SELECTION_LAYER_ID = WEAVE_NODES_SELECTION_LAYER_ID
23270
24199
  exports.WEAVE_NODES_SNAPPING_KEY = WEAVE_NODES_SNAPPING_KEY
24200
+ exports.WEAVE_RECTANGLE_NODE_TYPE = WEAVE_RECTANGLE_NODE_TYPE
23271
24201
  exports.WEAVE_STAGE_GRID_KEY = WEAVE_STAGE_GRID_KEY
24202
+ exports.WEAVE_STAGE_NODE_TYPE = WEAVE_STAGE_NODE_TYPE
24203
+ exports.WEAVE_STAR_NODE_TYPE = WEAVE_STAR_NODE_TYPE
24204
+ exports.WEAVE_TEXT_NODE_TYPE = WEAVE_TEXT_NODE_TYPE
23272
24205
  exports.WEAVE_USERS_POINTERS_KEY = WEAVE_USERS_POINTERS_KEY
23273
24206
  exports.WEAVE_USERS_SELECTION_KEY = WEAVE_USERS_SELECTION_KEY
23274
24207
  exports.WEAVE_USER_POINTERS_DEFAULT_PROPS = WEAVE_USER_POINTERS_DEFAULT_PROPS
@@ -23276,10 +24209,14 @@ exports.WEAVE_USER_POINTER_KEY = WEAVE_USER_POINTER_KEY
23276
24209
  exports.WEAVE_USER_SELECTION_KEY = WEAVE_USER_SELECTION_KEY
23277
24210
  exports.Weave = Weave
23278
24211
  exports.WeaveAction = WeaveAction
24212
+ exports.WeaveArrowNode = WeaveArrowNode
24213
+ exports.WeaveArrowToolAction = WeaveArrowToolAction
23279
24214
  exports.WeaveBrushToolAction = WeaveBrushToolAction
23280
24215
  exports.WeaveConnectedUsersPlugin = WeaveConnectedUsersPlugin
23281
24216
  exports.WeaveContextMenuPlugin = WeaveContextMenuPlugin
23282
24217
  exports.WeaveCopyPasteNodesPlugin = WeaveCopyPasteNodesPlugin
24218
+ exports.WeaveEllipseNode = WeaveEllipseNode
24219
+ exports.WeaveEllipseToolAction = WeaveEllipseToolAction
23283
24220
  exports.WeaveEraserToolAction = WeaveEraserToolAction
23284
24221
  exports.WeaveExportNodeToolAction = WeaveExportNodeToolAction
23285
24222
  exports.WeaveExportStageToolAction = WeaveExportStageToolAction
@@ -23307,6 +24244,8 @@ exports.WeaveStageNode = WeaveStageNode
23307
24244
  exports.WeaveStagePanningPlugin = WeaveStagePanningPlugin
23308
24245
  exports.WeaveStageResizePlugin = WeaveStageResizePlugin
23309
24246
  exports.WeaveStageZoomPlugin = WeaveStageZoomPlugin
24247
+ exports.WeaveStarNode = WeaveStarNode
24248
+ exports.WeaveStarToolAction = WeaveStarToolAction
23310
24249
  exports.WeaveStore = WeaveStore
23311
24250
  exports.WeaveTextNode = WeaveTextNode
23312
24251
  exports.WeaveTextToolAction = WeaveTextToolAction