@inditextech/weave-sdk 0.47.1 → 0.49.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 +130 -85
- package/dist/sdk.d.cts +13 -7
- package/dist/sdk.d.cts.map +1 -1
- package/dist/sdk.d.ts +13 -7
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +143 -99
- package/dist/sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Konva from "konva";
|
|
2
2
|
import "konva/lib/types";
|
|
3
|
-
import { WEAVE_AWARENESS_LAYER_ID, WEAVE_EXPORT_BACKGROUND_COLOR,
|
|
3
|
+
import { WEAVE_AWARENESS_LAYER_ID, WEAVE_EXPORT_BACKGROUND_COLOR, WEAVE_EXPORT_FORMATS, WEAVE_INSTANCE_STATUS, WEAVE_NODE_CUSTOM_EVENTS, WEAVE_NODE_LAYER_ID, WEAVE_NODE_POSITION, WEAVE_STORE_CONNECTION_STATUS, WEAVE_UTILITY_LAYER_ID } from "@inditextech/weave-types";
|
|
4
4
|
import { getYjsDoc, getYjsValue, observeDeep, syncedStore } from "@syncedstore/core";
|
|
5
5
|
import { Doc, UndoManager } from "yjs";
|
|
6
6
|
import { Transformer } from "konva/lib/shapes/Transformer";
|
|
@@ -15494,6 +15494,7 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
|
|
|
15494
15494
|
} else root._ = _;
|
|
15495
15495
|
}).call(exports);
|
|
15496
15496
|
} });
|
|
15497
|
+
var import_lodash$1 = __toESM(require_lodash());
|
|
15497
15498
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
15498
15499
|
|
|
15499
15500
|
//#endregion
|
|
@@ -15588,12 +15589,12 @@ var WeaveStore = class {
|
|
|
15588
15589
|
node: JSON.parse(JSON.stringify(nodeInfo.node))
|
|
15589
15590
|
});
|
|
15590
15591
|
}
|
|
15591
|
-
if (!this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) {
|
|
15592
|
+
if (!this.isRoomLoaded && !(0, import_lodash$1.isEmpty)(this.state.weave)) {
|
|
15592
15593
|
this.instance.setupRenderer();
|
|
15593
15594
|
this.isRoomLoaded = true;
|
|
15594
15595
|
this.instance.emitEvent("onRoomLoaded", this.isRoomLoaded);
|
|
15595
15596
|
}
|
|
15596
|
-
if (this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) this.instance.render();
|
|
15597
|
+
if (this.isRoomLoaded && !(0, import_lodash$1.isEmpty)(this.state.weave)) this.instance.render();
|
|
15597
15598
|
});
|
|
15598
15599
|
}
|
|
15599
15600
|
canUndoStateStep() {
|
|
@@ -15738,6 +15739,31 @@ function stringToColor(str) {
|
|
|
15738
15739
|
}
|
|
15739
15740
|
return color;
|
|
15740
15741
|
}
|
|
15742
|
+
function getExportBoundingBox(stage, nodes) {
|
|
15743
|
+
if (nodes.length === 0) return {
|
|
15744
|
+
x: 0,
|
|
15745
|
+
y: 0,
|
|
15746
|
+
width: 0,
|
|
15747
|
+
height: 0
|
|
15748
|
+
};
|
|
15749
|
+
let minX = Infinity;
|
|
15750
|
+
let minY = Infinity;
|
|
15751
|
+
let maxX = -Infinity;
|
|
15752
|
+
let maxY = -Infinity;
|
|
15753
|
+
for (const node of nodes) {
|
|
15754
|
+
const box = node.getExportClientRect({ skipTransform: false });
|
|
15755
|
+
minX = Math.min(minX, box.x);
|
|
15756
|
+
minY = Math.min(minY, box.y);
|
|
15757
|
+
maxX = Math.max(maxX, box.x + box.width);
|
|
15758
|
+
maxY = Math.max(maxY, box.y + box.height);
|
|
15759
|
+
}
|
|
15760
|
+
return {
|
|
15761
|
+
x: minX,
|
|
15762
|
+
y: minY,
|
|
15763
|
+
width: maxX - minX,
|
|
15764
|
+
height: maxY - minY
|
|
15765
|
+
};
|
|
15766
|
+
}
|
|
15741
15767
|
function getBoundingBox(stage, nodes) {
|
|
15742
15768
|
if (nodes.length === 0) return {
|
|
15743
15769
|
x: 0,
|
|
@@ -15805,6 +15831,14 @@ function containsNodeDeep(nodes, target) {
|
|
|
15805
15831
|
return false;
|
|
15806
15832
|
}
|
|
15807
15833
|
|
|
15834
|
+
//#endregion
|
|
15835
|
+
//#region src/actions/selection-tool/constants.ts
|
|
15836
|
+
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
15837
|
+
const SELECTION_TOOL_STATE = {
|
|
15838
|
+
["IDLE"]: "idle",
|
|
15839
|
+
["SELECTING"]: "selection"
|
|
15840
|
+
};
|
|
15841
|
+
|
|
15808
15842
|
//#endregion
|
|
15809
15843
|
//#region src/plugins/context-menu/context-menu.ts
|
|
15810
15844
|
var WeaveContextMenuPlugin = class extends WeavePlugin {
|
|
@@ -15917,7 +15951,7 @@ var WeaveContextMenuPlugin = class extends WeavePlugin {
|
|
|
15917
15951
|
this.timer = setTimeout(() => {
|
|
15918
15952
|
this.tapHold = true;
|
|
15919
15953
|
const actualActions = this.instance.getActiveAction();
|
|
15920
|
-
if (actualActions !==
|
|
15954
|
+
if (actualActions !== SELECTION_TOOL_ACTION_NAME) return;
|
|
15921
15955
|
delete this.pointers[e.evt.pointerId];
|
|
15922
15956
|
const selectedGroup = getTargetedNode(this.instance);
|
|
15923
15957
|
this.triggerContextMenu(e.target, selectedGroup);
|
|
@@ -16098,7 +16132,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
16098
16132
|
return this.selecting;
|
|
16099
16133
|
}
|
|
16100
16134
|
isSelecting() {
|
|
16101
|
-
return this.instance.getActiveAction() ===
|
|
16135
|
+
return this.instance.getActiveAction() === SELECTION_TOOL_ACTION_NAME;
|
|
16102
16136
|
}
|
|
16103
16137
|
isNodeSelected(ele) {
|
|
16104
16138
|
let selected = false;
|
|
@@ -16140,7 +16174,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
16140
16174
|
if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
|
|
16141
16175
|
this.triggerSelectedNodesEvent();
|
|
16142
16176
|
};
|
|
16143
|
-
tr.on("transform", (0, import_lodash.throttle)(handleTransform, 50));
|
|
16177
|
+
tr.on("transform", (0, import_lodash$1.throttle)(handleTransform, 50));
|
|
16144
16178
|
tr.on("transformend", () => {
|
|
16145
16179
|
this.triggerSelectedNodesEvent();
|
|
16146
16180
|
});
|
|
@@ -16262,7 +16296,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
16262
16296
|
this.initEvents();
|
|
16263
16297
|
this.initialized = true;
|
|
16264
16298
|
this.instance.addEventListener("onActiveActionChange", (activeAction) => {
|
|
16265
|
-
if (typeof activeAction !== "undefined" && activeAction !==
|
|
16299
|
+
if (typeof activeAction !== "undefined" && activeAction !== SELECTION_TOOL_ACTION_NAME) {
|
|
16266
16300
|
this.active = false;
|
|
16267
16301
|
return;
|
|
16268
16302
|
}
|
|
@@ -16565,7 +16599,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
16565
16599
|
const stage = this.instance.getStage();
|
|
16566
16600
|
e.cancelBubble = true;
|
|
16567
16601
|
if (!this.enabled) return;
|
|
16568
|
-
if (this.instance.getActiveAction() !==
|
|
16602
|
+
if (this.instance.getActiveAction() !== SELECTION_TOOL_ACTION_NAME) return;
|
|
16569
16603
|
const contextMenuPlugin = this.getContextMenuPlugin();
|
|
16570
16604
|
if (contextMenuPlugin?.isContextMenuVisible()) {
|
|
16571
16605
|
this.selecting = false;
|
|
@@ -16953,6 +16987,9 @@ const augmentKonvaNodeClass = (config) => {
|
|
|
16953
16987
|
Konva.Node.prototype.getTransformerProperties = function() {
|
|
16954
16988
|
return { ...transform };
|
|
16955
16989
|
};
|
|
16990
|
+
Konva.Node.prototype.getExportClientRect = function(config$1) {
|
|
16991
|
+
return this.getClientRect(config$1);
|
|
16992
|
+
};
|
|
16956
16993
|
Konva.Node.prototype.getRealClientRect = function(config$1) {
|
|
16957
16994
|
return this.getClientRect(config$1);
|
|
16958
16995
|
};
|
|
@@ -16981,7 +17018,7 @@ var WeaveNode = class {
|
|
|
16981
17018
|
return selectionPlugin;
|
|
16982
17019
|
}
|
|
16983
17020
|
isSelecting() {
|
|
16984
|
-
return this.instance.getActiveAction() ===
|
|
17021
|
+
return this.instance.getActiveAction() === SELECTION_TOOL_ACTION_NAME;
|
|
16985
17022
|
}
|
|
16986
17023
|
isPasting() {
|
|
16987
17024
|
const copyPastePlugin = this.instance.getPlugin("copyPasteNodes");
|
|
@@ -17067,7 +17104,7 @@ var WeaveNode = class {
|
|
|
17067
17104
|
if (nodesSelectionPlugin && this.isSelecting() && this.isNodeSelected(node$1)) nodesSelectionPlugin.getTransformer().forceUpdate();
|
|
17068
17105
|
if (nodesSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesSnappingPlugin.evaluateGuidelines(e);
|
|
17069
17106
|
};
|
|
17070
|
-
node.on("transform", (0, import_lodash.throttle)(handleTransform, 100));
|
|
17107
|
+
node.on("transform", (0, import_lodash$1.throttle)(handleTransform, 100));
|
|
17071
17108
|
node.on("transformend", (e) => {
|
|
17072
17109
|
const node$1 = e.target;
|
|
17073
17110
|
this.instance.emitEvent("onTransform", null);
|
|
@@ -17121,7 +17158,7 @@ var WeaveNode = class {
|
|
|
17121
17158
|
if (layerToMove && !hasFrames(node)) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { bubbles: true });
|
|
17122
17159
|
}
|
|
17123
17160
|
};
|
|
17124
|
-
node.on("dragmove", (0, import_lodash.throttle)(handleDragMove, 100));
|
|
17161
|
+
node.on("dragmove", (0, import_lodash$1.throttle)(handleDragMove, 100));
|
|
17125
17162
|
node.on("dragend", (e) => {
|
|
17126
17163
|
if (!this.didMove) return;
|
|
17127
17164
|
const isErasing = this.instance.getActiveAction() === "eraseTool";
|
|
@@ -18840,7 +18877,7 @@ var WeaveRegisterManager = class {
|
|
|
18840
18877
|
|
|
18841
18878
|
//#endregion
|
|
18842
18879
|
//#region package.json
|
|
18843
|
-
var version = "0.
|
|
18880
|
+
var version = "0.49.0";
|
|
18844
18881
|
|
|
18845
18882
|
//#endregion
|
|
18846
18883
|
//#region src/managers/setup.ts
|
|
@@ -18963,7 +19000,8 @@ var WeaveActionsManager = class {
|
|
|
18963
19000
|
}
|
|
18964
19001
|
triggerAction(actionName, params) {
|
|
18965
19002
|
const actionsHandlers = this.instance.getActionsHandlers();
|
|
18966
|
-
if (
|
|
19003
|
+
if (typeof actionName === "undefined") throw new Error("Action name is required");
|
|
19004
|
+
if (actionName && !actionsHandlers[actionName]) throw new Error(`Action handler with name [${actionName}] not registered`);
|
|
18967
19005
|
if (typeof this.activeAction !== "undefined") this.cancelAction(this.activeAction);
|
|
18968
19006
|
this.activeAction = actionName;
|
|
18969
19007
|
const payload = actionsHandlers[actionName].trigger(this.cancelActionCallback(actionName), params);
|
|
@@ -19053,17 +19091,20 @@ var WeaveExportManager = class {
|
|
|
19053
19091
|
const { format: format$2 = WEAVE_EXPORT_FORMATS.PNG, padding = 0, pixelRatio = 1, backgroundColor = WEAVE_EXPORT_BACKGROUND_COLOR } = options;
|
|
19054
19092
|
const stage = this.instance.getStage();
|
|
19055
19093
|
const mainLayer = this.instance.getMainLayer();
|
|
19056
|
-
const
|
|
19094
|
+
const originalPosition = {
|
|
19095
|
+
x: stage.x(),
|
|
19096
|
+
y: stage.y()
|
|
19097
|
+
};
|
|
19098
|
+
const originalScale = {
|
|
19099
|
+
x: stage.scaleX(),
|
|
19100
|
+
y: stage.scaleY()
|
|
19101
|
+
};
|
|
19057
19102
|
stage.scale({
|
|
19058
19103
|
x: 1,
|
|
19059
19104
|
y: 1
|
|
19060
19105
|
});
|
|
19061
|
-
const realNodes = nodes.map((node) => {
|
|
19062
|
-
if (node.getAttrs().nodeId) return stage.findOne(`#${node.getAttrs().nodeId}`);
|
|
19063
|
-
return node;
|
|
19064
|
-
}).filter((node) => typeof node !== "undefined");
|
|
19065
19106
|
if (mainLayer) {
|
|
19066
|
-
const bounds =
|
|
19107
|
+
const bounds = getExportBoundingBox(stage, boundingNodes(nodes));
|
|
19067
19108
|
const scaleX = stage.scaleX();
|
|
19068
19109
|
const scaleY = stage.scaleY();
|
|
19069
19110
|
const unscaledBounds = {
|
|
@@ -19082,7 +19123,7 @@ var WeaveExportManager = class {
|
|
|
19082
19123
|
fill: backgroundColor
|
|
19083
19124
|
});
|
|
19084
19125
|
exportGroup.add(background);
|
|
19085
|
-
for (const node of
|
|
19126
|
+
for (const node of nodes) {
|
|
19086
19127
|
const clonedNode = node.clone({ id: v4_default() });
|
|
19087
19128
|
const absPos = node.getAbsolutePosition();
|
|
19088
19129
|
clonedNode.absolutePosition({
|
|
@@ -19103,7 +19144,9 @@ var WeaveExportManager = class {
|
|
|
19103
19144
|
quality: options.quality ?? 1,
|
|
19104
19145
|
callback: (img) => {
|
|
19105
19146
|
exportGroup.destroy();
|
|
19147
|
+
stage.position(originalPosition);
|
|
19106
19148
|
stage.scale(originalScale);
|
|
19149
|
+
stage.batchDraw();
|
|
19107
19150
|
resolve(img);
|
|
19108
19151
|
}
|
|
19109
19152
|
});
|
|
@@ -19563,14 +19606,6 @@ var Weave = class {
|
|
|
19563
19606
|
}
|
|
19564
19607
|
};
|
|
19565
19608
|
|
|
19566
|
-
//#endregion
|
|
19567
|
-
//#region src/actions/selection-tool/constants.ts
|
|
19568
|
-
const SELECTION_TOOL_ACTION_NAME = "selectionTool";
|
|
19569
|
-
const SELECTION_TOOL_STATE = {
|
|
19570
|
-
["IDLE"]: "idle",
|
|
19571
|
-
["SELECTING"]: "selection"
|
|
19572
|
-
};
|
|
19573
|
-
|
|
19574
19609
|
//#endregion
|
|
19575
19610
|
//#region src/nodes/stage/stage.ts
|
|
19576
19611
|
var WeaveStageNode = class extends WeaveNode {
|
|
@@ -20026,7 +20061,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
20026
20061
|
text.on("transformstart", (e) => {
|
|
20027
20062
|
this.instance.emitEvent("onTransform", e.target);
|
|
20028
20063
|
});
|
|
20029
|
-
text.on("transform", (0, import_lodash.throttle)(handleTextTransform, 50));
|
|
20064
|
+
text.on("transform", (0, import_lodash$1.throttle)(handleTextTransform, 50));
|
|
20030
20065
|
text.on("transformend", () => {
|
|
20031
20066
|
this.instance.emitEvent("onTransform", null);
|
|
20032
20067
|
});
|
|
@@ -20382,7 +20417,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
20382
20417
|
tr.nodes([textNode]);
|
|
20383
20418
|
tr.show();
|
|
20384
20419
|
}
|
|
20385
|
-
this.instance.triggerAction(
|
|
20420
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
20386
20421
|
}
|
|
20387
20422
|
stage.container().tabIndex = 1;
|
|
20388
20423
|
stage.container().click();
|
|
@@ -20461,7 +20496,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
20461
20496
|
if (window.weaveDragImageURL) {
|
|
20462
20497
|
this.instance.getStage().setPointersPositions(e);
|
|
20463
20498
|
const position = this.instance.getStage().getRelativePointerPosition();
|
|
20464
|
-
this.instance.triggerAction(
|
|
20499
|
+
this.instance.triggerAction(IMAGE_TOOL_ACTION_NAME, {
|
|
20465
20500
|
imageURL: window.weaveDragImageURL,
|
|
20466
20501
|
position
|
|
20467
20502
|
});
|
|
@@ -20637,7 +20672,7 @@ var WeaveImageToolAction = class extends WeaveAction {
|
|
|
20637
20672
|
if (selectionPlugin) {
|
|
20638
20673
|
const node = stage.findOne(`#${this.imageId}`);
|
|
20639
20674
|
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
20640
|
-
this.instance.triggerAction(
|
|
20675
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
20641
20676
|
}
|
|
20642
20677
|
stage.container().style.cursor = "default";
|
|
20643
20678
|
this.initialCursor = null;
|
|
@@ -21319,7 +21354,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
21319
21354
|
const stage = this.instance.getStage();
|
|
21320
21355
|
const image = stage.findOne(`#${imageAttrs.id}`);
|
|
21321
21356
|
const internalImage = image?.findOne(`#${imageAttrs.id}-image`);
|
|
21322
|
-
if (image && internalImage && !imageAttrs.adding && imageAttrs.cropInfo && !(0, import_lodash.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
|
|
21357
|
+
if (image && internalImage && !imageAttrs.adding && imageAttrs.cropInfo && !(0, import_lodash$1.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
|
|
21323
21358
|
const actualScale = imageAttrs.uncroppedImage.width / imageAttrs.imageInfo.width;
|
|
21324
21359
|
internalImage.width(imageAttrs.uncroppedImage.width);
|
|
21325
21360
|
internalImage.height(imageAttrs.uncroppedImage.height);
|
|
@@ -21336,7 +21371,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
21336
21371
|
internalImage.height(imageAttrs.cropSize.height);
|
|
21337
21372
|
this.cachedCropInfo[imageAttrs.id ?? ""] = imageAttrs.cropInfo;
|
|
21338
21373
|
}
|
|
21339
|
-
if (image && internalImage && !imageAttrs.adding && !imageAttrs.cropInfo && !(0, import_lodash.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
|
|
21374
|
+
if (image && internalImage && !imageAttrs.adding && !imageAttrs.cropInfo && !(0, import_lodash$1.isEqual)(imageAttrs.cropInfo, this.cachedCropInfo[imageAttrs.id ?? ""])) {
|
|
21340
21375
|
internalImage.width(imageAttrs.uncroppedImage.width);
|
|
21341
21376
|
internalImage.height(imageAttrs.uncroppedImage.height);
|
|
21342
21377
|
internalImage.rotation(0);
|
|
@@ -21349,7 +21384,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
21349
21384
|
}
|
|
21350
21385
|
}
|
|
21351
21386
|
getImageToolAction() {
|
|
21352
|
-
const imageToolAction = this.instance.getActionHandler(
|
|
21387
|
+
const imageToolAction = this.instance.getActionHandler(IMAGE_TOOL_ACTION_NAME);
|
|
21353
21388
|
if (!imageToolAction) throw new Error("Image Tool action not found");
|
|
21354
21389
|
return imageToolAction;
|
|
21355
21390
|
}
|
|
@@ -21710,7 +21745,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
21710
21745
|
const text = new Konva.Text({
|
|
21711
21746
|
id: `${id}-title`,
|
|
21712
21747
|
x: 0,
|
|
21713
|
-
width: props.frameWidth
|
|
21748
|
+
width: props.frameWidth,
|
|
21714
21749
|
fontSize: fontSize / stage.scaleX(),
|
|
21715
21750
|
fontFamily,
|
|
21716
21751
|
fontStyle,
|
|
@@ -21786,6 +21821,16 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
21786
21821
|
listening: false,
|
|
21787
21822
|
draggable: false
|
|
21788
21823
|
});
|
|
21824
|
+
frame.getExportClientRect = (config) => {
|
|
21825
|
+
const textBox = text.getClientRect(config);
|
|
21826
|
+
const containerAreaBox = containerArea.getClientRect(config);
|
|
21827
|
+
return {
|
|
21828
|
+
x: textBox.x,
|
|
21829
|
+
y: textBox.y,
|
|
21830
|
+
width: containerAreaBox.width,
|
|
21831
|
+
height: containerAreaBox.height + textBox.height
|
|
21832
|
+
};
|
|
21833
|
+
};
|
|
21789
21834
|
frame.getClientRect = (config) => {
|
|
21790
21835
|
return containerArea.getClientRect(config);
|
|
21791
21836
|
};
|
|
@@ -21804,7 +21849,7 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
21804
21849
|
this.instance.addEventListener("onZoomChange", () => {
|
|
21805
21850
|
const stage$1 = this.instance.getStage();
|
|
21806
21851
|
text.fontSize(fontSize / stage$1.scaleX());
|
|
21807
|
-
text.width(props.frameWidth
|
|
21852
|
+
text.width(props.frameWidth);
|
|
21808
21853
|
const textMeasures$1 = text.measureSize(text.getAttrs().text ?? "");
|
|
21809
21854
|
const textHeight$1 = textMeasures$1.height + 2 * titleMargin / stage$1.scaleX();
|
|
21810
21855
|
text.y(-textHeight$1);
|
|
@@ -22060,7 +22105,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22060
22105
|
constructor(params) {
|
|
22061
22106
|
super();
|
|
22062
22107
|
const { config } = params ?? {};
|
|
22063
|
-
this.config = (0, import_lodash.merge)(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
|
|
22108
|
+
this.config = (0, import_lodash$1.merge)(WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, config);
|
|
22064
22109
|
if (!this.config.zoomSteps.includes(this.config.defaultZoom)) throw new Error(`Default zoom ${this.config.defaultZoom} is not in zoom steps`);
|
|
22065
22110
|
this.pinching = false;
|
|
22066
22111
|
this.isTrackpad = false;
|
|
@@ -22088,7 +22133,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22088
22133
|
this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
|
|
22089
22134
|
}
|
|
22090
22135
|
};
|
|
22091
|
-
mainLayer?.on("draw", (0, import_lodash.throttle)(handleDraw, 50));
|
|
22136
|
+
mainLayer?.on("draw", (0, import_lodash$1.throttle)(handleDraw, 50));
|
|
22092
22137
|
this.setZoom(this.config.zoomSteps[this.actualStep]);
|
|
22093
22138
|
}
|
|
22094
22139
|
setZoom(scale, centered = true, pointer) {
|
|
@@ -22204,13 +22249,22 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22204
22249
|
}
|
|
22205
22250
|
fitToScreen() {
|
|
22206
22251
|
if (!this.enabled) return;
|
|
22252
|
+
const stage = this.instance.getStage();
|
|
22207
22253
|
const mainLayer = this.instance.getMainLayer();
|
|
22208
22254
|
if (!mainLayer) return;
|
|
22255
|
+
const container = stage.container();
|
|
22256
|
+
const rect = container.getBoundingClientRect();
|
|
22257
|
+
const containerWidth = rect.width;
|
|
22258
|
+
const containerHeight = rect.height;
|
|
22259
|
+
const centerPoint = {
|
|
22260
|
+
x: containerWidth / 2,
|
|
22261
|
+
y: containerHeight / 2
|
|
22262
|
+
};
|
|
22209
22263
|
if (mainLayer?.getChildren().length === 0) {
|
|
22264
|
+
stage.position(centerPoint);
|
|
22210
22265
|
this.setZoom(this.config.zoomSteps[this.defaultStep]);
|
|
22211
22266
|
return;
|
|
22212
22267
|
}
|
|
22213
|
-
const stage = this.instance.getStage();
|
|
22214
22268
|
stage.scale({
|
|
22215
22269
|
x: 1,
|
|
22216
22270
|
y: 1
|
|
@@ -22222,6 +22276,11 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22222
22276
|
let realNodes = mainLayer.getChildren();
|
|
22223
22277
|
realNodes = realNodes.filter((node) => typeof node.getAttrs().visible === "undefined" || node.getAttrs().visible);
|
|
22224
22278
|
const bounds = getBoundingBox(stage, realNodes);
|
|
22279
|
+
if (bounds.width === 0 || bounds.height === 0) {
|
|
22280
|
+
stage.position(centerPoint);
|
|
22281
|
+
this.setZoom(this.config.zoomSteps[this.defaultStep]);
|
|
22282
|
+
return;
|
|
22283
|
+
}
|
|
22225
22284
|
const stageWidth = stage.width();
|
|
22226
22285
|
const stageHeight = stage.height();
|
|
22227
22286
|
const scaleX = (stageWidth - this.config.fitToScreen.padding * 2) / bounds.width;
|
|
@@ -22246,30 +22305,13 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22246
22305
|
if (!selectionPlugin) return;
|
|
22247
22306
|
const nodes = selectionPlugin.getTransformer().getNodes();
|
|
22248
22307
|
if (nodes.length === 0) return;
|
|
22249
|
-
let zoomTransformer = stage.findOne("#zoomTransformer");
|
|
22250
|
-
if (!zoomTransformer) {
|
|
22251
|
-
zoomTransformer = new Konva.Transformer({
|
|
22252
|
-
id: "zoomTransformer",
|
|
22253
|
-
clearBeforeDraw: true,
|
|
22254
|
-
resizeEnabled: false,
|
|
22255
|
-
ignoreStroke: true,
|
|
22256
|
-
rotateEnabled: false,
|
|
22257
|
-
enabledAnchors: [],
|
|
22258
|
-
shouldOverdrawWholeArea: true,
|
|
22259
|
-
scaleX: stage.scaleX(),
|
|
22260
|
-
scaleY: stage.scaleY()
|
|
22261
|
-
});
|
|
22262
|
-
const mainLayer = this.instance.getMainLayer();
|
|
22263
|
-
mainLayer?.add(zoomTransformer);
|
|
22264
|
-
}
|
|
22265
22308
|
this.setZoom(1, false);
|
|
22266
22309
|
stage.setAttrs({
|
|
22267
22310
|
x: 0,
|
|
22268
22311
|
y: 0
|
|
22269
22312
|
});
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
const box = zoomTransformer.__getNodeRect();
|
|
22313
|
+
const box = getBoundingBox(stage, selectionPlugin.getTransformer().getNodes());
|
|
22314
|
+
if (box.width === 0 || box.height === 0) return;
|
|
22273
22315
|
const stageBox = {
|
|
22274
22316
|
width: stage.width(),
|
|
22275
22317
|
height: stage.height()
|
|
@@ -22294,7 +22336,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
22294
22336
|
y: stageY
|
|
22295
22337
|
});
|
|
22296
22338
|
this.setZoom(scale, false);
|
|
22297
|
-
zoomTransformer.destroy();
|
|
22298
22339
|
}
|
|
22299
22340
|
enable() {
|
|
22300
22341
|
this.enabled = true;
|
|
@@ -22582,7 +22623,7 @@ var WeaveFitToSelectionToolAction = class extends WeaveAction {
|
|
|
22582
22623
|
}
|
|
22583
22624
|
cleanup() {
|
|
22584
22625
|
const stage = this.instance.getStage();
|
|
22585
|
-
this.instance.triggerAction(this.previousAction);
|
|
22626
|
+
if (this.previousAction) this.instance.triggerAction(this.previousAction);
|
|
22586
22627
|
stage.container().style.cursor = "default";
|
|
22587
22628
|
}
|
|
22588
22629
|
};
|
|
@@ -23424,7 +23465,7 @@ var WeavePenToolAction = class extends WeaveAction {
|
|
|
23424
23465
|
if (selectionPlugin) {
|
|
23425
23466
|
const node = stage.findOne(`#${this.lineId}`);
|
|
23426
23467
|
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
23427
|
-
this.instance.triggerAction(
|
|
23468
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
23428
23469
|
}
|
|
23429
23470
|
stage.container().style.cursor = "default";
|
|
23430
23471
|
this.initialCursor = null;
|
|
@@ -23504,6 +23545,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
23504
23545
|
stage.on("pointerdown touchstart", handlePointerDown);
|
|
23505
23546
|
const handlePointerMove = (e) => {
|
|
23506
23547
|
if (this.state !== BRUSH_TOOL_STATE.DEFINE_STROKE) return;
|
|
23548
|
+
stage.container().style.cursor = "crosshair";
|
|
23507
23549
|
const pointPressure = this.getPointPressure(e);
|
|
23508
23550
|
this.handleMovement(pointPressure);
|
|
23509
23551
|
e.evt.stopPropagation();
|
|
@@ -23617,9 +23659,10 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
23617
23659
|
});
|
|
23618
23660
|
const realNode = this.instance.getStage().findOne(`#${tempStroke.getAttrs().id}`);
|
|
23619
23661
|
if (realNode) realNode.destroy();
|
|
23620
|
-
this.instance.addNode(nodeHandler.serialize(tempStroke), this.container?.getAttrs().id);
|
|
23662
|
+
if (tempStroke.getAttrs().strokeElements.length >= 3) this.instance.addNode(nodeHandler.serialize(tempStroke), this.container?.getAttrs().id);
|
|
23621
23663
|
}
|
|
23622
23664
|
this.clickPoint = null;
|
|
23665
|
+
stage.container().style.cursor = "crosshair";
|
|
23623
23666
|
stage.container().tabIndex = 1;
|
|
23624
23667
|
stage.container().focus();
|
|
23625
23668
|
this.setState(BRUSH_TOOL_STATE.IDLE);
|
|
@@ -23651,7 +23694,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
23651
23694
|
if (selectionPlugin) {
|
|
23652
23695
|
const node = stage.findOne(`#${this.strokeId}`);
|
|
23653
23696
|
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
23654
|
-
this.instance.triggerAction(
|
|
23697
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
23655
23698
|
}
|
|
23656
23699
|
this.clickPoint = null;
|
|
23657
23700
|
this.setState(BRUSH_TOOL_STATE.INACTIVE);
|
|
@@ -24207,7 +24250,7 @@ var WeaveArrowToolAction = class extends WeaveAction {
|
|
|
24207
24250
|
if (selectionPlugin) {
|
|
24208
24251
|
const node = stage.findOne(`#${this.arrowId}`);
|
|
24209
24252
|
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
24210
|
-
this.instance.triggerAction(
|
|
24253
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
24211
24254
|
}
|
|
24212
24255
|
stage.container().style.cursor = "default";
|
|
24213
24256
|
this.initialCursor = null;
|
|
@@ -24525,7 +24568,7 @@ var WeaveFrameToolAction = class extends WeaveAction {
|
|
|
24525
24568
|
if (selectionPlugin) {
|
|
24526
24569
|
const node = stage.findOne(`#${this.frameId}-selector-area`);
|
|
24527
24570
|
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
24528
|
-
this.instance.triggerAction(
|
|
24571
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
24529
24572
|
}
|
|
24530
24573
|
this.frameId = null;
|
|
24531
24574
|
this.container = void 0;
|
|
@@ -24555,12 +24598,13 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
24555
24598
|
}
|
|
24556
24599
|
async exportStage(boundingNodes) {
|
|
24557
24600
|
const mainLayer = this.instance.getMainLayer();
|
|
24558
|
-
const img = await this.instance.exportNodes(
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24601
|
+
const img = await this.instance.exportNodes(
|
|
24602
|
+
// mainLayer?.find('.node') ?? [],
|
|
24603
|
+
mainLayer?.getChildren() ?? [],
|
|
24604
|
+
boundingNodes,
|
|
24605
|
+
this.options
|
|
24606
|
+
);
|
|
24607
|
+
return img;
|
|
24564
24608
|
}
|
|
24565
24609
|
async trigger(cancelAction, { boundingNodes, options }) {
|
|
24566
24610
|
if (!this.instance) throw new Error("Instance not defined");
|
|
@@ -24572,14 +24616,16 @@ var WeaveExportStageToolAction = class extends WeaveAction {
|
|
|
24572
24616
|
...this.defaultFormatOptions,
|
|
24573
24617
|
...options
|
|
24574
24618
|
};
|
|
24575
|
-
await this.exportStage(boundingNodes ?? ((nodes) => nodes));
|
|
24619
|
+
const img = await this.exportStage(boundingNodes ?? ((nodes) => nodes));
|
|
24620
|
+
this.cancelAction?.();
|
|
24621
|
+
return img;
|
|
24576
24622
|
}
|
|
24577
24623
|
cleanup() {
|
|
24578
24624
|
const stage = this.instance.getStage();
|
|
24579
24625
|
stage.container().tabIndex = 0;
|
|
24580
24626
|
stage.container().click();
|
|
24581
24627
|
stage.container().focus();
|
|
24582
|
-
this.instance.triggerAction(
|
|
24628
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
24583
24629
|
}
|
|
24584
24630
|
};
|
|
24585
24631
|
|
|
@@ -24604,13 +24650,9 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
|
|
|
24604
24650
|
}
|
|
24605
24651
|
async exportNodes(nodes, boundingNodes) {
|
|
24606
24652
|
const img = await this.instance.exportNodes(nodes, boundingNodes ?? ((nodes$1) => nodes$1), this.options);
|
|
24607
|
-
|
|
24608
|
-
link.href = img.src;
|
|
24609
|
-
link.download = `${v4_default()}${WEAVE_EXPORT_FILE_FORMAT[this.options.format ?? WEAVE_EXPORT_FORMATS.PNG]}`;
|
|
24610
|
-
link.click();
|
|
24611
|
-
this.cancelAction?.();
|
|
24653
|
+
return img;
|
|
24612
24654
|
}
|
|
24613
|
-
async trigger(cancelAction, { nodes, boundingNodes, options, triggerSelectionTool = true
|
|
24655
|
+
async trigger(cancelAction, { nodes, boundingNodes, options, triggerSelectionTool = true }) {
|
|
24614
24656
|
if (!this.instance) throw new Error("Instance not defined");
|
|
24615
24657
|
const stage = this.instance.getStage();
|
|
24616
24658
|
stage.container().tabIndex = 1;
|
|
@@ -24621,20 +24663,16 @@ var WeaveExportNodesToolAction = class extends WeaveAction {
|
|
|
24621
24663
|
...this.defaultFormatOptions,
|
|
24622
24664
|
...options
|
|
24623
24665
|
};
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
this.cancelAction?.();
|
|
24628
|
-
return base64URL;
|
|
24629
|
-
}
|
|
24630
|
-
await this.exportNodes(nodes, boundingNodes ?? ((nodes$1) => nodes$1));
|
|
24666
|
+
const img = await this.exportNodes(nodes, boundingNodes ?? ((nodes$1) => nodes$1));
|
|
24667
|
+
this.cancelAction?.();
|
|
24668
|
+
return img;
|
|
24631
24669
|
}
|
|
24632
24670
|
cleanup() {
|
|
24633
24671
|
const stage = this.instance.getStage();
|
|
24634
24672
|
stage.container().tabIndex = 0;
|
|
24635
24673
|
stage.container().click();
|
|
24636
24674
|
stage.container().focus();
|
|
24637
|
-
if (this.triggerSelectionTool) this.instance.triggerAction(
|
|
24675
|
+
if (this.triggerSelectionTool) this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
24638
24676
|
}
|
|
24639
24677
|
};
|
|
24640
24678
|
|
|
@@ -24879,7 +24917,7 @@ var WeaveAlignNodesToolAction = class extends WeaveAction {
|
|
|
24879
24917
|
this.alignNodes(alignTo);
|
|
24880
24918
|
}
|
|
24881
24919
|
cleanup() {
|
|
24882
|
-
if (this.triggerSelectionTool) this.instance.triggerAction(
|
|
24920
|
+
if (this.triggerSelectionTool) this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
24883
24921
|
this.setState(ALIGN_NODES_TOOL_STATE.IDLE);
|
|
24884
24922
|
}
|
|
24885
24923
|
};
|
|
@@ -24900,6 +24938,7 @@ const WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO = 4;
|
|
|
24900
24938
|
const WEAVE_GRID_DEFAULT_RADIUS = 1;
|
|
24901
24939
|
const WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO = 2;
|
|
24902
24940
|
const WEAVE_GRID_DEFAULT_MAJOR_EVERY = 10;
|
|
24941
|
+
const WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS = 300;
|
|
24903
24942
|
const WEAVE_GRID_LAYER_ID = "gridLayer";
|
|
24904
24943
|
|
|
24905
24944
|
//#endregion
|
|
@@ -24916,6 +24955,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
|
|
|
24916
24955
|
gridColor: WEAVE_GRID_DEFAULT_COLOR,
|
|
24917
24956
|
gridOriginColor: WEAVE_GRID_DEFAULT_ORIGIN_COLOR,
|
|
24918
24957
|
gridSize: WEAVE_GRID_DEFAULT_SIZE,
|
|
24958
|
+
gridDotMaxDotsPerAxis: WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS,
|
|
24919
24959
|
...config
|
|
24920
24960
|
};
|
|
24921
24961
|
}
|
|
@@ -24950,19 +24990,19 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
|
|
|
24950
24990
|
});
|
|
24951
24991
|
stage.on("pointerdown", (e) => {
|
|
24952
24992
|
const activeAction = this.instance.getActiveAction();
|
|
24953
|
-
if (e && e.evt.button === 0 && activeAction ===
|
|
24993
|
+
if (e && e.evt.button === 0 && activeAction === MOVE_TOOL_ACTION_NAME) this.moveToolActive = true;
|
|
24954
24994
|
if (e && (e.evt.button === 2 || e.evt.buttons === 4)) this.isMouseMiddleButtonPressed = true;
|
|
24955
24995
|
});
|
|
24956
24996
|
stage.on("pointerup", (e) => {
|
|
24957
24997
|
const activeAction = this.instance.getActiveAction();
|
|
24958
|
-
if (e && e.evt.button === 0 && activeAction ===
|
|
24998
|
+
if (e && e.evt.button === 0 && activeAction === MOVE_TOOL_ACTION_NAME) this.moveToolActive = false;
|
|
24959
24999
|
if (e && (e.evt.button === 1 || e.evt.buttons === 0)) this.isMouseMiddleButtonPressed = false;
|
|
24960
25000
|
});
|
|
24961
25001
|
const handleMouseMove = () => {
|
|
24962
25002
|
if (!this.enabled || !(this.isSpaceKeyPressed || this.isMouseMiddleButtonPressed || this.moveToolActive)) return;
|
|
24963
25003
|
this.onRender();
|
|
24964
25004
|
};
|
|
24965
|
-
stage.on("pointermove", (0, import_lodash.throttle)(handleMouseMove, 50));
|
|
25005
|
+
stage.on("pointermove", (0, import_lodash$1.throttle)(handleMouseMove, 50));
|
|
24966
25006
|
stage.on("pointermove", () => {
|
|
24967
25007
|
if (this.enabled) this.onRender();
|
|
24968
25008
|
});
|
|
@@ -24994,11 +25034,11 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
|
|
|
24994
25034
|
const snappedSpacing = baseGridSpacing * Math.pow(2, logFactor);
|
|
24995
25035
|
return snappedSpacing;
|
|
24996
25036
|
}
|
|
24997
|
-
getAdjustedSpacing(startX, endX, startY, endY, baseSpacing = 50
|
|
25037
|
+
getAdjustedSpacing(startX, endX, startY, endY, baseSpacing = 50) {
|
|
24998
25038
|
let spacing = baseSpacing;
|
|
24999
25039
|
let dotCountX = Math.ceil((endX - startX) / spacing);
|
|
25000
25040
|
let dotCountY = Math.ceil((endY - startY) / spacing);
|
|
25001
|
-
while ((dotCountX >
|
|
25041
|
+
while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && spacing < 1e6) {
|
|
25002
25042
|
spacing *= 2;
|
|
25003
25043
|
dotCountX = Math.ceil((endX - startX) / spacing);
|
|
25004
25044
|
dotCountY = Math.ceil((endY - startY) / spacing);
|
|
@@ -25081,13 +25121,17 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
|
|
|
25081
25121
|
let adjustedSpacing = spacing;
|
|
25082
25122
|
let dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
|
|
25083
25123
|
let dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
|
|
25084
|
-
|
|
25085
|
-
while ((dotCountX > maxDotsPerAxis || dotCountY > maxDotsPerAxis) && adjustedSpacing < 1e6) {
|
|
25124
|
+
while ((dotCountX > this.config.gridDotMaxDotsPerAxis || dotCountY > this.config.gridDotMaxDotsPerAxis) && adjustedSpacing < 1e6) {
|
|
25086
25125
|
adjustedSpacing *= 2;
|
|
25087
25126
|
dotCountX = Math.ceil((endX - startX) / adjustedSpacing);
|
|
25088
25127
|
dotCountY = Math.ceil((endY - startY) / adjustedSpacing);
|
|
25089
25128
|
}
|
|
25090
25129
|
this.getAdjustedSpacing(startX, endX, startY, endY, spacing);
|
|
25130
|
+
console.log({
|
|
25131
|
+
dotCountX,
|
|
25132
|
+
dotCountY,
|
|
25133
|
+
adjustedSpacing
|
|
25134
|
+
});
|
|
25091
25135
|
startX = Math.floor((offsetX - margin * worldWidth) / adjustedSpacing) * adjustedSpacing;
|
|
25092
25136
|
startY = Math.floor((offsetY - margin * worldHeight) / adjustedSpacing) * adjustedSpacing;
|
|
25093
25137
|
const highlightEvery = this.config.gridMajorEvery ?? WEAVE_GRID_DEFAULT_MAJOR_EVERY;
|
|
@@ -25230,7 +25274,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
25230
25274
|
if (this.pointers.size > 1) return;
|
|
25231
25275
|
const activeAction = this.instance.getActiveAction();
|
|
25232
25276
|
let enableMove = false;
|
|
25233
|
-
if (e && (e.evt.pointerType !== "mouse" || e.evt.pointerType === "mouse" && e.evt.buttons === 1) && activeAction ===
|
|
25277
|
+
if (e && (e.evt.pointerType !== "mouse" || e.evt.pointerType === "mouse" && e.evt.buttons === 1) && activeAction === MOVE_TOOL_ACTION_NAME) {
|
|
25234
25278
|
this.moveToolActive = true;
|
|
25235
25279
|
enableMove = true;
|
|
25236
25280
|
}
|
|
@@ -25415,7 +25459,7 @@ var WeaveConnectedUsersPlugin = class extends WeavePlugin {
|
|
|
25415
25459
|
newConnectedUsers[userInformation.id] = userInformation;
|
|
25416
25460
|
}
|
|
25417
25461
|
}
|
|
25418
|
-
if (!(0, import_lodash.isEqual)(this.connectedUsers, newConnectedUsers)) this.instance.emitEvent("onConnectedUsersChange", newConnectedUsers);
|
|
25462
|
+
if (!(0, import_lodash$1.isEqual)(this.connectedUsers, newConnectedUsers)) this.instance.emitEvent("onConnectedUsersChange", newConnectedUsers);
|
|
25419
25463
|
this.connectedUsers = newConnectedUsers;
|
|
25420
25464
|
});
|
|
25421
25465
|
}
|
|
@@ -26178,5 +26222,5 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
26178
26222
|
};
|
|
26179
26223
|
|
|
26180
26224
|
//#endregion
|
|
26181
|
-
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, ARROW_TOOL_ACTION_NAME, ARROW_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, 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, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_GRID_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveZoomInToolAction, WeaveZoomOutToolAction, clearContainerTargets, containerOverCursor, containsNodeDeep, getBoundingBox, getContrastTextColor, getTargetedNode, hasFrames, hasImages, intersectArrays, isNodeInSelection, moveNodeToContainer, resetScale, stringToColor };
|
|
26225
|
+
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, ARROW_TOOL_ACTION_NAME, ARROW_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, 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, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_GRID_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveZoomInToolAction, WeaveZoomOutToolAction, clearContainerTargets, containerOverCursor, containsNodeDeep, getBoundingBox, getContrastTextColor, getExportBoundingBox, getTargetedNode, hasFrames, hasImages, intersectArrays, isNodeInSelection, moveNodeToContainer, resetScale, stringToColor };
|
|
26182
26226
|
//# sourceMappingURL=sdk.js.map
|