@pluv/react 0.5.7 → 0.5.8

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/react@0.5.7 build /home/runner/work/pluv/pluv/packages/react
2
+ > @pluv/react@0.5.8 build /home/runner/work/pluv/pluv/packages/react
3
3
  > tsup src/index.ts --format esm,cjs --dts --external react
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 8.75 KB
12
- ESM ⚡️ Build success in 121ms
13
- CJS dist/index.js 11.24 KB
14
- CJS ⚡️ Build success in 121ms
11
+ CJS dist/index.js 11.15 KB
12
+ CJS ⚡️ Build success in 100ms
13
+ ESM dist/index.mjs 8.66 KB
14
+ ESM ⚡️ Build success in 110ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 5667ms
16
+ DTS ⚡️ Build success in 4254ms
17
17
  DTS dist/index.d.ts 4.37 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @pluv/react
2
2
 
3
+ ## 0.5.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 7ad4967: fixed user's presence not updating locally while offline
8
+ - Updated dependencies [7ad4967]
9
+ - Updated dependencies [4535687]
10
+ - @pluv/client@0.6.5
11
+ - @pluv/types@0.1.6
12
+
3
13
  ## 0.5.7
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -195,12 +195,8 @@ var createRoomBundle = (client, options = {}) => {
195
195
  );
196
196
  const updateMyPresence = (0, import_react3.useCallback)(
197
197
  (value) => {
198
- const oldMyPresence = room.getMyPresence();
199
- const presence = typeof value === "function" ? value(oldMyPresence) : value;
200
- room.broadcast(
201
- "$UPDATE_PRESENCE",
202
- { presence }
203
- );
198
+ const presence = typeof value === "function" ? value(room.getMyPresence()) : value;
199
+ room.updateMyPresence(presence);
204
200
  },
205
201
  [room]
206
202
  );
package/dist/index.mjs CHANGED
@@ -158,12 +158,8 @@ var createRoomBundle = (client, options = {}) => {
158
158
  );
159
159
  const updateMyPresence = useCallback2(
160
160
  (value) => {
161
- const oldMyPresence = room.getMyPresence();
162
- const presence = typeof value === "function" ? value(oldMyPresence) : value;
163
- room.broadcast(
164
- "$UPDATE_PRESENCE",
165
- { presence }
166
- );
161
+ const presence = typeof value === "function" ? value(room.getMyPresence()) : value;
162
+ room.updateMyPresence(presence);
167
163
  },
168
164
  [room]
169
165
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/react",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "@pluv/client React.js bindings",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  "@types/use-sync-external-store": "^0.0.3",
21
21
  "fast-deep-equal": "^3.1.3",
22
22
  "use-sync-external-store": "^1.2.0",
23
- "@pluv/client": "^0.6.4",
23
+ "@pluv/client": "^0.6.5",
24
24
  "@pluv/types": "^0.1.6"
25
25
  },
26
26
  "peerDependencies": {
@@ -28,12 +28,12 @@
28
28
  "yjs": "^13.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/react": "18.0.33",
31
+ "@types/react": "18.0.37",
32
32
  "react": "18.2.0",
33
33
  "tsup": "^6.7.0",
34
34
  "typescript": "^5.0.4",
35
35
  "yjs": "^13.5.52",
36
- "@pluv/tsconfig": "^0.1.5",
36
+ "@pluv/tsconfig": "^0.1.6",
37
37
  "eslint-config-pluv": "^0.1.10"
38
38
  },
39
39
  "scripts": {
@@ -334,16 +334,12 @@ export const createRoomBundle = <
334
334
  const updateMyPresence: Dispatch<UpdateMyPresenceAction<TPresence>> =
335
335
  useCallback(
336
336
  (value: UpdateMyPresenceAction<TPresence>): void => {
337
- const oldMyPresence = room.getMyPresence();
338
337
  const presence =
339
338
  typeof value === "function"
340
- ? value(oldMyPresence)
339
+ ? value(room.getMyPresence())
341
340
  : value;
342
341
 
343
- room.broadcast(
344
- "$UPDATE_PRESENCE" as keyof InferIOInput<TIO>,
345
- { presence } as any
346
- );
342
+ room.updateMyPresence(presence);
347
343
  },
348
344
  [room]
349
345
  );