@inditextech/weave-sdk 2.8.0 → 2.8.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.js +21 -24
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.node.d.ts +5 -5
- package/dist/sdk.node.d.ts.map +1 -1
- package/dist/sdk.node.js +3 -5
- package/dist/sdk.node.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -15008,7 +15008,6 @@ var require_lodash = __commonJS({ "../../node_modules/lodash/lodash.js"(exports,
|
|
|
15008
15008
|
} else root$8._ = _;
|
|
15009
15009
|
}).call(exports);
|
|
15010
15010
|
} });
|
|
15011
|
-
var import_lodash$1 = __toESM(require_lodash());
|
|
15012
15011
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
15013
15012
|
|
|
15014
15013
|
//#endregion
|
|
@@ -15153,13 +15152,13 @@ var WeaveStore = class {
|
|
|
15153
15152
|
node: JSON.parse(JSON.stringify(nodeInfo.node))
|
|
15154
15153
|
});
|
|
15155
15154
|
}
|
|
15156
|
-
if (!this.isRoomLoaded && !(0, import_lodash
|
|
15155
|
+
if (!this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) {
|
|
15157
15156
|
this.instance.setupRenderer();
|
|
15158
15157
|
this.isRoomLoaded = true;
|
|
15159
15158
|
this.emitOnRoomLoadedEvent();
|
|
15160
15159
|
return;
|
|
15161
15160
|
}
|
|
15162
|
-
if (this.isRoomLoaded && !(0, import_lodash
|
|
15161
|
+
if (this.isRoomLoaded && !(0, import_lodash.isEmpty)(this.state.weave)) this.instance.render();
|
|
15163
15162
|
});
|
|
15164
15163
|
}
|
|
15165
15164
|
canUndoStateStep() {
|
|
@@ -17603,7 +17602,7 @@ var require_mergeWith = __commonJS({ "../../node_modules/lodash/mergeWith.js"(ex
|
|
|
17603
17602
|
});
|
|
17604
17603
|
module.exports = mergeWith;
|
|
17605
17604
|
} });
|
|
17606
|
-
var import_mergeWith = __toESM(require_mergeWith());
|
|
17605
|
+
var import_mergeWith = __toESM(require_mergeWith(), 1);
|
|
17607
17606
|
|
|
17608
17607
|
//#endregion
|
|
17609
17608
|
//#region src/utils.ts
|
|
@@ -18473,7 +18472,7 @@ var require_throttle = __commonJS({ "../../node_modules/lodash/throttle.js"(expo
|
|
|
18473
18472
|
}
|
|
18474
18473
|
module.exports = throttle;
|
|
18475
18474
|
} });
|
|
18476
|
-
var import_throttle = __toESM(require_throttle());
|
|
18475
|
+
var import_throttle = __toESM(require_throttle(), 1);
|
|
18477
18476
|
|
|
18478
18477
|
//#endregion
|
|
18479
18478
|
//#region src/nodes/stage/constants.ts
|
|
@@ -20087,7 +20086,7 @@ var WeaveNode = class {
|
|
|
20087
20086
|
if (nodesSelectionPlugin && this.isSelecting() && this.isNodeSelected(node$1)) nodesSelectionPlugin.getTransformer().forceUpdate();
|
|
20088
20087
|
if (nodesEdgeSnappingPlugin && transforming && this.isSelecting() && this.isNodeSelected(node$1)) nodesEdgeSnappingPlugin.evaluateGuidelines(e);
|
|
20089
20088
|
};
|
|
20090
|
-
node.on("transform", (0, import_lodash
|
|
20089
|
+
node.on("transform", (0, import_lodash.throttle)(handleTransform, 100));
|
|
20091
20090
|
node.on("transformend", (e) => {
|
|
20092
20091
|
const node$1 = e.target;
|
|
20093
20092
|
e.target.setAttr("strokeScaleEnabled", true);
|
|
@@ -20187,7 +20186,7 @@ var WeaveNode = class {
|
|
|
20187
20186
|
if (layerToMove && !hasFrames(realNodeTarget) && realNodeTarget.isDragging() && !realNodeTarget.getAttrs().lockToContainer) layerToMove.fire(WEAVE_NODE_CUSTOM_EVENTS.onTargetEnter, { node: realNodeTarget });
|
|
20188
20187
|
}
|
|
20189
20188
|
};
|
|
20190
|
-
node.on("dragmove", (0, import_lodash
|
|
20189
|
+
node.on("dragmove", (0, import_lodash.throttle)(handleDragMove, 100));
|
|
20191
20190
|
node.on("dragend", (e) => {
|
|
20192
20191
|
const nodeTarget = e.target;
|
|
20193
20192
|
if (this.getSelectionPlugin()?.getSelectedNodes().length === 1) {
|
|
@@ -21628,7 +21627,7 @@ var WeaveTextNode = class extends WeaveNode {
|
|
|
21628
21627
|
text.on("transformstart", (e) => {
|
|
21629
21628
|
this.instance.emitEvent("onTransform", e.target);
|
|
21630
21629
|
});
|
|
21631
|
-
text.on("transform", (0, import_lodash
|
|
21630
|
+
text.on("transform", (0, import_lodash.throttle)(handleTextTransform, 50));
|
|
21632
21631
|
text.on("transformend", () => {
|
|
21633
21632
|
this.instance.emitEvent("onTransform", null);
|
|
21634
21633
|
});
|
|
@@ -24935,7 +24934,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
24935
24934
|
this.config.zoomSteps = [minimumZoom, ...this.config.zoomSteps];
|
|
24936
24935
|
}
|
|
24937
24936
|
};
|
|
24938
|
-
mainLayer?.on("draw", (0, import_lodash
|
|
24937
|
+
mainLayer?.on("draw", (0, import_lodash.throttle)(handleDraw, 50));
|
|
24939
24938
|
this.setZoom(this.config.zoomSteps[this.actualStep]);
|
|
24940
24939
|
}
|
|
24941
24940
|
setZoom(scale, centered = true, pointer) {
|
|
@@ -25279,7 +25278,7 @@ var WeaveStageZoomPlugin = class extends WeavePlugin {
|
|
|
25279
25278
|
requestAnimationFrame(this.zoomTick.bind(this));
|
|
25280
25279
|
}
|
|
25281
25280
|
};
|
|
25282
|
-
const throttledHandleWheel = (0, import_lodash
|
|
25281
|
+
const throttledHandleWheel = (0, import_lodash.throttle)(handleWheel, 30);
|
|
25283
25282
|
window.addEventListener("wheel", throttledHandleWheel, { passive: true });
|
|
25284
25283
|
}
|
|
25285
25284
|
getInertiaScale() {
|
|
@@ -28667,7 +28666,7 @@ var WeaveStageGridPlugin = class extends WeavePlugin {
|
|
|
28667
28666
|
if (!this.enabled || !(this.isSpaceKeyPressed || this.isMouseMiddleButtonPressed || this.moveToolActive)) return;
|
|
28668
28667
|
this.onRender();
|
|
28669
28668
|
};
|
|
28670
|
-
stage.on("pointermove", (0, import_lodash
|
|
28669
|
+
stage.on("pointermove", (0, import_lodash.throttle)(handleMouseMove, 50));
|
|
28671
28670
|
stage.on("pointermove", () => {
|
|
28672
28671
|
if (this.enabled) this.onRender();
|
|
28673
28672
|
});
|
|
@@ -28974,7 +28973,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
28974
28973
|
lastPos = pos;
|
|
28975
28974
|
this.instance.emitEvent("onStageMove");
|
|
28976
28975
|
};
|
|
28977
|
-
stage.on("pointermove", (0, import_lodash
|
|
28976
|
+
stage.on("pointermove", (0, import_lodash.throttle)(handleMouseMove, 50));
|
|
28978
28977
|
stage.on("pointerup", (e) => {
|
|
28979
28978
|
this.pointers.delete(e.evt.pointerId);
|
|
28980
28979
|
this.isMouseLeftButtonPressed = false;
|
|
@@ -29000,7 +28999,7 @@ var WeaveStagePanningPlugin = class extends WeavePlugin {
|
|
|
29000
28999
|
stage.y(stage.y() - e.deltaY);
|
|
29001
29000
|
this.instance.emitEvent("onStageMove");
|
|
29002
29001
|
};
|
|
29003
|
-
const handleWheelThrottled = (0, import_lodash
|
|
29002
|
+
const handleWheelThrottled = (0, import_lodash.throttle)(handleWheel, 20);
|
|
29004
29003
|
window.addEventListener("wheel", handleWheelThrottled, { passive: true });
|
|
29005
29004
|
stage.on("dragstart", (e) => {
|
|
29006
29005
|
const duration = 1e3 / 60;
|
|
@@ -29239,7 +29238,7 @@ var WeaveStageMinimapPlugin = class extends WeavePlugin {
|
|
|
29239
29238
|
this.setupMinimap();
|
|
29240
29239
|
}
|
|
29241
29240
|
onInit() {
|
|
29242
|
-
const throttledUpdateMinimap = (0, import_lodash
|
|
29241
|
+
const throttledUpdateMinimap = (0, import_lodash.throttle)(async () => {
|
|
29243
29242
|
await this.updateMinimapContent();
|
|
29244
29243
|
this.updateMinimapViewportReference();
|
|
29245
29244
|
}, 100);
|
|
@@ -29562,7 +29561,7 @@ var WeaveConnectedUsersPlugin = class extends WeavePlugin {
|
|
|
29562
29561
|
newConnectedUsers[userInformation.id] = userInformation;
|
|
29563
29562
|
}
|
|
29564
29563
|
}
|
|
29565
|
-
if (!(0, import_lodash
|
|
29564
|
+
if (!(0, import_lodash.isEqual)(this.connectedUsers, newConnectedUsers)) this.instance.emitEvent("onConnectedUsersChange", newConnectedUsers);
|
|
29566
29565
|
this.connectedUsers = newConnectedUsers;
|
|
29567
29566
|
});
|
|
29568
29567
|
}
|
|
@@ -29811,7 +29810,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
29811
29810
|
for (let i = 0; i < inactiveUsers.length; i++) delete this.usersPointers[inactiveUsers[i]];
|
|
29812
29811
|
this.renderPointers();
|
|
29813
29812
|
});
|
|
29814
|
-
const sendAwarenessUpdateThrottled = (0, import_lodash
|
|
29813
|
+
const sendAwarenessUpdateThrottled = (0, import_lodash.throttle)(this.sendAwarenessUpdate.bind(this), this.config.awarenessThrottleMs);
|
|
29815
29814
|
stage.on("dragmove", () => {
|
|
29816
29815
|
const mousePos = stage.getRelativePointerPosition();
|
|
29817
29816
|
if (mousePos) sendAwarenessUpdateThrottled(mousePos);
|
|
@@ -29820,7 +29819,7 @@ var WeaveUsersPointersPlugin = class extends WeavePlugin {
|
|
|
29820
29819
|
const mousePos = stage.getRelativePointerPosition();
|
|
29821
29820
|
if (mousePos) sendAwarenessUpdateThrottled(mousePos);
|
|
29822
29821
|
};
|
|
29823
|
-
const throttledHandleOnPointerMove = (0, import_lodash
|
|
29822
|
+
const throttledHandleOnPointerMove = (0, import_lodash.throttle)(handleOnPointerMove, this.config.awarenessThrottleMs);
|
|
29824
29823
|
stage.on("pointermove", throttledHandleOnPointerMove);
|
|
29825
29824
|
this.renderPointers();
|
|
29826
29825
|
}
|
|
@@ -31055,10 +31054,8 @@ var WeaveStageKeyboardMovePlugin = class extends WeavePlugin {
|
|
|
31055
31054
|
|
|
31056
31055
|
//#endregion
|
|
31057
31056
|
//#region src/index.node.ts
|
|
31058
|
-
|
|
31059
|
-
|
|
31060
|
-
global._weave_serverSideBackend = void 0;
|
|
31061
|
-
}
|
|
31057
|
+
globalThis._weave_isServerSide = true;
|
|
31058
|
+
globalThis._weave_serverSideBackend = void 0;
|
|
31062
31059
|
|
|
31063
31060
|
//#endregion
|
|
31064
31061
|
//#region src/managers/groups.ts
|
|
@@ -32098,7 +32095,7 @@ var WeaveRegisterManager = class {
|
|
|
32098
32095
|
|
|
32099
32096
|
//#endregion
|
|
32100
32097
|
//#region package.json
|
|
32101
|
-
var version = "2.8.
|
|
32098
|
+
var version = "2.8.1";
|
|
32102
32099
|
|
|
32103
32100
|
//#endregion
|
|
32104
32101
|
//#region src/managers/setup.ts
|
|
@@ -33429,8 +33426,8 @@ var WeaveLineToolAction = class extends WeaveAction {
|
|
|
33429
33426
|
|
|
33430
33427
|
//#endregion
|
|
33431
33428
|
//#region src/index.ts
|
|
33432
|
-
|
|
33433
|
-
|
|
33429
|
+
globalThis._weave_isServerSide = false;
|
|
33430
|
+
globalThis._weave_serverSideBackend = void 0;
|
|
33434
33431
|
|
|
33435
33432
|
//#endregion
|
|
33436
33433
|
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, ARROW_TOOL_ACTION_NAME, ARROW_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_LINE_DEFAULT_CONFIG, GUIDE_ENTER_SNAPPING_TOLERANCE, GUIDE_EXIT_SNAPPING_TOLERANCE, GUIDE_HORIZONTAL_LINE_NAME, GUIDE_LINE_DEFAULT_CONFIG, GUIDE_LINE_DRAG_SNAPPING_THRESHOLD, GUIDE_LINE_NAME, GUIDE_LINE_TRANSFORM_SNAPPING_THRESHOLD, GUIDE_ORIENTATION, GUIDE_VERTICAL_LINE_NAME, IMAGE_TOOL_ACTION_NAME, IMAGE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, NODE_SNAP, NODE_SNAP_HORIZONTAL, NODE_SNAP_VERTICAL, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_COLOR, WEAVE_GRID_DEFAULT_DOT_MAX_DOTS_PER_AXIS, WEAVE_GRID_DEFAULT_MAJOR_DOT_RATIO, WEAVE_GRID_DEFAULT_MAJOR_EVERY, WEAVE_GRID_DEFAULT_MAJOR_LINE_RATIO, WEAVE_GRID_DEFAULT_ORIGIN_COLOR, WEAVE_GRID_DEFAULT_RADIUS, WEAVE_GRID_DEFAULT_SIZE, WEAVE_GRID_DEFAULT_STROKE, WEAVE_GRID_DEFAULT_TYPE, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_NODES_DISTANCE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_EDGE_SNAPPING_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveImageNode, WeaveImageToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesDistanceSnappingPlugin, WeaveNodesEdgeSnappingPlugin, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeavePenToolAction, WeavePlugin, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStore, WeaveStrokeNode, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, canComposite, clearContainerTargets, containerOverCursor, containsNodeDeep, defaultInitialState, getBoundingBox, getExportBoundingBox, getPositionRelativeToContainerOnPosition, getSelectedNodesMetadata, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, intersectArrays, isIOS, isInShadowDOM, isNodeInSelection, isServer, memoize, mergeExceptArrays, moveNodeToContainer, resetScale };
|