@inditextech/weave-sdk 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.cjs +91 -148
- package/dist/sdk.d.cts +1 -3
- package/dist/sdk.d.ts +1 -3
- package/dist/sdk.js +93 -148
- package/package.json +2 -2
package/dist/sdk.cjs
CHANGED
|
@@ -15794,7 +15794,6 @@ function moveNodeToContainer(instance, node) {
|
|
|
15794
15794
|
//#endregion
|
|
15795
15795
|
//#region src/plugins/users-selection/constants.ts
|
|
15796
15796
|
const WEAVE_USERS_SELECTION_KEY = "usersSelection";
|
|
15797
|
-
const WEAVE_USERS_SELECTION_LAYER_ID = "usersPointersLayer";
|
|
15798
15797
|
const WEAVE_USER_SELECTION_KEY = "userSelection";
|
|
15799
15798
|
|
|
15800
15799
|
//#endregion
|
|
@@ -17920,7 +17919,7 @@ var WeaveRegisterManager = class {
|
|
|
17920
17919
|
|
|
17921
17920
|
//#endregion
|
|
17922
17921
|
//#region package.json
|
|
17923
|
-
var version = "0.16.
|
|
17922
|
+
var version = "0.16.1";
|
|
17924
17923
|
|
|
17925
17924
|
//#endregion
|
|
17926
17925
|
//#region src/managers/setup.ts
|
|
@@ -21636,7 +21635,7 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21636
21635
|
return WEAVE_USERS_SELECTION_KEY;
|
|
21637
21636
|
}
|
|
21638
21637
|
getLayerName() {
|
|
21639
|
-
return
|
|
21638
|
+
return __inditextech_weave_types.WEAVE_AWARENESS_LAYER_ID;
|
|
21640
21639
|
}
|
|
21641
21640
|
initLayer() {
|
|
21642
21641
|
const stage = this.instance.getStage();
|
|
@@ -21651,7 +21650,7 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21651
21650
|
}
|
|
21652
21651
|
getLayer() {
|
|
21653
21652
|
const stage = this.instance.getStage();
|
|
21654
|
-
return stage.findOne(`#${
|
|
21653
|
+
return stage.findOne(`#${this.getLayerName()}`);
|
|
21655
21654
|
}
|
|
21656
21655
|
onInit() {
|
|
21657
21656
|
this.instance.addEventListener("onAwarenessChange", (changes) => {
|
|
@@ -21671,17 +21670,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21671
21670
|
};
|
|
21672
21671
|
}
|
|
21673
21672
|
}
|
|
21674
|
-
const allActiveUsersSelections = Object.keys(this.usersSelection).map((userSelectionKey) => {
|
|
21675
|
-
const selectionInfo = this.usersSelection[userSelectionKey];
|
|
21676
|
-
return selectionInfo.actualNodes.user;
|
|
21677
|
-
});
|
|
21678
|
-
const inactiveSelections = import_lodash.default.differenceWith(allActiveUsersSelections, allActiveUsers, import_lodash.default.isEqual);
|
|
21679
|
-
const selectionsLayer = this.getLayer();
|
|
21680
|
-
for (const inactiveSelection of inactiveSelections) {
|
|
21681
|
-
const userPointerNode = selectionsLayer?.findOne(`#${inactiveSelection}`);
|
|
21682
|
-
if (userPointerNode) userPointerNode.destroy();
|
|
21683
|
-
delete this.usersSelection[inactiveSelection];
|
|
21684
|
-
}
|
|
21685
21673
|
this.renderSelectors();
|
|
21686
21674
|
});
|
|
21687
21675
|
this.renderSelectors();
|
|
@@ -21748,51 +21736,33 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21748
21736
|
for (const selector of selectors) selector.destroy();
|
|
21749
21737
|
for (const userPointerKey of Object.keys(this.usersSelection)) {
|
|
21750
21738
|
const userSelector = this.usersSelection[userPointerKey];
|
|
21751
|
-
const
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
selectorsLayer?.add(userSelectorNode$1);
|
|
21776
|
-
continue;
|
|
21777
|
-
}
|
|
21778
|
-
const userSelectorRect = selectorsLayer?.findOne(`#selector_${userSelector.actualNodes.user}_rect`);
|
|
21779
|
-
if (userSelectorRect) {
|
|
21780
|
-
const selectionRect = this.getSelectedNodesRect(userSelector.actualNodes.nodes);
|
|
21781
|
-
userSelectorNode.setAttrs({
|
|
21782
|
-
x: selectionRect.x,
|
|
21783
|
-
y: selectionRect.y,
|
|
21784
|
-
width: selectionRect.width,
|
|
21785
|
-
height: selectionRect.height,
|
|
21786
|
-
scale: 1
|
|
21787
|
-
});
|
|
21788
|
-
userSelectorRect.setAttrs({
|
|
21789
|
-
x: 0,
|
|
21790
|
-
y: 0,
|
|
21791
|
-
width: selectionRect.width,
|
|
21792
|
-
height: selectionRect.height
|
|
21793
|
-
});
|
|
21794
|
-
}
|
|
21739
|
+
const selectionRect = this.getSelectedNodesRect(userSelector.actualNodes.nodes);
|
|
21740
|
+
const userSelectorNode = new konva.default.Group({
|
|
21741
|
+
name: "selector",
|
|
21742
|
+
id: `selector_${userSelector.actualNodes.user}`,
|
|
21743
|
+
x: selectionRect.x,
|
|
21744
|
+
y: selectionRect.y,
|
|
21745
|
+
width: selectionRect.width / stage.scaleX(),
|
|
21746
|
+
height: selectionRect.height / stage.scaleY(),
|
|
21747
|
+
listening: false
|
|
21748
|
+
});
|
|
21749
|
+
userSelectorNode.moveToBottom();
|
|
21750
|
+
const userSelectorRect = new konva.default.Rect({
|
|
21751
|
+
x: 0,
|
|
21752
|
+
y: 0,
|
|
21753
|
+
id: `selector_${userSelector.actualNodes.user}_rect`,
|
|
21754
|
+
width: selectionRect.width / stage.scaleX(),
|
|
21755
|
+
height: selectionRect.height / stage.scaleY(),
|
|
21756
|
+
fill: "transparent",
|
|
21757
|
+
stroke: this.stringToColor(userSelector.actualNodes.user),
|
|
21758
|
+
strokeWidth: 3,
|
|
21759
|
+
strokeScaleEnabled: false
|
|
21760
|
+
});
|
|
21761
|
+
userSelectorNode.add(userSelectorRect);
|
|
21762
|
+
selectorsLayer?.add(userSelectorNode);
|
|
21795
21763
|
}
|
|
21764
|
+
const pointers = selectorsLayer?.find(".pointer") ?? [];
|
|
21765
|
+
for (const pointer of pointers) pointer.moveToTop();
|
|
21796
21766
|
}
|
|
21797
21767
|
enable() {
|
|
21798
21768
|
this.getLayer()?.show();
|
|
@@ -21807,7 +21777,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21807
21777
|
//#endregion
|
|
21808
21778
|
//#region src/plugins/users-pointers/constants.ts
|
|
21809
21779
|
const WEAVE_USERS_POINTERS_KEY = "usersPointers";
|
|
21810
|
-
const WEAVE_USERS_POINTERS_LAYER_ID = "usersPointersLayer";
|
|
21811
21780
|
const WEAVE_USER_POINTER_KEY = "userPointer";
|
|
21812
21781
|
const WEAVE_DEFAULT_USER_INFO_FUNCTION = () => ({
|
|
21813
21782
|
name: "Unknown",
|
|
@@ -21845,7 +21814,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21845
21814
|
return WEAVE_USERS_POINTERS_KEY;
|
|
21846
21815
|
}
|
|
21847
21816
|
getLayerName() {
|
|
21848
|
-
return
|
|
21817
|
+
return __inditextech_weave_types.WEAVE_AWARENESS_LAYER_ID;
|
|
21849
21818
|
}
|
|
21850
21819
|
initLayer() {
|
|
21851
21820
|
const stage = this.instance.getStage();
|
|
@@ -21860,7 +21829,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21860
21829
|
}
|
|
21861
21830
|
getLayer() {
|
|
21862
21831
|
const stage = this.instance.getStage();
|
|
21863
|
-
return stage.findOne(`#${
|
|
21832
|
+
return stage.findOne(`#${this.getLayerName()}`);
|
|
21864
21833
|
}
|
|
21865
21834
|
onInit() {
|
|
21866
21835
|
const store = this.instance.getStore();
|
|
@@ -21883,17 +21852,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21883
21852
|
};
|
|
21884
21853
|
}
|
|
21885
21854
|
}
|
|
21886
|
-
const allActiveUsersPointers = Object.keys(this.usersPointers).map((userPointerKey) => {
|
|
21887
|
-
const pointerInfo = this.usersPointers[userPointerKey];
|
|
21888
|
-
return pointerInfo.actualPos.user;
|
|
21889
|
-
});
|
|
21890
|
-
const inactivePointers = import_lodash.default.differenceWith(allActiveUsersPointers, allActiveUsers, import_lodash.default.isEqual);
|
|
21891
|
-
const pointersLayer = this.getLayer();
|
|
21892
|
-
for (const inactivePointer of inactivePointers) {
|
|
21893
|
-
const userPointerNode = pointersLayer?.findOne(`#pointer_${inactivePointer}`);
|
|
21894
|
-
if (userPointerNode) userPointerNode.destroy();
|
|
21895
|
-
delete this.usersPointers[inactivePointer];
|
|
21896
|
-
}
|
|
21897
21855
|
this.renderPointers();
|
|
21898
21856
|
});
|
|
21899
21857
|
stage.on("dragmove", (e) => {
|
|
@@ -21942,85 +21900,72 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21942
21900
|
const stage = this.instance.getStage();
|
|
21943
21901
|
const pointersLayer = this.getLayer();
|
|
21944
21902
|
if (!this.enabled) return;
|
|
21903
|
+
const pointers = pointersLayer?.find(".pointer") ?? [];
|
|
21904
|
+
for (const pointer of pointers) pointer.destroy();
|
|
21945
21905
|
for (const userPointerKey of Object.keys(this.usersPointers)) {
|
|
21946
21906
|
const userPointer = this.usersPointers[userPointerKey];
|
|
21947
|
-
const userPointerNode =
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
name: "pointer",
|
|
21951
|
-
id: `pointer_${userPointer.actualPos.user}`,
|
|
21952
|
-
x: userPointer.actualPos.x,
|
|
21953
|
-
y: userPointer.actualPos.y,
|
|
21954
|
-
opacity: 1,
|
|
21955
|
-
listening: false
|
|
21956
|
-
});
|
|
21957
|
-
const { separation, pointer: { circleRadius, circleStrokeWidth }, name: { fontFamily, fontSize, backgroundCornerRadius, backgroundPaddingX, backgroundPaddingY } } = this.uiConfig;
|
|
21958
|
-
const userColor = this.stringToColor(userPointer.actualPos.user);
|
|
21959
|
-
const userContrastColor = this.getContrastTextColor(userColor);
|
|
21960
|
-
const userPointNode = new konva.default.Circle({
|
|
21961
|
-
id: `pointer_${userPointer.actualPos.user}_userPoint`,
|
|
21962
|
-
x: 0,
|
|
21963
|
-
y: 0,
|
|
21964
|
-
radius: circleRadius,
|
|
21965
|
-
fill: userColor,
|
|
21966
|
-
stroke: "black",
|
|
21967
|
-
strokeWidth: circleStrokeWidth,
|
|
21968
|
-
strokeScaleEnabled: false,
|
|
21969
|
-
listening: false
|
|
21970
|
-
});
|
|
21971
|
-
const userNameNode = new konva.default.Text({
|
|
21972
|
-
id: `pointer_${userPointer.actualPos.user}_userPointName`,
|
|
21973
|
-
x: separation,
|
|
21974
|
-
y: -circleRadius * 2 + backgroundPaddingY,
|
|
21975
|
-
text: userPointer.actualPos.user.trim(),
|
|
21976
|
-
fontSize,
|
|
21977
|
-
fontFamily,
|
|
21978
|
-
lineHeight: .9,
|
|
21979
|
-
fill: userContrastColor,
|
|
21980
|
-
align: "center",
|
|
21981
|
-
verticalAlign: "middle",
|
|
21982
|
-
listening: false,
|
|
21983
|
-
strokeScaleEnabled: false,
|
|
21984
|
-
ellipsis: true
|
|
21985
|
-
});
|
|
21986
|
-
const textWidth = userNameNode.getTextWidth();
|
|
21987
|
-
const textHeight = userNameNode.getTextHeight();
|
|
21988
|
-
userNameNode.width(textWidth + backgroundPaddingX * 2);
|
|
21989
|
-
userNameNode.height(textHeight + backgroundPaddingY * 2);
|
|
21990
|
-
const userNameBackground = new konva.default.Rect({
|
|
21991
|
-
id: `pointer_${userPointer.actualPos.user}_userPointRect`,
|
|
21992
|
-
x: separation,
|
|
21993
|
-
y: -backgroundPaddingY,
|
|
21994
|
-
width: textWidth + backgroundPaddingX * 2,
|
|
21995
|
-
height: textHeight + backgroundPaddingY * 2,
|
|
21996
|
-
cornerRadius: backgroundCornerRadius,
|
|
21997
|
-
fill: userColor,
|
|
21998
|
-
listening: false
|
|
21999
|
-
});
|
|
22000
|
-
userPointNode.setAttrs({ y: userNameBackground.y() + userNameBackground.height() / 2 });
|
|
22001
|
-
userPointerNode$1.add(userPointNode);
|
|
22002
|
-
userPointerNode$1.add(userNameBackground);
|
|
22003
|
-
userPointerNode$1.add(userNameNode);
|
|
22004
|
-
pointersLayer?.add(userPointerNode$1);
|
|
22005
|
-
continue;
|
|
22006
|
-
}
|
|
22007
|
-
const oldPos = {
|
|
22008
|
-
x: userPointer.oldPos.x,
|
|
22009
|
-
y: userPointer.oldPos.y
|
|
22010
|
-
};
|
|
22011
|
-
const actualPos = {
|
|
22012
|
-
x: userPointer.actualPos.x,
|
|
22013
|
-
y: userPointer.actualPos.y
|
|
22014
|
-
};
|
|
22015
|
-
const hasChanged = !import_lodash.default.isEqual(actualPos, oldPos);
|
|
22016
|
-
userPointerNode.scaleX(1 / stage.scaleX());
|
|
22017
|
-
userPointerNode.scaleY(1 / stage.scaleY());
|
|
22018
|
-
if (hasChanged) userPointerNode.setAttrs({
|
|
21907
|
+
const userPointerNode = new konva.default.Group({
|
|
21908
|
+
name: "pointer",
|
|
21909
|
+
id: `pointer_${userPointer.actualPos.user}`,
|
|
22019
21910
|
x: userPointer.actualPos.x,
|
|
22020
21911
|
y: userPointer.actualPos.y,
|
|
22021
|
-
opacity: 1
|
|
21912
|
+
opacity: 1,
|
|
21913
|
+
listening: false,
|
|
21914
|
+
scaleX: 1 / stage.scaleX(),
|
|
21915
|
+
scaleY: 1 / stage.scaleY()
|
|
21916
|
+
});
|
|
21917
|
+
userPointerNode.moveToTop();
|
|
21918
|
+
const { separation, pointer: { circleRadius, circleStrokeWidth }, name: { fontFamily, fontSize, backgroundCornerRadius, backgroundPaddingX, backgroundPaddingY } } = this.uiConfig;
|
|
21919
|
+
const userColor = this.stringToColor(userPointer.actualPos.user);
|
|
21920
|
+
const userContrastColor = this.getContrastTextColor(userColor);
|
|
21921
|
+
const userPointNode = new konva.default.Circle({
|
|
21922
|
+
id: `pointer_${userPointer.actualPos.user}_userPoint`,
|
|
21923
|
+
x: 0,
|
|
21924
|
+
y: 0,
|
|
21925
|
+
radius: circleRadius,
|
|
21926
|
+
fill: userColor,
|
|
21927
|
+
stroke: "black",
|
|
21928
|
+
strokeWidth: circleStrokeWidth,
|
|
21929
|
+
strokeScaleEnabled: false,
|
|
21930
|
+
listening: false
|
|
21931
|
+
});
|
|
21932
|
+
const userNameNode = new konva.default.Text({
|
|
21933
|
+
id: `pointer_${userPointer.actualPos.user}_userPointName`,
|
|
21934
|
+
x: separation,
|
|
21935
|
+
y: -circleRadius * 2 + backgroundPaddingY,
|
|
21936
|
+
text: userPointer.actualPos.user.trim(),
|
|
21937
|
+
fontSize,
|
|
21938
|
+
fontFamily,
|
|
21939
|
+
lineHeight: .9,
|
|
21940
|
+
fill: userContrastColor,
|
|
21941
|
+
align: "center",
|
|
21942
|
+
verticalAlign: "middle",
|
|
21943
|
+
listening: false,
|
|
21944
|
+
strokeScaleEnabled: false,
|
|
21945
|
+
ellipsis: true
|
|
21946
|
+
});
|
|
21947
|
+
const textWidth = userNameNode.getTextWidth();
|
|
21948
|
+
const textHeight = userNameNode.getTextHeight();
|
|
21949
|
+
userNameNode.width(textWidth + backgroundPaddingX * 2);
|
|
21950
|
+
userNameNode.height(textHeight + backgroundPaddingY * 2);
|
|
21951
|
+
const userNameBackground = new konva.default.Rect({
|
|
21952
|
+
id: `pointer_${userPointer.actualPos.user}_userPointRect`,
|
|
21953
|
+
x: separation,
|
|
21954
|
+
y: -backgroundPaddingY,
|
|
21955
|
+
width: textWidth + backgroundPaddingX * 2,
|
|
21956
|
+
height: textHeight + backgroundPaddingY * 2,
|
|
21957
|
+
cornerRadius: backgroundCornerRadius,
|
|
21958
|
+
fill: userColor,
|
|
21959
|
+
listening: false
|
|
22022
21960
|
});
|
|
21961
|
+
userPointNode.setAttrs({ y: userNameBackground.y() + userNameBackground.height() / 2 });
|
|
21962
|
+
userPointerNode.add(userPointNode);
|
|
21963
|
+
userPointerNode.add(userNameBackground);
|
|
21964
|
+
userPointerNode.add(userNameNode);
|
|
21965
|
+
pointersLayer?.add(userPointerNode);
|
|
22023
21966
|
}
|
|
21967
|
+
const selectors = pointersLayer?.find(".selector") ?? [];
|
|
21968
|
+
for (const selector of selectors) selector.moveToBottom();
|
|
22024
21969
|
}
|
|
22025
21970
|
enable() {
|
|
22026
21971
|
this.getLayer()?.show();
|
|
@@ -22469,9 +22414,7 @@ exports.WEAVE_NODES_SELECTION_LAYER_ID = WEAVE_NODES_SELECTION_LAYER_ID
|
|
|
22469
22414
|
exports.WEAVE_NODES_SNAPPING_KEY = WEAVE_NODES_SNAPPING_KEY
|
|
22470
22415
|
exports.WEAVE_STAGE_GRID_KEY = WEAVE_STAGE_GRID_KEY
|
|
22471
22416
|
exports.WEAVE_USERS_POINTERS_KEY = WEAVE_USERS_POINTERS_KEY
|
|
22472
|
-
exports.WEAVE_USERS_POINTERS_LAYER_ID = WEAVE_USERS_POINTERS_LAYER_ID
|
|
22473
22417
|
exports.WEAVE_USERS_SELECTION_KEY = WEAVE_USERS_SELECTION_KEY
|
|
22474
|
-
exports.WEAVE_USERS_SELECTION_LAYER_ID = WEAVE_USERS_SELECTION_LAYER_ID
|
|
22475
22418
|
exports.WEAVE_USER_POINTERS_DEFAULT_PROPS = WEAVE_USER_POINTERS_DEFAULT_PROPS
|
|
22476
22419
|
exports.WEAVE_USER_POINTER_KEY = WEAVE_USER_POINTER_KEY
|
|
22477
22420
|
exports.WEAVE_USER_SELECTION_KEY = WEAVE_USER_SELECTION_KEY
|
package/dist/sdk.d.cts
CHANGED
|
@@ -1281,7 +1281,6 @@ declare class WeaveConnectedUsersPlugin extends WeavePlugin {
|
|
|
1281
1281
|
//#endregion
|
|
1282
1282
|
//#region src/plugins/users-selection/constants.d.ts
|
|
1283
1283
|
declare const WEAVE_USERS_SELECTION_KEY = "usersSelection";
|
|
1284
|
-
declare const WEAVE_USERS_SELECTION_LAYER_ID = "usersPointersLayer";
|
|
1285
1284
|
declare const WEAVE_USER_SELECTION_KEY = "userSelection";
|
|
1286
1285
|
|
|
1287
1286
|
//#endregion
|
|
@@ -1322,7 +1321,6 @@ declare class WeaveUsersSelectionPlugin extends WeavePlugin {
|
|
|
1322
1321
|
//#endregion
|
|
1323
1322
|
//#region src/plugins/users-pointers/constants.d.ts
|
|
1324
1323
|
declare const WEAVE_USERS_POINTERS_KEY = "usersPointers";
|
|
1325
|
-
declare const WEAVE_USERS_POINTERS_LAYER_ID = "usersPointersLayer";
|
|
1326
1324
|
declare const WEAVE_USER_POINTER_KEY = "userPointer";
|
|
1327
1325
|
declare const WEAVE_DEFAULT_USER_INFO_FUNCTION: () => {
|
|
1328
1326
|
name: string;
|
|
@@ -1585,4 +1583,4 @@ declare class WeaveNodesSnappingPlugin extends WeavePlugin {
|
|
|
1585
1583
|
}
|
|
1586
1584
|
|
|
1587
1585
|
//#endregion
|
|
1588
|
-
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY,
|
|
1586
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUserPointersUIProperties, WeaveUserSelectionInfo, WeaveUserSelectionKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveUsersSelectionPlugin, WeaveUsersSelectionPluginConfig, WeaveUsersSelectionPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1281,7 +1281,6 @@ declare class WeaveConnectedUsersPlugin extends WeavePlugin {
|
|
|
1281
1281
|
//#endregion
|
|
1282
1282
|
//#region src/plugins/users-selection/constants.d.ts
|
|
1283
1283
|
declare const WEAVE_USERS_SELECTION_KEY = "usersSelection";
|
|
1284
|
-
declare const WEAVE_USERS_SELECTION_LAYER_ID = "usersPointersLayer";
|
|
1285
1284
|
declare const WEAVE_USER_SELECTION_KEY = "userSelection";
|
|
1286
1285
|
|
|
1287
1286
|
//#endregion
|
|
@@ -1322,7 +1321,6 @@ declare class WeaveUsersSelectionPlugin extends WeavePlugin {
|
|
|
1322
1321
|
//#endregion
|
|
1323
1322
|
//#region src/plugins/users-pointers/constants.d.ts
|
|
1324
1323
|
declare const WEAVE_USERS_POINTERS_KEY = "usersPointers";
|
|
1325
|
-
declare const WEAVE_USERS_POINTERS_LAYER_ID = "usersPointersLayer";
|
|
1326
1324
|
declare const WEAVE_USER_POINTER_KEY = "userPointer";
|
|
1327
1325
|
declare const WEAVE_DEFAULT_USER_INFO_FUNCTION: () => {
|
|
1328
1326
|
name: string;
|
|
@@ -1585,4 +1583,4 @@ declare class WeaveNodesSnappingPlugin extends WeavePlugin {
|
|
|
1585
1583
|
}
|
|
1586
1584
|
|
|
1587
1585
|
//#endregion
|
|
1588
|
-
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY,
|
|
1586
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, Guide, GuideOrientation, GuideOrientationKeys, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, ImageProps, LineGuide, LineGuideStop, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NodeSnap, NodeSnapKeys, NodeSnappingEdge, NodeSnappingEdges, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, TextSerializable, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveActionPropsChangeEvent, WeaveBrushToolAction, WeaveBrushToolActionState, WeaveBrushToolActionStateKeys, WeaveConnectedUserInfoKey, WeaveConnectedUsers, WeaveConnectedUsersChangeEvent, WeaveConnectedUsersPlugin, WeaveConnectedUsersPluginConfig, WeaveConnectedUsersPluginParams, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveCopyPasteNodesPluginOnCopyEvent, WeaveCopyPasteNodesPluginOnPasteEvent, WeaveCopyPasteNodesPluginOnPasteExternalEvent, WeaveCopyPasteNodesPluginState, WeaveCopyPasteNodesPluginStateKeys, WeaveExportNodeActionParams, WeaveExportNodeToolAction, WeaveExportStageActionParams, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToScreenToolActionParams, WeaveFitToSelectionToolAction, WeaveFitToSelectionToolActionParams, WeaveFrameAttributes, WeaveFrameNode, WeaveFrameNodeParams, WeaveFrameNodeSizes, WeaveFrameNodeSizesInfo, WeaveFrameNodeSizesKeys, WeaveFrameNodeSizesOrientation, WeaveFrameNodeSizesOrientationKeys, WeaveFrameProperties, WeaveFrameToolAction, WeaveFrameToolActionState, WeaveFrameToolActionStateKeys, WeaveFrameToolActionTriggerParams, WeaveFrameToolProps, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveImageToolActionOnEndLoadImageEvent, WeaveImageToolActionOnStartLoadImageEvent, WeaveImageToolActionState, WeaveImageToolActionStateKeys, WeaveImageToolActionTriggerParams, WeaveImageToolActionTriggerReturn, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveMoveToolActionState, WeaveMoveToolActionStateKeys, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSelectionPluginConfig, WeaveNodesSelectionPluginOnNodesChangeEvent, WeaveNodesSelectionPluginOnSelectionStateEvent, WeaveNodesSelectionPluginOnStageSelectionEvent, WeaveNodesSelectionPluginParams, WeaveNodesSnappingPlugin, WeaveNodesSnappingPluginConfig, WeaveNodesSnappingPluginParams, WeavePasteModel, WeavePenToolAction, WeavePenToolActionState, WeavePenToolActionStateKeys, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRectangleToolActionState, WeaveRectangleToolActionStateKeys, WeaveSelectionToolAction, WeaveSelectionToolActionState, WeaveSelectionToolActionStateKeys, WeaveStageContextMenuPluginConfig, WeaveStageContextMenuPluginOnNodeContextMenuEvent, WeaveStageContextMenuPluginParams, WeaveStageDropAreaPlugin, WeaveStageDropPluginOnStageDropEvent, WeaveStageGridPlugin, WeaveStageGridPluginConfig, WeaveStageGridPluginParams, WeaveStageGridType, WeaveStageGridTypeKeys, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomChanged, WeaveStageZoomPlugin, WeaveStageZoomPluginConfig, WeaveStageZoomPluginOnZoomChangeEvent, WeaveStageZoomPluginParams, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveTextToolActionState, WeaveTextToolActionStateKeys, WeaveToPasteNode, WeaveUserPointer, WeaveUserPointerKey, WeaveUserPointersUIProperties, WeaveUserSelectionInfo, WeaveUserSelectionKey, WeaveUsersPointersPlugin, WeaveUsersPointersPluginConfig, WeaveUsersPointersPluginParams, WeaveUsersSelectionPlugin, WeaveUsersSelectionPluginConfig, WeaveUsersSelectionPluginParams, WeaveZoomInToolAction, WeaveZoomInToolActionParams, WeaveZoomOutToolAction, WeaveZoomOutToolActionParams, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/dist/sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Konva from "konva";
|
|
2
2
|
import "konva/lib/types";
|
|
3
|
-
import { WEAVE_EXPORT_BACKGROUND_COLOR, WEAVE_EXPORT_FILE_FORMAT, WEAVE_EXPORT_FORMATS, WEAVE_INSTANCE_STATUS, WEAVE_NODE_CUSTOM_EVENTS, WEAVE_NODE_LAYER_ID, WEAVE_NODE_POSITION, WEAVE_UTILITY_LAYER_ID } from "@inditextech/weave-types";
|
|
3
|
+
import { WEAVE_AWARENESS_LAYER_ID, WEAVE_EXPORT_BACKGROUND_COLOR, WEAVE_EXPORT_FILE_FORMAT, WEAVE_EXPORT_FORMATS, WEAVE_INSTANCE_STATUS, WEAVE_NODE_CUSTOM_EVENTS, WEAVE_NODE_LAYER_ID, WEAVE_NODE_POSITION, WEAVE_UTILITY_LAYER_ID } from "@inditextech/weave-types";
|
|
4
4
|
import { getYjsDoc, getYjsValue, observeDeep, syncedStore } from "@syncedstore/core";
|
|
5
5
|
import { Doc, UndoManager } from "yjs";
|
|
6
6
|
import React from "react";
|
|
@@ -15794,7 +15794,6 @@ function moveNodeToContainer(instance, node) {
|
|
|
15794
15794
|
//#endregion
|
|
15795
15795
|
//#region src/plugins/users-selection/constants.ts
|
|
15796
15796
|
const WEAVE_USERS_SELECTION_KEY = "usersSelection";
|
|
15797
|
-
const WEAVE_USERS_SELECTION_LAYER_ID = "usersPointersLayer";
|
|
15798
15797
|
const WEAVE_USER_SELECTION_KEY = "userSelection";
|
|
15799
15798
|
|
|
15800
15799
|
//#endregion
|
|
@@ -17920,7 +17919,7 @@ var WeaveRegisterManager = class {
|
|
|
17920
17919
|
|
|
17921
17920
|
//#endregion
|
|
17922
17921
|
//#region package.json
|
|
17923
|
-
var version = "0.16.
|
|
17922
|
+
var version = "0.16.1";
|
|
17924
17923
|
|
|
17925
17924
|
//#endregion
|
|
17926
17925
|
//#region src/managers/setup.ts
|
|
@@ -21636,7 +21635,7 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21636
21635
|
return WEAVE_USERS_SELECTION_KEY;
|
|
21637
21636
|
}
|
|
21638
21637
|
getLayerName() {
|
|
21639
|
-
return
|
|
21638
|
+
return WEAVE_AWARENESS_LAYER_ID;
|
|
21640
21639
|
}
|
|
21641
21640
|
initLayer() {
|
|
21642
21641
|
const stage = this.instance.getStage();
|
|
@@ -21651,7 +21650,7 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21651
21650
|
}
|
|
21652
21651
|
getLayer() {
|
|
21653
21652
|
const stage = this.instance.getStage();
|
|
21654
|
-
return stage.findOne(`#${
|
|
21653
|
+
return stage.findOne(`#${this.getLayerName()}`);
|
|
21655
21654
|
}
|
|
21656
21655
|
onInit() {
|
|
21657
21656
|
this.instance.addEventListener("onAwarenessChange", (changes) => {
|
|
@@ -21671,17 +21670,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21671
21670
|
};
|
|
21672
21671
|
}
|
|
21673
21672
|
}
|
|
21674
|
-
const allActiveUsersSelections = Object.keys(this.usersSelection).map((userSelectionKey) => {
|
|
21675
|
-
const selectionInfo = this.usersSelection[userSelectionKey];
|
|
21676
|
-
return selectionInfo.actualNodes.user;
|
|
21677
|
-
});
|
|
21678
|
-
const inactiveSelections = import_lodash.default.differenceWith(allActiveUsersSelections, allActiveUsers, import_lodash.default.isEqual);
|
|
21679
|
-
const selectionsLayer = this.getLayer();
|
|
21680
|
-
for (const inactiveSelection of inactiveSelections) {
|
|
21681
|
-
const userPointerNode = selectionsLayer?.findOne(`#${inactiveSelection}`);
|
|
21682
|
-
if (userPointerNode) userPointerNode.destroy();
|
|
21683
|
-
delete this.usersSelection[inactiveSelection];
|
|
21684
|
-
}
|
|
21685
21673
|
this.renderSelectors();
|
|
21686
21674
|
});
|
|
21687
21675
|
this.renderSelectors();
|
|
@@ -21748,51 +21736,33 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21748
21736
|
for (const selector of selectors) selector.destroy();
|
|
21749
21737
|
for (const userPointerKey of Object.keys(this.usersSelection)) {
|
|
21750
21738
|
const userSelector = this.usersSelection[userPointerKey];
|
|
21751
|
-
const
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
selectorsLayer?.add(userSelectorNode$1);
|
|
21776
|
-
continue;
|
|
21777
|
-
}
|
|
21778
|
-
const userSelectorRect = selectorsLayer?.findOne(`#selector_${userSelector.actualNodes.user}_rect`);
|
|
21779
|
-
if (userSelectorRect) {
|
|
21780
|
-
const selectionRect = this.getSelectedNodesRect(userSelector.actualNodes.nodes);
|
|
21781
|
-
userSelectorNode.setAttrs({
|
|
21782
|
-
x: selectionRect.x,
|
|
21783
|
-
y: selectionRect.y,
|
|
21784
|
-
width: selectionRect.width,
|
|
21785
|
-
height: selectionRect.height,
|
|
21786
|
-
scale: 1
|
|
21787
|
-
});
|
|
21788
|
-
userSelectorRect.setAttrs({
|
|
21789
|
-
x: 0,
|
|
21790
|
-
y: 0,
|
|
21791
|
-
width: selectionRect.width,
|
|
21792
|
-
height: selectionRect.height
|
|
21793
|
-
});
|
|
21794
|
-
}
|
|
21739
|
+
const selectionRect = this.getSelectedNodesRect(userSelector.actualNodes.nodes);
|
|
21740
|
+
const userSelectorNode = new Konva.Group({
|
|
21741
|
+
name: "selector",
|
|
21742
|
+
id: `selector_${userSelector.actualNodes.user}`,
|
|
21743
|
+
x: selectionRect.x,
|
|
21744
|
+
y: selectionRect.y,
|
|
21745
|
+
width: selectionRect.width / stage.scaleX(),
|
|
21746
|
+
height: selectionRect.height / stage.scaleY(),
|
|
21747
|
+
listening: false
|
|
21748
|
+
});
|
|
21749
|
+
userSelectorNode.moveToBottom();
|
|
21750
|
+
const userSelectorRect = new Konva.Rect({
|
|
21751
|
+
x: 0,
|
|
21752
|
+
y: 0,
|
|
21753
|
+
id: `selector_${userSelector.actualNodes.user}_rect`,
|
|
21754
|
+
width: selectionRect.width / stage.scaleX(),
|
|
21755
|
+
height: selectionRect.height / stage.scaleY(),
|
|
21756
|
+
fill: "transparent",
|
|
21757
|
+
stroke: this.stringToColor(userSelector.actualNodes.user),
|
|
21758
|
+
strokeWidth: 3,
|
|
21759
|
+
strokeScaleEnabled: false
|
|
21760
|
+
});
|
|
21761
|
+
userSelectorNode.add(userSelectorRect);
|
|
21762
|
+
selectorsLayer?.add(userSelectorNode);
|
|
21795
21763
|
}
|
|
21764
|
+
const pointers = selectorsLayer?.find(".pointer") ?? [];
|
|
21765
|
+
for (const pointer of pointers) pointer.moveToTop();
|
|
21796
21766
|
}
|
|
21797
21767
|
enable() {
|
|
21798
21768
|
this.getLayer()?.show();
|
|
@@ -21807,7 +21777,6 @@ var WeaveUsersSelectionPlugin = class extends WeavePlugin {
|
|
|
21807
21777
|
//#endregion
|
|
21808
21778
|
//#region src/plugins/users-pointers/constants.ts
|
|
21809
21779
|
const WEAVE_USERS_POINTERS_KEY = "usersPointers";
|
|
21810
|
-
const WEAVE_USERS_POINTERS_LAYER_ID = "usersPointersLayer";
|
|
21811
21780
|
const WEAVE_USER_POINTER_KEY = "userPointer";
|
|
21812
21781
|
const WEAVE_DEFAULT_USER_INFO_FUNCTION = () => ({
|
|
21813
21782
|
name: "Unknown",
|
|
@@ -21845,7 +21814,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21845
21814
|
return WEAVE_USERS_POINTERS_KEY;
|
|
21846
21815
|
}
|
|
21847
21816
|
getLayerName() {
|
|
21848
|
-
return
|
|
21817
|
+
return WEAVE_AWARENESS_LAYER_ID;
|
|
21849
21818
|
}
|
|
21850
21819
|
initLayer() {
|
|
21851
21820
|
const stage = this.instance.getStage();
|
|
@@ -21860,7 +21829,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21860
21829
|
}
|
|
21861
21830
|
getLayer() {
|
|
21862
21831
|
const stage = this.instance.getStage();
|
|
21863
|
-
return stage.findOne(`#${
|
|
21832
|
+
return stage.findOne(`#${this.getLayerName()}`);
|
|
21864
21833
|
}
|
|
21865
21834
|
onInit() {
|
|
21866
21835
|
const store = this.instance.getStore();
|
|
@@ -21883,17 +21852,6 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21883
21852
|
};
|
|
21884
21853
|
}
|
|
21885
21854
|
}
|
|
21886
|
-
const allActiveUsersPointers = Object.keys(this.usersPointers).map((userPointerKey) => {
|
|
21887
|
-
const pointerInfo = this.usersPointers[userPointerKey];
|
|
21888
|
-
return pointerInfo.actualPos.user;
|
|
21889
|
-
});
|
|
21890
|
-
const inactivePointers = import_lodash.default.differenceWith(allActiveUsersPointers, allActiveUsers, import_lodash.default.isEqual);
|
|
21891
|
-
const pointersLayer = this.getLayer();
|
|
21892
|
-
for (const inactivePointer of inactivePointers) {
|
|
21893
|
-
const userPointerNode = pointersLayer?.findOne(`#pointer_${inactivePointer}`);
|
|
21894
|
-
if (userPointerNode) userPointerNode.destroy();
|
|
21895
|
-
delete this.usersPointers[inactivePointer];
|
|
21896
|
-
}
|
|
21897
21855
|
this.renderPointers();
|
|
21898
21856
|
});
|
|
21899
21857
|
stage.on("dragmove", (e) => {
|
|
@@ -21942,85 +21900,72 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
21942
21900
|
const stage = this.instance.getStage();
|
|
21943
21901
|
const pointersLayer = this.getLayer();
|
|
21944
21902
|
if (!this.enabled) return;
|
|
21903
|
+
const pointers = pointersLayer?.find(".pointer") ?? [];
|
|
21904
|
+
for (const pointer of pointers) pointer.destroy();
|
|
21945
21905
|
for (const userPointerKey of Object.keys(this.usersPointers)) {
|
|
21946
21906
|
const userPointer = this.usersPointers[userPointerKey];
|
|
21947
|
-
const userPointerNode =
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
name: "pointer",
|
|
21951
|
-
id: `pointer_${userPointer.actualPos.user}`,
|
|
21952
|
-
x: userPointer.actualPos.x,
|
|
21953
|
-
y: userPointer.actualPos.y,
|
|
21954
|
-
opacity: 1,
|
|
21955
|
-
listening: false
|
|
21956
|
-
});
|
|
21957
|
-
const { separation, pointer: { circleRadius, circleStrokeWidth }, name: { fontFamily, fontSize, backgroundCornerRadius, backgroundPaddingX, backgroundPaddingY } } = this.uiConfig;
|
|
21958
|
-
const userColor = this.stringToColor(userPointer.actualPos.user);
|
|
21959
|
-
const userContrastColor = this.getContrastTextColor(userColor);
|
|
21960
|
-
const userPointNode = new Konva.Circle({
|
|
21961
|
-
id: `pointer_${userPointer.actualPos.user}_userPoint`,
|
|
21962
|
-
x: 0,
|
|
21963
|
-
y: 0,
|
|
21964
|
-
radius: circleRadius,
|
|
21965
|
-
fill: userColor,
|
|
21966
|
-
stroke: "black",
|
|
21967
|
-
strokeWidth: circleStrokeWidth,
|
|
21968
|
-
strokeScaleEnabled: false,
|
|
21969
|
-
listening: false
|
|
21970
|
-
});
|
|
21971
|
-
const userNameNode = new Konva.Text({
|
|
21972
|
-
id: `pointer_${userPointer.actualPos.user}_userPointName`,
|
|
21973
|
-
x: separation,
|
|
21974
|
-
y: -circleRadius * 2 + backgroundPaddingY,
|
|
21975
|
-
text: userPointer.actualPos.user.trim(),
|
|
21976
|
-
fontSize,
|
|
21977
|
-
fontFamily,
|
|
21978
|
-
lineHeight: .9,
|
|
21979
|
-
fill: userContrastColor,
|
|
21980
|
-
align: "center",
|
|
21981
|
-
verticalAlign: "middle",
|
|
21982
|
-
listening: false,
|
|
21983
|
-
strokeScaleEnabled: false,
|
|
21984
|
-
ellipsis: true
|
|
21985
|
-
});
|
|
21986
|
-
const textWidth = userNameNode.getTextWidth();
|
|
21987
|
-
const textHeight = userNameNode.getTextHeight();
|
|
21988
|
-
userNameNode.width(textWidth + backgroundPaddingX * 2);
|
|
21989
|
-
userNameNode.height(textHeight + backgroundPaddingY * 2);
|
|
21990
|
-
const userNameBackground = new Konva.Rect({
|
|
21991
|
-
id: `pointer_${userPointer.actualPos.user}_userPointRect`,
|
|
21992
|
-
x: separation,
|
|
21993
|
-
y: -backgroundPaddingY,
|
|
21994
|
-
width: textWidth + backgroundPaddingX * 2,
|
|
21995
|
-
height: textHeight + backgroundPaddingY * 2,
|
|
21996
|
-
cornerRadius: backgroundCornerRadius,
|
|
21997
|
-
fill: userColor,
|
|
21998
|
-
listening: false
|
|
21999
|
-
});
|
|
22000
|
-
userPointNode.setAttrs({ y: userNameBackground.y() + userNameBackground.height() / 2 });
|
|
22001
|
-
userPointerNode$1.add(userPointNode);
|
|
22002
|
-
userPointerNode$1.add(userNameBackground);
|
|
22003
|
-
userPointerNode$1.add(userNameNode);
|
|
22004
|
-
pointersLayer?.add(userPointerNode$1);
|
|
22005
|
-
continue;
|
|
22006
|
-
}
|
|
22007
|
-
const oldPos = {
|
|
22008
|
-
x: userPointer.oldPos.x,
|
|
22009
|
-
y: userPointer.oldPos.y
|
|
22010
|
-
};
|
|
22011
|
-
const actualPos = {
|
|
22012
|
-
x: userPointer.actualPos.x,
|
|
22013
|
-
y: userPointer.actualPos.y
|
|
22014
|
-
};
|
|
22015
|
-
const hasChanged = !import_lodash.default.isEqual(actualPos, oldPos);
|
|
22016
|
-
userPointerNode.scaleX(1 / stage.scaleX());
|
|
22017
|
-
userPointerNode.scaleY(1 / stage.scaleY());
|
|
22018
|
-
if (hasChanged) userPointerNode.setAttrs({
|
|
21907
|
+
const userPointerNode = new Konva.Group({
|
|
21908
|
+
name: "pointer",
|
|
21909
|
+
id: `pointer_${userPointer.actualPos.user}`,
|
|
22019
21910
|
x: userPointer.actualPos.x,
|
|
22020
21911
|
y: userPointer.actualPos.y,
|
|
22021
|
-
opacity: 1
|
|
21912
|
+
opacity: 1,
|
|
21913
|
+
listening: false,
|
|
21914
|
+
scaleX: 1 / stage.scaleX(),
|
|
21915
|
+
scaleY: 1 / stage.scaleY()
|
|
21916
|
+
});
|
|
21917
|
+
userPointerNode.moveToTop();
|
|
21918
|
+
const { separation, pointer: { circleRadius, circleStrokeWidth }, name: { fontFamily, fontSize, backgroundCornerRadius, backgroundPaddingX, backgroundPaddingY } } = this.uiConfig;
|
|
21919
|
+
const userColor = this.stringToColor(userPointer.actualPos.user);
|
|
21920
|
+
const userContrastColor = this.getContrastTextColor(userColor);
|
|
21921
|
+
const userPointNode = new Konva.Circle({
|
|
21922
|
+
id: `pointer_${userPointer.actualPos.user}_userPoint`,
|
|
21923
|
+
x: 0,
|
|
21924
|
+
y: 0,
|
|
21925
|
+
radius: circleRadius,
|
|
21926
|
+
fill: userColor,
|
|
21927
|
+
stroke: "black",
|
|
21928
|
+
strokeWidth: circleStrokeWidth,
|
|
21929
|
+
strokeScaleEnabled: false,
|
|
21930
|
+
listening: false
|
|
21931
|
+
});
|
|
21932
|
+
const userNameNode = new Konva.Text({
|
|
21933
|
+
id: `pointer_${userPointer.actualPos.user}_userPointName`,
|
|
21934
|
+
x: separation,
|
|
21935
|
+
y: -circleRadius * 2 + backgroundPaddingY,
|
|
21936
|
+
text: userPointer.actualPos.user.trim(),
|
|
21937
|
+
fontSize,
|
|
21938
|
+
fontFamily,
|
|
21939
|
+
lineHeight: .9,
|
|
21940
|
+
fill: userContrastColor,
|
|
21941
|
+
align: "center",
|
|
21942
|
+
verticalAlign: "middle",
|
|
21943
|
+
listening: false,
|
|
21944
|
+
strokeScaleEnabled: false,
|
|
21945
|
+
ellipsis: true
|
|
21946
|
+
});
|
|
21947
|
+
const textWidth = userNameNode.getTextWidth();
|
|
21948
|
+
const textHeight = userNameNode.getTextHeight();
|
|
21949
|
+
userNameNode.width(textWidth + backgroundPaddingX * 2);
|
|
21950
|
+
userNameNode.height(textHeight + backgroundPaddingY * 2);
|
|
21951
|
+
const userNameBackground = new Konva.Rect({
|
|
21952
|
+
id: `pointer_${userPointer.actualPos.user}_userPointRect`,
|
|
21953
|
+
x: separation,
|
|
21954
|
+
y: -backgroundPaddingY,
|
|
21955
|
+
width: textWidth + backgroundPaddingX * 2,
|
|
21956
|
+
height: textHeight + backgroundPaddingY * 2,
|
|
21957
|
+
cornerRadius: backgroundCornerRadius,
|
|
21958
|
+
fill: userColor,
|
|
21959
|
+
listening: false
|
|
22022
21960
|
});
|
|
21961
|
+
userPointNode.setAttrs({ y: userNameBackground.y() + userNameBackground.height() / 2 });
|
|
21962
|
+
userPointerNode.add(userPointNode);
|
|
21963
|
+
userPointerNode.add(userNameBackground);
|
|
21964
|
+
userPointerNode.add(userNameNode);
|
|
21965
|
+
pointersLayer?.add(userPointerNode);
|
|
22023
21966
|
}
|
|
21967
|
+
const selectors = pointersLayer?.find(".selector") ?? [];
|
|
21968
|
+
for (const selector of selectors) selector.moveToBottom();
|
|
22024
21969
|
}
|
|
22025
21970
|
enable() {
|
|
22026
21971
|
this.getLayer()?.show();
|
|
@@ -22426,4 +22371,4 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
22426
22371
|
};
|
|
22427
22372
|
|
|
22428
22373
|
//#endregion
|
|
22429
|
-
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY,
|
|
22374
|
+
export { BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_SIZES, WEAVE_FRAME_NODE_SIZES_MULTIPLIER, WEAVE_FRAME_NODE_SIZES_ORIENTATION, WEAVE_FRAME_NODE_SIZES_TYPES, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_KEY, WEAVE_STAGE_GRID_KEY, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTERS_DEFAULT_PROPS, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, Weave, WeaveAction, WeaveBrushToolAction, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveExportNodeToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveMoveToolAction, WeaveNode, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStore, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveZoomInToolAction, WeaveZoomOutToolAction, checkIfOverContainer, clearContainerTargets, moveNodeToContainer, resetScale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inditextech/weave-sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jesus Manuel Piñeiro Cid <jesusmpc@inditex.com>",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"version:release": "npm version $RELEASE_VERSION -m \"[npm-scripts] prepare release $RELEASE_VERSION\" --tag-version-prefix \"\""
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@inditextech/weave-types": "0.16.
|
|
46
|
+
"@inditextech/weave-types": "0.16.1",
|
|
47
47
|
"@syncedstore/core": "0.6.0",
|
|
48
48
|
"canvas": "3.1.0",
|
|
49
49
|
"konva": "9.3.20",
|