@liveblocks/react 3.8.0-tiptap1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_private.cjs +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-OKYUUXNY.js → chunk-2R44HQCN.js} +180 -39
- package/dist/chunk-2R44HQCN.js.map +1 -0
- package/dist/{chunk-ZU7C6DJE.cjs → chunk-6MZ5AS3V.cjs} +2 -2
- package/dist/{chunk-ZU7C6DJE.cjs.map → chunk-6MZ5AS3V.cjs.map} +1 -1
- package/dist/{chunk-RCYYHORY.js → chunk-C65QJNZB.js} +2 -2
- package/dist/{chunk-4GCS3365.cjs → chunk-IQBSX6NS.cjs} +204 -63
- package/dist/chunk-IQBSX6NS.cjs.map +1 -0
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{room-BtcL74U0.d.cts → room-C97RX2dB.d.cts} +102 -2
- package/dist/{room-BtcL74U0.d.ts → room-C97RX2dB.d.ts} +102 -2
- package/dist/suspense.cjs +6 -4
- package/dist/suspense.cjs.map +1 -1
- package/dist/suspense.d.cts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +4 -2
- package/dist/suspense.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-4GCS3365.cjs.map +0 -1
- package/dist/chunk-OKYUUXNY.js.map +0 -1
- /package/dist/{chunk-RCYYHORY.js.map → chunk-C65QJNZB.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk6MZ5AS3Vcjs = require('./chunk-6MZ5AS3V.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -77,12 +77,14 @@ var _chunkZU7C6DJEcjs = require('./chunk-ZU7C6DJE.cjs');
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
|
|
81
|
+
var _chunkIQBSX6NScjs = require('./chunk-IQBSX6NS.cjs');
|
|
81
82
|
|
|
82
83
|
// src/index.ts
|
|
83
84
|
var _core = require('@liveblocks/core');
|
|
84
85
|
var _client = require('@liveblocks/client');
|
|
85
|
-
_core.detectDupes.call(void 0,
|
|
86
|
+
_core.detectDupes.call(void 0, _chunk6MZ5AS3Vcjs.PKG_NAME, _chunk6MZ5AS3Vcjs.PKG_VERSION, _chunk6MZ5AS3Vcjs.PKG_FORMAT);
|
|
87
|
+
|
|
86
88
|
|
|
87
89
|
|
|
88
90
|
|
|
@@ -159,5 +161,5 @@ _core.detectDupes.call(void 0, _chunkZU7C6DJEcjs.PKG_NAME, _chunkZU7C6DJEcjs.PKG
|
|
|
159
161
|
|
|
160
162
|
|
|
161
163
|
|
|
162
|
-
exports.ClientContext =
|
|
164
|
+
exports.ClientContext = _chunkIQBSX6NScjs.ClientContext; exports.ClientSideSuspense = _chunk6MZ5AS3Vcjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkIQBSX6NScjs.LiveblocksProvider; exports.RegisterAiKnowledge = _chunkIQBSX6NScjs.RegisterAiKnowledge; exports.RegisterAiTool = _chunkIQBSX6NScjs.RegisterAiTool; exports.RoomContext = _chunkIQBSX6NScjs.RoomContext; exports.RoomProvider = _chunkIQBSX6NScjs._RoomProvider; exports.createLiveblocksContext = _chunkIQBSX6NScjs.createLiveblocksContext; exports.createRoomContext = _chunkIQBSX6NScjs.createRoomContext; exports.isNotificationChannelEnabled = _client.isNotificationChannelEnabled; exports.shallow = _client.shallow; exports.useAddReaction = _chunkIQBSX6NScjs._useAddReaction; exports.useAiChat = _chunkIQBSX6NScjs._useAiChat; exports.useAiChatMessages = _chunkIQBSX6NScjs._useAiChatMessages; exports.useAiChatStatus = _chunkIQBSX6NScjs.useAiChatStatus; exports.useAiChats = _chunkIQBSX6NScjs._useAiChats; exports.useAttachmentUrl = _chunkIQBSX6NScjs.useAttachmentUrl; exports.useBroadcastEvent = _chunkIQBSX6NScjs._useBroadcastEvent; exports.useCanRedo = _chunkIQBSX6NScjs.useCanRedo; exports.useCanUndo = _chunkIQBSX6NScjs.useCanUndo; exports.useClient = _chunkIQBSX6NScjs.useClient; exports.useCreateAiChat = _chunkIQBSX6NScjs.useCreateAiChat; exports.useCreateComment = _chunkIQBSX6NScjs.useCreateComment; exports.useCreateThread = _chunkIQBSX6NScjs._useCreateThread; exports.useDeleteAiChat = _chunkIQBSX6NScjs.useDeleteAiChat; exports.useDeleteAllInboxNotifications = _chunkIQBSX6NScjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkIQBSX6NScjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkIQBSX6NScjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkIQBSX6NScjs._useDeleteThread; exports.useEditComment = _chunkIQBSX6NScjs.useEditComment; exports.useEditThreadMetadata = _chunkIQBSX6NScjs._useEditThreadMetadata; exports.useErrorListener = _chunkIQBSX6NScjs.useErrorListener; exports.useEventListener = _chunkIQBSX6NScjs._useEventListener; exports.useGroupInfo = _chunkIQBSX6NScjs.useGroupInfo; exports.useHistory = _chunkIQBSX6NScjs.useHistory; exports.useHistoryVersionData = _chunkIQBSX6NScjs.useHistoryVersionData; exports.useHistoryVersions = _chunkIQBSX6NScjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkIQBSX6NScjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkIQBSX6NScjs.useInboxNotifications; exports.useIsInsideRoom = _chunkIQBSX6NScjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkIQBSX6NScjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkIQBSX6NScjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkIQBSX6NScjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkIQBSX6NScjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkIQBSX6NScjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkIQBSX6NScjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkIQBSX6NScjs._useMutation; exports.useMyPresence = _chunkIQBSX6NScjs._useMyPresence; exports.useNotificationSettings = _chunkIQBSX6NScjs.useNotificationSettings; exports.useOther = _chunkIQBSX6NScjs._useOther; exports.useOthers = _chunkIQBSX6NScjs._useOthers; exports.useOthersConnectionIds = _chunkIQBSX6NScjs.useOthersConnectionIds; exports.useOthersListener = _chunkIQBSX6NScjs._useOthersListener; exports.useOthersMapped = _chunkIQBSX6NScjs._useOthersMapped; exports.useRedo = _chunkIQBSX6NScjs.useRedo; exports.useRemoveReaction = _chunkIQBSX6NScjs.useRemoveReaction; exports.useRoom = _chunkIQBSX6NScjs._useRoom; exports.useRoomInfo = _chunkIQBSX6NScjs.useRoomInfo; exports.useRoomSubscriptionSettings = _chunkIQBSX6NScjs._useRoomSubscriptionSettings; exports.useSelf = _chunkIQBSX6NScjs._useSelf; exports.useSendAiMessage = _chunkIQBSX6NScjs.useSendAiMessage; exports.useStatus = _chunkIQBSX6NScjs.useStatus; exports.useStorage = _chunkIQBSX6NScjs._useStorage; exports.useStorageRoot = _chunkIQBSX6NScjs._useStorageRoot; exports.useSubscribeToThread = _chunkIQBSX6NScjs.useSubscribeToThread; exports.useSyncStatus = _chunkIQBSX6NScjs.useSyncStatus; exports.useThreadSubscription = _chunkIQBSX6NScjs.useThreadSubscription; exports.useThreads = _chunkIQBSX6NScjs._useThreads; exports.useUndo = _chunkIQBSX6NScjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkIQBSX6NScjs.useUnreadInboxNotificationsCount; exports.useUnsubscribeFromThread = _chunkIQBSX6NScjs.useUnsubscribeFromThread; exports.useUpdateMyPresence = _chunkIQBSX6NScjs._useUpdateMyPresence; exports.useUpdateNotificationSettings = _chunkIQBSX6NScjs.useUpdateNotificationSettings; exports.useUpdateRoomSubscriptionSettings = _chunkIQBSX6NScjs.useUpdateRoomSubscriptionSettings; exports.useUser = _chunkIQBSX6NScjs._useUser; exports.useUserThreads_experimental = _chunkIQBSX6NScjs._useUserThreads_experimental;
|
|
163
165
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACjFA,wCAA4B;AAe5B,4CAAsD;AAZtD,+BAAA,0BAAY,EAAU,6BAAA,EAAa,4BAAU,CAAA;ADkF7C;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,u0JAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","sourcesContent":[null,"/* 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 UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} 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 useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n} from \"./liveblocks\";\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-
|
|
2
|
-
export { C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext,
|
|
1
|
+
import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-C97RX2dB.cjs';
|
|
2
|
+
export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aG as useUser, aC as useUserThreads_experimental } from './room-C97RX2dB.cjs';
|
|
3
3
|
export { Json, JsonObject, isNotificationChannelEnabled, shallow } from '@liveblocks/client';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as react from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-
|
|
2
|
-
export { C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext,
|
|
1
|
+
import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-C97RX2dB.js';
|
|
2
|
+
export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aG as useUser, aC as useUserThreads_experimental } from './room-C97RX2dB.js';
|
|
3
3
|
export { Json, JsonObject, isNotificationChannelEnabled, shallow } from '@liveblocks/client';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as react from 'react';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PKG_FORMAT,
|
|
4
4
|
PKG_NAME,
|
|
5
5
|
PKG_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C65QJNZB.js";
|
|
7
7
|
import {
|
|
8
8
|
ClientContext,
|
|
9
9
|
LiveblocksProvider,
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
_useUserThreads_experimental,
|
|
41
41
|
createLiveblocksContext,
|
|
42
42
|
createRoomContext,
|
|
43
|
+
useAiChatStatus,
|
|
43
44
|
useAttachmentUrl,
|
|
44
45
|
useCanRedo,
|
|
45
46
|
useCanUndo,
|
|
@@ -77,7 +78,7 @@ import {
|
|
|
77
78
|
useUnsubscribeFromThread,
|
|
78
79
|
useUpdateNotificationSettings,
|
|
79
80
|
useUpdateRoomSubscriptionSettings
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-2R44HQCN.js";
|
|
81
82
|
|
|
82
83
|
// src/index.ts
|
|
83
84
|
import { detectDupes } from "@liveblocks/core";
|
|
@@ -98,6 +99,7 @@ export {
|
|
|
98
99
|
_useAddReaction as useAddReaction,
|
|
99
100
|
_useAiChat as useAiChat,
|
|
100
101
|
_useAiChatMessages as useAiChatMessages,
|
|
102
|
+
useAiChatStatus,
|
|
101
103
|
_useAiChats as useAiChats,
|
|
102
104
|
useAttachmentUrl,
|
|
103
105
|
_useBroadcastEvent as useBroadcastEvent,
|
package/dist/index.js.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 UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {
|
|
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 UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} 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 useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAe5B,SAAS,SAAS,oCAAoC;AAZtD,YAAY,UAAU,aAAa,UAAU;","names":[]}
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentType, Context, PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { BaseUserMeta, Client, JsonObject, LsonObject, LiveObject, User, Json, RoomSubscriptionSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ClientOptions, ThreadData as ThreadData$1, CommentData as CommentData$1 } from '@liveblocks/client';
|
|
4
4
|
import * as _liveblocks_core from '@liveblocks/core';
|
|
5
|
-
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings,
|
|
5
|
+
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, DerivedSignal, DefaultMap, SubscriptionData, SubscriptionKey, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -53,6 +53,25 @@ type RegisterAiToolProps = {
|
|
|
53
53
|
*/
|
|
54
54
|
enabled?: boolean;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Simplified status for the requested chat.
|
|
58
|
+
* This hook offers a convenient way to update the UI while an AI chat
|
|
59
|
+
* generation is in progress.
|
|
60
|
+
*/
|
|
61
|
+
type AiChatStatus = Relax<{
|
|
62
|
+
status: "loading";
|
|
63
|
+
} | {
|
|
64
|
+
status: "idle";
|
|
65
|
+
} | {
|
|
66
|
+
status: "generating";
|
|
67
|
+
} | {
|
|
68
|
+
status: "generating";
|
|
69
|
+
partType: Exclude<AiAssistantContentPart["type"], "tool-invocation">;
|
|
70
|
+
} | {
|
|
71
|
+
status: "generating";
|
|
72
|
+
partType: "tool-invocation";
|
|
73
|
+
toolName: string;
|
|
74
|
+
}>;
|
|
56
75
|
|
|
57
76
|
type UiChatMessage = WithNavigation<AiChatMessage>;
|
|
58
77
|
type UseSyncStatusOptions = {
|
|
@@ -216,6 +235,7 @@ type AiChatAsyncSuccess = AsyncSuccess<AiChat, "chat">;
|
|
|
216
235
|
type AiChatAsyncResult = AsyncResult<AiChat, "chat">;
|
|
217
236
|
type AiChatMessagesAsyncSuccess = AsyncSuccess<readonly UiChatMessage[], "messages">;
|
|
218
237
|
type AiChatMessagesAsyncResult = AsyncResult<readonly UiChatMessage[], "messages">;
|
|
238
|
+
|
|
219
239
|
type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
|
|
220
240
|
/**
|
|
221
241
|
* The id of the room you want to connect to
|
|
@@ -1236,6 +1256,29 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1236
1256
|
* const { chat, error, isLoading } = useAiChat("my-chat");
|
|
1237
1257
|
*/
|
|
1238
1258
|
useAiChat(chatId: string): AiChatAsyncResult;
|
|
1259
|
+
/**
|
|
1260
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1261
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1262
|
+
* the latest assistant message in the chat.
|
|
1263
|
+
*
|
|
1264
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1265
|
+
*
|
|
1266
|
+
* @param chatId - The ID of the chat to monitor
|
|
1267
|
+
* @returns The current status of the AI chat
|
|
1268
|
+
*
|
|
1269
|
+
* @example
|
|
1270
|
+
* ```tsx
|
|
1271
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1272
|
+
*
|
|
1273
|
+
* function ChatStatus() {
|
|
1274
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1275
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1276
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1277
|
+
* console.log(status.toolName); // string | undefined
|
|
1278
|
+
* }
|
|
1279
|
+
* ```
|
|
1280
|
+
*/
|
|
1281
|
+
useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
|
|
1239
1282
|
suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
|
|
1240
1283
|
/**
|
|
1241
1284
|
* Returns the inbox notifications for the current user.
|
|
@@ -1289,6 +1332,29 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1289
1332
|
* const { chat, error, isLoading } = useAiChat("my-chat");
|
|
1290
1333
|
*/
|
|
1291
1334
|
useAiChat(chatId: string): AiChatAsyncSuccess;
|
|
1335
|
+
/**
|
|
1336
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1337
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1338
|
+
* the latest assistant message in the chat.
|
|
1339
|
+
*
|
|
1340
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1341
|
+
*
|
|
1342
|
+
* @param chatId - The ID of the chat to monitor
|
|
1343
|
+
* @returns The current status of the AI chat
|
|
1344
|
+
*
|
|
1345
|
+
* @example
|
|
1346
|
+
* ```tsx
|
|
1347
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1348
|
+
*
|
|
1349
|
+
* function ChatStatus() {
|
|
1350
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1351
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1352
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1353
|
+
* console.log(status.toolName); // string | undefined
|
|
1354
|
+
* }
|
|
1355
|
+
* ```
|
|
1356
|
+
*/
|
|
1357
|
+
useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
|
|
1292
1358
|
}>;
|
|
1293
1359
|
}>;
|
|
1294
1360
|
|
|
@@ -1537,6 +1603,12 @@ declare function createStore_forNotifications(): {
|
|
|
1537
1603
|
updateAssociatedNotification: (newComment: CommentData) => void;
|
|
1538
1604
|
upsert: (notification: InboxNotificationData) => void;
|
|
1539
1605
|
};
|
|
1606
|
+
declare function createStore_forUnreadNotificationsCount(): {
|
|
1607
|
+
signal: DerivedSignal<{
|
|
1608
|
+
[k: string]: number;
|
|
1609
|
+
}>;
|
|
1610
|
+
update: (queryKey: InboxNotificationsQueryKey, count: number) => void;
|
|
1611
|
+
};
|
|
1540
1612
|
declare function createStore_forSubscriptions(updates: ISignal<readonly OptimisticUpdate<BaseMetadata>[]>, threads: ReadonlyThreadDB<BaseMetadata>): {
|
|
1541
1613
|
signal: DerivedSignal<SubscriptionsByKey>;
|
|
1542
1614
|
applyDelta: (newSubscriptions: SubscriptionData[], deletedSubscriptions: SubscriptionDeleteInfo[]) => void;
|
|
@@ -1593,6 +1665,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1593
1665
|
readonly subscriptions: ReturnType<typeof createStore_forSubscriptions>;
|
|
1594
1666
|
readonly roomSubscriptionSettings: ReturnType<typeof createStore_forRoomSubscriptionSettings>;
|
|
1595
1667
|
readonly historyVersions: ReturnType<typeof createStore_forHistoryVersions>;
|
|
1668
|
+
readonly unreadNotificationsCount: ReturnType<typeof createStore_forUnreadNotificationsCount>;
|
|
1596
1669
|
readonly permissionHints: ReturnType<typeof createStore_forPermissionHints>;
|
|
1597
1670
|
readonly notificationSettings: ReturnType<typeof createStore_forNotificationSettings>;
|
|
1598
1671
|
readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<M>>;
|
|
@@ -1604,6 +1677,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1604
1677
|
readonly notifications: DerivedSignal<CleanNotifications>;
|
|
1605
1678
|
readonly threadSubscriptions: DerivedSignal<CleanThreadSubscriptions>;
|
|
1606
1679
|
readonly loadingNotifications: DefaultMap<InboxNotificationsQueryKey, LoadableResource<InboxNotificationsAsyncResult>>;
|
|
1680
|
+
readonly unreadNotificationsCount: DefaultMap<InboxNotificationsQueryKey, LoadableResource<UnreadInboxNotificationsCountAsyncResult>>;
|
|
1607
1681
|
readonly roomSubscriptionSettingsByRoomId: DefaultMap<RoomId, LoadableResource<RoomSubscriptionSettingsAsyncResult>>;
|
|
1608
1682
|
readonly versionsByRoomId: DefaultMap<RoomId, LoadableResource<HistoryVersionsAsyncResult>>;
|
|
1609
1683
|
readonly notificationSettings: LoadableResource<NotificationSettingsAsyncResult>;
|
|
@@ -1673,6 +1747,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1673
1747
|
*/
|
|
1674
1748
|
updateRoomSubscriptionSettings(roomId: string, optimisticId: string, settings: Readonly<RoomSubscriptionSettings$1>): void;
|
|
1675
1749
|
fetchNotificationsDeltaUpdate(signal: AbortSignal): Promise<void>;
|
|
1750
|
+
fetchUnreadNotificationsCount(queryKey: InboxNotificationsQueryKey, signal: AbortSignal): Promise<void>;
|
|
1676
1751
|
fetchRoomThreadsDeltaUpdate(roomId: string, signal: AbortSignal): Promise<void>;
|
|
1677
1752
|
fetchUserThreadsDeltaUpdate(signal: AbortSignal): Promise<void>;
|
|
1678
1753
|
fetchRoomVersionsDeltaUpdate(roomId: string, signal: AbortSignal): Promise<void>;
|
|
@@ -1721,6 +1796,31 @@ declare function useCreateAiChat(): {
|
|
|
1721
1796
|
* deleteAiChat("ai-chat-id");
|
|
1722
1797
|
*/
|
|
1723
1798
|
declare function useDeleteAiChat(): (chatId: string) => void;
|
|
1799
|
+
/**
|
|
1800
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1801
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1802
|
+
* the latest assistant message in the chat.
|
|
1803
|
+
*
|
|
1804
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1805
|
+
*
|
|
1806
|
+
* @param chatId - The ID of the chat to monitor
|
|
1807
|
+
* @returns The current status of the AI chat
|
|
1808
|
+
*
|
|
1809
|
+
* @example
|
|
1810
|
+
* ```tsx
|
|
1811
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1812
|
+
*
|
|
1813
|
+
* function ChatStatus() {
|
|
1814
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1815
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1816
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1817
|
+
* console.log(status.toolName); // string | undefined
|
|
1818
|
+
* }
|
|
1819
|
+
* ```
|
|
1820
|
+
*/
|
|
1821
|
+
declare function useAiChatStatus(chatId: string,
|
|
1822
|
+
/** @internal */
|
|
1823
|
+
branchId?: MessageId): AiChatStatus;
|
|
1724
1824
|
/**
|
|
1725
1825
|
* Returns a function to send a message in an AI chat.
|
|
1726
1826
|
*
|
|
@@ -2756,4 +2856,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
|
|
|
2756
2856
|
*/
|
|
2757
2857
|
declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
|
|
2758
2858
|
|
|
2759
|
-
export {
|
|
2859
|
+
export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserThreadsSuspense_experimental as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useOtherSuspense as aL, _useOthersSuspense as aM, useOthersConnectionIdsSuspense as aN, _useOthersMappedSuspense as aO, _useSelfSuspense as aP, _useStorageSuspense as aQ, _useThreadsSuspense as aR, useAttachmentUrlSuspense as aS, _useHistoryVersionsSuspense as aT, _useRoomSubscriptionSettingsSuspense as aU, useInboxNotificationsSuspense as aV, useNotificationSettingsSuspense as aW, useRoomInfoSuspense as aX, useGroupInfoSuspense as aY, useUnreadInboxNotificationsCountSuspense as aZ, _useUserSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useAiChatsSuspense as b0, _useAiChatMessagesSuspense as b1, _useAiChatSuspense as b2, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentType, Context, PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { BaseUserMeta, Client, JsonObject, LsonObject, LiveObject, User, Json, RoomSubscriptionSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ClientOptions, ThreadData as ThreadData$1, CommentData as CommentData$1 } from '@liveblocks/client';
|
|
4
4
|
import * as _liveblocks_core from '@liveblocks/core';
|
|
5
|
-
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings,
|
|
5
|
+
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, DerivedSignal, DefaultMap, SubscriptionData, SubscriptionKey, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -53,6 +53,25 @@ type RegisterAiToolProps = {
|
|
|
53
53
|
*/
|
|
54
54
|
enabled?: boolean;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Simplified status for the requested chat.
|
|
58
|
+
* This hook offers a convenient way to update the UI while an AI chat
|
|
59
|
+
* generation is in progress.
|
|
60
|
+
*/
|
|
61
|
+
type AiChatStatus = Relax<{
|
|
62
|
+
status: "loading";
|
|
63
|
+
} | {
|
|
64
|
+
status: "idle";
|
|
65
|
+
} | {
|
|
66
|
+
status: "generating";
|
|
67
|
+
} | {
|
|
68
|
+
status: "generating";
|
|
69
|
+
partType: Exclude<AiAssistantContentPart["type"], "tool-invocation">;
|
|
70
|
+
} | {
|
|
71
|
+
status: "generating";
|
|
72
|
+
partType: "tool-invocation";
|
|
73
|
+
toolName: string;
|
|
74
|
+
}>;
|
|
56
75
|
|
|
57
76
|
type UiChatMessage = WithNavigation<AiChatMessage>;
|
|
58
77
|
type UseSyncStatusOptions = {
|
|
@@ -216,6 +235,7 @@ type AiChatAsyncSuccess = AsyncSuccess<AiChat, "chat">;
|
|
|
216
235
|
type AiChatAsyncResult = AsyncResult<AiChat, "chat">;
|
|
217
236
|
type AiChatMessagesAsyncSuccess = AsyncSuccess<readonly UiChatMessage[], "messages">;
|
|
218
237
|
type AiChatMessagesAsyncResult = AsyncResult<readonly UiChatMessage[], "messages">;
|
|
238
|
+
|
|
219
239
|
type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
|
|
220
240
|
/**
|
|
221
241
|
* The id of the room you want to connect to
|
|
@@ -1236,6 +1256,29 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1236
1256
|
* const { chat, error, isLoading } = useAiChat("my-chat");
|
|
1237
1257
|
*/
|
|
1238
1258
|
useAiChat(chatId: string): AiChatAsyncResult;
|
|
1259
|
+
/**
|
|
1260
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1261
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1262
|
+
* the latest assistant message in the chat.
|
|
1263
|
+
*
|
|
1264
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1265
|
+
*
|
|
1266
|
+
* @param chatId - The ID of the chat to monitor
|
|
1267
|
+
* @returns The current status of the AI chat
|
|
1268
|
+
*
|
|
1269
|
+
* @example
|
|
1270
|
+
* ```tsx
|
|
1271
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1272
|
+
*
|
|
1273
|
+
* function ChatStatus() {
|
|
1274
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1275
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1276
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1277
|
+
* console.log(status.toolName); // string | undefined
|
|
1278
|
+
* }
|
|
1279
|
+
* ```
|
|
1280
|
+
*/
|
|
1281
|
+
useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
|
|
1239
1282
|
suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
|
|
1240
1283
|
/**
|
|
1241
1284
|
* Returns the inbox notifications for the current user.
|
|
@@ -1289,6 +1332,29 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1289
1332
|
* const { chat, error, isLoading } = useAiChat("my-chat");
|
|
1290
1333
|
*/
|
|
1291
1334
|
useAiChat(chatId: string): AiChatAsyncSuccess;
|
|
1335
|
+
/**
|
|
1336
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1337
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1338
|
+
* the latest assistant message in the chat.
|
|
1339
|
+
*
|
|
1340
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1341
|
+
*
|
|
1342
|
+
* @param chatId - The ID of the chat to monitor
|
|
1343
|
+
* @returns The current status of the AI chat
|
|
1344
|
+
*
|
|
1345
|
+
* @example
|
|
1346
|
+
* ```tsx
|
|
1347
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1348
|
+
*
|
|
1349
|
+
* function ChatStatus() {
|
|
1350
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1351
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1352
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1353
|
+
* console.log(status.toolName); // string | undefined
|
|
1354
|
+
* }
|
|
1355
|
+
* ```
|
|
1356
|
+
*/
|
|
1357
|
+
useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
|
|
1292
1358
|
}>;
|
|
1293
1359
|
}>;
|
|
1294
1360
|
|
|
@@ -1537,6 +1603,12 @@ declare function createStore_forNotifications(): {
|
|
|
1537
1603
|
updateAssociatedNotification: (newComment: CommentData) => void;
|
|
1538
1604
|
upsert: (notification: InboxNotificationData) => void;
|
|
1539
1605
|
};
|
|
1606
|
+
declare function createStore_forUnreadNotificationsCount(): {
|
|
1607
|
+
signal: DerivedSignal<{
|
|
1608
|
+
[k: string]: number;
|
|
1609
|
+
}>;
|
|
1610
|
+
update: (queryKey: InboxNotificationsQueryKey, count: number) => void;
|
|
1611
|
+
};
|
|
1540
1612
|
declare function createStore_forSubscriptions(updates: ISignal<readonly OptimisticUpdate<BaseMetadata>[]>, threads: ReadonlyThreadDB<BaseMetadata>): {
|
|
1541
1613
|
signal: DerivedSignal<SubscriptionsByKey>;
|
|
1542
1614
|
applyDelta: (newSubscriptions: SubscriptionData[], deletedSubscriptions: SubscriptionDeleteInfo[]) => void;
|
|
@@ -1593,6 +1665,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1593
1665
|
readonly subscriptions: ReturnType<typeof createStore_forSubscriptions>;
|
|
1594
1666
|
readonly roomSubscriptionSettings: ReturnType<typeof createStore_forRoomSubscriptionSettings>;
|
|
1595
1667
|
readonly historyVersions: ReturnType<typeof createStore_forHistoryVersions>;
|
|
1668
|
+
readonly unreadNotificationsCount: ReturnType<typeof createStore_forUnreadNotificationsCount>;
|
|
1596
1669
|
readonly permissionHints: ReturnType<typeof createStore_forPermissionHints>;
|
|
1597
1670
|
readonly notificationSettings: ReturnType<typeof createStore_forNotificationSettings>;
|
|
1598
1671
|
readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<M>>;
|
|
@@ -1604,6 +1677,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1604
1677
|
readonly notifications: DerivedSignal<CleanNotifications>;
|
|
1605
1678
|
readonly threadSubscriptions: DerivedSignal<CleanThreadSubscriptions>;
|
|
1606
1679
|
readonly loadingNotifications: DefaultMap<InboxNotificationsQueryKey, LoadableResource<InboxNotificationsAsyncResult>>;
|
|
1680
|
+
readonly unreadNotificationsCount: DefaultMap<InboxNotificationsQueryKey, LoadableResource<UnreadInboxNotificationsCountAsyncResult>>;
|
|
1607
1681
|
readonly roomSubscriptionSettingsByRoomId: DefaultMap<RoomId, LoadableResource<RoomSubscriptionSettingsAsyncResult>>;
|
|
1608
1682
|
readonly versionsByRoomId: DefaultMap<RoomId, LoadableResource<HistoryVersionsAsyncResult>>;
|
|
1609
1683
|
readonly notificationSettings: LoadableResource<NotificationSettingsAsyncResult>;
|
|
@@ -1673,6 +1747,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1673
1747
|
*/
|
|
1674
1748
|
updateRoomSubscriptionSettings(roomId: string, optimisticId: string, settings: Readonly<RoomSubscriptionSettings$1>): void;
|
|
1675
1749
|
fetchNotificationsDeltaUpdate(signal: AbortSignal): Promise<void>;
|
|
1750
|
+
fetchUnreadNotificationsCount(queryKey: InboxNotificationsQueryKey, signal: AbortSignal): Promise<void>;
|
|
1676
1751
|
fetchRoomThreadsDeltaUpdate(roomId: string, signal: AbortSignal): Promise<void>;
|
|
1677
1752
|
fetchUserThreadsDeltaUpdate(signal: AbortSignal): Promise<void>;
|
|
1678
1753
|
fetchRoomVersionsDeltaUpdate(roomId: string, signal: AbortSignal): Promise<void>;
|
|
@@ -1721,6 +1796,31 @@ declare function useCreateAiChat(): {
|
|
|
1721
1796
|
* deleteAiChat("ai-chat-id");
|
|
1722
1797
|
*/
|
|
1723
1798
|
declare function useDeleteAiChat(): (chatId: string) => void;
|
|
1799
|
+
/**
|
|
1800
|
+
* Returns the status of an AI chat, indicating whether it's idle or actively
|
|
1801
|
+
* generating content. This is a convenience hook that derives its state from
|
|
1802
|
+
* the latest assistant message in the chat.
|
|
1803
|
+
*
|
|
1804
|
+
* Re-renders whenever any of the relevant fields change.
|
|
1805
|
+
*
|
|
1806
|
+
* @param chatId - The ID of the chat to monitor
|
|
1807
|
+
* @returns The current status of the AI chat
|
|
1808
|
+
*
|
|
1809
|
+
* @example
|
|
1810
|
+
* ```tsx
|
|
1811
|
+
* import { useAiChatStatus } from "@liveblocks/react";
|
|
1812
|
+
*
|
|
1813
|
+
* function ChatStatus() {
|
|
1814
|
+
* const { status, partType, toolName } = useAiChatStatus("my-chat");
|
|
1815
|
+
* console.log(status); // "loading" | "idle" | "generating"
|
|
1816
|
+
* console.log(status.partType); // "text" | "tool-invocation" | ...
|
|
1817
|
+
* console.log(status.toolName); // string | undefined
|
|
1818
|
+
* }
|
|
1819
|
+
* ```
|
|
1820
|
+
*/
|
|
1821
|
+
declare function useAiChatStatus(chatId: string,
|
|
1822
|
+
/** @internal */
|
|
1823
|
+
branchId?: MessageId): AiChatStatus;
|
|
1724
1824
|
/**
|
|
1725
1825
|
* Returns a function to send a message in an AI chat.
|
|
1726
1826
|
*
|
|
@@ -2756,4 +2856,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
|
|
|
2756
2856
|
*/
|
|
2757
2857
|
declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
|
|
2758
2858
|
|
|
2759
|
-
export {
|
|
2859
|
+
export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserThreadsSuspense_experimental as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useOtherSuspense as aL, _useOthersSuspense as aM, useOthersConnectionIdsSuspense as aN, _useOthersMappedSuspense as aO, _useSelfSuspense as aP, _useStorageSuspense as aQ, _useThreadsSuspense as aR, useAttachmentUrlSuspense as aS, _useHistoryVersionsSuspense as aT, _useRoomSubscriptionSettingsSuspense as aU, useInboxNotificationsSuspense as aV, useNotificationSettingsSuspense as aW, useRoomInfoSuspense as aX, useGroupInfoSuspense as aY, useUnreadInboxNotificationsCountSuspense as aZ, _useUserSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useAiChatsSuspense as b0, _useAiChatMessagesSuspense as b1, _useAiChatSuspense as b2, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
|
package/dist/suspense.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk6MZ5AS3Vcjs = require('./chunk-6MZ5AS3V.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -74,12 +74,14 @@ var _chunkZU7C6DJEcjs = require('./chunk-ZU7C6DJE.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
var _chunkIQBSX6NScjs = require('./chunk-IQBSX6NS.cjs');
|
|
78
79
|
|
|
79
80
|
// src/suspense.ts
|
|
80
81
|
var _core = require('@liveblocks/core');
|
|
81
82
|
var _client = require('@liveblocks/client');
|
|
82
|
-
_core.detectDupes.call(void 0,
|
|
83
|
+
_core.detectDupes.call(void 0, _chunk6MZ5AS3Vcjs.PKG_NAME, _chunk6MZ5AS3Vcjs.PKG_VERSION, _chunk6MZ5AS3Vcjs.PKG_FORMAT);
|
|
84
|
+
|
|
83
85
|
|
|
84
86
|
|
|
85
87
|
|
|
@@ -153,5 +155,5 @@ _core.detectDupes.call(void 0, _chunkZU7C6DJEcjs.PKG_NAME, _chunkZU7C6DJEcjs.PKG
|
|
|
153
155
|
|
|
154
156
|
|
|
155
157
|
|
|
156
|
-
exports.ClientContext =
|
|
158
|
+
exports.ClientContext = _chunkIQBSX6NScjs.ClientContext; exports.ClientSideSuspense = _chunk6MZ5AS3Vcjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkIQBSX6NScjs.LiveblocksProvider; exports.RegisterAiKnowledge = _chunkIQBSX6NScjs.RegisterAiKnowledge; exports.RegisterAiTool = _chunkIQBSX6NScjs.RegisterAiTool; exports.RoomContext = _chunkIQBSX6NScjs.RoomContext; exports.RoomProvider = _chunkIQBSX6NScjs._RoomProvider; exports.isNotificationChannelEnabled = _client.isNotificationChannelEnabled; exports.shallow = _client.shallow; exports.useAddReaction = _chunkIQBSX6NScjs._useAddReaction; exports.useAiChat = _chunkIQBSX6NScjs._useAiChatSuspense; exports.useAiChatMessages = _chunkIQBSX6NScjs._useAiChatMessagesSuspense; exports.useAiChatStatus = _chunkIQBSX6NScjs.useAiChatStatus; exports.useAiChats = _chunkIQBSX6NScjs._useAiChatsSuspense; exports.useAttachmentUrl = _chunkIQBSX6NScjs.useAttachmentUrlSuspense; exports.useBroadcastEvent = _chunkIQBSX6NScjs._useBroadcastEvent; exports.useCanRedo = _chunkIQBSX6NScjs.useCanRedo; exports.useCanUndo = _chunkIQBSX6NScjs.useCanUndo; exports.useClient = _chunkIQBSX6NScjs.useClient; exports.useCreateAiChat = _chunkIQBSX6NScjs.useCreateAiChat; exports.useCreateComment = _chunkIQBSX6NScjs.useCreateComment; exports.useCreateThread = _chunkIQBSX6NScjs._useCreateThread; exports.useDeleteAiChat = _chunkIQBSX6NScjs.useDeleteAiChat; exports.useDeleteAllInboxNotifications = _chunkIQBSX6NScjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkIQBSX6NScjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkIQBSX6NScjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkIQBSX6NScjs._useDeleteThread; exports.useEditComment = _chunkIQBSX6NScjs.useEditComment; exports.useEditThreadMetadata = _chunkIQBSX6NScjs._useEditThreadMetadata; exports.useErrorListener = _chunkIQBSX6NScjs.useErrorListener; exports.useEventListener = _chunkIQBSX6NScjs._useEventListener; exports.useGroupInfo = _chunkIQBSX6NScjs.useGroupInfoSuspense; exports.useHistory = _chunkIQBSX6NScjs.useHistory; exports.useHistoryVersions = _chunkIQBSX6NScjs._useHistoryVersionsSuspense; exports.useInboxNotificationThread = _chunkIQBSX6NScjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkIQBSX6NScjs.useInboxNotificationsSuspense; exports.useIsInsideRoom = _chunkIQBSX6NScjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkIQBSX6NScjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkIQBSX6NScjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkIQBSX6NScjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkIQBSX6NScjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkIQBSX6NScjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkIQBSX6NScjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkIQBSX6NScjs._useMutation; exports.useMyPresence = _chunkIQBSX6NScjs._useMyPresence; exports.useNotificationSettings = _chunkIQBSX6NScjs.useNotificationSettingsSuspense; exports.useOther = _chunkIQBSX6NScjs._useOtherSuspense; exports.useOthers = _chunkIQBSX6NScjs._useOthersSuspense; exports.useOthersConnectionIds = _chunkIQBSX6NScjs.useOthersConnectionIdsSuspense; exports.useOthersListener = _chunkIQBSX6NScjs._useOthersListener; exports.useOthersMapped = _chunkIQBSX6NScjs._useOthersMappedSuspense; exports.useRedo = _chunkIQBSX6NScjs.useRedo; exports.useRemoveReaction = _chunkIQBSX6NScjs.useRemoveReaction; exports.useRoom = _chunkIQBSX6NScjs._useRoom; exports.useRoomInfo = _chunkIQBSX6NScjs.useRoomInfoSuspense; exports.useRoomSubscriptionSettings = _chunkIQBSX6NScjs._useRoomSubscriptionSettingsSuspense; exports.useSelf = _chunkIQBSX6NScjs._useSelfSuspense; exports.useSendAiMessage = _chunkIQBSX6NScjs.useSendAiMessage; exports.useStatus = _chunkIQBSX6NScjs.useStatus; exports.useStorage = _chunkIQBSX6NScjs._useStorageSuspense; exports.useStorageRoot = _chunkIQBSX6NScjs._useStorageRoot; exports.useSubscribeToThread = _chunkIQBSX6NScjs.useSubscribeToThread; exports.useSyncStatus = _chunkIQBSX6NScjs.useSyncStatus; exports.useThreadSubscription = _chunkIQBSX6NScjs.useThreadSubscription; exports.useThreads = _chunkIQBSX6NScjs._useThreadsSuspense; exports.useUndo = _chunkIQBSX6NScjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkIQBSX6NScjs.useUnreadInboxNotificationsCountSuspense; exports.useUnsubscribeFromThread = _chunkIQBSX6NScjs.useUnsubscribeFromThread; exports.useUpdateMyPresence = _chunkIQBSX6NScjs._useUpdateMyPresence; exports.useUpdateNotificationSettings = _chunkIQBSX6NScjs.useUpdateNotificationSettings; exports.useUpdateRoomSubscriptionSettings = _chunkIQBSX6NScjs.useUpdateRoomSubscriptionSettings; exports.useUser = _chunkIQBSX6NScjs._useUserSuspense; exports.useUserThreads_experimental = _chunkIQBSX6NScjs._useUserThreadsSuspense_experimental;
|
|
157
159
|
//# sourceMappingURL=suspense.cjs.map
|