@inditextech/weave-react 0.25.0 → 0.26.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/react.cjs +18 -0
- package/dist/react.d.cts +3 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +18 -0
- package/package.json +2 -2
package/dist/react.cjs
CHANGED
|
@@ -32,6 +32,9 @@ const WEAVE_INSTANCE_STATUS = {
|
|
|
32
32
|
["IDLE"]: "idle",
|
|
33
33
|
["STARTING"]: "starting",
|
|
34
34
|
["LOADING_FONTS"]: "loadingFonts",
|
|
35
|
+
["CONNECTING_TO_ROOM"]: "connectingToRoom",
|
|
36
|
+
["CONNECTING_ERROR"]: "connectingError",
|
|
37
|
+
["LOADING_ROOM"]: "loadingRoom",
|
|
35
38
|
["RUNNING"]: "running"
|
|
36
39
|
};
|
|
37
40
|
const WEAVE_TRANSFORMER_ANCHORS = {
|
|
@@ -235,12 +238,20 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
235
238
|
const setCanUndo = useWeave((state) => state.setCanUndo);
|
|
236
239
|
const setCanRedo = useWeave((state) => state.setCanRedo);
|
|
237
240
|
const setActualAction = useWeave((state) => state.setActualAction);
|
|
241
|
+
const setConnectionStatus = useWeave((state) => state.setConnectionStatus);
|
|
238
242
|
const onInstanceStatusHandler = react.default.useCallback(
|
|
239
243
|
(status) => {
|
|
240
244
|
setStatus(status);
|
|
241
245
|
},
|
|
242
246
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
243
247
|
[]
|
|
248
|
+
);
|
|
249
|
+
const onStoreConnectionStatusChangeHandler = react.default.useCallback(
|
|
250
|
+
(status) => {
|
|
251
|
+
setConnectionStatus(status);
|
|
252
|
+
},
|
|
253
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
254
|
+
[]
|
|
244
255
|
);
|
|
245
256
|
const onRoomLoadedHandler = react.default.useCallback(
|
|
246
257
|
(status) => {
|
|
@@ -313,6 +324,7 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
313
324
|
height: weaveEleClientRect?.height ?? 1080
|
|
314
325
|
});
|
|
315
326
|
weaveInstanceRef.current.addEventListener("onInstanceStatus", onInstanceStatusHandler);
|
|
327
|
+
weaveInstanceRef.current.addEventListener("onStoreConnectionStatusChange", onStoreConnectionStatusChangeHandler);
|
|
316
328
|
weaveInstanceRef.current.addEventListener("onRoomLoaded", onRoomLoadedHandler);
|
|
317
329
|
weaveInstanceRef.current.addEventListener("onStateChange", onStateChangeHandler);
|
|
318
330
|
weaveInstanceRef.current.addEventListener("onUndoManagerStatusChange", onUndoManagerStatusChangeHandler);
|
|
@@ -325,6 +337,12 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
325
337
|
setRoomLoaded(false);
|
|
326
338
|
initWeave();
|
|
327
339
|
return () => {
|
|
340
|
+
weaveInstanceRef.current?.removeEventListener("onInstanceStatus", onInstanceStatusHandler);
|
|
341
|
+
weaveInstanceRef.current?.removeEventListener("onStoreConnectionStatusChange", onStoreConnectionStatusChangeHandler);
|
|
342
|
+
weaveInstanceRef.current?.removeEventListener("onRoomLoaded", onRoomLoadedHandler);
|
|
343
|
+
weaveInstanceRef.current?.removeEventListener("onStateChange", onStateChangeHandler);
|
|
344
|
+
weaveInstanceRef.current?.removeEventListener("onUndoManagerStatusChange", onUndoManagerStatusChangeHandler);
|
|
345
|
+
weaveInstanceRef.current?.removeEventListener("onActiveActionChange", onActiveActionChangeHandler);
|
|
328
346
|
weaveInstanceRef.current?.destroy();
|
|
329
347
|
weaveInstanceRef.current = null;
|
|
330
348
|
};
|
package/dist/react.d.cts
CHANGED
|
@@ -48,6 +48,9 @@ declare const WEAVE_INSTANCE_STATUS: {
|
|
|
48
48
|
readonly "IDLE": "idle";
|
|
49
49
|
readonly "STARTING": "starting";
|
|
50
50
|
readonly "LOADING_FONTS": "loadingFonts";
|
|
51
|
+
readonly "CONNECTING_TO_ROOM": "connectingToRoom";
|
|
52
|
+
readonly "CONNECTING_ERROR": "connectingError";
|
|
53
|
+
readonly "LOADING_ROOM": "loadingRoom";
|
|
51
54
|
readonly "RUNNING": "running";
|
|
52
55
|
}; //#endregion
|
|
53
56
|
//#region src/components/provider.d.ts
|
package/dist/react.d.ts
CHANGED
|
@@ -48,6 +48,9 @@ declare const WEAVE_INSTANCE_STATUS: {
|
|
|
48
48
|
readonly "IDLE": "idle";
|
|
49
49
|
readonly "STARTING": "starting";
|
|
50
50
|
readonly "LOADING_FONTS": "loadingFonts";
|
|
51
|
+
readonly "CONNECTING_TO_ROOM": "connectingToRoom";
|
|
52
|
+
readonly "CONNECTING_ERROR": "connectingError";
|
|
53
|
+
readonly "LOADING_ROOM": "loadingRoom";
|
|
51
54
|
readonly "RUNNING": "running";
|
|
52
55
|
}; //#endregion
|
|
53
56
|
//#region src/components/provider.d.ts
|
package/dist/react.js
CHANGED
|
@@ -8,6 +8,9 @@ const WEAVE_INSTANCE_STATUS = {
|
|
|
8
8
|
["IDLE"]: "idle",
|
|
9
9
|
["STARTING"]: "starting",
|
|
10
10
|
["LOADING_FONTS"]: "loadingFonts",
|
|
11
|
+
["CONNECTING_TO_ROOM"]: "connectingToRoom",
|
|
12
|
+
["CONNECTING_ERROR"]: "connectingError",
|
|
13
|
+
["LOADING_ROOM"]: "loadingRoom",
|
|
11
14
|
["RUNNING"]: "running"
|
|
12
15
|
};
|
|
13
16
|
const WEAVE_TRANSFORMER_ANCHORS = {
|
|
@@ -211,12 +214,20 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
211
214
|
const setCanUndo = useWeave((state) => state.setCanUndo);
|
|
212
215
|
const setCanRedo = useWeave((state) => state.setCanRedo);
|
|
213
216
|
const setActualAction = useWeave((state) => state.setActualAction);
|
|
217
|
+
const setConnectionStatus = useWeave((state) => state.setConnectionStatus);
|
|
214
218
|
const onInstanceStatusHandler = React.useCallback(
|
|
215
219
|
(status) => {
|
|
216
220
|
setStatus(status);
|
|
217
221
|
},
|
|
218
222
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
219
223
|
[]
|
|
224
|
+
);
|
|
225
|
+
const onStoreConnectionStatusChangeHandler = React.useCallback(
|
|
226
|
+
(status) => {
|
|
227
|
+
setConnectionStatus(status);
|
|
228
|
+
},
|
|
229
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
230
|
+
[]
|
|
220
231
|
);
|
|
221
232
|
const onRoomLoadedHandler = React.useCallback(
|
|
222
233
|
(status) => {
|
|
@@ -289,6 +300,7 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
289
300
|
height: weaveEleClientRect?.height ?? 1080
|
|
290
301
|
});
|
|
291
302
|
weaveInstanceRef.current.addEventListener("onInstanceStatus", onInstanceStatusHandler);
|
|
303
|
+
weaveInstanceRef.current.addEventListener("onStoreConnectionStatusChange", onStoreConnectionStatusChangeHandler);
|
|
292
304
|
weaveInstanceRef.current.addEventListener("onRoomLoaded", onRoomLoadedHandler);
|
|
293
305
|
weaveInstanceRef.current.addEventListener("onStateChange", onStateChangeHandler);
|
|
294
306
|
weaveInstanceRef.current.addEventListener("onUndoManagerStatusChange", onUndoManagerStatusChangeHandler);
|
|
@@ -301,6 +313,12 @@ const WeaveProvider = ({ containerId, getUser, store, nodes = [], actions = [],
|
|
|
301
313
|
setRoomLoaded(false);
|
|
302
314
|
initWeave();
|
|
303
315
|
return () => {
|
|
316
|
+
weaveInstanceRef.current?.removeEventListener("onInstanceStatus", onInstanceStatusHandler);
|
|
317
|
+
weaveInstanceRef.current?.removeEventListener("onStoreConnectionStatusChange", onStoreConnectionStatusChangeHandler);
|
|
318
|
+
weaveInstanceRef.current?.removeEventListener("onRoomLoaded", onRoomLoadedHandler);
|
|
319
|
+
weaveInstanceRef.current?.removeEventListener("onStateChange", onStateChangeHandler);
|
|
320
|
+
weaveInstanceRef.current?.removeEventListener("onUndoManagerStatusChange", onUndoManagerStatusChangeHandler);
|
|
321
|
+
weaveInstanceRef.current?.removeEventListener("onActiveActionChange", onActiveActionChangeHandler);
|
|
304
322
|
weaveInstanceRef.current?.destroy();
|
|
305
323
|
weaveInstanceRef.current = null;
|
|
306
324
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inditextech/weave-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jesus Manuel Piñeiro Cid <jesusmpc@inditex.com>",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"yjs": "13.6.26"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@inditextech/weave-sdk": "0.
|
|
51
|
+
"@inditextech/weave-sdk": "0.26.0",
|
|
52
52
|
"@types/node": "^22.15.3",
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "8.26.0",
|
|
54
54
|
"@typescript-eslint/parser": "8.26.0",
|