@inditextech/weave-sdk 3.7.1 → 3.8.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.js +169 -187
- package/dist/sdk.node.js +169 -187
- package/dist/types.d.ts +32 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +169 -187
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/types.js
CHANGED
|
@@ -15102,6 +15102,9 @@ var WeaveStore = class {
|
|
|
15102
15102
|
getStateJson() {
|
|
15103
15103
|
return JSON.parse(JSON.stringify(this.state, void 0, 2));
|
|
15104
15104
|
}
|
|
15105
|
+
getRoomId() {
|
|
15106
|
+
return this.roomId;
|
|
15107
|
+
}
|
|
15105
15108
|
getStateSnapshot() {
|
|
15106
15109
|
const doc = this.getDocument();
|
|
15107
15110
|
return yjs_default.encodeStateAsUpdate(doc);
|
|
@@ -18678,7 +18681,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18678
18681
|
"bottom-right"
|
|
18679
18682
|
];
|
|
18680
18683
|
this.taps = 0;
|
|
18681
|
-
this.isCtrlMetaPressed = false;
|
|
18682
18684
|
this.isSpaceKeyPressed = false;
|
|
18683
18685
|
this.isDoubleTap = false;
|
|
18684
18686
|
this.tapStart = null;
|
|
@@ -18778,12 +18780,12 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18778
18780
|
}
|
|
18779
18781
|
};
|
|
18780
18782
|
stage.on("pointermove", (0, import_throttle.default)(handlePointerMoveInit, DEFAULT_THROTTLE_MS));
|
|
18781
|
-
tr.on("transformstart", () => {
|
|
18783
|
+
tr.on("transformstart", (e) => {
|
|
18782
18784
|
this.transformInProcess = true;
|
|
18783
18785
|
this.triggerSelectedNodesEvent();
|
|
18784
18786
|
const selectedNodes$1 = tr.nodes();
|
|
18785
18787
|
for (const node of selectedNodes$1) {
|
|
18786
|
-
node.handleMouseout();
|
|
18788
|
+
node.handleMouseout(e);
|
|
18787
18789
|
if (node.getAttrs().strokeScaleEnabled !== false) {
|
|
18788
18790
|
node.setAttr("strokeScaleEnabled", false);
|
|
18789
18791
|
node.setAttr("_revertStrokeScaleEnabled", true);
|
|
@@ -18795,7 +18797,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18795
18797
|
});
|
|
18796
18798
|
});
|
|
18797
18799
|
let nodeHovered = void 0;
|
|
18798
|
-
tr.on("mousemove", () => {
|
|
18800
|
+
tr.on("mousemove", (e) => {
|
|
18799
18801
|
if (this.dragInProcess) return;
|
|
18800
18802
|
const pointerPos = stage.getPointerPosition();
|
|
18801
18803
|
if (!pointerPos) return;
|
|
@@ -18805,13 +18807,13 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18805
18807
|
if (shape) {
|
|
18806
18808
|
const targetNode = this.instance.getInstanceRecursive(shape);
|
|
18807
18809
|
if (targetNode && targetNode !== nodeHovered) {
|
|
18808
|
-
this.instance.getStage().handleMouseover();
|
|
18809
|
-
nodeHovered?.handleMouseout?.();
|
|
18810
|
-
targetNode?.handleMouseover?.();
|
|
18810
|
+
this.instance.getStage().handleMouseover(e);
|
|
18811
|
+
nodeHovered?.handleMouseout?.(e);
|
|
18812
|
+
targetNode?.handleMouseover?.(e);
|
|
18811
18813
|
nodeHovered = targetNode;
|
|
18812
18814
|
}
|
|
18813
|
-
targetNode?.handleMouseover?.();
|
|
18814
|
-
} else nodeHovered?.handleMouseout?.();
|
|
18815
|
+
targetNode?.handleMouseover?.(e);
|
|
18816
|
+
} else nodeHovered?.handleMouseout?.(e);
|
|
18815
18817
|
});
|
|
18816
18818
|
tr.on("mouseover", () => {
|
|
18817
18819
|
const nodesSelected = tr.nodes();
|
|
@@ -18820,16 +18822,16 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18820
18822
|
stage.container().style.cursor = node.defineMousePointer() ?? "grab";
|
|
18821
18823
|
} else stage.container().style.cursor = "grab";
|
|
18822
18824
|
});
|
|
18823
|
-
tr.on("mouseout", () => {
|
|
18824
|
-
this.instance.getStage().handleMouseover?.();
|
|
18825
|
+
tr.on("mouseout", (e) => {
|
|
18826
|
+
this.instance.getStage().handleMouseover?.(e);
|
|
18825
18827
|
nodeHovered = void 0;
|
|
18826
18828
|
});
|
|
18827
|
-
window.addEventListener("mouseout", () => {
|
|
18829
|
+
window.addEventListener("mouseout", (e) => {
|
|
18828
18830
|
if (nodeHovered) {
|
|
18829
|
-
nodeHovered.handleMouseout();
|
|
18831
|
+
nodeHovered.handleMouseout(e);
|
|
18830
18832
|
nodeHovered = void 0;
|
|
18831
18833
|
}
|
|
18832
|
-
this.instance.getStage().handleMouseover?.();
|
|
18834
|
+
this.instance.getStage().handleMouseover?.(e);
|
|
18833
18835
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
18834
18836
|
const handleTransform = (e) => {
|
|
18835
18837
|
const moved = this.checkMoved(e);
|
|
@@ -18869,6 +18871,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18869
18871
|
let selectedNodes = [];
|
|
18870
18872
|
tr.on("dragstart", (e) => {
|
|
18871
18873
|
this.dragInProcess = true;
|
|
18874
|
+
let isWheelMousePressed = false;
|
|
18875
|
+
if (e.evt.button === 1) isWheelMousePressed = true;
|
|
18872
18876
|
const mainLayer = this.instance.getMainLayer();
|
|
18873
18877
|
if (!mainLayer) return;
|
|
18874
18878
|
initialPos = {
|
|
@@ -18880,7 +18884,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18880
18884
|
this.saveDragSelectedNodes();
|
|
18881
18885
|
if (this.getDragSelectedNodes().length > 1) this.setNodesOpacityOnDrag();
|
|
18882
18886
|
selectedNodes = tr.nodes();
|
|
18883
|
-
if (
|
|
18887
|
+
if (isWheelMousePressed) {
|
|
18884
18888
|
e.cancelBubble = true;
|
|
18885
18889
|
e.target.stopDrag();
|
|
18886
18890
|
return;
|
|
@@ -18904,13 +18908,14 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
18904
18908
|
x: e.target.x(),
|
|
18905
18909
|
y: e.target.y()
|
|
18906
18910
|
};
|
|
18911
|
+
let isWheelMousePressed = false;
|
|
18912
|
+
if (e.evt.button === 1) isWheelMousePressed = true;
|
|
18907
18913
|
e.cancelBubble = true;
|
|
18908
18914
|
if (initialPos) {
|
|
18909
18915
|
const moved = this.checkMovedDrag(initialPos, actualPos);
|
|
18910
18916
|
if (moved) this.getContextMenuPlugin()?.cancelLongPressTimer();
|
|
18911
18917
|
}
|
|
18912
|
-
|
|
18913
|
-
if (stage$1.isMouseWheelPressed()) {
|
|
18918
|
+
if (isWheelMousePressed) {
|
|
18914
18919
|
e.cancelBubble = true;
|
|
18915
18920
|
e.target.stopDrag();
|
|
18916
18921
|
return;
|
|
@@ -19020,16 +19025,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19020
19025
|
tr.forceUpdate();
|
|
19021
19026
|
}
|
|
19022
19027
|
});
|
|
19023
|
-
this.instance.addEventListener("onRender", () => {
|
|
19024
|
-
const point = stage.getPointerPosition();
|
|
19025
|
-
if (point) {
|
|
19026
|
-
const ele = this.instance.getTargetingManager().pointIntersectsElement(point);
|
|
19027
|
-
if (ele) {
|
|
19028
|
-
const realEle = this.instance.getTargetingManager().resolveNode(ele);
|
|
19029
|
-
realEle?.handleMouseover();
|
|
19030
|
-
}
|
|
19031
|
-
}
|
|
19032
|
-
});
|
|
19033
19028
|
this.instance.addEventListener("onNodesChange", () => {
|
|
19034
19029
|
const currentSelectedNodes = tr.nodes();
|
|
19035
19030
|
const unselectedNodes = this.prevSelectedNodes.filter((node) => !currentSelectedNodes.map((node1) => node1.getAttrs().id).includes(node.getAttrs().id));
|
|
@@ -19236,12 +19231,7 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19236
19231
|
initEvents() {
|
|
19237
19232
|
this.selecting = false;
|
|
19238
19233
|
const stage = this.instance.getStage();
|
|
19239
|
-
window.addEventListener("blur", () => {
|
|
19240
|
-
this.isCtrlMetaPressed = false;
|
|
19241
|
-
this.isSpaceKeyPressed = false;
|
|
19242
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
19243
19234
|
stage.container().addEventListener("keydown", (e) => {
|
|
19244
|
-
if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
|
|
19245
19235
|
if (e.code === "Space") this.isSpaceKeyPressed = true;
|
|
19246
19236
|
if (e.code === "Backspace" || e.code === "Delete") {
|
|
19247
19237
|
Promise.resolve().then(() => {
|
|
@@ -19251,7 +19241,6 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19251
19241
|
}
|
|
19252
19242
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
19253
19243
|
stage.container().addEventListener("keyup", (e) => {
|
|
19254
|
-
if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
|
|
19255
19244
|
if (e.code === "Space") this.isSpaceKeyPressed = false;
|
|
19256
19245
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
19257
19246
|
stage.on("pointerdown", (e) => {
|
|
@@ -19303,7 +19292,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19303
19292
|
this.selectionRectangle.width(0);
|
|
19304
19293
|
this.selectionRectangle.height(0);
|
|
19305
19294
|
this.selecting = true;
|
|
19306
|
-
|
|
19295
|
+
const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
|
|
19296
|
+
if (isCtrlOrMetaPressed) {
|
|
19307
19297
|
const nodesSelected = this.tr.nodes();
|
|
19308
19298
|
for (const node of nodesSelected) node.fire("onSelectionCleared", { bubbles: true });
|
|
19309
19299
|
}
|
|
@@ -19523,7 +19513,8 @@ var WeaveNodesSelectionPlugin = class extends WeavePlugin {
|
|
|
19523
19513
|
nodeTargeted.dblClick();
|
|
19524
19514
|
return;
|
|
19525
19515
|
}
|
|
19526
|
-
|
|
19516
|
+
const isCtrlOrCmdPressed = e.evt.ctrlKey || e.evt.metaKey;
|
|
19517
|
+
if (isCtrlOrCmdPressed) return;
|
|
19527
19518
|
if (!metaPressed) {
|
|
19528
19519
|
this.tr.nodes([nodeTargeted]);
|
|
19529
19520
|
this.tr.show();
|
|
@@ -20165,11 +20156,6 @@ const MOVE_TOOL_STATE = {
|
|
|
20165
20156
|
|
|
20166
20157
|
//#endregion
|
|
20167
20158
|
//#region src/nodes/node.ts
|
|
20168
|
-
const augmentKonvaStageClass = () => {
|
|
20169
|
-
Konva.Stage.prototype.isMouseWheelPressed = function() {
|
|
20170
|
-
return false;
|
|
20171
|
-
};
|
|
20172
|
-
};
|
|
20173
20159
|
const augmentKonvaNodeClass = (config) => {
|
|
20174
20160
|
const { transform } = config ?? {};
|
|
20175
20161
|
Konva.Node.prototype.getTransformerProperties = function() {
|
|
@@ -20476,6 +20462,8 @@ var WeaveNode = class {
|
|
|
20476
20462
|
node.off("dragstart");
|
|
20477
20463
|
node.on("dragstart", (e) => {
|
|
20478
20464
|
const nodeTarget = e.target;
|
|
20465
|
+
let isWheelMousePressed = false;
|
|
20466
|
+
if (e.evt.button === 1) isWheelMousePressed = true;
|
|
20479
20467
|
e.cancelBubble = true;
|
|
20480
20468
|
this.getNodesSelectionFeedbackPlugin()?.hideSelectionHalo(nodeTarget);
|
|
20481
20469
|
this.getSelectionPlugin()?.saveDragSelectedNodes();
|
|
@@ -20496,7 +20484,7 @@ var WeaveNode = class {
|
|
|
20496
20484
|
return;
|
|
20497
20485
|
}
|
|
20498
20486
|
this.instance.emitEvent("onDrag", nodeTarget);
|
|
20499
|
-
if (
|
|
20487
|
+
if (isWheelMousePressed) {
|
|
20500
20488
|
e.cancelBubble = true;
|
|
20501
20489
|
nodeTarget.stopDrag();
|
|
20502
20490
|
}
|
|
@@ -20513,6 +20501,7 @@ var WeaveNode = class {
|
|
|
20513
20501
|
originalNode = realNodeTarget.clone();
|
|
20514
20502
|
originalContainer = realNodeTarget.getParent();
|
|
20515
20503
|
if (originalContainer?.getAttrs().nodeId) originalContainer = stage.findOne(`#${originalContainer.getAttrs().nodeId}`);
|
|
20504
|
+
realNodeTarget.fire("nodeDragStart", { node: realNodeTarget });
|
|
20516
20505
|
if (e.evt?.altKey) {
|
|
20517
20506
|
nodeTarget.setAttrs({ isCloneOrigin: true });
|
|
20518
20507
|
nodeTarget.setAttrs({ isCloned: false });
|
|
@@ -20541,19 +20530,20 @@ var WeaveNode = class {
|
|
|
20541
20530
|
});
|
|
20542
20531
|
const handleDragMove = (e) => {
|
|
20543
20532
|
const nodeTarget = e.target;
|
|
20533
|
+
let isWheelMousePressed = false;
|
|
20534
|
+
if (e.evt.button === 1) isWheelMousePressed = true;
|
|
20544
20535
|
e.cancelBubble = true;
|
|
20545
20536
|
if (e.evt?.buttons === 0) {
|
|
20546
20537
|
nodeTarget.stopDrag();
|
|
20547
20538
|
return;
|
|
20548
20539
|
}
|
|
20549
20540
|
this.didMove = true;
|
|
20550
|
-
const stage$1 = this.instance.getStage();
|
|
20551
20541
|
const isErasing = this.instance.getActiveAction() === "eraseTool";
|
|
20552
20542
|
if (isErasing) {
|
|
20553
20543
|
nodeTarget.stopDrag();
|
|
20554
20544
|
return;
|
|
20555
20545
|
}
|
|
20556
|
-
if (
|
|
20546
|
+
if (isWheelMousePressed) {
|
|
20557
20547
|
e.cancelBubble = true;
|
|
20558
20548
|
nodeTarget.stopDrag();
|
|
20559
20549
|
return;
|
|
@@ -20667,11 +20657,11 @@ var WeaveNode = class {
|
|
|
20667
20657
|
originalPosition = realNodeTarget.getAbsolutePosition();
|
|
20668
20658
|
});
|
|
20669
20659
|
if (!node.getAttrs().overridesMouseControl) {
|
|
20670
|
-
node.handleMouseover = () => {
|
|
20671
|
-
this.handleMouseOver(node);
|
|
20660
|
+
node.handleMouseover = (e) => {
|
|
20661
|
+
this.handleMouseOver(e, node);
|
|
20672
20662
|
};
|
|
20673
|
-
node.handleMouseout = () => {
|
|
20674
|
-
this.handleMouseout(node);
|
|
20663
|
+
node.handleMouseout = (e) => {
|
|
20664
|
+
this.handleMouseout(e, node);
|
|
20675
20665
|
};
|
|
20676
20666
|
}
|
|
20677
20667
|
node.on("xChange yChange", () => {
|
|
@@ -20699,20 +20689,21 @@ var WeaveNode = class {
|
|
|
20699
20689
|
};
|
|
20700
20690
|
node.on("pointerover", (e) => {
|
|
20701
20691
|
const realNodeTarget = this.getRealSelectedNode(e.target);
|
|
20702
|
-
realNodeTarget?.handleMouseover?.();
|
|
20703
|
-
const doCancelBubble = this.handleMouseOver(e.target);
|
|
20692
|
+
realNodeTarget?.handleMouseover?.(e);
|
|
20693
|
+
const doCancelBubble = this.handleMouseOver(e, e.target);
|
|
20704
20694
|
if (doCancelBubble) e.cancelBubble = true;
|
|
20705
20695
|
});
|
|
20706
20696
|
node.on("pointerleave", (e) => {
|
|
20707
20697
|
const realNodeTarget = this.getRealSelectedNode(e.target);
|
|
20708
|
-
realNodeTarget?.handleMouseout?.();
|
|
20709
|
-
this.handleMouseout(e.target);
|
|
20698
|
+
realNodeTarget?.handleMouseout?.(e);
|
|
20699
|
+
this.handleMouseout(e, e.target);
|
|
20710
20700
|
});
|
|
20711
20701
|
}
|
|
20712
20702
|
}
|
|
20713
|
-
handleMouseOver(node) {
|
|
20703
|
+
handleMouseOver(e, node) {
|
|
20714
20704
|
const stage = this.instance.getStage();
|
|
20715
|
-
|
|
20705
|
+
const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
|
|
20706
|
+
if (isCtrlOrMetaPressed) return false;
|
|
20716
20707
|
const user = this.instance.getStore().getUser();
|
|
20717
20708
|
const activeAction = this.instance.getActiveAction();
|
|
20718
20709
|
const isNodeSelectionEnabled = this.getSelectionPlugin()?.isEnabled();
|
|
@@ -20746,9 +20737,9 @@ var WeaveNode = class {
|
|
|
20746
20737
|
else this.hideHoverState();
|
|
20747
20738
|
return cancelBubble;
|
|
20748
20739
|
}
|
|
20749
|
-
handleMouseout(node) {
|
|
20750
|
-
const
|
|
20751
|
-
if (
|
|
20740
|
+
handleMouseout(e, node) {
|
|
20741
|
+
const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
|
|
20742
|
+
if (isCtrlOrMetaPressed) return;
|
|
20752
20743
|
const realNode = this.instance.getInstanceRecursive(node);
|
|
20753
20744
|
if (realNode) this.hideHoverState();
|
|
20754
20745
|
}
|
|
@@ -22033,7 +22024,7 @@ var WeaveRegisterManager = class {
|
|
|
22033
22024
|
|
|
22034
22025
|
//#endregion
|
|
22035
22026
|
//#region package.json
|
|
22036
|
-
var version = "3.
|
|
22027
|
+
var version = "3.8.0";
|
|
22037
22028
|
|
|
22038
22029
|
//#endregion
|
|
22039
22030
|
//#region src/managers/setup.ts
|
|
@@ -23479,7 +23470,6 @@ var Weave = class {
|
|
|
23479
23470
|
this.status = WEAVE_INSTANCE_STATUS.STARTING;
|
|
23480
23471
|
this.emitEvent("onInstanceStatus", this.status);
|
|
23481
23472
|
await this.registerManager.registerNodesHandlers();
|
|
23482
|
-
this.augmentKonvaStageClass();
|
|
23483
23473
|
this.augmentKonvaNodeClass();
|
|
23484
23474
|
this.registerManager.registerPlugins();
|
|
23485
23475
|
this.registerManager.registerActionsHandlers();
|
|
@@ -23551,9 +23541,6 @@ var Weave = class {
|
|
|
23551
23541
|
getConfiguration() {
|
|
23552
23542
|
return this.config;
|
|
23553
23543
|
}
|
|
23554
|
-
augmentKonvaStageClass() {
|
|
23555
|
-
augmentKonvaStageClass();
|
|
23556
|
-
}
|
|
23557
23544
|
augmentKonvaNodeClass(config) {
|
|
23558
23545
|
augmentKonvaNodeClass(config);
|
|
23559
23546
|
}
|
|
@@ -24326,8 +24313,6 @@ const setupUpscaleStage = (instance, stage) => {
|
|
|
24326
24313
|
var WeaveStageNode = class extends WeaveNode {
|
|
24327
24314
|
nodeType = WEAVE_STAGE_NODE_TYPE;
|
|
24328
24315
|
stageFocused = false;
|
|
24329
|
-
wheelMousePressed = false;
|
|
24330
|
-
isCmdCtrlPressed = false;
|
|
24331
24316
|
globalEventsInitialized = false;
|
|
24332
24317
|
initialize = void 0;
|
|
24333
24318
|
onRender(props) {
|
|
@@ -24336,9 +24321,7 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24336
24321
|
mode: "default"
|
|
24337
24322
|
});
|
|
24338
24323
|
setupUpscaleStage(this.instance, stage);
|
|
24339
|
-
this.wheelMousePressed = false;
|
|
24340
24324
|
stage.isFocused = () => this.stageFocused;
|
|
24341
|
-
stage.isMouseWheelPressed = () => this.wheelMousePressed;
|
|
24342
24325
|
stage.position({
|
|
24343
24326
|
x: 0,
|
|
24344
24327
|
y: 0
|
|
@@ -24374,8 +24357,7 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24374
24357
|
};
|
|
24375
24358
|
stage.handleMouseout = function() {};
|
|
24376
24359
|
stage.mode(WEAVE_STAGE_DEFAULT_MODE);
|
|
24377
|
-
stage.on("pointerdown", (
|
|
24378
|
-
if (e.evt.button === 1) this.wheelMousePressed = true;
|
|
24360
|
+
stage.on("pointerdown", () => {
|
|
24379
24361
|
if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(this.instance.getActiveAction() ?? "")) stage.container().style.cursor = "grabbing";
|
|
24380
24362
|
});
|
|
24381
24363
|
stage.on("pointermove", (e) => {
|
|
@@ -24389,9 +24371,8 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24389
24371
|
stage$1.container().style.cursor = "default";
|
|
24390
24372
|
}
|
|
24391
24373
|
});
|
|
24392
|
-
stage.on("pointerup", (
|
|
24374
|
+
stage.on("pointerup", () => {
|
|
24393
24375
|
const activeAction = this.instance.getActiveAction();
|
|
24394
|
-
if (e.evt.button === 1) this.wheelMousePressed = false;
|
|
24395
24376
|
if (!this.instance.isServerSide() && [MOVE_TOOL_ACTION_NAME].includes(activeAction ?? "")) stage.container().style.cursor = "grab";
|
|
24396
24377
|
});
|
|
24397
24378
|
stage.on("pointerover", (e) => {
|
|
@@ -24403,7 +24384,6 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24403
24384
|
this.hideHoverState();
|
|
24404
24385
|
if (!this.instance.isServerSide()) stage.container().style.cursor = "default";
|
|
24405
24386
|
});
|
|
24406
|
-
stage.isCmdCtrlPressed = () => this.isCmdCtrlPressed;
|
|
24407
24387
|
this.setupEvents();
|
|
24408
24388
|
return stage;
|
|
24409
24389
|
}
|
|
@@ -24411,12 +24391,8 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24411
24391
|
setupEvents() {
|
|
24412
24392
|
if (this.globalEventsInitialized) return;
|
|
24413
24393
|
if (this.instance.isServerSide()) return;
|
|
24414
|
-
window.addEventListener("blur", () => {
|
|
24415
|
-
this.isCmdCtrlPressed = false;
|
|
24416
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
24417
24394
|
window.addEventListener("keydown", (e) => {
|
|
24418
24395
|
if (this.isOnlyCtrlOrMeta(e)) {
|
|
24419
|
-
this.isCmdCtrlPressed = true;
|
|
24420
24396
|
this.instance.getStage().container().style.cursor = "default";
|
|
24421
24397
|
const transformer = this.getSelectionPlugin()?.getTransformer();
|
|
24422
24398
|
if (!transformer) return;
|
|
@@ -24427,7 +24403,6 @@ var WeaveStageNode = class extends WeaveNode {
|
|
|
24427
24403
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
24428
24404
|
window.addEventListener("keyup", (e) => {
|
|
24429
24405
|
if (!(e.ctrlKey || e.metaKey)) {
|
|
24430
|
-
this.isCmdCtrlPressed = false;
|
|
24431
24406
|
this.instance.getStage().container().style.cursor = "default";
|
|
24432
24407
|
const transformer = this.getSelectionPlugin()?.getTransformer();
|
|
24433
24408
|
if (!transformer) return;
|
|
@@ -25108,35 +25083,26 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25108
25083
|
}
|
|
25109
25084
|
initialize() {
|
|
25110
25085
|
this.keyPressHandler = void 0;
|
|
25111
|
-
this.eventsInitialized = false;
|
|
25112
|
-
this.isCtrlMetaPressed = false;
|
|
25113
25086
|
this.textAreaSuperContainer = null;
|
|
25114
25087
|
this.textAreaContainer = null;
|
|
25115
25088
|
this.textArea = null;
|
|
25116
25089
|
this.editing = false;
|
|
25117
25090
|
this.textArea = null;
|
|
25118
25091
|
}
|
|
25119
|
-
initEvents() {
|
|
25120
|
-
if (!this.eventsInitialized && !globalThis._weave_isServerSide) {
|
|
25121
|
-
window.addEventListener("blur", () => {
|
|
25122
|
-
this.isCtrlMetaPressed = false;
|
|
25123
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
25124
|
-
window.addEventListener("keydown", (e) => {
|
|
25125
|
-
if (e.ctrlKey || e.metaKey) this.isCtrlMetaPressed = true;
|
|
25126
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
25127
|
-
window.addEventListener("keyup", (e) => {
|
|
25128
|
-
if (!(e.ctrlKey || e.metaKey)) this.isCtrlMetaPressed = false;
|
|
25129
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
25130
|
-
this.eventsInitialized = true;
|
|
25131
|
-
}
|
|
25132
|
-
}
|
|
25133
25092
|
updateNode(nodeInstance) {
|
|
25134
25093
|
const actNode = this.instance.getStage().findOne(`#${nodeInstance.id()}`);
|
|
25135
25094
|
if (actNode) {
|
|
25136
25095
|
const clonedText = actNode.clone();
|
|
25137
25096
|
clonedText.setAttr("triggerEditMode", void 0);
|
|
25138
25097
|
clonedText.setAttr("cancelEditMode", void 0);
|
|
25139
|
-
this.
|
|
25098
|
+
if (this.createNode && actNode.getAttrs().text !== "") {
|
|
25099
|
+
const actualContainer = actNode.getParent();
|
|
25100
|
+
actNode.destroy();
|
|
25101
|
+
const serializedNode = this.serialize(clonedText);
|
|
25102
|
+
this.instance.addNode(serializedNode, actualContainer?.getAttrs().id);
|
|
25103
|
+
} else if (this.createNode && actNode.getAttrs().text === "") actNode.destroy();
|
|
25104
|
+
else this.instance.updateNode(this.serialize(clonedText));
|
|
25105
|
+
this.createNode = false;
|
|
25140
25106
|
clonedText.destroy();
|
|
25141
25107
|
}
|
|
25142
25108
|
}
|
|
@@ -25158,7 +25124,6 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25158
25124
|
}
|
|
25159
25125
|
}
|
|
25160
25126
|
onRender(props) {
|
|
25161
|
-
this.initEvents();
|
|
25162
25127
|
const text = new Konva.Text({
|
|
25163
25128
|
...props,
|
|
25164
25129
|
name: "node",
|
|
@@ -25225,6 +25190,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25225
25190
|
text.setAttr("triggerEditMode", this.triggerEditMode.bind(this));
|
|
25226
25191
|
let actualAnchor = void 0;
|
|
25227
25192
|
text.on("transformstart", (e) => {
|
|
25193
|
+
const isCtrlOrMetaPressed = e.evt.ctrlKey || e.evt.metaKey;
|
|
25228
25194
|
this.instance.emitEvent("onTransform", e.target);
|
|
25229
25195
|
actualAnchor = this.getNodesSelectionPlugin()?.getTransformer()?.getActiveAnchor();
|
|
25230
25196
|
if (text.getAttrs().layout === TEXT_LAYOUT.SMART && [
|
|
@@ -25232,10 +25198,11 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25232
25198
|
"top-right",
|
|
25233
25199
|
"bottom-left",
|
|
25234
25200
|
"bottom-right"
|
|
25235
|
-
].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED &&
|
|
25201
|
+
].includes(actualAnchor ?? "") || text.getAttrs().layout === TEXT_LAYOUT.FIXED && isCtrlOrMetaPressed) this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(true);
|
|
25236
25202
|
else this.getNodesSelectionPlugin()?.getTransformer()?.keepRatio(false);
|
|
25237
25203
|
if ([TEXT_LAYOUT.AUTO_HEIGHT, TEXT_LAYOUT.SMART].includes(text.getAttrs().layout) && ["middle-right", "middle-left"].includes(actualAnchor ?? "")) {
|
|
25238
25204
|
text.wrap("word");
|
|
25205
|
+
text.scaleY(1);
|
|
25239
25206
|
text.height(void 0);
|
|
25240
25207
|
}
|
|
25241
25208
|
e.cancelBubble = true;
|
|
@@ -25261,7 +25228,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25261
25228
|
text.setAttr("shouldUpdateOnTransform", false);
|
|
25262
25229
|
text.getLayer()?.batchDraw();
|
|
25263
25230
|
};
|
|
25264
|
-
text.on("transform",
|
|
25231
|
+
text.on("transform", handleTextTransform);
|
|
25265
25232
|
const handleTransformEnd = () => {
|
|
25266
25233
|
this.instance.emitEvent("onTransform", null);
|
|
25267
25234
|
let definedSmartWidth = false;
|
|
@@ -25290,6 +25257,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25290
25257
|
definedSmartWidth = true;
|
|
25291
25258
|
text.width(Math.ceil(text.width() * text.scaleX()));
|
|
25292
25259
|
text.scaleX(1);
|
|
25260
|
+
text.scaleY(1);
|
|
25293
25261
|
text.height(void 0);
|
|
25294
25262
|
text.getLayer()?.batchDraw();
|
|
25295
25263
|
text.height(Math.ceil(text.height()));
|
|
@@ -25304,7 +25272,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25304
25272
|
handleTransformEnd();
|
|
25305
25273
|
});
|
|
25306
25274
|
this.instance.addEventListener("onNodeRenderedAdded", (node) => {
|
|
25307
|
-
if (node.id() === text.id() && node.getParent() !== text.getParent()) text.getAttr("cancelEditMode")?.();
|
|
25275
|
+
if (node.id() === text.id() && node.getParent() !== text.getParent() && this.editing) text.getAttr("cancelEditMode")?.();
|
|
25308
25276
|
});
|
|
25309
25277
|
if (!this.instance.isServerSide() && !this.keyPressHandler) {
|
|
25310
25278
|
this.keyPressHandler = this.handleKeyPress.bind(this);
|
|
@@ -25313,14 +25281,6 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25313
25281
|
return text;
|
|
25314
25282
|
}
|
|
25315
25283
|
onUpdate(nodeInstance, nextProps) {
|
|
25316
|
-
const actualFontFamily = nodeInstance.getAttrs().fontFamily;
|
|
25317
|
-
const actualFontSize = nodeInstance.getAttrs().fontSize;
|
|
25318
|
-
const actualFontStyle = nodeInstance.getAttrs().fontStyle;
|
|
25319
|
-
const actualFontVariant = nodeInstance.getAttrs().fontVariant;
|
|
25320
|
-
const actualTextDecoration = nodeInstance.getAttrs().textDecoration;
|
|
25321
|
-
const actualLineHeight = nodeInstance.getAttrs().lineHeight;
|
|
25322
|
-
let updateNeeded = false;
|
|
25323
|
-
if (actualFontFamily !== nextProps.fontFamily || actualFontSize !== nextProps.fontSize || actualFontStyle !== nextProps.fontStyle || actualFontVariant !== nextProps.fontVariant || actualTextDecoration !== nextProps.textDecoration || actualLineHeight !== nextProps.lineHeight) updateNeeded = true;
|
|
25324
25284
|
nodeInstance.setAttrs({
|
|
25325
25285
|
...nextProps,
|
|
25326
25286
|
...!this.config.outline.enabled && { strokeEnabled: false },
|
|
@@ -25335,22 +25295,20 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25335
25295
|
let height = nextProps.height;
|
|
25336
25296
|
if (nextProps.layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
25337
25297
|
const { width: textAreaWidth, height: textAreaHeight } = this.textRenderedSize(nextProps.text, nodeInstance);
|
|
25338
|
-
width = textAreaWidth;
|
|
25339
|
-
height = textAreaHeight;
|
|
25298
|
+
width = (textAreaWidth + 2) * nodeInstance.getAbsoluteScale().x;
|
|
25299
|
+
height = (textAreaHeight + 2) * nodeInstance.getAbsoluteScale().x;
|
|
25340
25300
|
}
|
|
25341
25301
|
if (nextProps.layout === TEXT_LAYOUT.SMART && !nextProps.smartFixedWidth) {
|
|
25342
25302
|
const { width: textAreaWidth } = this.textRenderedSize(nextProps.text, nodeInstance);
|
|
25343
|
-
width = textAreaWidth;
|
|
25303
|
+
width = textAreaWidth / this.instance.getStage().scaleX();
|
|
25344
25304
|
height = void 0;
|
|
25345
25305
|
}
|
|
25346
25306
|
if (nextProps.layout === TEXT_LAYOUT.SMART && nextProps.smartFixedWidth) height = void 0;
|
|
25347
25307
|
if (nextProps.layout === TEXT_LAYOUT.AUTO_HEIGHT) height = void 0;
|
|
25348
|
-
if (nextProps.layout === TEXT_LAYOUT.FIXED) updateNeeded = false;
|
|
25349
25308
|
nodeInstance.setAttrs({
|
|
25350
25309
|
width,
|
|
25351
25310
|
height
|
|
25352
25311
|
});
|
|
25353
|
-
if (updateNeeded) this.instance.updateNode(this.serialize(nodeInstance));
|
|
25354
25312
|
if (this.editing) this.updateTextAreaDOM(nodeInstance);
|
|
25355
25313
|
if (!this.editing) {
|
|
25356
25314
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
@@ -25398,14 +25356,17 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25398
25356
|
if (!this.textArea || !this.textAreaContainer) return;
|
|
25399
25357
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
|
|
25400
25358
|
const { width: textAreaWidth } = this.textRenderedSize(this.textArea.value, textNode);
|
|
25401
|
-
|
|
25359
|
+
const width = (textAreaWidth + 2) * textNode.getAbsoluteScale().x / this.instance.getStage().scaleX();
|
|
25360
|
+
this.textAreaContainer.style.width = width + "px";
|
|
25402
25361
|
}
|
|
25403
25362
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.SMART) {
|
|
25404
25363
|
this.textAreaContainer.style.height = "auto";
|
|
25405
|
-
|
|
25364
|
+
const height$1 = this.textArea.scrollHeight + textNode.getAbsoluteScale().y;
|
|
25365
|
+
this.textAreaContainer.style.height = height$1 + "px";
|
|
25406
25366
|
}
|
|
25407
25367
|
this.textArea.style.height = "auto";
|
|
25408
|
-
|
|
25368
|
+
const height = this.textArea.scrollHeight + textNode.getAbsoluteScale().y;
|
|
25369
|
+
this.textArea.style.height = height + "px";
|
|
25409
25370
|
this.textArea.rows = this.textArea.value.split("\n").length;
|
|
25410
25371
|
}
|
|
25411
25372
|
measureMultilineText(textNode) {
|
|
@@ -25427,8 +25388,8 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25427
25388
|
height = height + textSize.height * (textNode.lineHeight() ?? 1);
|
|
25428
25389
|
}
|
|
25429
25390
|
return {
|
|
25430
|
-
width: width * 1.01,
|
|
25431
|
-
height
|
|
25391
|
+
width: width * this.instance.getStage().scaleX() * 1.01,
|
|
25392
|
+
height: height * this.instance.getStage().scaleX() * 1.01
|
|
25432
25393
|
};
|
|
25433
25394
|
}
|
|
25434
25395
|
mimicTextNode(textNode) {
|
|
@@ -25437,7 +25398,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25437
25398
|
this.textArea.rows = textNode.text().split("\n").length;
|
|
25438
25399
|
this.textArea.style.letterSpacing = `${textNode.letterSpacing()}`;
|
|
25439
25400
|
this.textArea.style.opacity = `${textNode.getAttrs().opacity}`;
|
|
25440
|
-
this.textArea.style.lineHeight = `${textNode.lineHeight()}`;
|
|
25401
|
+
this.textArea.style.lineHeight = `${textNode.lineHeight()}em`;
|
|
25441
25402
|
this.textArea.style.fontFamily = textNode.fontFamily();
|
|
25442
25403
|
let fontWeight = "normal";
|
|
25443
25404
|
let fontStyle = "normal";
|
|
@@ -25450,6 +25411,10 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25450
25411
|
this.textArea.style.textDecoration = textNode.textDecoration();
|
|
25451
25412
|
this.textArea.style.textAlign = textNode.align();
|
|
25452
25413
|
this.textArea.style.color = `${textNode.fill()}`;
|
|
25414
|
+
if (this.config.outline.enabled) {
|
|
25415
|
+
this.textArea.style.paintOrder = "stroke fill";
|
|
25416
|
+
this.textArea.style.webkitTextStroke = `${this.config.outline.width * this.instance.getStage().scaleX()}px ${this.config.outline.color}`;
|
|
25417
|
+
}
|
|
25453
25418
|
}
|
|
25454
25419
|
createTextAreaDOM(textNode, position) {
|
|
25455
25420
|
const stage = this.instance.getStage();
|
|
@@ -25488,19 +25453,19 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25488
25453
|
this.textAreaContainer.style.left = position.x * upscaleScale + "px";
|
|
25489
25454
|
if (textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
|
|
25490
25455
|
const rect = textNode.getClientRect({ relativeTo: stage });
|
|
25491
|
-
this.textAreaContainer.style.width = (rect.width + 2) *
|
|
25492
|
-
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2
|
|
25456
|
+
this.textAreaContainer.style.width = (rect.width + 2) * textNode.getAbsoluteScale().x + "px";
|
|
25457
|
+
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
|
|
25493
25458
|
}
|
|
25494
25459
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL) {
|
|
25495
25460
|
const rect = textNode.getClientRect({ relativeTo: stage });
|
|
25496
|
-
this.textAreaContainer.style.width = (rect.width + 2) *
|
|
25497
|
-
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2
|
|
25461
|
+
this.textAreaContainer.style.width = (rect.width + 2) * textNode.getAbsoluteScale().x + "px";
|
|
25462
|
+
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
|
|
25498
25463
|
}
|
|
25499
25464
|
if (textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && textNode.getAttrs().smartFixedWidth) {
|
|
25500
25465
|
const rect = textNode.getClientRect({ relativeTo: stage });
|
|
25501
|
-
this.textAreaContainer.style.width = (rect.width + 10) *
|
|
25502
|
-
if (textNode.getAttrs().smartFixedWidth) this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2
|
|
25503
|
-
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2
|
|
25466
|
+
this.textAreaContainer.style.width = (rect.width + 10) * textNode.getAbsoluteScale().x + "px";
|
|
25467
|
+
if (textNode.getAttrs().smartFixedWidth) this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
|
|
25468
|
+
this.textAreaContainer.style.height = (textNode.height() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
|
|
25504
25469
|
}
|
|
25505
25470
|
if (textNode.getAttrs().layout === TEXT_LAYOUT.FIXED) {
|
|
25506
25471
|
this.textAreaContainer.style.width = (textNode.width() - textNode.padding() * 2) * textNode.getAbsoluteScale().x + "px";
|
|
@@ -25510,6 +25475,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25510
25475
|
this.textArea.style.position = "absolute";
|
|
25511
25476
|
this.textArea.style.top = "0px";
|
|
25512
25477
|
this.textArea.style.left = "0px";
|
|
25478
|
+
this.textArea.style.lineHeight = "1em";
|
|
25513
25479
|
this.textArea.style.overscrollBehavior = "contains";
|
|
25514
25480
|
this.textArea.style.scrollBehavior = "auto";
|
|
25515
25481
|
this.textArea.style.caretColor = "black";
|
|
@@ -25518,31 +25484,22 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25518
25484
|
this.textArea.style.margin = "0px";
|
|
25519
25485
|
this.textArea.style.padding = "0px";
|
|
25520
25486
|
this.textArea.style.paddingTop = "0px";
|
|
25521
|
-
this.textArea.style.boxSizing = "
|
|
25487
|
+
this.textArea.style.boxSizing = "border-box";
|
|
25522
25488
|
this.textArea.style.overflow = "hidden";
|
|
25523
25489
|
this.textArea.style.background = "transparent";
|
|
25524
25490
|
this.textArea.style.border = "none";
|
|
25525
25491
|
this.textArea.style.outline = "none";
|
|
25526
25492
|
this.textArea.style.resize = "none";
|
|
25527
25493
|
this.textArea.style.overflow = "hidden";
|
|
25494
|
+
if (this.config.outline.enabled) {
|
|
25495
|
+
this.textArea.style.paintOrder = "stroke fill";
|
|
25496
|
+
this.textArea.style.webkitTextStroke = `${this.config.outline.width * this.instance.getStage().scaleX()}px ${this.config.outline.color}`;
|
|
25497
|
+
}
|
|
25528
25498
|
this.textArea.style.backgroundColor = "transparent";
|
|
25529
25499
|
this.textAreaContainer.style.transformOrigin = "left top";
|
|
25530
25500
|
this.mimicTextNode(textNode);
|
|
25531
|
-
|
|
25532
|
-
|
|
25533
|
-
const actualFont = loadedFonts.find((f) => f.name === fontFamily);
|
|
25534
|
-
const correctionX = (actualFont === void 0 ? 0 : actualFont.offsetX ?? 0) * stage.scaleX();
|
|
25535
|
-
const correctionY = (actualFont === void 0 ? 0 : actualFont.offsetY ?? 0) * stage.scaleX();
|
|
25536
|
-
this.textArea.style.left = `${correctionX - 1}px`;
|
|
25537
|
-
this.textArea.style.top = `${correctionY}px`;
|
|
25538
|
-
const updateTextNode = () => {
|
|
25539
|
-
if (!this.textArea) return;
|
|
25540
|
-
updateTextNodeSize();
|
|
25541
|
-
textNode.text(this.textArea.value);
|
|
25542
|
-
textNode.visible(true);
|
|
25543
|
-
this.instance.updateNode(this.serialize(textNode));
|
|
25544
|
-
};
|
|
25545
|
-
const throttledUpdateTextNode = (0, import_lodash.throttle)(updateTextNode, 300);
|
|
25501
|
+
this.textArea.style.left = `-1px`;
|
|
25502
|
+
this.textArea.style.top = `-1px`;
|
|
25546
25503
|
this.textArea.onfocus = () => {
|
|
25547
25504
|
this.textAreaDomResize(textNode);
|
|
25548
25505
|
};
|
|
@@ -25556,11 +25513,9 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25556
25513
|
};
|
|
25557
25514
|
this.textArea.onpaste = () => {
|
|
25558
25515
|
this.textAreaDomResize(textNode);
|
|
25559
|
-
throttledUpdateTextNode();
|
|
25560
25516
|
};
|
|
25561
25517
|
this.textArea.oninput = () => {
|
|
25562
25518
|
this.textAreaDomResize(textNode);
|
|
25563
|
-
throttledUpdateTextNode();
|
|
25564
25519
|
};
|
|
25565
25520
|
this.textAreaSuperContainer.addEventListener("scroll", () => {
|
|
25566
25521
|
if (this.textAreaSuperContainer) {
|
|
@@ -25587,7 +25542,8 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25587
25542
|
if (!this.textArea) return;
|
|
25588
25543
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART && !textNode.getAttrs().smartFixedWidth) {
|
|
25589
25544
|
const { width: textAreaWidth } = this.textRenderedSize(this.textArea.value, textNode);
|
|
25590
|
-
|
|
25545
|
+
const width = textAreaWidth / this.instance.getStage().scaleX();
|
|
25546
|
+
textNode.width(width);
|
|
25591
25547
|
}
|
|
25592
25548
|
if (!textNode.getAttrs().layout || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_HEIGHT || textNode.getAttrs().layout === TEXT_LAYOUT.AUTO_ALL || textNode.getAttrs().layout === TEXT_LAYOUT.SMART) textNode.height(this.textArea.scrollHeight * (1 / textNode.getAbsoluteScale().x));
|
|
25593
25549
|
};
|
|
@@ -25708,7 +25664,8 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
25708
25664
|
stage.container().focus();
|
|
25709
25665
|
this.instance.emitEvent("onExitTextNodeEditMode", { node: textNode });
|
|
25710
25666
|
}
|
|
25711
|
-
triggerEditMode(textNode) {
|
|
25667
|
+
triggerEditMode(textNode, create = false) {
|
|
25668
|
+
if (create) this.createNode = true;
|
|
25712
25669
|
const lockAcquired = this.instance.setMutexLock({
|
|
25713
25670
|
nodeIds: [textNode.id()],
|
|
25714
25671
|
operation: "text-edit"
|
|
@@ -26153,7 +26110,8 @@ var WeaveImageCrop = class WeaveImageCrop {
|
|
|
26153
26110
|
this.onClose();
|
|
26154
26111
|
const utilityLayer = this.instance.getUtilityLayer();
|
|
26155
26112
|
utilityLayer?.destroyChildren();
|
|
26156
|
-
|
|
26113
|
+
const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
|
|
26114
|
+
if (isCtrlOrMetaPressed && utilityLayer) {
|
|
26157
26115
|
this.node.renderCropMode(utilityLayer, this.image);
|
|
26158
26116
|
utilityLayer.show();
|
|
26159
26117
|
}
|
|
@@ -26689,23 +26647,36 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
26689
26647
|
if (this.imageCrop) this.closeCrop(image, WEAVE_IMAGE_CROP_END_TYPE.CANCEL);
|
|
26690
26648
|
}
|
|
26691
26649
|
});
|
|
26650
|
+
image.on("nodeDragStart", () => {
|
|
26651
|
+
const utilityLayer = this.instance.getUtilityLayer();
|
|
26652
|
+
if (!utilityLayer) return;
|
|
26653
|
+
const nodes = utilityLayer?.find(".cropMode") ?? [];
|
|
26654
|
+
nodes.forEach((n) => {
|
|
26655
|
+
n.destroy();
|
|
26656
|
+
});
|
|
26657
|
+
const transformer = this.getSelectionPlugin()?.getTransformer();
|
|
26658
|
+
if (!transformer) return;
|
|
26659
|
+
transformer.show();
|
|
26660
|
+
});
|
|
26692
26661
|
if (this.config.cropMode.enabled && this.config.cropMode.triggers.ctrlCmd) {
|
|
26693
26662
|
image.on("onCmdCtrlPressed", () => {
|
|
26663
|
+
const utilityLayer = this.instance.getUtilityLayer();
|
|
26664
|
+
if (!utilityLayer) return;
|
|
26665
|
+
if (image.isDragging()) return;
|
|
26694
26666
|
const transformer = this.getSelectionPlugin()?.getTransformer();
|
|
26695
26667
|
if (!transformer) return;
|
|
26696
26668
|
transformer.hide();
|
|
26697
|
-
const utilityLayer = this.instance.getUtilityLayer();
|
|
26698
|
-
if (!utilityLayer) return;
|
|
26699
26669
|
utilityLayer?.destroyChildren();
|
|
26700
26670
|
this.renderCropMode(utilityLayer, image);
|
|
26701
26671
|
utilityLayer?.show();
|
|
26702
26672
|
});
|
|
26703
26673
|
image.on("onCmdCtrlReleased", () => {
|
|
26674
|
+
const utilityLayer = this.instance.getUtilityLayer();
|
|
26675
|
+
if (!utilityLayer) return;
|
|
26676
|
+
if (image.isDragging()) return;
|
|
26704
26677
|
const transformer = this.getSelectionPlugin()?.getTransformer();
|
|
26705
26678
|
if (!transformer) return;
|
|
26706
26679
|
transformer.show();
|
|
26707
|
-
const utilityLayer = this.instance.getUtilityLayer();
|
|
26708
|
-
if (!utilityLayer) return;
|
|
26709
26680
|
utilityLayer?.destroyChildren();
|
|
26710
26681
|
});
|
|
26711
26682
|
}
|
|
@@ -26764,6 +26735,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
26764
26735
|
fill: "transparent",
|
|
26765
26736
|
strokeScaleEnabled: false,
|
|
26766
26737
|
strokeWidth: 2,
|
|
26738
|
+
name: "cropMode",
|
|
26767
26739
|
stroke: "#1a1aff",
|
|
26768
26740
|
draggable: false,
|
|
26769
26741
|
listening: false,
|
|
@@ -26824,6 +26796,7 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
26824
26796
|
}));
|
|
26825
26797
|
const anchor = new Konva.Rect({
|
|
26826
26798
|
draggable: false,
|
|
26799
|
+
name: "cropMode",
|
|
26827
26800
|
rotation: node.rotation()
|
|
26828
26801
|
});
|
|
26829
26802
|
this.config.cropMode.selection.anchorStyleFunc(anchor, position);
|
|
@@ -27266,6 +27239,11 @@ var WeaveImageNode = class extends WeaveNode {
|
|
|
27266
27239
|
const nodeId = nodeInstance.getAttrs().id ?? "";
|
|
27267
27240
|
const isMoveContainer = nodeInstance.getAttr("onMoveContainer");
|
|
27268
27241
|
nodeInstance.setAttr("onMoveContainer", void 0);
|
|
27242
|
+
const utilityLayer = this.instance.getUtilityLayer();
|
|
27243
|
+
const nodes = utilityLayer?.find(".cropMode") ?? [];
|
|
27244
|
+
nodes.forEach((n) => {
|
|
27245
|
+
n.destroy();
|
|
27246
|
+
});
|
|
27269
27247
|
if (this.imageTryoutIds[nodeId]) {
|
|
27270
27248
|
clearTimeout(this.imageTryoutIds[nodeId]);
|
|
27271
27249
|
delete this.imageTryoutIds[nodeId];
|
|
@@ -29870,16 +29848,16 @@ var WeaveVideoNode = class extends WeaveNode {
|
|
|
29870
29848
|
}
|
|
29871
29849
|
if (isServer()) this.instance.updateNode(this.serialize(videoGroup));
|
|
29872
29850
|
const defaultHandleMouseover = videoGroup.handleMouseover;
|
|
29873
|
-
videoGroup.handleMouseover = () => {
|
|
29874
|
-
defaultHandleMouseover.call(this);
|
|
29851
|
+
videoGroup.handleMouseover = (e) => {
|
|
29852
|
+
defaultHandleMouseover.call(this, e);
|
|
29875
29853
|
if (this.config.style.track.onlyOnHover && this.videoState[id].loaded) {
|
|
29876
29854
|
const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
|
|
29877
29855
|
videoProgress?.show();
|
|
29878
29856
|
}
|
|
29879
29857
|
};
|
|
29880
29858
|
const defaultHandleMouseout = videoGroup.handleMouseout;
|
|
29881
|
-
videoGroup.handleMouseout = () => {
|
|
29882
|
-
defaultHandleMouseout.call(this);
|
|
29859
|
+
videoGroup.handleMouseout = (e) => {
|
|
29860
|
+
defaultHandleMouseout.call(e, this);
|
|
29883
29861
|
if (this.config.style.track.onlyOnHover && this.videoState[id].loaded && !this.videoState[id].paused) {
|
|
29884
29862
|
const videoProgress = videoGroup.findOne(`#${id}-video-progress`);
|
|
29885
29863
|
videoProgress?.hide();
|
|
@@ -32149,7 +32127,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
32149
32127
|
this.zooming = false;
|
|
32150
32128
|
this.isTrackpad = false;
|
|
32151
32129
|
this.zoomVelocity = 0;
|
|
32152
|
-
this.isCtrlOrMetaPressed = false;
|
|
32153
32130
|
this.updatedMinimumZoom = false;
|
|
32154
32131
|
this.actualStep = this.config.zoomSteps.findIndex((step) => step === this.config.defaultZoom);
|
|
32155
32132
|
this.actualScale = this.config.zoomSteps[this.actualStep];
|
|
@@ -32460,15 +32437,6 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
32460
32437
|
};
|
|
32461
32438
|
}
|
|
32462
32439
|
initEvents() {
|
|
32463
|
-
window.addEventListener("blur", () => {
|
|
32464
|
-
this.isCtrlOrMetaPressed = false;
|
|
32465
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
32466
|
-
window.addEventListener("keydown", (e) => {
|
|
32467
|
-
if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
|
|
32468
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
32469
|
-
window.addEventListener("keyup", (e) => {
|
|
32470
|
-
if (!(e.ctrlKey || e.metaKey)) this.isCtrlOrMetaPressed = false;
|
|
32471
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
32472
32440
|
const stage = this.instance.getStage();
|
|
32473
32441
|
let lastCenter = null;
|
|
32474
32442
|
let lastDist = 0;
|
|
@@ -32550,7 +32518,8 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
32550
32518
|
});
|
|
32551
32519
|
let doZoom = false;
|
|
32552
32520
|
const handleWheelImmediate = (e) => {
|
|
32553
|
-
const
|
|
32521
|
+
const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
|
|
32522
|
+
const performZoom = isCtrlOrMetaPressed || !isCtrlOrMetaPressed && e.ctrlKey && e.deltaMode === 0;
|
|
32554
32523
|
const mouseX = e.clientX;
|
|
32555
32524
|
const mouseY = e.clientY;
|
|
32556
32525
|
let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
|
|
@@ -34293,6 +34262,7 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
34293
34262
|
fontFamily: "Arial, sans-serif",
|
|
34294
34263
|
fill: "#000000",
|
|
34295
34264
|
align: "left",
|
|
34265
|
+
lineHeight: 1,
|
|
34296
34266
|
verticalAlign: "top",
|
|
34297
34267
|
strokeEnabled: false
|
|
34298
34268
|
};
|
|
@@ -34346,7 +34316,8 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
34346
34316
|
y: this.clickPoint?.y ?? 0,
|
|
34347
34317
|
draggable: true
|
|
34348
34318
|
});
|
|
34349
|
-
|
|
34319
|
+
const renderedNode = nodeHandler.onRender(node.props);
|
|
34320
|
+
this.container.add(renderedNode);
|
|
34350
34321
|
this.instance.emitEvent("onAddedArrow");
|
|
34351
34322
|
}
|
|
34352
34323
|
this.setState(TEXT_TOOL_STATE.FINISHED);
|
|
@@ -34371,7 +34342,7 @@ var WeaveTextToolAction = class extends WeaveAction {
|
|
|
34371
34342
|
this.instance.triggerAction(SELECTION_TOOL_ACTION_NAME);
|
|
34372
34343
|
}
|
|
34373
34344
|
const node = stage.findOne(`#${this.textId}`);
|
|
34374
|
-
if (node) node.getAttr("triggerEditMode")(node);
|
|
34345
|
+
if (node) node.getAttr("triggerEditMode")(node, true);
|
|
34375
34346
|
this.initialCursor = null;
|
|
34376
34347
|
this.textId = null;
|
|
34377
34348
|
this.container = void 0;
|
|
@@ -38198,7 +38169,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
38198
38169
|
this.moveToolActive = false;
|
|
38199
38170
|
this.isMouseLeftButtonPressed = false;
|
|
38200
38171
|
this.isMouseMiddleButtonPressed = false;
|
|
38201
|
-
this.isCtrlOrMetaPressed = false;
|
|
38202
38172
|
this.isSpaceKeyPressed = false;
|
|
38203
38173
|
this.previousPointer = null;
|
|
38204
38174
|
this.currentPointer = null;
|
|
@@ -38227,11 +38197,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
38227
38197
|
}
|
|
38228
38198
|
initEvents() {
|
|
38229
38199
|
const stage = this.instance.getStage();
|
|
38230
|
-
window.addEventListener("blur", () => {
|
|
38231
|
-
this.isCtrlOrMetaPressed = false;
|
|
38232
|
-
}, { signal: this.instance.getEventsController()?.signal });
|
|
38233
38200
|
window.addEventListener("keydown", (e) => {
|
|
38234
|
-
if (e.ctrlKey || e.metaKey) this.isCtrlOrMetaPressed = true;
|
|
38235
38201
|
if (e.code === "Space") {
|
|
38236
38202
|
this.getContextMenuPlugin()?.disable();
|
|
38237
38203
|
this.getNodesSelectionPlugin()?.disable();
|
|
@@ -38242,7 +38208,6 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
38242
38208
|
}
|
|
38243
38209
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
38244
38210
|
window.addEventListener("keyup", (e) => {
|
|
38245
|
-
if (e.key === "Meta" || e.key === "Control") this.isCtrlOrMetaPressed = false;
|
|
38246
38211
|
if (e.code === "Space") {
|
|
38247
38212
|
this.getContextMenuPlugin()?.enable();
|
|
38248
38213
|
this.getNodesSelectionPlugin()?.enable();
|
|
@@ -38309,7 +38274,8 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
38309
38274
|
this.cleanupEdgeMoveIntervals();
|
|
38310
38275
|
});
|
|
38311
38276
|
const handleWheel = (e) => {
|
|
38312
|
-
const
|
|
38277
|
+
const isCtrlOrMetaPressed = e.ctrlKey || e.metaKey;
|
|
38278
|
+
const performPanning = !isCtrlOrMetaPressed && !e.ctrlKey;
|
|
38313
38279
|
const mouseX = e.clientX;
|
|
38314
38280
|
const mouseY = e.clientY;
|
|
38315
38281
|
let elementUnderMouse = document.elementFromPoint(mouseX, mouseY);
|
|
@@ -38317,7 +38283,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
38317
38283
|
const shadowHost = getTopmostShadowHost(stage.container());
|
|
38318
38284
|
if (shadowHost) elementUnderMouse = shadowHost.elementFromPoint(mouseX, mouseY);
|
|
38319
38285
|
}
|
|
38320
|
-
if (!this.enabled ||
|
|
38286
|
+
if (!this.enabled || isCtrlOrMetaPressed || e.buttons === 4 || !performPanning || this.instance.getClosestParentWithWeaveId(elementUnderMouse) !== stage.container()) return;
|
|
38321
38287
|
this.getContextMenuPlugin()?.cancelLongPressTimer();
|
|
38322
38288
|
stage.x(stage.x() - e.deltaX);
|
|
38323
38289
|
stage.y(stage.y() - e.deltaY);
|
|
@@ -40574,7 +40540,16 @@ var WeaveCommentsRendererPlugin = class extends WeavePlugin {
|
|
|
40574
40540
|
//#endregion
|
|
40575
40541
|
//#region src/plugins/stage-keyboard-move/constants.ts
|
|
40576
40542
|
const WEAVE_STAGE_KEYBOARD_MOVE_KEY = "stageKeyboardMove";
|
|
40577
|
-
const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = {
|
|
40543
|
+
const WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG = {
|
|
40544
|
+
movementDelta: 1,
|
|
40545
|
+
shiftMovementDelta: 10
|
|
40546
|
+
};
|
|
40547
|
+
const WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION = {
|
|
40548
|
+
["UP"]: "up",
|
|
40549
|
+
["DOWN"]: "down",
|
|
40550
|
+
["LEFT"]: "left",
|
|
40551
|
+
["RIGHT"]: "right"
|
|
40552
|
+
};
|
|
40578
40553
|
|
|
40579
40554
|
//#endregion
|
|
40580
40555
|
//#region src/plugins/stage-keyboard-move/stage-keyboard-move.ts
|
|
@@ -40589,25 +40564,31 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
|
|
|
40589
40564
|
getName() {
|
|
40590
40565
|
return WEAVE_STAGE_KEYBOARD_MOVE_KEY;
|
|
40591
40566
|
}
|
|
40592
|
-
handleNodesMovement(movementOrientation) {
|
|
40567
|
+
handleNodesMovement(movementOrientation, { isShiftPressed }) {
|
|
40593
40568
|
const nodesSelectionPlugin = this.instance.getPlugin("nodesSelection");
|
|
40594
40569
|
if (nodesSelectionPlugin) {
|
|
40595
40570
|
const selectedNodes = nodesSelectionPlugin.getSelectedNodes();
|
|
40571
|
+
const movementDelta = isShiftPressed ? this.config.shiftMovementDelta : this.config.movementDelta;
|
|
40596
40572
|
for (const node of selectedNodes) {
|
|
40597
40573
|
switch (movementOrientation) {
|
|
40598
|
-
case
|
|
40599
|
-
node.y(node.y() -
|
|
40574
|
+
case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP:
|
|
40575
|
+
node.y(node.y() - movementDelta);
|
|
40600
40576
|
break;
|
|
40601
|
-
case
|
|
40602
|
-
node.y(node.y() +
|
|
40577
|
+
case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN:
|
|
40578
|
+
node.y(node.y() + movementDelta);
|
|
40603
40579
|
break;
|
|
40604
|
-
case
|
|
40605
|
-
node.x(node.x() -
|
|
40580
|
+
case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT:
|
|
40581
|
+
node.x(node.x() - movementDelta);
|
|
40606
40582
|
break;
|
|
40607
|
-
case
|
|
40608
|
-
node.x(node.x() +
|
|
40583
|
+
case WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT:
|
|
40584
|
+
node.x(node.x() + movementDelta);
|
|
40609
40585
|
break;
|
|
40610
40586
|
}
|
|
40587
|
+
this.instance.emitEvent("onNodeKeyboardMove", {
|
|
40588
|
+
node,
|
|
40589
|
+
orientation: movementOrientation,
|
|
40590
|
+
delta: movementDelta
|
|
40591
|
+
});
|
|
40611
40592
|
const nodeHandler = this.instance.getNodeHandler(node.getAttrs().nodeType);
|
|
40612
40593
|
if (!nodeHandler) break;
|
|
40613
40594
|
this.instance.updateNode(nodeHandler.serialize(node));
|
|
@@ -40616,10 +40597,11 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
|
|
|
40616
40597
|
}
|
|
40617
40598
|
onInit() {
|
|
40618
40599
|
window.addEventListener("keydown", (e) => {
|
|
40619
|
-
|
|
40620
|
-
if (e.code === "
|
|
40621
|
-
if (e.code === "
|
|
40622
|
-
if (e.code === "
|
|
40600
|
+
const isShiftPressed = e.shiftKey || e.code === "Shift";
|
|
40601
|
+
if (e.code === "ArrowUp") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.UP, { isShiftPressed });
|
|
40602
|
+
if (e.code === "ArrowLeft") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.LEFT, { isShiftPressed });
|
|
40603
|
+
if (e.code === "ArrowRight") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.RIGHT, { isShiftPressed });
|
|
40604
|
+
if (e.code === "ArrowDown") this.handleNodesMovement(WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION.DOWN, { isShiftPressed });
|
|
40623
40605
|
}, { signal: this.instance.getEventsController()?.signal });
|
|
40624
40606
|
}
|
|
40625
40607
|
enable() {
|
|
@@ -40631,5 +40613,5 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
|
|
|
40631
40613
|
};
|
|
40632
40614
|
|
|
40633
40615
|
//#endregion
|
|
40634
|
-
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_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, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_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_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, 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_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, 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_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, 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_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, 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_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
|
|
40616
|
+
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_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, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_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_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, 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_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, 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_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, 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_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isObject, isServer, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, weavejsToYjsBinary };
|
|
40635
40617
|
//# sourceMappingURL=types.js.map
|