@inditextech/weave-sdk 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.cjs +93 -65
- package/dist/sdk.d.cts +6 -1
- package/dist/sdk.d.ts +6 -1
- package/dist/sdk.js +90 -66
- package/package.json +2 -2
package/dist/sdk.cjs
CHANGED
|
@@ -16277,12 +16277,22 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
|
|
|
16277
16277
|
setState(state) {
|
|
16278
16278
|
this.state = state;
|
|
16279
16279
|
}
|
|
16280
|
+
recursivelyUpdateKeys(nodes) {
|
|
16281
|
+
for (const child of nodes) {
|
|
16282
|
+
const newNodeId = v4_default();
|
|
16283
|
+
child.key = newNodeId;
|
|
16284
|
+
child.props.id = newNodeId;
|
|
16285
|
+
if (child.props.children) this.recursivelyUpdateKeys(child.props.children);
|
|
16286
|
+
}
|
|
16287
|
+
}
|
|
16280
16288
|
handlePaste() {
|
|
16281
16289
|
if (this.toPaste) {
|
|
16282
16290
|
const { mousePoint, container } = this.instance.getMousePointer();
|
|
16283
16291
|
for (const element of Object.keys(this.toPaste.weave)) {
|
|
16284
16292
|
const node = this.toPaste.weave[element];
|
|
16293
|
+
if (node.props.children) this.recursivelyUpdateKeys(node.props.children);
|
|
16285
16294
|
const newNodeId = v4_default();
|
|
16295
|
+
delete node.props.containerId;
|
|
16286
16296
|
node.key = newNodeId;
|
|
16287
16297
|
node.props.id = newNodeId;
|
|
16288
16298
|
node.props.x = mousePoint.x + (node.props.x - this.toPaste.weaveMinPoint.x);
|
|
@@ -17903,7 +17913,7 @@ var WeaveRegisterManager = class {
|
|
|
17903
17913
|
|
|
17904
17914
|
//#endregion
|
|
17905
17915
|
//#region package.json
|
|
17906
|
-
var version = "0.14.
|
|
17916
|
+
var version = "0.14.2";
|
|
17907
17917
|
|
|
17908
17918
|
//#endregion
|
|
17909
17919
|
//#region src/managers/setup.ts
|
|
@@ -18681,6 +18691,14 @@ var WeaveLineNode = class extends WeaveNode {
|
|
|
18681
18691
|
//#region src/nodes/text/constants.ts
|
|
18682
18692
|
const WEAVE_TEXT_NODE_TYPE = "text";
|
|
18683
18693
|
|
|
18694
|
+
//#endregion
|
|
18695
|
+
//#region src/actions/selection-tool/constants.ts
|
|
18696
|
+
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
18697
|
+
const SELECTION_TOOL_STATE = {
|
|
18698
|
+
["IDLE"]: "idle",
|
|
18699
|
+
["SELECTING"]: "selection"
|
|
18700
|
+
};
|
|
18701
|
+
|
|
18684
18702
|
//#endregion
|
|
18685
18703
|
//#region src/nodes/text/text.ts
|
|
18686
18704
|
var WeaveTextNode = class extends WeaveNode {
|
|
@@ -18703,13 +18721,14 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18703
18721
|
});
|
|
18704
18722
|
this.setupDefaultNodeEvents(text);
|
|
18705
18723
|
window.addEventListener("keypress", (e) => {
|
|
18706
|
-
if (this.editing)
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18724
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === SELECTION_TOOL_ACTION_NAME && !this.editing) {
|
|
18725
|
+
e.preventDefault();
|
|
18726
|
+
if (this.isSelecting() && this.isNodeSelected(text)) {
|
|
18727
|
+
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
18728
|
+
if (nodesSelectionPlugin && nodesSelectionPlugin.getSelectedNodes().length === 1 && nodesSelectionPlugin.getSelectedNodes()[0].getAttrs().nodeType === WEAVE_TEXT_NODE_TYPE && !window.weaveTextEditing[nodesSelectionPlugin.getSelectedNodes()[0].id()]) {
|
|
18729
|
+
e.preventDefault();
|
|
18730
|
+
this.triggerEditMode(nodesSelectionPlugin.getSelectedNodes()[0]);
|
|
18731
|
+
}
|
|
18713
18732
|
}
|
|
18714
18733
|
}
|
|
18715
18734
|
});
|
|
@@ -18823,9 +18842,6 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18823
18842
|
textArea.style.height = "auto";
|
|
18824
18843
|
textArea.style.height = textArea.scrollHeight + 1.6 * textNode.getAbsoluteScale().x + "px";
|
|
18825
18844
|
};
|
|
18826
|
-
textArea.onwheel = (e) => {
|
|
18827
|
-
e.preventDefault();
|
|
18828
|
-
};
|
|
18829
18845
|
textArea.oninput = () => {
|
|
18830
18846
|
textArea.style.height = "auto";
|
|
18831
18847
|
textArea.style.height = textArea.scrollHeight + 1.6 * textNode.getAbsoluteScale().x + "px";
|
|
@@ -18834,36 +18850,22 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18834
18850
|
let transform = "";
|
|
18835
18851
|
if (rotation) transform += "rotateZ(" + rotation + "deg)";
|
|
18836
18852
|
const px = 0;
|
|
18837
|
-
const py = -3 *
|
|
18853
|
+
const py = -3 * stage.scaleY();
|
|
18838
18854
|
transform += "translateX(" + px + "px)";
|
|
18839
18855
|
transform += "translateY(" + py + "px)";
|
|
18840
18856
|
textArea.style.transform = transform;
|
|
18841
18857
|
const handleKeyDown = (e) => {
|
|
18842
|
-
|
|
18843
|
-
|
|
18844
|
-
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
}
|
|
18854
|
-
return;
|
|
18855
|
-
}
|
|
18856
|
-
if (e.key === "Escape") {
|
|
18857
|
-
textNode.width(parseFloat(textArea.style.width) * (1 / textNode.getAbsoluteScale().x));
|
|
18858
|
-
textNode.height((textArea.scrollHeight + 1.6) * (1 / textNode.getAbsoluteScale().x));
|
|
18859
|
-
textNode.text(textArea.value);
|
|
18860
|
-
this.updateNode(textNode);
|
|
18861
|
-
this.removeTextAreaDOM(textNode);
|
|
18862
|
-
this.instance.removeEventListener("onZoomChange", this.onZoomChangeHandler(textNode).bind(this));
|
|
18863
|
-
this.instance.removeEventListener("onStageMove", this.onStageMoveHandler(textNode).bind(this));
|
|
18864
|
-
window.removeEventListener("click", handleOutsideClick);
|
|
18865
|
-
return;
|
|
18866
|
-
}
|
|
18858
|
+
e.stopPropagation();
|
|
18859
|
+
if (textArea && textNode && e.key === "Escape") {
|
|
18860
|
+
textNode.width(parseFloat(textArea.style.width) * (1 / textNode.getAbsoluteScale().x));
|
|
18861
|
+
textNode.height((textArea.scrollHeight + 1.6) * (1 / textNode.getAbsoluteScale().x));
|
|
18862
|
+
textNode.text(textArea.value);
|
|
18863
|
+
this.updateNode(textNode);
|
|
18864
|
+
this.removeTextAreaDOM(textNode);
|
|
18865
|
+
this.instance.removeEventListener("onZoomChange", this.onZoomChangeHandler(textNode).bind(this));
|
|
18866
|
+
this.instance.removeEventListener("onStageMove", this.onStageMoveHandler(textNode).bind(this));
|
|
18867
|
+
window.removeEventListener("click", handleOutsideClick);
|
|
18868
|
+
return;
|
|
18867
18869
|
}
|
|
18868
18870
|
};
|
|
18869
18871
|
const handleKeyUp = () => {
|
|
@@ -18945,6 +18947,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18945
18947
|
|
|
18946
18948
|
//#endregion
|
|
18947
18949
|
//#region src/actions/image-tool/constants.ts
|
|
18950
|
+
const IMAGE_TOOL_ACTION_NAME = "imageTool";
|
|
18948
18951
|
const IMAGE_TOOL_STATE = {
|
|
18949
18952
|
["IDLE"]: "idle",
|
|
18950
18953
|
["UPLOADING"]: "uploading",
|
|
@@ -18971,7 +18974,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
18971
18974
|
this.clickPoint = null;
|
|
18972
18975
|
}
|
|
18973
18976
|
getName() {
|
|
18974
|
-
return
|
|
18977
|
+
return IMAGE_TOOL_ACTION_NAME;
|
|
18975
18978
|
}
|
|
18976
18979
|
getPreloadedImage(imageId) {
|
|
18977
18980
|
return this.preloadImgs?.[imageId];
|
|
@@ -18995,8 +18998,10 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
18995
18998
|
setupEvents() {
|
|
18996
18999
|
const stage = this.instance.getStage();
|
|
18997
19000
|
stage.container().addEventListener("keydown", (e) => {
|
|
18998
|
-
if (e.key === "Escape"
|
|
18999
|
-
|
|
19001
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === IMAGE_TOOL_ACTION_NAME) {
|
|
19002
|
+
this.cancelAction();
|
|
19003
|
+
return;
|
|
19004
|
+
}
|
|
19000
19005
|
});
|
|
19001
19006
|
stage.on("click tap", (e) => {
|
|
19002
19007
|
e.evt.preventDefault();
|
|
@@ -20005,12 +20010,16 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20005
20010
|
}
|
|
20006
20011
|
};
|
|
20007
20012
|
|
|
20013
|
+
//#endregion
|
|
20014
|
+
//#region src/actions/zoom-out-tool/constants.ts
|
|
20015
|
+
const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
|
|
20016
|
+
|
|
20008
20017
|
//#endregion
|
|
20009
20018
|
//#region src/actions/zoom-out-tool/zoom-out-tool.ts
|
|
20010
20019
|
var WeaveZoomOutToolAction = class extends WeaveAction {
|
|
20011
20020
|
onPropsChange = void 0;
|
|
20012
20021
|
getName() {
|
|
20013
|
-
return
|
|
20022
|
+
return ZOOM_OUT_TOOL_ACTION_NAME;
|
|
20014
20023
|
}
|
|
20015
20024
|
getStageZoomPlugin() {
|
|
20016
20025
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20034,12 +20043,16 @@ var WeaveZoomOutToolAction = class extends WeaveAction {
|
|
|
20034
20043
|
}
|
|
20035
20044
|
};
|
|
20036
20045
|
|
|
20046
|
+
//#endregion
|
|
20047
|
+
//#region src/actions/zoom-in-tool/constants.ts
|
|
20048
|
+
const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
|
|
20049
|
+
|
|
20037
20050
|
//#endregion
|
|
20038
20051
|
//#region src/actions/zoom-in-tool/zoom-in-tool.ts
|
|
20039
20052
|
var WeaveZoomInToolAction = class extends WeaveAction {
|
|
20040
20053
|
onPropsChange = void 0;
|
|
20041
20054
|
getName() {
|
|
20042
|
-
return
|
|
20055
|
+
return ZOOM_IN_TOOL_ACTION_NAME;
|
|
20043
20056
|
}
|
|
20044
20057
|
getStageZoomPlugin() {
|
|
20045
20058
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20063,12 +20076,16 @@ var WeaveZoomInToolAction = class extends WeaveAction {
|
|
|
20063
20076
|
}
|
|
20064
20077
|
};
|
|
20065
20078
|
|
|
20079
|
+
//#endregion
|
|
20080
|
+
//#region src/actions/fit-to-screen-tool/constants.ts
|
|
20081
|
+
const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
|
|
20082
|
+
|
|
20066
20083
|
//#endregion
|
|
20067
20084
|
//#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
|
|
20068
20085
|
var WeaveFitToScreenToolAction = class extends WeaveAction {
|
|
20069
20086
|
onPropsChange = void 0;
|
|
20070
20087
|
getName() {
|
|
20071
|
-
return
|
|
20088
|
+
return FIT_TO_SCREEN_TOOL_ACTION_NAME;
|
|
20072
20089
|
}
|
|
20073
20090
|
getStageZoomPlugin() {
|
|
20074
20091
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20091,12 +20108,16 @@ var WeaveFitToScreenToolAction = class extends WeaveAction {
|
|
|
20091
20108
|
}
|
|
20092
20109
|
};
|
|
20093
20110
|
|
|
20111
|
+
//#endregion
|
|
20112
|
+
//#region src/actions/fit-to-selection-tool/constants.ts
|
|
20113
|
+
const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
|
|
20114
|
+
|
|
20094
20115
|
//#endregion
|
|
20095
20116
|
//#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
|
|
20096
20117
|
var WeaveFitToSelectionToolAction = class extends WeaveAction {
|
|
20097
20118
|
onPropsChange = void 0;
|
|
20098
20119
|
getName() {
|
|
20099
|
-
return
|
|
20120
|
+
return FIT_TO_SELECTION_TOOL_ACTION_NAME;
|
|
20100
20121
|
}
|
|
20101
20122
|
getNodesSelectionPlugin() {
|
|
20102
20123
|
return this.instance.getPlugin("nodesSelection");
|
|
@@ -20180,14 +20201,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
|
|
|
20180
20201
|
}
|
|
20181
20202
|
};
|
|
20182
20203
|
|
|
20183
|
-
//#endregion
|
|
20184
|
-
//#region src/actions/selection-tool/constants.ts
|
|
20185
|
-
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
20186
|
-
const SELECTION_TOOL_STATE = {
|
|
20187
|
-
["IDLE"]: "idle",
|
|
20188
|
-
["SELECTING"]: "selection"
|
|
20189
|
-
};
|
|
20190
|
-
|
|
20191
20204
|
//#endregion
|
|
20192
20205
|
//#region src/actions/selection-tool/selection-tool.ts
|
|
20193
20206
|
var WeaveSelectionToolAction = class extends WeaveAction {
|
|
@@ -20285,11 +20298,11 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
20285
20298
|
setupEvents() {
|
|
20286
20299
|
const stage = this.instance.getStage();
|
|
20287
20300
|
stage.container().addEventListener("keydown", (e) => {
|
|
20288
|
-
if (e.key === "Enter") {
|
|
20301
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === RECTANGLE_TOOL_ACTION_NAME) {
|
|
20289
20302
|
this.cancelAction();
|
|
20290
20303
|
return;
|
|
20291
20304
|
}
|
|
20292
|
-
if (e.key === "Escape") {
|
|
20305
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === RECTANGLE_TOOL_ACTION_NAME) {
|
|
20293
20306
|
this.cancelAction();
|
|
20294
20307
|
return;
|
|
20295
20308
|
}
|
|
@@ -20419,6 +20432,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
20419
20432
|
|
|
20420
20433
|
//#endregion
|
|
20421
20434
|
//#region src/actions/pen-tool/constants.ts
|
|
20435
|
+
const PEN_TOOL_ACTION_NAME = "penTool";
|
|
20422
20436
|
const PEN_TOOL_STATE = {
|
|
20423
20437
|
["IDLE"]: "idle",
|
|
20424
20438
|
["ADDING"]: "adding",
|
|
@@ -20447,7 +20461,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20447
20461
|
this.props = this.initProps();
|
|
20448
20462
|
}
|
|
20449
20463
|
getName() {
|
|
20450
|
-
return
|
|
20464
|
+
return PEN_TOOL_ACTION_NAME;
|
|
20451
20465
|
}
|
|
20452
20466
|
initProps() {
|
|
20453
20467
|
return {
|
|
@@ -20459,11 +20473,11 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20459
20473
|
setupEvents() {
|
|
20460
20474
|
const stage = this.instance.getStage();
|
|
20461
20475
|
stage.container().addEventListener("keydown", (e) => {
|
|
20462
|
-
if (e.key === "Enter") {
|
|
20476
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === PEN_TOOL_ACTION_NAME) {
|
|
20463
20477
|
this.cancelAction();
|
|
20464
20478
|
return;
|
|
20465
20479
|
}
|
|
20466
|
-
if (e.key === "Escape") {
|
|
20480
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === PEN_TOOL_ACTION_NAME) {
|
|
20467
20481
|
this.cancelAction();
|
|
20468
20482
|
return;
|
|
20469
20483
|
}
|
|
@@ -20657,6 +20671,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20657
20671
|
|
|
20658
20672
|
//#endregion
|
|
20659
20673
|
//#region src/actions/brush-tool/constants.ts
|
|
20674
|
+
const BRUSH_TOOL_ACTION_NAME = "brushTool";
|
|
20660
20675
|
const BRUSH_TOOL_STATE = {
|
|
20661
20676
|
["INACTIVE"]: "inactive",
|
|
20662
20677
|
["IDLE"]: "idle",
|
|
@@ -20680,7 +20695,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20680
20695
|
this.props = this.initProps();
|
|
20681
20696
|
}
|
|
20682
20697
|
getName() {
|
|
20683
|
-
return
|
|
20698
|
+
return BRUSH_TOOL_ACTION_NAME;
|
|
20684
20699
|
}
|
|
20685
20700
|
initProps() {
|
|
20686
20701
|
return {
|
|
@@ -20694,11 +20709,11 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20694
20709
|
stage.container().tabIndex = 1;
|
|
20695
20710
|
stage.container().focus();
|
|
20696
20711
|
stage.container().addEventListener("keydown", (e) => {
|
|
20697
|
-
if (e.key === "Enter") {
|
|
20712
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
|
|
20698
20713
|
this.cancelAction();
|
|
20699
20714
|
return;
|
|
20700
20715
|
}
|
|
20701
|
-
if (e.key === "Escape") {
|
|
20716
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
|
|
20702
20717
|
this.cancelAction();
|
|
20703
20718
|
return;
|
|
20704
20719
|
}
|
|
@@ -20806,6 +20821,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20806
20821
|
|
|
20807
20822
|
//#endregion
|
|
20808
20823
|
//#region src/actions/text-tool/constants.ts
|
|
20824
|
+
const TEXT_TOOL_ACTION_NAME = "textTool";
|
|
20809
20825
|
const TEXT_TOOL_STATE = {
|
|
20810
20826
|
["IDLE"]: "idle",
|
|
20811
20827
|
["ADDING"]: "adding",
|
|
@@ -20828,12 +20844,12 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
20828
20844
|
this.clickPoint = null;
|
|
20829
20845
|
}
|
|
20830
20846
|
getName() {
|
|
20831
|
-
return
|
|
20847
|
+
return TEXT_TOOL_ACTION_NAME;
|
|
20832
20848
|
}
|
|
20833
20849
|
setupEvents() {
|
|
20834
20850
|
const stage = this.instance.getStage();
|
|
20835
20851
|
stage.container().addEventListener("keydown", (e) => {
|
|
20836
|
-
if (e.key === "Escape") {
|
|
20852
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === TEXT_TOOL_ACTION_NAME) {
|
|
20837
20853
|
this.cancelAction();
|
|
20838
20854
|
return;
|
|
20839
20855
|
}
|
|
@@ -20955,7 +20971,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
|
|
|
20955
20971
|
setupEvents() {
|
|
20956
20972
|
const stage = this.instance.getStage();
|
|
20957
20973
|
stage.container().addEventListener("keydown", (e) => {
|
|
20958
|
-
if (e.key === "Escape") {
|
|
20974
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === FRAME_TOOL_ACTION_NAME) {
|
|
20959
20975
|
this.cancelAction();
|
|
20960
20976
|
return;
|
|
20961
20977
|
}
|
|
@@ -21027,6 +21043,10 @@ var WeaveFrameToolAction = class extends WeaveAction {
|
|
|
21027
21043
|
}
|
|
21028
21044
|
};
|
|
21029
21045
|
|
|
21046
|
+
//#endregion
|
|
21047
|
+
//#region src/actions/export-stage-tool/constants.ts
|
|
21048
|
+
const EXPORT_STAGE_TOOL_ACTION_NAME = "exportStageTool";
|
|
21049
|
+
|
|
21030
21050
|
//#endregion
|
|
21031
21051
|
//#region src/actions/export-stage-tool/export-stage-tool.ts
|
|
21032
21052
|
var WeaveExportStageToolAction = class extends WeaveAction {
|
|
@@ -21040,7 +21060,7 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
21040
21060
|
onPropsChange = void 0;
|
|
21041
21061
|
onInit = void 0;
|
|
21042
21062
|
getName() {
|
|
21043
|
-
return
|
|
21063
|
+
return EXPORT_STAGE_TOOL_ACTION_NAME;
|
|
21044
21064
|
}
|
|
21045
21065
|
async exportStage() {
|
|
21046
21066
|
const img = await this.instance.exportStage(this.options);
|
|
@@ -21071,6 +21091,10 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
21071
21091
|
}
|
|
21072
21092
|
};
|
|
21073
21093
|
|
|
21094
|
+
//#endregion
|
|
21095
|
+
//#region src/actions/export-node-tool/constants.ts
|
|
21096
|
+
const EXPORT_NODE_TOOL_ACTION_NAME = "exportNodeTool";
|
|
21097
|
+
|
|
21074
21098
|
//#endregion
|
|
21075
21099
|
//#region src/actions/export-node-tool/export-node-tool.ts
|
|
21076
21100
|
var WeaveExportNodeToolAction = class extends WeaveAction {
|
|
@@ -21084,7 +21108,7 @@ var WeaveExportNodeToolAction = class extends WeaveAction {
|
|
|
21084
21108
|
onPropsChange = void 0;
|
|
21085
21109
|
onInit = void 0;
|
|
21086
21110
|
getName() {
|
|
21087
|
-
return
|
|
21111
|
+
return EXPORT_NODE_TOOL_ACTION_NAME;
|
|
21088
21112
|
}
|
|
21089
21113
|
async exportNode(node) {
|
|
21090
21114
|
const img = await this.instance.exportNode(node, this.options);
|
|
@@ -22137,6 +22161,7 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
22137
22161
|
};
|
|
22138
22162
|
|
|
22139
22163
|
//#endregion
|
|
22164
|
+
exports.BRUSH_TOOL_ACTION_NAME = BRUSH_TOOL_ACTION_NAME
|
|
22140
22165
|
exports.BRUSH_TOOL_STATE = BRUSH_TOOL_STATE
|
|
22141
22166
|
exports.COPY_PASTE_NODES_PLUGIN_STATE = COPY_PASTE_NODES_PLUGIN_STATE
|
|
22142
22167
|
exports.FRAME_TOOL_ACTION_NAME = FRAME_TOOL_ACTION_NAME
|
|
@@ -22146,15 +22171,18 @@ exports.GUIDE_LINE_DRAG_SNAPPING_THRESHOLD = GUIDE_LINE_DRAG_SNAPPING_THRESHOLD
|
|
|
22146
22171
|
exports.GUIDE_LINE_NAME = GUIDE_LINE_NAME
|
|
22147
22172
|
exports.GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD = GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD
|
|
22148
22173
|
exports.GUIDE_ORIENTATION = GUIDE_ORIENTATION
|
|
22174
|
+
exports.IMAGE_TOOL_ACTION_NAME = IMAGE_TOOL_ACTION_NAME
|
|
22149
22175
|
exports.IMAGE_TOOL_STATE = IMAGE_TOOL_STATE
|
|
22150
22176
|
exports.MOVE_TOOL_ACTION_NAME = MOVE_TOOL_ACTION_NAME
|
|
22151
22177
|
exports.MOVE_TOOL_STATE = MOVE_TOOL_STATE
|
|
22152
22178
|
exports.NODE_SNAP = NODE_SNAP
|
|
22179
|
+
exports.PEN_TOOL_ACTION_NAME = PEN_TOOL_ACTION_NAME
|
|
22153
22180
|
exports.PEN_TOOL_STATE = PEN_TOOL_STATE
|
|
22154
22181
|
exports.RECTANGLE_TOOL_ACTION_NAME = RECTANGLE_TOOL_ACTION_NAME
|
|
22155
22182
|
exports.RECTANGLE_TOOL_STATE = RECTANGLE_TOOL_STATE
|
|
22156
22183
|
exports.SELECTION_TOOL_ACTION_NAME = SELECTION_TOOL_ACTION_NAME
|
|
22157
22184
|
exports.SELECTION_TOOL_STATE = SELECTION_TOOL_STATE
|
|
22185
|
+
exports.TEXT_TOOL_ACTION_NAME = TEXT_TOOL_ACTION_NAME
|
|
22158
22186
|
exports.TEXT_TOOL_STATE = TEXT_TOOL_STATE
|
|
22159
22187
|
exports.WEAVE_COPY_PASTE_NODES_KEY = WEAVE_COPY_PASTE_NODES_KEY
|
|
22160
22188
|
exports.WEAVE_FRAME_NODE_DEFAULT_CONFIG = WEAVE_FRAME_NODE_DEFAULT_CONFIG
|
package/dist/sdk.d.cts
CHANGED
|
@@ -842,6 +842,7 @@ declare class WeaveRectangleToolAction extends WeaveAction {
|
|
|
842
842
|
|
|
843
843
|
//#endregion
|
|
844
844
|
//#region src/actions/pen-tool/constants.d.ts
|
|
845
|
+
declare const PEN_TOOL_ACTION_NAME = "penTool";
|
|
845
846
|
declare const PEN_TOOL_STATE: {
|
|
846
847
|
readonly "IDLE": "idle";
|
|
847
848
|
readonly "ADDING": "adding";
|
|
@@ -889,6 +890,7 @@ declare class WeavePenToolAction extends WeaveAction {
|
|
|
889
890
|
|
|
890
891
|
//#endregion
|
|
891
892
|
//#region src/actions/brush-tool/constants.d.ts
|
|
893
|
+
declare const BRUSH_TOOL_ACTION_NAME = "brushTool";
|
|
892
894
|
declare const BRUSH_TOOL_STATE: {
|
|
893
895
|
readonly "INACTIVE": "inactive";
|
|
894
896
|
readonly "IDLE": "idle";
|
|
@@ -930,6 +932,7 @@ declare class WeaveBrushToolAction extends WeaveAction {
|
|
|
930
932
|
|
|
931
933
|
//#endregion
|
|
932
934
|
//#region src/actions/text-tool/constants.d.ts
|
|
935
|
+
declare const TEXT_TOOL_ACTION_NAME = "textTool";
|
|
933
936
|
declare const TEXT_TOOL_STATE: {
|
|
934
937
|
readonly "IDLE": "idle";
|
|
935
938
|
readonly "ADDING": "adding";
|
|
@@ -965,6 +968,7 @@ declare class WeaveTextToolAction extends WeaveAction {
|
|
|
965
968
|
|
|
966
969
|
//#endregion
|
|
967
970
|
//#region src/actions/image-tool/constants.d.ts
|
|
971
|
+
declare const IMAGE_TOOL_ACTION_NAME = "imageTool";
|
|
968
972
|
declare const IMAGE_TOOL_STATE: {
|
|
969
973
|
readonly "IDLE": "idle";
|
|
970
974
|
readonly "UPLOADING": "uploading";
|
|
@@ -1424,6 +1428,7 @@ declare class WeaveCopyPasteNodesPlugin extends WeavePlugin {
|
|
|
1424
1428
|
initEvents(): void;
|
|
1425
1429
|
private mapToPasteNodes;
|
|
1426
1430
|
private setState;
|
|
1431
|
+
private recursivelyUpdateKeys;
|
|
1427
1432
|
private handlePaste;
|
|
1428
1433
|
private performCopy;
|
|
1429
1434
|
private performPaste;
|
|
@@ -1517,4 +1522,4 @@ declare class WeaveNodesSnappingPlugin extends WeavePlugin {
|
|
|
1517
1522
|
}
|
|
1518
1523
|
|
|
1519
1524
|
//#endregion
|
|
1520
|
-
export { BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
|
1525
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/dist/sdk.d.ts
CHANGED
|
@@ -842,6 +842,7 @@ declare class WeaveRectangleToolAction extends WeaveAction {
|
|
|
842
842
|
|
|
843
843
|
//#endregion
|
|
844
844
|
//#region src/actions/pen-tool/constants.d.ts
|
|
845
|
+
declare const PEN_TOOL_ACTION_NAME = "penTool";
|
|
845
846
|
declare const PEN_TOOL_STATE: {
|
|
846
847
|
readonly "IDLE": "idle";
|
|
847
848
|
readonly "ADDING": "adding";
|
|
@@ -889,6 +890,7 @@ declare class WeavePenToolAction extends WeaveAction {
|
|
|
889
890
|
|
|
890
891
|
//#endregion
|
|
891
892
|
//#region src/actions/brush-tool/constants.d.ts
|
|
893
|
+
declare const BRUSH_TOOL_ACTION_NAME = "brushTool";
|
|
892
894
|
declare const BRUSH_TOOL_STATE: {
|
|
893
895
|
readonly "INACTIVE": "inactive";
|
|
894
896
|
readonly "IDLE": "idle";
|
|
@@ -930,6 +932,7 @@ declare class WeaveBrushToolAction extends WeaveAction {
|
|
|
930
932
|
|
|
931
933
|
//#endregion
|
|
932
934
|
//#region src/actions/text-tool/constants.d.ts
|
|
935
|
+
declare const TEXT_TOOL_ACTION_NAME = "textTool";
|
|
933
936
|
declare const TEXT_TOOL_STATE: {
|
|
934
937
|
readonly "IDLE": "idle";
|
|
935
938
|
readonly "ADDING": "adding";
|
|
@@ -965,6 +968,7 @@ declare class WeaveTextToolAction extends WeaveAction {
|
|
|
965
968
|
|
|
966
969
|
//#endregion
|
|
967
970
|
//#region src/actions/image-tool/constants.d.ts
|
|
971
|
+
declare const IMAGE_TOOL_ACTION_NAME = "imageTool";
|
|
968
972
|
declare const IMAGE_TOOL_STATE: {
|
|
969
973
|
readonly "IDLE": "idle";
|
|
970
974
|
readonly "UPLOADING": "uploading";
|
|
@@ -1424,6 +1428,7 @@ declare class WeaveCopyPasteNodesPlugin extends WeavePlugin {
|
|
|
1424
1428
|
initEvents(): void;
|
|
1425
1429
|
private mapToPasteNodes;
|
|
1426
1430
|
private setState;
|
|
1431
|
+
private recursivelyUpdateKeys;
|
|
1427
1432
|
private handlePaste;
|
|
1428
1433
|
private performCopy;
|
|
1429
1434
|
private performPaste;
|
|
@@ -1517,4 +1522,4 @@ declare class WeaveNodesSnappingPlugin extends WeavePlugin {
|
|
|
1517
1522
|
}
|
|
1518
1523
|
|
|
1519
1524
|
//#endregion
|
|
1520
|
-
export { BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
|
1525
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/dist/sdk.js
CHANGED
|
@@ -16277,12 +16277,22 @@ var WeaveCopyPasteNodesPlugin = class extends WeavePlugin {
|
|
|
16277
16277
|
setState(state) {
|
|
16278
16278
|
this.state = state;
|
|
16279
16279
|
}
|
|
16280
|
+
recursivelyUpdateKeys(nodes) {
|
|
16281
|
+
for (const child of nodes) {
|
|
16282
|
+
const newNodeId = v4_default();
|
|
16283
|
+
child.key = newNodeId;
|
|
16284
|
+
child.props.id = newNodeId;
|
|
16285
|
+
if (child.props.children) this.recursivelyUpdateKeys(child.props.children);
|
|
16286
|
+
}
|
|
16287
|
+
}
|
|
16280
16288
|
handlePaste() {
|
|
16281
16289
|
if (this.toPaste) {
|
|
16282
16290
|
const { mousePoint, container } = this.instance.getMousePointer();
|
|
16283
16291
|
for (const element of Object.keys(this.toPaste.weave)) {
|
|
16284
16292
|
const node = this.toPaste.weave[element];
|
|
16293
|
+
if (node.props.children) this.recursivelyUpdateKeys(node.props.children);
|
|
16285
16294
|
const newNodeId = v4_default();
|
|
16295
|
+
delete node.props.containerId;
|
|
16286
16296
|
node.key = newNodeId;
|
|
16287
16297
|
node.props.id = newNodeId;
|
|
16288
16298
|
node.props.x = mousePoint.x + (node.props.x - this.toPaste.weaveMinPoint.x);
|
|
@@ -17903,7 +17913,7 @@ var WeaveRegisterManager = class {
|
|
|
17903
17913
|
|
|
17904
17914
|
//#endregion
|
|
17905
17915
|
//#region package.json
|
|
17906
|
-
var version = "0.14.
|
|
17916
|
+
var version = "0.14.2";
|
|
17907
17917
|
|
|
17908
17918
|
//#endregion
|
|
17909
17919
|
//#region src/managers/setup.ts
|
|
@@ -18681,6 +18691,14 @@ var WeaveLineNode = class extends WeaveNode {
|
|
|
18681
18691
|
//#region src/nodes/text/constants.ts
|
|
18682
18692
|
const WEAVE_TEXT_NODE_TYPE = "text";
|
|
18683
18693
|
|
|
18694
|
+
//#endregion
|
|
18695
|
+
//#region src/actions/selection-tool/constants.ts
|
|
18696
|
+
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
18697
|
+
const SELECTION_TOOL_STATE = {
|
|
18698
|
+
["IDLE"]: "idle",
|
|
18699
|
+
["SELECTING"]: "selection"
|
|
18700
|
+
};
|
|
18701
|
+
|
|
18684
18702
|
//#endregion
|
|
18685
18703
|
//#region src/nodes/text/text.ts
|
|
18686
18704
|
var WeaveTextNode = class extends WeaveNode {
|
|
@@ -18703,13 +18721,14 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18703
18721
|
});
|
|
18704
18722
|
this.setupDefaultNodeEvents(text);
|
|
18705
18723
|
window.addEventListener("keypress", (e) => {
|
|
18706
|
-
if (this.editing)
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18724
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === SELECTION_TOOL_ACTION_NAME && !this.editing) {
|
|
18725
|
+
e.preventDefault();
|
|
18726
|
+
if (this.isSelecting() && this.isNodeSelected(text)) {
|
|
18727
|
+
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
18728
|
+
if (nodesSelectionPlugin && nodesSelectionPlugin.getSelectedNodes().length === 1 && nodesSelectionPlugin.getSelectedNodes()[0].getAttrs().nodeType === WEAVE_TEXT_NODE_TYPE && !window.weaveTextEditing[nodesSelectionPlugin.getSelectedNodes()[0].id()]) {
|
|
18729
|
+
e.preventDefault();
|
|
18730
|
+
this.triggerEditMode(nodesSelectionPlugin.getSelectedNodes()[0]);
|
|
18731
|
+
}
|
|
18713
18732
|
}
|
|
18714
18733
|
}
|
|
18715
18734
|
});
|
|
@@ -18823,9 +18842,6 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18823
18842
|
textArea.style.height = "auto";
|
|
18824
18843
|
textArea.style.height = textArea.scrollHeight + 1.6 * textNode.getAbsoluteScale().x + "px";
|
|
18825
18844
|
};
|
|
18826
|
-
textArea.onwheel = (e) => {
|
|
18827
|
-
e.preventDefault();
|
|
18828
|
-
};
|
|
18829
18845
|
textArea.oninput = () => {
|
|
18830
18846
|
textArea.style.height = "auto";
|
|
18831
18847
|
textArea.style.height = textArea.scrollHeight + 1.6 * textNode.getAbsoluteScale().x + "px";
|
|
@@ -18834,36 +18850,22 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18834
18850
|
let transform = "";
|
|
18835
18851
|
if (rotation) transform += "rotateZ(" + rotation + "deg)";
|
|
18836
18852
|
const px = 0;
|
|
18837
|
-
const py = -3 *
|
|
18853
|
+
const py = -3 * stage.scaleY();
|
|
18838
18854
|
transform += "translateX(" + px + "px)";
|
|
18839
18855
|
transform += "translateY(" + py + "px)";
|
|
18840
18856
|
textArea.style.transform = transform;
|
|
18841
18857
|
const handleKeyDown = (e) => {
|
|
18842
|
-
|
|
18843
|
-
|
|
18844
|
-
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
}
|
|
18854
|
-
return;
|
|
18855
|
-
}
|
|
18856
|
-
if (e.key === "Escape") {
|
|
18857
|
-
textNode.width(parseFloat(textArea.style.width) * (1 / textNode.getAbsoluteScale().x));
|
|
18858
|
-
textNode.height((textArea.scrollHeight + 1.6) * (1 / textNode.getAbsoluteScale().x));
|
|
18859
|
-
textNode.text(textArea.value);
|
|
18860
|
-
this.updateNode(textNode);
|
|
18861
|
-
this.removeTextAreaDOM(textNode);
|
|
18862
|
-
this.instance.removeEventListener("onZoomChange", this.onZoomChangeHandler(textNode).bind(this));
|
|
18863
|
-
this.instance.removeEventListener("onStageMove", this.onStageMoveHandler(textNode).bind(this));
|
|
18864
|
-
window.removeEventListener("click", handleOutsideClick);
|
|
18865
|
-
return;
|
|
18866
|
-
}
|
|
18858
|
+
e.stopPropagation();
|
|
18859
|
+
if (textArea && textNode && e.key === "Escape") {
|
|
18860
|
+
textNode.width(parseFloat(textArea.style.width) * (1 / textNode.getAbsoluteScale().x));
|
|
18861
|
+
textNode.height((textArea.scrollHeight + 1.6) * (1 / textNode.getAbsoluteScale().x));
|
|
18862
|
+
textNode.text(textArea.value);
|
|
18863
|
+
this.updateNode(textNode);
|
|
18864
|
+
this.removeTextAreaDOM(textNode);
|
|
18865
|
+
this.instance.removeEventListener("onZoomChange", this.onZoomChangeHandler(textNode).bind(this));
|
|
18866
|
+
this.instance.removeEventListener("onStageMove", this.onStageMoveHandler(textNode).bind(this));
|
|
18867
|
+
window.removeEventListener("click", handleOutsideClick);
|
|
18868
|
+
return;
|
|
18867
18869
|
}
|
|
18868
18870
|
};
|
|
18869
18871
|
const handleKeyUp = () => {
|
|
@@ -18945,6 +18947,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
18945
18947
|
|
|
18946
18948
|
//#endregion
|
|
18947
18949
|
//#region src/actions/image-tool/constants.ts
|
|
18950
|
+
const IMAGE_TOOL_ACTION_NAME = "imageTool";
|
|
18948
18951
|
const IMAGE_TOOL_STATE = {
|
|
18949
18952
|
["IDLE"]: "idle",
|
|
18950
18953
|
["UPLOADING"]: "uploading",
|
|
@@ -18971,7 +18974,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
18971
18974
|
this.clickPoint = null;
|
|
18972
18975
|
}
|
|
18973
18976
|
getName() {
|
|
18974
|
-
return
|
|
18977
|
+
return IMAGE_TOOL_ACTION_NAME;
|
|
18975
18978
|
}
|
|
18976
18979
|
getPreloadedImage(imageId) {
|
|
18977
18980
|
return this.preloadImgs?.[imageId];
|
|
@@ -18995,8 +18998,10 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
18995
18998
|
setupEvents() {
|
|
18996
18999
|
const stage = this.instance.getStage();
|
|
18997
19000
|
stage.container().addEventListener("keydown", (e) => {
|
|
18998
|
-
if (e.key === "Escape"
|
|
18999
|
-
|
|
19001
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === IMAGE_TOOL_ACTION_NAME) {
|
|
19002
|
+
this.cancelAction();
|
|
19003
|
+
return;
|
|
19004
|
+
}
|
|
19000
19005
|
});
|
|
19001
19006
|
stage.on("click tap", (e) => {
|
|
19002
19007
|
e.evt.preventDefault();
|
|
@@ -20005,12 +20010,16 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
20005
20010
|
}
|
|
20006
20011
|
};
|
|
20007
20012
|
|
|
20013
|
+
//#endregion
|
|
20014
|
+
//#region src/actions/zoom-out-tool/constants.ts
|
|
20015
|
+
const ZOOM_OUT_TOOL_ACTION_NAME = "zoomOutTool";
|
|
20016
|
+
|
|
20008
20017
|
//#endregion
|
|
20009
20018
|
//#region src/actions/zoom-out-tool/zoom-out-tool.ts
|
|
20010
20019
|
var WeaveZoomOutToolAction = class extends WeaveAction {
|
|
20011
20020
|
onPropsChange = void 0;
|
|
20012
20021
|
getName() {
|
|
20013
|
-
return
|
|
20022
|
+
return ZOOM_OUT_TOOL_ACTION_NAME;
|
|
20014
20023
|
}
|
|
20015
20024
|
getStageZoomPlugin() {
|
|
20016
20025
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20034,12 +20043,16 @@ var WeaveZoomOutToolAction = class extends WeaveAction {
|
|
|
20034
20043
|
}
|
|
20035
20044
|
};
|
|
20036
20045
|
|
|
20046
|
+
//#endregion
|
|
20047
|
+
//#region src/actions/zoom-in-tool/constants.ts
|
|
20048
|
+
const ZOOM_IN_TOOL_ACTION_NAME = "zoomInTool";
|
|
20049
|
+
|
|
20037
20050
|
//#endregion
|
|
20038
20051
|
//#region src/actions/zoom-in-tool/zoom-in-tool.ts
|
|
20039
20052
|
var WeaveZoomInToolAction = class extends WeaveAction {
|
|
20040
20053
|
onPropsChange = void 0;
|
|
20041
20054
|
getName() {
|
|
20042
|
-
return
|
|
20055
|
+
return ZOOM_IN_TOOL_ACTION_NAME;
|
|
20043
20056
|
}
|
|
20044
20057
|
getStageZoomPlugin() {
|
|
20045
20058
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20063,12 +20076,16 @@ var WeaveZoomInToolAction = class extends WeaveAction {
|
|
|
20063
20076
|
}
|
|
20064
20077
|
};
|
|
20065
20078
|
|
|
20079
|
+
//#endregion
|
|
20080
|
+
//#region src/actions/fit-to-screen-tool/constants.ts
|
|
20081
|
+
const FIT_TO_SCREEN_TOOL_ACTION_NAME = "fitToScreenTool";
|
|
20082
|
+
|
|
20066
20083
|
//#endregion
|
|
20067
20084
|
//#region src/actions/fit-to-screen-tool/fit-to-screen-tool.ts
|
|
20068
20085
|
var WeaveFitToScreenToolAction = class extends WeaveAction {
|
|
20069
20086
|
onPropsChange = void 0;
|
|
20070
20087
|
getName() {
|
|
20071
|
-
return
|
|
20088
|
+
return FIT_TO_SCREEN_TOOL_ACTION_NAME;
|
|
20072
20089
|
}
|
|
20073
20090
|
getStageZoomPlugin() {
|
|
20074
20091
|
return this.instance.getPlugin("stageZoom");
|
|
@@ -20091,12 +20108,16 @@ var WeaveFitToScreenToolAction = class extends WeaveAction {
|
|
|
20091
20108
|
}
|
|
20092
20109
|
};
|
|
20093
20110
|
|
|
20111
|
+
//#endregion
|
|
20112
|
+
//#region src/actions/fit-to-selection-tool/constants.ts
|
|
20113
|
+
const FIT_TO_SELECTION_TOOL_ACTION_NAME = "fitToSelectionTool";
|
|
20114
|
+
|
|
20094
20115
|
//#endregion
|
|
20095
20116
|
//#region src/actions/fit-to-selection-tool/fit-to-selection-tool.ts
|
|
20096
20117
|
var WeaveFitToSelectionToolAction = class extends WeaveAction {
|
|
20097
20118
|
onPropsChange = void 0;
|
|
20098
20119
|
getName() {
|
|
20099
|
-
return
|
|
20120
|
+
return FIT_TO_SELECTION_TOOL_ACTION_NAME;
|
|
20100
20121
|
}
|
|
20101
20122
|
getNodesSelectionPlugin() {
|
|
20102
20123
|
return this.instance.getPlugin("nodesSelection");
|
|
@@ -20180,14 +20201,6 @@ var WeaveMoveToolAction = class extends WeaveAction {
|
|
|
20180
20201
|
}
|
|
20181
20202
|
};
|
|
20182
20203
|
|
|
20183
|
-
//#endregion
|
|
20184
|
-
//#region src/actions/selection-tool/constants.ts
|
|
20185
|
-
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
20186
|
-
const SELECTION_TOOL_STATE = {
|
|
20187
|
-
["IDLE"]: "idle",
|
|
20188
|
-
["SELECTING"]: "selection"
|
|
20189
|
-
};
|
|
20190
|
-
|
|
20191
20204
|
//#endregion
|
|
20192
20205
|
//#region src/actions/selection-tool/selection-tool.ts
|
|
20193
20206
|
var WeaveSelectionToolAction = class extends WeaveAction {
|
|
@@ -20285,11 +20298,11 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
20285
20298
|
setupEvents() {
|
|
20286
20299
|
const stage = this.instance.getStage();
|
|
20287
20300
|
stage.container().addEventListener("keydown", (e) => {
|
|
20288
|
-
if (e.key === "Enter") {
|
|
20301
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === RECTANGLE_TOOL_ACTION_NAME) {
|
|
20289
20302
|
this.cancelAction();
|
|
20290
20303
|
return;
|
|
20291
20304
|
}
|
|
20292
|
-
if (e.key === "Escape") {
|
|
20305
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === RECTANGLE_TOOL_ACTION_NAME) {
|
|
20293
20306
|
this.cancelAction();
|
|
20294
20307
|
return;
|
|
20295
20308
|
}
|
|
@@ -20419,6 +20432,7 @@ var WeaveRectangleToolAction = class extends WeaveAction {
|
|
|
20419
20432
|
|
|
20420
20433
|
//#endregion
|
|
20421
20434
|
//#region src/actions/pen-tool/constants.ts
|
|
20435
|
+
const PEN_TOOL_ACTION_NAME = "penTool";
|
|
20422
20436
|
const PEN_TOOL_STATE = {
|
|
20423
20437
|
["IDLE"]: "idle",
|
|
20424
20438
|
["ADDING"]: "adding",
|
|
@@ -20447,7 +20461,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20447
20461
|
this.props = this.initProps();
|
|
20448
20462
|
}
|
|
20449
20463
|
getName() {
|
|
20450
|
-
return
|
|
20464
|
+
return PEN_TOOL_ACTION_NAME;
|
|
20451
20465
|
}
|
|
20452
20466
|
initProps() {
|
|
20453
20467
|
return {
|
|
@@ -20459,11 +20473,11 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20459
20473
|
setupEvents() {
|
|
20460
20474
|
const stage = this.instance.getStage();
|
|
20461
20475
|
stage.container().addEventListener("keydown", (e) => {
|
|
20462
|
-
if (e.key === "Enter") {
|
|
20476
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === PEN_TOOL_ACTION_NAME) {
|
|
20463
20477
|
this.cancelAction();
|
|
20464
20478
|
return;
|
|
20465
20479
|
}
|
|
20466
|
-
if (e.key === "Escape") {
|
|
20480
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === PEN_TOOL_ACTION_NAME) {
|
|
20467
20481
|
this.cancelAction();
|
|
20468
20482
|
return;
|
|
20469
20483
|
}
|
|
@@ -20657,6 +20671,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
20657
20671
|
|
|
20658
20672
|
//#endregion
|
|
20659
20673
|
//#region src/actions/brush-tool/constants.ts
|
|
20674
|
+
const BRUSH_TOOL_ACTION_NAME = "brushTool";
|
|
20660
20675
|
const BRUSH_TOOL_STATE = {
|
|
20661
20676
|
["INACTIVE"]: "inactive",
|
|
20662
20677
|
["IDLE"]: "idle",
|
|
@@ -20680,7 +20695,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20680
20695
|
this.props = this.initProps();
|
|
20681
20696
|
}
|
|
20682
20697
|
getName() {
|
|
20683
|
-
return
|
|
20698
|
+
return BRUSH_TOOL_ACTION_NAME;
|
|
20684
20699
|
}
|
|
20685
20700
|
initProps() {
|
|
20686
20701
|
return {
|
|
@@ -20694,11 +20709,11 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20694
20709
|
stage.container().tabIndex = 1;
|
|
20695
20710
|
stage.container().focus();
|
|
20696
20711
|
stage.container().addEventListener("keydown", (e) => {
|
|
20697
|
-
if (e.key === "Enter") {
|
|
20712
|
+
if (e.key === "Enter" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
|
|
20698
20713
|
this.cancelAction();
|
|
20699
20714
|
return;
|
|
20700
20715
|
}
|
|
20701
|
-
if (e.key === "Escape") {
|
|
20716
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === BRUSH_TOOL_ACTION_NAME) {
|
|
20702
20717
|
this.cancelAction();
|
|
20703
20718
|
return;
|
|
20704
20719
|
}
|
|
@@ -20806,6 +20821,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
20806
20821
|
|
|
20807
20822
|
//#endregion
|
|
20808
20823
|
//#region src/actions/text-tool/constants.ts
|
|
20824
|
+
const TEXT_TOOL_ACTION_NAME = "textTool";
|
|
20809
20825
|
const TEXT_TOOL_STATE = {
|
|
20810
20826
|
["IDLE"]: "idle",
|
|
20811
20827
|
["ADDING"]: "adding",
|
|
@@ -20828,12 +20844,12 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
20828
20844
|
this.clickPoint = null;
|
|
20829
20845
|
}
|
|
20830
20846
|
getName() {
|
|
20831
|
-
return
|
|
20847
|
+
return TEXT_TOOL_ACTION_NAME;
|
|
20832
20848
|
}
|
|
20833
20849
|
setupEvents() {
|
|
20834
20850
|
const stage = this.instance.getStage();
|
|
20835
20851
|
stage.container().addEventListener("keydown", (e) => {
|
|
20836
|
-
if (e.key === "Escape") {
|
|
20852
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === TEXT_TOOL_ACTION_NAME) {
|
|
20837
20853
|
this.cancelAction();
|
|
20838
20854
|
return;
|
|
20839
20855
|
}
|
|
@@ -20955,7 +20971,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
|
|
|
20955
20971
|
setupEvents() {
|
|
20956
20972
|
const stage = this.instance.getStage();
|
|
20957
20973
|
stage.container().addEventListener("keydown", (e) => {
|
|
20958
|
-
if (e.key === "Escape") {
|
|
20974
|
+
if (e.key === "Escape" && this.instance.getActiveAction() === FRAME_TOOL_ACTION_NAME) {
|
|
20959
20975
|
this.cancelAction();
|
|
20960
20976
|
return;
|
|
20961
20977
|
}
|
|
@@ -21027,6 +21043,10 @@ var WeaveFrameToolAction = class extends WeaveAction {
|
|
|
21027
21043
|
}
|
|
21028
21044
|
};
|
|
21029
21045
|
|
|
21046
|
+
//#endregion
|
|
21047
|
+
//#region src/actions/export-stage-tool/constants.ts
|
|
21048
|
+
const EXPORT_STAGE_TOOL_ACTION_NAME = "exportStageTool";
|
|
21049
|
+
|
|
21030
21050
|
//#endregion
|
|
21031
21051
|
//#region src/actions/export-stage-tool/export-stage-tool.ts
|
|
21032
21052
|
var WeaveExportStageToolAction = class extends WeaveAction {
|
|
@@ -21040,7 +21060,7 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
21040
21060
|
onPropsChange = void 0;
|
|
21041
21061
|
onInit = void 0;
|
|
21042
21062
|
getName() {
|
|
21043
|
-
return
|
|
21063
|
+
return EXPORT_STAGE_TOOL_ACTION_NAME;
|
|
21044
21064
|
}
|
|
21045
21065
|
async exportStage() {
|
|
21046
21066
|
const img = await this.instance.exportStage(this.options);
|
|
@@ -21071,6 +21091,10 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
21071
21091
|
}
|
|
21072
21092
|
};
|
|
21073
21093
|
|
|
21094
|
+
//#endregion
|
|
21095
|
+
//#region src/actions/export-node-tool/constants.ts
|
|
21096
|
+
const EXPORT_NODE_TOOL_ACTION_NAME = "exportNodeTool";
|
|
21097
|
+
|
|
21074
21098
|
//#endregion
|
|
21075
21099
|
//#region src/actions/export-node-tool/export-node-tool.ts
|
|
21076
21100
|
var WeaveExportNodeToolAction = class extends WeaveAction {
|
|
@@ -21084,7 +21108,7 @@ var WeaveExportNodeToolAction = class extends WeaveAction {
|
|
|
21084
21108
|
onPropsChange = void 0;
|
|
21085
21109
|
onInit = void 0;
|
|
21086
21110
|
getName() {
|
|
21087
|
-
return
|
|
21111
|
+
return EXPORT_NODE_TOOL_ACTION_NAME;
|
|
21088
21112
|
}
|
|
21089
21113
|
async exportNode(node) {
|
|
21090
21114
|
const img = await this.instance.exportNode(node, this.options);
|
|
@@ -22137,4 +22161,4 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
22137
22161
|
};
|
|
22138
22162
|
|
|
22139
22163
|
//#endregion
|
|
22140
|
-
export { BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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, IMAGE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_STATE, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveBrushToolAction, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveExportNodeToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveZoomInToolAction, WeaveZoomOutToolAction, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
|
22164
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_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, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, WEAVE_COPY_PASTE_NODES_KEY, 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_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, Weave, WeaveAction, WeaveBrushToolAction, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveExportNodeToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveZoomInToolAction, WeaveZoomOutToolAction, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inditextech/weave-sdk",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jesus Manuel Piñeiro Cid <jesusmpc@inditex.com>",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"version:release": "npm version $RELEASE_VERSION -m \"[npm-scripts] prepare release $RELEASE_VERSION\" --tag-version-prefix \"\""
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@inditextech/weave-types": "0.14.
|
|
46
|
+
"@inditextech/weave-types": "0.14.2",
|
|
47
47
|
"@syncedstore/core": "0.6.0",
|
|
48
48
|
"canvas": "3.1.0",
|
|
49
49
|
"konva": "9.3.20",
|