@liveblocks/react 2.8.0-beta2 → 2.8.0-beta4
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-OBLKSEC3.mjs → chunk-G35ZEFD6.mjs} +366 -281
- package/dist/chunk-G35ZEFD6.mjs.map +1 -0
- package/dist/{chunk-7GMBACXS.js → chunk-G4SKKVCK.js} +381 -296
- package/dist/chunk-G4SKKVCK.js.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{suspense-FX3HjuPs.d.mts → suspense-DJOhRXB2.d.mts} +70 -143
- package/dist/{suspense-FX3HjuPs.d.ts → suspense-DJOhRXB2.d.ts} +70 -143
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +3 -3
- package/dist/suspense.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-7GMBACXS.js.map +0 -1
- package/dist/chunk-OBLKSEC3.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User,
|
|
1
|
+
import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, RoomNotificationSettings, Json, 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,
|
|
4
|
+
import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResult, DRI, AsyncSuccess, CommentAttachment, Resolve, ToImmutable, ThreadData, InboxNotificationData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, CommentUserReaction, ThreadDeleteInfo, InboxNotificationDeleteInfo, DistributiveOmit, OpaqueClient, DU, DM, OpaqueRoom, DP, DS, DE } from '@liveblocks/core';
|
|
5
5
|
|
|
6
6
|
declare type Props = {
|
|
7
7
|
fallback: ReactNode;
|
|
@@ -166,21 +166,12 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
|
|
|
166
166
|
*/
|
|
167
167
|
scrollOnLoad?: boolean;
|
|
168
168
|
};
|
|
169
|
-
declare type UserAsyncResult<T> =
|
|
170
|
-
declare type UserAsyncSuccess<T> =
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare type
|
|
175
|
-
declare type RoomInfoAsyncSuccess = Resolve<RoomInfoAsyncResult & {
|
|
176
|
-
readonly isLoading: false;
|
|
177
|
-
readonly error?: undefined;
|
|
178
|
-
}>;
|
|
179
|
-
declare type AttachmentUrlAsyncResult = AsyncResultWithDataField<string, "url">;
|
|
180
|
-
declare type AttachmentUrlAsyncSuccess = Resolve<AttachmentUrlAsyncResult & {
|
|
181
|
-
readonly isLoading: false;
|
|
182
|
-
readonly error?: undefined;
|
|
183
|
-
}>;
|
|
169
|
+
declare type UserAsyncResult<T> = AsyncResult<T, "user">;
|
|
170
|
+
declare type UserAsyncSuccess<T> = AsyncSuccess<T, "user">;
|
|
171
|
+
declare type RoomInfoAsyncResult = AsyncResult<DRI, "info">;
|
|
172
|
+
declare type RoomInfoAsyncSuccess = AsyncSuccess<DRI, "info">;
|
|
173
|
+
declare type AttachmentUrlAsyncResult = AsyncResult<string, "url">;
|
|
174
|
+
declare type AttachmentUrlAsyncSuccess = AsyncSuccess<string, "url">;
|
|
184
175
|
declare type CreateThreadOptions<M extends BaseMetadata> = Resolve<{
|
|
185
176
|
body: CommentBody;
|
|
186
177
|
attachments?: CommentAttachment[];
|
|
@@ -211,102 +202,17 @@ declare type CommentReactionOptions = {
|
|
|
211
202
|
commentId: string;
|
|
212
203
|
emoji: string;
|
|
213
204
|
};
|
|
214
|
-
declare type
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
declare type
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
declare type
|
|
225
|
-
isLoading: false;
|
|
226
|
-
threads: ThreadData<M>[];
|
|
227
|
-
error?: never;
|
|
228
|
-
};
|
|
229
|
-
declare type ThreadsState<M extends BaseMetadata> = ThreadsStateLoading | ThreadsStateResolved<M>;
|
|
230
|
-
declare type InboxNotificationsStateLoading = {
|
|
231
|
-
isLoading: true;
|
|
232
|
-
inboxNotifications?: never;
|
|
233
|
-
error?: never;
|
|
234
|
-
};
|
|
235
|
-
declare type InboxNotificationsStateSuccess = {
|
|
236
|
-
isLoading: false;
|
|
237
|
-
inboxNotifications: InboxNotificationData[];
|
|
238
|
-
error?: never;
|
|
239
|
-
};
|
|
240
|
-
declare type InboxNotificationsStateError = {
|
|
241
|
-
isLoading: false;
|
|
242
|
-
inboxNotifications?: never;
|
|
243
|
-
error: Error;
|
|
244
|
-
};
|
|
245
|
-
declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateSuccess | InboxNotificationsStateError;
|
|
246
|
-
declare type UnreadInboxNotificationsCountStateLoading = {
|
|
247
|
-
isLoading: true;
|
|
248
|
-
count?: never;
|
|
249
|
-
error?: never;
|
|
250
|
-
};
|
|
251
|
-
declare type UnreadInboxNotificationsCountStateSuccess = {
|
|
252
|
-
isLoading: false;
|
|
253
|
-
count: number;
|
|
254
|
-
error?: never;
|
|
255
|
-
};
|
|
256
|
-
declare type UnreadInboxNotificationsCountStateError = {
|
|
257
|
-
isLoading: false;
|
|
258
|
-
count?: never;
|
|
259
|
-
error: Error;
|
|
260
|
-
};
|
|
261
|
-
declare type UnreadInboxNotificationsCountState = UnreadInboxNotificationsCountStateLoading | UnreadInboxNotificationsCountStateSuccess | UnreadInboxNotificationsCountStateError;
|
|
262
|
-
declare type RoomNotificationSettingsStateLoading = {
|
|
263
|
-
isLoading: true;
|
|
264
|
-
settings?: never;
|
|
265
|
-
error?: never;
|
|
266
|
-
};
|
|
267
|
-
declare type RoomNotificationSettingsStateError = {
|
|
268
|
-
isLoading: false;
|
|
269
|
-
settings?: never;
|
|
270
|
-
error: Error;
|
|
271
|
-
};
|
|
272
|
-
declare type RoomNotificationSettingsStateSuccess = {
|
|
273
|
-
isLoading: false;
|
|
274
|
-
settings: RoomNotificationSettings;
|
|
275
|
-
error?: never;
|
|
276
|
-
};
|
|
277
|
-
declare type RoomNotificationSettingsState = RoomNotificationSettingsStateLoading | RoomNotificationSettingsStateError | RoomNotificationSettingsStateSuccess;
|
|
278
|
-
declare type HistoryVersionDataStateLoading = {
|
|
279
|
-
isLoading: true;
|
|
280
|
-
data?: never;
|
|
281
|
-
error?: never;
|
|
282
|
-
};
|
|
283
|
-
declare type HistoryVersionDataStateResolved = {
|
|
284
|
-
isLoading: false;
|
|
285
|
-
data: Uint8Array;
|
|
286
|
-
error?: Error;
|
|
287
|
-
};
|
|
288
|
-
declare type HistoryVersionDataStateError = {
|
|
289
|
-
isLoading: false;
|
|
290
|
-
data?: never;
|
|
291
|
-
error: Error;
|
|
292
|
-
};
|
|
293
|
-
declare type HistoryVersionDataState = HistoryVersionDataStateLoading | HistoryVersionDataStateResolved | HistoryVersionDataStateError;
|
|
294
|
-
declare type HistoryVersionsStateLoading = {
|
|
295
|
-
isLoading: true;
|
|
296
|
-
versions?: never;
|
|
297
|
-
error?: never;
|
|
298
|
-
};
|
|
299
|
-
declare type HistoryVersionsStateResolved = {
|
|
300
|
-
isLoading: false;
|
|
301
|
-
versions: HistoryVersion[];
|
|
302
|
-
error?: Error;
|
|
303
|
-
};
|
|
304
|
-
declare type HistoryVersionsStateError = {
|
|
305
|
-
isLoading: false;
|
|
306
|
-
versions?: never;
|
|
307
|
-
error: Error;
|
|
308
|
-
};
|
|
309
|
-
declare type HistoryVersionsState = HistoryVersionsStateLoading | HistoryVersionsStateResolved | HistoryVersionsStateError;
|
|
205
|
+
declare type ThreadsAsyncSuccess<M extends BaseMetadata> = AsyncSuccess<ThreadData<M>[], "threads">;
|
|
206
|
+
declare type ThreadsAsyncResult<M extends BaseMetadata> = AsyncResult<ThreadData<M>[], "threads">;
|
|
207
|
+
declare type InboxNotificationsAsyncSuccess = AsyncSuccess<InboxNotificationData[], "inboxNotifications">;
|
|
208
|
+
declare type InboxNotificationsAsyncResult = AsyncResult<InboxNotificationData[], "inboxNotifications">;
|
|
209
|
+
declare type UnreadInboxNotificationsCountAsyncSuccess = AsyncSuccess<number, "count">;
|
|
210
|
+
declare type UnreadInboxNotificationsCountAsyncResult = AsyncResult<number, "count">;
|
|
211
|
+
declare type RoomNotificationSettingsAsyncSuccess = AsyncSuccess<RoomNotificationSettings, "settings">;
|
|
212
|
+
declare type RoomNotificationSettingsAsyncResult = AsyncResult<RoomNotificationSettings, "settings">;
|
|
213
|
+
declare type HistoryVersionDataAsyncResult = AsyncResult<Uint8Array>;
|
|
214
|
+
declare type HistoryVersionsAsyncSuccess = AsyncSuccess<HistoryVersion[], "versions">;
|
|
215
|
+
declare type HistoryVersionsAsyncResult = AsyncResult<HistoryVersion[], "versions">;
|
|
310
216
|
declare type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
|
|
311
217
|
/**
|
|
312
218
|
* The id of the room you want to connect to
|
|
@@ -917,7 +823,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
917
823
|
* @example
|
|
918
824
|
* const { threads, error, isLoading } = useThreads();
|
|
919
825
|
*/
|
|
920
|
-
useThreads(options?: UseThreadsOptions<M>):
|
|
826
|
+
useThreads(options?: UseThreadsOptions<M>): ThreadsAsyncResult<M>;
|
|
921
827
|
/**
|
|
922
828
|
* Returns the user's notification settings for the current room
|
|
923
829
|
* and a function to update them.
|
|
@@ -926,7 +832,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
926
832
|
* const [{ settings }, updateSettings] = useRoomNotificationSettings();
|
|
927
833
|
*/
|
|
928
834
|
useRoomNotificationSettings(): [
|
|
929
|
-
|
|
835
|
+
RoomNotificationSettingsAsyncResult,
|
|
930
836
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
931
837
|
];
|
|
932
838
|
/**
|
|
@@ -942,14 +848,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
942
848
|
* @example
|
|
943
849
|
* const { versions, error, isLoading } = useHistoryVersions();
|
|
944
850
|
*/
|
|
945
|
-
useHistoryVersions():
|
|
851
|
+
useHistoryVersions(): HistoryVersionsAsyncResult;
|
|
946
852
|
/**
|
|
947
853
|
* (Private beta) Returns the data of a specific version of the current room.
|
|
948
854
|
*
|
|
949
855
|
* @example
|
|
950
856
|
* const { data, error, isLoading } = useHistoryVersionData(version.id);
|
|
951
857
|
*/
|
|
952
|
-
useHistoryVersionData(id: string):
|
|
858
|
+
useHistoryVersionData(id: string): HistoryVersionDataAsyncResult;
|
|
953
859
|
suspense: Resolve<RoomContextBundleCommon<P, S, U, E, M> & SharedContextBundle<U>["suspense"] & {
|
|
954
860
|
/**
|
|
955
861
|
* Returns the current storage status for the Room, and triggers
|
|
@@ -1011,14 +917,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
1011
917
|
* @example
|
|
1012
918
|
* const { threads } = useThreads();
|
|
1013
919
|
*/
|
|
1014
|
-
useThreads(options?: UseThreadsOptions<M>):
|
|
920
|
+
useThreads(options?: UseThreadsOptions<M>): ThreadsAsyncSuccess<M>;
|
|
1015
921
|
/**
|
|
1016
922
|
* (Private beta) Returns a history of versions of the current room.
|
|
1017
923
|
*
|
|
1018
924
|
* @example
|
|
1019
925
|
* const { versions } = useHistoryVersions();
|
|
1020
926
|
*/
|
|
1021
|
-
useHistoryVersions():
|
|
927
|
+
useHistoryVersions(): HistoryVersionsAsyncSuccess;
|
|
1022
928
|
/**
|
|
1023
929
|
* Returns the user's notification settings for the current room
|
|
1024
930
|
* and a function to update them.
|
|
@@ -1027,7 +933,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
1027
933
|
* const [{ settings }, updateSettings] = useRoomNotificationSettings();
|
|
1028
934
|
*/
|
|
1029
935
|
useRoomNotificationSettings(): [
|
|
1030
|
-
|
|
936
|
+
RoomNotificationSettingsAsyncSuccess,
|
|
1031
937
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
1032
938
|
];
|
|
1033
939
|
/**
|
|
@@ -1104,21 +1010,21 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
|
|
|
1104
1010
|
* @example
|
|
1105
1011
|
* const { inboxNotifications, error, isLoading } = useInboxNotifications();
|
|
1106
1012
|
*/
|
|
1107
|
-
useInboxNotifications():
|
|
1013
|
+
useInboxNotifications(): InboxNotificationsAsyncResult;
|
|
1108
1014
|
/**
|
|
1109
1015
|
* Returns the number of unread inbox notifications for the current user.
|
|
1110
1016
|
*
|
|
1111
1017
|
* @example
|
|
1112
1018
|
* const { count, error, isLoading } = useUnreadInboxNotificationsCount();
|
|
1113
1019
|
*/
|
|
1114
|
-
useUnreadInboxNotificationsCount():
|
|
1020
|
+
useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncResult;
|
|
1115
1021
|
/**
|
|
1116
1022
|
* @experimental
|
|
1117
1023
|
*
|
|
1118
1024
|
* This hook is experimental and could be removed or changed at any time!
|
|
1119
1025
|
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1120
1026
|
*/
|
|
1121
|
-
useUserThreads_experimental(options?: UseUserThreadsOptions<M>):
|
|
1027
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsAsyncResult<M>;
|
|
1122
1028
|
suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
|
|
1123
1029
|
/**
|
|
1124
1030
|
* Returns the inbox notifications for the current user.
|
|
@@ -1126,21 +1032,21 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
|
|
|
1126
1032
|
* @example
|
|
1127
1033
|
* const { inboxNotifications } = useInboxNotifications();
|
|
1128
1034
|
*/
|
|
1129
|
-
useInboxNotifications():
|
|
1035
|
+
useInboxNotifications(): InboxNotificationsAsyncSuccess;
|
|
1130
1036
|
/**
|
|
1131
1037
|
* Returns the number of unread inbox notifications for the current user.
|
|
1132
1038
|
*
|
|
1133
1039
|
* @example
|
|
1134
1040
|
* const { count } = useUnreadInboxNotificationsCount();
|
|
1135
1041
|
*/
|
|
1136
|
-
useUnreadInboxNotificationsCount():
|
|
1042
|
+
useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncSuccess;
|
|
1137
1043
|
/**
|
|
1138
1044
|
* @experimental
|
|
1139
1045
|
*
|
|
1140
1046
|
* This hook is experimental and could be removed or changed at any time!
|
|
1141
1047
|
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1142
1048
|
*/
|
|
1143
|
-
useUserThreads_experimental(options?: UseUserThreadsOptions<M>):
|
|
1049
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsAsyncSuccess<M>;
|
|
1144
1050
|
}>;
|
|
1145
1051
|
}>;
|
|
1146
1052
|
|
|
@@ -1239,7 +1145,7 @@ declare type UpdateNotificationSettingsOptimisticUpdate = {
|
|
|
1239
1145
|
roomId: string;
|
|
1240
1146
|
settings: Partial<RoomNotificationSettings$1>;
|
|
1241
1147
|
};
|
|
1242
|
-
declare type
|
|
1148
|
+
declare type QueryAsyncResult = AsyncResult<undefined>;
|
|
1243
1149
|
/**
|
|
1244
1150
|
* Externally observable state of the store, which will have:
|
|
1245
1151
|
* - Optimistic updates applied
|
|
@@ -1251,7 +1157,9 @@ declare type UmbrellaStoreState<M extends BaseMetadata> = {
|
|
|
1251
1157
|
* e.g. 'room-abc-{"color":"red"}' - ok
|
|
1252
1158
|
* e.g. 'room-abc-{}' - loading
|
|
1253
1159
|
*/
|
|
1254
|
-
|
|
1160
|
+
queries2: Record<string, QueryAsyncResult>;
|
|
1161
|
+
queries3: Record<string, QueryAsyncResult>;
|
|
1162
|
+
queries4: Record<string, QueryAsyncResult>;
|
|
1255
1163
|
/**
|
|
1256
1164
|
* All threads in a sorted array, optimistic updates applied, without deleted
|
|
1257
1165
|
* threads.
|
|
@@ -1292,11 +1200,17 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1292
1200
|
private _stateCached;
|
|
1293
1201
|
constructor();
|
|
1294
1202
|
private get;
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1203
|
+
batch(callback: () => void): void;
|
|
1204
|
+
getFullState(): UmbrellaStoreState<M>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Returns the async result of the given queryKey. If the query is success,
|
|
1207
|
+
* then it will return the entire store's state in the payload.
|
|
1208
|
+
*/
|
|
1209
|
+
getThreadsAsync(queryKey: string): AsyncResult<UmbrellaStoreState<M>, "fullState">;
|
|
1210
|
+
getUserThreadsAsync(queryKey: string): AsyncResult<UmbrellaStoreState<M>, "fullState">;
|
|
1211
|
+
getInboxNotificationsAsync(): AsyncResult<InboxNotificationData[], "inboxNotifications">;
|
|
1212
|
+
getNotificationSettingsAsync(roomId: string): RoomNotificationSettingsAsyncResult;
|
|
1213
|
+
getVersionsAsync(roomId: string): AsyncResult<HistoryVersion[], "versions">;
|
|
1300
1214
|
/**
|
|
1301
1215
|
* @private Only used by the E2E test suite.
|
|
1302
1216
|
*/
|
|
@@ -1307,14 +1221,18 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1307
1221
|
*/
|
|
1308
1222
|
_subscribeOptimisticUpdates(callback: () => void): () => void;
|
|
1309
1223
|
subscribeThreads(callback: () => void): () => void;
|
|
1310
|
-
|
|
1224
|
+
subscribeUserThreads(callback: () => void): () => void;
|
|
1225
|
+
subscribeThreadsOrInboxNotifications(callback: () => void): () => void;
|
|
1311
1226
|
subscribeNotificationSettings(callback: () => void): () => void;
|
|
1312
1227
|
subscribeVersions(callback: () => void): () => void;
|
|
1313
1228
|
private updateThreadsCache;
|
|
1314
1229
|
private updateInboxNotificationsCache;
|
|
1315
1230
|
private setNotificationSettings;
|
|
1316
1231
|
private setVersions;
|
|
1317
|
-
private
|
|
1232
|
+
private setQuery1State;
|
|
1233
|
+
private setQuery2State;
|
|
1234
|
+
private setQuery3State;
|
|
1235
|
+
private setQuery4State;
|
|
1318
1236
|
private updateOptimisticUpdatesCache;
|
|
1319
1237
|
/**
|
|
1320
1238
|
* Updates an existing inbox notification with a new value, replacing the
|
|
@@ -1377,7 +1295,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1377
1295
|
editComment(threadId: string, optimisticUpdateId: string, editedComment: CommentData): void;
|
|
1378
1296
|
deleteComment(threadId: string, optimisticUpdateId: string, commentId: string, deletedAt: Date): void;
|
|
1379
1297
|
updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
|
|
1380
|
-
updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[]
|
|
1298
|
+
updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[]): void;
|
|
1381
1299
|
/**
|
|
1382
1300
|
* Updates existing notification setting for a room with a new value,
|
|
1383
1301
|
* replacing the corresponding optimistic update.
|
|
@@ -1387,9 +1305,18 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1387
1305
|
updateRoomVersions(roomId: string, versions: HistoryVersion[], queryKey?: string): void;
|
|
1388
1306
|
addOptimisticUpdate(optimisticUpdate: DistributiveOmit<OptimisticUpdate<M>, "id">): string;
|
|
1389
1307
|
removeOptimisticUpdate(optimisticUpdateId: string): void;
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1308
|
+
setQuery1Loading(): void;
|
|
1309
|
+
setQuery1OK(): void;
|
|
1310
|
+
setQuery1Error(error: Error): void;
|
|
1311
|
+
setQuery2Loading(queryKey: string): void;
|
|
1312
|
+
setQuery2OK(queryKey: string): void;
|
|
1313
|
+
setQuery2Error(queryKey: string, error: Error): void;
|
|
1314
|
+
setQuery3Loading(queryKey: string): void;
|
|
1315
|
+
private setQuery3OK;
|
|
1316
|
+
setQuery3Error(queryKey: string, error: Error): void;
|
|
1317
|
+
setQuery4Loading(queryKey: string): void;
|
|
1318
|
+
private setQuery4OK;
|
|
1319
|
+
setQuery4Error(queryKey: string, error: Error): void;
|
|
1393
1320
|
}
|
|
1394
1321
|
|
|
1395
1322
|
/**
|
|
@@ -1438,7 +1365,7 @@ declare function createLiveblocksContext<U extends BaseUserMeta = DU, M extends
|
|
|
1438
1365
|
* @example
|
|
1439
1366
|
* const { inboxNotifications, error, isLoading } = useInboxNotifications();
|
|
1440
1367
|
*/
|
|
1441
|
-
declare function useInboxNotifications():
|
|
1368
|
+
declare function useInboxNotifications(): AsyncResult<InboxNotificationData[], "inboxNotifications">;
|
|
1442
1369
|
/**
|
|
1443
1370
|
* Returns the inbox notifications for the current user.
|
|
1444
1371
|
*
|
|
@@ -1488,7 +1415,7 @@ declare function useDeleteInboxNotification(): (inboxNotificationId: string) =>
|
|
|
1488
1415
|
* @example
|
|
1489
1416
|
* const { count, error, isLoading } = useUnreadInboxNotificationsCount();
|
|
1490
1417
|
*/
|
|
1491
|
-
declare function useUnreadInboxNotificationsCount():
|
|
1418
|
+
declare function useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncResult;
|
|
1492
1419
|
/**
|
|
1493
1420
|
* Returns the number of unread inbox notifications for the current user.
|
|
1494
1421
|
*
|
|
@@ -1751,7 +1678,7 @@ declare function useThreadSubscription(threadId: string): ThreadSubscription;
|
|
|
1751
1678
|
* const [{ settings }, updateSettings] = useRoomNotificationSettings();
|
|
1752
1679
|
*/
|
|
1753
1680
|
declare function useRoomNotificationSettings(): [
|
|
1754
|
-
|
|
1681
|
+
RoomNotificationSettingsAsyncResult,
|
|
1755
1682
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
1756
1683
|
];
|
|
1757
1684
|
/**
|
|
@@ -1760,7 +1687,7 @@ declare function useRoomNotificationSettings(): [
|
|
|
1760
1687
|
* @example
|
|
1761
1688
|
* const {data} = useHistoryVersionData(versionId);
|
|
1762
1689
|
*/
|
|
1763
|
-
declare function useHistoryVersionData(versionId: string):
|
|
1690
|
+
declare function useHistoryVersionData(versionId: string): HistoryVersionDataAsyncResult;
|
|
1764
1691
|
/**
|
|
1765
1692
|
* Returns a function that updates the user's notification settings
|
|
1766
1693
|
* for the current room.
|
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, 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-
|
|
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-DJOhRXB2.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, 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-
|
|
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-DJOhRXB2.js';
|
|
2
2
|
export { Json, JsonObject, shallow } from '@liveblocks/client';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@liveblocks/core';
|
package/dist/suspense.js
CHANGED
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunkG4SKKVCKjs = require('./chunk-G4SKKVCK.js');
|
|
64
64
|
|
|
65
65
|
// src/suspense.ts
|
|
66
66
|
var _core = require('@liveblocks/core');
|
|
67
67
|
var _client = require('@liveblocks/client');
|
|
68
|
-
_core.detectDupes.call(void 0,
|
|
68
|
+
_core.detectDupes.call(void 0, _chunkG4SKKVCKjs.PKG_NAME, _chunkG4SKKVCKjs.PKG_VERSION, _chunkG4SKKVCKjs.PKG_FORMAT);
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
@@ -126,5 +126,5 @@ _core.detectDupes.call(void 0, _chunk7GMBACXSjs.PKG_NAME, _chunk7GMBACXSjs.PKG_V
|
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
exports.ClientContext =
|
|
129
|
+
exports.ClientContext = _chunkG4SKKVCKjs.ClientContext; exports.ClientSideSuspense = _chunkG4SKKVCKjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkG4SKKVCKjs.LiveblocksProvider; exports.RoomContext = _chunkG4SKKVCKjs.RoomContext; exports.RoomProvider = _chunkG4SKKVCKjs._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkG4SKKVCKjs._useAddReaction; exports.useAttachmentUrl = _chunkG4SKKVCKjs.useAttachmentUrlSuspense; exports.useBatch = _chunkG4SKKVCKjs.useBatch; exports.useBroadcastEvent = _chunkG4SKKVCKjs._useBroadcastEvent; exports.useCanRedo = _chunkG4SKKVCKjs.useCanRedo; exports.useCanUndo = _chunkG4SKKVCKjs.useCanUndo; exports.useClient = _chunkG4SKKVCKjs.useClient; exports.useCreateComment = _chunkG4SKKVCKjs.useCreateComment; exports.useCreateThread = _chunkG4SKKVCKjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkG4SKKVCKjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkG4SKKVCKjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkG4SKKVCKjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkG4SKKVCKjs._useDeleteThread; exports.useEditComment = _chunkG4SKKVCKjs.useEditComment; exports.useEditThreadMetadata = _chunkG4SKKVCKjs._useEditThreadMetadata; exports.useErrorListener = _chunkG4SKKVCKjs.useErrorListener; exports.useEventListener = _chunkG4SKKVCKjs._useEventListener; exports.useHistory = _chunkG4SKKVCKjs.useHistory; exports.useHistoryVersions = _chunkG4SKKVCKjs._useHistoryVersionsSuspense; exports.useInboxNotificationThread = _chunkG4SKKVCKjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkG4SKKVCKjs.useInboxNotificationsSuspense; exports.useIsInsideRoom = _chunkG4SKKVCKjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkG4SKKVCKjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkG4SKKVCKjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkG4SKKVCKjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkG4SKKVCKjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkG4SKKVCKjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkG4SKKVCKjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkG4SKKVCKjs._useMutation; exports.useMyPresence = _chunkG4SKKVCKjs._useMyPresence; exports.useOther = _chunkG4SKKVCKjs._useOtherSuspense; exports.useOthers = _chunkG4SKKVCKjs._useOthersSuspense; exports.useOthersConnectionIds = _chunkG4SKKVCKjs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkG4SKKVCKjs._useOthersListener; exports.useOthersMapped = _chunkG4SKKVCKjs._useOthersMappedSuspense; exports.useRedo = _chunkG4SKKVCKjs.useRedo; exports.useRemoveReaction = _chunkG4SKKVCKjs.useRemoveReaction; exports.useRoom = _chunkG4SKKVCKjs._useRoom; exports.useRoomInfo = _chunkG4SKKVCKjs.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkG4SKKVCKjs.useRoomNotificationSettings; exports.useSelf = _chunkG4SKKVCKjs._useSelfSuspense; exports.useStatus = _chunkG4SKKVCKjs.useStatus; exports.useStorage = _chunkG4SKKVCKjs._useStorageSuspense; exports.useStorageRoot = _chunkG4SKKVCKjs._useStorageRoot; exports.useStorageStatus = _chunkG4SKKVCKjs.useStorageStatusSuspense; exports.useThreadSubscription = _chunkG4SKKVCKjs.useThreadSubscription; exports.useThreads = _chunkG4SKKVCKjs._useThreadsSuspense; exports.useUndo = _chunkG4SKKVCKjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkG4SKKVCKjs.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkG4SKKVCKjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkG4SKKVCKjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkG4SKKVCKjs._useUserSuspense; exports.useUserThreads_experimental = _chunkG4SKKVCKjs._useUserThreadsSuspense_experimental;
|
|
130
130
|
//# sourceMappingURL=suspense.js.map
|
package/dist/suspense.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react",
|
|
3
|
-
"version": "2.8.0-
|
|
3
|
+
"version": "2.8.0-beta4",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"showdeps": "depcruise src --include-only '^src' --exclude='__tests__' --output-type dot | dot -T svg > /tmp/dependency-graph.svg && open /tmp/dependency-graph.svg"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@liveblocks/client": "2.8.0-
|
|
53
|
-
"@liveblocks/core": "2.8.0-
|
|
52
|
+
"@liveblocks/client": "2.8.0-beta4",
|
|
53
|
+
"@liveblocks/core": "2.8.0-beta4",
|
|
54
54
|
"use-sync-external-store": "^1.2.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|