@arbidocs/react 0.5.165 → 0.5.167
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/ai/MessageArtifactCard.js +16 -0
- package/dist/ai/MessageArtifactCard.js.map +2 -2
- package/dist/artifacts/artifact-kind.js +12 -1
- package/dist/artifacts/artifact-kind.js.map +2 -2
- package/dist/artifacts/index.cjs +58 -47
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.ts +3 -20
- package/dist/artifacts/index.js +3 -1
- package/dist/artifacts/index.js.map +2 -2
- package/dist/calls/livekit/index.cjs +51 -51
- package/dist/chat/ChatBubble.js +56 -65
- package/dist/chat/ChatBubble.js.map +2 -2
- package/dist/chat/open-document.js +4 -1
- package/dist/chat/open-document.js.map +2 -2
- package/dist/chat/request-agent-status.js +34 -0
- package/dist/chat/request-agent-status.js.map +7 -0
- package/dist/chat/run-finished.js +1 -0
- package/dist/chat/run-finished.js.map +2 -2
- package/dist/chat/useAgentRunControl.js +3 -3
- package/dist/chat/useAgentRunControl.js.map +2 -2
- package/dist/chat/useConnectRunStream.js +4 -0
- package/dist/chat/useConnectRunStream.js.map +2 -2
- package/dist/chat/useConversation.js +13 -10
- package/dist/chat/useConversation.js.map +2 -2
- package/dist/chat/useConversationActions.js +4 -3
- package/dist/chat/useConversationActions.js.map +2 -2
- package/dist/{chunk-XSJNRWLD.cjs → chunk-3DPOR5IR.cjs} +9 -6
- package/dist/chunk-3DPOR5IR.cjs.map +1 -0
- package/dist/{chunk-ZBRJEM25.cjs → chunk-4TWXQFHU.cjs} +70 -70
- package/dist/{chunk-ZBRJEM25.cjs.map → chunk-4TWXQFHU.cjs.map} +1 -1
- package/dist/{chunk-ZZBCZRA5.cjs → chunk-5QOZLKAY.cjs} +5 -2
- package/dist/chunk-5QOZLKAY.cjs.map +1 -0
- package/dist/{chunk-B3W7WDVY.cjs → chunk-BI4SYRLX.cjs} +73 -66
- package/dist/chunk-BI4SYRLX.cjs.map +1 -0
- package/dist/{chunk-ONAYOSSV.cjs → chunk-HRQS27DO.cjs} +39 -39
- package/dist/{chunk-ONAYOSSV.cjs.map → chunk-HRQS27DO.cjs.map} +1 -1
- package/dist/{chunk-DQODLWFX.cjs → chunk-KULS4YWP.cjs} +3 -3
- package/dist/{chunk-DQODLWFX.cjs.map → chunk-KULS4YWP.cjs.map} +1 -1
- package/dist/{chunk-V5WCKJEH.cjs → chunk-Q7BGWKHP.cjs} +44 -44
- package/dist/{chunk-V5WCKJEH.cjs.map → chunk-Q7BGWKHP.cjs.map} +1 -1
- package/dist/{chunk-352P2C4E.cjs → chunk-TX7UCN73.cjs} +14 -14
- package/dist/{chunk-352P2C4E.cjs.map → chunk-TX7UCN73.cjs.map} +1 -1
- package/dist/{chunk-WJIRX5MS.cjs → chunk-W4W75MSO.cjs} +134 -25
- package/dist/chunk-W4W75MSO.cjs.map +1 -0
- package/dist/chunk-WABJGKVA.cjs +246 -0
- package/dist/chunk-WABJGKVA.cjs.map +1 -0
- package/dist/databases.js.map +2 -2
- package/dist/directmessages/DmComposer.js +26 -10
- package/dist/directmessages/DmComposer.js.map +2 -2
- package/dist/directmessages/index.js +2 -0
- package/dist/directmessages/index.js.map +2 -2
- package/dist/directmessages/useChats.js +11 -0
- package/dist/directmessages/useChats.js.map +2 -2
- package/dist/document-tools/core.cjs +102 -102
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/index.cjs +104 -104
- package/dist/document-tools/index.d.ts +2 -2
- package/dist/entities/DocumentEntity.js +8 -3
- package/dist/entities/DocumentEntity.js.map +2 -2
- package/dist/entities/EntityActionsMenu.js +53 -0
- package/dist/entities/EntityActionsMenu.js.map +7 -0
- package/dist/entities/EntityPill.js +50 -16
- package/dist/entities/EntityPill.js.map +2 -2
- package/dist/entities/ProjectEntity.js +4 -0
- package/dist/entities/ProjectEntity.js.map +2 -2
- package/dist/entities/TagEntity.js +1 -0
- package/dist/entities/TagEntity.js.map +2 -2
- package/dist/entities/UserEntity.js +25 -3
- package/dist/entities/UserEntity.js.map +2 -2
- package/dist/entities/links.js +9 -0
- package/dist/entities/links.js.map +7 -0
- package/dist/entities/reference-data.js +56 -0
- package/dist/entities/reference-data.js.map +7 -0
- package/dist/{file-shares.d-Bwy9k3Db.d.ts → file-shares.d-Dlt7pKRi.d.ts} +3 -0
- package/dist/host/config.js.map +2 -2
- package/dist/index.cjs +2654 -2529
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-Dy_Pz6Vl.d.ts → index.d-BaZUctD1.d.ts} +34 -10
- package/dist/index.d.ts +164 -20
- package/dist/index.js +5 -0
- package/dist/index.js.map +2 -2
- package/dist/query-keys.js +3 -0
- package/dist/query-keys.js.map +2 -2
- package/dist/session/conversation-panels.js +5 -3
- package/dist/session/conversation-panels.js.map +2 -2
- package/dist/session/layout.js +5 -0
- package/dist/session/layout.js.map +2 -2
- package/dist/shell/index.cjs +40 -40
- package/dist/{stored-markdown.d-Bp18vrbr.d.ts → stored-markdown.d-BLQPny3e.d.ts} +21 -1
- package/dist/ui/index.cjs +168 -164
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +2 -2
- package/dist/viewers/AudioViewer.js +13 -3
- package/dist/viewers/AudioViewer.js.map +2 -2
- package/dist/viewers/MediaTranscriptPlayer.js +171 -0
- package/dist/viewers/MediaTranscriptPlayer.js.map +7 -0
- package/dist/viewers/VideoViewer.js +4 -11
- package/dist/viewers/VideoViewer.js.map +2 -2
- package/dist/viewers/index.cjs +16 -12
- package/dist/viewers/index.d.ts +17 -3
- package/dist/viewers/index.js +2 -0
- package/dist/viewers/index.js.map +2 -2
- package/package.json +3 -3
- package/dist/chunk-B3W7WDVY.cjs.map +0 -1
- package/dist/chunk-TMPDW7J5.cjs +0 -79
- package/dist/chunk-TMPDW7J5.cjs.map +0 -1
- package/dist/chunk-WJIRX5MS.cjs.map +0 -1
- package/dist/chunk-XSJNRWLD.cjs.map +0 -1
- package/dist/chunk-ZZBCZRA5.cjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var chunkZZBCZRA5_cjs = require('./chunk-ZZBCZRA5.cjs');
|
|
3
|
+
var chunkBI4SYRLX_cjs = require('./chunk-BI4SYRLX.cjs');
|
|
4
|
+
var chunk5QOZLKAY_cjs = require('./chunk-5QOZLKAY.cjs');
|
|
6
5
|
var chunk5ECKSF6H_cjs = require('./chunk-5ECKSF6H.cjs');
|
|
6
|
+
var chunkEEIYXVM4_cjs = require('./chunk-EEIYXVM4.cjs');
|
|
7
7
|
var reactQuery = require('@tanstack/react-query');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var browser = require('@arbidocs/sdk/browser');
|
|
10
10
|
var client = require('@arbidocs/client');
|
|
11
11
|
|
|
12
12
|
function useUserSettings(options) {
|
|
13
|
-
const arbi =
|
|
13
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
14
14
|
return reactQuery.useQuery({
|
|
15
|
-
queryKey:
|
|
15
|
+
queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings(),
|
|
16
16
|
queryFn: () => arbi.settings.get(),
|
|
17
17
|
// Edited about once a month, and every write here patches the cache: no refetch on each mount.
|
|
18
18
|
staleTime: 30 * 60 * 1e3,
|
|
@@ -21,23 +21,23 @@ function useUserSettings(options) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function useUpdateUserSettings() {
|
|
24
|
-
const arbi =
|
|
24
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
25
25
|
const qc = reactQuery.useQueryClient();
|
|
26
26
|
return reactQuery.useMutation({
|
|
27
27
|
mutationFn: (patch) => arbi.settings.update(patch),
|
|
28
28
|
onMutate: async (patch) => {
|
|
29
|
-
await qc.cancelQueries({ queryKey:
|
|
30
|
-
const previous = qc.getQueryData(
|
|
29
|
+
await qc.cancelQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings() });
|
|
30
|
+
const previous = qc.getQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings());
|
|
31
31
|
qc.setQueryData(
|
|
32
|
-
|
|
32
|
+
chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings(),
|
|
33
33
|
(old) => old ? { ...old, ...patch } : old
|
|
34
34
|
);
|
|
35
35
|
return { previous };
|
|
36
36
|
},
|
|
37
37
|
onError: (_err, _patch, context) => {
|
|
38
|
-
qc.setQueryData(
|
|
38
|
+
qc.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings(), context?.previous);
|
|
39
39
|
},
|
|
40
|
-
onSettled: () => qc.invalidateQueries({ queryKey:
|
|
40
|
+
onSettled: () => qc.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.userSettings() })
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
var ALWAYS_ON = { on: true, set: () => {
|
|
@@ -60,7 +60,7 @@ function useLocalSwitch(source, feature) {
|
|
|
60
60
|
return { on: saved ?? fallback, set };
|
|
61
61
|
}
|
|
62
62
|
function useFeatureSwitch(feature) {
|
|
63
|
-
const source =
|
|
63
|
+
const source = chunk5QOZLKAY_cjs.useArbiHost().features?.[feature];
|
|
64
64
|
const useSource = !source ? useUnlisted : "userSetting" in source ? useUserSettingSwitch : useLocalSwitch;
|
|
65
65
|
return useSource(source, feature);
|
|
66
66
|
}
|
|
@@ -71,7 +71,7 @@ function useNoSettings() {
|
|
|
71
71
|
return { data: void 0 };
|
|
72
72
|
}
|
|
73
73
|
function useFeatureCheck() {
|
|
74
|
-
const features =
|
|
74
|
+
const features = chunk5QOZLKAY_cjs.useArbiHost().features;
|
|
75
75
|
const useSettings = Object.values(features ?? {}).some(
|
|
76
76
|
(source) => !!source && "userSetting" in source
|
|
77
77
|
) ? useUserSettings : useNoSettings;
|
|
@@ -193,13 +193,13 @@ function byActivity(a, b) {
|
|
|
193
193
|
return bt - at;
|
|
194
194
|
}
|
|
195
195
|
function cachedChats(queryClient) {
|
|
196
|
-
return queryClient.getQueryData(
|
|
196
|
+
return queryClient.getQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatList()) ?? [];
|
|
197
197
|
}
|
|
198
198
|
function cachedChat(queryClient, chatExtId) {
|
|
199
199
|
return cachedChats(queryClient).find((c) => c.external_id === chatExtId);
|
|
200
200
|
}
|
|
201
201
|
function upsertChat(queryClient, chat) {
|
|
202
|
-
queryClient.setQueryData(
|
|
202
|
+
queryClient.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatList(), (old) => {
|
|
203
203
|
if (!old) return old;
|
|
204
204
|
const rest = old.filter((c) => c.external_id !== chat.external_id);
|
|
205
205
|
return [chat, ...rest].sort(byActivity);
|
|
@@ -207,13 +207,13 @@ function upsertChat(queryClient, chat) {
|
|
|
207
207
|
}
|
|
208
208
|
function removeChat(queryClient, chatExtId) {
|
|
209
209
|
queryClient.setQueryData(
|
|
210
|
-
|
|
210
|
+
chunk5QOZLKAY_cjs.arbiQueryKeys.chatList(),
|
|
211
211
|
(old) => old?.filter((c) => c.external_id !== chatExtId)
|
|
212
212
|
);
|
|
213
|
-
queryClient.removeQueries({ queryKey:
|
|
213
|
+
queryClient.removeQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
214
214
|
}
|
|
215
215
|
function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
216
|
-
queryClient.setQueryData(
|
|
216
|
+
queryClient.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
217
217
|
if (!old) return old;
|
|
218
218
|
const without = old.messages.filter(
|
|
219
219
|
(m) => m.external_id !== message.external_id && m.external_id !== replaceOptimisticId
|
|
@@ -223,12 +223,12 @@ function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
|
223
223
|
}
|
|
224
224
|
function dropFromThread(queryClient, chatExtId, messageExtId) {
|
|
225
225
|
queryClient.setQueryData(
|
|
226
|
-
|
|
226
|
+
chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId),
|
|
227
227
|
(old) => old ? { ...old, messages: old.messages.filter((m) => m.external_id !== messageExtId) } : old
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
230
|
function replaceInThread(queryClient, chatExtId, message) {
|
|
231
|
-
queryClient.setQueryData(
|
|
231
|
+
queryClient.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
232
232
|
if (!old || !old.messages.some((m) => m.external_id === message.external_id)) return old;
|
|
233
233
|
return {
|
|
234
234
|
...old,
|
|
@@ -238,14 +238,14 @@ function replaceInThread(queryClient, chatExtId, message) {
|
|
|
238
238
|
}
|
|
239
239
|
function patchLastMessage(queryClient, chatExtId, message) {
|
|
240
240
|
queryClient.setQueryData(
|
|
241
|
-
|
|
241
|
+
chunk5QOZLKAY_cjs.arbiQueryKeys.chatList(),
|
|
242
242
|
(old) => old?.map(
|
|
243
243
|
(c) => c.external_id === chatExtId && c.last_message?.external_id === message.external_id ? { ...c, last_message: message } : c
|
|
244
244
|
)
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
async function deleteChatMessage(arbi, queryClient, chatExtId, messageExtId) {
|
|
248
|
-
const thread = queryClient.getQueryData(
|
|
248
|
+
const thread = queryClient.getQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId));
|
|
249
249
|
const before = thread?.messages.find((m) => m.external_id === messageExtId);
|
|
250
250
|
const listed = cachedChat(queryClient, chatExtId);
|
|
251
251
|
const wasLast = listed?.last_message?.external_id === messageExtId ? listed.last_message : null;
|
|
@@ -266,7 +266,7 @@ async function applyChangedMessage(arbi, queryClient, chatExtId, message) {
|
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
268
|
const chat = cachedChat(queryClient, chatExtId);
|
|
269
|
-
if (!chat || !queryClient.getQueryData(
|
|
269
|
+
if (!chat || !queryClient.getQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId))) return;
|
|
270
270
|
try {
|
|
271
271
|
replaceInThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
272
272
|
} catch (err) {
|
|
@@ -278,7 +278,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
278
278
|
const me = myChatId(arbi);
|
|
279
279
|
const chat = cachedChat(queryClient, chatExtId);
|
|
280
280
|
if (!chat) {
|
|
281
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
281
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.chatList() });
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
284
|
const mine = message.sender_ext_id === me;
|
|
@@ -292,7 +292,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
292
292
|
(m) => m.user.external_id === me ? { ...m, last_read_at: message.created_at } : m
|
|
293
293
|
) : chat.members
|
|
294
294
|
});
|
|
295
|
-
if (queryClient.getQueryData(
|
|
295
|
+
if (queryClient.getQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId))) {
|
|
296
296
|
try {
|
|
297
297
|
appendToThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
298
298
|
} catch (err) {
|
|
@@ -303,7 +303,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
303
303
|
function applyChatRead(arbi, queryClient, chatExtId, userExtId, lastReadAt) {
|
|
304
304
|
const me = myChatId(arbi);
|
|
305
305
|
queryClient.setQueryData(
|
|
306
|
-
|
|
306
|
+
chunk5QOZLKAY_cjs.arbiQueryKeys.chatList(),
|
|
307
307
|
(old) => old?.map(
|
|
308
308
|
(c) => c.external_id !== chatExtId ? c : {
|
|
309
309
|
...c,
|
|
@@ -329,14 +329,14 @@ async function applyChatUpdated(arbi, queryClient, chatExtId, message) {
|
|
|
329
329
|
}
|
|
330
330
|
upsertChat(queryClient, chat);
|
|
331
331
|
if (!message)
|
|
332
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
332
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
333
333
|
}
|
|
334
334
|
function applyAgentDmStatus(queryClient, status) {
|
|
335
335
|
if (!["queued", "working", "done", "failed"].includes(status.status)) return;
|
|
336
|
-
queryClient.setQueryData(
|
|
336
|
+
queryClient.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.agentDmStatus(status.agent_ext_id), status);
|
|
337
337
|
if (status.status === "done" || status.status === "failed") {
|
|
338
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
339
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
338
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.calendarQueryKeys.all() });
|
|
339
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.all() });
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
async function applyChatEvent(arbi, queryClient, event) {
|
|
@@ -352,13 +352,13 @@ async function applyChatEvent(arbi, queryClient, event) {
|
|
|
352
352
|
|
|
353
353
|
// src/calls/keys.ts
|
|
354
354
|
function serverCallsExperimental(queryClient) {
|
|
355
|
-
return queryClient.getQueryData(
|
|
355
|
+
return queryClient.getQueryData(chunk5QOZLKAY_cjs.callQueryKeys.config())?.experimental !== false;
|
|
356
356
|
}
|
|
357
357
|
function invalidateCall(queryClient, message) {
|
|
358
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
358
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.call(message.call_ext_id) });
|
|
359
359
|
const thread = message.log_conversation_ext_id;
|
|
360
360
|
if (thread) {
|
|
361
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
361
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.conversationActivity(thread) });
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
|
|
@@ -609,19 +609,19 @@ function applyCallEvent(queryClient, event, options = {}) {
|
|
|
609
609
|
}
|
|
610
610
|
case "call.recording": {
|
|
611
611
|
if (callExtId)
|
|
612
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
612
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
613
613
|
const state2 = browser.calls.recordingStateFrom(m);
|
|
614
614
|
relay("call.recording", callExtId && state2 ? { ...state2, call_ext_id: callExtId } : null);
|
|
615
615
|
return true;
|
|
616
616
|
}
|
|
617
617
|
case "call.recording_updated": {
|
|
618
618
|
if (callExtId)
|
|
619
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
619
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
620
620
|
return true;
|
|
621
621
|
}
|
|
622
622
|
case "call.recording_deleted": {
|
|
623
623
|
if (callExtId)
|
|
624
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
624
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
625
625
|
const recordingExtId = str(m.recording_ext_id);
|
|
626
626
|
relay(
|
|
627
627
|
"call.recording_deleted",
|
|
@@ -914,11 +914,11 @@ function useProfile(options) {
|
|
|
914
914
|
const { client, enabled } = useAccountClient();
|
|
915
915
|
const qc = reactQuery.useQueryClient();
|
|
916
916
|
react.useEffect(
|
|
917
|
-
() => client.onProfileChange(() => qc.setQueryData(
|
|
917
|
+
() => client.onProfileChange(() => qc.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.profile(), client.profile())),
|
|
918
918
|
[client, qc]
|
|
919
919
|
);
|
|
920
920
|
return reactQuery.useQuery({
|
|
921
|
-
queryKey:
|
|
921
|
+
queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.profile(),
|
|
922
922
|
queryFn: () => client.profile(),
|
|
923
923
|
enabled: (options?.enabled ?? true) && enabled,
|
|
924
924
|
staleTime: Infinity
|
|
@@ -933,9 +933,9 @@ function useUpdateProfile() {
|
|
|
933
933
|
return client.profile();
|
|
934
934
|
},
|
|
935
935
|
onSuccess: (profile) => {
|
|
936
|
-
qc.setQueryData(
|
|
937
|
-
void qc.invalidateQueries({ queryKey:
|
|
938
|
-
return qc.invalidateQueries({ queryKey:
|
|
936
|
+
qc.setQueryData(chunk5QOZLKAY_cjs.arbiQueryKeys.profile(), profile);
|
|
937
|
+
void qc.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.identity() });
|
|
938
|
+
return qc.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.workspaces() });
|
|
939
939
|
}
|
|
940
940
|
});
|
|
941
941
|
}
|
|
@@ -1037,7 +1037,7 @@ function arbiAccountClient(arbi, overrides = {}) {
|
|
|
1037
1037
|
if (everywhere) await arbi.sessions.logoutAll();
|
|
1038
1038
|
else await arbi.logout();
|
|
1039
1039
|
} finally {
|
|
1040
|
-
|
|
1040
|
+
chunkBI4SYRLX_cjs.clearSealedDrafts();
|
|
1041
1041
|
chunk5ECKSF6H_cjs.clearChatArtifacts();
|
|
1042
1042
|
await wipeOfflineMail().catch(() => {
|
|
1043
1043
|
});
|
|
@@ -1084,7 +1084,7 @@ var NO_ACCOUNT = {
|
|
|
1084
1084
|
};
|
|
1085
1085
|
var ALWAYS = () => true;
|
|
1086
1086
|
function useAccountClient() {
|
|
1087
|
-
const { account, arbi } =
|
|
1087
|
+
const { account, arbi } = chunk5QOZLKAY_cjs.useArbiHost();
|
|
1088
1088
|
const fallback = react.useMemo(() => arbi ? arbiAccountClient(arbi) : null, [arbi]);
|
|
1089
1089
|
const useEnabled = account?.useEnabled ?? ALWAYS;
|
|
1090
1090
|
const enabled = useEnabled();
|
|
@@ -1095,9 +1095,9 @@ function useAccountClient() {
|
|
|
1095
1095
|
return { client: fallback, enabled: arbi.isLoggedIn };
|
|
1096
1096
|
}
|
|
1097
1097
|
function useEntitlements() {
|
|
1098
|
-
const { arbi } =
|
|
1098
|
+
const { arbi } = chunk5QOZLKAY_cjs.useArbiHost();
|
|
1099
1099
|
return reactQuery.useQuery({
|
|
1100
|
-
queryKey:
|
|
1100
|
+
queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.entitlements(),
|
|
1101
1101
|
queryFn: () => arbi.account.entitlements(),
|
|
1102
1102
|
enabled: !!arbi?.isLoggedIn,
|
|
1103
1103
|
// A plan change shows on the next read; the API enforces it at once either way.
|
|
@@ -1106,7 +1106,7 @@ function useEntitlements() {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
function useInvalidateEntitlements() {
|
|
1108
1108
|
const qc = reactQuery.useQueryClient();
|
|
1109
|
-
return () => qc.invalidateQueries({ queryKey:
|
|
1109
|
+
return () => qc.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.entitlements() });
|
|
1110
1110
|
}
|
|
1111
1111
|
function useIsEntitled(feature) {
|
|
1112
1112
|
const { data } = useEntitlements();
|
|
@@ -1230,8 +1230,8 @@ function ensureMeetingChat(arbi, queryClient, callExtId, callKey) {
|
|
|
1230
1230
|
});
|
|
1231
1231
|
if (!ref) throw new Error("The server did not return a meeting chat");
|
|
1232
1232
|
if (ref.kind === "chat")
|
|
1233
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
1234
|
-
else void
|
|
1233
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.arbiQueryKeys.chatList() });
|
|
1234
|
+
else void chunkBI4SYRLX_cjs.invalidateConversationLists(queryClient);
|
|
1235
1235
|
return ref;
|
|
1236
1236
|
})();
|
|
1237
1237
|
pending.set(callExtId, run);
|
|
@@ -2236,9 +2236,9 @@ async function transcribeRecording(params) {
|
|
|
2236
2236
|
return { stored, failed };
|
|
2237
2237
|
}
|
|
2238
2238
|
function useCallsConfig() {
|
|
2239
|
-
const arbi =
|
|
2239
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2240
2240
|
const { data } = reactQuery.useQuery({
|
|
2241
|
-
queryKey:
|
|
2241
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.config(),
|
|
2242
2242
|
queryFn: () => arbi.calls.config(),
|
|
2243
2243
|
enabled: arbi.isLoggedIn,
|
|
2244
2244
|
staleTime: 5 * 6e4,
|
|
@@ -2256,9 +2256,9 @@ function useCallTranscriptionAvailable() {
|
|
|
2256
2256
|
return useCallsConfig()?.transcription_available === true;
|
|
2257
2257
|
}
|
|
2258
2258
|
function useCall(callExtId) {
|
|
2259
|
-
const arbi =
|
|
2259
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2260
2260
|
return reactQuery.useQuery({
|
|
2261
|
-
queryKey:
|
|
2261
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.call(callExtId ?? ""),
|
|
2262
2262
|
queryFn: () => arbi.calls.get(callExtId),
|
|
2263
2263
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2264
2264
|
staleTime: 6e4,
|
|
@@ -2266,18 +2266,18 @@ function useCall(callExtId) {
|
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
2268
|
function useCallRecordings(callExtId, enabled = true) {
|
|
2269
|
-
const arbi =
|
|
2269
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2270
2270
|
return reactQuery.useQuery({
|
|
2271
|
-
queryKey:
|
|
2271
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recordings(callExtId ?? ""),
|
|
2272
2272
|
queryFn: () => arbi.calls.recording.list(callExtId),
|
|
2273
2273
|
enabled: !!callExtId && enabled && arbi.isLoggedIn,
|
|
2274
2274
|
retry: false
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
2277
|
function useCallRecording(callExtId, recordingExtId) {
|
|
2278
|
-
const arbi =
|
|
2278
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2279
2279
|
return reactQuery.useQuery({
|
|
2280
|
-
queryKey:
|
|
2280
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recording(callExtId ?? "", recordingExtId ?? ""),
|
|
2281
2281
|
queryFn: () => arbi.calls.recording.get(callExtId, recordingExtId),
|
|
2282
2282
|
enabled: !!callExtId && !!recordingExtId && arbi.isLoggedIn,
|
|
2283
2283
|
retry: false
|
|
@@ -2289,21 +2289,21 @@ function useRecordingWindows(callExtId, enabled) {
|
|
|
2289
2289
|
return react.useMemo(() => data ? recordingWindowsOf(data) : NO_WINDOWS, [data]);
|
|
2290
2290
|
}
|
|
2291
2291
|
function useCallInviteLinks(callExtId) {
|
|
2292
|
-
const arbi =
|
|
2292
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2293
2293
|
return reactQuery.useQuery({
|
|
2294
|
-
queryKey:
|
|
2294
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.inviteLinks(callExtId ?? ""),
|
|
2295
2295
|
queryFn: () => arbi.calls.inviteLinks.list(callExtId),
|
|
2296
2296
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2297
2297
|
retry: false
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
2300
|
function useRecordingActions(call) {
|
|
2301
|
-
const arbi =
|
|
2301
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2302
2302
|
const queryClient = reactQuery.useQueryClient();
|
|
2303
2303
|
return react.useMemo(
|
|
2304
2304
|
() => ({
|
|
2305
2305
|
refresh: () => void queryClient.invalidateQueries({
|
|
2306
|
-
queryKey:
|
|
2306
|
+
queryKey: chunk5QOZLKAY_cjs.callQueryKeys.recordingsOf(call.external_id)
|
|
2307
2307
|
}),
|
|
2308
2308
|
open: (recording) => openRecording(arbi, queryClient, call, recording.external_id, recording),
|
|
2309
2309
|
transcribe: async (opened, onProgress) => transcribeRecording({
|
|
@@ -2319,12 +2319,12 @@ function useRecordingActions(call) {
|
|
|
2319
2319
|
);
|
|
2320
2320
|
}
|
|
2321
2321
|
function useRevokeCallInviteLink(callExtId) {
|
|
2322
|
-
const arbi =
|
|
2322
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2323
2323
|
const queryClient = reactQuery.useQueryClient();
|
|
2324
2324
|
return react.useCallback(
|
|
2325
2325
|
async (inviteExtId) => {
|
|
2326
2326
|
await arbi.calls.inviteLinks.revoke(callExtId, inviteExtId);
|
|
2327
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
2327
|
+
void queryClient.invalidateQueries({ queryKey: chunk5QOZLKAY_cjs.callQueryKeys.inviteLinks(callExtId) });
|
|
2328
2328
|
},
|
|
2329
2329
|
[arbi, queryClient, callExtId]
|
|
2330
2330
|
);
|
|
@@ -2382,12 +2382,12 @@ async function saveRecordingFilesToThread(arbi, params) {
|
|
|
2382
2382
|
});
|
|
2383
2383
|
}
|
|
2384
2384
|
function useSaveToThread() {
|
|
2385
|
-
const arbi =
|
|
2385
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2386
2386
|
const queryClient = reactQuery.useQueryClient();
|
|
2387
2387
|
return react.useMemo(() => {
|
|
2388
2388
|
const thenRefresh = async (run) => {
|
|
2389
2389
|
const result = await run;
|
|
2390
|
-
void
|
|
2390
|
+
void chunkBI4SYRLX_cjs.invalidateConversationLists(queryClient);
|
|
2391
2391
|
return result;
|
|
2392
2392
|
};
|
|
2393
2393
|
return {
|
|
@@ -2669,9 +2669,9 @@ function isWorkspaceGuestOf(workspaces, workspaceExtId, me) {
|
|
|
2669
2669
|
return workspace?.users?.find((wu) => wu.user.external_id === me)?.role === "guest";
|
|
2670
2670
|
}
|
|
2671
2671
|
function useMeetingReadOnly(lockedWorkspaceExtId) {
|
|
2672
|
-
const arbi =
|
|
2672
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2673
2673
|
const me = arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
|
|
2674
|
-
const { data: workspaces } =
|
|
2674
|
+
const { data: workspaces } = chunkBI4SYRLX_cjs.useWorkspaces({
|
|
2675
2675
|
enabled: !!lockedWorkspaceExtId && arbi.isLoggedIn
|
|
2676
2676
|
});
|
|
2677
2677
|
return isWorkspaceGuestOf(
|
|
@@ -2694,9 +2694,9 @@ function useCanHostCalls() {
|
|
|
2694
2694
|
return callsEnabled && entitled;
|
|
2695
2695
|
}
|
|
2696
2696
|
function useOpenCallMeetingChat() {
|
|
2697
|
-
const arbi =
|
|
2697
|
+
const arbi = chunk5QOZLKAY_cjs.useArbi();
|
|
2698
2698
|
const queryClient = reactQuery.useQueryClient();
|
|
2699
|
-
const open =
|
|
2699
|
+
const open = chunk5QOZLKAY_cjs.useArbiHost().calls?.openMeetingChat;
|
|
2700
2700
|
return react.useCallback(
|
|
2701
2701
|
async (target) => {
|
|
2702
2702
|
try {
|
|
@@ -2924,5 +2924,5 @@ exports.useUserSettings = useUserSettings;
|
|
|
2924
2924
|
exports.wipeOfflineMail = wipeOfflineMail;
|
|
2925
2925
|
exports.wrapTrackKey = wrapTrackKey;
|
|
2926
2926
|
exports.writeSamples = writeSamples;
|
|
2927
|
-
//# sourceMappingURL=chunk-
|
|
2928
|
-
//# sourceMappingURL=chunk-
|
|
2927
|
+
//# sourceMappingURL=chunk-4TWXQFHU.cjs.map
|
|
2928
|
+
//# sourceMappingURL=chunk-4TWXQFHU.cjs.map
|