@liveblocks/react 3.7.1 → 3.8.0-next1
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-4GCS3365.cjs → chunk-45BFK66K.cjs} +63 -23
- package/dist/chunk-45BFK66K.cjs.map +1 -0
- package/dist/{chunk-OKYUUXNY.js → chunk-GXPZZIB2.js} +41 -1
- package/dist/chunk-GXPZZIB2.js.map +1 -0
- package/dist/{chunk-W466HEJW.js → chunk-TMNECRRU.js} +2 -2
- package/dist/{chunk-MEL5UMNW.cjs → chunk-X3KI55GF.cjs} +2 -2
- package/dist/{chunk-MEL5UMNW.cjs.map → chunk-X3KI55GF.cjs.map} +1 -1
- 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-DSJuooXd.d.cts} +61 -2
- package/dist/{room-BtcL74U0.d.ts → room-DSJuooXd.d.ts} +61 -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-W466HEJW.js.map → chunk-TMNECRRU.js.map} +0 -0
package/dist/_private.cjs
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunk45BFK66Kcjs = require('./chunk-45BFK66K.cjs');
|
|
29
29
|
|
|
30
30
|
// src/lib/use-layout-effect.ts
|
|
31
31
|
var _react = require('react');
|
|
@@ -50,7 +50,7 @@ function selectorFor_useGroup(state) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function useGroup(groupId) {
|
|
53
|
-
const client =
|
|
53
|
+
const client = _chunk45BFK66Kcjs.useClient.call(void 0, );
|
|
54
54
|
const store = client[_core.kInternal].httpClient.groupsStore;
|
|
55
55
|
const getGroupState = _react.useCallback.call(void 0,
|
|
56
56
|
() => store.getItemState(groupId),
|
|
@@ -59,7 +59,7 @@ function useGroup(groupId) {
|
|
|
59
59
|
_react.useEffect.call(void 0, () => {
|
|
60
60
|
void store.enqueue(groupId);
|
|
61
61
|
}, [store, groupId]);
|
|
62
|
-
return
|
|
62
|
+
return _chunk45BFK66Kcjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
63
63
|
store.subscribe,
|
|
64
64
|
getGroupState,
|
|
65
65
|
getGroupState,
|
|
@@ -80,8 +80,8 @@ function normalizeMentionSuggestions(suggestions) {
|
|
|
80
80
|
function useMentionSuggestions(roomId, search) {
|
|
81
81
|
const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
|
|
82
82
|
const lastInvokedAt = _react.useRef.call(void 0, );
|
|
83
|
-
const resolveMentionSuggestions =
|
|
84
|
-
const mentionSuggestionsCache =
|
|
83
|
+
const resolveMentionSuggestions = _chunk45BFK66Kcjs.useResolveMentionSuggestions.call(void 0, );
|
|
84
|
+
const mentionSuggestionsCache = _chunk45BFK66Kcjs.useMentionSuggestionsCache.call(void 0, );
|
|
85
85
|
_react.useEffect.call(void 0, () => {
|
|
86
86
|
if (search === void 0 || !resolveMentionSuggestions) {
|
|
87
87
|
return;
|
|
@@ -136,7 +136,7 @@ function useMentionSuggestions(roomId, search) {
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
function useSyncSource() {
|
|
139
|
-
const client =
|
|
139
|
+
const client = _chunk45BFK66Kcjs.useClient.call(void 0, );
|
|
140
140
|
const createSyncSource = client[_core.kInternal].createSyncSource;
|
|
141
141
|
const [syncSource, setSyncSource] = _react.useState.call(void 0, );
|
|
142
142
|
_react.useEffect.call(void 0, () => {
|
|
@@ -176,5 +176,5 @@ function useSyncSource() {
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
exports.getUmbrellaStoreForClient =
|
|
179
|
+
exports.getUmbrellaStoreForClient = _chunk45BFK66Kcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunk45BFK66Kcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunk45BFK66Kcjs.useClientOrNull; exports.useCreateRoomComment = _chunk45BFK66Kcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunk45BFK66Kcjs.useCreateRoomThread; exports.useCreateTextMention = _chunk45BFK66Kcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunk45BFK66Kcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunk45BFK66Kcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunk45BFK66Kcjs.useDeleteTextMention; exports.useEditRoomComment = _chunk45BFK66Kcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunk45BFK66Kcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useLatest = _chunk45BFK66Kcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunk45BFK66Kcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunk45BFK66Kcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunk45BFK66Kcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunk45BFK66Kcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunk45BFK66Kcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunk45BFK66Kcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunk45BFK66Kcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunk45BFK66Kcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunk45BFK66Kcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunk45BFK66Kcjs.useRoomThreadSubscription; exports.useSignal = _chunk45BFK66Kcjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunk45BFK66Kcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunk45BFK66Kcjs.useYjsProvider;
|
|
180
180
|
//# sourceMappingURL=_private.cjs.map
|
package/dist/_private.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DSJuooXd.cjs';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-DSJuooXd.cjs';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DSJuooXd.js';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-DSJuooXd.js';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
useSignal,
|
|
26
26
|
useSyncExternalStoreWithSelector,
|
|
27
27
|
useYjsProvider
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GXPZZIB2.js";
|
|
29
29
|
|
|
30
30
|
// src/lib/use-layout-effect.ts
|
|
31
31
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -2151,6 +2151,7 @@ function makeLiveblocksContextBundle(client) {
|
|
|
2151
2151
|
useAiChats,
|
|
2152
2152
|
useAiChat,
|
|
2153
2153
|
useAiChatMessages,
|
|
2154
|
+
useAiChatStatus,
|
|
2154
2155
|
useCreateAiChat,
|
|
2155
2156
|
useDeleteAiChat,
|
|
2156
2157
|
useSendAiMessage,
|
|
@@ -2170,6 +2171,7 @@ function makeLiveblocksContextBundle(client) {
|
|
|
2170
2171
|
useAiChats: useAiChatsSuspense,
|
|
2171
2172
|
useAiChat: useAiChatSuspense,
|
|
2172
2173
|
useAiChatMessages: useAiChatMessagesSuspense,
|
|
2174
|
+
useAiChatStatus,
|
|
2173
2175
|
useCreateAiChat,
|
|
2174
2176
|
useDeleteAiChat,
|
|
2175
2177
|
useSendAiMessage,
|
|
@@ -2746,6 +2748,43 @@ function useDeleteAiChat() {
|
|
|
2746
2748
|
[client]
|
|
2747
2749
|
);
|
|
2748
2750
|
}
|
|
2751
|
+
var LOADING = Object.freeze({ status: "loading" });
|
|
2752
|
+
var IDLE = Object.freeze({ status: "idle" });
|
|
2753
|
+
function useAiChatStatus(chatId, branchId) {
|
|
2754
|
+
const client = useClient();
|
|
2755
|
+
const store = getUmbrellaStoreForClient(client);
|
|
2756
|
+
useEnsureAiConnection(client);
|
|
2757
|
+
_react.useEffect.call(void 0,
|
|
2758
|
+
() => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(branchId, () => ( null))).waitUntilLoaded()
|
|
2759
|
+
);
|
|
2760
|
+
return useSignal(
|
|
2761
|
+
// Signal
|
|
2762
|
+
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(branchId, () => ( null))).signal,
|
|
2763
|
+
// Selector
|
|
2764
|
+
(result) => {
|
|
2765
|
+
if (result.isLoading) return LOADING;
|
|
2766
|
+
if (result.error) return IDLE;
|
|
2767
|
+
const messages = result.messages;
|
|
2768
|
+
const lastMessage = messages[messages.length - 1];
|
|
2769
|
+
if (_optionalChain([lastMessage, 'optionalAccess', _25 => _25.role]) !== "assistant") return IDLE;
|
|
2770
|
+
if (lastMessage.status !== "generating" && lastMessage.status !== "awaiting-tool")
|
|
2771
|
+
return IDLE;
|
|
2772
|
+
const contentSoFar = lastMessage.contentSoFar;
|
|
2773
|
+
const lastPart = contentSoFar[contentSoFar.length - 1];
|
|
2774
|
+
if (_optionalChain([lastPart, 'optionalAccess', _26 => _26.type]) === "tool-invocation") {
|
|
2775
|
+
return {
|
|
2776
|
+
status: "generating",
|
|
2777
|
+
partType: "tool-invocation",
|
|
2778
|
+
toolName: lastPart.name
|
|
2779
|
+
};
|
|
2780
|
+
} else {
|
|
2781
|
+
return { status: "generating", partType: _optionalChain([lastPart, 'optionalAccess', _27 => _27.type]) };
|
|
2782
|
+
}
|
|
2783
|
+
},
|
|
2784
|
+
// Consider { status: "generating", partType: "text" } and { status: "generating", partType: "text" } equal
|
|
2785
|
+
_core.shallow
|
|
2786
|
+
);
|
|
2787
|
+
}
|
|
2749
2788
|
function useSendAiMessage(chatId, options) {
|
|
2750
2789
|
const client = useClient();
|
|
2751
2790
|
return _react.useCallback.call(void 0,
|
|
@@ -2762,7 +2801,7 @@ function useSendAiMessage(chatId, options) {
|
|
|
2762
2801
|
"chatId must be provided to either `useSendAiMessage` or its returned function."
|
|
2763
2802
|
)));
|
|
2764
2803
|
const messages = client[_core.kInternal].ai.signals.getChatMessagesForBranch\u03A3(resolvedChatId).get();
|
|
2765
|
-
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess',
|
|
2804
|
+
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _28 => _28.copilotId])) {
|
|
2766
2805
|
_core.console.warn(
|
|
2767
2806
|
`No copilot ID was provided to useSendAiMessage when sending the message "${messageText.slice(
|
|
2768
2807
|
0,
|
|
@@ -2774,8 +2813,8 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
2774
2813
|
)}\u2026", copilotId: "co_xxx" })'`
|
|
2775
2814
|
);
|
|
2776
2815
|
}
|
|
2777
|
-
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess',
|
|
2778
|
-
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access',
|
|
2816
|
+
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _29 => _29.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
|
|
2817
|
+
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _30 => _30[messages.length - 1], 'optionalAccess', _31 => _31.id]), () => ( null));
|
|
2779
2818
|
const content = [{ type: "text", text: messageText }];
|
|
2780
2819
|
const newMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
|
|
2781
2820
|
resolvedChatId,
|
|
@@ -2795,10 +2834,10 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
2795
2834
|
{ id: newMessageId, parentMessageId: lastMessageId, content },
|
|
2796
2835
|
targetMessageId,
|
|
2797
2836
|
{
|
|
2798
|
-
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess',
|
|
2837
|
+
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _32 => _32.stream]))),
|
|
2799
2838
|
copilotId: resolvedCopilotId,
|
|
2800
|
-
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess',
|
|
2801
|
-
knowledge: _nullishCoalesce(messageOptions.knowledge, () => ( _optionalChain([options, 'optionalAccess',
|
|
2839
|
+
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _33 => _33.timeout]))),
|
|
2840
|
+
knowledge: _nullishCoalesce(messageOptions.knowledge, () => ( _optionalChain([options, 'optionalAccess', _34 => _34.knowledge])))
|
|
2802
2841
|
}
|
|
2803
2842
|
);
|
|
2804
2843
|
return newMessage;
|
|
@@ -2806,10 +2845,10 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
2806
2845
|
[
|
|
2807
2846
|
client,
|
|
2808
2847
|
chatId,
|
|
2809
|
-
_optionalChain([options, 'optionalAccess',
|
|
2810
|
-
_optionalChain([options, 'optionalAccess',
|
|
2811
|
-
_optionalChain([options, 'optionalAccess',
|
|
2812
|
-
_optionalChain([options, 'optionalAccess',
|
|
2848
|
+
_optionalChain([options, 'optionalAccess', _35 => _35.copilotId]),
|
|
2849
|
+
_optionalChain([options, 'optionalAccess', _36 => _36.stream]),
|
|
2850
|
+
_optionalChain([options, 'optionalAccess', _37 => _37.timeout]),
|
|
2851
|
+
_optionalChain([options, 'optionalAccess', _38 => _38.knowledge])
|
|
2813
2852
|
]
|
|
2814
2853
|
);
|
|
2815
2854
|
}
|
|
@@ -2845,7 +2884,7 @@ function createSharedContext(client) {
|
|
|
2845
2884
|
}
|
|
2846
2885
|
function useEnsureNoLiveblocksProvider(options) {
|
|
2847
2886
|
const existing = useClientOrNull();
|
|
2848
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2887
|
+
if (!_optionalChain([options, 'optionalAccess', _39 => _39.allowNesting]) && existing !== null) {
|
|
2849
2888
|
throw new Error(
|
|
2850
2889
|
"You cannot nest multiple LiveblocksProvider instances in the same React tree."
|
|
2851
2890
|
);
|
|
@@ -3009,7 +3048,7 @@ var _useAiChatSuspense = useAiChatSuspense;
|
|
|
3009
3048
|
var _useAiChatMessages = useAiChatMessages;
|
|
3010
3049
|
var _useAiChatMessagesSuspense = useAiChatMessagesSuspense;
|
|
3011
3050
|
function useSyncStatus_withClient(client, options) {
|
|
3012
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3051
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _40 => _40.smooth]), () => ( false)));
|
|
3013
3052
|
if (smooth) {
|
|
3014
3053
|
return useSyncStatusSmooth_withClient(client);
|
|
3015
3054
|
} else {
|
|
@@ -3188,8 +3227,8 @@ function makeRoomExtrasForClient(client) {
|
|
|
3188
3227
|
if (innerError.status === 403) {
|
|
3189
3228
|
const detailedMessage = [
|
|
3190
3229
|
innerError.message,
|
|
3191
|
-
_optionalChain([innerError, 'access',
|
|
3192
|
-
_optionalChain([innerError, 'access',
|
|
3230
|
+
_optionalChain([innerError, 'access', _41 => _41.details, 'optionalAccess', _42 => _42.suggestion]),
|
|
3231
|
+
_optionalChain([innerError, 'access', _43 => _43.details, 'optionalAccess', _44 => _44.docs])
|
|
3193
3232
|
].filter(Boolean).join("\n");
|
|
3194
3233
|
_core.console.error(detailedMessage);
|
|
3195
3234
|
}
|
|
@@ -3484,7 +3523,7 @@ function RoomProviderInner(props) {
|
|
|
3484
3523
|
}
|
|
3485
3524
|
function useRoom(options) {
|
|
3486
3525
|
const room = useRoomOrNull();
|
|
3487
|
-
if (room === null && !_optionalChain([options, 'optionalAccess',
|
|
3526
|
+
if (room === null && !_optionalChain([options, 'optionalAccess', _45 => _45.allowOutsideRoom])) {
|
|
3488
3527
|
throw new Error("RoomProvider is missing from the React tree.");
|
|
3489
3528
|
}
|
|
3490
3529
|
return room;
|
|
@@ -3834,7 +3873,7 @@ function useCreateRoomThread(roomId) {
|
|
|
3834
3873
|
thread: newThread,
|
|
3835
3874
|
roomId
|
|
3836
3875
|
});
|
|
3837
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3876
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _46 => _46.map, 'call', _47 => _47((attachment) => attachment.id)]);
|
|
3838
3877
|
client[_core.kInternal].httpClient.createThread({
|
|
3839
3878
|
roomId,
|
|
3840
3879
|
threadId,
|
|
@@ -3874,7 +3913,7 @@ function useDeleteRoomThread(roomId) {
|
|
|
3874
3913
|
const { store, onMutationFailure } = getRoomExtrasForClient(client);
|
|
3875
3914
|
const userId = getCurrentUserId(client);
|
|
3876
3915
|
const existing = store.outputs.threads.get().get(threadId);
|
|
3877
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
3916
|
+
if (_optionalChain([existing, 'optionalAccess', _48 => _48.comments, 'optionalAccess', _49 => _49[0], 'optionalAccess', _50 => _50.userId]) !== userId) {
|
|
3878
3917
|
throw new Error("Only the thread creator can delete the thread");
|
|
3879
3918
|
}
|
|
3880
3919
|
const optimisticId = store.optimisticUpdates.add({
|
|
@@ -3962,7 +4001,7 @@ function useCreateRoomComment(roomId) {
|
|
|
3962
4001
|
type: "create-comment",
|
|
3963
4002
|
comment
|
|
3964
4003
|
});
|
|
3965
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4004
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _51 => _51.map, 'call', _52 => _52((attachment) => attachment.id)]);
|
|
3966
4005
|
client[_core.kInternal].httpClient.createComment({ roomId, threadId, commentId, body, attachmentIds }).then(
|
|
3967
4006
|
(newComment) => {
|
|
3968
4007
|
store.createComment(newComment, optimisticId);
|
|
@@ -4018,7 +4057,7 @@ function useEditRoomComment(roomId) {
|
|
|
4018
4057
|
attachments: _nullishCoalesce(attachments, () => ( []))
|
|
4019
4058
|
}
|
|
4020
4059
|
});
|
|
4021
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4060
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _53 => _53.map, 'call', _54 => _54((attachment) => attachment.id)]);
|
|
4022
4061
|
client[_core.kInternal].httpClient.editComment({ roomId, threadId, commentId, body, attachmentIds }).then(
|
|
4023
4062
|
(editedComment) => {
|
|
4024
4063
|
store.editComment(threadId, optimisticId, editedComment);
|
|
@@ -4359,7 +4398,7 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
4359
4398
|
}
|
|
4360
4399
|
return {
|
|
4361
4400
|
status: "subscribed",
|
|
4362
|
-
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess',
|
|
4401
|
+
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _55 => _55.readAt]), () => ( null)),
|
|
4363
4402
|
subscribe,
|
|
4364
4403
|
unsubscribe
|
|
4365
4404
|
};
|
|
@@ -4570,7 +4609,7 @@ function useThreadsSuspense(options = {}) {
|
|
|
4570
4609
|
return result;
|
|
4571
4610
|
}
|
|
4572
4611
|
function selectorFor_useAttachmentUrl(state) {
|
|
4573
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
4612
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _56 => _56.isLoading])) {
|
|
4574
4613
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
4575
4614
|
}
|
|
4576
4615
|
if (state.error) {
|
|
@@ -4797,5 +4836,6 @@ var _useUpdateMyPresence = useUpdateMyPresence;
|
|
|
4797
4836
|
|
|
4798
4837
|
|
|
4799
4838
|
|
|
4800
|
-
|
|
4801
|
-
|
|
4839
|
+
|
|
4840
|
+
exports.ClientContext = ClientContext; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; exports.RoomContext = RoomContext; exports.useLatest = useLatest; exports.RegisterAiKnowledge = RegisterAiKnowledge; exports.RegisterAiTool = RegisterAiTool; exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; exports.useSignal = useSignal; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; exports.useCreateAiChat = useCreateAiChat; exports.useDeleteAiChat = useDeleteAiChat; exports.useAiChatStatus = useAiChatStatus; exports.useSendAiMessage = useSendAiMessage; exports.LiveblocksProvider = LiveblocksProvider; exports.createLiveblocksContext = createLiveblocksContext; exports.useInboxNotifications = useInboxNotifications; exports.useInboxNotificationsSuspense = useInboxNotificationsSuspense; exports.useMarkAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = useMarkInboxNotificationAsRead; exports.useDeleteAllInboxNotifications = useDeleteAllInboxNotifications; exports.useDeleteInboxNotification = useDeleteInboxNotification; exports.useUnreadInboxNotificationsCount = useUnreadInboxNotificationsCount; exports.useUnreadInboxNotificationsCountSuspense = useUnreadInboxNotificationsCountSuspense; exports.useNotificationSettings = useNotificationSettings; exports.useNotificationSettingsSuspense = useNotificationSettingsSuspense; exports.useUpdateNotificationSettings = useUpdateNotificationSettings; exports.useRoomInfo = useRoomInfo; exports.useRoomInfoSuspense = useRoomInfoSuspense; exports.useGroupInfo = useGroupInfo; exports.useGroupInfoSuspense = useGroupInfoSuspense; exports._useInboxNotificationThread = _useInboxNotificationThread; exports._useUser = _useUser; exports._useUserSuspense = _useUserSuspense; exports._useUserThreads_experimental = _useUserThreads_experimental; exports._useUserThreadsSuspense_experimental = _useUserThreadsSuspense_experimental; exports._useAiChats = _useAiChats; exports._useAiChatsSuspense = _useAiChatsSuspense; exports._useAiChat = _useAiChat; exports._useAiChatSuspense = _useAiChatSuspense; exports._useAiChatMessages = _useAiChatMessages; exports._useAiChatMessagesSuspense = _useAiChatMessagesSuspense; exports.useSyncStatus = useSyncStatus; exports.useErrorListener = useErrorListener; exports.useStatus = useStatus; exports.useReportTextEditor = useReportTextEditor; exports.useYjsProvider = useYjsProvider; exports.useCreateTextMention = useCreateTextMention; exports.useDeleteTextMention = useDeleteTextMention; exports.useResolveMentionSuggestions = useResolveMentionSuggestions; exports.useMentionSuggestionsCache = useMentionSuggestionsCache; exports.useLostConnectionListener = useLostConnectionListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCreateRoomThread = useCreateRoomThread; exports.useDeleteRoomThread = useDeleteRoomThread; exports.useEditRoomThreadMetadata = useEditRoomThreadMetadata; exports.useCreateComment = useCreateComment; exports.useCreateRoomComment = useCreateRoomComment; exports.useEditComment = useEditComment; exports.useEditRoomComment = useEditRoomComment; exports.useDeleteComment = useDeleteComment; exports.useDeleteRoomComment = useDeleteRoomComment; exports.useAddRoomCommentReaction = useAddRoomCommentReaction; exports.useRemoveReaction = useRemoveReaction; exports.useRemoveRoomCommentReaction = useRemoveRoomCommentReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkRoomThreadAsRead = useMarkRoomThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkRoomThreadAsResolved = useMarkRoomThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useMarkRoomThreadAsUnresolved = useMarkRoomThreadAsUnresolved; exports.useSubscribeToThread = useSubscribeToThread; exports.useUnsubscribeFromThread = useUnsubscribeFromThread; exports.useThreadSubscription = useThreadSubscription; exports.useRoomThreadSubscription = useRoomThreadSubscription; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useAttachmentUrl = useAttachmentUrl; exports.useRoomAttachmentUrl = useRoomAttachmentUrl; exports.useAttachmentUrlSuspense = useAttachmentUrlSuspense; exports.useRoomPermissions = useRoomPermissions; exports.createRoomContext = createRoomContext; exports._RoomProvider = _RoomProvider; exports._useBroadcastEvent = _useBroadcastEvent; exports._useOthersListener = _useOthersListener; exports._useRoom = _useRoom; exports._useIsInsideRoom = _useIsInsideRoom; exports._useAddReaction = _useAddReaction; exports._useMutation = _useMutation; exports._useCreateThread = _useCreateThread; exports._useDeleteThread = _useDeleteThread; exports._useEditThreadMetadata = _useEditThreadMetadata; exports._useEventListener = _useEventListener; exports._useMyPresence = _useMyPresence; exports._useOthersMapped = _useOthersMapped; exports._useOthersMappedSuspense = _useOthersMappedSuspense; exports._useThreads = _useThreads; exports._useThreadsSuspense = _useThreadsSuspense; exports._useRoomSubscriptionSettings = _useRoomSubscriptionSettings; exports._useRoomSubscriptionSettingsSuspense = _useRoomSubscriptionSettingsSuspense; exports._useHistoryVersions = _useHistoryVersions; exports._useHistoryVersionsSuspense = _useHistoryVersionsSuspense; exports._useOther = _useOther; exports._useOthers = _useOthers; exports._useOtherSuspense = _useOtherSuspense; exports._useOthersSuspense = _useOthersSuspense; exports._useStorage = _useStorage; exports._useStorageSuspense = _useStorageSuspense; exports._useSelf = _useSelf; exports._useSelfSuspense = _useSelfSuspense; exports._useStorageRoot = _useStorageRoot; exports._useUpdateMyPresence = _useUpdateMyPresence;
|
|
4841
|
+
//# sourceMappingURL=chunk-45BFK66K.cjs.map
|