@liveblocks/react 2.7.0-versions2 → 2.7.1
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-YGRZXVI6.js → chunk-TNEGW2UU.js} +1413 -886
- package/dist/chunk-TNEGW2UU.js.map +1 -0
- package/dist/{chunk-HS6BFH3A.mjs → chunk-XK5NTOJJ.mjs} +1526 -999
- package/dist/chunk-XK5NTOJJ.mjs.map +1 -0
- package/dist/index.d.mts +2 -10
- package/dist/index.d.ts +2 -10
- 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-2UL0jBvg.d.mts → suspense-ZevLSpFZ.d.mts} +324 -31
- package/dist/{suspense-2UL0jBvg.d.ts → suspense-ZevLSpFZ.d.ts} +324 -31
- 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 +6 -4
- package/dist/chunk-HS6BFH3A.mjs.map +0 -1
- package/dist/chunk-YGRZXVI6.js.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, a as UseStorageStatusOptions, c as createLiveblocksContext, h as createRoomContext, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, 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, V as useHistoryVersionData, a5 as useHistoryVersions, _ as useInboxNotificationThread, a6 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, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a8 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, a9 as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, aa as useUser, a7 as useUserThreads_experimental } from './suspense-2UL0jBvg.mjs';
|
|
1
|
+
export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ab as getUmbrellaStoreForClient, ac as selectThreads, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, 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, V as useHistoryVersionData, a5 as useHistoryVersions, _ as useInboxNotificationThread, a6 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, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a8 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, a9 as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, aa as useUser, a7 as useUserThreads_experimental } from './suspense-ZevLSpFZ.mjs';
|
|
3
2
|
export { Json, JsonObject, shallow } from '@liveblocks/client';
|
|
4
|
-
import { BaseMetadata, CacheState, ThreadData } from '@liveblocks/core';
|
|
5
3
|
import 'react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @private Do not rely on this internal API.
|
|
9
|
-
*/
|
|
10
|
-
declare function selectedThreads<M extends BaseMetadata>(roomId: string, state: CacheState<M>, options: UseThreadsOptions<M>): ThreadData<M>[];
|
|
11
|
-
|
|
12
|
-
export { UseThreadsOptions, selectedThreads };
|
|
4
|
+
import '@liveblocks/core';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, a as UseStorageStatusOptions, c as createLiveblocksContext, h as createRoomContext, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, 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, V as useHistoryVersionData, a5 as useHistoryVersions, _ as useInboxNotificationThread, a6 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, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a8 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, a9 as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, aa as useUser, a7 as useUserThreads_experimental } from './suspense-2UL0jBvg.js';
|
|
1
|
+
export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ab as getUmbrellaStoreForClient, ac as selectThreads, j as useAddReaction, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, 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, V as useHistoryVersionData, a5 as useHistoryVersions, _ as useInboxNotificationThread, a6 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, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a8 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, a9 as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, aa as useUser, a7 as useUserThreads_experimental } from './suspense-ZevLSpFZ.js';
|
|
3
2
|
export { Json, JsonObject, shallow } from '@liveblocks/client';
|
|
4
|
-
import { BaseMetadata, CacheState, ThreadData } from '@liveblocks/core';
|
|
5
3
|
import 'react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @private Do not rely on this internal API.
|
|
9
|
-
*/
|
|
10
|
-
declare function selectedThreads<M extends BaseMetadata>(roomId: string, state: CacheState<M>, options: UseThreadsOptions<M>): ThreadData<M>[];
|
|
11
|
-
|
|
12
|
-
export { UseThreadsOptions, selectedThreads };
|
|
4
|
+
import '@liveblocks/core';
|
package/dist/index.js
CHANGED
|
@@ -65,12 +65,14 @@
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
var _chunkTNEGW2UUjs = require('./chunk-TNEGW2UU.js');
|
|
69
70
|
|
|
70
71
|
// src/index.ts
|
|
71
72
|
var _core = require('@liveblocks/core');
|
|
72
73
|
var _client = require('@liveblocks/client');
|
|
73
|
-
_core.detectDupes.call(void 0,
|
|
74
|
+
_core.detectDupes.call(void 0, _chunkTNEGW2UUjs.PKG_NAME, _chunkTNEGW2UUjs.PKG_VERSION, _chunkTNEGW2UUjs.PKG_FORMAT);
|
|
75
|
+
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
|
|
@@ -136,5 +138,5 @@ _core.detectDupes.call(void 0, _chunkYGRZXVI6js.PKG_NAME, _chunkYGRZXVI6js.PKG_V
|
|
|
136
138
|
|
|
137
139
|
|
|
138
140
|
|
|
139
|
-
exports.ClientContext =
|
|
141
|
+
exports.ClientContext = _chunkTNEGW2UUjs.ClientContext; exports.ClientSideSuspense = _chunkTNEGW2UUjs.ClientSideSuspense; exports.CreateThreadError = _chunkTNEGW2UUjs.CreateThreadError; exports.LiveblocksProvider = _chunkTNEGW2UUjs.LiveblocksProvider; exports.RoomContext = _chunkTNEGW2UUjs.RoomContext; exports.RoomProvider = _chunkTNEGW2UUjs._RoomProvider; exports.createLiveblocksContext = _chunkTNEGW2UUjs.createLiveblocksContext; exports.createRoomContext = _chunkTNEGW2UUjs.createRoomContext; exports.getUmbrellaStoreForClient = _chunkTNEGW2UUjs.getUmbrellaStoreForClient; exports.selectThreads = _chunkTNEGW2UUjs.selectThreads; exports.shallow = _client.shallow; exports.useAddReaction = _chunkTNEGW2UUjs._useAddReaction; exports.useBatch = _chunkTNEGW2UUjs.useBatch; exports.useBroadcastEvent = _chunkTNEGW2UUjs._useBroadcastEvent; exports.useCanRedo = _chunkTNEGW2UUjs.useCanRedo; exports.useCanUndo = _chunkTNEGW2UUjs.useCanUndo; exports.useClient = _chunkTNEGW2UUjs.useClient; exports.useCommentsErrorListener = _chunkTNEGW2UUjs.useCommentsErrorListener; exports.useCreateComment = _chunkTNEGW2UUjs.useCreateComment; exports.useCreateThread = _chunkTNEGW2UUjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkTNEGW2UUjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkTNEGW2UUjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkTNEGW2UUjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkTNEGW2UUjs._useDeleteThread; exports.useEditComment = _chunkTNEGW2UUjs.useEditComment; exports.useEditThreadMetadata = _chunkTNEGW2UUjs._useEditThreadMetadata; exports.useErrorListener = _chunkTNEGW2UUjs.useErrorListener; exports.useEventListener = _chunkTNEGW2UUjs._useEventListener; exports.useHistory = _chunkTNEGW2UUjs.useHistory; exports.useHistoryVersionData = _chunkTNEGW2UUjs.useHistoryVersionData; exports.useHistoryVersions = _chunkTNEGW2UUjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkTNEGW2UUjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkTNEGW2UUjs.useInboxNotifications; exports.useIsInsideRoom = _chunkTNEGW2UUjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkTNEGW2UUjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkTNEGW2UUjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkTNEGW2UUjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkTNEGW2UUjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkTNEGW2UUjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkTNEGW2UUjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkTNEGW2UUjs._useMutation; exports.useMyPresence = _chunkTNEGW2UUjs._useMyPresence; exports.useOther = _chunkTNEGW2UUjs._useOther; exports.useOthers = _chunkTNEGW2UUjs._useOthers; exports.useOthersConnectionIds = _chunkTNEGW2UUjs.useOthersConnectionIds; exports.useOthersListener = _chunkTNEGW2UUjs._useOthersListener; exports.useOthersMapped = _chunkTNEGW2UUjs._useOthersMapped; exports.useRedo = _chunkTNEGW2UUjs.useRedo; exports.useRemoveReaction = _chunkTNEGW2UUjs.useRemoveReaction; exports.useRoom = _chunkTNEGW2UUjs._useRoom; exports.useRoomInfo = _chunkTNEGW2UUjs.useRoomInfo; exports.useRoomNotificationSettings = _chunkTNEGW2UUjs.useRoomNotificationSettings; exports.useSelf = _chunkTNEGW2UUjs._useSelf; exports.useStatus = _chunkTNEGW2UUjs.useStatus; exports.useStorage = _chunkTNEGW2UUjs._useStorage; exports.useStorageRoot = _chunkTNEGW2UUjs._useStorageRoot; exports.useStorageStatus = _chunkTNEGW2UUjs.useStorageStatus; exports.useThreadSubscription = _chunkTNEGW2UUjs.useThreadSubscription; exports.useThreads = _chunkTNEGW2UUjs._useThreads; exports.useUndo = _chunkTNEGW2UUjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkTNEGW2UUjs.useUnreadInboxNotificationsCount; exports.useUpdateMyPresence = _chunkTNEGW2UUjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkTNEGW2UUjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkTNEGW2UUjs._useUser; exports.useUserThreads_experimental = _chunkTNEGW2UUjs._useUserThreads_experimental;
|
|
140
142
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.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 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 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 useHistoryVersionData,\n} from \"./room\";\n\nexport { useCommentsErrorListener, CreateThreadError } from \"./room\";\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 useHistoryVersions,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n} from \"./liveblocks\";\n\n// Private APIs (for use in react-lexical only)\nexport { getUmbrellaStoreForClient, selectThreads } from \"./liveblocks\";\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,8 @@ import {
|
|
|
33
33
|
_useUserThreads_experimental,
|
|
34
34
|
createLiveblocksContext,
|
|
35
35
|
createRoomContext,
|
|
36
|
-
|
|
36
|
+
getUmbrellaStoreForClient,
|
|
37
|
+
selectThreads,
|
|
37
38
|
useBatch,
|
|
38
39
|
useCanRedo,
|
|
39
40
|
useCanUndo,
|
|
@@ -65,7 +66,7 @@ import {
|
|
|
65
66
|
useUndo,
|
|
66
67
|
useUnreadInboxNotificationsCount,
|
|
67
68
|
useUpdateRoomNotificationSettings
|
|
68
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-XK5NTOJJ.mjs";
|
|
69
70
|
|
|
70
71
|
// src/index.ts
|
|
71
72
|
import { detectDupes } from "@liveblocks/core";
|
|
@@ -80,7 +81,8 @@ export {
|
|
|
80
81
|
_RoomProvider as RoomProvider,
|
|
81
82
|
createLiveblocksContext,
|
|
82
83
|
createRoomContext,
|
|
83
|
-
|
|
84
|
+
getUmbrellaStoreForClient,
|
|
85
|
+
selectThreads,
|
|
84
86
|
shallow,
|
|
85
87
|
_useAddReaction as useAddReaction,
|
|
86
88
|
useBatch,
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 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 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 useHistoryVersionData,\n} from \"./room\";\n\nexport { useCommentsErrorListener, CreateThreadError } from \"./room\";\
|
|
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 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 useHistoryVersionData,\n} from \"./room\";\n\nexport { useCommentsErrorListener, CreateThreadError } from \"./room\";\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 useHistoryVersions,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n} from \"./liveblocks\";\n\n// Private APIs (for use in react-lexical only)\nexport { getUmbrellaStoreForClient, selectThreads } from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAc5B,SAAS,eAAe;AAXxB,YAAY,UAAU,aAAa,UAAU;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
3
|
import React__default, { ReactNode, PropsWithChildren } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { BaseMetadata, CommentBody, Patchable, QueryMetadata, StorageStatus, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, OpaqueClient, DU, ClientOptions, DM, OpaqueRoom, RoomNotificationSettings as RoomNotificationSettings$1, DP, DS, DE } from '@liveblocks/core';
|
|
4
|
+
import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResultWithDataField, DRI, Resolve, InboxNotificationData, ToImmutable, ThreadData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, 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;
|
|
@@ -132,23 +132,31 @@ declare type UseStorageStatusOptions = {
|
|
|
132
132
|
smooth?: boolean;
|
|
133
133
|
};
|
|
134
134
|
declare type StorageStatusSuccess = Exclude<StorageStatus, "not-loaded" | "loading">;
|
|
135
|
+
declare type ThreadsQuery<M extends BaseMetadata> = {
|
|
136
|
+
/**
|
|
137
|
+
* Whether to only return threads marked as resolved or unresolved. If not provided,
|
|
138
|
+
* all threads will be returned.
|
|
139
|
+
*/
|
|
140
|
+
resolved?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The metadata to filter the threads by. If provided, only threads with metadata that matches
|
|
143
|
+
* the provided metadata will be returned. If not provided, all threads will be returned.
|
|
144
|
+
*/
|
|
145
|
+
metadata?: Partial<QueryMetadata<M>>;
|
|
146
|
+
};
|
|
147
|
+
declare type UseUserThreadsOptions<M extends BaseMetadata> = {
|
|
148
|
+
/**
|
|
149
|
+
* The query (including metadata) to filter the threads by. If provided, only threads
|
|
150
|
+
* that match the query will be returned. If not provided, all threads will be returned.
|
|
151
|
+
*/
|
|
152
|
+
query?: ThreadsQuery<M>;
|
|
153
|
+
};
|
|
135
154
|
declare type UseThreadsOptions<M extends BaseMetadata> = {
|
|
136
155
|
/**
|
|
137
156
|
* The query (including metadata) to filter the threads by. If provided, only threads
|
|
138
157
|
* that match the query will be returned. If not provided, all threads will be returned.
|
|
139
158
|
*/
|
|
140
|
-
query?:
|
|
141
|
-
/**
|
|
142
|
-
* Whether to only return threads marked as resolved or unresolved. If not provided,
|
|
143
|
-
* all threads will be returned.
|
|
144
|
-
*/
|
|
145
|
-
resolved?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* The metadata to filter the threads by. If provided, only threads with metadata that matches
|
|
148
|
-
* the provided metadata will be returned. If not provided, all threads will be returned.
|
|
149
|
-
*/
|
|
150
|
-
metadata?: Partial<QueryMetadata<M>>;
|
|
151
|
-
};
|
|
159
|
+
query?: ThreadsQuery<M>;
|
|
152
160
|
/**
|
|
153
161
|
* Whether to scroll to a comment on load based on the URL hash. Defaults to `true`.
|
|
154
162
|
*
|
|
@@ -158,7 +166,6 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
|
|
|
158
166
|
*/
|
|
159
167
|
scrollOnLoad?: boolean;
|
|
160
168
|
};
|
|
161
|
-
|
|
162
169
|
declare type UserAsyncResult<T> = AsyncResultWithDataField<T, "user">;
|
|
163
170
|
declare type UserAsyncSuccess<T> = Resolve<UserAsyncResult<T> & {
|
|
164
171
|
readonly isLoading: false;
|
|
@@ -915,14 +922,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
915
922
|
(settings: Partial<RoomNotificationSettings>) => void
|
|
916
923
|
];
|
|
917
924
|
/**
|
|
918
|
-
* Returns a history of versions of the current room.
|
|
925
|
+
* (Private beta) Returns a history of versions of the current room.
|
|
919
926
|
*
|
|
920
927
|
* @example
|
|
921
928
|
* const { versions, error, isLoading } = useHistoryVersions();
|
|
922
929
|
*/
|
|
923
930
|
useHistoryVersions(): HistoryVersionsState;
|
|
924
931
|
/**
|
|
925
|
-
* Returns the data of a specific version of the current room.
|
|
932
|
+
* (Private beta) Returns the data of a specific version of the current room.
|
|
926
933
|
*
|
|
927
934
|
* @example
|
|
928
935
|
* const { data, error, isLoading } = useHistoryVersionData(version.id);
|
|
@@ -991,7 +998,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
|
|
|
991
998
|
*/
|
|
992
999
|
useThreads(options?: UseThreadsOptions<M>): ThreadsStateSuccess<M>;
|
|
993
1000
|
/**
|
|
994
|
-
* Returns a history of versions of the current room.
|
|
1001
|
+
* (Private beta) Returns a history of versions of the current room.
|
|
995
1002
|
*
|
|
996
1003
|
* @example
|
|
997
1004
|
* const { versions } = useHistoryVersions();
|
|
@@ -1087,9 +1094,9 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
|
|
|
1087
1094
|
* @experimental
|
|
1088
1095
|
*
|
|
1089
1096
|
* This hook is experimental and could be removed or changed at any time!
|
|
1090
|
-
* Do not use unless
|
|
1097
|
+
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1091
1098
|
*/
|
|
1092
|
-
useUserThreads_experimental(): ThreadsState<M>;
|
|
1099
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsState<M>;
|
|
1093
1100
|
suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
|
|
1094
1101
|
/**
|
|
1095
1102
|
* Returns the inbox notifications for the current user.
|
|
@@ -1109,12 +1116,259 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
|
|
|
1109
1116
|
* @experimental
|
|
1110
1117
|
*
|
|
1111
1118
|
* This hook is experimental and could be removed or changed at any time!
|
|
1112
|
-
* Do not use unless
|
|
1119
|
+
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1113
1120
|
*/
|
|
1114
|
-
useUserThreads_experimental(): ThreadsStateSuccess<M>;
|
|
1121
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsStateSuccess<M>;
|
|
1115
1122
|
}>;
|
|
1116
1123
|
}>;
|
|
1117
1124
|
|
|
1125
|
+
declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
|
|
1126
|
+
declare type CreateThreadOptimisticUpdate<M extends BaseMetadata> = {
|
|
1127
|
+
type: "create-thread";
|
|
1128
|
+
id: string;
|
|
1129
|
+
roomId: string;
|
|
1130
|
+
thread: ThreadData<M>;
|
|
1131
|
+
};
|
|
1132
|
+
declare type DeleteThreadOptimisticUpdate = {
|
|
1133
|
+
type: "delete-thread";
|
|
1134
|
+
id: string;
|
|
1135
|
+
roomId: string;
|
|
1136
|
+
threadId: string;
|
|
1137
|
+
deletedAt: Date;
|
|
1138
|
+
};
|
|
1139
|
+
declare type EditThreadMetadataOptimisticUpdate<M extends BaseMetadata> = {
|
|
1140
|
+
type: "edit-thread-metadata";
|
|
1141
|
+
id: string;
|
|
1142
|
+
threadId: string;
|
|
1143
|
+
metadata: Resolve<Patchable<M>>;
|
|
1144
|
+
updatedAt: Date;
|
|
1145
|
+
};
|
|
1146
|
+
declare type MarkThreadAsResolvedOptimisticUpdate = {
|
|
1147
|
+
type: "mark-thread-as-resolved";
|
|
1148
|
+
id: string;
|
|
1149
|
+
threadId: string;
|
|
1150
|
+
updatedAt: Date;
|
|
1151
|
+
};
|
|
1152
|
+
declare type MarkThreadAsUnresolvedOptimisticUpdate = {
|
|
1153
|
+
type: "mark-thread-as-unresolved";
|
|
1154
|
+
id: string;
|
|
1155
|
+
threadId: string;
|
|
1156
|
+
updatedAt: Date;
|
|
1157
|
+
};
|
|
1158
|
+
declare type CreateCommentOptimisticUpdate = {
|
|
1159
|
+
type: "create-comment";
|
|
1160
|
+
id: string;
|
|
1161
|
+
comment: CommentData;
|
|
1162
|
+
};
|
|
1163
|
+
declare type EditCommentOptimisticUpdate = {
|
|
1164
|
+
type: "edit-comment";
|
|
1165
|
+
id: string;
|
|
1166
|
+
comment: CommentData;
|
|
1167
|
+
};
|
|
1168
|
+
declare type DeleteCommentOptimisticUpdate = {
|
|
1169
|
+
type: "delete-comment";
|
|
1170
|
+
id: string;
|
|
1171
|
+
roomId: string;
|
|
1172
|
+
threadId: string;
|
|
1173
|
+
deletedAt: Date;
|
|
1174
|
+
commentId: string;
|
|
1175
|
+
};
|
|
1176
|
+
declare type AddReactionOptimisticUpdate = {
|
|
1177
|
+
type: "add-reaction";
|
|
1178
|
+
id: string;
|
|
1179
|
+
threadId: string;
|
|
1180
|
+
commentId: string;
|
|
1181
|
+
reaction: CommentUserReaction;
|
|
1182
|
+
};
|
|
1183
|
+
declare type RemoveReactionOptimisticUpdate = {
|
|
1184
|
+
type: "remove-reaction";
|
|
1185
|
+
id: string;
|
|
1186
|
+
threadId: string;
|
|
1187
|
+
commentId: string;
|
|
1188
|
+
emoji: string;
|
|
1189
|
+
userId: string;
|
|
1190
|
+
removedAt: Date;
|
|
1191
|
+
};
|
|
1192
|
+
declare type MarkInboxNotificationAsReadOptimisticUpdate = {
|
|
1193
|
+
type: "mark-inbox-notification-as-read";
|
|
1194
|
+
id: string;
|
|
1195
|
+
inboxNotificationId: string;
|
|
1196
|
+
readAt: Date;
|
|
1197
|
+
};
|
|
1198
|
+
declare type MarkAllInboxNotificationsAsReadOptimisticUpdate = {
|
|
1199
|
+
type: "mark-all-inbox-notifications-as-read";
|
|
1200
|
+
id: string;
|
|
1201
|
+
readAt: Date;
|
|
1202
|
+
};
|
|
1203
|
+
declare type DeleteInboxNotificationOptimisticUpdate = {
|
|
1204
|
+
type: "delete-inbox-notification";
|
|
1205
|
+
id: string;
|
|
1206
|
+
inboxNotificationId: string;
|
|
1207
|
+
deletedAt: Date;
|
|
1208
|
+
};
|
|
1209
|
+
declare type DeleteAllInboxNotificationsOptimisticUpdate = {
|
|
1210
|
+
type: "delete-all-inbox-notifications";
|
|
1211
|
+
id: string;
|
|
1212
|
+
deletedAt: Date;
|
|
1213
|
+
};
|
|
1214
|
+
declare type UpdateNotificationSettingsOptimisticUpdate = {
|
|
1215
|
+
type: "update-notification-settings";
|
|
1216
|
+
id: string;
|
|
1217
|
+
roomId: string;
|
|
1218
|
+
settings: Partial<RoomNotificationSettings$1>;
|
|
1219
|
+
};
|
|
1220
|
+
declare type QueryState = AsyncResult<undefined>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Externally observable state of the store, which will have:
|
|
1223
|
+
* - Optimistic updates applied
|
|
1224
|
+
* - All deleted threads removed from the threads list
|
|
1225
|
+
*/
|
|
1226
|
+
declare type UmbrellaStoreState<M extends BaseMetadata> = {
|
|
1227
|
+
/**
|
|
1228
|
+
* Keep track of loading and error status of all the queries made by the client.
|
|
1229
|
+
* e.g. 'room-abc-{"color":"red"}' - ok
|
|
1230
|
+
* e.g. 'room-abc-{}' - loading
|
|
1231
|
+
*/
|
|
1232
|
+
queries: Record<string, QueryState>;
|
|
1233
|
+
/**
|
|
1234
|
+
* All threads in a sorted array, optimistic updates applied, without deleted
|
|
1235
|
+
* threads.
|
|
1236
|
+
*/
|
|
1237
|
+
threads: ThreadData<M>[];
|
|
1238
|
+
/**
|
|
1239
|
+
* All threads in a map, keyed by thread ID, with all optimistic updates
|
|
1240
|
+
* applied. Deleted threads are still in this mapping, and will have
|
|
1241
|
+
* a deletedAt field if so.
|
|
1242
|
+
*/
|
|
1243
|
+
threadsById: Record<string, ThreadDataWithDeleteInfo<M>>;
|
|
1244
|
+
/**
|
|
1245
|
+
* All inbox notifications in a sorted array, optimistic updates applied.
|
|
1246
|
+
*/
|
|
1247
|
+
inboxNotifications: InboxNotificationData[];
|
|
1248
|
+
/**
|
|
1249
|
+
* Inbox notifications by ID.
|
|
1250
|
+
* e.g. `in_${string}`
|
|
1251
|
+
*/
|
|
1252
|
+
inboxNotificationsById: Record<string, InboxNotificationData>;
|
|
1253
|
+
/**
|
|
1254
|
+
* Notification settings by room ID.
|
|
1255
|
+
* e.g. { 'room-abc': { threads: "all" },
|
|
1256
|
+
* 'room-def': { threads: "replies_and_mentions" },
|
|
1257
|
+
* 'room-xyz': { threads: "none" },
|
|
1258
|
+
* }
|
|
1259
|
+
*/
|
|
1260
|
+
notificationSettingsByRoomId: Record<string, RoomNotificationSettings$1>;
|
|
1261
|
+
/**
|
|
1262
|
+
* Versions by roomId
|
|
1263
|
+
* e.g. { 'room-abc': {versions: "all versions"}}
|
|
1264
|
+
*/
|
|
1265
|
+
versionsByRoomId: Record<string, HistoryVersion[]>;
|
|
1266
|
+
};
|
|
1267
|
+
declare class UmbrellaStore<M extends BaseMetadata> {
|
|
1268
|
+
private _store;
|
|
1269
|
+
private _prevState;
|
|
1270
|
+
private _stateCached;
|
|
1271
|
+
constructor();
|
|
1272
|
+
private get;
|
|
1273
|
+
getThreads(): UmbrellaStoreState<M>;
|
|
1274
|
+
getInboxNotifications(): UmbrellaStoreState<M>;
|
|
1275
|
+
getNotificationSettings(): UmbrellaStoreState<M>;
|
|
1276
|
+
getVersions(): UmbrellaStoreState<M>;
|
|
1277
|
+
/**
|
|
1278
|
+
* @private Only used by the E2E test suite.
|
|
1279
|
+
*/
|
|
1280
|
+
_hasOptimisticUpdates(): boolean;
|
|
1281
|
+
private subscribe;
|
|
1282
|
+
/**
|
|
1283
|
+
* @private Only used by the E2E test suite.
|
|
1284
|
+
*/
|
|
1285
|
+
_subscribeOptimisticUpdates(callback: () => void): () => void;
|
|
1286
|
+
subscribeThreads(callback: () => void): () => void;
|
|
1287
|
+
subscribeInboxNotifications(callback: () => void): () => void;
|
|
1288
|
+
subscribeNotificationSettings(callback: () => void): () => void;
|
|
1289
|
+
subscribeVersions(callback: () => void): () => void;
|
|
1290
|
+
private updateThreadsCache;
|
|
1291
|
+
private updateInboxNotificationsCache;
|
|
1292
|
+
private setNotificationSettings;
|
|
1293
|
+
private setVersions;
|
|
1294
|
+
private setQueryState;
|
|
1295
|
+
private updateOptimisticUpdatesCache;
|
|
1296
|
+
/**
|
|
1297
|
+
* Updates an existing inbox notification with a new value, replacing the
|
|
1298
|
+
* corresponding optimistic update.
|
|
1299
|
+
*
|
|
1300
|
+
* This will not update anything if the inbox notification ID isn't found in
|
|
1301
|
+
* the cache.
|
|
1302
|
+
*/
|
|
1303
|
+
updateInboxNotification(inboxNotificationId: string, optimisticUpdateId: string, callback: (notification: Readonly<InboxNotificationData>) => Readonly<InboxNotificationData>): void;
|
|
1304
|
+
/**
|
|
1305
|
+
* Updates *all* inbox notifications by running a mapper function over all of
|
|
1306
|
+
* them, replacing the corresponding optimistic update.
|
|
1307
|
+
*/
|
|
1308
|
+
updateAllInboxNotifications(optimisticUpdateId: string, mapFn: (notification: Readonly<InboxNotificationData>) => Readonly<InboxNotificationData>): void;
|
|
1309
|
+
/**
|
|
1310
|
+
* Deletes an existing inbox notification, replacing the corresponding
|
|
1311
|
+
* optimistic update.
|
|
1312
|
+
*/
|
|
1313
|
+
deleteInboxNotification(inboxNotificationId: string, optimisticUpdateId: string): void;
|
|
1314
|
+
/**
|
|
1315
|
+
* Deletes *all* inbox notifications, replacing the corresponding optimistic
|
|
1316
|
+
* update.
|
|
1317
|
+
*/
|
|
1318
|
+
deleteAllInboxNotifications(optimisticUpdateId: string): void;
|
|
1319
|
+
/**
|
|
1320
|
+
* Creates an new thread, replacing the corresponding optimistic update.
|
|
1321
|
+
*/
|
|
1322
|
+
createThread(optimisticUpdateId: string, thread: Readonly<ThreadDataWithDeleteInfo<M>>): void;
|
|
1323
|
+
/**
|
|
1324
|
+
* Updates an existing thread with a new value, replacing the corresponding
|
|
1325
|
+
* optimistic update.
|
|
1326
|
+
*
|
|
1327
|
+
* This will not update anything if:
|
|
1328
|
+
* - The thread ID isn't found in the cache; or
|
|
1329
|
+
* - The thread ID was already deleted from the cache; or
|
|
1330
|
+
* - The thread ID in the cache was updated more recently than the optimistic
|
|
1331
|
+
* update's timestamp (if given)
|
|
1332
|
+
*/
|
|
1333
|
+
private updateThread;
|
|
1334
|
+
patchThread(threadId: string, optimisticUpdateId: string | null, patch: {
|
|
1335
|
+
metadata?: M;
|
|
1336
|
+
resolved?: boolean;
|
|
1337
|
+
}, updatedAt: Date): void;
|
|
1338
|
+
addReaction(threadId: string, optimisticUpdateId: string | null, commentId: string, reaction: CommentUserReaction, createdAt: Date): void;
|
|
1339
|
+
removeReaction(threadId: string, optimisticUpdateId: string | null, commentId: string, emoji: string, userId: string, removedAt: Date): void;
|
|
1340
|
+
/**
|
|
1341
|
+
* Soft-deletes an existing thread by setting its `deletedAt` value,
|
|
1342
|
+
* replacing the corresponding optimistic update.
|
|
1343
|
+
*
|
|
1344
|
+
* This will not update anything if:
|
|
1345
|
+
* - The thread ID isn't found in the cache; or
|
|
1346
|
+
* - The thread ID was already deleted from the cache
|
|
1347
|
+
*/
|
|
1348
|
+
deleteThread(threadId: string, optimisticUpdateId: string | null): void;
|
|
1349
|
+
/**
|
|
1350
|
+
* Creates an existing comment and ensures the associated notification is
|
|
1351
|
+
* updated correctly, replacing the corresponding optimistic update.
|
|
1352
|
+
*/
|
|
1353
|
+
createComment(newComment: CommentData, optimisticUpdateId: string): void;
|
|
1354
|
+
editComment(threadId: string, optimisticUpdateId: string, editedComment: CommentData): void;
|
|
1355
|
+
deleteComment(threadId: string, optimisticUpdateId: string, commentId: string, deletedAt: Date): void;
|
|
1356
|
+
updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
|
|
1357
|
+
updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
|
|
1358
|
+
/**
|
|
1359
|
+
* Updates existing notification setting for a room with a new value,
|
|
1360
|
+
* replacing the corresponding optimistic update.
|
|
1361
|
+
*/
|
|
1362
|
+
updateRoomInboxNotificationSettings2(roomId: string, optimisticUpdateId: string, settings: Readonly<RoomNotificationSettings$1>): void;
|
|
1363
|
+
updateRoomInboxNotificationSettings(roomId: string, settings: RoomNotificationSettings$1, queryKey: string): void;
|
|
1364
|
+
updateRoomVersions(roomId: string, versions: HistoryVersion[], queryKey?: string): void;
|
|
1365
|
+
addOptimisticUpdate(optimisticUpdate: DistributiveOmit<OptimisticUpdate<M>, "id">): string;
|
|
1366
|
+
removeOptimisticUpdate(optimisticUpdateId: string): void;
|
|
1367
|
+
setQueryLoading(queryKey: string): void;
|
|
1368
|
+
private setQueryOK;
|
|
1369
|
+
setQueryError(queryKey: string, error: Error): void;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1118
1372
|
/**
|
|
1119
1373
|
* Raw access to the React context where the LiveblocksProvider stores the
|
|
1120
1374
|
* current client. Exposed for advanced use cases only.
|
|
@@ -1122,6 +1376,20 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
|
|
|
1122
1376
|
* @private This is a private/advanced API. Do not rely on it.
|
|
1123
1377
|
*/
|
|
1124
1378
|
declare const ClientContext: React__default.Context<OpaqueClient | null>;
|
|
1379
|
+
/**
|
|
1380
|
+
* @private Do not rely on this internal API.
|
|
1381
|
+
*/
|
|
1382
|
+
declare function selectThreads<M extends BaseMetadata$1>(state: UmbrellaStoreState<M>, options: {
|
|
1383
|
+
roomId: string | null;
|
|
1384
|
+
query?: ThreadsQuery<M>;
|
|
1385
|
+
orderBy: "age" | "last-update";
|
|
1386
|
+
}): ThreadData$1<M>[];
|
|
1387
|
+
/**
|
|
1388
|
+
* Gets or creates a unique Umbrella store for each unique client instance.
|
|
1389
|
+
*
|
|
1390
|
+
* @private
|
|
1391
|
+
*/
|
|
1392
|
+
declare function getUmbrellaStoreForClient<M extends BaseMetadata$1>(client: OpaqueClient): UmbrellaStore<M>;
|
|
1125
1393
|
/**
|
|
1126
1394
|
* Obtains a reference to the current Liveblocks client.
|
|
1127
1395
|
*/
|
|
@@ -1250,14 +1518,32 @@ declare const _useUserSuspense: TypedBundle$1["suspense"]["useUser"];
|
|
|
1250
1518
|
* @experimental
|
|
1251
1519
|
*
|
|
1252
1520
|
* This hook is experimental and could be removed or changed at any time!
|
|
1253
|
-
* Do not use unless
|
|
1521
|
+
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1522
|
+
*
|
|
1523
|
+
* WARNING:
|
|
1524
|
+
* Please note that this hook currently returns all threads by most recently
|
|
1525
|
+
* updated threads first. This is inconsistent with the default sort order of
|
|
1526
|
+
* the useThreads() hook, which returns them in chronological order (by
|
|
1527
|
+
* creation date). In the final version, we will make these hooks behave
|
|
1528
|
+
* consistently, so expect that in the final version, you'll have to explicitly
|
|
1529
|
+
* specify the sort order to be by most recently updated first somehow.
|
|
1530
|
+
* The final API for that is still TBD.
|
|
1254
1531
|
*/
|
|
1255
1532
|
declare const _useUserThreads_experimental: TypedBundle$1["useUserThreads_experimental"];
|
|
1256
1533
|
/**
|
|
1257
1534
|
* @experimental
|
|
1258
1535
|
*
|
|
1259
1536
|
* This hook is experimental and could be removed or changed at any time!
|
|
1260
|
-
* Do not use unless
|
|
1537
|
+
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1538
|
+
*
|
|
1539
|
+
* WARNING:
|
|
1540
|
+
* Please note that this hook currently returns all threads by most recently
|
|
1541
|
+
* updated threads first. This is inconsistent with the default sort order of
|
|
1542
|
+
* the useThreads() hook, which returns them in chronological order (by
|
|
1543
|
+
* creation date). In the final version, we will make these hooks behave
|
|
1544
|
+
* consistently, so expect that in the final version, you'll have to explicitly
|
|
1545
|
+
* specify the sort order to be by most recently updated first somehow.
|
|
1546
|
+
* The final API for that is still TBD.
|
|
1261
1547
|
*/
|
|
1262
1548
|
declare const _useUserThreadsSuspense_experimental: TypedBundle$1["suspense"]["useUserThreads_experimental"];
|
|
1263
1549
|
|
|
@@ -1268,6 +1554,7 @@ declare const _useUserThreadsSuspense_experimental: TypedBundle$1["suspense"]["u
|
|
|
1268
1554
|
* @private This is a private/advanced API. Do not rely on it.
|
|
1269
1555
|
*/
|
|
1270
1556
|
declare const RoomContext: React$1.Context<OpaqueRoom | null>;
|
|
1557
|
+
|
|
1271
1558
|
/**
|
|
1272
1559
|
* Returns the current connection status for the Room, and triggers
|
|
1273
1560
|
* a re-render whenever it changes. Can be used to render a status badge.
|
|
@@ -1278,7 +1565,7 @@ declare function useStatus(): Status;
|
|
|
1278
1565
|
* a re-render whenever it changes. Can be used to render a "Saving..."
|
|
1279
1566
|
* indicator.
|
|
1280
1567
|
*/
|
|
1281
|
-
declare function useStorageStatus(options?: UseStorageStatusOptions): StorageStatus;
|
|
1568
|
+
declare function useStorageStatus(options?: UseStorageStatusOptions): StorageStatus$1;
|
|
1282
1569
|
/**
|
|
1283
1570
|
* @deprecated It's recommended to use `useMutation` for writing to Storage,
|
|
1284
1571
|
* which will automatically batch all mutations.
|
|
@@ -1368,7 +1655,7 @@ declare function useCommentsErrorListener<M extends BaseMetadata$1>(callback: (e
|
|
|
1368
1655
|
* const createComment = useCreateComment();
|
|
1369
1656
|
* createComment({ threadId: "th_xxx", body: {} });
|
|
1370
1657
|
*/
|
|
1371
|
-
declare function useCreateComment(): (options: CreateCommentOptions) => CommentData;
|
|
1658
|
+
declare function useCreateComment(): (options: CreateCommentOptions) => CommentData$1;
|
|
1372
1659
|
/**
|
|
1373
1660
|
* Returns a function that edits a comment's body.
|
|
1374
1661
|
*
|
|
@@ -1434,8 +1721,14 @@ declare function useThreadSubscription(threadId: string): ThreadSubscription;
|
|
|
1434
1721
|
*/
|
|
1435
1722
|
declare function useRoomNotificationSettings(): [
|
|
1436
1723
|
RoomNotificationSettingsState,
|
|
1437
|
-
(settings: Partial<RoomNotificationSettings
|
|
1724
|
+
(settings: Partial<RoomNotificationSettings>) => void
|
|
1438
1725
|
];
|
|
1726
|
+
/**
|
|
1727
|
+
* Returns the version data bianry for a given version
|
|
1728
|
+
*
|
|
1729
|
+
* @example
|
|
1730
|
+
* const {data} = useHistoryVersionData(versionId);
|
|
1731
|
+
*/
|
|
1439
1732
|
declare function useHistoryVersionData(versionId: string): HistoryVersionDataState;
|
|
1440
1733
|
/**
|
|
1441
1734
|
* Returns a function that updates the user's notification settings
|
|
@@ -1445,7 +1738,7 @@ declare function useHistoryVersionData(versionId: string): HistoryVersionDataSta
|
|
|
1445
1738
|
* const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
|
|
1446
1739
|
* updateRoomNotificationSettings({ threads: "all" });
|
|
1447
1740
|
*/
|
|
1448
|
-
declare function useUpdateRoomNotificationSettings(): (settings: Partial<RoomNotificationSettings
|
|
1741
|
+
declare function useUpdateRoomNotificationSettings(): (settings: Partial<RoomNotificationSettings>) => void;
|
|
1449
1742
|
/**
|
|
1450
1743
|
* Returns an array of connection IDs. This matches the values you'll get by
|
|
1451
1744
|
* using the `useOthers()` hook.
|
|
@@ -1687,14 +1980,14 @@ declare const _useThreads: TypedBundle["useThreads"];
|
|
|
1687
1980
|
*/
|
|
1688
1981
|
declare const _useThreadsSuspense: TypedBundle["suspense"]["useThreads"];
|
|
1689
1982
|
/**
|
|
1690
|
-
* Returns a history of versions of the current room.
|
|
1983
|
+
* (Private beta) Returns a history of versions of the current room.
|
|
1691
1984
|
*
|
|
1692
1985
|
* @example
|
|
1693
1986
|
* const { versions, error, isLoading } = useHistoryVersions();
|
|
1694
1987
|
*/
|
|
1695
1988
|
declare const _useHistoryVersions: TypedBundle["useHistoryVersions"];
|
|
1696
1989
|
/**
|
|
1697
|
-
* Returns a history of versions of the current room.
|
|
1990
|
+
* (Private beta) Returns a history of versions of the current room.
|
|
1698
1991
|
*
|
|
1699
1992
|
* @example
|
|
1700
1993
|
* const { versions } = useHistoryVersions();
|
|
@@ -1927,4 +2220,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
|
|
|
1927
2220
|
*/
|
|
1928
2221
|
declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
|
|
1929
2222
|
|
|
1930
|
-
export { useOthersConnectionIds as $, _useIsInsideRoom as A, useLostConnectionListener as B, ClientSideSuspense as C, useMarkThreadAsRead as D, _useMutation as E, _useMyPresence as F, _useOthersListener as G, useRedo as H, useRemoveReaction as I, _useRoom as J, useRoomNotificationSettings as K, LiveblocksProvider as L, type MutationContext as M, useStatus as N, _useStorageRoot as O, useThreadSubscription as P, useUndo as Q, RoomContext as R, _useUpdateMyPresence as S, useUpdateRoomNotificationSettings as T, type
|
|
2223
|
+
export { useOthersConnectionIds as $, _useIsInsideRoom as A, useLostConnectionListener as B, ClientSideSuspense as C, useMarkThreadAsRead as D, _useMutation as E, _useMyPresence as F, _useOthersListener as G, useRedo as H, useRemoveReaction as I, _useRoom as J, useRoomNotificationSettings as K, LiveblocksProvider as L, type MutationContext as M, useStatus as N, _useStorageRoot as O, useThreadSubscription as P, useUndo as Q, RoomContext as R, _useUpdateMyPresence as S, useUpdateRoomNotificationSettings as T, type UseStorageStatusOptions as U, useHistoryVersionData as V, useCommentsErrorListener as W, CreateThreadError as X, _useOther as Y, _useOthers as Z, _useInboxNotificationThread as _, type UseThreadsOptions as a, _useOthersMapped as a0, _useSelf as a1, _useStorage as a2, useStorageStatus as a3, _useThreads as a4, _useHistoryVersions as a5, useInboxNotifications as a6, _useUserThreads_experimental as a7, useRoomInfo as a8, useUnreadInboxNotificationsCount as a9, _useUser as aa, getUmbrellaStoreForClient as ab, selectThreads as ac, _useOtherSuspense as ad, _useOthersSuspense as ae, useOthersConnectionIdsSuspense as af, _useOthersMappedSuspense as ag, _useSelfSuspense as ah, _useStorageSuspense as ai, useStorageStatusSuspense as aj, _useThreadsSuspense as ak, _useHistoryVersionsSuspense as al, useInboxNotificationsSuspense as am, useRoomInfoSuspense as an, useUnreadInboxNotificationsCountSuspense as ao, _useUserSuspense as ap, _useUserThreadsSuspense_experimental as aq, ClientContext as b, createLiveblocksContext as c, useMarkAllInboxNotificationsAsRead as d, useMarkInboxNotificationAsRead as e, useDeleteAllInboxNotifications as f, useDeleteInboxNotification as g, createRoomContext as h, _RoomProvider as i, _useAddReaction as j, useBatch as k, _useBroadcastEvent as l, useCanRedo as m, useCanUndo as n, useCreateComment as o, _useCreateThread as p, useDeleteComment as q, _useDeleteThread as r, useEditComment as s, _useEditThreadMetadata as t, useClient as u, useMarkThreadAsResolved as v, useMarkThreadAsUnresolved as w, useErrorListener as x, _useEventListener as y, useHistory as z };
|