@liveblocks/react 2.7.0 → 2.8.0-beta1
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/{chunk-KNPU4P3Y.js → chunk-BYZWUB6M.js} +568 -366
- package/dist/chunk-BYZWUB6M.js.map +1 -0
- package/dist/{chunk-OKR7ROQ5.mjs → chunk-WVLHQ6LC.mjs} +621 -419
- package/dist/chunk-WVLHQ6LC.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{suspense-pL0llH_6.d.mts → suspense-j9RIyQIe.d.mts} +103 -23
- package/dist/{suspense-pL0llH_6.d.ts → suspense-j9RIyQIe.d.ts} +103 -23
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +5 -3
- package/dist/suspense.js.map +1 -1
- package/dist/suspense.mjs +3 -1
- package/dist/suspense.mjs.map +1 -1
- package/package.json +6 -4
- package/dist/chunk-KNPU4P3Y.js.map +0 -1
- package/dist/chunk-OKR7ROQ5.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1,
|
|
1
|
+
import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ThreadData as ThreadData$1, Client as Client$1, ClientOptions, StorageStatus as StorageStatus$1, CommentData as CommentData$1 } from '@liveblocks/client';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode, PropsWithChildren } from 'react';
|
|
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,
|
|
4
|
+
import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResultWithDataField, DRI, Resolve, CommentAttachment, InboxNotificationData, ToImmutable, ThreadData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, CommentUserReaction, ThreadDeleteInfo, InboxNotificationDeleteInfo, DistributiveOmit, AsyncResult, OpaqueClient, DU, DM, OpaqueRoom, DP, DS, DE } from '@liveblocks/core';
|
|
5
5
|
|
|
6
6
|
declare type Props = {
|
|
7
7
|
fallback: ReactNode;
|
|
@@ -166,7 +166,6 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
|
|
|
166
166
|
*/
|
|
167
167
|
scrollOnLoad?: boolean;
|
|
168
168
|
};
|
|
169
|
-
|
|
170
169
|
declare type UserAsyncResult<T> = AsyncResultWithDataField<T, "user">;
|
|
171
170
|
declare type UserAsyncSuccess<T> = Resolve<UserAsyncResult<T> & {
|
|
172
171
|
readonly isLoading: false;
|
|
@@ -177,8 +176,14 @@ declare type RoomInfoAsyncSuccess = Resolve<RoomInfoAsyncResult & {
|
|
|
177
176
|
readonly isLoading: false;
|
|
178
177
|
readonly error?: undefined;
|
|
179
178
|
}>;
|
|
179
|
+
declare type AttachmentUrlAsyncResult = AsyncResultWithDataField<string, "url">;
|
|
180
|
+
declare type AttachmentUrlAsyncSuccess = Resolve<AttachmentUrlAsyncResult & {
|
|
181
|
+
readonly isLoading: false;
|
|
182
|
+
readonly error?: undefined;
|
|
183
|
+
}>;
|
|
180
184
|
declare type CreateThreadOptions<M extends BaseMetadata> = Resolve<{
|
|
181
185
|
body: CommentBody;
|
|
186
|
+
attachments?: CommentAttachment[];
|
|
182
187
|
} & PartialUnless<M, {
|
|
183
188
|
metadata: M;
|
|
184
189
|
}>>;
|
|
@@ -189,11 +194,13 @@ declare type EditThreadMetadataOptions<M extends BaseMetadata> = {
|
|
|
189
194
|
declare type CreateCommentOptions = {
|
|
190
195
|
threadId: string;
|
|
191
196
|
body: CommentBody;
|
|
197
|
+
attachments?: CommentAttachment[];
|
|
192
198
|
};
|
|
193
199
|
declare type EditCommentOptions = {
|
|
194
200
|
threadId: string;
|
|
195
201
|
commentId: string;
|
|
196
202
|
body: CommentBody;
|
|
203
|
+
attachments?: CommentAttachment[];
|
|
197
204
|
};
|
|
198
205
|
declare type DeleteCommentOptions = {
|
|
199
206
|
threadId: string;
|
|
@@ -922,6 +929,13 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
922
929
|
RoomNotificationSettingsState,
|
|
923
930
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
924
931
|
];
|
|
932
|
+
/**
|
|
933
|
+
* Returns a presigned URL for an attachment by its ID.
|
|
934
|
+
*
|
|
935
|
+
* @example
|
|
936
|
+
* const { url, error, isLoading } = useAttachmentUrl("at_xxx");
|
|
937
|
+
*/
|
|
938
|
+
useAttachmentUrl(attachmentId: string): AttachmentUrlAsyncResult;
|
|
925
939
|
/**
|
|
926
940
|
* (Private beta) Returns a history of versions of the current room.
|
|
927
941
|
*
|
|
@@ -1016,6 +1030,13 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
1016
1030
|
RoomNotificationSettingsStateSuccess,
|
|
1017
1031
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
1018
1032
|
];
|
|
1033
|
+
/**
|
|
1034
|
+
* Returns a presigned URL for an attachment by its ID.
|
|
1035
|
+
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* const { url } = useAttachmentUrl("at_xxx");
|
|
1038
|
+
*/
|
|
1039
|
+
useAttachmentUrl(attachmentId: string): AttachmentUrlAsyncSuccess;
|
|
1019
1040
|
}>;
|
|
1020
1041
|
} & PrivateRoomContextApi>;
|
|
1021
1042
|
/**
|
|
@@ -1219,7 +1240,12 @@ declare type UpdateNotificationSettingsOptimisticUpdate = {
|
|
|
1219
1240
|
settings: Partial<RoomNotificationSettings$1>;
|
|
1220
1241
|
};
|
|
1221
1242
|
declare type QueryState = AsyncResult<undefined>;
|
|
1222
|
-
|
|
1243
|
+
/**
|
|
1244
|
+
* Externally observable state of the store, which will have:
|
|
1245
|
+
* - Optimistic updates applied
|
|
1246
|
+
* - All deleted threads removed from the threads list
|
|
1247
|
+
*/
|
|
1248
|
+
declare type UmbrellaStoreState<M extends BaseMetadata> = {
|
|
1223
1249
|
/**
|
|
1224
1250
|
* Keep track of loading and error status of all the queries made by the client.
|
|
1225
1251
|
* e.g. 'room-abc-{"color":"red"}' - ok
|
|
@@ -1227,20 +1253,25 @@ declare type UmbrellaStoreState<M extends BaseMetadata> = Readonly<{
|
|
|
1227
1253
|
*/
|
|
1228
1254
|
queries: Record<string, QueryState>;
|
|
1229
1255
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1256
|
+
* All threads in a sorted array, optimistic updates applied, without deleted
|
|
1257
|
+
* threads.
|
|
1258
|
+
*/
|
|
1259
|
+
threads: ThreadData<M>[];
|
|
1260
|
+
/**
|
|
1261
|
+
* All threads in a map, keyed by thread ID, with all optimistic updates
|
|
1262
|
+
* applied. Deleted threads are still in this mapping, and will have
|
|
1263
|
+
* a deletedAt field if so.
|
|
1232
1264
|
*/
|
|
1233
|
-
|
|
1265
|
+
threadsById: Record<string, ThreadDataWithDeleteInfo<M>>;
|
|
1234
1266
|
/**
|
|
1235
|
-
*
|
|
1236
|
-
* e.g. `th_${string}`
|
|
1267
|
+
* All inbox notifications in a sorted array, optimistic updates applied.
|
|
1237
1268
|
*/
|
|
1238
|
-
|
|
1269
|
+
inboxNotifications: InboxNotificationData[];
|
|
1239
1270
|
/**
|
|
1240
1271
|
* Inbox notifications by ID.
|
|
1241
1272
|
* e.g. `in_${string}`
|
|
1242
1273
|
*/
|
|
1243
|
-
|
|
1274
|
+
inboxNotificationsById: Record<string, InboxNotificationData>;
|
|
1244
1275
|
/**
|
|
1245
1276
|
* Notification settings by room ID.
|
|
1246
1277
|
* e.g. { 'room-abc': { threads: "all" },
|
|
@@ -1248,18 +1279,36 @@ declare type UmbrellaStoreState<M extends BaseMetadata> = Readonly<{
|
|
|
1248
1279
|
* 'room-xyz': { threads: "none" },
|
|
1249
1280
|
* }
|
|
1250
1281
|
*/
|
|
1251
|
-
|
|
1282
|
+
notificationSettingsByRoomId: Record<string, RoomNotificationSettings$1>;
|
|
1252
1283
|
/**
|
|
1253
|
-
* Versions
|
|
1284
|
+
* Versions by roomId
|
|
1254
1285
|
* e.g. { 'room-abc': {versions: "all versions"}}
|
|
1255
1286
|
*/
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1287
|
+
versionsByRoomId: Record<string, HistoryVersion[]>;
|
|
1288
|
+
};
|
|
1258
1289
|
declare class UmbrellaStore<M extends BaseMetadata> {
|
|
1259
1290
|
private _store;
|
|
1291
|
+
private _prevState;
|
|
1292
|
+
private _stateCached;
|
|
1260
1293
|
constructor();
|
|
1261
|
-
get
|
|
1262
|
-
|
|
1294
|
+
private get;
|
|
1295
|
+
getThreads(): UmbrellaStoreState<M>;
|
|
1296
|
+
getInboxNotifications(): UmbrellaStoreState<M>;
|
|
1297
|
+
getNotificationSettings(): UmbrellaStoreState<M>;
|
|
1298
|
+
getVersions(): UmbrellaStoreState<M>;
|
|
1299
|
+
/**
|
|
1300
|
+
* @private Only used by the E2E test suite.
|
|
1301
|
+
*/
|
|
1302
|
+
_hasOptimisticUpdates(): boolean;
|
|
1303
|
+
private subscribe;
|
|
1304
|
+
/**
|
|
1305
|
+
* @private Only used by the E2E test suite.
|
|
1306
|
+
*/
|
|
1307
|
+
_subscribeOptimisticUpdates(callback: () => void): () => void;
|
|
1308
|
+
subscribeThreads(callback: () => void): () => void;
|
|
1309
|
+
subscribeInboxNotifications(callback: () => void): () => void;
|
|
1310
|
+
subscribeNotificationSettings(callback: () => void): () => void;
|
|
1311
|
+
subscribeVersions(callback: () => void): () => void;
|
|
1263
1312
|
private updateThreadsCache;
|
|
1264
1313
|
private updateInboxNotificationsCache;
|
|
1265
1314
|
private setNotificationSettings;
|
|
@@ -1303,7 +1352,13 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1303
1352
|
* - The thread ID in the cache was updated more recently than the optimistic
|
|
1304
1353
|
* update's timestamp (if given)
|
|
1305
1354
|
*/
|
|
1306
|
-
updateThread
|
|
1355
|
+
private updateThread;
|
|
1356
|
+
patchThread(threadId: string, optimisticUpdateId: string | null, patch: {
|
|
1357
|
+
metadata?: M;
|
|
1358
|
+
resolved?: boolean;
|
|
1359
|
+
}, updatedAt: Date): void;
|
|
1360
|
+
addReaction(threadId: string, optimisticUpdateId: string | null, commentId: string, reaction: CommentUserReaction, createdAt: Date): void;
|
|
1361
|
+
removeReaction(threadId: string, optimisticUpdateId: string | null, commentId: string, emoji: string, userId: string, removedAt: Date): void;
|
|
1307
1362
|
/**
|
|
1308
1363
|
* Soft-deletes an existing thread by setting its `deletedAt` value,
|
|
1309
1364
|
* replacing the corresponding optimistic update.
|
|
@@ -1318,6 +1373,8 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1318
1373
|
* updated correctly, replacing the corresponding optimistic update.
|
|
1319
1374
|
*/
|
|
1320
1375
|
createComment(newComment: CommentData, optimisticUpdateId: string): void;
|
|
1376
|
+
editComment(threadId: string, optimisticUpdateId: string, editedComment: CommentData): void;
|
|
1377
|
+
deleteComment(threadId: string, optimisticUpdateId: string, commentId: string, deletedAt: Date): void;
|
|
1321
1378
|
updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
|
|
1322
1379
|
updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
|
|
1323
1380
|
/**
|
|
@@ -1341,6 +1398,14 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1341
1398
|
* @private This is a private/advanced API. Do not rely on it.
|
|
1342
1399
|
*/
|
|
1343
1400
|
declare const ClientContext: React__default.Context<OpaqueClient | null>;
|
|
1401
|
+
/**
|
|
1402
|
+
* @private Do not rely on this internal API.
|
|
1403
|
+
*/
|
|
1404
|
+
declare function selectThreads<M extends BaseMetadata$1>(state: UmbrellaStoreState<M>, options: {
|
|
1405
|
+
roomId: string | null;
|
|
1406
|
+
query?: ThreadsQuery<M>;
|
|
1407
|
+
orderBy: "age" | "last-update";
|
|
1408
|
+
}): ThreadData$1<M>[];
|
|
1344
1409
|
/**
|
|
1345
1410
|
* Gets or creates a unique Umbrella store for each unique client instance.
|
|
1346
1411
|
*
|
|
@@ -1504,10 +1569,6 @@ declare const _useUserThreads_experimental: TypedBundle$1["useUserThreads_experi
|
|
|
1504
1569
|
*/
|
|
1505
1570
|
declare const _useUserThreadsSuspense_experimental: TypedBundle$1["suspense"]["useUserThreads_experimental"];
|
|
1506
1571
|
|
|
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>[];
|
|
1511
1572
|
/**
|
|
1512
1573
|
* Raw access to the React context where the RoomProvider stores the current
|
|
1513
1574
|
* room. Exposed for advanced use cases only.
|
|
@@ -1515,6 +1576,7 @@ declare function selectRoomThreads<M extends BaseMetadata$1>(roomId: string, sta
|
|
|
1515
1576
|
* @private This is a private/advanced API. Do not rely on it.
|
|
1516
1577
|
*/
|
|
1517
1578
|
declare const RoomContext: React$1.Context<OpaqueRoom | null>;
|
|
1579
|
+
|
|
1518
1580
|
/**
|
|
1519
1581
|
* Returns the current connection status for the Room, and triggers
|
|
1520
1582
|
* a re-render whenever it changes. Can be used to render a status badge.
|
|
@@ -1720,6 +1782,24 @@ declare function useOthersConnectionIdsSuspense(): readonly number[];
|
|
|
1720
1782
|
* indicator.
|
|
1721
1783
|
*/
|
|
1722
1784
|
declare function useStorageStatusSuspense(options?: UseStorageStatusOptions): StorageStatusSuccess;
|
|
1785
|
+
/**
|
|
1786
|
+
* Returns a presigned URL for an attachment by its ID.
|
|
1787
|
+
*
|
|
1788
|
+
* @example
|
|
1789
|
+
* const { url, error, isLoading } = useAttachmentUrl("at_xxx");
|
|
1790
|
+
*/
|
|
1791
|
+
declare function useAttachmentUrl(attachmentId: string): AttachmentUrlAsyncResult;
|
|
1792
|
+
/**
|
|
1793
|
+
* Returns a presigned URL for an attachment by its ID.
|
|
1794
|
+
*
|
|
1795
|
+
* @example
|
|
1796
|
+
* const { url } = useAttachmentUrl("at_xxx");
|
|
1797
|
+
*/
|
|
1798
|
+
declare function useAttachmentUrlSuspense(attachmentId: string): {
|
|
1799
|
+
readonly isLoading: false;
|
|
1800
|
+
readonly url: string;
|
|
1801
|
+
readonly error: undefined;
|
|
1802
|
+
};
|
|
1723
1803
|
/**
|
|
1724
1804
|
* Creates a RoomProvider and a set of typed hooks to use in your app. Note
|
|
1725
1805
|
* that any RoomProvider created in this way does not need to be nested in
|
|
@@ -2180,4 +2260,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
|
|
|
2180
2260
|
*/
|
|
2181
2261
|
declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
|
|
2182
2262
|
|
|
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,
|
|
2263
|
+
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, useAttachmentUrl as a5, _useHistoryVersions as a6, useInboxNotifications as a7, _useUserThreads_experimental as a8, useRoomInfo as a9, useUnreadInboxNotificationsCount as aa, _useUser as ab, getUmbrellaStoreForClient as ac, selectThreads as ad, _useOtherSuspense as ae, _useOthersSuspense as af, useOthersConnectionIdsSuspense as ag, _useOthersMappedSuspense as ah, _useSelfSuspense as ai, _useStorageSuspense as aj, useStorageStatusSuspense as ak, _useThreadsSuspense as al, useAttachmentUrlSuspense as am, _useHistoryVersionsSuspense as an, useInboxNotificationsSuspense as ao, useRoomInfoSuspense as ap, useUnreadInboxNotificationsCountSuspense as aq, _useUserSuspense as ar, _useUserThreadsSuspense_experimental as as, 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 };
|
package/dist/suspense.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, am as useAttachmentUrl, 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, an as useHistoryVersions, _ as useInboxNotificationThread, ao 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, ae as useOther, af as useOthers, ag as useOthersConnectionIds, G as useOthersListener, ah as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, ap as useRoomInfo, K as useRoomNotificationSettings, ai as useSelf, N as useStatus, aj as useStorage, O as useStorageRoot, ak as useStorageStatus, P as useThreadSubscription, al as useThreads, Q as useUndo, aq as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ar as useUser, as as useUserThreads_experimental } from './suspense-j9RIyQIe.mjs';
|
|
2
2
|
export { Json, JsonObject, shallow } from '@liveblocks/client';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@liveblocks/core';
|
package/dist/suspense.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, am as useAttachmentUrl, 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, an as useHistoryVersions, _ as useInboxNotificationThread, ao 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, ae as useOther, af as useOthers, ag as useOthersConnectionIds, G as useOthersListener, ah as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, ap as useRoomInfo, K as useRoomNotificationSettings, ai as useSelf, N as useStatus, aj as useStorage, O as useStorageRoot, ak as useStorageStatus, P as useThreadSubscription, al as useThreads, Q as useUndo, aq as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ar as useUser, as as useUserThreads_experimental } from './suspense-j9RIyQIe.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,14 @@
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
var _chunkBYZWUB6Mjs = require('./chunk-BYZWUB6M.js');
|
|
63
64
|
|
|
64
65
|
// src/suspense.ts
|
|
65
66
|
var _core = require('@liveblocks/core');
|
|
66
67
|
var _client = require('@liveblocks/client');
|
|
67
|
-
_core.detectDupes.call(void 0,
|
|
68
|
+
_core.detectDupes.call(void 0, _chunkBYZWUB6Mjs.PKG_NAME, _chunkBYZWUB6Mjs.PKG_VERSION, _chunkBYZWUB6Mjs.PKG_FORMAT);
|
|
69
|
+
|
|
68
70
|
|
|
69
71
|
|
|
70
72
|
|
|
@@ -124,5 +126,5 @@ _core.detectDupes.call(void 0, _chunkKNPU4P3Yjs.PKG_NAME, _chunkKNPU4P3Yjs.PKG_V
|
|
|
124
126
|
|
|
125
127
|
|
|
126
128
|
|
|
127
|
-
exports.ClientContext =
|
|
129
|
+
exports.ClientContext = _chunkBYZWUB6Mjs.ClientContext; exports.ClientSideSuspense = _chunkBYZWUB6Mjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkBYZWUB6Mjs.LiveblocksProvider; exports.RoomContext = _chunkBYZWUB6Mjs.RoomContext; exports.RoomProvider = _chunkBYZWUB6Mjs._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkBYZWUB6Mjs._useAddReaction; exports.useAttachmentUrl = _chunkBYZWUB6Mjs.useAttachmentUrlSuspense; exports.useBatch = _chunkBYZWUB6Mjs.useBatch; exports.useBroadcastEvent = _chunkBYZWUB6Mjs._useBroadcastEvent; exports.useCanRedo = _chunkBYZWUB6Mjs.useCanRedo; exports.useCanUndo = _chunkBYZWUB6Mjs.useCanUndo; exports.useClient = _chunkBYZWUB6Mjs.useClient; exports.useCreateComment = _chunkBYZWUB6Mjs.useCreateComment; exports.useCreateThread = _chunkBYZWUB6Mjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkBYZWUB6Mjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkBYZWUB6Mjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkBYZWUB6Mjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkBYZWUB6Mjs._useDeleteThread; exports.useEditComment = _chunkBYZWUB6Mjs.useEditComment; exports.useEditThreadMetadata = _chunkBYZWUB6Mjs._useEditThreadMetadata; exports.useErrorListener = _chunkBYZWUB6Mjs.useErrorListener; exports.useEventListener = _chunkBYZWUB6Mjs._useEventListener; exports.useHistory = _chunkBYZWUB6Mjs.useHistory; exports.useHistoryVersions = _chunkBYZWUB6Mjs._useHistoryVersionsSuspense; exports.useInboxNotificationThread = _chunkBYZWUB6Mjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkBYZWUB6Mjs.useInboxNotificationsSuspense; exports.useIsInsideRoom = _chunkBYZWUB6Mjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkBYZWUB6Mjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkBYZWUB6Mjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkBYZWUB6Mjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkBYZWUB6Mjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkBYZWUB6Mjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkBYZWUB6Mjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkBYZWUB6Mjs._useMutation; exports.useMyPresence = _chunkBYZWUB6Mjs._useMyPresence; exports.useOther = _chunkBYZWUB6Mjs._useOtherSuspense; exports.useOthers = _chunkBYZWUB6Mjs._useOthersSuspense; exports.useOthersConnectionIds = _chunkBYZWUB6Mjs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkBYZWUB6Mjs._useOthersListener; exports.useOthersMapped = _chunkBYZWUB6Mjs._useOthersMappedSuspense; exports.useRedo = _chunkBYZWUB6Mjs.useRedo; exports.useRemoveReaction = _chunkBYZWUB6Mjs.useRemoveReaction; exports.useRoom = _chunkBYZWUB6Mjs._useRoom; exports.useRoomInfo = _chunkBYZWUB6Mjs.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkBYZWUB6Mjs.useRoomNotificationSettings; exports.useSelf = _chunkBYZWUB6Mjs._useSelfSuspense; exports.useStatus = _chunkBYZWUB6Mjs.useStatus; exports.useStorage = _chunkBYZWUB6Mjs._useStorageSuspense; exports.useStorageRoot = _chunkBYZWUB6Mjs._useStorageRoot; exports.useStorageStatus = _chunkBYZWUB6Mjs.useStorageStatusSuspense; exports.useThreadSubscription = _chunkBYZWUB6Mjs.useThreadSubscription; exports.useThreads = _chunkBYZWUB6Mjs._useThreadsSuspense; exports.useUndo = _chunkBYZWUB6Mjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkBYZWUB6Mjs.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkBYZWUB6Mjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkBYZWUB6Mjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkBYZWUB6Mjs._useUserSuspense; exports.useUserThreads_experimental = _chunkBYZWUB6Mjs._useUserThreadsSuspense_experimental;
|
|
128
130
|
//# sourceMappingURL=suspense.js.map
|
package/dist/suspense.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/suspense.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/suspense.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU","sourcesContent":["/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseStorageStatusOptions,\n UseThreadsOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport {\n ClientContext,\n LiveblocksProvider,\n useClient,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n} from \"./liveblocks\";\nexport {\n RoomContext,\n RoomProvider,\n useAddReaction,\n useBatch,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useErrorListener,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useRoomNotificationSettings,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomNotificationSettings,\n} from \"./room\";\n\n// Export the Suspense versions of our hooks\n// (This part differs from src/index.ts)\nexport {\n useOtherSuspense as useOther,\n useOthersSuspense as useOthers,\n useOthersConnectionIdsSuspense as useOthersConnectionIds,\n useOthersMappedSuspense as useOthersMapped,\n useSelfSuspense as useSelf,\n useStorageSuspense as useStorage,\n useStorageStatusSuspense as useStorageStatus,\n useThreadsSuspense as useThreads,\n useAttachmentUrlSuspense as useAttachmentUrl,\n useHistoryVersionsSuspense as useHistoryVersions,\n} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n useUserThreadsSuspense_experimental as useUserThreads_experimental,\n} from \"./liveblocks\";\n"]}
|
package/dist/suspense.mjs
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
_useUpdateMyPresence,
|
|
31
31
|
_useUserSuspense,
|
|
32
32
|
_useUserThreadsSuspense_experimental,
|
|
33
|
+
useAttachmentUrlSuspense,
|
|
33
34
|
useBatch,
|
|
34
35
|
useCanRedo,
|
|
35
36
|
useCanUndo,
|
|
@@ -59,7 +60,7 @@ import {
|
|
|
59
60
|
useUndo,
|
|
60
61
|
useUnreadInboxNotificationsCountSuspense,
|
|
61
62
|
useUpdateRoomNotificationSettings
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-WVLHQ6LC.mjs";
|
|
63
64
|
|
|
64
65
|
// src/suspense.ts
|
|
65
66
|
import { detectDupes } from "@liveblocks/core";
|
|
@@ -73,6 +74,7 @@ export {
|
|
|
73
74
|
_RoomProvider as RoomProvider,
|
|
74
75
|
shallow,
|
|
75
76
|
_useAddReaction as useAddReaction,
|
|
77
|
+
useAttachmentUrlSuspense as useAttachmentUrl,
|
|
76
78
|
useBatch,
|
|
77
79
|
_useBroadcastEvent as useBroadcastEvent,
|
|
78
80
|
useCanRedo,
|
package/dist/suspense.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/suspense.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseStorageStatusOptions,\n UseThreadsOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport {\n ClientContext,\n LiveblocksProvider,\n useClient,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n} from \"./liveblocks\";\nexport {\n RoomContext,\n RoomProvider,\n useAddReaction,\n useBatch,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useErrorListener,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useRoomNotificationSettings,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomNotificationSettings,\n} from \"./room\";\n\n// Export the Suspense versions of our hooks\n// (This part differs from src/index.ts)\nexport {\n useOtherSuspense as useOther,\n useOthersSuspense as useOthers,\n useOthersConnectionIdsSuspense as useOthersConnectionIds,\n useOthersMappedSuspense as useOthersMapped,\n useSelfSuspense as useSelf,\n useStorageSuspense as useStorage,\n useStorageStatusSuspense as useStorageStatus,\n useThreadsSuspense as useThreads,\n useHistoryVersionsSuspense as useHistoryVersions,\n} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n useUserThreadsSuspense_experimental as useUserThreads_experimental,\n} from \"./liveblocks\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/suspense.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseStorageStatusOptions,\n UseThreadsOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport {\n ClientContext,\n LiveblocksProvider,\n useClient,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n} from \"./liveblocks\";\nexport {\n RoomContext,\n RoomProvider,\n useAddReaction,\n useBatch,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useErrorListener,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useRoomNotificationSettings,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomNotificationSettings,\n} from \"./room\";\n\n// Export the Suspense versions of our hooks\n// (This part differs from src/index.ts)\nexport {\n useOtherSuspense as useOther,\n useOthersSuspense as useOthers,\n useOthersConnectionIdsSuspense as useOthersConnectionIds,\n useOthersMappedSuspense as useOthersMapped,\n useSelfSuspense as useSelf,\n useStorageSuspense as useStorage,\n useStorageStatusSuspense as useStorageStatus,\n useThreadsSuspense as useThreads,\n useAttachmentUrlSuspense as useAttachmentUrl,\n useHistoryVersionsSuspense as useHistoryVersions,\n} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n useUserThreadsSuspense_experimental as useUserThreads_experimental,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0-beta1",
|
|
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",
|
|
@@ -44,11 +44,13 @@
|
|
|
44
44
|
"lint:package": "publint --strict && attw --pack && bun scripts/check-exports.ts",
|
|
45
45
|
"test": "jest --silent --verbose --color=always",
|
|
46
46
|
"test:types": "ls test-d/* | xargs -n1 tsd --files",
|
|
47
|
-
"test:watch": "jest --silent --verbose --color=always --watch"
|
|
47
|
+
"test:watch": "jest --silent --verbose --color=always --watch",
|
|
48
|
+
"test:deps": "depcruise src --exclude __tests__",
|
|
49
|
+
"showdeps": "depcruise src --include-only '^src' --exclude='__tests__' --output-type dot | dot -T svg > /tmp/dependency-graph.svg && open /tmp/dependency-graph.svg"
|
|
48
50
|
},
|
|
49
51
|
"dependencies": {
|
|
50
|
-
"@liveblocks/client": "2.
|
|
51
|
-
"@liveblocks/core": "2.
|
|
52
|
+
"@liveblocks/client": "2.8.0-beta1",
|
|
53
|
+
"@liveblocks/core": "2.8.0-beta1",
|
|
52
54
|
"use-sync-external-store": "^1.2.2"
|
|
53
55
|
},
|
|
54
56
|
"peerDependencies": {
|