@liveblocks/react 2.2.3-alpha2 → 2.4.0-test1

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/index.mjs CHANGED
@@ -37,7 +37,9 @@ import {
37
37
  useClient,
38
38
  useCommentsErrorListener,
39
39
  useCreateComment,
40
+ useDeleteAllInboxNotifications,
40
41
  useDeleteComment,
42
+ useDeleteInboxNotification,
41
43
  useEditComment,
42
44
  useErrorListener,
43
45
  useHistory,
@@ -59,7 +61,7 @@ import {
59
61
  useUndo,
60
62
  useUnreadInboxNotificationsCount,
61
63
  useUpdateRoomNotificationSettings
62
- } from "./chunk-AKAI4UTH.mjs";
64
+ } from "./chunk-2ITOEAYK.mjs";
63
65
 
64
66
  // src/index.ts
65
67
  import { detectDupes } from "@liveblocks/core";
@@ -85,7 +87,9 @@ export {
85
87
  useCommentsErrorListener,
86
88
  useCreateComment,
87
89
  _useCreateThread as useCreateThread,
90
+ useDeleteAllInboxNotifications,
88
91
  useDeleteComment,
92
+ useDeleteInboxNotification,
89
93
  _useDeleteThread as useDeleteThread,
90
94
  useEditComment,
91
95
  _useEditThreadMetadata as useEditThreadMetadata,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.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 createLiveblocksContext,\n useClient,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\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 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\nexport { useCommentsErrorListener, CreateThreadError } from \"./room\";\nexport { selectedThreads } from \"./comments/lib/selected-threads\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useStorageStatus,\n useThreads,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useRoomInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}
1
+ {"version":3,"sources":["../src/index.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 createLiveblocksContext,\n useClient,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\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 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\nexport { useCommentsErrorListener, CreateThreadError } from \"./room\";\nexport { selectedThreads } from \"./comments/lib/selected-threads\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useStorageStatus,\n useThreads,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useRoomInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, PropsWithChildren } from 'react';
3
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, DRI, InboxNotificationData, Resolve, ToImmutable, ThreadData, 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, QueryMetadata, StorageStatus, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, OpaqueClient, DU, ClientOptions, DM, OpaqueRoom, RoomNotificationSettings as RoomNotificationSettings$1, DP, DS, DE } from '@liveblocks/core';
5
5
 
6
6
  declare type Props = {
7
7
  fallback: ReactNode;
@@ -159,38 +159,16 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
159
159
  scrollOnLoad?: boolean;
160
160
  };
161
161
 
162
- declare type UserStateLoading = {
163
- isLoading: true;
164
- user?: never;
165
- error?: never;
166
- };
167
- declare type UserStateError = {
168
- isLoading: false;
169
- user?: never;
170
- error: Error;
171
- };
172
- declare type UserStateSuccess<T> = {
173
- isLoading: false;
174
- user: T;
175
- error?: never;
176
- };
177
- declare type UserState<T> = UserStateLoading | UserStateError | UserStateSuccess<T>;
178
- declare type RoomInfoStateLoading = {
179
- isLoading: true;
180
- info?: never;
181
- error?: never;
182
- };
183
- declare type RoomInfoStateError = {
184
- isLoading: false;
185
- info?: never;
186
- error: Error;
187
- };
188
- declare type RoomInfoStateSuccess = {
189
- isLoading: false;
190
- info: DRI;
191
- error?: never;
192
- };
193
- declare type RoomInfoState = RoomInfoStateLoading | RoomInfoStateError | RoomInfoStateSuccess;
162
+ declare type UserAsyncResult<T> = AsyncResultWithDataField<T, "user">;
163
+ declare type UserAsyncSuccess<T> = Resolve<UserAsyncResult<T> & {
164
+ readonly isLoading: false;
165
+ readonly error?: undefined;
166
+ }>;
167
+ declare type RoomInfoAsyncResult = AsyncResultWithDataField<DRI, "info">;
168
+ declare type RoomInfoAsyncSuccess = Resolve<RoomInfoAsyncResult & {
169
+ readonly isLoading: false;
170
+ readonly error?: undefined;
171
+ }>;
194
172
  declare type CreateThreadOptions<M extends BaseMetadata> = Resolve<{
195
173
  body: CommentBody;
196
174
  } & PartialUnless<M, {
@@ -239,11 +217,6 @@ declare type InboxNotificationsStateLoading = {
239
217
  inboxNotifications?: never;
240
218
  error?: never;
241
219
  };
242
- declare type InboxNotificationsStateResolved = {
243
- isLoading: false;
244
- inboxNotifications: InboxNotificationData[];
245
- error?: Error;
246
- };
247
220
  declare type InboxNotificationsStateSuccess = {
248
221
  isLoading: false;
249
222
  inboxNotifications: InboxNotificationData[];
@@ -254,7 +227,7 @@ declare type InboxNotificationsStateError = {
254
227
  inboxNotifications?: never;
255
228
  error: Error;
256
229
  };
257
- declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateResolved | InboxNotificationsStateError;
230
+ declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateSuccess | InboxNotificationsStateError;
258
231
  declare type UnreadInboxNotificationsCountStateLoading = {
259
232
  isLoading: true;
260
233
  count?: never;
@@ -364,14 +337,14 @@ declare type SharedContextBundle<U extends BaseUserMeta> = {
364
337
  * @example
365
338
  * const { user, error, isLoading } = useUser("user-id");
366
339
  */
367
- useUser(userId: string): UserState<U["info"]>;
340
+ useUser(userId: string): UserAsyncResult<U["info"]>;
368
341
  /**
369
342
  * Returns room info from a given room ID.
370
343
  *
371
344
  * @example
372
345
  * const { info, error, isLoading } = useRoomInfo("room-id");
373
346
  */
374
- useRoomInfo(roomId: string): RoomInfoState;
347
+ useRoomInfo(roomId: string): RoomInfoAsyncResult;
375
348
  };
376
349
  suspense: {
377
350
  /**
@@ -384,14 +357,14 @@ declare type SharedContextBundle<U extends BaseUserMeta> = {
384
357
  * @example
385
358
  * const { user } = useUser("user-id");
386
359
  */
387
- useUser(userId: string): UserStateSuccess<U["info"]>;
360
+ useUser(userId: string): UserAsyncSuccess<U["info"]>;
388
361
  /**
389
362
  * Returns room info from a given room ID.
390
363
  *
391
364
  * @example
392
365
  * const { info } = useRoomInfo("room-id");
393
366
  */
394
- useRoomInfo(roomId: string): RoomInfoStateSuccess;
367
+ useRoomInfo(roomId: string): RoomInfoAsyncSuccess;
395
368
  };
396
369
  };
397
370
  /**
@@ -980,7 +953,7 @@ declare type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
980
953
  */
981
954
  LiveblocksProvider(props: PropsWithChildren): JSX.Element;
982
955
  /**
983
- * Returns a function that marks an inbox notification as read.
956
+ * Returns a function that marks an inbox notification as read for the current user.
984
957
  *
985
958
  * @example
986
959
  * const markInboxNotificationAsRead = useMarkInboxNotificationAsRead();
@@ -988,13 +961,29 @@ declare type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
988
961
  */
989
962
  useMarkInboxNotificationAsRead(): (inboxNotificationId: string) => void;
990
963
  /**
991
- * Returns a function that marks all inbox notifications as read.
964
+ * Returns a function that marks all of the current user's inbox notifications as read.
992
965
  *
993
966
  * @example
994
967
  * const markAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead();
995
968
  * markAllInboxNotificationsAsRead();
996
969
  */
997
970
  useMarkAllInboxNotificationsAsRead(): () => void;
971
+ /**
972
+ * Returns a function that deletes an inbox notification for the current user.
973
+ *
974
+ * @example
975
+ * const deleteInboxNotification = useDeleteInboxNotification();
976
+ * deleteInboxNotification("in_xxx");
977
+ */
978
+ useDeleteInboxNotification(): (inboxNotificationId: string) => void;
979
+ /**
980
+ * Returns a function that deletes all of the current user's inbox notifications.
981
+ *
982
+ * @example
983
+ * const deleteAllInboxNotifications = useDeleteAllInboxNotifications();
984
+ * deleteAllInboxNotifications();
985
+ */
986
+ useDeleteAllInboxNotifications(): () => void;
998
987
  /**
999
988
  * Returns the thread associated with a `"thread"` inbox notification.
1000
989
  *
@@ -1055,7 +1044,7 @@ declare const ClientContext: React__default.Context<OpaqueClient | null>;
1055
1044
  /**
1056
1045
  * Obtains a reference to the current Liveblocks client.
1057
1046
  */
1058
- declare function useClient<U extends BaseUserMeta>(): Client$1<U>;
1047
+ declare function useClient<U extends BaseUserMeta>(): Client$1<U, BaseMetadata$1>;
1059
1048
  /**
1060
1049
  * Sets up a client for connecting to Liveblocks, and is the recommended way to do
1061
1050
  * this for React apps. You must define either `authEndpoint` or `publicApiKey`.
@@ -1086,7 +1075,7 @@ declare function useInboxNotifications(): InboxNotificationsState;
1086
1075
  */
1087
1076
  declare function useInboxNotificationsSuspense(): InboxNotificationsStateSuccess;
1088
1077
  /**
1089
- * Returns a function that marks all inbox notifications as read.
1078
+ * Returns a function that marks all of the current user's inbox notifications as read.
1090
1079
  *
1091
1080
  * @example
1092
1081
  * const markAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead();
@@ -1094,13 +1083,29 @@ declare function useInboxNotificationsSuspense(): InboxNotificationsStateSuccess
1094
1083
  */
1095
1084
  declare function useMarkAllInboxNotificationsAsRead(): () => void;
1096
1085
  /**
1097
- * Returns a function that marks an inbox notification as read.
1086
+ * Returns a function that marks an inbox notification as read for the current user.
1098
1087
  *
1099
1088
  * @example
1100
1089
  * const markInboxNotificationAsRead = useMarkInboxNotificationAsRead();
1101
1090
  * markInboxNotificationAsRead("in_xxx");
1102
1091
  */
1103
1092
  declare function useMarkInboxNotificationAsRead(): (inboxNotificationId: string) => void;
1093
+ /**
1094
+ * Returns a function that deletes all of the current user's inbox notifications.
1095
+ *
1096
+ * @example
1097
+ * const deleteAllInboxNotifications = useDeleteAllInboxNotifications();
1098
+ * deleteAllInboxNotifications();
1099
+ */
1100
+ declare function useDeleteAllInboxNotifications(): () => void;
1101
+ /**
1102
+ * Returns a function that deletes an inbox notification for the current user.
1103
+ *
1104
+ * @example
1105
+ * const deleteInboxNotification = useDeleteInboxNotification();
1106
+ * deleteInboxNotification("in_xxx");
1107
+ */
1108
+ declare function useDeleteInboxNotification(): (inboxNotificationId: string) => void;
1104
1109
  /**
1105
1110
  * Returns the number of unread inbox notifications for the current user.
1106
1111
  *
@@ -1121,14 +1126,14 @@ declare function useUnreadInboxNotificationsCountSuspense(): UnreadInboxNotifica
1121
1126
  * @example
1122
1127
  * const { info, error, isLoading } = useRoomInfo("room-id");
1123
1128
  */
1124
- declare function useRoomInfo(roomId: string): RoomInfoState;
1129
+ declare function useRoomInfo(roomId: string): RoomInfoAsyncResult;
1125
1130
  /**
1126
1131
  * Returns room info from a given room ID.
1127
1132
  *
1128
1133
  * @example
1129
1134
  * const { info } = useRoomInfo("room-id");
1130
1135
  */
1131
- declare function useRoomInfoSuspense(roomId: string): RoomInfoStateSuccess;
1136
+ declare function useRoomInfoSuspense(roomId: string): RoomInfoAsyncSuccess;
1132
1137
  declare type TypedBundle$1 = LiveblocksContextBundle<DU, DM>;
1133
1138
  /**
1134
1139
  * Returns the thread associated with a `"thread"` inbox notification.
@@ -1805,4 +1810,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
1805
1810
  */
1806
1811
  declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
1807
1812
 
1808
- export { useStorageStatus as $, _useMutation as A, _useMyPresence as B, ClientSideSuspense as C, _useOthersListener as D, useRedo as E, useRemoveReaction as F, _useRoom as G, useRoomNotificationSettings as H, useStatus as I, _useStorageRoot as J, useThreadSubscription as K, LiveblocksProvider as L, type MutationContext as M, useUndo as N, _useUpdateMyPresence as O, useUpdateRoomNotificationSettings as P, useCommentsErrorListener as Q, RoomContext as R, CreateThreadError as S, _useOther as T, type UseThreadsOptions as U, _useOthers as V, useOthersConnectionIds as W, _useOthersMapped as X, _useSelf as Y, _useStorage as Z, _useInboxNotificationThread as _, type UseStorageStatusOptions as a, _useThreads as a0, useInboxNotifications as a1, useRoomInfo as a2, useUnreadInboxNotificationsCount as a3, _useUser as a4, _useOtherSuspense as a5, _useOthersSuspense as a6, useOthersConnectionIdsSuspense as a7, _useOthersMappedSuspense as a8, _useSelfSuspense as a9, _useStorageSuspense as aa, useStorageStatusSuspense as ab, _useThreadsSuspense as ac, useInboxNotificationsSuspense as ad, useRoomInfoSuspense as ae, useUnreadInboxNotificationsCountSuspense as af, _useUserSuspense as ag, ClientContext as b, createLiveblocksContext as c, useMarkAllInboxNotificationsAsRead as d, useMarkInboxNotificationAsRead as e, createRoomContext as f, _RoomProvider as g, _useAddReaction as h, useBatch as i, _useBroadcastEvent as j, useCanRedo as k, useCanUndo as l, useCreateComment as m, _useCreateThread as n, useDeleteComment as o, _useDeleteThread as p, useEditComment as q, _useEditThreadMetadata as r, useMarkThreadAsResolved as s, useMarkThreadAsUnresolved as t, useClient as u, useErrorListener as v, _useEventListener as w, useHistory as x, useLostConnectionListener as y, useMarkThreadAsRead as z };
1813
+ export { _useSelf as $, useLostConnectionListener as A, useMarkThreadAsRead as B, ClientSideSuspense as C, _useMutation as D, _useMyPresence as E, _useOthersListener as F, useRedo as G, useRemoveReaction as H, _useRoom as I, useRoomNotificationSettings as J, useStatus as K, LiveblocksProvider as L, type MutationContext as M, _useStorageRoot as N, useThreadSubscription as O, useUndo as P, _useUpdateMyPresence as Q, RoomContext as R, useUpdateRoomNotificationSettings as S, useCommentsErrorListener as T, type UseThreadsOptions as U, CreateThreadError as V, _useOther as W, _useOthers as X, useOthersConnectionIds as Y, _useOthersMapped as Z, _useInboxNotificationThread as _, type UseStorageStatusOptions as a, _useStorage as a0, useStorageStatus as a1, _useThreads as a2, useInboxNotifications as a3, useRoomInfo as a4, useUnreadInboxNotificationsCount as a5, _useUser as a6, _useOtherSuspense as a7, _useOthersSuspense as a8, useOthersConnectionIdsSuspense as a9, _useOthersMappedSuspense as aa, _useSelfSuspense as ab, _useStorageSuspense as ac, useStorageStatusSuspense as ad, _useThreadsSuspense as ae, useInboxNotificationsSuspense as af, useRoomInfoSuspense as ag, useUnreadInboxNotificationsCountSuspense as ah, _useUserSuspense as ai, 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,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, PropsWithChildren } from 'react';
3
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, DRI, InboxNotificationData, Resolve, ToImmutable, ThreadData, 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, QueryMetadata, StorageStatus, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, OpaqueClient, DU, ClientOptions, DM, OpaqueRoom, RoomNotificationSettings as RoomNotificationSettings$1, DP, DS, DE } from '@liveblocks/core';
5
5
 
6
6
  declare type Props = {
7
7
  fallback: ReactNode;
@@ -159,38 +159,16 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
159
159
  scrollOnLoad?: boolean;
160
160
  };
161
161
 
162
- declare type UserStateLoading = {
163
- isLoading: true;
164
- user?: never;
165
- error?: never;
166
- };
167
- declare type UserStateError = {
168
- isLoading: false;
169
- user?: never;
170
- error: Error;
171
- };
172
- declare type UserStateSuccess<T> = {
173
- isLoading: false;
174
- user: T;
175
- error?: never;
176
- };
177
- declare type UserState<T> = UserStateLoading | UserStateError | UserStateSuccess<T>;
178
- declare type RoomInfoStateLoading = {
179
- isLoading: true;
180
- info?: never;
181
- error?: never;
182
- };
183
- declare type RoomInfoStateError = {
184
- isLoading: false;
185
- info?: never;
186
- error: Error;
187
- };
188
- declare type RoomInfoStateSuccess = {
189
- isLoading: false;
190
- info: DRI;
191
- error?: never;
192
- };
193
- declare type RoomInfoState = RoomInfoStateLoading | RoomInfoStateError | RoomInfoStateSuccess;
162
+ declare type UserAsyncResult<T> = AsyncResultWithDataField<T, "user">;
163
+ declare type UserAsyncSuccess<T> = Resolve<UserAsyncResult<T> & {
164
+ readonly isLoading: false;
165
+ readonly error?: undefined;
166
+ }>;
167
+ declare type RoomInfoAsyncResult = AsyncResultWithDataField<DRI, "info">;
168
+ declare type RoomInfoAsyncSuccess = Resolve<RoomInfoAsyncResult & {
169
+ readonly isLoading: false;
170
+ readonly error?: undefined;
171
+ }>;
194
172
  declare type CreateThreadOptions<M extends BaseMetadata> = Resolve<{
195
173
  body: CommentBody;
196
174
  } & PartialUnless<M, {
@@ -239,11 +217,6 @@ declare type InboxNotificationsStateLoading = {
239
217
  inboxNotifications?: never;
240
218
  error?: never;
241
219
  };
242
- declare type InboxNotificationsStateResolved = {
243
- isLoading: false;
244
- inboxNotifications: InboxNotificationData[];
245
- error?: Error;
246
- };
247
220
  declare type InboxNotificationsStateSuccess = {
248
221
  isLoading: false;
249
222
  inboxNotifications: InboxNotificationData[];
@@ -254,7 +227,7 @@ declare type InboxNotificationsStateError = {
254
227
  inboxNotifications?: never;
255
228
  error: Error;
256
229
  };
257
- declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateResolved | InboxNotificationsStateError;
230
+ declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateSuccess | InboxNotificationsStateError;
258
231
  declare type UnreadInboxNotificationsCountStateLoading = {
259
232
  isLoading: true;
260
233
  count?: never;
@@ -364,14 +337,14 @@ declare type SharedContextBundle<U extends BaseUserMeta> = {
364
337
  * @example
365
338
  * const { user, error, isLoading } = useUser("user-id");
366
339
  */
367
- useUser(userId: string): UserState<U["info"]>;
340
+ useUser(userId: string): UserAsyncResult<U["info"]>;
368
341
  /**
369
342
  * Returns room info from a given room ID.
370
343
  *
371
344
  * @example
372
345
  * const { info, error, isLoading } = useRoomInfo("room-id");
373
346
  */
374
- useRoomInfo(roomId: string): RoomInfoState;
347
+ useRoomInfo(roomId: string): RoomInfoAsyncResult;
375
348
  };
376
349
  suspense: {
377
350
  /**
@@ -384,14 +357,14 @@ declare type SharedContextBundle<U extends BaseUserMeta> = {
384
357
  * @example
385
358
  * const { user } = useUser("user-id");
386
359
  */
387
- useUser(userId: string): UserStateSuccess<U["info"]>;
360
+ useUser(userId: string): UserAsyncSuccess<U["info"]>;
388
361
  /**
389
362
  * Returns room info from a given room ID.
390
363
  *
391
364
  * @example
392
365
  * const { info } = useRoomInfo("room-id");
393
366
  */
394
- useRoomInfo(roomId: string): RoomInfoStateSuccess;
367
+ useRoomInfo(roomId: string): RoomInfoAsyncSuccess;
395
368
  };
396
369
  };
397
370
  /**
@@ -980,7 +953,7 @@ declare type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
980
953
  */
981
954
  LiveblocksProvider(props: PropsWithChildren): JSX.Element;
982
955
  /**
983
- * Returns a function that marks an inbox notification as read.
956
+ * Returns a function that marks an inbox notification as read for the current user.
984
957
  *
985
958
  * @example
986
959
  * const markInboxNotificationAsRead = useMarkInboxNotificationAsRead();
@@ -988,13 +961,29 @@ declare type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
988
961
  */
989
962
  useMarkInboxNotificationAsRead(): (inboxNotificationId: string) => void;
990
963
  /**
991
- * Returns a function that marks all inbox notifications as read.
964
+ * Returns a function that marks all of the current user's inbox notifications as read.
992
965
  *
993
966
  * @example
994
967
  * const markAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead();
995
968
  * markAllInboxNotificationsAsRead();
996
969
  */
997
970
  useMarkAllInboxNotificationsAsRead(): () => void;
971
+ /**
972
+ * Returns a function that deletes an inbox notification for the current user.
973
+ *
974
+ * @example
975
+ * const deleteInboxNotification = useDeleteInboxNotification();
976
+ * deleteInboxNotification("in_xxx");
977
+ */
978
+ useDeleteInboxNotification(): (inboxNotificationId: string) => void;
979
+ /**
980
+ * Returns a function that deletes all of the current user's inbox notifications.
981
+ *
982
+ * @example
983
+ * const deleteAllInboxNotifications = useDeleteAllInboxNotifications();
984
+ * deleteAllInboxNotifications();
985
+ */
986
+ useDeleteAllInboxNotifications(): () => void;
998
987
  /**
999
988
  * Returns the thread associated with a `"thread"` inbox notification.
1000
989
  *
@@ -1055,7 +1044,7 @@ declare const ClientContext: React__default.Context<OpaqueClient | null>;
1055
1044
  /**
1056
1045
  * Obtains a reference to the current Liveblocks client.
1057
1046
  */
1058
- declare function useClient<U extends BaseUserMeta>(): Client$1<U>;
1047
+ declare function useClient<U extends BaseUserMeta>(): Client$1<U, BaseMetadata$1>;
1059
1048
  /**
1060
1049
  * Sets up a client for connecting to Liveblocks, and is the recommended way to do
1061
1050
  * this for React apps. You must define either `authEndpoint` or `publicApiKey`.
@@ -1086,7 +1075,7 @@ declare function useInboxNotifications(): InboxNotificationsState;
1086
1075
  */
1087
1076
  declare function useInboxNotificationsSuspense(): InboxNotificationsStateSuccess;
1088
1077
  /**
1089
- * Returns a function that marks all inbox notifications as read.
1078
+ * Returns a function that marks all of the current user's inbox notifications as read.
1090
1079
  *
1091
1080
  * @example
1092
1081
  * const markAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead();
@@ -1094,13 +1083,29 @@ declare function useInboxNotificationsSuspense(): InboxNotificationsStateSuccess
1094
1083
  */
1095
1084
  declare function useMarkAllInboxNotificationsAsRead(): () => void;
1096
1085
  /**
1097
- * Returns a function that marks an inbox notification as read.
1086
+ * Returns a function that marks an inbox notification as read for the current user.
1098
1087
  *
1099
1088
  * @example
1100
1089
  * const markInboxNotificationAsRead = useMarkInboxNotificationAsRead();
1101
1090
  * markInboxNotificationAsRead("in_xxx");
1102
1091
  */
1103
1092
  declare function useMarkInboxNotificationAsRead(): (inboxNotificationId: string) => void;
1093
+ /**
1094
+ * Returns a function that deletes all of the current user's inbox notifications.
1095
+ *
1096
+ * @example
1097
+ * const deleteAllInboxNotifications = useDeleteAllInboxNotifications();
1098
+ * deleteAllInboxNotifications();
1099
+ */
1100
+ declare function useDeleteAllInboxNotifications(): () => void;
1101
+ /**
1102
+ * Returns a function that deletes an inbox notification for the current user.
1103
+ *
1104
+ * @example
1105
+ * const deleteInboxNotification = useDeleteInboxNotification();
1106
+ * deleteInboxNotification("in_xxx");
1107
+ */
1108
+ declare function useDeleteInboxNotification(): (inboxNotificationId: string) => void;
1104
1109
  /**
1105
1110
  * Returns the number of unread inbox notifications for the current user.
1106
1111
  *
@@ -1121,14 +1126,14 @@ declare function useUnreadInboxNotificationsCountSuspense(): UnreadInboxNotifica
1121
1126
  * @example
1122
1127
  * const { info, error, isLoading } = useRoomInfo("room-id");
1123
1128
  */
1124
- declare function useRoomInfo(roomId: string): RoomInfoState;
1129
+ declare function useRoomInfo(roomId: string): RoomInfoAsyncResult;
1125
1130
  /**
1126
1131
  * Returns room info from a given room ID.
1127
1132
  *
1128
1133
  * @example
1129
1134
  * const { info } = useRoomInfo("room-id");
1130
1135
  */
1131
- declare function useRoomInfoSuspense(roomId: string): RoomInfoStateSuccess;
1136
+ declare function useRoomInfoSuspense(roomId: string): RoomInfoAsyncSuccess;
1132
1137
  declare type TypedBundle$1 = LiveblocksContextBundle<DU, DM>;
1133
1138
  /**
1134
1139
  * Returns the thread associated with a `"thread"` inbox notification.
@@ -1805,4 +1810,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
1805
1810
  */
1806
1811
  declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
1807
1812
 
1808
- export { useStorageStatus as $, _useMutation as A, _useMyPresence as B, ClientSideSuspense as C, _useOthersListener as D, useRedo as E, useRemoveReaction as F, _useRoom as G, useRoomNotificationSettings as H, useStatus as I, _useStorageRoot as J, useThreadSubscription as K, LiveblocksProvider as L, type MutationContext as M, useUndo as N, _useUpdateMyPresence as O, useUpdateRoomNotificationSettings as P, useCommentsErrorListener as Q, RoomContext as R, CreateThreadError as S, _useOther as T, type UseThreadsOptions as U, _useOthers as V, useOthersConnectionIds as W, _useOthersMapped as X, _useSelf as Y, _useStorage as Z, _useInboxNotificationThread as _, type UseStorageStatusOptions as a, _useThreads as a0, useInboxNotifications as a1, useRoomInfo as a2, useUnreadInboxNotificationsCount as a3, _useUser as a4, _useOtherSuspense as a5, _useOthersSuspense as a6, useOthersConnectionIdsSuspense as a7, _useOthersMappedSuspense as a8, _useSelfSuspense as a9, _useStorageSuspense as aa, useStorageStatusSuspense as ab, _useThreadsSuspense as ac, useInboxNotificationsSuspense as ad, useRoomInfoSuspense as ae, useUnreadInboxNotificationsCountSuspense as af, _useUserSuspense as ag, ClientContext as b, createLiveblocksContext as c, useMarkAllInboxNotificationsAsRead as d, useMarkInboxNotificationAsRead as e, createRoomContext as f, _RoomProvider as g, _useAddReaction as h, useBatch as i, _useBroadcastEvent as j, useCanRedo as k, useCanUndo as l, useCreateComment as m, _useCreateThread as n, useDeleteComment as o, _useDeleteThread as p, useEditComment as q, _useEditThreadMetadata as r, useMarkThreadAsResolved as s, useMarkThreadAsUnresolved as t, useClient as u, useErrorListener as v, _useEventListener as w, useHistory as x, useLostConnectionListener as y, useMarkThreadAsRead as z };
1813
+ export { _useSelf as $, useLostConnectionListener as A, useMarkThreadAsRead as B, ClientSideSuspense as C, _useMutation as D, _useMyPresence as E, _useOthersListener as F, useRedo as G, useRemoveReaction as H, _useRoom as I, useRoomNotificationSettings as J, useStatus as K, LiveblocksProvider as L, type MutationContext as M, _useStorageRoot as N, useThreadSubscription as O, useUndo as P, _useUpdateMyPresence as Q, RoomContext as R, useUpdateRoomNotificationSettings as S, useCommentsErrorListener as T, type UseThreadsOptions as U, CreateThreadError as V, _useOther as W, _useOthers as X, useOthersConnectionIds as Y, _useOthersMapped as Z, _useInboxNotificationThread as _, type UseStorageStatusOptions as a, _useStorage as a0, useStorageStatus as a1, _useThreads as a2, useInboxNotifications as a3, useRoomInfo as a4, useUnreadInboxNotificationsCount as a5, _useUser as a6, _useOtherSuspense as a7, _useOthersSuspense as a8, useOthersConnectionIdsSuspense as a9, _useOthersMappedSuspense as aa, _useSelfSuspense as ab, _useStorageSuspense as ac, useStorageStatusSuspense as ad, _useThreadsSuspense as ae, useInboxNotificationsSuspense as af, useRoomInfoSuspense as ag, useUnreadInboxNotificationsCountSuspense as ah, _useUserSuspense as ai, 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, g as RoomProvider, a as UseStorageStatusOptions, U as UseThreadsOptions, h as useAddReaction, i as useBatch, j as useBroadcastEvent, k as useCanRedo, l as useCanUndo, u as useClient, m as useCreateComment, n as useCreateThread, o as useDeleteComment, p as useDeleteThread, q as useEditComment, r as useEditThreadMetadata, v as useErrorListener, w as useEventListener, x as useHistory, _ as useInboxNotificationThread, ad as useInboxNotifications, y as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, z as useMarkThreadAsRead, s as useMarkThreadAsResolved, t as useMarkThreadAsUnresolved, A as useMutation, B as useMyPresence, a5 as useOther, a6 as useOthers, a7 as useOthersConnectionIds, D as useOthersListener, a8 as useOthersMapped, E as useRedo, F as useRemoveReaction, G as useRoom, ae as useRoomInfo, H as useRoomNotificationSettings, a9 as useSelf, I as useStatus, aa as useStorage, J as useStorageRoot, ab as useStorageStatus, K as useThreadSubscription, ac as useThreads, N as useUndo, af as useUnreadInboxNotificationsCount, O as useUpdateMyPresence, P as useUpdateRoomNotificationSettings, ag as useUser } from './suspense-Wplc32v5.mjs';
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, _ as useInboxNotificationThread, af as useInboxNotifications, A as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, B as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, D as useMutation, E as useMyPresence, a7 as useOther, a8 as useOthers, a9 as useOthersConnectionIds, F as useOthersListener, aa as useOthersMapped, G as useRedo, H as useRemoveReaction, I as useRoom, ag as useRoomInfo, J as useRoomNotificationSettings, ab as useSelf, K as useStatus, ac as useStorage, N as useStorageRoot, ad as useStorageStatus, O as useThreadSubscription, ae as useThreads, P as useUndo, ah as useUnreadInboxNotificationsCount, Q as useUpdateMyPresence, S as useUpdateRoomNotificationSettings, ai as useUser } from './suspense-HhfQZzDE.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, g as RoomProvider, a as UseStorageStatusOptions, U as UseThreadsOptions, h as useAddReaction, i as useBatch, j as useBroadcastEvent, k as useCanRedo, l as useCanUndo, u as useClient, m as useCreateComment, n as useCreateThread, o as useDeleteComment, p as useDeleteThread, q as useEditComment, r as useEditThreadMetadata, v as useErrorListener, w as useEventListener, x as useHistory, _ as useInboxNotificationThread, ad as useInboxNotifications, y as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, z as useMarkThreadAsRead, s as useMarkThreadAsResolved, t as useMarkThreadAsUnresolved, A as useMutation, B as useMyPresence, a5 as useOther, a6 as useOthers, a7 as useOthersConnectionIds, D as useOthersListener, a8 as useOthersMapped, E as useRedo, F as useRemoveReaction, G as useRoom, ae as useRoomInfo, H as useRoomNotificationSettings, a9 as useSelf, I as useStatus, aa as useStorage, J as useStorageRoot, ab as useStorageStatus, K as useThreadSubscription, ac as useThreads, N as useUndo, af as useUnreadInboxNotificationsCount, O as useUpdateMyPresence, P as useUpdateRoomNotificationSettings, ag as useUser } from './suspense-Wplc32v5.js';
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, _ as useInboxNotificationThread, af as useInboxNotifications, A as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, B as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, D as useMutation, E as useMyPresence, a7 as useOther, a8 as useOthers, a9 as useOthersConnectionIds, F as useOthersListener, aa as useOthersMapped, G as useRedo, H as useRemoveReaction, I as useRoom, ag as useRoomInfo, J as useRoomNotificationSettings, ab as useSelf, K as useStatus, ac as useStorage, N as useStorageRoot, ad as useStorageStatus, O as useThreadSubscription, ae as useThreads, P as useUndo, ah as useUnreadInboxNotificationsCount, Q as useUpdateMyPresence, S as useUpdateRoomNotificationSettings, ai as useUser } from './suspense-HhfQZzDE.js';
2
2
  export { Json, JsonObject, shallow } from '@liveblocks/client';
3
3
  import 'react';
4
4
  import '@liveblocks/core';
package/dist/suspense.js CHANGED
@@ -54,12 +54,16 @@
54
54
 
55
55
 
56
56
 
57
- var _chunkOZDSOIGVjs = require('./chunk-OZDSOIGV.js');
57
+
58
+
59
+ var _chunkL4QUDD4Ijs = require('./chunk-L4QUDD4I.js');
58
60
 
59
61
  // src/suspense.ts
60
62
  var _core = require('@liveblocks/core');
61
63
  var _client = require('@liveblocks/client');
62
- _core.detectDupes.call(void 0, _chunkOZDSOIGVjs.PKG_NAME, _chunkOZDSOIGVjs.PKG_VERSION, _chunkOZDSOIGVjs.PKG_FORMAT);
64
+ _core.detectDupes.call(void 0, _chunkL4QUDD4Ijs.PKG_NAME, _chunkL4QUDD4Ijs.PKG_VERSION, _chunkL4QUDD4Ijs.PKG_FORMAT);
65
+
66
+
63
67
 
64
68
 
65
69
 
@@ -114,5 +118,5 @@ _core.detectDupes.call(void 0, _chunkOZDSOIGVjs.PKG_NAME, _chunkOZDSOIGVjs.PKG_V
114
118
 
115
119
 
116
120
 
117
- exports.ClientContext = _chunkOZDSOIGVjs.ClientContext; exports.ClientSideSuspense = _chunkOZDSOIGVjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkOZDSOIGVjs.LiveblocksProvider; exports.RoomContext = _chunkOZDSOIGVjs.RoomContext; exports.RoomProvider = _chunkOZDSOIGVjs._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkOZDSOIGVjs._useAddReaction; exports.useBatch = _chunkOZDSOIGVjs.useBatch; exports.useBroadcastEvent = _chunkOZDSOIGVjs._useBroadcastEvent; exports.useCanRedo = _chunkOZDSOIGVjs.useCanRedo; exports.useCanUndo = _chunkOZDSOIGVjs.useCanUndo; exports.useClient = _chunkOZDSOIGVjs.useClient; exports.useCreateComment = _chunkOZDSOIGVjs.useCreateComment; exports.useCreateThread = _chunkOZDSOIGVjs._useCreateThread; exports.useDeleteComment = _chunkOZDSOIGVjs.useDeleteComment; exports.useDeleteThread = _chunkOZDSOIGVjs._useDeleteThread; exports.useEditComment = _chunkOZDSOIGVjs.useEditComment; exports.useEditThreadMetadata = _chunkOZDSOIGVjs._useEditThreadMetadata; exports.useErrorListener = _chunkOZDSOIGVjs.useErrorListener; exports.useEventListener = _chunkOZDSOIGVjs._useEventListener; exports.useHistory = _chunkOZDSOIGVjs.useHistory; exports.useInboxNotificationThread = _chunkOZDSOIGVjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkOZDSOIGVjs.useInboxNotificationsSuspense; exports.useLostConnectionListener = _chunkOZDSOIGVjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkOZDSOIGVjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkOZDSOIGVjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkOZDSOIGVjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkOZDSOIGVjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkOZDSOIGVjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkOZDSOIGVjs._useMutation; exports.useMyPresence = _chunkOZDSOIGVjs._useMyPresence; exports.useOther = _chunkOZDSOIGVjs._useOtherSuspense; exports.useOthers = _chunkOZDSOIGVjs._useOthersSuspense; exports.useOthersConnectionIds = _chunkOZDSOIGVjs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkOZDSOIGVjs._useOthersListener; exports.useOthersMapped = _chunkOZDSOIGVjs._useOthersMappedSuspense; exports.useRedo = _chunkOZDSOIGVjs.useRedo; exports.useRemoveReaction = _chunkOZDSOIGVjs.useRemoveReaction; exports.useRoom = _chunkOZDSOIGVjs._useRoom; exports.useRoomInfo = _chunkOZDSOIGVjs.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkOZDSOIGVjs.useRoomNotificationSettings; exports.useSelf = _chunkOZDSOIGVjs._useSelfSuspense; exports.useStatus = _chunkOZDSOIGVjs.useStatus; exports.useStorage = _chunkOZDSOIGVjs._useStorageSuspense; exports.useStorageRoot = _chunkOZDSOIGVjs._useStorageRoot; exports.useStorageStatus = _chunkOZDSOIGVjs.useStorageStatusSuspense; exports.useThreadSubscription = _chunkOZDSOIGVjs.useThreadSubscription; exports.useThreads = _chunkOZDSOIGVjs._useThreadsSuspense; exports.useUndo = _chunkOZDSOIGVjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkOZDSOIGVjs.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkOZDSOIGVjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkOZDSOIGVjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkOZDSOIGVjs._useUserSuspense;
121
+ exports.ClientContext = _chunkL4QUDD4Ijs.ClientContext; exports.ClientSideSuspense = _chunkL4QUDD4Ijs.ClientSideSuspense; exports.LiveblocksProvider = _chunkL4QUDD4Ijs.LiveblocksProvider; exports.RoomContext = _chunkL4QUDD4Ijs.RoomContext; exports.RoomProvider = _chunkL4QUDD4Ijs._RoomProvider; exports.shallow = _client.shallow; exports.useAddReaction = _chunkL4QUDD4Ijs._useAddReaction; exports.useBatch = _chunkL4QUDD4Ijs.useBatch; exports.useBroadcastEvent = _chunkL4QUDD4Ijs._useBroadcastEvent; exports.useCanRedo = _chunkL4QUDD4Ijs.useCanRedo; exports.useCanUndo = _chunkL4QUDD4Ijs.useCanUndo; exports.useClient = _chunkL4QUDD4Ijs.useClient; exports.useCreateComment = _chunkL4QUDD4Ijs.useCreateComment; exports.useCreateThread = _chunkL4QUDD4Ijs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkL4QUDD4Ijs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkL4QUDD4Ijs.useDeleteComment; exports.useDeleteInboxNotification = _chunkL4QUDD4Ijs.useDeleteInboxNotification; exports.useDeleteThread = _chunkL4QUDD4Ijs._useDeleteThread; exports.useEditComment = _chunkL4QUDD4Ijs.useEditComment; exports.useEditThreadMetadata = _chunkL4QUDD4Ijs._useEditThreadMetadata; exports.useErrorListener = _chunkL4QUDD4Ijs.useErrorListener; exports.useEventListener = _chunkL4QUDD4Ijs._useEventListener; exports.useHistory = _chunkL4QUDD4Ijs.useHistory; exports.useInboxNotificationThread = _chunkL4QUDD4Ijs._useInboxNotificationThread; exports.useInboxNotifications = _chunkL4QUDD4Ijs.useInboxNotificationsSuspense; exports.useLostConnectionListener = _chunkL4QUDD4Ijs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkL4QUDD4Ijs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkL4QUDD4Ijs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkL4QUDD4Ijs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkL4QUDD4Ijs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkL4QUDD4Ijs.useMarkThreadAsUnresolved; exports.useMutation = _chunkL4QUDD4Ijs._useMutation; exports.useMyPresence = _chunkL4QUDD4Ijs._useMyPresence; exports.useOther = _chunkL4QUDD4Ijs._useOtherSuspense; exports.useOthers = _chunkL4QUDD4Ijs._useOthersSuspense; exports.useOthersConnectionIds = _chunkL4QUDD4Ijs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkL4QUDD4Ijs._useOthersListener; exports.useOthersMapped = _chunkL4QUDD4Ijs._useOthersMappedSuspense; exports.useRedo = _chunkL4QUDD4Ijs.useRedo; exports.useRemoveReaction = _chunkL4QUDD4Ijs.useRemoveReaction; exports.useRoom = _chunkL4QUDD4Ijs._useRoom; exports.useRoomInfo = _chunkL4QUDD4Ijs.useRoomInfoSuspense; exports.useRoomNotificationSettings = _chunkL4QUDD4Ijs.useRoomNotificationSettings; exports.useSelf = _chunkL4QUDD4Ijs._useSelfSuspense; exports.useStatus = _chunkL4QUDD4Ijs.useStatus; exports.useStorage = _chunkL4QUDD4Ijs._useStorageSuspense; exports.useStorageRoot = _chunkL4QUDD4Ijs._useStorageRoot; exports.useStorageStatus = _chunkL4QUDD4Ijs.useStorageStatusSuspense; exports.useThreadSubscription = _chunkL4QUDD4Ijs.useThreadSubscription; exports.useThreads = _chunkL4QUDD4Ijs._useThreadsSuspense; exports.useUndo = _chunkL4QUDD4Ijs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkL4QUDD4Ijs.useUnreadInboxNotificationsCountSuspense; exports.useUpdateMyPresence = _chunkL4QUDD4Ijs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkL4QUDD4Ijs.useUpdateRoomNotificationSettings; exports.useUser = _chunkL4QUDD4Ijs._useUserSuspense;
118
122
  //# sourceMappingURL=suspense.js.map
@@ -1 +1 @@
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} 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 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} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n} from \"./liveblocks\";\n"]}
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 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} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n} from \"./liveblocks\";\n"]}
package/dist/suspense.mjs CHANGED
@@ -32,7 +32,9 @@ import {
32
32
  useCanUndo,
33
33
  useClient,
34
34
  useCreateComment,
35
+ useDeleteAllInboxNotifications,
35
36
  useDeleteComment,
37
+ useDeleteInboxNotification,
36
38
  useEditComment,
37
39
  useErrorListener,
38
40
  useHistory,
@@ -54,7 +56,7 @@ import {
54
56
  useUndo,
55
57
  useUnreadInboxNotificationsCountSuspense,
56
58
  useUpdateRoomNotificationSettings
57
- } from "./chunk-AKAI4UTH.mjs";
59
+ } from "./chunk-2ITOEAYK.mjs";
58
60
 
59
61
  // src/suspense.ts
60
62
  import { detectDupes } from "@liveblocks/core";
@@ -75,7 +77,9 @@ export {
75
77
  useClient,
76
78
  useCreateComment,
77
79
  _useCreateThread as useCreateThread,
80
+ useDeleteAllInboxNotifications,
78
81
  useDeleteComment,
82
+ useDeleteInboxNotification,
79
83
  _useDeleteThread as useDeleteThread,
80
84
  useEditComment,
81
85
  _useEditThreadMetadata as useEditThreadMetadata,
@@ -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} 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 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} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}
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 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} from \"./room\";\nexport {\n useInboxNotificationsSuspense as useInboxNotifications,\n useRoomInfoSuspense as useRoomInfo,\n useUnreadInboxNotificationsCountSuspense as useUnreadInboxNotificationsCount,\n useUserSuspense as useUser,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}