@inditextech/weave-sdk 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.cjs +1052 -105
- package/dist/sdk.d.cts +296 -13
- package/dist/sdk.d.cts.map +1 -1
- package/dist/sdk.d.ts +296 -13
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +1031 -106
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
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
|
|
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,25 +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
16560
|
node.width(Math.max(5, node.width() * node.scaleX()));
|
|
16554
16561
|
node.height(Math.max(5, node.height() * node.scaleY()));
|
|
16555
|
-
if (node.getAttrs().nodeType === "image" && node.getAttrs().uncroppedImage) node.setAttrs({ uncroppedImage: {
|
|
16556
|
-
width: node.getAttrs().uncroppedImage.width * node.scaleX(),
|
|
16557
|
-
height: node.getAttrs().uncroppedImage.height * node.scaleY()
|
|
16558
|
-
} });
|
|
16559
16562
|
node.scaleX(1);
|
|
16560
16563
|
node.scaleY(1);
|
|
16561
16564
|
}
|
|
@@ -16596,7 +16599,21 @@ var WeaveNode = class {
|
|
|
16596
16599
|
const nodeHandler = this.instance.getNodeHandler(node$1.getAttrs().nodeType);
|
|
16597
16600
|
this.instance.updateNode(nodeHandler.serialize(node$1));
|
|
16598
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
|
+
});
|
|
16599
16610
|
const handleDragMove = (e) => {
|
|
16611
|
+
const stage = this.instance.getStage();
|
|
16612
|
+
if (stage.isMouseWheelPressed()) {
|
|
16613
|
+
e.cancelBubble = true;
|
|
16614
|
+
node.stopDrag();
|
|
16615
|
+
return;
|
|
16616
|
+
}
|
|
16600
16617
|
if (this.isSelecting() && this.isNodeSelected(node)) {
|
|
16601
16618
|
clearContainerTargets(this.instance);
|
|
16602
16619
|
const layerToMove = checkIfOverContainer(this.instance, e.target);
|
|
@@ -18085,7 +18102,7 @@ var WeaveRegisterManager = class {
|
|
|
18085
18102
|
|
|
18086
18103
|
//#endregion
|
|
18087
18104
|
//#region package.json
|
|
18088
|
-
var version = "0.
|
|
18105
|
+
var version = "0.22.0";
|
|
18089
18106
|
|
|
18090
18107
|
//#endregion
|
|
18091
18108
|
//#region src/managers/setup.ts
|
|
@@ -18526,6 +18543,9 @@ var Weave = class extends Emittery {
|
|
|
18526
18543
|
getConfiguration() {
|
|
18527
18544
|
return this.config;
|
|
18528
18545
|
}
|
|
18546
|
+
setStageDefaultConfiguration() {
|
|
18547
|
+
setStageDefaultConfiguration();
|
|
18548
|
+
}
|
|
18529
18549
|
setNodesDefaultConfiguration(config) {
|
|
18530
18550
|
setNodesDefaultConfiguration(config);
|
|
18531
18551
|
}
|
|
@@ -18754,8 +18774,17 @@ const WEAVE_STAGE_NODE_TYPE = "stage";
|
|
|
18754
18774
|
//#region src/nodes/stage/stage.ts
|
|
18755
18775
|
var WeaveStageNode = class extends WeaveNode {
|
|
18756
18776
|
nodeType = WEAVE_STAGE_NODE_TYPE;
|
|
18777
|
+
wheelMousePressed = false;
|
|
18757
18778
|
onRender(props) {
|
|
18758
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
|
+
});
|
|
18759
18788
|
stage.batchDraw();
|
|
18760
18789
|
return stage;
|
|
18761
18790
|
}
|
|
@@ -18885,6 +18914,65 @@ var WeaveRectangleNode = class extends WeaveNode {
|
|
|
18885
18914
|
}
|
|
18886
18915
|
};
|
|
18887
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
|
+
|
|
18888
18976
|
//#endregion
|
|
18889
18977
|
//#region src/nodes/line/constants.ts
|
|
18890
18978
|
const WEAVE_LINE_NODE_TYPE = "line";
|
|
@@ -18917,6 +19005,25 @@ var WeaveLineNode = class extends WeaveNode {
|
|
|
18917
19005
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
18918
19006
|
if (nodesSelectionPlugin) nodesSelectionPlugin.getTransformer().forceUpdate();
|
|
18919
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
|
+
}
|
|
18920
19027
|
};
|
|
18921
19028
|
|
|
18922
19029
|
//#endregion
|
|
@@ -19463,7 +19570,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
19463
19570
|
imageURL: this.imageURL,
|
|
19464
19571
|
stroke: "#000000ff",
|
|
19465
19572
|
strokeWidth: 0,
|
|
19466
|
-
strokeScaleEnabled:
|
|
19573
|
+
strokeScaleEnabled: true,
|
|
19467
19574
|
listening: false
|
|
19468
19575
|
});
|
|
19469
19576
|
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
@@ -19490,7 +19597,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
19490
19597
|
imageURL: this.imageURL,
|
|
19491
19598
|
stroke: "#000000ff",
|
|
19492
19599
|
strokeWidth: 0,
|
|
19493
|
-
strokeScaleEnabled:
|
|
19600
|
+
strokeScaleEnabled: true,
|
|
19494
19601
|
imageWidth: this.preloadImgs[this.imageId].width,
|
|
19495
19602
|
imageHeight: this.preloadImgs[this.imageId].height,
|
|
19496
19603
|
imageInfo: {
|
|
@@ -19894,6 +20001,12 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
19894
20001
|
id,
|
|
19895
20002
|
name: "node"
|
|
19896
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
|
+
};
|
|
19897
20010
|
image.resetCrop = () => {
|
|
19898
20011
|
const stage = this.instance.getStage();
|
|
19899
20012
|
const image$1 = stage.findOne(`#${id}`);
|
|
@@ -19936,7 +20049,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
19936
20049
|
height: 0,
|
|
19937
20050
|
stroke: "#ff0000ff",
|
|
19938
20051
|
strokeWidth: 0,
|
|
19939
|
-
strokeScaleEnabled:
|
|
20052
|
+
strokeScaleEnabled: true,
|
|
19940
20053
|
draggable: false,
|
|
19941
20054
|
visible: false
|
|
19942
20055
|
});
|
|
@@ -20052,7 +20165,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
20052
20165
|
draggable: false,
|
|
20053
20166
|
zIndex: 0
|
|
20054
20167
|
});
|
|
20055
|
-
this.
|
|
20168
|
+
this.updateImageCrop(nextProps);
|
|
20056
20169
|
}
|
|
20057
20170
|
try {
|
|
20058
20171
|
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
@@ -20100,18 +20213,22 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
20100
20213
|
});
|
|
20101
20214
|
this.scaleReset(image);
|
|
20102
20215
|
const imageRect = image.getClientRect({ relativeTo: this.instance.getStage() });
|
|
20103
|
-
image.setAttr("uncroppedImage", {
|
|
20104
|
-
width: imageProps.uncroppedImage
|
|
20105
|
-
height: imageProps.uncroppedImage
|
|
20216
|
+
if (imageProps.cropInfo && imageProps.uncroppedImage) image.setAttr("uncroppedImage", {
|
|
20217
|
+
width: imageProps.uncroppedImage.width,
|
|
20218
|
+
height: imageProps.uncroppedImage.height
|
|
20106
20219
|
});
|
|
20107
|
-
|
|
20220
|
+
if (!imageProps.cropInfo) image.setAttr("uncroppedImage", {
|
|
20221
|
+
width: imageRect.width,
|
|
20222
|
+
height: imageRect.height
|
|
20223
|
+
});
|
|
20224
|
+
this.updateImageCrop(imageProps);
|
|
20108
20225
|
const nodeHandler = this.instance.getNodeHandler(image.getAttrs().nodeType);
|
|
20109
20226
|
this.instance.updateNode(nodeHandler.serialize(image));
|
|
20110
20227
|
}
|
|
20111
20228
|
};
|
|
20112
20229
|
if (imageProps.imageURL) imageObj.src = imageProps.imageURL;
|
|
20113
20230
|
}
|
|
20114
|
-
|
|
20231
|
+
updateImageCrop(nextProps) {
|
|
20115
20232
|
const imageAttrs = nextProps;
|
|
20116
20233
|
const stage = this.instance.getStage();
|
|
20117
20234
|
const image = stage.findOne(`#${imageAttrs.id}`);
|
|
@@ -20150,6 +20267,134 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
20150
20267
|
if (!imageToolAction) throw new Error("Image Tool action not found");
|
|
20151
20268
|
return imageToolAction;
|
|
20152
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
|
+
}
|
|
20153
20398
|
};
|
|
20154
20399
|
|
|
20155
20400
|
//#endregion
|
|
@@ -20283,7 +20528,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20283
20528
|
id,
|
|
20284
20529
|
containerId: `${id}-group-internal`,
|
|
20285
20530
|
containerOffsetX: 0,
|
|
20286
|
-
containerOffsetY:
|
|
20531
|
+
containerOffsetY: borderWidth,
|
|
20287
20532
|
width: props.frameWidth,
|
|
20288
20533
|
height: props.frameHeight,
|
|
20289
20534
|
fill: "transparent",
|
|
@@ -20296,7 +20541,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20296
20541
|
y: 0,
|
|
20297
20542
|
width: props.frameWidth,
|
|
20298
20543
|
height: props.frameHeight,
|
|
20299
|
-
strokeScaleEnabled:
|
|
20544
|
+
strokeScaleEnabled: true,
|
|
20300
20545
|
draggable: false
|
|
20301
20546
|
});
|
|
20302
20547
|
frame.add(frameInternalGroup);
|
|
@@ -20308,7 +20553,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20308
20553
|
width: props.frameWidth,
|
|
20309
20554
|
stroke: borderColor,
|
|
20310
20555
|
strokeWidth: borderWidth,
|
|
20311
|
-
strokeScaleEnabled:
|
|
20556
|
+
strokeScaleEnabled: true,
|
|
20312
20557
|
shadowForStrokeEnabled: false,
|
|
20313
20558
|
height: props.frameHeight,
|
|
20314
20559
|
fill: "#ffffffff",
|
|
@@ -20329,7 +20574,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20329
20574
|
text: props.title,
|
|
20330
20575
|
stroke: "#000000ff",
|
|
20331
20576
|
strokeWidth: 1,
|
|
20332
|
-
strokeScaleEnabled:
|
|
20577
|
+
strokeScaleEnabled: true,
|
|
20333
20578
|
listening: false,
|
|
20334
20579
|
draggable: false
|
|
20335
20580
|
});
|
|
@@ -20418,17 +20663,17 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20418
20663
|
const frameInternal = new konva.default.Group({
|
|
20419
20664
|
id: `${id}-group-internal`,
|
|
20420
20665
|
nodeId: id,
|
|
20421
|
-
x:
|
|
20422
|
-
y:
|
|
20423
|
-
width: props.frameWidth,
|
|
20424
|
-
height: props.frameHeight,
|
|
20425
|
-
strokeScaleEnabled:
|
|
20666
|
+
x: borderWidth,
|
|
20667
|
+
y: borderWidth,
|
|
20668
|
+
width: props.frameWidth - borderWidth * 2,
|
|
20669
|
+
height: props.frameHeight - borderWidth * 2,
|
|
20670
|
+
strokeScaleEnabled: true,
|
|
20426
20671
|
draggable: false
|
|
20427
20672
|
});
|
|
20428
20673
|
frameInternal.clipFunc((ctx) => {
|
|
20429
|
-
const width = frameInternal.width() * frameInternal.scaleX();
|
|
20430
|
-
const height = frameInternal.height() * frameInternal.scaleY();
|
|
20431
|
-
ctx.rect(
|
|
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);
|
|
20432
20677
|
});
|
|
20433
20678
|
frameInternalGroup.add(frameInternal);
|
|
20434
20679
|
this.setupDefaultNodeEvents(frame);
|
|
@@ -20454,9 +20699,11 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20454
20699
|
const { id } = nextProps;
|
|
20455
20700
|
const frameNode = nodeInstance;
|
|
20456
20701
|
const newProps = { ...nextProps };
|
|
20457
|
-
const { titleHeight } = this.config;
|
|
20702
|
+
const { titleHeight, borderWidth } = this.config;
|
|
20458
20703
|
nodeInstance.setAttrs({
|
|
20459
20704
|
...newProps,
|
|
20705
|
+
containerOffsetX: 0,
|
|
20706
|
+
containerOffsetY: borderWidth,
|
|
20460
20707
|
clip: void 0
|
|
20461
20708
|
});
|
|
20462
20709
|
const selectorArea = frameNode.findOne(`#${id}-selector-area`);
|
|
@@ -20489,14 +20736,15 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20489
20736
|
x: 0,
|
|
20490
20737
|
y: -titleHeight,
|
|
20491
20738
|
text: nextProps.title,
|
|
20492
|
-
width: width * selectorArea.scaleX()
|
|
20739
|
+
width: width * selectorArea.scaleX(),
|
|
20740
|
+
height: titleHeight * selectorArea.scaleY()
|
|
20493
20741
|
});
|
|
20494
20742
|
const frameInternal = frameNode.findOne(`#${id}-group-internal`);
|
|
20495
20743
|
if (frameInternal) frameInternal.setAttrs({
|
|
20496
|
-
x:
|
|
20497
|
-
y:
|
|
20498
|
-
width: width * selectorArea.scaleX(),
|
|
20499
|
-
height: height * selectorArea.scaleY()
|
|
20744
|
+
x: borderWidth,
|
|
20745
|
+
y: borderWidth,
|
|
20746
|
+
width: (width - borderWidth * 2) * selectorArea.scaleX(),
|
|
20747
|
+
height: (height - borderWidth * 2) * selectorArea.scaleY()
|
|
20500
20748
|
});
|
|
20501
20749
|
}
|
|
20502
20750
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
@@ -20536,10 +20784,6 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
20536
20784
|
const WEAVE_STAGE_ZOOM_KEY = "stageZoom";
|
|
20537
20785
|
const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
|
|
20538
20786
|
zoomSteps: [
|
|
20539
|
-
.1,
|
|
20540
|
-
.2,
|
|
20541
|
-
.3,
|
|
20542
|
-
.4,
|
|
20543
20787
|
.5,
|
|
20544
20788
|
.6,
|
|
20545
20789
|
.7,
|
|
@@ -20554,7 +20798,11 @@ const WEAVE_STAGE_ZOOM_DEFAULT_CONFIG = {
|
|
|
20554
20798
|
4,
|
|
20555
20799
|
6,
|
|
20556
20800
|
8,
|
|
20557
|
-
10
|
|
20801
|
+
10,
|
|
20802
|
+
20,
|
|
20803
|
+
50,
|
|
20804
|
+
100,
|
|
20805
|
+
250
|
|
20558
20806
|
],
|
|
20559
20807
|
defaultZoom: 1,
|
|
20560
20808
|
fitToScreen: { padding: 40 },
|
|
@@ -20576,6 +20824,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20576
20824
|
};
|
|
20577
20825
|
if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
|
|
20578
20826
|
this.isCtrlOrMetaPressed = false;
|
|
20827
|
+
this.updatedMinimumZoom = false;
|
|
20579
20828
|
this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
|
|
20580
20829
|
this.actualScale = this.config.zoomSteps[this.actualStep];
|
|
20581
20830
|
this.defaultStep = this.actualStep;
|
|
@@ -20585,9 +20834,27 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20585
20834
|
}
|
|
20586
20835
|
onInit() {
|
|
20587
20836
|
this.initEvents();
|
|
20837
|
+
const minimumZoom = this.minimumZoom();
|
|
20838
|
+
if (minimumZoom < this.config.zoomSteps[0]) {
|
|
20839
|
+
this.updatedMinimumZoom = true;
|
|
20840
|
+
this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
|
|
20841
|
+
}
|
|
20842
|
+
const mainLayer = this.instance.getMainLayer();
|
|
20843
|
+
mainLayer?.on("draw", () => {
|
|
20844
|
+
const minimumZoom$1 = this.minimumZoom();
|
|
20845
|
+
if (this.updatedMinimumZoom && minimumZoom$1 < this.config.zoomSteps[0]) {
|
|
20846
|
+
this.updatedMinimumZoom = true;
|
|
20847
|
+
this.config.zoomSteps.shift();
|
|
20848
|
+
this.config.zoomSteps = [minimumZoom$1, ...this.config.zoomSteps];
|
|
20849
|
+
}
|
|
20850
|
+
if (!this.updatedMinimumZoom && minimumZoom$1 < this.config.zoomSteps[0]) {
|
|
20851
|
+
this.updatedMinimumZoom = true;
|
|
20852
|
+
this.config.zoomSteps = [minimumZoom$1, ...this.config.zoomSteps];
|
|
20853
|
+
}
|
|
20854
|
+
});
|
|
20588
20855
|
this.setZoom(this.config.zoomSteps[this.actualStep]);
|
|
20589
20856
|
}
|
|
20590
|
-
setZoom(scale, centered = true) {
|
|
20857
|
+
setZoom(scale, centered = true, pointer) {
|
|
20591
20858
|
const stage = this.instance.getStage();
|
|
20592
20859
|
const mainLayer = this.instance.getMainLayer();
|
|
20593
20860
|
if (mainLayer) {
|
|
@@ -20612,6 +20879,17 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20612
20879
|
};
|
|
20613
20880
|
stage.position(newPos);
|
|
20614
20881
|
}
|
|
20882
|
+
if (!centered && pointer) {
|
|
20883
|
+
const mousePointTo = {
|
|
20884
|
+
x: (pointer.x - stage.x()) / oldScale,
|
|
20885
|
+
y: (pointer.y - stage.y()) / oldScale
|
|
20886
|
+
};
|
|
20887
|
+
const newPos = {
|
|
20888
|
+
x: pointer.x - mousePointTo.x * scale,
|
|
20889
|
+
y: pointer.y - mousePointTo.y * scale
|
|
20890
|
+
};
|
|
20891
|
+
stage.position(newPos);
|
|
20892
|
+
}
|
|
20615
20893
|
const plugins = this.instance.getPlugins();
|
|
20616
20894
|
for (const pluginId of Object.keys(plugins)) {
|
|
20617
20895
|
const pluginInstance = plugins[pluginId];
|
|
@@ -20632,7 +20910,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20632
20910
|
if (!this.enabled) return false;
|
|
20633
20911
|
const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
|
|
20634
20912
|
if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
|
|
20635
|
-
return this.actualStep - 1
|
|
20913
|
+
return this.actualStep - 1 >= 0;
|
|
20636
20914
|
}
|
|
20637
20915
|
canZoomIn() {
|
|
20638
20916
|
if (!this.enabled) return false;
|
|
@@ -20650,68 +20928,88 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20650
20928
|
const nextValue = this.config.zoomSteps.filter((scale) => direction === "zoomIn" ? scale >= this.actualScale : scale <= this.actualScale).sort((a, b) => direction === "zoomIn" ? a - b : b - a)[0];
|
|
20651
20929
|
return this.config.zoomSteps.findIndex((scale) => scale === nextValue);
|
|
20652
20930
|
}
|
|
20653
|
-
zoomIn() {
|
|
20931
|
+
zoomIn(pointer) {
|
|
20654
20932
|
if (!this.enabled) return;
|
|
20655
20933
|
if (!this.canZoomIn()) return;
|
|
20656
20934
|
const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
|
|
20657
20935
|
if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomIn");
|
|
20658
20936
|
else this.actualStep += 1;
|
|
20659
|
-
this.setZoom(this.config.zoomSteps[this.actualStep]);
|
|
20937
|
+
this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
|
|
20660
20938
|
}
|
|
20661
|
-
zoomOut() {
|
|
20939
|
+
zoomOut(pointer) {
|
|
20662
20940
|
if (!this.enabled) return;
|
|
20663
20941
|
if (!this.canZoomOut()) return;
|
|
20664
20942
|
const actualZoomIsStep = this.config.zoomSteps.findIndex((scale) => scale === this.actualScale);
|
|
20665
20943
|
if (actualZoomIsStep === -1) this.actualStep = this.findClosestStepIndex("zoomOut");
|
|
20666
20944
|
else this.actualStep -= 1;
|
|
20667
|
-
this.setZoom(this.config.zoomSteps[this.actualStep]);
|
|
20945
|
+
this.setZoom(this.config.zoomSteps[this.actualStep], pointer ? false : true, pointer);
|
|
20946
|
+
}
|
|
20947
|
+
minimumZoom() {
|
|
20948
|
+
if (!this.enabled) return -1;
|
|
20949
|
+
const mainLayer = this.instance.getMainLayer();
|
|
20950
|
+
if (!mainLayer) return -1;
|
|
20951
|
+
if (mainLayer.getChildren().length === 0) return this.config.zoomSteps[this.defaultStep];
|
|
20952
|
+
const stage = this.instance.getStage();
|
|
20953
|
+
const box = mainLayer.getClientRect({
|
|
20954
|
+
relativeTo: stage,
|
|
20955
|
+
skipStroke: true
|
|
20956
|
+
});
|
|
20957
|
+
const stageBox = {
|
|
20958
|
+
width: stage.width(),
|
|
20959
|
+
height: stage.height()
|
|
20960
|
+
};
|
|
20961
|
+
const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
|
|
20962
|
+
const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
|
|
20963
|
+
const scaleX = availableScreenWidth / box.width;
|
|
20964
|
+
const scaleY = availableScreenHeight / box.height;
|
|
20965
|
+
const scale = Math.min(scaleX, scaleY);
|
|
20966
|
+
return scale;
|
|
20668
20967
|
}
|
|
20669
20968
|
fitToScreen() {
|
|
20670
20969
|
if (!this.enabled) return;
|
|
20671
20970
|
const mainLayer = this.instance.getMainLayer();
|
|
20971
|
+
if (!mainLayer) return;
|
|
20672
20972
|
if (mainLayer?.getChildren().length === 0) {
|
|
20673
20973
|
this.setZoom(this.config.zoomSteps[this.defaultStep]);
|
|
20674
20974
|
return;
|
|
20675
20975
|
}
|
|
20676
20976
|
const stage = this.instance.getStage();
|
|
20677
|
-
|
|
20678
|
-
|
|
20679
|
-
|
|
20680
|
-
|
|
20681
|
-
|
|
20682
|
-
|
|
20683
|
-
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
20687
|
-
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
const
|
|
20711
|
-
|
|
20712
|
-
|
|
20713
|
-
if (nodes.length === 0) return;
|
|
20714
|
-
let zoomTransformer = stage.findOne("#zoomTransformer");
|
|
20977
|
+
const box = mainLayer.getClientRect({
|
|
20978
|
+
relativeTo: stage,
|
|
20979
|
+
skipStroke: true
|
|
20980
|
+
});
|
|
20981
|
+
const stageBox = {
|
|
20982
|
+
width: stage.width(),
|
|
20983
|
+
height: stage.height()
|
|
20984
|
+
};
|
|
20985
|
+
const availableScreenWidth = stageBox.width - 2 * this.config.fitToScreen.padding;
|
|
20986
|
+
const availableScreenHeight = stageBox.height - 2 * this.config.fitToScreen.padding;
|
|
20987
|
+
const scaleX = availableScreenWidth / box.width;
|
|
20988
|
+
const scaleY = availableScreenHeight / box.height;
|
|
20989
|
+
const scale = Math.min(scaleX, scaleY);
|
|
20990
|
+
stage.scale({
|
|
20991
|
+
x: scale,
|
|
20992
|
+
y: scale
|
|
20993
|
+
});
|
|
20994
|
+
const selectionCenterX = box.x + box.width / 2;
|
|
20995
|
+
const selectionCenterY = box.y + box.height / 2;
|
|
20996
|
+
const canvasCenterX = stage.width() / (2 * scale);
|
|
20997
|
+
const canvasCenterY = stage.height() / (2 * scale);
|
|
20998
|
+
const stageX = (canvasCenterX - selectionCenterX) * scale;
|
|
20999
|
+
const stageY = (canvasCenterY - selectionCenterY) * scale;
|
|
21000
|
+
stage.position({
|
|
21001
|
+
x: stageX,
|
|
21002
|
+
y: stageY
|
|
21003
|
+
});
|
|
21004
|
+
this.setZoom(scale, false);
|
|
21005
|
+
}
|
|
21006
|
+
fitToSelection() {
|
|
21007
|
+
if (!this.enabled) return;
|
|
21008
|
+
const stage = this.instance.getStage();
|
|
21009
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
21010
|
+
const nodes = selectionPlugin.getTransformer().getNodes();
|
|
21011
|
+
if (nodes.length === 0) return;
|
|
21012
|
+
let zoomTransformer = stage.findOne("#zoomTransformer");
|
|
20715
21013
|
if (!zoomTransformer) {
|
|
20716
21014
|
zoomTransformer = new konva.default.Transformer({
|
|
20717
21015
|
id: "zoomTransformer",
|
|
@@ -20776,8 +21074,11 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20776
21074
|
});
|
|
20777
21075
|
window.addEventListener("wheel", (e) => {
|
|
20778
21076
|
if (!this.enabled || !this.isCtrlOrMetaPressed) return;
|
|
20779
|
-
|
|
20780
|
-
|
|
21077
|
+
const stage = this.instance.getStage();
|
|
21078
|
+
const pointer = stage.getPointerPosition();
|
|
21079
|
+
if (!pointer) return;
|
|
21080
|
+
if (e.deltaY > 0) this.zoomOut(pointer);
|
|
21081
|
+
if (e.deltaY < 0) this.zoomIn(pointer);
|
|
20781
21082
|
});
|
|
20782
21083
|
}
|
|
20783
21084
|
};
|
|
@@ -21199,7 +21500,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
21199
21500
|
const nodeHandler = this.instance.getNodeHandler("rectangle");
|
|
21200
21501
|
const node = nodeHandler.create(this.rectId, {
|
|
21201
21502
|
...this.props,
|
|
21202
|
-
strokeScaleEnabled:
|
|
21503
|
+
strokeScaleEnabled: true,
|
|
21203
21504
|
x: this.clickPoint?.x ?? 0,
|
|
21204
21505
|
y: this.clickPoint?.y ?? 0,
|
|
21205
21506
|
width: 0,
|
|
@@ -21281,6 +21582,192 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
21281
21582
|
}
|
|
21282
21583
|
};
|
|
21283
21584
|
|
|
21585
|
+
//#endregion
|
|
21586
|
+
//#region src/actions/ellipse-tool/constants.ts
|
|
21587
|
+
const ELLIPSE_TOOL_ACTION_NAME = "ellipseTool";
|
|
21588
|
+
const ELLIPSE_TOOL_STATE = {
|
|
21589
|
+
["IDLE"]: "idle",
|
|
21590
|
+
["ADDING"]: "adding",
|
|
21591
|
+
["DEFINING_SIZE"]: "definingSize",
|
|
21592
|
+
["ADDED"]: "added"
|
|
21593
|
+
};
|
|
21594
|
+
|
|
21595
|
+
//#endregion
|
|
21596
|
+
//#region src/actions/ellipse-tool/ellipse-tool.ts
|
|
21597
|
+
var WeaveEllipseToolAction = class extends WeaveAction {
|
|
21598
|
+
initialized = false;
|
|
21599
|
+
onPropsChange = void 0;
|
|
21600
|
+
onInit = void 0;
|
|
21601
|
+
constructor() {
|
|
21602
|
+
super();
|
|
21603
|
+
this.initialized = false;
|
|
21604
|
+
this.state = ELLIPSE_TOOL_STATE.IDLE;
|
|
21605
|
+
this.ellipseId = null;
|
|
21606
|
+
this.creating = false;
|
|
21607
|
+
this.moved = false;
|
|
21608
|
+
this.container = void 0;
|
|
21609
|
+
this.clickPoint = null;
|
|
21610
|
+
this.props = this.initProps();
|
|
21611
|
+
}
|
|
21612
|
+
getName() {
|
|
21613
|
+
return ELLIPSE_TOOL_ACTION_NAME;
|
|
21614
|
+
}
|
|
21615
|
+
initProps() {
|
|
21616
|
+
return {
|
|
21617
|
+
opacity: 1,
|
|
21618
|
+
fill: "#71717aff",
|
|
21619
|
+
stroke: "#000000ff",
|
|
21620
|
+
strokeWidth: 1,
|
|
21621
|
+
radiusX: 50,
|
|
21622
|
+
radiusY: 50,
|
|
21623
|
+
keepAspectRatio: false
|
|
21624
|
+
};
|
|
21625
|
+
}
|
|
21626
|
+
setupEvents() {
|
|
21627
|
+
const stage = this.instance.getStage();
|
|
21628
|
+
stage.container().addEventListener("keydown", (e) => {
|
|
21629
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
|
|
21630
|
+
this.cancelAction();
|
|
21631
|
+
return;
|
|
21632
|
+
}
|
|
21633
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === ELLIPSE_TOOL_ACTION_NAME) {
|
|
21634
|
+
this.cancelAction();
|
|
21635
|
+
return;
|
|
21636
|
+
}
|
|
21637
|
+
});
|
|
21638
|
+
stage.on("mousedown touchstart", (e) => {
|
|
21639
|
+
e.evt.preventDefault();
|
|
21640
|
+
if (this.state === ELLIPSE_TOOL_STATE.ADDING) {
|
|
21641
|
+
this.creating = true;
|
|
21642
|
+
this.handleAdding();
|
|
21643
|
+
}
|
|
21644
|
+
});
|
|
21645
|
+
stage.on("mousemove touchmove", (e) => {
|
|
21646
|
+
e.evt.preventDefault();
|
|
21647
|
+
if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
|
|
21648
|
+
this.moved = true;
|
|
21649
|
+
this.handleMovement();
|
|
21650
|
+
}
|
|
21651
|
+
});
|
|
21652
|
+
stage.on("mouseup touchend", (e) => {
|
|
21653
|
+
e.evt.preventDefault();
|
|
21654
|
+
if (this.state === ELLIPSE_TOOL_STATE.DEFINING_SIZE) {
|
|
21655
|
+
this.creating = false;
|
|
21656
|
+
this.handleSettingSize();
|
|
21657
|
+
}
|
|
21658
|
+
});
|
|
21659
|
+
this.initialized = true;
|
|
21660
|
+
}
|
|
21661
|
+
setState(state) {
|
|
21662
|
+
this.state = state;
|
|
21663
|
+
}
|
|
21664
|
+
addEllipse() {
|
|
21665
|
+
const stage = this.instance.getStage();
|
|
21666
|
+
stage.container().style.cursor = "crosshair";
|
|
21667
|
+
stage.container().focus();
|
|
21668
|
+
this.clickPoint = null;
|
|
21669
|
+
this.setState(ELLIPSE_TOOL_STATE.ADDING);
|
|
21670
|
+
}
|
|
21671
|
+
handleAdding() {
|
|
21672
|
+
const { mousePoint, container } = this.instance.getMousePointer();
|
|
21673
|
+
this.clickPoint = mousePoint;
|
|
21674
|
+
this.container = container;
|
|
21675
|
+
this.ellipseId = v4_default();
|
|
21676
|
+
const nodeHandler = this.instance.getNodeHandler("ellipse");
|
|
21677
|
+
const node = nodeHandler.create(this.ellipseId, {
|
|
21678
|
+
...this.props,
|
|
21679
|
+
strokeScaleEnabled: true,
|
|
21680
|
+
x: this.clickPoint?.x ?? 0,
|
|
21681
|
+
y: this.clickPoint?.y ?? 0,
|
|
21682
|
+
radiusX: 0,
|
|
21683
|
+
radiusY: 0
|
|
21684
|
+
});
|
|
21685
|
+
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
21686
|
+
this.setState(ELLIPSE_TOOL_STATE.DEFINING_SIZE);
|
|
21687
|
+
}
|
|
21688
|
+
handleSettingSize() {
|
|
21689
|
+
const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
|
|
21690
|
+
if (this.ellipseId && this.clickPoint && this.container && ellipse) {
|
|
21691
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
|
|
21692
|
+
const nodeHandler = this.instance.getNodeHandler("ellipse");
|
|
21693
|
+
const ellipsePos = {
|
|
21694
|
+
x: this.clickPoint.x,
|
|
21695
|
+
y: this.clickPoint.y
|
|
21696
|
+
};
|
|
21697
|
+
let ellipseRadiusX = this.props.radiusY;
|
|
21698
|
+
let ellipseRadiusY = this.props.radiusY;
|
|
21699
|
+
if (this.moved) {
|
|
21700
|
+
ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
|
|
21701
|
+
ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
|
|
21702
|
+
ellipseRadiusX = Math.abs(this.clickPoint.x - mousePoint.x);
|
|
21703
|
+
ellipseRadiusY = Math.abs(this.clickPoint.y - mousePoint.y);
|
|
21704
|
+
}
|
|
21705
|
+
ellipse.setAttrs({
|
|
21706
|
+
...this.props,
|
|
21707
|
+
x: ellipsePos.x + ellipseRadiusX / 2,
|
|
21708
|
+
y: ellipsePos.y + ellipseRadiusY / 2,
|
|
21709
|
+
radiusX: ellipseRadiusX,
|
|
21710
|
+
radiusY: ellipseRadiusY
|
|
21711
|
+
});
|
|
21712
|
+
this.instance.updateNode(nodeHandler.serialize(ellipse));
|
|
21713
|
+
}
|
|
21714
|
+
this.cancelAction();
|
|
21715
|
+
}
|
|
21716
|
+
handleMovement() {
|
|
21717
|
+
if (this.state !== ELLIPSE_TOOL_STATE.DEFINING_SIZE) return;
|
|
21718
|
+
const ellipse = this.instance.getStage().findOne(`#${this.ellipseId}`);
|
|
21719
|
+
if (this.ellipseId && this.container && this.clickPoint && ellipse) {
|
|
21720
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
|
|
21721
|
+
const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
|
|
21722
|
+
const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
|
|
21723
|
+
const nodeHandler = this.instance.getNodeHandler("ellipse");
|
|
21724
|
+
const ellipsePos = {
|
|
21725
|
+
x: this.clickPoint.x,
|
|
21726
|
+
y: this.clickPoint.y
|
|
21727
|
+
};
|
|
21728
|
+
if (this.moved) {
|
|
21729
|
+
ellipsePos.x = Math.min(this.clickPoint.x, mousePoint.x);
|
|
21730
|
+
ellipsePos.y = Math.min(this.clickPoint.y, mousePoint.y);
|
|
21731
|
+
}
|
|
21732
|
+
ellipse.setAttrs({
|
|
21733
|
+
x: ellipsePos.x + deltaX / 2,
|
|
21734
|
+
y: ellipsePos.y + deltaY / 2,
|
|
21735
|
+
radiusX: deltaX,
|
|
21736
|
+
radiusY: deltaY
|
|
21737
|
+
});
|
|
21738
|
+
this.instance.updateNode(nodeHandler.serialize(ellipse));
|
|
21739
|
+
}
|
|
21740
|
+
}
|
|
21741
|
+
trigger(cancelAction) {
|
|
21742
|
+
if (!this.instance) throw new Error("Instance not defined");
|
|
21743
|
+
if (!this.initialized) this.setupEvents();
|
|
21744
|
+
const stage = this.instance.getStage();
|
|
21745
|
+
stage.container().tabIndex = 1;
|
|
21746
|
+
stage.container().focus();
|
|
21747
|
+
this.cancelAction = cancelAction;
|
|
21748
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
21749
|
+
if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
|
|
21750
|
+
this.props = this.initProps();
|
|
21751
|
+
this.addEllipse();
|
|
21752
|
+
}
|
|
21753
|
+
cleanup() {
|
|
21754
|
+
const stage = this.instance.getStage();
|
|
21755
|
+
stage.container().style.cursor = "default";
|
|
21756
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
21757
|
+
if (selectionPlugin) {
|
|
21758
|
+
const node = stage.findOne(`#${this.ellipseId}`);
|
|
21759
|
+
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
21760
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
21761
|
+
}
|
|
21762
|
+
this.ellipseId = null;
|
|
21763
|
+
this.creating = false;
|
|
21764
|
+
this.moved = false;
|
|
21765
|
+
this.container = void 0;
|
|
21766
|
+
this.clickPoint = null;
|
|
21767
|
+
this.setState(ELLIPSE_TOOL_STATE.IDLE);
|
|
21768
|
+
}
|
|
21769
|
+
};
|
|
21770
|
+
|
|
21284
21771
|
//#endregion
|
|
21285
21772
|
//#region src/actions/pen-tool/constants.ts
|
|
21286
21773
|
const PEN_TOOL_ACTION_NAME = "penTool";
|
|
@@ -21377,7 +21864,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
21377
21864
|
const nodeHandler = this.instance.getNodeHandler("line");
|
|
21378
21865
|
const node = nodeHandler.create(this.lineId, {
|
|
21379
21866
|
...this.props,
|
|
21380
|
-
strokeScaleEnabled:
|
|
21867
|
+
strokeScaleEnabled: true,
|
|
21381
21868
|
x: this.clickPoint?.x ?? 0,
|
|
21382
21869
|
y: this.clickPoint?.y ?? 0,
|
|
21383
21870
|
points: [0, 0]
|
|
@@ -21387,7 +21874,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
21387
21874
|
x: this.clickPoint?.x ?? 0,
|
|
21388
21875
|
y: this.clickPoint?.y ?? 0,
|
|
21389
21876
|
radius: 5 / stage.scaleX(),
|
|
21390
|
-
strokeScaleEnabled:
|
|
21877
|
+
strokeScaleEnabled: true,
|
|
21391
21878
|
stroke: "#cccccc",
|
|
21392
21879
|
strokeWidth: 0,
|
|
21393
21880
|
fill: "#cccccc"
|
|
@@ -21397,7 +21884,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
21397
21884
|
...this.props,
|
|
21398
21885
|
x: this.clickPoint?.x ?? 0,
|
|
21399
21886
|
y: this.clickPoint?.y ?? 0,
|
|
21400
|
-
strokeScaleEnabled:
|
|
21887
|
+
strokeScaleEnabled: true,
|
|
21401
21888
|
points: [0, 0]
|
|
21402
21889
|
});
|
|
21403
21890
|
this.instance.addNode(tempLine, this.container?.getAttrs().id);
|
|
@@ -21405,7 +21892,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
21405
21892
|
x: this.clickPoint?.x ?? 0,
|
|
21406
21893
|
y: this.clickPoint?.y ?? 0,
|
|
21407
21894
|
radius: 5 / stage.scaleX(),
|
|
21408
|
-
strokeScaleEnabled:
|
|
21895
|
+
strokeScaleEnabled: true,
|
|
21409
21896
|
stroke: "#cccccc",
|
|
21410
21897
|
strokeWidth: 0,
|
|
21411
21898
|
fill: "#cccccc"
|
|
@@ -21601,7 +22088,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
21601
22088
|
const nodeHandler = this.instance.getNodeHandler("line");
|
|
21602
22089
|
const node = nodeHandler.create(this.strokeId, {
|
|
21603
22090
|
...this.props,
|
|
21604
|
-
strokeScaleEnabled:
|
|
22091
|
+
strokeScaleEnabled: true,
|
|
21605
22092
|
x: this.clickPoint?.x ?? 0,
|
|
21606
22093
|
y: this.clickPoint?.y ?? 0,
|
|
21607
22094
|
points: [0, 0]
|
|
@@ -21741,7 +22228,7 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
21741
22228
|
strokeEnabled: false,
|
|
21742
22229
|
stroke: "#000000ff",
|
|
21743
22230
|
strokeWidth: 1,
|
|
21744
|
-
strokeScaleEnabled:
|
|
22231
|
+
strokeScaleEnabled: true,
|
|
21745
22232
|
align: "left",
|
|
21746
22233
|
verticalAlign: "top",
|
|
21747
22234
|
opacity: 1,
|
|
@@ -21778,6 +22265,444 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
21778
22265
|
}
|
|
21779
22266
|
};
|
|
21780
22267
|
|
|
22268
|
+
//#endregion
|
|
22269
|
+
//#region src/actions/star-tool/constants.ts
|
|
22270
|
+
const STAR_TOOL_ACTION_NAME = "starTool";
|
|
22271
|
+
const STAR_TOOL_STATE = {
|
|
22272
|
+
["IDLE"]: "idle",
|
|
22273
|
+
["ADDING"]: "adding",
|
|
22274
|
+
["DEFINING_SIZE"]: "definingSize",
|
|
22275
|
+
["ADDED"]: "added"
|
|
22276
|
+
};
|
|
22277
|
+
|
|
22278
|
+
//#endregion
|
|
22279
|
+
//#region src/actions/star-tool/star-tool.ts
|
|
22280
|
+
var WeaveStarToolAction = class extends WeaveAction {
|
|
22281
|
+
initialized = false;
|
|
22282
|
+
onPropsChange = void 0;
|
|
22283
|
+
onInit = void 0;
|
|
22284
|
+
constructor() {
|
|
22285
|
+
super();
|
|
22286
|
+
this.initialized = false;
|
|
22287
|
+
this.state = STAR_TOOL_STATE.IDLE;
|
|
22288
|
+
this.starId = null;
|
|
22289
|
+
this.creating = false;
|
|
22290
|
+
this.moved = false;
|
|
22291
|
+
this.container = void 0;
|
|
22292
|
+
this.clickPoint = null;
|
|
22293
|
+
this.props = this.initProps();
|
|
22294
|
+
}
|
|
22295
|
+
getName() {
|
|
22296
|
+
return STAR_TOOL_ACTION_NAME;
|
|
22297
|
+
}
|
|
22298
|
+
initProps() {
|
|
22299
|
+
return {
|
|
22300
|
+
opacity: 1,
|
|
22301
|
+
fill: "#71717aff",
|
|
22302
|
+
stroke: "#000000ff",
|
|
22303
|
+
strokeWidth: 1,
|
|
22304
|
+
numPoints: 5,
|
|
22305
|
+
innerRadius: 70,
|
|
22306
|
+
outerRadius: 184,
|
|
22307
|
+
keepAspectRatio: false
|
|
22308
|
+
};
|
|
22309
|
+
}
|
|
22310
|
+
setupEvents() {
|
|
22311
|
+
const stage = this.instance.getStage();
|
|
22312
|
+
stage.container().addEventListener("keydown", (e) => {
|
|
22313
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
|
|
22314
|
+
this.cancelAction();
|
|
22315
|
+
return;
|
|
22316
|
+
}
|
|
22317
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === STAR_TOOL_ACTION_NAME) {
|
|
22318
|
+
this.cancelAction();
|
|
22319
|
+
return;
|
|
22320
|
+
}
|
|
22321
|
+
});
|
|
22322
|
+
stage.on("mousedown touchstart", (e) => {
|
|
22323
|
+
e.evt.preventDefault();
|
|
22324
|
+
if (this.state === STAR_TOOL_STATE.ADDING) {
|
|
22325
|
+
this.creating = true;
|
|
22326
|
+
this.handleAdding();
|
|
22327
|
+
}
|
|
22328
|
+
});
|
|
22329
|
+
stage.on("mousemove touchmove", (e) => {
|
|
22330
|
+
e.evt.preventDefault();
|
|
22331
|
+
if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
|
|
22332
|
+
this.moved = true;
|
|
22333
|
+
this.handleMovement();
|
|
22334
|
+
}
|
|
22335
|
+
});
|
|
22336
|
+
stage.on("mouseup touchend", (e) => {
|
|
22337
|
+
e.evt.preventDefault();
|
|
22338
|
+
if (this.state === STAR_TOOL_STATE.DEFINING_SIZE) {
|
|
22339
|
+
this.creating = false;
|
|
22340
|
+
this.handleSettingSize();
|
|
22341
|
+
}
|
|
22342
|
+
});
|
|
22343
|
+
this.initialized = true;
|
|
22344
|
+
}
|
|
22345
|
+
setState(state) {
|
|
22346
|
+
this.state = state;
|
|
22347
|
+
}
|
|
22348
|
+
addStar() {
|
|
22349
|
+
const stage = this.instance.getStage();
|
|
22350
|
+
stage.container().style.cursor = "crosshair";
|
|
22351
|
+
stage.container().focus();
|
|
22352
|
+
this.clickPoint = null;
|
|
22353
|
+
this.setState(STAR_TOOL_STATE.ADDING);
|
|
22354
|
+
}
|
|
22355
|
+
handleAdding() {
|
|
22356
|
+
const { mousePoint, container } = this.instance.getMousePointer();
|
|
22357
|
+
this.clickPoint = mousePoint;
|
|
22358
|
+
this.container = container;
|
|
22359
|
+
this.starId = v4_default();
|
|
22360
|
+
const nodeHandler = this.instance.getNodeHandler("star");
|
|
22361
|
+
const node = nodeHandler.create(this.starId, {
|
|
22362
|
+
...this.props,
|
|
22363
|
+
strokeScaleEnabled: true,
|
|
22364
|
+
x: this.clickPoint?.x ?? 0,
|
|
22365
|
+
y: this.clickPoint?.y ?? 0,
|
|
22366
|
+
numPoints: 5,
|
|
22367
|
+
innerRadius: 0,
|
|
22368
|
+
outerRadius: 0
|
|
22369
|
+
});
|
|
22370
|
+
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
22371
|
+
this.setState(STAR_TOOL_STATE.DEFINING_SIZE);
|
|
22372
|
+
}
|
|
22373
|
+
handleSettingSize() {
|
|
22374
|
+
const star = this.instance.getStage().findOne(`#${this.starId}`);
|
|
22375
|
+
if (this.starId && this.clickPoint && this.container && star) {
|
|
22376
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
|
|
22377
|
+
const nodeHandler = this.instance.getNodeHandler("star");
|
|
22378
|
+
const starPos = {
|
|
22379
|
+
x: this.clickPoint.x,
|
|
22380
|
+
y: this.clickPoint.y
|
|
22381
|
+
};
|
|
22382
|
+
let starOuterRadius = this.props.outerRadius;
|
|
22383
|
+
let starInnerRadius = this.props.innerRadius;
|
|
22384
|
+
if (this.moved) {
|
|
22385
|
+
starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
|
|
22386
|
+
starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
|
|
22387
|
+
starOuterRadius = Math.abs(this.clickPoint.x - mousePoint.x);
|
|
22388
|
+
starInnerRadius = Math.abs(this.clickPoint.y - mousePoint.y);
|
|
22389
|
+
}
|
|
22390
|
+
star.setAttrs({
|
|
22391
|
+
...this.props,
|
|
22392
|
+
x: starPos.x + starOuterRadius / 2,
|
|
22393
|
+
y: starPos.y + starOuterRadius / 2,
|
|
22394
|
+
outerRadius: starOuterRadius,
|
|
22395
|
+
innerRadius: starInnerRadius
|
|
22396
|
+
});
|
|
22397
|
+
this.instance.updateNode(nodeHandler.serialize(star));
|
|
22398
|
+
}
|
|
22399
|
+
this.cancelAction();
|
|
22400
|
+
}
|
|
22401
|
+
handleMovement() {
|
|
22402
|
+
if (this.state !== STAR_TOOL_STATE.DEFINING_SIZE) return;
|
|
22403
|
+
const star = this.instance.getStage().findOne(`#${this.starId}`);
|
|
22404
|
+
if (this.starId && this.container && this.clickPoint && star) {
|
|
22405
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.container);
|
|
22406
|
+
const deltaX = Math.abs(mousePoint.x - this.clickPoint?.x);
|
|
22407
|
+
const deltaY = Math.abs(mousePoint.y - this.clickPoint?.y);
|
|
22408
|
+
const nodeHandler = this.instance.getNodeHandler("star");
|
|
22409
|
+
const starPos = {
|
|
22410
|
+
x: this.clickPoint.x,
|
|
22411
|
+
y: this.clickPoint.y
|
|
22412
|
+
};
|
|
22413
|
+
if (this.moved) {
|
|
22414
|
+
starPos.x = Math.min(this.clickPoint.x, mousePoint.x);
|
|
22415
|
+
starPos.y = Math.min(this.clickPoint.y, mousePoint.y);
|
|
22416
|
+
}
|
|
22417
|
+
star.setAttrs({
|
|
22418
|
+
x: starPos.x + deltaX / 2,
|
|
22419
|
+
y: starPos.y + deltaX / 2,
|
|
22420
|
+
outerRadius: deltaX,
|
|
22421
|
+
innerRadius: deltaY
|
|
22422
|
+
});
|
|
22423
|
+
this.instance.updateNode(nodeHandler.serialize(star));
|
|
22424
|
+
}
|
|
22425
|
+
}
|
|
22426
|
+
trigger(cancelAction) {
|
|
22427
|
+
if (!this.instance) throw new Error("Instance not defined");
|
|
22428
|
+
if (!this.initialized) this.setupEvents();
|
|
22429
|
+
const stage = this.instance.getStage();
|
|
22430
|
+
stage.container().tabIndex = 1;
|
|
22431
|
+
stage.container().focus();
|
|
22432
|
+
this.cancelAction = cancelAction;
|
|
22433
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
22434
|
+
if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
|
|
22435
|
+
this.props = this.initProps();
|
|
22436
|
+
this.addStar();
|
|
22437
|
+
}
|
|
22438
|
+
cleanup() {
|
|
22439
|
+
const stage = this.instance.getStage();
|
|
22440
|
+
stage.container().style.cursor = "default";
|
|
22441
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
22442
|
+
if (selectionPlugin) {
|
|
22443
|
+
const node = stage.findOne(`#${this.starId}`);
|
|
22444
|
+
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
22445
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
22446
|
+
}
|
|
22447
|
+
this.starId = null;
|
|
22448
|
+
this.creating = false;
|
|
22449
|
+
this.moved = false;
|
|
22450
|
+
this.container = void 0;
|
|
22451
|
+
this.clickPoint = null;
|
|
22452
|
+
this.setState(STAR_TOOL_STATE.IDLE);
|
|
22453
|
+
}
|
|
22454
|
+
};
|
|
22455
|
+
|
|
22456
|
+
//#endregion
|
|
22457
|
+
//#region src/actions/arrow-tool/constants.ts
|
|
22458
|
+
const ARROW_TOOL_ACTION_NAME = "arrowTool";
|
|
22459
|
+
const ARROW_TOOL_STATE = {
|
|
22460
|
+
["IDLE"]: "idle",
|
|
22461
|
+
["ADDING"]: "adding",
|
|
22462
|
+
["DEFINING_SIZE"]: "definingSize",
|
|
22463
|
+
["ADDED"]: "added"
|
|
22464
|
+
};
|
|
22465
|
+
|
|
22466
|
+
//#endregion
|
|
22467
|
+
//#region src/actions/arrow-tool/arrow-tool.ts
|
|
22468
|
+
var WeaveArrowToolAction = class extends WeaveAction {
|
|
22469
|
+
initialized = false;
|
|
22470
|
+
initialCursor = null;
|
|
22471
|
+
onPropsChange = void 0;
|
|
22472
|
+
onInit = void 0;
|
|
22473
|
+
constructor() {
|
|
22474
|
+
super();
|
|
22475
|
+
this.initialized = false;
|
|
22476
|
+
this.state = ARROW_TOOL_STATE.IDLE;
|
|
22477
|
+
this.arrowId = null;
|
|
22478
|
+
this.tempArrowId = null;
|
|
22479
|
+
this.container = void 0;
|
|
22480
|
+
this.measureContainer = void 0;
|
|
22481
|
+
this.clickPoint = null;
|
|
22482
|
+
this.tempPoint = void 0;
|
|
22483
|
+
this.tempNextPoint = void 0;
|
|
22484
|
+
this.props = this.initProps();
|
|
22485
|
+
}
|
|
22486
|
+
getName() {
|
|
22487
|
+
return ARROW_TOOL_ACTION_NAME;
|
|
22488
|
+
}
|
|
22489
|
+
initProps() {
|
|
22490
|
+
return {
|
|
22491
|
+
fill: "#000000ff",
|
|
22492
|
+
stroke: "#000000ff",
|
|
22493
|
+
strokeWidth: 1,
|
|
22494
|
+
opacity: 1,
|
|
22495
|
+
pointerLength: 10,
|
|
22496
|
+
pointerWidth: 10,
|
|
22497
|
+
pointerAtBeginning: false,
|
|
22498
|
+
pointerAtEnding: true
|
|
22499
|
+
};
|
|
22500
|
+
}
|
|
22501
|
+
setupEvents() {
|
|
22502
|
+
const stage = this.instance.getStage();
|
|
22503
|
+
stage.container().addEventListener("keydown", (e) => {
|
|
22504
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
|
|
22505
|
+
this.cancelAction();
|
|
22506
|
+
return;
|
|
22507
|
+
}
|
|
22508
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === ARROW_TOOL_ACTION_NAME) {
|
|
22509
|
+
this.cancelAction();
|
|
22510
|
+
return;
|
|
22511
|
+
}
|
|
22512
|
+
});
|
|
22513
|
+
stage.on("dblclick dbltap", (e) => {
|
|
22514
|
+
e.evt.preventDefault();
|
|
22515
|
+
this.cancelAction();
|
|
22516
|
+
});
|
|
22517
|
+
stage.on("click tap", (e) => {
|
|
22518
|
+
e.evt.preventDefault();
|
|
22519
|
+
if (this.state === ARROW_TOOL_STATE.IDLE) return;
|
|
22520
|
+
if (this.state === ARROW_TOOL_STATE.ADDING) {
|
|
22521
|
+
this.handleAdding();
|
|
22522
|
+
return;
|
|
22523
|
+
}
|
|
22524
|
+
if (this.state === ARROW_TOOL_STATE.DEFINING_SIZE) {
|
|
22525
|
+
this.handleSettingSize();
|
|
22526
|
+
return;
|
|
22527
|
+
}
|
|
22528
|
+
});
|
|
22529
|
+
stage.on("mousemove touchmove", (e) => {
|
|
22530
|
+
e.evt.preventDefault();
|
|
22531
|
+
this.handleMovement();
|
|
22532
|
+
});
|
|
22533
|
+
this.initialized = true;
|
|
22534
|
+
}
|
|
22535
|
+
setState(state) {
|
|
22536
|
+
this.state = state;
|
|
22537
|
+
}
|
|
22538
|
+
addArrow() {
|
|
22539
|
+
const stage = this.instance.getStage();
|
|
22540
|
+
stage.container().style.cursor = "crosshair";
|
|
22541
|
+
this.tempPoint = void 0;
|
|
22542
|
+
this.tempNextPoint = void 0;
|
|
22543
|
+
this.clickPoint = null;
|
|
22544
|
+
this.setState(ARROW_TOOL_STATE.ADDING);
|
|
22545
|
+
}
|
|
22546
|
+
handleAdding() {
|
|
22547
|
+
const stage = this.instance.getStage();
|
|
22548
|
+
const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
|
|
22549
|
+
this.clickPoint = mousePoint;
|
|
22550
|
+
this.container = container;
|
|
22551
|
+
this.measureContainer = measureContainer;
|
|
22552
|
+
this.arrowId = v4_default();
|
|
22553
|
+
this.tempArrowId = v4_default();
|
|
22554
|
+
const nodeHandler = this.instance.getNodeHandler("arrow");
|
|
22555
|
+
const lineNodeHandler = this.instance.getNodeHandler("line");
|
|
22556
|
+
const node = lineNodeHandler.create(this.arrowId, {
|
|
22557
|
+
...this.props,
|
|
22558
|
+
strokeScaleEnabled: true,
|
|
22559
|
+
x: this.clickPoint?.x ?? 0,
|
|
22560
|
+
y: this.clickPoint?.y ?? 0,
|
|
22561
|
+
points: [0, 0]
|
|
22562
|
+
});
|
|
22563
|
+
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
22564
|
+
this.tempPoint = new konva.default.Circle({
|
|
22565
|
+
x: this.clickPoint?.x ?? 0,
|
|
22566
|
+
y: this.clickPoint?.y ?? 0,
|
|
22567
|
+
radius: 5 / stage.scaleX(),
|
|
22568
|
+
strokeScaleEnabled: true,
|
|
22569
|
+
stroke: "#cccccc",
|
|
22570
|
+
strokeWidth: 0,
|
|
22571
|
+
fill: "#cccccc"
|
|
22572
|
+
});
|
|
22573
|
+
this.measureContainer?.add(this.tempPoint);
|
|
22574
|
+
const tempArrow = nodeHandler.create(this.tempArrowId, {
|
|
22575
|
+
...this.props,
|
|
22576
|
+
x: this.clickPoint?.x ?? 0,
|
|
22577
|
+
y: this.clickPoint?.y ?? 0,
|
|
22578
|
+
strokeScaleEnabled: true,
|
|
22579
|
+
points: [0, 0]
|
|
22580
|
+
});
|
|
22581
|
+
this.instance.addNode(tempArrow, this.container?.getAttrs().id);
|
|
22582
|
+
this.tempNextPoint = new konva.default.Circle({
|
|
22583
|
+
x: this.clickPoint?.x ?? 0,
|
|
22584
|
+
y: this.clickPoint?.y ?? 0,
|
|
22585
|
+
radius: 5 / stage.scaleX(),
|
|
22586
|
+
strokeScaleEnabled: true,
|
|
22587
|
+
stroke: "#cccccc",
|
|
22588
|
+
strokeWidth: 0,
|
|
22589
|
+
fill: "#cccccc"
|
|
22590
|
+
});
|
|
22591
|
+
this.measureContainer?.add(this.tempNextPoint);
|
|
22592
|
+
this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
|
|
22593
|
+
}
|
|
22594
|
+
handleSettingSize() {
|
|
22595
|
+
const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
|
|
22596
|
+
const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
|
|
22597
|
+
if (this.arrowId && this.tempPoint && this.tempNextPoint && this.measureContainer && tempMainArrow && tempArrow) {
|
|
22598
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
|
|
22599
|
+
const newPoints = [...tempMainArrow.points()];
|
|
22600
|
+
newPoints.push(mousePoint.x - tempMainArrow.x());
|
|
22601
|
+
newPoints.push(mousePoint.y - tempMainArrow.y());
|
|
22602
|
+
tempMainArrow.setAttrs({
|
|
22603
|
+
...this.props,
|
|
22604
|
+
points: newPoints
|
|
22605
|
+
});
|
|
22606
|
+
const nodeHandler = this.instance.getNodeHandler("arrow");
|
|
22607
|
+
const lineNodeHandler = this.instance.getNodeHandler("line");
|
|
22608
|
+
this.instance.updateNode(lineNodeHandler.serialize(tempMainArrow));
|
|
22609
|
+
this.tempPoint.setAttrs({
|
|
22610
|
+
x: mousePoint.x,
|
|
22611
|
+
y: mousePoint.y
|
|
22612
|
+
});
|
|
22613
|
+
this.tempNextPoint.setAttrs({
|
|
22614
|
+
x: mousePoint.x,
|
|
22615
|
+
y: mousePoint.y
|
|
22616
|
+
});
|
|
22617
|
+
tempArrow.setAttrs({
|
|
22618
|
+
...this.props,
|
|
22619
|
+
x: mousePoint.x,
|
|
22620
|
+
y: mousePoint.y,
|
|
22621
|
+
points: [0, 0]
|
|
22622
|
+
});
|
|
22623
|
+
this.instance.updateNode(nodeHandler.serialize(tempArrow));
|
|
22624
|
+
}
|
|
22625
|
+
this.setState(ARROW_TOOL_STATE.DEFINING_SIZE);
|
|
22626
|
+
}
|
|
22627
|
+
handleMovement() {
|
|
22628
|
+
if (this.state !== ARROW_TOOL_STATE.DEFINING_SIZE) return;
|
|
22629
|
+
const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
|
|
22630
|
+
if (this.arrowId && this.measureContainer && this.tempNextPoint && tempArrow) {
|
|
22631
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
|
|
22632
|
+
tempArrow.setAttrs({
|
|
22633
|
+
...this.props,
|
|
22634
|
+
points: [
|
|
22635
|
+
tempArrow.points()[0],
|
|
22636
|
+
tempArrow.points()[1],
|
|
22637
|
+
mousePoint.x - tempArrow.x(),
|
|
22638
|
+
mousePoint.y - tempArrow.y()
|
|
22639
|
+
]
|
|
22640
|
+
});
|
|
22641
|
+
const nodeHandler = this.instance.getNodeHandler("arrow");
|
|
22642
|
+
this.instance.updateNode(nodeHandler.serialize(tempArrow));
|
|
22643
|
+
this.tempNextPoint.setAttrs({
|
|
22644
|
+
x: mousePoint.x,
|
|
22645
|
+
y: mousePoint.y
|
|
22646
|
+
});
|
|
22647
|
+
}
|
|
22648
|
+
}
|
|
22649
|
+
trigger(cancelAction) {
|
|
22650
|
+
if (!this.instance) throw new Error("Instance not defined");
|
|
22651
|
+
if (!this.initialized) this.setupEvents();
|
|
22652
|
+
const stage = this.instance.getStage();
|
|
22653
|
+
stage.container().tabIndex = 1;
|
|
22654
|
+
stage.container().focus();
|
|
22655
|
+
this.cancelAction = cancelAction;
|
|
22656
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
22657
|
+
if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
|
|
22658
|
+
this.props = this.initProps();
|
|
22659
|
+
this.addArrow();
|
|
22660
|
+
}
|
|
22661
|
+
cleanup() {
|
|
22662
|
+
const stage = this.instance.getStage();
|
|
22663
|
+
this.tempPoint?.destroy();
|
|
22664
|
+
this.tempNextPoint?.destroy();
|
|
22665
|
+
const tempArrow = this.instance.getStage().findOne(`#${this.tempArrowId}`);
|
|
22666
|
+
const tempMainArrow = this.instance.getStage().findOne(`#${this.arrowId}`);
|
|
22667
|
+
if (tempArrow) {
|
|
22668
|
+
const nodeHandler = this.instance.getNodeHandler("arrow");
|
|
22669
|
+
this.instance.removeNode(nodeHandler.serialize(tempArrow));
|
|
22670
|
+
}
|
|
22671
|
+
if (this.arrowId && tempMainArrow && tempMainArrow.points().length < 4) {
|
|
22672
|
+
const nodeHandler = this.instance.getNodeHandler("line");
|
|
22673
|
+
this.instance.removeNode(nodeHandler.serialize(tempMainArrow));
|
|
22674
|
+
}
|
|
22675
|
+
if (this.arrowId && tempMainArrow && tempMainArrow.points().length >= 4) {
|
|
22676
|
+
const nodeHandler = this.instance.getNodeHandler("arrow");
|
|
22677
|
+
const lineNodeHandler = this.instance.getNodeHandler("line");
|
|
22678
|
+
const finalArrow = nodeHandler.create(this.arrowId, {
|
|
22679
|
+
...tempMainArrow.getAttrs(),
|
|
22680
|
+
...this.props,
|
|
22681
|
+
strokeScaleEnabled: true,
|
|
22682
|
+
strokeWidth: 1,
|
|
22683
|
+
hitStrokeWidth: 16
|
|
22684
|
+
});
|
|
22685
|
+
this.instance.removeNode(lineNodeHandler.serialize(tempMainArrow));
|
|
22686
|
+
this.instance.addNode(finalArrow, this.container?.getAttrs().id);
|
|
22687
|
+
}
|
|
22688
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
22689
|
+
if (selectionPlugin) {
|
|
22690
|
+
const node = stage.findOne(`#${this.arrowId}`);
|
|
22691
|
+
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
22692
|
+
this.instance.triggerAction("selectionTool");
|
|
22693
|
+
}
|
|
22694
|
+
stage.container().style.cursor = "default";
|
|
22695
|
+
this.initialCursor = null;
|
|
22696
|
+
this.tempPoint = void 0;
|
|
22697
|
+
this.tempNextPoint = void 0;
|
|
22698
|
+
this.arrowId = null;
|
|
22699
|
+
this.tempArrowId = null;
|
|
22700
|
+
this.container = void 0;
|
|
22701
|
+
this.clickPoint = null;
|
|
22702
|
+
this.setState(ARROW_TOOL_STATE.IDLE);
|
|
22703
|
+
}
|
|
22704
|
+
};
|
|
22705
|
+
|
|
21781
22706
|
//#endregion
|
|
21782
22707
|
//#region src/actions/frame-tool/constants.ts
|
|
21783
22708
|
const FRAME_TOOL_ACTION_NAME = "frameTool";
|
|
@@ -23214,9 +24139,13 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
23214
24139
|
};
|
|
23215
24140
|
|
|
23216
24141
|
//#endregion
|
|
24142
|
+
exports.ARROW_TOOL_ACTION_NAME = ARROW_TOOL_ACTION_NAME
|
|
24143
|
+
exports.ARROW_TOOL_STATE = ARROW_TOOL_STATE
|
|
23217
24144
|
exports.BRUSH_TOOL_ACTION_NAME = BRUSH_TOOL_ACTION_NAME
|
|
23218
24145
|
exports.BRUSH_TOOL_STATE = BRUSH_TOOL_STATE
|
|
23219
24146
|
exports.COPY_PASTE_NODES_PLUGIN_STATE = COPY_PASTE_NODES_PLUGIN_STATE
|
|
24147
|
+
exports.ELLIPSE_TOOL_ACTION_NAME = ELLIPSE_TOOL_ACTION_NAME
|
|
24148
|
+
exports.ELLIPSE_TOOL_STATE = ELLIPSE_TOOL_STATE
|
|
23220
24149
|
exports.ERASER_TOOL_ACTION_NAME = ERASER_TOOL_ACTION_NAME
|
|
23221
24150
|
exports.ERASER_TOOL_STATE = ERASER_TOOL_STATE
|
|
23222
24151
|
exports.FRAME_TOOL_ACTION_NAME = FRAME_TOOL_ACTION_NAME
|
|
@@ -23237,11 +24166,15 @@ exports.RECTANGLE_TOOL_ACTION_NAME = RECTANGLE_TOOL_ACTION_NAME
|
|
|
23237
24166
|
exports.RECTANGLE_TOOL_STATE = RECTANGLE_TOOL_STATE
|
|
23238
24167
|
exports.SELECTION_TOOL_ACTION_NAME = SELECTION_TOOL_ACTION_NAME
|
|
23239
24168
|
exports.SELECTION_TOOL_STATE = SELECTION_TOOL_STATE
|
|
24169
|
+
exports.STAR_TOOL_ACTION_NAME = STAR_TOOL_ACTION_NAME
|
|
24170
|
+
exports.STAR_TOOL_STATE = STAR_TOOL_STATE
|
|
23240
24171
|
exports.TEXT_LAYOUT = TEXT_LAYOUT
|
|
23241
24172
|
exports.TEXT_TOOL_ACTION_NAME = TEXT_TOOL_ACTION_NAME
|
|
23242
24173
|
exports.TEXT_TOOL_STATE = TEXT_TOOL_STATE
|
|
24174
|
+
exports.WEAVE_ARROW_NODE_TYPE = WEAVE_ARROW_NODE_TYPE
|
|
23243
24175
|
exports.WEAVE_COPY_PASTE_NODES_KEY = WEAVE_COPY_PASTE_NODES_KEY
|
|
23244
24176
|
exports.WEAVE_DEFAULT_USER_INFO_FUNCTION = WEAVE_DEFAULT_USER_INFO_FUNCTION
|
|
24177
|
+
exports.WEAVE_ELLIPSE_NODE_TYPE = WEAVE_ELLIPSE_NODE_TYPE
|
|
23245
24178
|
exports.WEAVE_FRAME_NODE_DEFAULT_CONFIG = WEAVE_FRAME_NODE_DEFAULT_CONFIG
|
|
23246
24179
|
exports.WEAVE_FRAME_NODE_DEFAULT_PROPS = WEAVE_FRAME_NODE_DEFAULT_PROPS
|
|
23247
24180
|
exports.WEAVE_FRAME_NODE_SIZES = WEAVE_FRAME_NODE_SIZES
|
|
@@ -23255,10 +24188,18 @@ exports.WEAVE_GRID_DEFAULT_SIZE = WEAVE_GRID_DEFAULT_SIZE
|
|
|
23255
24188
|
exports.WEAVE_GRID_DEFAULT_TYPE = WEAVE_GRID_DEFAULT_TYPE
|
|
23256
24189
|
exports.WEAVE_GRID_LAYER_ID = WEAVE_GRID_LAYER_ID
|
|
23257
24190
|
exports.WEAVE_GRID_TYPES = WEAVE_GRID_TYPES
|
|
24191
|
+
exports.WEAVE_GROUP_NODE_TYPE = WEAVE_GROUP_NODE_TYPE
|
|
24192
|
+
exports.WEAVE_IMAGE_NODE_TYPE = WEAVE_IMAGE_NODE_TYPE
|
|
24193
|
+
exports.WEAVE_LAYER_NODE_TYPE = WEAVE_LAYER_NODE_TYPE
|
|
24194
|
+
exports.WEAVE_LINE_NODE_TYPE = WEAVE_LINE_NODE_TYPE
|
|
23258
24195
|
exports.WEAVE_NODES_SELECTION_KEY = WEAVE_NODES_SELECTION_KEY
|
|
23259
24196
|
exports.WEAVE_NODES_SELECTION_LAYER_ID = WEAVE_NODES_SELECTION_LAYER_ID
|
|
23260
24197
|
exports.WEAVE_NODES_SNAPPING_KEY = WEAVE_NODES_SNAPPING_KEY
|
|
24198
|
+
exports.WEAVE_RECTANGLE_NODE_TYPE = WEAVE_RECTANGLE_NODE_TYPE
|
|
23261
24199
|
exports.WEAVE_STAGE_GRID_KEY = WEAVE_STAGE_GRID_KEY
|
|
24200
|
+
exports.WEAVE_STAGE_NODE_TYPE = WEAVE_STAGE_NODE_TYPE
|
|
24201
|
+
exports.WEAVE_STAR_NODE_TYPE = WEAVE_STAR_NODE_TYPE
|
|
24202
|
+
exports.WEAVE_TEXT_NODE_TYPE = WEAVE_TEXT_NODE_TYPE
|
|
23262
24203
|
exports.WEAVE_USERS_POINTERS_KEY = WEAVE_USERS_POINTERS_KEY
|
|
23263
24204
|
exports.WEAVE_USERS_SELECTION_KEY = WEAVE_USERS_SELECTION_KEY
|
|
23264
24205
|
exports.WEAVE_USER_POINTERS_DEFAULT_PROPS = WEAVE_USER_POINTERS_DEFAULT_PROPS
|
|
@@ -23266,10 +24207,14 @@ exports.WEAVE_USER_POINTER_KEY = WEAVE_USER_POINTER_KEY
|
|
|
23266
24207
|
exports.WEAVE_USER_SELECTION_KEY = WEAVE_USER_SELECTION_KEY
|
|
23267
24208
|
exports.Weave = Weave
|
|
23268
24209
|
exports.WeaveAction = WeaveAction
|
|
24210
|
+
exports.WeaveArrowNode = WeaveArrowNode
|
|
24211
|
+
exports.WeaveArrowToolAction = WeaveArrowToolAction
|
|
23269
24212
|
exports.WeaveBrushToolAction = WeaveBrushToolAction
|
|
23270
24213
|
exports.WeaveConnectedUsersPlugin = WeaveConnectedUsersPlugin
|
|
23271
24214
|
exports.WeaveContextMenuPlugin = WeaveContextMenuPlugin
|
|
23272
24215
|
exports.WeaveCopyPasteNodesPlugin = WeaveCopyPasteNodesPlugin
|
|
24216
|
+
exports.WeaveEllipseNode = WeaveEllipseNode
|
|
24217
|
+
exports.WeaveEllipseToolAction = WeaveEllipseToolAction
|
|
23273
24218
|
exports.WeaveEraserToolAction = WeaveEraserToolAction
|
|
23274
24219
|
exports.WeaveExportNodeToolAction = WeaveExportNodeToolAction
|
|
23275
24220
|
exports.WeaveExportStageToolAction = WeaveExportStageToolAction
|
|
@@ -23297,6 +24242,8 @@ exports.WeaveStageNode = WeaveStageNode
|
|
|
23297
24242
|
exports.WeaveStagePanningPlugin = WeaveStagePanningPlugin
|
|
23298
24243
|
exports.WeaveStageResizePlugin = WeaveStageResizePlugin
|
|
23299
24244
|
exports.WeaveStageZoomPlugin = WeaveStageZoomPlugin
|
|
24245
|
+
exports.WeaveStarNode = WeaveStarNode
|
|
24246
|
+
exports.WeaveStarToolAction = WeaveStarToolAction
|
|
23300
24247
|
exports.WeaveStore = WeaveStore
|
|
23301
24248
|
exports.WeaveTextNode = WeaveTextNode
|
|
23302
24249
|
exports.WeaveTextToolAction = WeaveTextToolAction
|