@liveblocks/react 2.23.0 → 2.23.2
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/_private.cjs +5 -5
- package/dist/_private.js +1 -1
- package/dist/{chunk-C337YEKB.cjs → chunk-3WTRZ7RV.cjs} +4 -18
- package/dist/chunk-3WTRZ7RV.cjs.map +1 -0
- package/dist/{chunk-BZGGMXEG.cjs → chunk-B63Z24SQ.cjs} +2 -2
- package/dist/{chunk-BZGGMXEG.cjs.map → chunk-B63Z24SQ.cjs.map} +1 -1
- package/dist/{chunk-URVBSXYW.js → chunk-NLO76T6D.js} +18 -32
- package/dist/chunk-NLO76T6D.js.map +1 -0
- package/dist/{chunk-6GLJE7ID.js → chunk-UIYEJ4GA.js} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/suspense.cjs +4 -4
- package/dist/suspense.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-C337YEKB.cjs.map +0 -1
- package/dist/chunk-URVBSXYW.js.map +0 -1
- /package/dist/{chunk-6GLJE7ID.js.map → chunk-UIYEJ4GA.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/version.ts
|
|
2
2
|
var PKG_NAME = "@liveblocks/react";
|
|
3
|
-
var PKG_VERSION = "2.23.
|
|
3
|
+
var PKG_VERSION = "2.23.2";
|
|
4
4
|
var PKG_FORMAT = "cjs";
|
|
5
5
|
|
|
6
6
|
// src/ClientSideSuspense.tsx
|
|
@@ -20,4 +20,4 @@ function ClientSideSuspense(props) {
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
exports.PKG_NAME = PKG_NAME; exports.PKG_VERSION = PKG_VERSION; exports.PKG_FORMAT = PKG_FORMAT; exports.ClientSideSuspense = ClientSideSuspense;
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-B63Z24SQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-B63Z24SQ.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,QAAA;AACvD,IAAM,WAAA,EAAgD,KAAA;ADD7D;AACA;AEJA,8BAA8C;AAkC1C,+CAAA;AAVG,SAAS,kBAAA,CAAmB,KAAA,EAAc;AAC/C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAE5C,EAAA,8BAAA,CAAU,EAAA,GAAM;AAGd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,uBACE,6BAAA,eAAC,EAAA,EAAS,QAAA,EAAU,KAAA,CAAM,QAAA,EACvB,QAAA,EAAA,QAAA,EACG,OAAO,KAAA,CAAM,SAAA,IAAa,WAAA,EACxB,KAAA,CAAM,QAAA,CAAS,EAAA,EACf,KAAA,CAAM,SAAA,EACR,KAAA,CAAM,SAAA,CACZ,CAAA;AAEJ;AF5BA;AACA;AACE;AACA;AACA;AACA;AACF,iJAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-B63Z24SQ.cjs","sourcesContent":[null,"declare const __VERSION__: string;\ndeclare const TSUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof TSUP_FORMAT === \"string\" && TSUP_FORMAT;\n","import type { ReactNode } from \"react\";\nimport { Suspense, useEffect, useState } from \"react\";\n\ntype Props = {\n fallback: ReactNode;\n children: (() => ReactNode | undefined) | ReactNode | undefined;\n};\n\n/**\n * Almost like a normal <Suspense> component, except that for server-side\n * renders, the fallback will be used.\n *\n * The child props will have to be provided in a function, i.e. change:\n *\n * <Suspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </Suspense>\n *\n * To:\n *\n * <ClientSideSuspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </ClientSideSuspense>\n *\n */\nexport function ClientSideSuspense(props: Props) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n // Effects are never executed on the server side. The point of this is to\n // delay the flipping of this boolean until after hydration has happened.\n setMounted(true);\n }, []);\n\n return (\n <Suspense fallback={props.fallback}>\n {mounted\n ? typeof props.children === \"function\"\n ? props.children()\n : props.children\n : props.fallback}\n </Suspense>\n );\n}\n"]}
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
kInternal as kInternal2,
|
|
108
108
|
makePoller,
|
|
109
109
|
raise,
|
|
110
|
-
shallow as
|
|
110
|
+
shallow as shallow3
|
|
111
111
|
} from "@liveblocks/core";
|
|
112
112
|
import {
|
|
113
113
|
createContext as createContext2,
|
|
@@ -244,7 +244,8 @@ import {
|
|
|
244
244
|
nanoid,
|
|
245
245
|
nn,
|
|
246
246
|
patchUserNotificationSettings,
|
|
247
|
-
shallow
|
|
247
|
+
shallow,
|
|
248
|
+
shallow2,
|
|
248
249
|
Signal,
|
|
249
250
|
stableStringify
|
|
250
251
|
} from "@liveblocks/core";
|
|
@@ -266,21 +267,6 @@ function autobind(self) {
|
|
|
266
267
|
} while ((obj = Reflect.getPrototypeOf(obj)) && obj !== Object.prototype);
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
// src/lib/shallow2.ts
|
|
270
|
-
import { isPlainObject, shallow } from "@liveblocks/core";
|
|
271
|
-
function shallow2(a, b) {
|
|
272
|
-
if (!isPlainObject(a) || !isPlainObject(b)) {
|
|
273
|
-
return shallow(a, b);
|
|
274
|
-
}
|
|
275
|
-
const keysA = Object.keys(a);
|
|
276
|
-
if (keysA.length !== Object.keys(b).length) {
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
return keysA.every(
|
|
280
|
-
(key) => Object.prototype.hasOwnProperty.call(b, key) && shallow(a[key], b[key])
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
270
|
// src/ThreadDB.ts
|
|
285
271
|
import { batch, MutableSignal, SortedList } from "@liveblocks/core";
|
|
286
272
|
|
|
@@ -878,7 +864,7 @@ var UmbrellaStore = class {
|
|
|
878
864
|
sortedNotifications: s.sortedNotifications,
|
|
879
865
|
notificationsById: s.notificationsById
|
|
880
866
|
}),
|
|
881
|
-
|
|
867
|
+
shallow
|
|
882
868
|
);
|
|
883
869
|
const loadingUserThreads = new DefaultMap(
|
|
884
870
|
(queryKey) => {
|
|
@@ -1002,7 +988,7 @@ var UmbrellaStore = class {
|
|
|
1002
988
|
nn(this.roomNotificationSettings.signal.get()[roomId])
|
|
1003
989
|
);
|
|
1004
990
|
}
|
|
1005
|
-
},
|
|
991
|
+
}, shallow);
|
|
1006
992
|
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1007
993
|
});
|
|
1008
994
|
const versionsByRoomId = new DefaultMap(
|
|
@@ -1032,7 +1018,7 @@ var UmbrellaStore = class {
|
|
|
1032
1018
|
Object.values(this.historyVersions.signal.get()[roomId] ?? {})
|
|
1033
1019
|
);
|
|
1034
1020
|
}
|
|
1035
|
-
},
|
|
1021
|
+
}, shallow);
|
|
1036
1022
|
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1037
1023
|
}
|
|
1038
1024
|
);
|
|
@@ -1046,7 +1032,7 @@ var UmbrellaStore = class {
|
|
|
1046
1032
|
"settings",
|
|
1047
1033
|
nn(this.userNotificationSettings.signal.get())
|
|
1048
1034
|
);
|
|
1049
|
-
},
|
|
1035
|
+
}, shallow),
|
|
1050
1036
|
waitUntilLoaded: this.#userNotificationSettings.waitUntilLoaded
|
|
1051
1037
|
};
|
|
1052
1038
|
this.outputs = {
|
|
@@ -1833,7 +1819,7 @@ function makeLiveblocksContextBundle(client) {
|
|
|
1833
1819
|
const shared = createSharedContext(client);
|
|
1834
1820
|
const bundle = {
|
|
1835
1821
|
LiveblocksProvider: LiveblocksProvider2,
|
|
1836
|
-
useInboxNotifications: () => useInboxNotifications_withClient(client, identity2,
|
|
1822
|
+
useInboxNotifications: () => useInboxNotifications_withClient(client, identity2, shallow3),
|
|
1837
1823
|
useUnreadInboxNotificationsCount: () => useUnreadInboxNotificationsCount_withClient(client),
|
|
1838
1824
|
useMarkInboxNotificationAsRead: useMarkInboxNotificationAsRead2,
|
|
1839
1825
|
useMarkAllInboxNotificationsAsRead: useMarkAllInboxNotificationsAsRead2,
|
|
@@ -1891,7 +1877,7 @@ function useInboxNotificationsSuspense_withClient(client) {
|
|
|
1891
1877
|
ensureNotServerSide();
|
|
1892
1878
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
1893
1879
|
use(store.outputs.loadingNotifications.waitUntilLoaded());
|
|
1894
|
-
const result = useInboxNotifications_withClient(client, identity2,
|
|
1880
|
+
const result = useInboxNotifications_withClient(client, identity2, shallow3);
|
|
1895
1881
|
assert(!result.error, "Did not expect error");
|
|
1896
1882
|
assert(!result.isLoading, "Did not expect loading");
|
|
1897
1883
|
return result;
|
|
@@ -1900,7 +1886,7 @@ function useUnreadInboxNotificationsCount_withClient(client) {
|
|
|
1900
1886
|
return useInboxNotifications_withClient(
|
|
1901
1887
|
client,
|
|
1902
1888
|
selectorFor_useUnreadInboxNotificationsCount,
|
|
1903
|
-
|
|
1889
|
+
shallow3
|
|
1904
1890
|
);
|
|
1905
1891
|
}
|
|
1906
1892
|
function useUnreadInboxNotificationsCountSuspense_withClient(client) {
|
|
@@ -2120,7 +2106,7 @@ function useUser_withClient(client, userId) {
|
|
|
2120
2106
|
getUserState,
|
|
2121
2107
|
getUserState,
|
|
2122
2108
|
selector,
|
|
2123
|
-
|
|
2109
|
+
shallow3
|
|
2124
2110
|
);
|
|
2125
2111
|
useEffect3(
|
|
2126
2112
|
() => void usersStore.enqueue(userId)
|
|
@@ -2181,7 +2167,7 @@ function useRoomInfo_withClient(client, roomId) {
|
|
|
2181
2167
|
getRoomInfoState,
|
|
2182
2168
|
getRoomInfoState,
|
|
2183
2169
|
selector,
|
|
2184
|
-
|
|
2170
|
+
shallow3
|
|
2185
2171
|
);
|
|
2186
2172
|
useEffect3(
|
|
2187
2173
|
() => void roomsInfoStore.enqueue(roomId)
|
|
@@ -2341,7 +2327,7 @@ function useUserThreadsSuspense_experimental(options = {}) {
|
|
|
2341
2327
|
return result;
|
|
2342
2328
|
}
|
|
2343
2329
|
function useInboxNotifications() {
|
|
2344
|
-
return useInboxNotifications_withClient(useClient(), identity2,
|
|
2330
|
+
return useInboxNotifications_withClient(useClient(), identity2, shallow3);
|
|
2345
2331
|
}
|
|
2346
2332
|
function useInboxNotificationsSuspense() {
|
|
2347
2333
|
return useInboxNotificationsSuspense_withClient(useClient());
|
|
@@ -2448,7 +2434,7 @@ function useErrorListener(callback) {
|
|
|
2448
2434
|
}
|
|
2449
2435
|
|
|
2450
2436
|
// src/room.tsx
|
|
2451
|
-
import { shallow as
|
|
2437
|
+
import { shallow as shallow4 } from "@liveblocks/client";
|
|
2452
2438
|
import {
|
|
2453
2439
|
assert as assert2,
|
|
2454
2440
|
console as console3,
|
|
@@ -3088,7 +3074,7 @@ function useOthersMapped(itemSelector, itemIsEqual) {
|
|
|
3088
3074
|
return useOthers(wrappedSelector, wrappedIsEqual);
|
|
3089
3075
|
}
|
|
3090
3076
|
function useOthersConnectionIds() {
|
|
3091
|
-
return useOthers(selectorFor_useOthersConnectionIds,
|
|
3077
|
+
return useOthers(selectorFor_useOthersConnectionIds, shallow4);
|
|
3092
3078
|
}
|
|
3093
3079
|
var NOT_FOUND = Symbol();
|
|
3094
3080
|
function useOther(connectionId, selector, isEqual) {
|
|
@@ -3700,7 +3686,7 @@ function useThreadSubscription(threadId) {
|
|
|
3700
3686
|
},
|
|
3701
3687
|
[threadId]
|
|
3702
3688
|
);
|
|
3703
|
-
return useSignal(signal, selector,
|
|
3689
|
+
return useSignal(signal, selector, shallow4);
|
|
3704
3690
|
}
|
|
3705
3691
|
function useRoomNotificationSettings() {
|
|
3706
3692
|
const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
|
|
@@ -3925,7 +3911,7 @@ function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
|
3925
3911
|
getAttachmentUrlState,
|
|
3926
3912
|
getAttachmentUrlState,
|
|
3927
3913
|
selectorFor_useAttachmentUrl,
|
|
3928
|
-
|
|
3914
|
+
shallow4
|
|
3929
3915
|
);
|
|
3930
3916
|
}
|
|
3931
3917
|
function useAttachmentUrlSuspense(attachmentId) {
|
|
@@ -4112,4 +4098,4 @@ export {
|
|
|
4112
4098
|
_useStorageRoot,
|
|
4113
4099
|
_useUpdateMyPresence
|
|
4114
4100
|
};
|
|
4115
|
-
//# sourceMappingURL=chunk-
|
|
4101
|
+
//# sourceMappingURL=chunk-NLO76T6D.js.map
|