@arbidocs/react 0.5.97 → 0.5.98
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/README.md +6 -1
- package/dist/artifacts/index.cjs +13 -13
- package/dist/artifacts/index.js +3 -3
- package/dist/calls/livekit/index.cjs +48 -48
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-IIOOXKOB.js → chunk-4SH5INC3.js} +4 -4
- package/dist/{chunk-IIOOXKOB.js.map → chunk-4SH5INC3.js.map} +1 -1
- package/dist/{chunk-NJDVQIJR.cjs → chunk-5EELSW26.cjs} +4 -4
- package/dist/{chunk-NJDVQIJR.cjs.map → chunk-5EELSW26.cjs.map} +1 -1
- package/dist/{chunk-HGLS3IC6.js → chunk-5X3JANHT.js} +3 -3
- package/dist/{chunk-HGLS3IC6.js.map → chunk-5X3JANHT.js.map} +1 -1
- package/dist/{chunk-7PMNITKA.js → chunk-6SG2OGDR.js} +11 -2
- package/dist/chunk-6SG2OGDR.js.map +1 -0
- package/dist/{chunk-5RRWRTY3.js → chunk-ALT6ETIE.js} +39 -6
- package/dist/chunk-ALT6ETIE.js.map +1 -0
- package/dist/{chunk-BRFRQWAY.cjs → chunk-HAGC67GL.cjs} +11 -2
- package/dist/chunk-HAGC67GL.cjs.map +1 -0
- package/dist/{chunk-6BXRZYL2.cjs → chunk-ORBUPHMV.cjs} +38 -38
- package/dist/{chunk-6BXRZYL2.cjs.map → chunk-ORBUPHMV.cjs.map} +1 -1
- package/dist/{chunk-7RUVJZZG.cjs → chunk-Q65QCWNI.cjs} +57 -57
- package/dist/{chunk-7RUVJZZG.cjs.map → chunk-Q65QCWNI.cjs.map} +1 -1
- package/dist/{chunk-NR6PUE5O.cjs → chunk-VIOW22Q4.cjs} +44 -44
- package/dist/{chunk-NR6PUE5O.cjs.map → chunk-VIOW22Q4.cjs.map} +1 -1
- package/dist/{chunk-CSYZ3YI4.cjs → chunk-WJME7DI4.cjs} +99 -65
- package/dist/chunk-WJME7DI4.cjs.map +1 -0
- package/dist/{chunk-KZBYWXPS.js → chunk-YIZH5RVW.js} +3 -3
- package/dist/{chunk-KZBYWXPS.js.map → chunk-YIZH5RVW.js.map} +1 -1
- package/dist/{chunk-N3SFVZ7H.js → chunk-ZEGCZATR.js} +3 -3
- package/dist/{chunk-N3SFVZ7H.js.map → chunk-ZEGCZATR.js.map} +1 -1
- package/dist/document-tools/core.cjs +98 -98
- package/dist/document-tools/core.d.cts +2 -2
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/core.js +3 -3
- package/dist/document-tools/index.cjs +100 -100
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +4 -4
- package/dist/index.cjs +1693 -1320
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +221 -9
- package/dist/index.d.ts +221 -9
- package/dist/index.js +406 -50
- package/dist/index.js.map +1 -1
- package/dist/{query-keys.d-D6SAUl7S.d.ts → query-keys.d-O3lHn6rp.d.cts} +9 -0
- package/dist/{query-keys.d-D6SAUl7S.d.cts → query-keys.d-O3lHn6rp.d.ts} +9 -0
- package/package.json +3 -3
- package/dist/chunk-5RRWRTY3.js.map +0 -1
- package/dist/chunk-7PMNITKA.js.map +0 -1
- package/dist/chunk-BRFRQWAY.cjs.map +0 -1
- package/dist/chunk-CSYZ3YI4.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkQ65QCWNI_cjs = require('./chunk-Q65QCWNI.cjs');
|
|
4
|
+
var chunkHAGC67GL_cjs = require('./chunk-HAGC67GL.cjs');
|
|
5
5
|
var chunkRLSBRZ6Z_cjs = require('./chunk-RLSBRZ6Z.cjs');
|
|
6
6
|
var chunkEEIYXVM4_cjs = require('./chunk-EEIYXVM4.cjs');
|
|
7
7
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -10,9 +10,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 = chunkHAGC67GL_cjs.useArbi();
|
|
14
14
|
return reactQuery.useQuery({
|
|
15
|
-
queryKey:
|
|
15
|
+
queryKey: chunkHAGC67GL_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,
|
|
@@ -20,23 +20,23 @@ function useUserSettings(options) {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
function useUpdateUserSettings() {
|
|
23
|
-
const arbi =
|
|
23
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
24
24
|
const qc = reactQuery.useQueryClient();
|
|
25
25
|
return reactQuery.useMutation({
|
|
26
26
|
mutationFn: (patch) => arbi.settings.update(patch),
|
|
27
27
|
onMutate: async (patch) => {
|
|
28
|
-
await qc.cancelQueries({ queryKey:
|
|
29
|
-
const previous = qc.getQueryData(
|
|
28
|
+
await qc.cancelQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.userSettings() });
|
|
29
|
+
const previous = qc.getQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.userSettings());
|
|
30
30
|
qc.setQueryData(
|
|
31
|
-
|
|
31
|
+
chunkHAGC67GL_cjs.arbiQueryKeys.userSettings(),
|
|
32
32
|
(old) => old ? { ...old, ...patch } : old
|
|
33
33
|
);
|
|
34
34
|
return { previous };
|
|
35
35
|
},
|
|
36
36
|
onError: (_err, _patch, context) => {
|
|
37
|
-
qc.setQueryData(
|
|
37
|
+
qc.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.userSettings(), context?.previous);
|
|
38
38
|
},
|
|
39
|
-
onSettled: () => qc.invalidateQueries({ queryKey:
|
|
39
|
+
onSettled: () => qc.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.userSettings() })
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
var ALWAYS_ON = { on: true, set: () => {
|
|
@@ -59,13 +59,46 @@ function useLocalSwitch(source, feature) {
|
|
|
59
59
|
return { on: saved ?? fallback, set };
|
|
60
60
|
}
|
|
61
61
|
function useFeatureSwitch(feature) {
|
|
62
|
-
const source =
|
|
62
|
+
const source = chunkHAGC67GL_cjs.useArbiHost().features?.[feature];
|
|
63
63
|
const useSource = !source ? useUnlisted : "userSetting" in source ? useUserSettingSwitch : useLocalSwitch;
|
|
64
64
|
return useSource(source, feature);
|
|
65
65
|
}
|
|
66
66
|
function useFeature(feature) {
|
|
67
67
|
return useFeatureSwitch(feature).on;
|
|
68
68
|
}
|
|
69
|
+
function useNoSettings() {
|
|
70
|
+
return { data: void 0 };
|
|
71
|
+
}
|
|
72
|
+
function useFeatureCheck() {
|
|
73
|
+
const features = chunkHAGC67GL_cjs.useArbiHost().features;
|
|
74
|
+
const useSettings = Object.values(features ?? {}).some(
|
|
75
|
+
(source) => !!source && "userSetting" in source
|
|
76
|
+
) ? useUserSettings : useNoSettings;
|
|
77
|
+
const { data } = useSettings();
|
|
78
|
+
const locals = react.useMemo(() => {
|
|
79
|
+
const entries = Object.entries(features ?? {}).filter(
|
|
80
|
+
(entry) => !!entry[1] && "local" in entry[1]
|
|
81
|
+
);
|
|
82
|
+
return {
|
|
83
|
+
subscribe: (listener) => {
|
|
84
|
+
const stops = [...new Set(entries.map(([, source]) => source.local))].map(
|
|
85
|
+
(store2) => store2.subscribe(listener)
|
|
86
|
+
);
|
|
87
|
+
return () => stops.forEach((stop) => stop());
|
|
88
|
+
},
|
|
89
|
+
// A primitive snapshot, so an unrelated store write does not re-render.
|
|
90
|
+
snapshot: () => entries.map(([name, source]) => `${source.local.get(name)}`).join(",")
|
|
91
|
+
};
|
|
92
|
+
}, [features]);
|
|
93
|
+
react.useSyncExternalStore(locals.subscribe, locals.snapshot, locals.snapshot);
|
|
94
|
+
return (feature) => {
|
|
95
|
+
const source = features?.[feature];
|
|
96
|
+
if (!source) return true;
|
|
97
|
+
if ("local" in source) return source.local.get(feature) ?? source.default;
|
|
98
|
+
const saved = data?.[source.userSetting];
|
|
99
|
+
return saved ?? source.default;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
69
102
|
function readLocalFeature(features, feature) {
|
|
70
103
|
const source = features[feature];
|
|
71
104
|
if (!source) return true;
|
|
@@ -149,7 +182,7 @@ var LISTS = {
|
|
|
149
182
|
};
|
|
150
183
|
function patchConversationList(queryClient, workspaceId, reducer) {
|
|
151
184
|
if (!workspaceId) return;
|
|
152
|
-
const key =
|
|
185
|
+
const key = chunkHAGC67GL_cjs.arbiQueryKeys.conversations(workspaceId);
|
|
153
186
|
const current = queryClient.getQueryData(key) ?? [];
|
|
154
187
|
const next = reducer(current);
|
|
155
188
|
if (next !== current) queryClient.setQueryData(key, next);
|
|
@@ -213,13 +246,13 @@ function byActivity(a, b) {
|
|
|
213
246
|
return bt - at;
|
|
214
247
|
}
|
|
215
248
|
function cachedChats(queryClient) {
|
|
216
|
-
return queryClient.getQueryData(
|
|
249
|
+
return queryClient.getQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatList()) ?? [];
|
|
217
250
|
}
|
|
218
251
|
function cachedChat(queryClient, chatExtId) {
|
|
219
252
|
return cachedChats(queryClient).find((c) => c.external_id === chatExtId);
|
|
220
253
|
}
|
|
221
254
|
function upsertChat(queryClient, chat) {
|
|
222
|
-
queryClient.setQueryData(
|
|
255
|
+
queryClient.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatList(), (old) => {
|
|
223
256
|
if (!old) return old;
|
|
224
257
|
const rest = old.filter((c) => c.external_id !== chat.external_id);
|
|
225
258
|
return [chat, ...rest].sort(byActivity);
|
|
@@ -227,13 +260,13 @@ function upsertChat(queryClient, chat) {
|
|
|
227
260
|
}
|
|
228
261
|
function removeChat(queryClient, chatExtId) {
|
|
229
262
|
queryClient.setQueryData(
|
|
230
|
-
|
|
263
|
+
chunkHAGC67GL_cjs.arbiQueryKeys.chatList(),
|
|
231
264
|
(old) => old?.filter((c) => c.external_id !== chatExtId)
|
|
232
265
|
);
|
|
233
|
-
queryClient.removeQueries({ queryKey:
|
|
266
|
+
queryClient.removeQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
234
267
|
}
|
|
235
268
|
function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
236
|
-
queryClient.setQueryData(
|
|
269
|
+
queryClient.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
237
270
|
if (!old) return old;
|
|
238
271
|
const without = old.messages.filter(
|
|
239
272
|
(m) => m.external_id !== message.external_id && m.external_id !== replaceOptimisticId
|
|
@@ -243,12 +276,12 @@ function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
|
243
276
|
}
|
|
244
277
|
function dropFromThread(queryClient, chatExtId, messageExtId) {
|
|
245
278
|
queryClient.setQueryData(
|
|
246
|
-
|
|
279
|
+
chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId),
|
|
247
280
|
(old) => old ? { ...old, messages: old.messages.filter((m) => m.external_id !== messageExtId) } : old
|
|
248
281
|
);
|
|
249
282
|
}
|
|
250
283
|
function replaceInThread(queryClient, chatExtId, message) {
|
|
251
|
-
queryClient.setQueryData(
|
|
284
|
+
queryClient.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
252
285
|
if (!old || !old.messages.some((m) => m.external_id === message.external_id)) return old;
|
|
253
286
|
return {
|
|
254
287
|
...old,
|
|
@@ -258,14 +291,14 @@ function replaceInThread(queryClient, chatExtId, message) {
|
|
|
258
291
|
}
|
|
259
292
|
function patchLastMessage(queryClient, chatExtId, message) {
|
|
260
293
|
queryClient.setQueryData(
|
|
261
|
-
|
|
294
|
+
chunkHAGC67GL_cjs.arbiQueryKeys.chatList(),
|
|
262
295
|
(old) => old?.map(
|
|
263
296
|
(c) => c.external_id === chatExtId && c.last_message?.external_id === message.external_id ? { ...c, last_message: message } : c
|
|
264
297
|
)
|
|
265
298
|
);
|
|
266
299
|
}
|
|
267
300
|
async function deleteChatMessage(arbi, queryClient, chatExtId, messageExtId) {
|
|
268
|
-
const thread = queryClient.getQueryData(
|
|
301
|
+
const thread = queryClient.getQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId));
|
|
269
302
|
const before = thread?.messages.find((m) => m.external_id === messageExtId);
|
|
270
303
|
const listed = cachedChat(queryClient, chatExtId);
|
|
271
304
|
const wasLast = listed?.last_message?.external_id === messageExtId ? listed.last_message : null;
|
|
@@ -286,7 +319,7 @@ async function applyChangedMessage(arbi, queryClient, chatExtId, message) {
|
|
|
286
319
|
return;
|
|
287
320
|
}
|
|
288
321
|
const chat = cachedChat(queryClient, chatExtId);
|
|
289
|
-
if (!chat || !queryClient.getQueryData(
|
|
322
|
+
if (!chat || !queryClient.getQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId))) return;
|
|
290
323
|
try {
|
|
291
324
|
replaceInThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
292
325
|
} catch (err) {
|
|
@@ -298,7 +331,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
298
331
|
const me = myChatId(arbi);
|
|
299
332
|
const chat = cachedChat(queryClient, chatExtId);
|
|
300
333
|
if (!chat) {
|
|
301
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
334
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.chatList() });
|
|
302
335
|
return;
|
|
303
336
|
}
|
|
304
337
|
const mine = message.sender_ext_id === me;
|
|
@@ -312,7 +345,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
312
345
|
(m) => m.user.external_id === me ? { ...m, last_read_at: message.created_at } : m
|
|
313
346
|
) : chat.members
|
|
314
347
|
});
|
|
315
|
-
if (queryClient.getQueryData(
|
|
348
|
+
if (queryClient.getQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId))) {
|
|
316
349
|
try {
|
|
317
350
|
appendToThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
318
351
|
} catch (err) {
|
|
@@ -323,7 +356,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
323
356
|
function applyChatRead(arbi, queryClient, chatExtId, userExtId, lastReadAt) {
|
|
324
357
|
const me = myChatId(arbi);
|
|
325
358
|
queryClient.setQueryData(
|
|
326
|
-
|
|
359
|
+
chunkHAGC67GL_cjs.arbiQueryKeys.chatList(),
|
|
327
360
|
(old) => old?.map(
|
|
328
361
|
(c) => c.external_id !== chatExtId ? c : {
|
|
329
362
|
...c,
|
|
@@ -349,11 +382,11 @@ async function applyChatUpdated(arbi, queryClient, chatExtId, message) {
|
|
|
349
382
|
}
|
|
350
383
|
upsertChat(queryClient, chat);
|
|
351
384
|
if (!message)
|
|
352
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
385
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
353
386
|
}
|
|
354
387
|
function applyAgentDmStatus(queryClient, status) {
|
|
355
388
|
if (!["queued", "working", "done", "failed"].includes(status.status)) return;
|
|
356
|
-
queryClient.setQueryData(
|
|
389
|
+
queryClient.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.agentDmStatus(status.agent_ext_id), status);
|
|
357
390
|
}
|
|
358
391
|
async function applyChatEvent(arbi, queryClient, event) {
|
|
359
392
|
const e = event;
|
|
@@ -368,13 +401,13 @@ async function applyChatEvent(arbi, queryClient, event) {
|
|
|
368
401
|
|
|
369
402
|
// src/calls/keys.ts
|
|
370
403
|
function serverCallsExperimental(queryClient) {
|
|
371
|
-
return queryClient.getQueryData(
|
|
404
|
+
return queryClient.getQueryData(chunkHAGC67GL_cjs.callQueryKeys.config())?.experimental !== false;
|
|
372
405
|
}
|
|
373
406
|
function invalidateCall(queryClient, message) {
|
|
374
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
407
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.callQueryKeys.call(message.call_ext_id) });
|
|
375
408
|
const thread = message.log_conversation_ext_id;
|
|
376
409
|
if (thread) {
|
|
377
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
410
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.conversationActivity(thread) });
|
|
378
411
|
}
|
|
379
412
|
}
|
|
380
413
|
|
|
@@ -625,19 +658,19 @@ function applyCallEvent(queryClient, event, options = {}) {
|
|
|
625
658
|
}
|
|
626
659
|
case "call.recording": {
|
|
627
660
|
if (callExtId)
|
|
628
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
661
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
629
662
|
const state2 = browser.calls.recordingStateFrom(m);
|
|
630
663
|
relay("call.recording", callExtId && state2 ? { ...state2, call_ext_id: callExtId } : null);
|
|
631
664
|
return true;
|
|
632
665
|
}
|
|
633
666
|
case "call.recording_updated": {
|
|
634
667
|
if (callExtId)
|
|
635
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
668
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
636
669
|
return true;
|
|
637
670
|
}
|
|
638
671
|
case "call.recording_deleted": {
|
|
639
672
|
if (callExtId)
|
|
640
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
673
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
641
674
|
const recordingExtId = str(m.recording_ext_id);
|
|
642
675
|
relay(
|
|
643
676
|
"call.recording_deleted",
|
|
@@ -930,11 +963,11 @@ function useProfile(options) {
|
|
|
930
963
|
const { client, enabled } = useAccountClient();
|
|
931
964
|
const qc = reactQuery.useQueryClient();
|
|
932
965
|
react.useEffect(
|
|
933
|
-
() => client.onProfileChange(() => qc.setQueryData(
|
|
966
|
+
() => client.onProfileChange(() => qc.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.profile(), client.profile())),
|
|
934
967
|
[client, qc]
|
|
935
968
|
);
|
|
936
969
|
return reactQuery.useQuery({
|
|
937
|
-
queryKey:
|
|
970
|
+
queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.profile(),
|
|
938
971
|
queryFn: () => client.profile(),
|
|
939
972
|
enabled: (options?.enabled ?? true) && enabled,
|
|
940
973
|
staleTime: Infinity
|
|
@@ -949,9 +982,9 @@ function useUpdateProfile() {
|
|
|
949
982
|
return client.profile();
|
|
950
983
|
},
|
|
951
984
|
onSuccess: (profile) => {
|
|
952
|
-
qc.setQueryData(
|
|
953
|
-
void qc.invalidateQueries({ queryKey:
|
|
954
|
-
return qc.invalidateQueries({ queryKey:
|
|
985
|
+
qc.setQueryData(chunkHAGC67GL_cjs.arbiQueryKeys.profile(), profile);
|
|
986
|
+
void qc.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.identity() });
|
|
987
|
+
return qc.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.workspaces() });
|
|
955
988
|
}
|
|
956
989
|
});
|
|
957
990
|
}
|
|
@@ -1053,7 +1086,7 @@ function arbiAccountClient(arbi, overrides = {}) {
|
|
|
1053
1086
|
if (everywhere) await arbi.sessions.logoutAll();
|
|
1054
1087
|
else await arbi.logout();
|
|
1055
1088
|
} finally {
|
|
1056
|
-
|
|
1089
|
+
chunkQ65QCWNI_cjs.clearSealedDrafts();
|
|
1057
1090
|
chunkRLSBRZ6Z_cjs.clearChatArtifacts();
|
|
1058
1091
|
await wipeOfflineMail().catch(() => {
|
|
1059
1092
|
});
|
|
@@ -1100,7 +1133,7 @@ var NO_ACCOUNT = {
|
|
|
1100
1133
|
};
|
|
1101
1134
|
var ALWAYS = () => true;
|
|
1102
1135
|
function useAccountClient() {
|
|
1103
|
-
const { account, arbi } =
|
|
1136
|
+
const { account, arbi } = chunkHAGC67GL_cjs.useArbiHost();
|
|
1104
1137
|
const fallback = react.useMemo(() => arbi ? arbiAccountClient(arbi) : null, [arbi]);
|
|
1105
1138
|
const useEnabled = account?.useEnabled ?? ALWAYS;
|
|
1106
1139
|
const enabled = useEnabled();
|
|
@@ -1111,9 +1144,9 @@ function useAccountClient() {
|
|
|
1111
1144
|
return { client: fallback, enabled: arbi.isLoggedIn };
|
|
1112
1145
|
}
|
|
1113
1146
|
function useEntitlements() {
|
|
1114
|
-
const { arbi } =
|
|
1147
|
+
const { arbi } = chunkHAGC67GL_cjs.useArbiHost();
|
|
1115
1148
|
return reactQuery.useQuery({
|
|
1116
|
-
queryKey:
|
|
1149
|
+
queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.entitlements(),
|
|
1117
1150
|
queryFn: () => arbi.account.entitlements(),
|
|
1118
1151
|
enabled: !!arbi?.isLoggedIn,
|
|
1119
1152
|
// A plan change shows on the next read; the API enforces it at once either way.
|
|
@@ -1122,7 +1155,7 @@ function useEntitlements() {
|
|
|
1122
1155
|
}
|
|
1123
1156
|
function useInvalidateEntitlements() {
|
|
1124
1157
|
const qc = reactQuery.useQueryClient();
|
|
1125
|
-
return () => qc.invalidateQueries({ queryKey:
|
|
1158
|
+
return () => qc.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.entitlements() });
|
|
1126
1159
|
}
|
|
1127
1160
|
function useIsEntitled(feature) {
|
|
1128
1161
|
const { data } = useEntitlements();
|
|
@@ -1246,7 +1279,7 @@ function ensureMeetingChat(arbi, queryClient, callExtId, callKey) {
|
|
|
1246
1279
|
});
|
|
1247
1280
|
if (!ref) throw new Error("The server did not return a meeting chat");
|
|
1248
1281
|
if (ref.kind === "chat")
|
|
1249
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
1282
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.arbiQueryKeys.chatList() });
|
|
1250
1283
|
else void invalidateConversationLists(queryClient);
|
|
1251
1284
|
return ref;
|
|
1252
1285
|
})();
|
|
@@ -2252,9 +2285,9 @@ async function transcribeRecording(params) {
|
|
|
2252
2285
|
return { stored, failed };
|
|
2253
2286
|
}
|
|
2254
2287
|
function useCallsConfig() {
|
|
2255
|
-
const arbi =
|
|
2288
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2256
2289
|
const { data } = reactQuery.useQuery({
|
|
2257
|
-
queryKey:
|
|
2290
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.config(),
|
|
2258
2291
|
queryFn: () => arbi.calls.config(),
|
|
2259
2292
|
enabled: arbi.isLoggedIn,
|
|
2260
2293
|
staleTime: 5 * 6e4,
|
|
@@ -2272,9 +2305,9 @@ function useCallTranscriptionAvailable() {
|
|
|
2272
2305
|
return useCallsConfig()?.transcription_available === true;
|
|
2273
2306
|
}
|
|
2274
2307
|
function useCall(callExtId) {
|
|
2275
|
-
const arbi =
|
|
2308
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2276
2309
|
return reactQuery.useQuery({
|
|
2277
|
-
queryKey:
|
|
2310
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.call(callExtId ?? ""),
|
|
2278
2311
|
queryFn: () => arbi.calls.get(callExtId),
|
|
2279
2312
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2280
2313
|
staleTime: 6e4,
|
|
@@ -2282,18 +2315,18 @@ function useCall(callExtId) {
|
|
|
2282
2315
|
});
|
|
2283
2316
|
}
|
|
2284
2317
|
function useCallRecordings(callExtId, enabled = true) {
|
|
2285
|
-
const arbi =
|
|
2318
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2286
2319
|
return reactQuery.useQuery({
|
|
2287
|
-
queryKey:
|
|
2320
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.recordings(callExtId ?? ""),
|
|
2288
2321
|
queryFn: () => arbi.calls.recording.list(callExtId),
|
|
2289
2322
|
enabled: !!callExtId && enabled && arbi.isLoggedIn,
|
|
2290
2323
|
retry: false
|
|
2291
2324
|
});
|
|
2292
2325
|
}
|
|
2293
2326
|
function useCallRecording(callExtId, recordingExtId) {
|
|
2294
|
-
const arbi =
|
|
2327
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2295
2328
|
return reactQuery.useQuery({
|
|
2296
|
-
queryKey:
|
|
2329
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.recording(callExtId ?? "", recordingExtId ?? ""),
|
|
2297
2330
|
queryFn: () => arbi.calls.recording.get(callExtId, recordingExtId),
|
|
2298
2331
|
enabled: !!callExtId && !!recordingExtId && arbi.isLoggedIn,
|
|
2299
2332
|
retry: false
|
|
@@ -2305,21 +2338,21 @@ function useRecordingWindows(callExtId, enabled) {
|
|
|
2305
2338
|
return react.useMemo(() => data ? recordingWindowsOf(data) : NO_WINDOWS, [data]);
|
|
2306
2339
|
}
|
|
2307
2340
|
function useCallInviteLinks(callExtId) {
|
|
2308
|
-
const arbi =
|
|
2341
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2309
2342
|
return reactQuery.useQuery({
|
|
2310
|
-
queryKey:
|
|
2343
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.inviteLinks(callExtId ?? ""),
|
|
2311
2344
|
queryFn: () => arbi.calls.inviteLinks.list(callExtId),
|
|
2312
2345
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2313
2346
|
retry: false
|
|
2314
2347
|
});
|
|
2315
2348
|
}
|
|
2316
2349
|
function useRecordingActions(call) {
|
|
2317
|
-
const arbi =
|
|
2350
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2318
2351
|
const queryClient = reactQuery.useQueryClient();
|
|
2319
2352
|
return react.useMemo(
|
|
2320
2353
|
() => ({
|
|
2321
2354
|
refresh: () => void queryClient.invalidateQueries({
|
|
2322
|
-
queryKey:
|
|
2355
|
+
queryKey: chunkHAGC67GL_cjs.callQueryKeys.recordingsOf(call.external_id)
|
|
2323
2356
|
}),
|
|
2324
2357
|
open: (recording) => openRecording(arbi, queryClient, call, recording.external_id, recording),
|
|
2325
2358
|
transcribe: async (opened, onProgress) => transcribeRecording({
|
|
@@ -2335,12 +2368,12 @@ function useRecordingActions(call) {
|
|
|
2335
2368
|
);
|
|
2336
2369
|
}
|
|
2337
2370
|
function useRevokeCallInviteLink(callExtId) {
|
|
2338
|
-
const arbi =
|
|
2371
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2339
2372
|
const queryClient = reactQuery.useQueryClient();
|
|
2340
2373
|
return react.useCallback(
|
|
2341
2374
|
async (inviteExtId) => {
|
|
2342
2375
|
await arbi.calls.inviteLinks.revoke(callExtId, inviteExtId);
|
|
2343
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
2376
|
+
void queryClient.invalidateQueries({ queryKey: chunkHAGC67GL_cjs.callQueryKeys.inviteLinks(callExtId) });
|
|
2344
2377
|
},
|
|
2345
2378
|
[arbi, queryClient, callExtId]
|
|
2346
2379
|
);
|
|
@@ -2398,7 +2431,7 @@ async function saveRecordingFilesToThread(arbi, params) {
|
|
|
2398
2431
|
});
|
|
2399
2432
|
}
|
|
2400
2433
|
function useSaveToThread() {
|
|
2401
|
-
const arbi =
|
|
2434
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2402
2435
|
const queryClient = reactQuery.useQueryClient();
|
|
2403
2436
|
return react.useMemo(() => {
|
|
2404
2437
|
const thenRefresh = async (run) => {
|
|
@@ -2685,9 +2718,9 @@ function isWorkspaceGuestOf(workspaces, workspaceExtId, me) {
|
|
|
2685
2718
|
return workspace?.users?.find((wu) => wu.user.external_id === me)?.role === "guest";
|
|
2686
2719
|
}
|
|
2687
2720
|
function useMeetingReadOnly(lockedWorkspaceExtId) {
|
|
2688
|
-
const arbi =
|
|
2721
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2689
2722
|
const me = arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
|
|
2690
|
-
const { data: workspaces } =
|
|
2723
|
+
const { data: workspaces } = chunkQ65QCWNI_cjs.useWorkspaces({
|
|
2691
2724
|
enabled: !!lockedWorkspaceExtId && arbi.isLoggedIn
|
|
2692
2725
|
});
|
|
2693
2726
|
return isWorkspaceGuestOf(
|
|
@@ -2710,9 +2743,9 @@ function useCanHostCalls() {
|
|
|
2710
2743
|
return callsEnabled && entitled;
|
|
2711
2744
|
}
|
|
2712
2745
|
function useOpenCallMeetingChat() {
|
|
2713
|
-
const arbi =
|
|
2746
|
+
const arbi = chunkHAGC67GL_cjs.useArbi();
|
|
2714
2747
|
const queryClient = reactQuery.useQueryClient();
|
|
2715
|
-
const open =
|
|
2748
|
+
const open = chunkHAGC67GL_cjs.useArbiHost().calls?.openMeetingChat;
|
|
2716
2749
|
return react.useCallback(
|
|
2717
2750
|
async (target) => {
|
|
2718
2751
|
try {
|
|
@@ -2929,6 +2962,7 @@ exports.useCallsEnabled = useCallsEnabled;
|
|
|
2929
2962
|
exports.useCanHostCalls = useCanHostCalls;
|
|
2930
2963
|
exports.useEntitlements = useEntitlements;
|
|
2931
2964
|
exports.useFeature = useFeature;
|
|
2965
|
+
exports.useFeatureCheck = useFeatureCheck;
|
|
2932
2966
|
exports.useFeatureSwitch = useFeatureSwitch;
|
|
2933
2967
|
exports.useInvalidateEntitlements = useInvalidateEntitlements;
|
|
2934
2968
|
exports.useIsEntitled = useIsEntitled;
|
|
@@ -2948,5 +2982,5 @@ exports.useUserSettings = useUserSettings;
|
|
|
2948
2982
|
exports.wipeOfflineMail = wipeOfflineMail;
|
|
2949
2983
|
exports.wrapTrackKey = wrapTrackKey;
|
|
2950
2984
|
exports.writeSamples = writeSamples;
|
|
2951
|
-
//# sourceMappingURL=chunk-
|
|
2952
|
-
//# sourceMappingURL=chunk-
|
|
2985
|
+
//# sourceMappingURL=chunk-WJME7DI4.cjs.map
|
|
2986
|
+
//# sourceMappingURL=chunk-WJME7DI4.cjs.map
|