@inditextech/weave-sdk 0.22.1 → 0.23.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
@@ -18102,7 +18102,7 @@ var WeaveRegisterManager = class {
18102
18102
 
18103
18103
  //#endregion
18104
18104
  //#region package.json
18105
- var version = "0.22.1";
18105
+ var version = "0.23.1";
18106
18106
 
18107
18107
  //#endregion
18108
18108
  //#region src/managers/setup.ts
@@ -20300,14 +20300,14 @@ var WeaveStarNode = class extends WeaveNode {
20300
20300
  } };
20301
20301
  }
20302
20302
  onRender(props) {
20303
- const rectangle = new konva.default.Star({
20303
+ const star = new konva.default.Star({
20304
20304
  ...props,
20305
20305
  name: "node",
20306
20306
  numPoints: props.numPoints,
20307
20307
  innerRadius: props.innerRadius,
20308
20308
  outerRadius: props.outerRadius
20309
20309
  });
20310
- rectangle.getTransformerProperties = () => {
20310
+ star.getTransformerProperties = () => {
20311
20311
  const stage = this.instance.getStage();
20312
20312
  const node = stage.findOne(`#${props.id}`);
20313
20313
  if (node && node.getAttrs().keepAspectRatio) return {
@@ -20322,8 +20322,8 @@ var WeaveStarNode = class extends WeaveNode {
20322
20322
  };
20323
20323
  return this.config.transform;
20324
20324
  };
20325
- this.setupDefaultNodeEvents(rectangle);
20326
- return rectangle;
20325
+ this.setupDefaultNodeEvents(star);
20326
+ return star;
20327
20327
  }
20328
20328
  onUpdate(nodeInstance, nextProps) {
20329
20329
  nodeInstance.setAttrs({ ...nextProps });
@@ -20378,17 +20378,17 @@ var WeaveArrowNode = class extends WeaveNode {
20378
20378
  }
20379
20379
  scaleReset(node) {
20380
20380
  if (node.getAttrs().nodeType === "arrow") {
20381
- const lineNode = node;
20382
- const oldPoints = lineNode.points();
20381
+ const arrowNode = node;
20382
+ const oldPoints = arrowNode.points();
20383
20383
  const newPoints = [];
20384
20384
  for (let i = 0; i < oldPoints.length / 2; i++) {
20385
20385
  const point = {
20386
- x: oldPoints[i * 2] * lineNode.scaleX(),
20387
- y: oldPoints[i * 2 + 1] * lineNode.scaleY()
20386
+ x: oldPoints[i * 2] * arrowNode.scaleX(),
20387
+ y: oldPoints[i * 2 + 1] * arrowNode.scaleY()
20388
20388
  };
20389
20389
  newPoints.push(point.x, point.y);
20390
20390
  }
20391
- lineNode.points(newPoints);
20391
+ arrowNode.points(newPoints);
20392
20392
  }
20393
20393
  node.width(Math.max(5, node.width() * node.scaleX()));
20394
20394
  node.height(Math.max(5, node.height() * node.scaleY()));
@@ -20397,6 +20397,64 @@ var WeaveArrowNode = class extends WeaveNode {
20397
20397
  }
20398
20398
  };
20399
20399
 
20400
+ //#endregion
20401
+ //#region src/nodes/regular-polygon/constants.ts
20402
+ const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
20403
+
20404
+ //#endregion
20405
+ //#region src/nodes/regular-polygon/regular-polygon.ts
20406
+ var WeaveRegularPolygonNode = class extends WeaveNode {
20407
+ nodeType = WEAVE_REGULAR_POLYGON_NODE_TYPE;
20408
+ constructor(params) {
20409
+ super();
20410
+ const { config } = params ?? {};
20411
+ this.config = { transform: {
20412
+ ...__inditextech_weave_types.WEAVE_DEFAULT_TRANSFORM_PROPERTIES,
20413
+ ...config?.transform
20414
+ } };
20415
+ }
20416
+ onRender(props) {
20417
+ const regularPolygon = new konva.default.RegularPolygon({
20418
+ ...props,
20419
+ name: "node",
20420
+ sides: props.sides,
20421
+ radius: props.radius
20422
+ });
20423
+ regularPolygon.getTransformerProperties = () => {
20424
+ return {
20425
+ ...this.config.transform,
20426
+ enabledAnchors: [
20427
+ "top-left",
20428
+ "top-right",
20429
+ "bottom-left",
20430
+ "bottom-right"
20431
+ ],
20432
+ keepRatio: true
20433
+ };
20434
+ };
20435
+ this.setupDefaultNodeEvents(regularPolygon);
20436
+ return regularPolygon;
20437
+ }
20438
+ onUpdate(nodeInstance, nextProps) {
20439
+ nodeInstance.setAttrs({
20440
+ ...nextProps,
20441
+ radius: nextProps.radius
20442
+ });
20443
+ const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
20444
+ if (nodesSelectionPlugin) {
20445
+ const actualSelectedNodes = nodesSelectionPlugin.getSelectedNodes();
20446
+ nodesSelectionPlugin.setSelectedNodes(actualSelectedNodes);
20447
+ nodesSelectionPlugin.getTransformer().forceUpdate();
20448
+ }
20449
+ }
20450
+ scaleReset(node) {
20451
+ const regularPolygonNode = node;
20452
+ regularPolygonNode.radius(Math.max(5, regularPolygonNode.radius() * regularPolygonNode.scaleX()));
20453
+ node.scaleX(1);
20454
+ node.scaleY(1);
20455
+ }
20456
+ };
20457
+
20400
20458
  //#endregion
20401
20459
  //#region src/nodes/frame/constants.ts
20402
20460
  const WEAVE_FRAME_NODE_TYPE = "frame";
@@ -21679,8 +21737,8 @@ var WeaveEllipseToolAction = class extends WeaveAction {
21679
21737
  const node = nodeHandler.create(this.ellipseId, {
21680
21738
  ...this.props,
21681
21739
  strokeScaleEnabled: true,
21682
- x: this.clickPoint?.x ?? 0,
21683
- y: this.clickPoint?.y ?? 0,
21740
+ x: this.clickPoint?.x ?? 0 + this.props.radiusX,
21741
+ y: this.clickPoint?.y ?? 0 + this.props.radiusY,
21684
21742
  radiusX: 0,
21685
21743
  radiusY: 0
21686
21744
  });
@@ -21706,8 +21764,8 @@ var WeaveEllipseToolAction = class extends WeaveAction {
21706
21764
  }
21707
21765
  ellipse.setAttrs({
21708
21766
  ...this.props,
21709
- x: ellipsePos.x + ellipseRadiusX / 2,
21710
- y: ellipsePos.y + ellipseRadiusY / 2,
21767
+ x: ellipsePos.x + ellipseRadiusX,
21768
+ y: ellipsePos.y + ellipseRadiusY,
21711
21769
  radiusX: ellipseRadiusX,
21712
21770
  radiusY: ellipseRadiusY
21713
21771
  });
@@ -21732,8 +21790,8 @@ var WeaveEllipseToolAction = class extends WeaveAction {
21732
21790
  ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
21733
21791
  }
21734
21792
  ellipse.setAttrs({
21735
- x: ellipsePos.x + deltaX / 2,
21736
- y: ellipsePos.y + deltaY / 2,
21793
+ x: ellipsePos.x + deltaX,
21794
+ y: ellipsePos.y + deltaY,
21737
21795
  radiusX: deltaX,
21738
21796
  radiusY: deltaY
21739
21797
  });
@@ -22304,8 +22362,8 @@ var WeaveStarToolAction = class extends WeaveAction {
22304
22362
  stroke: "#000000ff",
22305
22363
  strokeWidth: 1,
22306
22364
  numPoints: 5,
22307
- innerRadius: 70,
22308
- outerRadius: 184,
22365
+ innerRadius: 35,
22366
+ outerRadius: 92,
22309
22367
  keepAspectRatio: false
22310
22368
  };
22311
22369
  }
@@ -22363,8 +22421,8 @@ var WeaveStarToolAction = class extends WeaveAction {
22363
22421
  const node = nodeHandler.create(this.starId, {
22364
22422
  ...this.props,
22365
22423
  strokeScaleEnabled: true,
22366
- x: this.clickPoint?.x ?? 0,
22367
- y: this.clickPoint?.y ?? 0,
22424
+ x: this.clickPoint?.x ?? 0 + this.props.outerRadius,
22425
+ y: this.clickPoint?.y ?? 0 + this.props.outerRadius,
22368
22426
  numPoints: 5,
22369
22427
  innerRadius: 0,
22370
22428
  outerRadius: 0
@@ -22391,8 +22449,8 @@ var WeaveStarToolAction = class extends WeaveAction {
22391
22449
  }
22392
22450
  star.setAttrs({
22393
22451
  ...this.props,
22394
- x: starPos.x + starOuterRadius / 2,
22395
- y: starPos.y + starOuterRadius / 2,
22452
+ x: starPos.x + starOuterRadius,
22453
+ y: starPos.y + starOuterRadius,
22396
22454
  outerRadius: starOuterRadius,
22397
22455
  innerRadius: starInnerRadius
22398
22456
  });
@@ -22417,8 +22475,8 @@ var WeaveStarToolAction = class extends WeaveAction {
22417
22475
  starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22418
22476
  }
22419
22477
  star.setAttrs({
22420
- x: starPos.x + deltaX / 2,
22421
- y: starPos.y + deltaX / 2,
22478
+ x: starPos.x + deltaX,
22479
+ y: starPos.y + deltaX,
22422
22480
  outerRadius: deltaX,
22423
22481
  innerRadius: deltaY
22424
22482
  });
@@ -22705,6 +22763,185 @@ var WeaveArrowToolAction = class extends WeaveAction {
22705
22763
  }
22706
22764
  };
22707
22765
 
22766
+ //#endregion
22767
+ //#region src/actions/regular-polygon-tool/constants.ts
22768
+ const REGULAR_POLYGON_TOOL_ACTION_NAME = "regularPolygonTool";
22769
+ const REGULAR_POLYGON_TOOL_STATE = {
22770
+ ["IDLE"]: "idle",
22771
+ ["ADDING"]: "adding",
22772
+ ["DEFINING_SIZE"]: "definingSize",
22773
+ ["ADDED"]: "added"
22774
+ };
22775
+
22776
+ //#endregion
22777
+ //#region src/actions/regular-polygon-tool/regular-polygon-tool.ts
22778
+ var WeaveRegularPolygonToolAction = class extends WeaveAction {
22779
+ initialized = false;
22780
+ onPropsChange = void 0;
22781
+ onInit = void 0;
22782
+ constructor() {
22783
+ super();
22784
+ this.initialized = false;
22785
+ this.state = REGULAR_POLYGON_TOOL_STATE.IDLE;
22786
+ this.regularPolygonId = null;
22787
+ this.creating = false;
22788
+ this.moved = false;
22789
+ this.container = void 0;
22790
+ this.clickPoint = null;
22791
+ this.props = this.initProps();
22792
+ }
22793
+ getName() {
22794
+ return REGULAR_POLYGON_TOOL_ACTION_NAME;
22795
+ }
22796
+ initProps() {
22797
+ return {
22798
+ opacity: 1,
22799
+ fill: "#71717aff",
22800
+ stroke: "#000000ff",
22801
+ strokeWidth: 1,
22802
+ sides: 5,
22803
+ radius: 50
22804
+ };
22805
+ }
22806
+ setupEvents() {
22807
+ const stage = this.instance.getStage();
22808
+ stage.container().addEventListener("keydown", (e) => {
22809
+ if (e.key === "Enter" && this.instance.getActiveAction() === REGULAR_POLYGON_TOOL_ACTION_NAME) {
22810
+ this.cancelAction();
22811
+ return;
22812
+ }
22813
+ if (e.key === "Escape" && this.instance.getActiveAction() === REGULAR_POLYGON_TOOL_ACTION_NAME) {
22814
+ this.cancelAction();
22815
+ return;
22816
+ }
22817
+ });
22818
+ stage.on("mousedown touchstart", (e) => {
22819
+ e.evt.preventDefault();
22820
+ if (this.state === REGULAR_POLYGON_TOOL_STATE.ADDING) {
22821
+ this.creating = true;
22822
+ this.handleAdding();
22823
+ }
22824
+ });
22825
+ stage.on("mousemove touchmove", (e) => {
22826
+ e.evt.preventDefault();
22827
+ if (this.state === REGULAR_POLYGON_TOOL_STATE.DEFINING_SIZE) {
22828
+ this.moved = true;
22829
+ this.handleMovement();
22830
+ }
22831
+ });
22832
+ stage.on("mouseup touchend", (e) => {
22833
+ e.evt.preventDefault();
22834
+ if (this.state === REGULAR_POLYGON_TOOL_STATE.DEFINING_SIZE) {
22835
+ this.creating = false;
22836
+ this.handleSettingSize();
22837
+ }
22838
+ });
22839
+ this.initialized = true;
22840
+ }
22841
+ setState(state) {
22842
+ this.state = state;
22843
+ }
22844
+ addRegularPolygon() {
22845
+ const stage = this.instance.getStage();
22846
+ stage.container().style.cursor = "crosshair";
22847
+ stage.container().focus();
22848
+ this.clickPoint = null;
22849
+ this.setState(REGULAR_POLYGON_TOOL_STATE.ADDING);
22850
+ }
22851
+ handleAdding() {
22852
+ const { mousePoint, container } = this.instance.getMousePointer();
22853
+ this.clickPoint = mousePoint;
22854
+ this.container = container;
22855
+ this.regularPolygonId = v4_default();
22856
+ const nodeHandler = this.instance.getNodeHandler("regular-polygon");
22857
+ const node = nodeHandler.create(this.regularPolygonId, {
22858
+ ...this.props,
22859
+ strokeScaleEnabled: true,
22860
+ x: (this.clickPoint?.x ?? 0) + this.props.radius,
22861
+ y: (this.clickPoint?.y ?? 0) + this.props.radius,
22862
+ radius: 0
22863
+ });
22864
+ this.instance.addNode(node, this.container?.getAttrs().id);
22865
+ this.setState(REGULAR_POLYGON_TOOL_STATE.DEFINING_SIZE);
22866
+ }
22867
+ handleSettingSize() {
22868
+ const regularPolygon = this.instance.getStage().findOne(`#${this.regularPolygonId}`);
22869
+ if (this.regularPolygonId && this.clickPoint && this.container && regularPolygon) {
22870
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22871
+ const nodeHandler = this.instance.getNodeHandler("regular-polygon");
22872
+ const starPos = {
22873
+ x: this.clickPoint.x,
22874
+ y: this.clickPoint.y
22875
+ };
22876
+ let newRadius = this.props.radius;
22877
+ if (this.moved) {
22878
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22879
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22880
+ newRadius = Math.abs(this.clickPoint.x - mousePoint.x);
22881
+ }
22882
+ regularPolygon.setAttrs({
22883
+ ...this.props,
22884
+ x: starPos.x + newRadius,
22885
+ y: starPos.y + newRadius,
22886
+ radius: newRadius
22887
+ });
22888
+ this.instance.updateNode(nodeHandler.serialize(regularPolygon));
22889
+ }
22890
+ this.cancelAction();
22891
+ }
22892
+ handleMovement() {
22893
+ if (this.state !== REGULAR_POLYGON_TOOL_STATE.DEFINING_SIZE) return;
22894
+ const regularPolygon = this.instance.getStage().findOne(`#${this.regularPolygonId}`);
22895
+ if (this.regularPolygonId && this.container && this.clickPoint && regularPolygon) {
22896
+ const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
22897
+ const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
22898
+ const nodeHandler = this.instance.getNodeHandler("regular-polygon");
22899
+ const starPos = {
22900
+ x: this.clickPoint.x,
22901
+ y: this.clickPoint.y
22902
+ };
22903
+ if (this.moved) {
22904
+ starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
22905
+ starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
22906
+ }
22907
+ regularPolygon.setAttrs({
22908
+ x: starPos.x + deltaX,
22909
+ y: starPos.y + deltaX,
22910
+ radius: deltaX
22911
+ });
22912
+ this.instance.updateNode(nodeHandler.serialize(regularPolygon));
22913
+ }
22914
+ }
22915
+ trigger(cancelAction) {
22916
+ if (!this.instance) throw new Error("Instance not defined");
22917
+ if (!this.initialized) this.setupEvents();
22918
+ const stage = this.instance.getStage();
22919
+ stage.container().tabIndex = 1;
22920
+ stage.container().focus();
22921
+ this.cancelAction = cancelAction;
22922
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22923
+ if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
22924
+ this.props = this.initProps();
22925
+ this.addRegularPolygon();
22926
+ }
22927
+ cleanup() {
22928
+ const stage = this.instance.getStage();
22929
+ stage.container().style.cursor = "default";
22930
+ const selectionPlugin = this.instance.getPlugin("nodesSelection");
22931
+ if (selectionPlugin) {
22932
+ const node = stage.findOne(`#${this.regularPolygonId}`);
22933
+ if (node) selectionPlugin.setSelectedNodes([node]);
22934
+ this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
22935
+ }
22936
+ this.regularPolygonId = null;
22937
+ this.creating = false;
22938
+ this.moved = false;
22939
+ this.container = void 0;
22940
+ this.clickPoint = null;
22941
+ this.setState(REGULAR_POLYGON_TOOL_STATE.IDLE);
22942
+ }
22943
+ };
22944
+
22708
22945
  //#endregion
22709
22946
  //#region src/actions/frame-tool/constants.ts
22710
22947
  const FRAME_TOOL_ACTION_NAME = "frameTool";
@@ -23359,6 +23596,12 @@ var WeaveConnectedUsersPlugin = class extends WeavePlugin {
23359
23596
  const userInfo = this.config.getUser();
23360
23597
  store.setAwarenessInfo(WEAVE_CONNECTED_USER_INFO_KEY, userInfo);
23361
23598
  this.instance.emitEvent("onConnectedUsersChange", { [userInfo.name]: userInfo });
23599
+ this.instance.addEventListener("onConnectionStatusChange", (status) => {
23600
+ if (status === "connected") {
23601
+ const userInfo$1 = this.config.getUser();
23602
+ store.setAwarenessInfo(WEAVE_CONNECTED_USER_INFO_KEY, userInfo$1);
23603
+ } else store.setAwarenessInfo(WEAVE_CONNECTED_USER_INFO_KEY, void 0);
23604
+ });
23362
23605
  this.instance.addEventListener("onAwarenessChange", (changes) => {
23363
23606
  if (!this.enabled) {
23364
23607
  this.connectedUsers = {};
@@ -24166,6 +24409,8 @@ exports.PEN_TOOL_ACTION_NAME = PEN_TOOL_ACTION_NAME
24166
24409
  exports.PEN_TOOL_STATE = PEN_TOOL_STATE
24167
24410
  exports.RECTANGLE_TOOL_ACTION_NAME = RECTANGLE_TOOL_ACTION_NAME
24168
24411
  exports.RECTANGLE_TOOL_STATE = RECTANGLE_TOOL_STATE
24412
+ exports.REGULAR_POLYGON_TOOL_ACTION_NAME = REGULAR_POLYGON_TOOL_ACTION_NAME
24413
+ exports.REGULAR_POLYGON_TOOL_STATE = REGULAR_POLYGON_TOOL_STATE
24169
24414
  exports.SELECTION_TOOL_ACTION_NAME = SELECTION_TOOL_ACTION_NAME
24170
24415
  exports.SELECTION_TOOL_STATE = SELECTION_TOOL_STATE
24171
24416
  exports.STAR_TOOL_ACTION_NAME = STAR_TOOL_ACTION_NAME
@@ -24198,6 +24443,7 @@ exports.WEAVE_NODES_SELECTION_KEY = WEAVE_NODES_SELECTION_KEY
24198
24443
  exports.WEAVE_NODES_SELECTION_LAYER_ID = WEAVE_NODES_SELECTION_LAYER_ID
24199
24444
  exports.WEAVE_NODES_SNAPPING_KEY = WEAVE_NODES_SNAPPING_KEY
24200
24445
  exports.WEAVE_RECTANGLE_NODE_TYPE = WEAVE_RECTANGLE_NODE_TYPE
24446
+ exports.WEAVE_REGULAR_POLYGON_NODE_TYPE = WEAVE_REGULAR_POLYGON_NODE_TYPE
24201
24447
  exports.WEAVE_STAGE_GRID_KEY = WEAVE_STAGE_GRID_KEY
24202
24448
  exports.WEAVE_STAGE_NODE_TYPE = WEAVE_STAGE_NODE_TYPE
24203
24449
  exports.WEAVE_STAR_NODE_TYPE = WEAVE_STAR_NODE_TYPE
@@ -24237,6 +24483,8 @@ exports.WeavePenToolAction = WeavePenToolAction
24237
24483
  exports.WeavePlugin = WeavePlugin
24238
24484
  exports.WeaveRectangleNode = WeaveRectangleNode
24239
24485
  exports.WeaveRectangleToolAction = WeaveRectangleToolAction
24486
+ exports.WeaveRegularPolygonNode = WeaveRegularPolygonNode
24487
+ exports.WeaveRegularPolygonToolAction = WeaveRegularPolygonToolAction
24240
24488
  exports.WeaveSelectionToolAction = WeaveSelectionToolAction
24241
24489
  exports.WeaveStageDropAreaPlugin = WeaveStageDropAreaPlugin
24242
24490
  exports.WeaveStageGridPlugin = WeaveStageGridPlugin
package/dist/sdk.d.cts CHANGED
@@ -789,6 +789,33 @@ declare class WeaveArrowNode extends WeaveNode {
789
789
  //# sourceMappingURL=arrow.d.ts.map
790
790
  declare const WEAVE_ARROW_NODE_TYPE = "arrow";
791
791
 
792
+ //#endregion
793
+ //#region src/nodes/regular-polygon/types.d.ts
794
+ //# sourceMappingURL=constants.d.ts.map
795
+ type WeaveRegularPolygonProperties = {
796
+ transform: WeaveNodeTransformerProperties;
797
+ };
798
+ type WeaveRegularPolygonNodeParams = {
799
+ config: Partial<WeaveRegularPolygonProperties>;
800
+ };
801
+
802
+ //#endregion
803
+ //#region src/nodes/regular-polygon/regular-polygon.d.ts
804
+ //# sourceMappingURL=types.d.ts.map
805
+ declare class WeaveRegularPolygonNode extends WeaveNode {
806
+ private config;
807
+ protected nodeType: string;
808
+ constructor(params?: WeaveRegularPolygonNodeParams);
809
+ onRender(props: WeaveElementAttributes): WeaveElementInstance;
810
+ onUpdate(nodeInstance: WeaveElementInstance, nextProps: WeaveElementAttributes): void;
811
+ protected scaleReset(node: Konva.Node): void;
812
+ }
813
+
814
+ //#endregion
815
+ //#region src/nodes/regular-polygon/constants.d.ts
816
+ //# sourceMappingURL=regular-polygon.d.ts.map
817
+ declare const WEAVE_REGULAR_POLYGON_NODE_TYPE = "regular-polygon";
818
+
792
819
  //#endregion
793
820
  //#region src/nodes/frame/constants.d.ts
794
821
  //# sourceMappingURL=constants.d.ts.map
@@ -1488,8 +1515,59 @@ declare class WeaveArrowToolAction extends WeaveAction {
1488
1515
  }
1489
1516
 
1490
1517
  //#endregion
1491
- //#region src/actions/frame-tool/constants.d.ts
1518
+ //#region src/actions/regular-polygon-tool/constants.d.ts
1492
1519
  //# sourceMappingURL=arrow-tool.d.ts.map
1520
+ declare const REGULAR_POLYGON_TOOL_ACTION_NAME = "regularPolygonTool";
1521
+ declare const REGULAR_POLYGON_TOOL_STATE: {
1522
+ readonly IDLE: "idle";
1523
+ readonly ADDING: "adding";
1524
+ readonly DEFINING_SIZE: "definingSize";
1525
+ readonly ADDED: "added";
1526
+ };
1527
+
1528
+ //#endregion
1529
+ //#region src/actions/regular-polygon-tool/types.d.ts
1530
+ //# sourceMappingURL=constants.d.ts.map
1531
+ type WeaveRegularPolygonToolActionStateKeys = keyof typeof REGULAR_POLYGON_TOOL_STATE;
1532
+ type WeaveRegularPolygonToolActionState = (typeof REGULAR_POLYGON_TOOL_STATE)[WeaveRegularPolygonToolActionStateKeys];
1533
+
1534
+ //#endregion
1535
+ //#region src/actions/regular-polygon-tool/regular-polygon-tool.d.ts
1536
+ //# sourceMappingURL=types.d.ts.map
1537
+ declare class WeaveRegularPolygonToolAction extends WeaveAction {
1538
+ protected initialized: boolean;
1539
+ protected state: WeaveRegularPolygonToolActionState;
1540
+ protected regularPolygonId: string | null;
1541
+ protected creating: boolean;
1542
+ protected moved: boolean;
1543
+ protected clickPoint: Vector2d | null;
1544
+ protected container: Konva.Group | Konva.Layer | undefined;
1545
+ protected cancelAction: () => void;
1546
+ onPropsChange: undefined;
1547
+ onInit: undefined;
1548
+ constructor();
1549
+ getName(): string;
1550
+ initProps(): {
1551
+ opacity: number;
1552
+ fill: string;
1553
+ stroke: string;
1554
+ strokeWidth: number;
1555
+ sides: number;
1556
+ radius: number;
1557
+ };
1558
+ private setupEvents;
1559
+ private setState;
1560
+ private addRegularPolygon;
1561
+ private handleAdding;
1562
+ private handleSettingSize;
1563
+ private handleMovement;
1564
+ trigger(cancelAction: () => void): void;
1565
+ cleanup(): void;
1566
+ }
1567
+
1568
+ //#endregion
1569
+ //#region src/actions/frame-tool/constants.d.ts
1570
+ //# sourceMappingURL=regular-polygon-tool.d.ts.map
1493
1571
  declare const FRAME_TOOL_ACTION_NAME = "frameTool";
1494
1572
  declare const FRAME_TOOL_STATE: {
1495
1573
  readonly IDLE: "idle";
@@ -2105,5 +2183,5 @@ declare class WeaveNodesSnappingPlugin extends WeavePlugin {
2105
2183
  //#endregion
2106
2184
  //# sourceMappingURL=nodes-snapping.d.ts.map
2107
2185
 
2108
- export { ARROW_TOOL_ACTION_NAME, ARROW_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_ARROW_NODE_TYPE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_STAGE_GRID_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveArrowNode, WeaveArrowNodeParams, WeaveArrowProperties, WeaveArrowToolAction, WeaveArrowToolActionState, WeaveArrowToolActionStateKeys, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveEllipseNode, WeaveEllipseNodeParams, WeaveEllipseProperties, WeaveEllipseToolAction, WeaveEllipseToolActionState, WeaveEllipseToolActionStateKeys, WeaveEraserToolAction, WeaveEraserToolActionState, WeaveEraserToolActionStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveGroupNodeParams, WeaveGroupProperties, WeaveImageNode, WeaveImageNodeParams, WeaveImageProperties, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveLineNodeParams, WeaveLineProperties, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionConfig, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSelectionTransformationsConfig, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleNodeParams, WeaveRectangleProperties, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStarNode, WeaveStarNodeParams, WeaveStarProperties, WeaveStarToolAction, WeaveStarToolActionState, WeaveStarToolActionStateKeys, WeaveStore, WeaveStoreOnNodeChangeEvent, WeaveStoreOnRoomLoadedEvent, WeaveStoreOnStateChangeEvent, WeaveStoreOnUndoRedoChangeEvent, WeaveTextLayout, WeaveTextLayoutKeys, WeaveTextNode, WeaveTextNodeParams, WeaveTextProperties, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUserPointersUIProperties, WeaveUserSelectionInfo, WeaveUserSelectionKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveUsersSelectionPlugin, WeaveUsersSelectionPluginConfig, WeaveUsersSelectionPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
2186
+ export { ARROW_TOOL_ACTION_NAME, ARROW_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_ARROW_NODE_TYPE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_GRID_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveArrowNode, WeaveArrowNodeParams, WeaveArrowProperties, WeaveArrowToolAction, WeaveArrowToolActionState, WeaveArrowToolActionStateKeys, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveEllipseNode, WeaveEllipseNodeParams, WeaveEllipseProperties, WeaveEllipseToolAction, WeaveEllipseToolActionState, WeaveEllipseToolActionStateKeys, WeaveEraserToolAction, WeaveEraserToolActionState, WeaveEraserToolActionStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveGroupNodeParams, WeaveGroupProperties, WeaveImageNode, WeaveImageNodeParams, WeaveImageProperties, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveLineNodeParams, WeaveLineProperties, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionConfig, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSelectionTransformationsConfig, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleNodeParams, WeaveRectangleProperties, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveRegularPolygonNode, WeaveRegularPolygonNodeParams, WeaveRegularPolygonProperties, WeaveRegularPolygonToolAction, WeaveRegularPolygonToolActionState, WeaveRegularPolygonToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStarNode, WeaveStarNodeParams, WeaveStarProperties, WeaveStarToolAction, WeaveStarToolActionState, WeaveStarToolActionStateKeys, WeaveStore, WeaveStoreOnNodeChangeEvent, WeaveStoreOnRoomLoadedEvent, WeaveStoreOnStateChangeEvent, WeaveStoreOnUndoRedoChangeEvent, WeaveTextLayout, WeaveTextLayoutKeys, WeaveTextNode, WeaveTextNodeParams, WeaveTextProperties, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUserPointersUIProperties, WeaveUserSelectionInfo, WeaveUserSelectionKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveUsersSelectionPlugin, WeaveUsersSelectionPluginConfig, WeaveUsersSelectionPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
2109
2187
  //# sourceMappingURL=sdk.d.cts.map