@inditextech/weave-sdk 2.3.2 → 2.4.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.d.ts +120 -8
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +602 -24
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.node.d.ts +58 -22
- package/dist/sdk.node.d.ts.map +1 -1
- package/dist/sdk.node.js +323 -24
- package/dist/sdk.node.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -17806,6 +17806,10 @@ function getTargetAndSkipNodes(instance, e, forceTransformer = false) {
|
|
|
17806
17806
|
if (e.type === "dragmove" && nodesSelectionPlugin && nodesSelectionPlugin.getTransformer().nodes().length === 1) {
|
|
17807
17807
|
node = nodesSelectionPlugin.getTransformer().nodes()[0];
|
|
17808
17808
|
skipNodes.push(node.getAttrs().id ?? "");
|
|
17809
|
+
if (node.getAttr("eventTarget")) {
|
|
17810
|
+
node = e.target;
|
|
17811
|
+
skipNodes.push(e.target.getAttrs().id ?? "");
|
|
17812
|
+
}
|
|
17809
17813
|
}
|
|
17810
17814
|
if (e.type === "dragmove" && nodesSelectionPlugin && nodesSelectionPlugin.getTransformer().nodes().length > 1) {
|
|
17811
17815
|
const { nodes } = getSelectedNodesMetadata(nodesSelectionPlugin.getTransformer());
|
|
@@ -18704,27 +18708,27 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18704
18708
|
if (shape) {
|
|
18705
18709
|
const targetNode = this.instance.getInstanceRecursive(shape);
|
|
18706
18710
|
if (targetNode && targetNode !== nodeHovered) {
|
|
18707
|
-
this.instance.getStage().handleMouseover();
|
|
18708
|
-
nodeHovered?.handleMouseout();
|
|
18709
|
-
targetNode?.handleMouseover();
|
|
18711
|
+
this.instance.getStage().handleMouseover?.();
|
|
18712
|
+
nodeHovered?.handleMouseout?.();
|
|
18713
|
+
targetNode?.handleMouseover?.();
|
|
18710
18714
|
nodeHovered = targetNode;
|
|
18711
18715
|
}
|
|
18712
|
-
targetNode?.handleMouseover();
|
|
18713
|
-
} else nodeHovered?.handleMouseout();
|
|
18716
|
+
targetNode?.handleMouseover?.();
|
|
18717
|
+
} else nodeHovered?.handleMouseout?.();
|
|
18714
18718
|
});
|
|
18715
18719
|
tr.on("mouseover", () => {
|
|
18716
18720
|
stage.container().style.cursor = "grab";
|
|
18717
18721
|
});
|
|
18718
18722
|
tr.on("mouseout", () => {
|
|
18719
|
-
this.instance.getStage().handleMouseover();
|
|
18723
|
+
this.instance.getStage().handleMouseover?.();
|
|
18720
18724
|
nodeHovered = void 0;
|
|
18721
18725
|
});
|
|
18722
18726
|
window.addEventListener("mouseout", () => {
|
|
18723
18727
|
if (nodeHovered) {
|
|
18724
|
-
nodeHovered
|
|
18728
|
+
nodeHovered?.handleMouseout?.();
|
|
18725
18729
|
nodeHovered = void 0;
|
|
18726
18730
|
}
|
|
18727
|
-
this.instance.getStage().handleMouseover();
|
|
18731
|
+
this.instance.getStage().handleMouseover?.();
|
|
18728
18732
|
});
|
|
18729
18733
|
const handleTransform = (e) => {
|
|
18730
18734
|
const moved = this.checkMoved(e);
|
|
@@ -19047,7 +19051,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19047
19051
|
if (!this.tapStart) return false;
|
|
19048
19052
|
const dx = actual.x - init.x;
|
|
19049
19053
|
const dy = actual.y - init.y;
|
|
19050
|
-
const dist = Math.
|
|
19054
|
+
const dist = Math.hypot(dx, dy);
|
|
19051
19055
|
const MOVED_DISTANCE = 5;
|
|
19052
19056
|
if (dist <= MOVED_DISTANCE) return false;
|
|
19053
19057
|
return true;
|
|
@@ -19056,7 +19060,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19056
19060
|
if (!this.tapStart) return false;
|
|
19057
19061
|
const dx = e.evt.clientX - this.tapStart.x;
|
|
19058
19062
|
const dy = e.evt.clientY - this.tapStart.y;
|
|
19059
|
-
const dist = Math.
|
|
19063
|
+
const dist = Math.hypot(dx, dy);
|
|
19060
19064
|
const MOVED_DISTANCE = 5;
|
|
19061
19065
|
if (dist <= MOVED_DISTANCE) return false;
|
|
19062
19066
|
return true;
|
|
@@ -19066,7 +19070,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19066
19070
|
const now$2 = performance.now();
|
|
19067
19071
|
const dx = e.evt.clientX - this.tapStart.x;
|
|
19068
19072
|
const dy = e.evt.clientY - this.tapStart.y;
|
|
19069
|
-
const dist = Math.
|
|
19073
|
+
const dist = Math.hypot(dx, dy);
|
|
19070
19074
|
const DOUBLE_TAP_DISTANCE = 10;
|
|
19071
19075
|
const DOUBLE_TAP_TIME = 300;
|
|
19072
19076
|
this.isDoubleTap = false;
|
|
@@ -20049,6 +20053,7 @@ var WeaveNode = class {
|
|
|
20049
20053
|
node.on("transform", (0, import_lodash.throttle)(handleTransform, 100));
|
|
20050
20054
|
node.on("transformend", (e) => {
|
|
20051
20055
|
const node$1 = e.target;
|
|
20056
|
+
e.target.setAttr("strokeScaleEnabled", true);
|
|
20052
20057
|
this.instance.emitEvent("onTransform", null);
|
|
20053
20058
|
transforming = false;
|
|
20054
20059
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
@@ -20095,7 +20100,7 @@ var WeaveNode = class {
|
|
|
20095
20100
|
}
|
|
20096
20101
|
const realNodeTarget = this.getRealSelectedNode(nodeTarget);
|
|
20097
20102
|
if (realNodeTarget.getAttrs().isCloned) return;
|
|
20098
|
-
if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1) {
|
|
20103
|
+
if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1 && realNodeTarget.getAttr("dragStartOpacity") === void 0) {
|
|
20099
20104
|
realNodeTarget.setAttr("dragStartOpacity", realNodeTarget.opacity());
|
|
20100
20105
|
realNodeTarget.opacity(this.getNodesSelectionPlugin()?.getDragOpacity());
|
|
20101
20106
|
}
|
|
@@ -20168,7 +20173,7 @@ var WeaveNode = class {
|
|
|
20168
20173
|
}
|
|
20169
20174
|
this.instance.emitEvent("onDrag", null);
|
|
20170
20175
|
const realNodeTarget = this.getRealSelectedNode(nodeTarget);
|
|
20171
|
-
if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1) {
|
|
20176
|
+
if (this.getNodesSelectionPlugin()?.getSelectedNodes().length === 1 && realNodeTarget.getAttr("dragStartOpacity") !== void 0) {
|
|
20172
20177
|
const originalNodeOpacity = realNodeTarget.getAttr("dragStartOpacity") ?? 1;
|
|
20173
20178
|
realNodeTarget.setAttrs({ opacity: originalNodeOpacity });
|
|
20174
20179
|
realNodeTarget.setAttr("dragStartOpacity", void 0);
|
|
@@ -20453,7 +20458,7 @@ var WeaveAction = class {
|
|
|
20453
20458
|
if (!this.tapStart) return false;
|
|
20454
20459
|
const dx = e.evt.clientX - this.tapStart.x;
|
|
20455
20460
|
const dy = e.evt.clientY - this.tapStart.y;
|
|
20456
|
-
const dist = Math.
|
|
20461
|
+
const dist = Math.hypot(dx, dy);
|
|
20457
20462
|
const dt = performance.now() - this.tapStart.time;
|
|
20458
20463
|
const TAP_DISTANCE = 10;
|
|
20459
20464
|
const TAP_TIME = 300;
|
|
@@ -21137,15 +21142,75 @@ var WeaveEllipseNode = class extends WeaveNode {
|
|
|
21137
21142
|
//#endregion
|
|
21138
21143
|
//#region src/nodes/line/constants.ts
|
|
21139
21144
|
const WEAVE_LINE_NODE_TYPE = "line";
|
|
21145
|
+
const WEAVE_LINE_NODE_DEFAULT_CONFIG = { snapAngles: {
|
|
21146
|
+
angles: [
|
|
21147
|
+
0,
|
|
21148
|
+
45,
|
|
21149
|
+
90,
|
|
21150
|
+
135,
|
|
21151
|
+
180,
|
|
21152
|
+
225,
|
|
21153
|
+
270,
|
|
21154
|
+
315
|
|
21155
|
+
],
|
|
21156
|
+
activateThreshold: 5,
|
|
21157
|
+
releaseThreshold: 10
|
|
21158
|
+
} };
|
|
21159
|
+
|
|
21160
|
+
//#endregion
|
|
21161
|
+
//#region src/utils/greedy-snapper.ts
|
|
21162
|
+
var GreedySnapper = class {
|
|
21163
|
+
snappedAngle = null;
|
|
21164
|
+
constructor(config) {
|
|
21165
|
+
this.config = config;
|
|
21166
|
+
}
|
|
21167
|
+
reset() {
|
|
21168
|
+
this.snappedAngle = null;
|
|
21169
|
+
}
|
|
21170
|
+
apply(angleDeg) {
|
|
21171
|
+
const { snapAngles, activateThreshold, releaseThreshold } = this.config;
|
|
21172
|
+
const normalized = (angleDeg % 360 + 360) % 360;
|
|
21173
|
+
if (this.snappedAngle !== null) {
|
|
21174
|
+
const diff = Math.abs(normalized - this.snappedAngle);
|
|
21175
|
+
if (diff > releaseThreshold) {
|
|
21176
|
+
this.snappedAngle = null;
|
|
21177
|
+
return normalized;
|
|
21178
|
+
}
|
|
21179
|
+
return this.snappedAngle;
|
|
21180
|
+
}
|
|
21181
|
+
let closest = snapAngles[0];
|
|
21182
|
+
let minDiff = Math.abs(normalized - closest);
|
|
21183
|
+
for (const a of snapAngles) {
|
|
21184
|
+
const d = Math.abs(normalized - a);
|
|
21185
|
+
if (d < minDiff) {
|
|
21186
|
+
minDiff = d;
|
|
21187
|
+
closest = a;
|
|
21188
|
+
}
|
|
21189
|
+
}
|
|
21190
|
+
if (minDiff <= activateThreshold) {
|
|
21191
|
+
this.snappedAngle = closest;
|
|
21192
|
+
return closest;
|
|
21193
|
+
}
|
|
21194
|
+
return normalized;
|
|
21195
|
+
}
|
|
21196
|
+
};
|
|
21140
21197
|
|
|
21141
21198
|
//#endregion
|
|
21142
21199
|
//#region src/nodes/line/line.ts
|
|
21143
21200
|
var WeaveLineNode = class extends WeaveNode {
|
|
21201
|
+
startHandle = null;
|
|
21202
|
+
endHandle = null;
|
|
21144
21203
|
nodeType = WEAVE_LINE_NODE_TYPE;
|
|
21145
21204
|
constructor(params) {
|
|
21146
21205
|
super();
|
|
21147
|
-
|
|
21148
|
-
this.
|
|
21206
|
+
this.config = mergeExceptArrays(WEAVE_LINE_NODE_DEFAULT_CONFIG, params?.config ?? {});
|
|
21207
|
+
this.handleNodeChanges = null;
|
|
21208
|
+
this.handleZoomChanges = null;
|
|
21209
|
+
this.snapper = new GreedySnapper({
|
|
21210
|
+
snapAngles: this.config.snapAngles.angles,
|
|
21211
|
+
activateThreshold: this.config.snapAngles.activateThreshold,
|
|
21212
|
+
releaseThreshold: this.config.snapAngles.releaseThreshold
|
|
21213
|
+
});
|
|
21149
21214
|
}
|
|
21150
21215
|
onRender(props) {
|
|
21151
21216
|
const line = new Konva.Line({
|
|
@@ -21156,11 +21221,240 @@ var WeaveLineNode = class extends WeaveNode {
|
|
|
21156
21221
|
this.setupDefaultNodeAugmentation(line);
|
|
21157
21222
|
const defaultTransformerProperties = this.defaultGetTransformerProperties(this.config.transform);
|
|
21158
21223
|
line.getTransformerProperties = function() {
|
|
21159
|
-
return
|
|
21224
|
+
return {
|
|
21225
|
+
...defaultTransformerProperties,
|
|
21226
|
+
ignoreStroke: true,
|
|
21227
|
+
rotateEnabled: this.points().length !== 4,
|
|
21228
|
+
keepRatio: this.points().length !== 4,
|
|
21229
|
+
flipEnabled: this.points().length === 4,
|
|
21230
|
+
shiftBehavior: this.points().length === 4 ? "none" : "default"
|
|
21231
|
+
};
|
|
21232
|
+
};
|
|
21233
|
+
let originalStartHandleVisibility = null;
|
|
21234
|
+
let originalEndHandleVisibility = null;
|
|
21235
|
+
line.on("dragstart", () => {
|
|
21236
|
+
originalStartHandleVisibility = this.startHandle?.visible() ?? false;
|
|
21237
|
+
originalEndHandleVisibility = this.endHandle?.visible() ?? false;
|
|
21238
|
+
this.startHandle?.visible(false);
|
|
21239
|
+
this.endHandle?.visible(false);
|
|
21240
|
+
});
|
|
21241
|
+
line.on("dragend", () => {
|
|
21242
|
+
this.startHandle?.visible(originalStartHandleVisibility);
|
|
21243
|
+
this.endHandle?.visible(originalEndHandleVisibility);
|
|
21244
|
+
originalStartHandleVisibility = null;
|
|
21245
|
+
originalEndHandleVisibility = null;
|
|
21246
|
+
});
|
|
21247
|
+
line.allowedAnchors = function() {
|
|
21248
|
+
if (this.points().length !== 4) return [
|
|
21249
|
+
"top-left",
|
|
21250
|
+
"top-center",
|
|
21251
|
+
"top-right",
|
|
21252
|
+
"middle-right",
|
|
21253
|
+
"middle-left",
|
|
21254
|
+
"bottom-left",
|
|
21255
|
+
"bottom-center",
|
|
21256
|
+
"bottom-right"
|
|
21257
|
+
];
|
|
21258
|
+
return [];
|
|
21160
21259
|
};
|
|
21161
21260
|
this.setupDefaultNodeEvents(line);
|
|
21261
|
+
if (!this.handleZoomChanges) {
|
|
21262
|
+
this.handleZoomChanges = () => {
|
|
21263
|
+
if (this.startHandle) this.startHandle.scale({
|
|
21264
|
+
x: 1 / this.instance.getStage().scaleX(),
|
|
21265
|
+
y: 1 / this.instance.getStage().scaleY()
|
|
21266
|
+
});
|
|
21267
|
+
if (this.endHandle) this.endHandle.scale({
|
|
21268
|
+
x: 1 / this.instance.getStage().scaleX(),
|
|
21269
|
+
y: 1 / this.instance.getStage().scaleY()
|
|
21270
|
+
});
|
|
21271
|
+
};
|
|
21272
|
+
this.instance.addEventListener("onZoomChange", this.handleZoomChanges);
|
|
21273
|
+
}
|
|
21274
|
+
if (!this.handleNodeChanges) {
|
|
21275
|
+
this.handleNodeChanges = (nodes) => {
|
|
21276
|
+
if (nodes.length === 1 && nodes[0].instance.getAttrs().nodeType === "line" && nodes[0].instance.points().length === 4) {
|
|
21277
|
+
const lineSelected = this.instance.getStage().findOne(`#${nodes[0].instance.getAttrs().id}`);
|
|
21278
|
+
if (!lineSelected) return;
|
|
21279
|
+
this.setupHandles();
|
|
21280
|
+
this.showHandles(lineSelected);
|
|
21281
|
+
} else {
|
|
21282
|
+
this.startHandle?.setAttr("lineId", void 0);
|
|
21283
|
+
this.startHandle?.visible(false);
|
|
21284
|
+
this.endHandle?.setAttr("lineId", void 0);
|
|
21285
|
+
this.endHandle?.visible(false);
|
|
21286
|
+
}
|
|
21287
|
+
};
|
|
21288
|
+
this.instance.addEventListener("onNodesChange", this.handleNodeChanges);
|
|
21289
|
+
}
|
|
21162
21290
|
return line;
|
|
21163
21291
|
}
|
|
21292
|
+
defineFinalPoint(handle, origin, e) {
|
|
21293
|
+
let pos = {
|
|
21294
|
+
x: 0,
|
|
21295
|
+
y: 0
|
|
21296
|
+
};
|
|
21297
|
+
if (e.evt.shiftKey) {
|
|
21298
|
+
const handlePosition = handle.position();
|
|
21299
|
+
let dx = handlePosition.x - origin.x;
|
|
21300
|
+
let dy = handlePosition.y - origin.y;
|
|
21301
|
+
const angle = Math.atan2(dy, dx);
|
|
21302
|
+
const angleDeg = angle * 180 / Math.PI;
|
|
21303
|
+
const snapped = this.snapper.apply(angleDeg);
|
|
21304
|
+
const dist = Math.hypot(dx, dy);
|
|
21305
|
+
const rad = snapped * Math.PI / 180;
|
|
21306
|
+
dx = Math.cos(rad) * dist;
|
|
21307
|
+
dy = Math.sin(rad) * dist;
|
|
21308
|
+
pos.x = origin.x + dx;
|
|
21309
|
+
pos.y = origin.y + dy;
|
|
21310
|
+
} else pos = handle.position();
|
|
21311
|
+
return pos;
|
|
21312
|
+
}
|
|
21313
|
+
setupHandles() {
|
|
21314
|
+
if (!this.startHandle) {
|
|
21315
|
+
const startHandle = new Konva.Circle({
|
|
21316
|
+
id: "line-start-handle",
|
|
21317
|
+
radius: 5,
|
|
21318
|
+
fill: "#ffffff",
|
|
21319
|
+
stroke: "#000000",
|
|
21320
|
+
strokeWidth: 1,
|
|
21321
|
+
edgeDistanceDisableOnDrag: true,
|
|
21322
|
+
scaleX: 1 / this.instance.getStage().scaleX(),
|
|
21323
|
+
scaleY: 1 / this.instance.getStage().scaleY(),
|
|
21324
|
+
draggable: true
|
|
21325
|
+
});
|
|
21326
|
+
startHandle.on("pointerover", () => {
|
|
21327
|
+
this.instance.getStage().container().style.cursor = "move";
|
|
21328
|
+
});
|
|
21329
|
+
startHandle.on("pointerout", () => {
|
|
21330
|
+
this.instance.getStage().container().style.cursor = "default";
|
|
21331
|
+
});
|
|
21332
|
+
startHandle.on("dragstart", (e) => {
|
|
21333
|
+
const lineId = e.target.getAttr("lineId");
|
|
21334
|
+
const line = this.instance.getStage().findOne(`#${lineId}`);
|
|
21335
|
+
if (!line) return;
|
|
21336
|
+
if (line.points().length === 4) line.setAttr("eventTarget", true);
|
|
21337
|
+
this.instance.emitEvent("onDrag", e.target);
|
|
21338
|
+
});
|
|
21339
|
+
startHandle.on("dragmove", (e) => {
|
|
21340
|
+
const draggedTarget = e.target;
|
|
21341
|
+
const lineId = draggedTarget.getAttr("lineId");
|
|
21342
|
+
const draggedLine = this.instance.getStage().findOne(`#${lineId}`);
|
|
21343
|
+
if (!draggedLine) return;
|
|
21344
|
+
const pos = this.defineFinalPoint(startHandle, {
|
|
21345
|
+
x: draggedLine.x() + draggedLine.points()[2],
|
|
21346
|
+
y: draggedLine.y() + draggedLine.points()[3]
|
|
21347
|
+
}, e);
|
|
21348
|
+
const [, , x2, y2] = draggedLine.points();
|
|
21349
|
+
startHandle.position(pos);
|
|
21350
|
+
draggedLine.points([
|
|
21351
|
+
pos.x - draggedLine.x(),
|
|
21352
|
+
pos.y - draggedLine.y(),
|
|
21353
|
+
x2,
|
|
21354
|
+
y2
|
|
21355
|
+
]);
|
|
21356
|
+
});
|
|
21357
|
+
startHandle.on("dragend", (e) => {
|
|
21358
|
+
const draggedTarget = e.target;
|
|
21359
|
+
const lineId = draggedTarget.getAttr("lineId");
|
|
21360
|
+
const draggedLine = this.instance.getStage().findOne(`#${lineId}`);
|
|
21361
|
+
if (!draggedLine) return;
|
|
21362
|
+
const { x, y } = startHandle.position();
|
|
21363
|
+
const [, , x2, y2] = draggedLine.points();
|
|
21364
|
+
draggedLine.points([
|
|
21365
|
+
x - draggedLine.x(),
|
|
21366
|
+
y - draggedLine.y(),
|
|
21367
|
+
x2,
|
|
21368
|
+
y2
|
|
21369
|
+
]);
|
|
21370
|
+
this.instance.updateNode(this.serialize(draggedLine));
|
|
21371
|
+
this.instance.emitEvent("onDrag", null);
|
|
21372
|
+
});
|
|
21373
|
+
this.startHandle = startHandle;
|
|
21374
|
+
this.startHandle.visible(false);
|
|
21375
|
+
this.instance.getSelectionLayer()?.add(this.startHandle);
|
|
21376
|
+
}
|
|
21377
|
+
if (!this.endHandle) {
|
|
21378
|
+
const endHandle = new Konva.Circle({
|
|
21379
|
+
id: "line-end-handle",
|
|
21380
|
+
radius: 5,
|
|
21381
|
+
fill: "#ffffff",
|
|
21382
|
+
stroke: "#000000",
|
|
21383
|
+
strokeWidth: 1,
|
|
21384
|
+
edgeDistanceDisableOnDrag: true,
|
|
21385
|
+
scaleX: 1 / this.instance.getStage().scaleX(),
|
|
21386
|
+
scaleY: 1 / this.instance.getStage().scaleY(),
|
|
21387
|
+
draggable: true
|
|
21388
|
+
});
|
|
21389
|
+
endHandle.on("pointerover", () => {
|
|
21390
|
+
this.instance.getStage().container().style.cursor = "move";
|
|
21391
|
+
});
|
|
21392
|
+
endHandle.on("pointerout", () => {
|
|
21393
|
+
this.instance.getStage().container().style.cursor = "default";
|
|
21394
|
+
});
|
|
21395
|
+
endHandle.on("dragstart", (e) => {
|
|
21396
|
+
const lineId = e.target.getAttr("lineId");
|
|
21397
|
+
const line = this.instance.getStage().findOne(`#${lineId}`);
|
|
21398
|
+
if (!line) return;
|
|
21399
|
+
if (line.points().length === 4) line.setAttr("eventTarget", true);
|
|
21400
|
+
this.instance.emitEvent("onDrag", e.target);
|
|
21401
|
+
});
|
|
21402
|
+
endHandle.on("dragmove", (e) => {
|
|
21403
|
+
const draggedTarget = e.target;
|
|
21404
|
+
const lineId = draggedTarget.getAttr("lineId");
|
|
21405
|
+
const draggedLine = this.instance.getStage().findOne(`#${lineId}`);
|
|
21406
|
+
if (!draggedLine) return;
|
|
21407
|
+
const pos = this.defineFinalPoint(endHandle, {
|
|
21408
|
+
x: draggedLine.x() + draggedLine.points()[0],
|
|
21409
|
+
y: draggedLine.y() + draggedLine.points()[1]
|
|
21410
|
+
}, e);
|
|
21411
|
+
const [x1, y1] = draggedLine.points();
|
|
21412
|
+
endHandle.position(pos);
|
|
21413
|
+
draggedLine.points([
|
|
21414
|
+
x1,
|
|
21415
|
+
y1,
|
|
21416
|
+
pos.x - draggedLine.x(),
|
|
21417
|
+
pos.y - draggedLine.y()
|
|
21418
|
+
]);
|
|
21419
|
+
});
|
|
21420
|
+
endHandle.on("dragend", (e) => {
|
|
21421
|
+
const draggedTarget = e.target;
|
|
21422
|
+
const lineId = draggedTarget.getAttr("lineId");
|
|
21423
|
+
const draggedLine = this.instance.getStage().findOne(`#${lineId}`);
|
|
21424
|
+
if (!draggedLine) return;
|
|
21425
|
+
const { x, y } = endHandle.position();
|
|
21426
|
+
const [x1, y1] = draggedLine.points();
|
|
21427
|
+
draggedLine.points([
|
|
21428
|
+
x1,
|
|
21429
|
+
y1,
|
|
21430
|
+
x - draggedLine.x(),
|
|
21431
|
+
y - draggedLine.y()
|
|
21432
|
+
]);
|
|
21433
|
+
this.instance.updateNode(this.serialize(draggedLine));
|
|
21434
|
+
this.instance.emitEvent("onDrag", null);
|
|
21435
|
+
});
|
|
21436
|
+
this.endHandle = endHandle;
|
|
21437
|
+
this.endHandle.visible(false);
|
|
21438
|
+
this.instance.getSelectionLayer()?.add(this.endHandle);
|
|
21439
|
+
}
|
|
21440
|
+
}
|
|
21441
|
+
showHandles(line) {
|
|
21442
|
+
const [x1, y1, x2, y2] = line.points();
|
|
21443
|
+
if (this.startHandle === null || this.endHandle === null) return;
|
|
21444
|
+
const lineId = line.getAttrs().id;
|
|
21445
|
+
this.startHandle.setAttr("lineId", lineId);
|
|
21446
|
+
this.startHandle.setAttr("targetNode", lineId);
|
|
21447
|
+
this.startHandle.x(line.x() + x1);
|
|
21448
|
+
this.startHandle.y(line.y() + y1);
|
|
21449
|
+
this.startHandle.visible(true);
|
|
21450
|
+
this.startHandle.moveToTop();
|
|
21451
|
+
this.endHandle.setAttr("lineId", lineId);
|
|
21452
|
+
this.endHandle.setAttr("targetNode", lineId);
|
|
21453
|
+
this.endHandle.x(line.x() + x2);
|
|
21454
|
+
this.endHandle.y(line.y() + y2);
|
|
21455
|
+
this.endHandle.visible(true);
|
|
21456
|
+
this.endHandle.moveToTop();
|
|
21457
|
+
}
|
|
21164
21458
|
onUpdate(nodeInstance, nextProps) {
|
|
21165
21459
|
nodeInstance.setAttrs({ ...nextProps });
|
|
21166
21460
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
@@ -23125,7 +23419,7 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
23125
23419
|
const p1 = centerline[i + 1];
|
|
23126
23420
|
const dx = p1.x - p0.x;
|
|
23127
23421
|
const dy = p1.y - p0.y;
|
|
23128
|
-
const segLen = Math.
|
|
23422
|
+
const segLen = Math.hypot(dx, dy) || 1;
|
|
23129
23423
|
const nx = -dy / segLen;
|
|
23130
23424
|
const ny = dx / segLen;
|
|
23131
23425
|
const w0 = baseW * p0.pressure / 2;
|
|
@@ -24822,7 +25116,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
24822
25116
|
this.enabled = false;
|
|
24823
25117
|
}
|
|
24824
25118
|
getDistance(p1, p2) {
|
|
24825
|
-
return Math.
|
|
25119
|
+
return Math.hypot(p2.x - p1.x, p2.y - p1.y);
|
|
24826
25120
|
}
|
|
24827
25121
|
getCenter(p1, p2) {
|
|
24828
25122
|
return {
|
|
@@ -29708,7 +30002,11 @@ var WeaveNodesEdgeSnappingPlugin = class extends WeavePlugin {
|
|
|
29708
30002
|
if (nodesSelectionPlugin && nodesSelectionPlugin.getTransformer().nodes().length > 1) {
|
|
29709
30003
|
if (nodesSelectionPlugin) nodeParent = this.instance.getNodeContainer(nodesSelectionPlugin.getTransformer().nodes()[0]);
|
|
29710
30004
|
}
|
|
29711
|
-
if (nodesSelectionPlugin && nodesSelectionPlugin.getTransformer().nodes().length === 1)
|
|
30005
|
+
if (nodesSelectionPlugin && nodesSelectionPlugin.getTransformer().nodes().length === 1) if (node.getAttrs().targetNode) {
|
|
30006
|
+
const targetNodeId = node.getAttrs().targetNode;
|
|
30007
|
+
const targetNode = this.instance.getStage().findOne(`#${targetNodeId}`);
|
|
30008
|
+
if (targetNode) nodeParent = this.instance.getNodeContainer(targetNode);
|
|
30009
|
+
} else nodeParent = this.instance.getNodeContainer(node);
|
|
29712
30010
|
return nodeParent;
|
|
29713
30011
|
}
|
|
29714
30012
|
cleanupGuidelines() {
|
|
@@ -29996,6 +30294,7 @@ var WeaveNodesDistanceSnappingPlugin = class extends WeavePlugin {
|
|
|
29996
30294
|
const utilityLayer = this.instance.getUtilityLayer();
|
|
29997
30295
|
if (!this.enabled) return;
|
|
29998
30296
|
if (!utilityLayer) return;
|
|
30297
|
+
if (e.target.getAttr("edgeDistanceDisableOnDrag")) return;
|
|
29999
30298
|
const { targetNode: node, skipNodes } = getTargetAndSkipNodes(this.instance, e, true);
|
|
30000
30299
|
if (typeof node === "undefined") return;
|
|
30001
30300
|
const nodeParent = this.getSelectionParentNode();
|
|
@@ -30911,8 +31210,8 @@ var WeaveGroupsManager = class {
|
|
|
30911
31210
|
}
|
|
30912
31211
|
extractTransformFromMatrix(m) {
|
|
30913
31212
|
const a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5];
|
|
30914
|
-
const scaleX = Math.
|
|
30915
|
-
const scaleY = Math.
|
|
31213
|
+
const scaleX = Math.hypot(a, b);
|
|
31214
|
+
const scaleY = Math.hypot(c, d);
|
|
30916
31215
|
const rotation = Math.atan2(b, a) * (180 / Math.PI);
|
|
30917
31216
|
return {
|
|
30918
31217
|
x: e,
|
|
@@ -31738,7 +32037,7 @@ var WeaveRegisterManager = class {
|
|
|
31738
32037
|
|
|
31739
32038
|
//#endregion
|
|
31740
32039
|
//#region package.json
|
|
31741
|
-
var version = "2.
|
|
32040
|
+
var version = "2.4.0";
|
|
31742
32041
|
|
|
31743
32042
|
//#endregion
|
|
31744
32043
|
//#region src/managers/setup.ts
|
|
@@ -32788,11 +33087,290 @@ var Weave = class {
|
|
|
32788
33087
|
}
|
|
32789
33088
|
};
|
|
32790
33089
|
|
|
33090
|
+
//#endregion
|
|
33091
|
+
//#region src/actions/line-tool/constants.ts
|
|
33092
|
+
const LINE_TOOL_ACTION_NAME = "lineTool";
|
|
33093
|
+
const LINE_TOOL_STATE = {
|
|
33094
|
+
["IDLE"]: "idle",
|
|
33095
|
+
["ADDING"]: "adding",
|
|
33096
|
+
["DEFINING_SIZE"]: "definingSize",
|
|
33097
|
+
["ADDED"]: "added"
|
|
33098
|
+
};
|
|
33099
|
+
const LINE_TOOL_DEFAULT_CONFIG = { snapAngles: {
|
|
33100
|
+
angles: [
|
|
33101
|
+
0,
|
|
33102
|
+
45,
|
|
33103
|
+
90,
|
|
33104
|
+
135,
|
|
33105
|
+
180,
|
|
33106
|
+
225,
|
|
33107
|
+
270,
|
|
33108
|
+
315
|
|
33109
|
+
],
|
|
33110
|
+
activateThreshold: 5,
|
|
33111
|
+
releaseThreshold: 10
|
|
33112
|
+
} };
|
|
33113
|
+
|
|
33114
|
+
//#endregion
|
|
33115
|
+
//#region src/actions/line-tool/line-tool.ts
|
|
33116
|
+
var WeaveLineToolAction = class extends WeaveAction {
|
|
33117
|
+
initialized = false;
|
|
33118
|
+
initialCursor = null;
|
|
33119
|
+
snappedAngle = null;
|
|
33120
|
+
shiftPressed = false;
|
|
33121
|
+
onPropsChange = void 0;
|
|
33122
|
+
onInit = void 0;
|
|
33123
|
+
constructor(params) {
|
|
33124
|
+
super();
|
|
33125
|
+
this.config = mergeExceptArrays(LINE_TOOL_DEFAULT_CONFIG, params?.config ?? {});
|
|
33126
|
+
this.pointers = new Map();
|
|
33127
|
+
this.initialized = false;
|
|
33128
|
+
this.state = LINE_TOOL_STATE.IDLE;
|
|
33129
|
+
this.lineId = null;
|
|
33130
|
+
this.shiftPressed = false;
|
|
33131
|
+
this.tempLineId = null;
|
|
33132
|
+
this.tempMainLineNode = null;
|
|
33133
|
+
this.tempLineNode = null;
|
|
33134
|
+
this.container = void 0;
|
|
33135
|
+
this.snappedAngle = null;
|
|
33136
|
+
this.measureContainer = void 0;
|
|
33137
|
+
this.clickPoint = null;
|
|
33138
|
+
this.snapper = new GreedySnapper({
|
|
33139
|
+
snapAngles: this.config.snapAngles.angles,
|
|
33140
|
+
activateThreshold: this.config.snapAngles.activateThreshold,
|
|
33141
|
+
releaseThreshold: this.config.snapAngles.releaseThreshold
|
|
33142
|
+
});
|
|
33143
|
+
this.props = this.initProps();
|
|
33144
|
+
}
|
|
33145
|
+
getName() {
|
|
33146
|
+
return LINE_TOOL_ACTION_NAME;
|
|
33147
|
+
}
|
|
33148
|
+
initProps() {
|
|
33149
|
+
return {
|
|
33150
|
+
stroke: "#000000ff",
|
|
33151
|
+
strokeWidth: 1,
|
|
33152
|
+
opacity: 1
|
|
33153
|
+
};
|
|
33154
|
+
}
|
|
33155
|
+
setupEvents() {
|
|
33156
|
+
const stage = this.instance.getStage();
|
|
33157
|
+
window.addEventListener("keydown", (e) => {
|
|
33158
|
+
if (e.code === "Enter" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33159
|
+
this.cancelAction();
|
|
33160
|
+
return;
|
|
33161
|
+
}
|
|
33162
|
+
if (e.code === "Escape" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33163
|
+
this.cancelAction();
|
|
33164
|
+
return;
|
|
33165
|
+
}
|
|
33166
|
+
if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33167
|
+
this.snappedAngle = null;
|
|
33168
|
+
this.shiftPressed = true;
|
|
33169
|
+
}
|
|
33170
|
+
});
|
|
33171
|
+
window.addEventListener("keyup", (e) => {
|
|
33172
|
+
if (e.key === "Shift" && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33173
|
+
this.snappedAngle = null;
|
|
33174
|
+
this.shiftPressed = false;
|
|
33175
|
+
}
|
|
33176
|
+
});
|
|
33177
|
+
stage.on("pointerdown", (e) => {
|
|
33178
|
+
this.setTapStart(e);
|
|
33179
|
+
this.pointers.set(e.evt.pointerId, {
|
|
33180
|
+
x: e.evt.clientX,
|
|
33181
|
+
y: e.evt.clientY
|
|
33182
|
+
});
|
|
33183
|
+
if (this.pointers.size === 2 && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33184
|
+
this.state = LINE_TOOL_STATE.ADDING;
|
|
33185
|
+
return;
|
|
33186
|
+
}
|
|
33187
|
+
if (!this.tempMainLineNode && this.state === LINE_TOOL_STATE.ADDING) this.handleAdding();
|
|
33188
|
+
if (this.tempMainLineNode && this.state === LINE_TOOL_STATE.ADDING) this.state = LINE_TOOL_STATE.DEFINING_SIZE;
|
|
33189
|
+
});
|
|
33190
|
+
stage.on("pointermove", () => {
|
|
33191
|
+
if (this.state === LINE_TOOL_STATE.IDLE) return;
|
|
33192
|
+
this.setCursor();
|
|
33193
|
+
if (this.pointers.size === 2 && this.instance.getActiveAction() === LINE_TOOL_ACTION_NAME) {
|
|
33194
|
+
this.state = LINE_TOOL_STATE.ADDING;
|
|
33195
|
+
return;
|
|
33196
|
+
}
|
|
33197
|
+
if (this.state === LINE_TOOL_STATE.DEFINING_SIZE) this.handleMovement();
|
|
33198
|
+
});
|
|
33199
|
+
stage.on("pointerup", (e) => {
|
|
33200
|
+
this.pointers.delete(e.evt.pointerId);
|
|
33201
|
+
if (this.state === LINE_TOOL_STATE.DEFINING_SIZE) this.handleSettingSize();
|
|
33202
|
+
});
|
|
33203
|
+
this.initialized = true;
|
|
33204
|
+
}
|
|
33205
|
+
setState(state) {
|
|
33206
|
+
this.state = state;
|
|
33207
|
+
}
|
|
33208
|
+
addLine() {
|
|
33209
|
+
this.setCursor();
|
|
33210
|
+
this.setFocusStage();
|
|
33211
|
+
this.instance.emitEvent("onAddingLine");
|
|
33212
|
+
this.shiftPressed = false;
|
|
33213
|
+
this.clickPoint = null;
|
|
33214
|
+
this.setState(LINE_TOOL_STATE.ADDING);
|
|
33215
|
+
}
|
|
33216
|
+
handleAdding() {
|
|
33217
|
+
const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
|
|
33218
|
+
this.clickPoint = mousePoint;
|
|
33219
|
+
this.container = container;
|
|
33220
|
+
this.measureContainer = measureContainer;
|
|
33221
|
+
this.lineId = v4_default();
|
|
33222
|
+
this.tempLineId = v4_default();
|
|
33223
|
+
if (!this.tempLineNode) {
|
|
33224
|
+
this.tempMainLineNode = new Konva.Line({
|
|
33225
|
+
...this.props,
|
|
33226
|
+
id: this.lineId,
|
|
33227
|
+
strokeScaleEnabled: true,
|
|
33228
|
+
x: this.clickPoint?.x ?? 0,
|
|
33229
|
+
y: this.clickPoint?.y ?? 0,
|
|
33230
|
+
points: [0, 0]
|
|
33231
|
+
});
|
|
33232
|
+
this.measureContainer?.add(this.tempMainLineNode);
|
|
33233
|
+
this.tempLineNode = new Konva.Line({
|
|
33234
|
+
...this.props,
|
|
33235
|
+
id: this.tempLineId,
|
|
33236
|
+
x: this.clickPoint?.x ?? 0,
|
|
33237
|
+
y: this.clickPoint?.y ?? 0,
|
|
33238
|
+
strokeScaleEnabled: true,
|
|
33239
|
+
points: [0, 0]
|
|
33240
|
+
});
|
|
33241
|
+
this.measureContainer?.add(this.tempLineNode);
|
|
33242
|
+
this.setState(LINE_TOOL_STATE.DEFINING_SIZE);
|
|
33243
|
+
}
|
|
33244
|
+
}
|
|
33245
|
+
defineFinalPoint() {
|
|
33246
|
+
if (!this.tempLineNode || !this.measureContainer) return {
|
|
33247
|
+
x: 0,
|
|
33248
|
+
y: 0
|
|
33249
|
+
};
|
|
33250
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
|
|
33251
|
+
const pos = {
|
|
33252
|
+
x: 0,
|
|
33253
|
+
y: 0
|
|
33254
|
+
};
|
|
33255
|
+
if (this.shiftPressed) {
|
|
33256
|
+
let dx = mousePoint.x - (this.tempLineNode.x() + this.tempLineNode.points()[0]);
|
|
33257
|
+
let dy = mousePoint.y - (this.tempLineNode.y() + this.tempLineNode.points()[1]);
|
|
33258
|
+
const angle = Math.atan2(dy, dx);
|
|
33259
|
+
const angleDeg = angle * 180 / Math.PI;
|
|
33260
|
+
const snapped = this.snapper.apply(angleDeg);
|
|
33261
|
+
const dist = Math.hypot(dx, dy);
|
|
33262
|
+
const rad = snapped * Math.PI / 180;
|
|
33263
|
+
dx = Math.cos(rad) * dist;
|
|
33264
|
+
dy = Math.sin(rad) * dist;
|
|
33265
|
+
pos.x = this.tempLineNode.points()[0] + dx;
|
|
33266
|
+
pos.y = this.tempLineNode.points()[1] + dy;
|
|
33267
|
+
} else {
|
|
33268
|
+
pos.x = mousePoint.x - this.tempLineNode.x();
|
|
33269
|
+
pos.y = mousePoint.y - this.tempLineNode.y();
|
|
33270
|
+
}
|
|
33271
|
+
return pos;
|
|
33272
|
+
}
|
|
33273
|
+
handleSettingSize() {
|
|
33274
|
+
if (this.lineId && this.tempLineNode && this.tempMainLineNode && this.measureContainer) {
|
|
33275
|
+
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
|
|
33276
|
+
const pos = this.defineFinalPoint();
|
|
33277
|
+
const newPoints = [
|
|
33278
|
+
...this.tempMainLineNode.points(),
|
|
33279
|
+
pos.x,
|
|
33280
|
+
pos.y
|
|
33281
|
+
];
|
|
33282
|
+
this.tempMainLineNode.setAttrs({
|
|
33283
|
+
...this.props,
|
|
33284
|
+
points: newPoints
|
|
33285
|
+
});
|
|
33286
|
+
this.tempLineNode.setAttrs({
|
|
33287
|
+
...this.props,
|
|
33288
|
+
x: mousePoint.x,
|
|
33289
|
+
y: mousePoint.y,
|
|
33290
|
+
points: [0, 0]
|
|
33291
|
+
});
|
|
33292
|
+
this.cancelAction();
|
|
33293
|
+
}
|
|
33294
|
+
}
|
|
33295
|
+
handleMovement() {
|
|
33296
|
+
if (this.state !== LINE_TOOL_STATE.DEFINING_SIZE) return;
|
|
33297
|
+
if (this.tempLineNode && this.measureContainer) {
|
|
33298
|
+
const pos = this.defineFinalPoint();
|
|
33299
|
+
this.tempLineNode.setAttrs({
|
|
33300
|
+
...this.props,
|
|
33301
|
+
points: [
|
|
33302
|
+
this.tempLineNode.points()[0],
|
|
33303
|
+
this.tempLineNode.points()[1],
|
|
33304
|
+
pos.x,
|
|
33305
|
+
pos.y
|
|
33306
|
+
]
|
|
33307
|
+
});
|
|
33308
|
+
}
|
|
33309
|
+
}
|
|
33310
|
+
trigger(cancelAction) {
|
|
33311
|
+
if (!this.instance) throw new Error("Instance not defined");
|
|
33312
|
+
if (!this.initialized) this.setupEvents();
|
|
33313
|
+
const stage = this.instance.getStage();
|
|
33314
|
+
stage.container().tabIndex = 1;
|
|
33315
|
+
stage.container().focus();
|
|
33316
|
+
this.cancelAction = cancelAction;
|
|
33317
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
33318
|
+
if (selectionPlugin) selectionPlugin.setSelectedNodes([]);
|
|
33319
|
+
this.props = this.initProps();
|
|
33320
|
+
this.addLine();
|
|
33321
|
+
}
|
|
33322
|
+
cleanup() {
|
|
33323
|
+
const stage = this.instance.getStage();
|
|
33324
|
+
this.tempLineNode?.destroy();
|
|
33325
|
+
if (this.lineId && this.tempMainLineNode?.points().length === 4) {
|
|
33326
|
+
const nodeHandler = this.instance.getNodeHandler("line");
|
|
33327
|
+
if (nodeHandler) {
|
|
33328
|
+
const clonedLine = this.tempMainLineNode.clone();
|
|
33329
|
+
nodeHandler.scaleReset(clonedLine);
|
|
33330
|
+
this.tempMainLineNode.destroy();
|
|
33331
|
+
const node = nodeHandler.create(this.lineId, {
|
|
33332
|
+
...this.props,
|
|
33333
|
+
...clonedLine.getAttrs(),
|
|
33334
|
+
hitStrokeWidth: 16
|
|
33335
|
+
});
|
|
33336
|
+
this.instance.addNode(node, this.container?.getAttrs().id);
|
|
33337
|
+
this.instance.emitEvent("onAddedLine");
|
|
33338
|
+
}
|
|
33339
|
+
}
|
|
33340
|
+
const selectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
33341
|
+
if (selectionPlugin) {
|
|
33342
|
+
const node = stage.findOne(`#${this.lineId}`);
|
|
33343
|
+
if (node) selectionPlugin.setSelectedNodes([node]);
|
|
33344
|
+
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
33345
|
+
}
|
|
33346
|
+
stage.container().style.cursor = "default";
|
|
33347
|
+
this.initialCursor = null;
|
|
33348
|
+
this.lineId = null;
|
|
33349
|
+
this.tempMainLineNode = null;
|
|
33350
|
+
this.tempLineId = null;
|
|
33351
|
+
this.tempLineNode = null;
|
|
33352
|
+
this.container = void 0;
|
|
33353
|
+
this.measureContainer = void 0;
|
|
33354
|
+
this.clickPoint = null;
|
|
33355
|
+
this.setState(LINE_TOOL_STATE.IDLE);
|
|
33356
|
+
}
|
|
33357
|
+
setCursor() {
|
|
33358
|
+
const stage = this.instance.getStage();
|
|
33359
|
+
stage.container().style.cursor = "crosshair";
|
|
33360
|
+
}
|
|
33361
|
+
setFocusStage() {
|
|
33362
|
+
const stage = this.instance.getStage();
|
|
33363
|
+
stage.container().tabIndex = 1;
|
|
33364
|
+
stage.container().blur();
|
|
33365
|
+
stage.container().focus();
|
|
33366
|
+
}
|
|
33367
|
+
};
|
|
33368
|
+
|
|
32791
33369
|
//#endregion
|
|
32792
33370
|
//#region src/index.ts
|
|
32793
33371
|
window._weave_isServerSide = false;
|
|
32794
33372
|
window._weave_serverSideBackend = void 0;
|
|
32795
33373
|
|
|
32796
33374
|
//#endregion
|
|
32797
|
-
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_DEFAULT_CONFIG, 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_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, 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, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, 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_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, getBoundingBox, getExportBoundingBox, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, memoize, mergeExceptArrays, moveNodeToContainer, resetScale };
|
|
33375
|
+
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_DEFAULT_CONFIG, 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_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, 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, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, 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_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, getBoundingBox, getExportBoundingBox, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, memoize, mergeExceptArrays, moveNodeToContainer, resetScale };
|
|
32798
33376
|
//# sourceMappingURL=sdk.js.map
|