@liveblocks/react 2.7.0-versions2 → 2.7.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.
@@ -1,7 +1,7 @@
1
+ import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, Client as Client$1, ClientOptions, ThreadData as ThreadData$1, StorageStatus as StorageStatus$1, CommentData as CommentData$1 } from '@liveblocks/client';
1
2
  import * as React$1 from 'react';
2
3
  import React__default, { ReactNode, PropsWithChildren } from 'react';
3
- import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, Client as Client$1, BaseMetadata as BaseMetadata$1 } from '@liveblocks/client';
4
- import { BaseMetadata, CommentBody, Patchable, QueryMetadata, StorageStatus, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, OpaqueClient, DU, ClientOptions, DM, OpaqueRoom, RoomNotificationSettings as RoomNotificationSettings$1, DP, DS, DE } from '@liveblocks/core';
4
+ import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, ThreadDeleteInfo, InboxNotificationDeleteInfo, DistributiveOmit, CommentUserReaction, AsyncResult, OpaqueClient, DU, DM, OpaqueRoom, DP, DS, DE } from '@liveblocks/core';
5
5
 
6
6
  declare type Props = {
7
7
  fallback: ReactNode;
@@ -132,23 +132,31 @@ declare type UseStorageStatusOptions = {
132
132
  smooth?: boolean;
133
133
  };
134
134
  declare type StorageStatusSuccess = Exclude<StorageStatus, "not-loaded" | "loading">;
135
+ declare type ThreadsQuery<M extends BaseMetadata> = {
136
+ /**
137
+ * Whether to only return threads marked as resolved or unresolved. If not provided,
138
+ * all threads will be returned.
139
+ */
140
+ resolved?: boolean;
141
+ /**
142
+ * The metadata to filter the threads by. If provided, only threads with metadata that matches
143
+ * the provided metadata will be returned. If not provided, all threads will be returned.
144
+ */
145
+ metadata?: Partial<QueryMetadata<M>>;
146
+ };
147
+ declare type UseUserThreadsOptions<M extends BaseMetadata> = {
148
+ /**
149
+ * The query (including metadata) to filter the threads by. If provided, only threads
150
+ * that match the query will be returned. If not provided, all threads will be returned.
151
+ */
152
+ query?: ThreadsQuery<M>;
153
+ };
135
154
  declare type UseThreadsOptions<M extends BaseMetadata> = {
136
155
  /**
137
156
  * The query (including metadata) to filter the threads by. If provided, only threads
138
157
  * that match the query will be returned. If not provided, all threads will be returned.
139
158
  */
140
- query?: {
141
- /**
142
- * Whether to only return threads marked as resolved or unresolved. If not provided,
143
- * all threads will be returned.
144
- */
145
- resolved?: boolean;
146
- /**
147
- * The metadata to filter the threads by. If provided, only threads with metadata that matches
148
- * the provided metadata will be returned. If not provided, all threads will be returned.
149
- */
150
- metadata?: Partial<QueryMetadata<M>>;
151
- };
159
+ query?: ThreadsQuery<M>;
152
160
  /**
153
161
  * Whether to scroll to a comment on load based on the URL hash. Defaults to `true`.
154
162
  *
@@ -915,14 +923,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
915
923
  (settings: Partial<RoomNotificationSettings>) => void
916
924
  ];
917
925
  /**
918
- * Returns a history of versions of the current room.
926
+ * (Private beta) Returns a history of versions of the current room.
919
927
  *
920
928
  * @example
921
929
  * const { versions, error, isLoading } = useHistoryVersions();
922
930
  */
923
931
  useHistoryVersions(): HistoryVersionsState;
924
932
  /**
925
- * Returns the data of a specific version of the current room.
933
+ * (Private beta) Returns the data of a specific version of the current room.
926
934
  *
927
935
  * @example
928
936
  * const { data, error, isLoading } = useHistoryVersionData(version.id);
@@ -991,7 +999,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
991
999
  */
992
1000
  useThreads(options?: UseThreadsOptions<M>): ThreadsStateSuccess<M>;
993
1001
  /**
994
- * Returns a history of versions of the current room.
1002
+ * (Private beta) Returns a history of versions of the current room.
995
1003
  *
996
1004
  * @example
997
1005
  * const { versions } = useHistoryVersions();
@@ -1087,9 +1095,9 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
1087
1095
  * @experimental
1088
1096
  *
1089
1097
  * This hook is experimental and could be removed or changed at any time!
1090
- * Do not use unless explicitely recommended by the Liveblocks team.
1098
+ * Do not use unless explicitly recommended by the Liveblocks team.
1091
1099
  */
1092
- useUserThreads_experimental(): ThreadsState<M>;
1100
+ useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsState<M>;
1093
1101
  suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
1094
1102
  /**
1095
1103
  * Returns the inbox notifications for the current user.
@@ -1109,12 +1117,223 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
1109
1117
  * @experimental
1110
1118
  *
1111
1119
  * This hook is experimental and could be removed or changed at any time!
1112
- * Do not use unless explicitely recommended by the Liveblocks team.
1120
+ * Do not use unless explicitly recommended by the Liveblocks team.
1113
1121
  */
1114
- useUserThreads_experimental(): ThreadsStateSuccess<M>;
1122
+ useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsStateSuccess<M>;
1115
1123
  }>;
1116
1124
  }>;
1117
1125
 
1126
+ declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
1127
+ declare type CreateThreadOptimisticUpdate<M extends BaseMetadata> = {
1128
+ type: "create-thread";
1129
+ id: string;
1130
+ roomId: string;
1131
+ thread: ThreadData<M>;
1132
+ };
1133
+ declare type DeleteThreadOptimisticUpdate = {
1134
+ type: "delete-thread";
1135
+ id: string;
1136
+ roomId: string;
1137
+ threadId: string;
1138
+ deletedAt: Date;
1139
+ };
1140
+ declare type EditThreadMetadataOptimisticUpdate<M extends BaseMetadata> = {
1141
+ type: "edit-thread-metadata";
1142
+ id: string;
1143
+ threadId: string;
1144
+ metadata: Resolve<Patchable<M>>;
1145
+ updatedAt: Date;
1146
+ };
1147
+ declare type MarkThreadAsResolvedOptimisticUpdate = {
1148
+ type: "mark-thread-as-resolved";
1149
+ id: string;
1150
+ threadId: string;
1151
+ updatedAt: Date;
1152
+ };
1153
+ declare type MarkThreadAsUnresolvedOptimisticUpdate = {
1154
+ type: "mark-thread-as-unresolved";
1155
+ id: string;
1156
+ threadId: string;
1157
+ updatedAt: Date;
1158
+ };
1159
+ declare type CreateCommentOptimisticUpdate = {
1160
+ type: "create-comment";
1161
+ id: string;
1162
+ comment: CommentData;
1163
+ };
1164
+ declare type EditCommentOptimisticUpdate = {
1165
+ type: "edit-comment";
1166
+ id: string;
1167
+ comment: CommentData;
1168
+ };
1169
+ declare type DeleteCommentOptimisticUpdate = {
1170
+ type: "delete-comment";
1171
+ id: string;
1172
+ roomId: string;
1173
+ threadId: string;
1174
+ deletedAt: Date;
1175
+ commentId: string;
1176
+ };
1177
+ declare type AddReactionOptimisticUpdate = {
1178
+ type: "add-reaction";
1179
+ id: string;
1180
+ threadId: string;
1181
+ commentId: string;
1182
+ reaction: CommentUserReaction;
1183
+ };
1184
+ declare type RemoveReactionOptimisticUpdate = {
1185
+ type: "remove-reaction";
1186
+ id: string;
1187
+ threadId: string;
1188
+ commentId: string;
1189
+ emoji: string;
1190
+ userId: string;
1191
+ removedAt: Date;
1192
+ };
1193
+ declare type MarkInboxNotificationAsReadOptimisticUpdate = {
1194
+ type: "mark-inbox-notification-as-read";
1195
+ id: string;
1196
+ inboxNotificationId: string;
1197
+ readAt: Date;
1198
+ };
1199
+ declare type MarkAllInboxNotificationsAsReadOptimisticUpdate = {
1200
+ type: "mark-all-inbox-notifications-as-read";
1201
+ id: string;
1202
+ readAt: Date;
1203
+ };
1204
+ declare type DeleteInboxNotificationOptimisticUpdate = {
1205
+ type: "delete-inbox-notification";
1206
+ id: string;
1207
+ inboxNotificationId: string;
1208
+ deletedAt: Date;
1209
+ };
1210
+ declare type DeleteAllInboxNotificationsOptimisticUpdate = {
1211
+ type: "delete-all-inbox-notifications";
1212
+ id: string;
1213
+ deletedAt: Date;
1214
+ };
1215
+ declare type UpdateNotificationSettingsOptimisticUpdate = {
1216
+ type: "update-notification-settings";
1217
+ id: string;
1218
+ roomId: string;
1219
+ settings: Partial<RoomNotificationSettings$1>;
1220
+ };
1221
+ declare type QueryState = AsyncResult<undefined>;
1222
+ declare type UmbrellaStoreState<M extends BaseMetadata> = Readonly<{
1223
+ /**
1224
+ * Keep track of loading and error status of all the queries made by the client.
1225
+ * e.g. 'room-abc-{"color":"red"}' - ok
1226
+ * e.g. 'room-abc-{}' - loading
1227
+ */
1228
+ queries: Record<string, QueryState>;
1229
+ /**
1230
+ * Optimistic updates that have not been acknowledged by the server yet.
1231
+ * They are applied on top of the threads in selectors.
1232
+ */
1233
+ optimisticUpdates: readonly OptimisticUpdate<M>[];
1234
+ /**
1235
+ * Threads by ID
1236
+ * e.g. `th_${string}`
1237
+ */
1238
+ threads: Record<string, ThreadDataWithDeleteInfo<M>>;
1239
+ /**
1240
+ * Inbox notifications by ID.
1241
+ * e.g. `in_${string}`
1242
+ */
1243
+ inboxNotifications: Record<string, InboxNotificationData>;
1244
+ /**
1245
+ * Notification settings by room ID.
1246
+ * e.g. { 'room-abc': { threads: "all" },
1247
+ * 'room-def': { threads: "replies_and_mentions" },
1248
+ * 'room-xyz': { threads: "none" },
1249
+ * }
1250
+ */
1251
+ notificationSettings: Record<string, RoomNotificationSettings$1>;
1252
+ /**
1253
+ * Versions per roomId
1254
+ * e.g. { 'room-abc': {versions: "all versions"}}
1255
+ */
1256
+ versions: Record<string, HistoryVersion[]>;
1257
+ }>;
1258
+ declare class UmbrellaStore<M extends BaseMetadata> {
1259
+ private _store;
1260
+ constructor();
1261
+ get(): Readonly<UmbrellaStoreState<M>>;
1262
+ subscribe(callback: (state: Readonly<UmbrellaStoreState<M>>) => void): () => void;
1263
+ private updateThreadsCache;
1264
+ private updateInboxNotificationsCache;
1265
+ private setNotificationSettings;
1266
+ private setVersions;
1267
+ private setQueryState;
1268
+ private updateOptimisticUpdatesCache;
1269
+ /**
1270
+ * Updates an existing inbox notification with a new value, replacing the
1271
+ * corresponding optimistic update.
1272
+ *
1273
+ * This will not update anything if the inbox notification ID isn't found in
1274
+ * the cache.
1275
+ */
1276
+ updateInboxNotification(inboxNotificationId: string, optimisticUpdateId: string, callback: (notification: Readonly<InboxNotificationData>) => Readonly<InboxNotificationData>): void;
1277
+ /**
1278
+ * Updates *all* inbox notifications by running a mapper function over all of
1279
+ * them, replacing the corresponding optimistic update.
1280
+ */
1281
+ updateAllInboxNotifications(optimisticUpdateId: string, mapFn: (notification: Readonly<InboxNotificationData>) => Readonly<InboxNotificationData>): void;
1282
+ /**
1283
+ * Deletes an existing inbox notification, replacing the corresponding
1284
+ * optimistic update.
1285
+ */
1286
+ deleteInboxNotification(inboxNotificationId: string, optimisticUpdateId: string): void;
1287
+ /**
1288
+ * Deletes *all* inbox notifications, replacing the corresponding optimistic
1289
+ * update.
1290
+ */
1291
+ deleteAllInboxNotifications(optimisticUpdateId: string): void;
1292
+ /**
1293
+ * Creates an new thread, replacing the corresponding optimistic update.
1294
+ */
1295
+ createThread(optimisticUpdateId: string, thread: Readonly<ThreadDataWithDeleteInfo<M>>): void;
1296
+ /**
1297
+ * Updates an existing thread with a new value, replacing the corresponding
1298
+ * optimistic update.
1299
+ *
1300
+ * This will not update anything if:
1301
+ * - The thread ID isn't found in the cache; or
1302
+ * - The thread ID was already deleted from the cache; or
1303
+ * - The thread ID in the cache was updated more recently than the optimistic
1304
+ * update's timestamp (if given)
1305
+ */
1306
+ updateThread(threadId: string, optimisticUpdateId: string | null, callback: (thread: Readonly<ThreadDataWithDeleteInfo<M>>) => Readonly<ThreadDataWithDeleteInfo<M>>, updatedAt?: Date): void;
1307
+ /**
1308
+ * Soft-deletes an existing thread by setting its `deletedAt` value,
1309
+ * replacing the corresponding optimistic update.
1310
+ *
1311
+ * This will not update anything if:
1312
+ * - The thread ID isn't found in the cache; or
1313
+ * - The thread ID was already deleted from the cache
1314
+ */
1315
+ deleteThread(threadId: string, optimisticUpdateId: string | null): void;
1316
+ /**
1317
+ * Creates an existing comment and ensures the associated notification is
1318
+ * updated correctly, replacing the corresponding optimistic update.
1319
+ */
1320
+ createComment(newComment: CommentData, optimisticUpdateId: string): void;
1321
+ updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
1322
+ updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
1323
+ /**
1324
+ * Updates existing notification setting for a room with a new value,
1325
+ * replacing the corresponding optimistic update.
1326
+ */
1327
+ updateRoomInboxNotificationSettings2(roomId: string, optimisticUpdateId: string, settings: Readonly<RoomNotificationSettings$1>): void;
1328
+ updateRoomInboxNotificationSettings(roomId: string, settings: RoomNotificationSettings$1, queryKey: string): void;
1329
+ updateRoomVersions(roomId: string, versions: HistoryVersion[], queryKey?: string): void;
1330
+ addOptimisticUpdate(optimisticUpdate: DistributiveOmit<OptimisticUpdate<M>, "id">): string;
1331
+ removeOptimisticUpdate(optimisticUpdateId: string): void;
1332
+ setQueryLoading(queryKey: string): void;
1333
+ private setQueryOK;
1334
+ setQueryError(queryKey: string, error: Error): void;
1335
+ }
1336
+
1118
1337
  /**
1119
1338
  * Raw access to the React context where the LiveblocksProvider stores the
1120
1339
  * current client. Exposed for advanced use cases only.
@@ -1122,6 +1341,12 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
1122
1341
  * @private This is a private/advanced API. Do not rely on it.
1123
1342
  */
1124
1343
  declare const ClientContext: React__default.Context<OpaqueClient | null>;
1344
+ /**
1345
+ * Gets or creates a unique Umbrella store for each unique client instance.
1346
+ *
1347
+ * @private
1348
+ */
1349
+ declare function getUmbrellaStoreForClient<M extends BaseMetadata$1>(client: OpaqueClient): UmbrellaStore<M>;
1125
1350
  /**
1126
1351
  * Obtains a reference to the current Liveblocks client.
1127
1352
  */
@@ -1250,17 +1475,39 @@ declare const _useUserSuspense: TypedBundle$1["suspense"]["useUser"];
1250
1475
  * @experimental
1251
1476
  *
1252
1477
  * This hook is experimental and could be removed or changed at any time!
1253
- * Do not use unless explicitely recommended by the Liveblocks team.
1478
+ * Do not use unless explicitly recommended by the Liveblocks team.
1479
+ *
1480
+ * WARNING:
1481
+ * Please note that this hook currently returns all threads by most recently
1482
+ * updated threads first. This is inconsistent with the default sort order of
1483
+ * the useThreads() hook, which returns them in chronological order (by
1484
+ * creation date). In the final version, we will make these hooks behave
1485
+ * consistently, so expect that in the final version, you'll have to explicitly
1486
+ * specify the sort order to be by most recently updated first somehow.
1487
+ * The final API for that is still TBD.
1254
1488
  */
1255
1489
  declare const _useUserThreads_experimental: TypedBundle$1["useUserThreads_experimental"];
1256
1490
  /**
1257
1491
  * @experimental
1258
1492
  *
1259
1493
  * This hook is experimental and could be removed or changed at any time!
1260
- * Do not use unless explicitely recommended by the Liveblocks team.
1494
+ * Do not use unless explicitly recommended by the Liveblocks team.
1495
+ *
1496
+ * WARNING:
1497
+ * Please note that this hook currently returns all threads by most recently
1498
+ * updated threads first. This is inconsistent with the default sort order of
1499
+ * the useThreads() hook, which returns them in chronological order (by
1500
+ * creation date). In the final version, we will make these hooks behave
1501
+ * consistently, so expect that in the final version, you'll have to explicitly
1502
+ * specify the sort order to be by most recently updated first somehow.
1503
+ * The final API for that is still TBD.
1261
1504
  */
1262
1505
  declare const _useUserThreadsSuspense_experimental: TypedBundle$1["suspense"]["useUserThreads_experimental"];
1263
1506
 
1507
+ /**
1508
+ * @private Do not rely on this internal API.
1509
+ */
1510
+ declare function selectRoomThreads<M extends BaseMetadata$1>(roomId: string, state: UmbrellaStoreState<M>, options: UseThreadsOptions<M>): ThreadData$1<M>[];
1264
1511
  /**
1265
1512
  * Raw access to the React context where the RoomProvider stores the current
1266
1513
  * room. Exposed for advanced use cases only.
@@ -1278,7 +1525,7 @@ declare function useStatus(): Status;
1278
1525
  * a re-render whenever it changes. Can be used to render a "Saving..."
1279
1526
  * indicator.
1280
1527
  */
1281
- declare function useStorageStatus(options?: UseStorageStatusOptions): StorageStatus;
1528
+ declare function useStorageStatus(options?: UseStorageStatusOptions): StorageStatus$1;
1282
1529
  /**
1283
1530
  * @deprecated It's recommended to use `useMutation` for writing to Storage,
1284
1531
  * which will automatically batch all mutations.
@@ -1368,7 +1615,7 @@ declare function useCommentsErrorListener<M extends BaseMetadata$1>(callback: (e
1368
1615
  * const createComment = useCreateComment();
1369
1616
  * createComment({ threadId: "th_xxx", body: {} });
1370
1617
  */
1371
- declare function useCreateComment(): (options: CreateCommentOptions) => CommentData;
1618
+ declare function useCreateComment(): (options: CreateCommentOptions) => CommentData$1;
1372
1619
  /**
1373
1620
  * Returns a function that edits a comment's body.
1374
1621
  *
@@ -1434,8 +1681,14 @@ declare function useThreadSubscription(threadId: string): ThreadSubscription;
1434
1681
  */
1435
1682
  declare function useRoomNotificationSettings(): [
1436
1683
  RoomNotificationSettingsState,
1437
- (settings: Partial<RoomNotificationSettings$1>) => void
1684
+ (settings: Partial<RoomNotificationSettings>) => void
1438
1685
  ];
1686
+ /**
1687
+ * Returns the version data bianry for a given version
1688
+ *
1689
+ * @example
1690
+ * const {data} = useHistoryVersionData(versionId);
1691
+ */
1439
1692
  declare function useHistoryVersionData(versionId: string): HistoryVersionDataState;
1440
1693
  /**
1441
1694
  * Returns a function that updates the user's notification settings
@@ -1445,7 +1698,7 @@ declare function useHistoryVersionData(versionId: string): HistoryVersionDataSta
1445
1698
  * const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
1446
1699
  * updateRoomNotificationSettings({ threads: "all" });
1447
1700
  */
1448
- declare function useUpdateRoomNotificationSettings(): (settings: Partial<RoomNotificationSettings$1>) => void;
1701
+ declare function useUpdateRoomNotificationSettings(): (settings: Partial<RoomNotificationSettings>) => void;
1449
1702
  /**
1450
1703
  * Returns an array of connection IDs. This matches the values you'll get by
1451
1704
  * using the `useOthers()` hook.
@@ -1687,14 +1940,14 @@ declare const _useThreads: TypedBundle["useThreads"];
1687
1940
  */
1688
1941
  declare const _useThreadsSuspense: TypedBundle["suspense"]["useThreads"];
1689
1942
  /**
1690
- * Returns a history of versions of the current room.
1943
+ * (Private beta) Returns a history of versions of the current room.
1691
1944
  *
1692
1945
  * @example
1693
1946
  * const { versions, error, isLoading } = useHistoryVersions();
1694
1947
  */
1695
1948
  declare const _useHistoryVersions: TypedBundle["useHistoryVersions"];
1696
1949
  /**
1697
- * Returns a history of versions of the current room.
1950
+ * (Private beta) Returns a history of versions of the current room.
1698
1951
  *
1699
1952
  * @example
1700
1953
  * const { versions } = useHistoryVersions();
@@ -1927,4 +2180,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
1927
2180
  */
1928
2181
  declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
1929
2182
 
1930
- export { useOthersConnectionIds as $, _useIsInsideRoom as A, useLostConnectionListener as B, ClientSideSuspense as C, useMarkThreadAsRead as D, _useMutation as E, _useMyPresence as F, _useOthersListener as G, useRedo as H, useRemoveReaction as I, _useRoom as J, useRoomNotificationSettings as K, LiveblocksProvider as L, type MutationContext as M, useStatus as N, _useStorageRoot as O, useThreadSubscription as P, useUndo as Q, RoomContext as R, _useUpdateMyPresence as S, useUpdateRoomNotificationSettings as T, type UseThreadsOptions as U, useHistoryVersionData as V, useCommentsErrorListener as W, CreateThreadError as X, _useOther as Y, _useOthers as Z, _useInboxNotificationThread as _, type UseStorageStatusOptions as a, _useOthersMapped as a0, _useSelf as a1, _useStorage as a2, useStorageStatus as a3, _useThreads as a4, _useHistoryVersions as a5, useInboxNotifications as a6, _useUserThreads_experimental as a7, useRoomInfo as a8, useUnreadInboxNotificationsCount as a9, _useUser as aa, _useOtherSuspense as ab, _useOthersSuspense as ac, useOthersConnectionIdsSuspense as ad, _useOthersMappedSuspense as ae, _useSelfSuspense as af, _useStorageSuspense as ag, useStorageStatusSuspense as ah, _useThreadsSuspense as ai, _useHistoryVersionsSuspense as aj, useInboxNotificationsSuspense as ak, useRoomInfoSuspense as al, useUnreadInboxNotificationsCountSuspense as am, _useUserSuspense as an, _useUserThreadsSuspense_experimental as ao, ClientContext as b, createLiveblocksContext as c, useMarkAllInboxNotificationsAsRead as d, useMarkInboxNotificationAsRead as e, useDeleteAllInboxNotifications as f, useDeleteInboxNotification as g, createRoomContext as h, _RoomProvider as i, _useAddReaction as j, useBatch as k, _useBroadcastEvent as l, useCanRedo as m, useCanUndo as n, useCreateComment as o, _useCreateThread as p, useDeleteComment as q, _useDeleteThread as r, useEditComment as s, _useEditThreadMetadata as t, useClient as u, useMarkThreadAsResolved as v, useMarkThreadAsUnresolved as w, useErrorListener as x, _useEventListener as y, useHistory as z };
2183
+ export { useOthersConnectionIds as $, _useIsInsideRoom as A, useLostConnectionListener as B, ClientSideSuspense as C, useMarkThreadAsRead as D, _useMutation as E, _useMyPresence as F, _useOthersListener as G, useRedo as H, useRemoveReaction as I, _useRoom as J, useRoomNotificationSettings as K, LiveblocksProvider as L, type MutationContext as M, useStatus as N, _useStorageRoot as O, useThreadSubscription as P, useUndo as Q, RoomContext as R, _useUpdateMyPresence as S, useUpdateRoomNotificationSettings as T, type UseStorageStatusOptions as U, useHistoryVersionData as V, useCommentsErrorListener as W, CreateThreadError as X, _useOther as Y, _useOthers as Z, _useInboxNotificationThread as _, type UseThreadsOptions as a, _useOthersMapped as a0, _useSelf as a1, _useStorage as a2, useStorageStatus as a3, _useThreads as a4, _useHistoryVersions as a5, useInboxNotifications as a6, _useUserThreads_experimental as a7, useRoomInfo as a8, useUnreadInboxNotificationsCount as a9, _useUser as aa, getUmbrellaStoreForClient as ab, selectRoomThreads as ac, _useOtherSuspense as ad, _useOthersSuspense as ae, useOthersConnectionIdsSuspense as af, _useOthersMappedSuspense as ag, _useSelfSuspense as ah, _useStorageSuspense as ai, useStorageStatusSuspense as aj, _useThreadsSuspense as ak, _useHistoryVersionsSuspense as al, useInboxNotificationsSuspense as am, useRoomInfoSuspense as an, useUnreadInboxNotificationsCountSuspense as ao, _useUserSuspense as ap, _useUserThreadsSuspense_experimental as aq, ClientContext as b, createLiveblocksContext as c, useMarkAllInboxNotificationsAsRead as d, useMarkInboxNotificationAsRead as e, useDeleteAllInboxNotifications as f, useDeleteInboxNotification as g, createRoomContext as h, _RoomProvider as i, _useAddReaction as j, useBatch as k, _useBroadcastEvent as l, useCanRedo as m, useCanUndo as n, useCreateComment as o, _useCreateThread as p, useDeleteComment as q, _useDeleteThread as r, useEditComment as s, _useEditThreadMetadata as t, useClient as u, useMarkThreadAsResolved as v, useMarkThreadAsUnresolved as w, useErrorListener as x, _useEventListener as y, useHistory as z };
@@ -1,4 +1,4 @@
1
- export { b as ClientContext, C as ClientSideSuspense, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, a as UseStorageStatusOptions, U as UseThreadsOptions, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, aj as useHistoryVersions, _ as useInboxNotificationThread, ak as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, ab as useOther, ac as useOthers, ad as useOthersConnectionIds, G as useOthersListener, ae as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, al as useRoomInfo, K as useRoomNotificationSettings, af as useSelf, N as useStatus, ag as useStorage, O as useStorageRoot, ah as useStorageStatus, P as useThreadSubscription, ai as useThreads, Q as useUndo, am as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, an as useUser, ao as useUserThreads_experimental } from './suspense-2UL0jBvg.mjs';
1
+ export { b as ClientContext, C as ClientSideSuspense, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, al as useHistoryVersions, _ as useInboxNotificationThread, am as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, ad as useOther, ae as useOthers, af as useOthersConnectionIds, G as useOthersListener, ag as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, an as useRoomInfo, K as useRoomNotificationSettings, ah as useSelf, N as useStatus, ai as useStorage, O as useStorageRoot, aj as useStorageStatus, P as useThreadSubscription, ak as useThreads, Q as useUndo, ao as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ap as useUser, aq as useUserThreads_experimental } from './suspense-pL0llH_6.mjs';
2
2
  export { Json, JsonObject, shallow } from '@liveblocks/client';
3
3
  import 'react';
4
4
  import '@liveblocks/core';
@@ -1,4 +1,4 @@
1
- export { b as ClientContext, C as ClientSideSuspense, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, a as UseStorageStatusOptions, U as UseThreadsOptions, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, aj as useHistoryVersions, _ as useInboxNotificationThread, ak as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, ab as useOther, ac as useOthers, ad as useOthersConnectionIds, G as useOthersListener, ae as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, al as useRoomInfo, K as useRoomNotificationSettings, af as useSelf, N as useStatus, ag as useStorage, O as useStorageRoot, ah as useStorageStatus, P as useThreadSubscription, ai as useThreads, Q as useUndo, am as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, an as useUser, ao as useUserThreads_experimental } from './suspense-2UL0jBvg.js';
1
+ export { b as ClientContext, C as ClientSideSuspense, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, al as useHistoryVersions, _ as useInboxNotificationThread, am as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, ad as useOther, ae as useOthers, af as useOthersConnectionIds, G as useOthersListener, ag as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, an as useRoomInfo, K as useRoomNotificationSettings, ah as useSelf, N as useStatus, ai as useStorage, O as useStorageRoot, aj as useStorageStatus, P as useThreadSubscription, ak as useThreads, Q as useUndo, ao as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ap as useUser, aq as useUserThreads_experimental } from './suspense-pL0llH_6.js';
2
2
  export { Json, JsonObject, shallow } from '@liveblocks/client';
3
3
  import 'react';
4
4
  import '@liveblocks/core';
package/dist/suspense.js CHANGED
@@ -59,12 +59,12 @@
59
59
 
60
60
 
61
61
 
62
- var _chunkYGRZXVI6js = require('./chunk-YGRZXVI6.js');
62
+ var _chunkKNPU4P3Yjs = require('./chunk-KNPU4P3Y.js');
63
63
 
64
64
  // src/suspense.ts
65
65
  var _core = require('@liveblocks/core');
66
66
  var _client = require('@liveblocks/client');
67
- _core.detectDupes.call(void 0, _chunkYGRZXVI6js.PKG_NAME, _chunkYGRZXVI6js.PKG_VERSION, _chunkYGRZXVI6js.PKG_FORMAT);
67
+ _core.detectDupes.call(void 0, _chunkKNPU4P3Yjs.PKG_NAME, _chunkKNPU4P3Yjs.PKG_VERSION, _chunkKNPU4P3Yjs.PKG_FORMAT);
68
68
 
69
69
 
70
70
 
@@ -124,5 +124,5 @@ _core.detectDupes.call(void 0, _chunkYGRZXVI6js.PKG_NAME, _chunkYGRZXVI6js.PKG_V
124
124
 
125
125
 
126
126
 
127
- exports.ClientContext = _chunkYGRZXVI6js.ClientContext; exports.ClientSideSuspense = _chunkYGRZXVI6js.ClientSideSuspense; exports.LiveblocksProvider = _chunkYGRZXVI6js.LiveblocksProvider; exports.RoomContext = _chunkYGRZXVI6js.RoomContext; exports.RoomProvider = _chunkYGRZXVI6js._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkYGRZXVI6js._useAddReaction; exports.useBatch = _chunkYGRZXVI6js.useBatch; exports.useBroadcastEvent = _chunkYGRZXVI6js._useBroadcastEvent; exports.useCanRedo = _chunkYGRZXVI6js.useCanRedo; exports.useCanUndo = _chunkYGRZXVI6js.useCanUndo; exports.useClient = _chunkYGRZXVI6js.useClient; exports.useCreateComment = _chunkYGRZXVI6js.useCreateComment; exports.useCreateThread = _chunkYGRZXVI6js._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkYGRZXVI6js.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkYGRZXVI6js.useDeleteComment; exports.useDeleteInboxNotification = _chunkYGRZXVI6js.useDeleteInboxNotification; exports.useDeleteThread = _chunkYGRZXVI6js._useDeleteThread; exports.useEditComment = _chunkYGRZXVI6js.useEditComment; exports.useEditThreadMetadata = _chunkYGRZXVI6js._useEditThreadMetadata; exports.useErrorListener = _chunkYGRZXVI6js.useErrorListener; exports.useEventListener = _chunkYGRZXVI6js._useEventListener; exports.useHistory = _chunkYGRZXVI6js.useHistory; exports.useHistoryVersions = _chunkYGRZXVI6js._useHistoryVersionsSuspense; exports.useInboxNotificationThread = _chunkYGRZXVI6js._useInboxNotificationThread; exports.useInboxNotifications = _chunkYGRZXVI6js.useInboxNotificationsSuspense; exports.useIsInsideRoom = _chunkYGRZXVI6js._useIsInsideRoom; exports.useLostConnectionListener = _chunkYGRZXVI6js.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkYGRZXVI6js.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkYGRZXVI6js.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkYGRZXVI6js.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkYGRZXVI6js.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkYGRZXVI6js.useMarkThreadAsUnresolved; exports.useMutation = _chunkYGRZXVI6js._useMutation; exports.useMyPresence = _chunkYGRZXVI6js._useMyPresence; exports.useOther = _chunkYGRZXVI6js._useOtherSuspense; exports.useOthers = _chunkYGRZXVI6js._useOthersSuspense; exports.useOthersConnectionIds = _chunkYGRZXVI6js.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkYGRZXVI6js._useOthersListener; exports.useOthersMapped = _chunkYGRZXVI6js._useOthersMappedSuspense; exports.useRedo = _chunkYGRZXVI6js.useRedo; exports.useRemoveReaction = _chunkYGRZXVI6js.useRemoveReaction; exports.useRoom = _chunkYGRZXVI6js._useRoom; exports.useRoomInfo = _chunkYGRZXVI6js.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkYGRZXVI6js.useRoomNotificationSettings; exports.useSelf = _chunkYGRZXVI6js._useSelfSuspense; exports.useStatus = _chunkYGRZXVI6js.useStatus; exports.useStorage = _chunkYGRZXVI6js._useStorageSuspense; exports.useStorageRoot = _chunkYGRZXVI6js._useStorageRoot; exports.useStorageStatus = _chunkYGRZXVI6js.useStorageStatusSuspense; exports.useThreadSubscription = _chunkYGRZXVI6js.useThreadSubscription; exports.useThreads = _chunkYGRZXVI6js._useThreadsSuspense; exports.useUndo = _chunkYGRZXVI6js.useUndo; exports.useUnreadInboxNotificationsCount = _chunkYGRZXVI6js.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkYGRZXVI6js._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkYGRZXVI6js.useUpdateRoomNotificationSettings; exports.useUser = _chunkYGRZXVI6js._useUserSuspense; exports.useUserThreads_experimental = _chunkYGRZXVI6js._useUserThreadsSuspense_experimental;
127
+ exports.ClientContext = _chunkKNPU4P3Yjs.ClientContext; exports.ClientSideSuspense = _chunkKNPU4P3Yjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkKNPU4P3Yjs.LiveblocksProvider; exports.RoomContext = _chunkKNPU4P3Yjs.RoomContext; exports.RoomProvider = _chunkKNPU4P3Yjs._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkKNPU4P3Yjs._useAddReaction; exports.useBatch = _chunkKNPU4P3Yjs.useBatch; exports.useBroadcastEvent = _chunkKNPU4P3Yjs._useBroadcastEvent; exports.useCanRedo = _chunkKNPU4P3Yjs.useCanRedo; exports.useCanUndo = _chunkKNPU4P3Yjs.useCanUndo; exports.useClient = _chunkKNPU4P3Yjs.useClient; exports.useCreateComment = _chunkKNPU4P3Yjs.useCreateComment; exports.useCreateThread = _chunkKNPU4P3Yjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkKNPU4P3Yjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkKNPU4P3Yjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkKNPU4P3Yjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkKNPU4P3Yjs._useDeleteThread; exports.useEditComment = _chunkKNPU4P3Yjs.useEditComment; exports.useEditThreadMetadata = _chunkKNPU4P3Yjs._useEditThreadMetadata; exports.useErrorListener = _chunkKNPU4P3Yjs.useErrorListener; exports.useEventListener = _chunkKNPU4P3Yjs._useEventListener; exports.useHistory = _chunkKNPU4P3Yjs.useHistory; exports.useHistoryVersions = _chunkKNPU4P3Yjs._useHistoryVersionsSuspense; exports.useInboxNotificationThread = _chunkKNPU4P3Yjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkKNPU4P3Yjs.useInboxNotificationsSuspense; exports.useIsInsideRoom = _chunkKNPU4P3Yjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkKNPU4P3Yjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkKNPU4P3Yjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkKNPU4P3Yjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkKNPU4P3Yjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkKNPU4P3Yjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkKNPU4P3Yjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkKNPU4P3Yjs._useMutation; exports.useMyPresence = _chunkKNPU4P3Yjs._useMyPresence; exports.useOther = _chunkKNPU4P3Yjs._useOtherSuspense; exports.useOthers = _chunkKNPU4P3Yjs._useOthersSuspense; exports.useOthersConnectionIds = _chunkKNPU4P3Yjs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkKNPU4P3Yjs._useOthersListener; exports.useOthersMapped = _chunkKNPU4P3Yjs._useOthersMappedSuspense; exports.useRedo = _chunkKNPU4P3Yjs.useRedo; exports.useRemoveReaction = _chunkKNPU4P3Yjs.useRemoveReaction; exports.useRoom = _chunkKNPU4P3Yjs._useRoom; exports.useRoomInfo = _chunkKNPU4P3Yjs.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkKNPU4P3Yjs.useRoomNotificationSettings; exports.useSelf = _chunkKNPU4P3Yjs._useSelfSuspense; exports.useStatus = _chunkKNPU4P3Yjs.useStatus; exports.useStorage = _chunkKNPU4P3Yjs._useStorageSuspense; exports.useStorageRoot = _chunkKNPU4P3Yjs._useStorageRoot; exports.useStorageStatus = _chunkKNPU4P3Yjs.useStorageStatusSuspense; exports.useThreadSubscription = _chunkKNPU4P3Yjs.useThreadSubscription; exports.useThreads = _chunkKNPU4P3Yjs._useThreadsSuspense; exports.useUndo = _chunkKNPU4P3Yjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkKNPU4P3Yjs.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkKNPU4P3Yjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkKNPU4P3Yjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkKNPU4P3Yjs._useUserSuspense; exports.useUserThreads_experimental = _chunkKNPU4P3Yjs._useUserThreadsSuspense_experimental;
128
128
  //# sourceMappingURL=suspense.js.map
package/dist/suspense.mjs CHANGED
@@ -59,7 +59,7 @@ import {
59
59
  useUndo,
60
60
  useUnreadInboxNotificationsCountSuspense,
61
61
  useUpdateRoomNotificationSettings
62
- } from "./chunk-HS6BFH3A.mjs";
62
+ } from "./chunk-OKR7ROQ5.mjs";
63
63
 
64
64
  // src/suspense.ts
65
65
  import { detectDupes } from "@liveblocks/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react",
3
- "version": "2.7.0-versions2",
3
+ "version": "2.7.0",
4
4
  "description": "A set of React hooks and providers to use Liveblocks declaratively. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -47,8 +47,8 @@
47
47
  "test:watch": "jest --silent --verbose --color=always --watch"
48
48
  },
49
49
  "dependencies": {
50
- "@liveblocks/client": "2.7.0-versions2",
51
- "@liveblocks/core": "2.7.0-versions2",
50
+ "@liveblocks/client": "2.7.0",
51
+ "@liveblocks/core": "2.7.0",
52
52
  "use-sync-external-store": "^1.2.2"
53
53
  },
54
54
  "peerDependencies": {