@arbidocs/react 0.5.24 → 0.5.26
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/artifacts/index.cjs +11 -11
- package/dist/artifacts/index.js +5 -5
- package/dist/calls/livekit/index.cjs +50 -50
- package/dist/calls/livekit/index.js +5 -5
- package/dist/{chunk-4UDIA47U.cjs → chunk-2ERRXEOB.cjs} +15 -15
- package/dist/{chunk-4UDIA47U.cjs.map → chunk-2ERRXEOB.cjs.map} +1 -1
- package/dist/{chunk-TUKW4MCI.cjs → chunk-AXZF5ODQ.cjs} +34 -24
- package/dist/chunk-AXZF5ODQ.cjs.map +1 -0
- package/dist/{chunk-FLAZSNC5.cjs → chunk-GSOAMP6Z.cjs} +32 -32
- package/dist/{chunk-FLAZSNC5.cjs.map → chunk-GSOAMP6Z.cjs.map} +1 -1
- package/dist/{chunk-YBIW7T66.cjs → chunk-HMSAYMMX.cjs} +7 -5
- package/dist/chunk-HMSAYMMX.cjs.map +1 -0
- package/dist/{chunk-5YWIUUUT.cjs → chunk-KC474WVG.cjs} +12 -2
- package/dist/chunk-KC474WVG.cjs.map +1 -0
- package/dist/{chunk-2HVCNYFH.js → chunk-KOLCL4KV.js} +3 -3
- package/dist/{chunk-2HVCNYFH.js.map → chunk-KOLCL4KV.js.map} +1 -1
- package/dist/{chunk-3WIBD44F.js → chunk-KTHMMF2M.js} +7 -4
- package/dist/chunk-KTHMMF2M.js.map +1 -0
- package/dist/{chunk-I4WI3MNH.js → chunk-LTEMUGPQ.js} +17 -9
- package/dist/chunk-LTEMUGPQ.js.map +1 -0
- package/dist/{chunk-KGCGA452.js → chunk-MB34NKBZ.js} +2 -2
- package/dist/{chunk-KGCGA452.js.map → chunk-MB34NKBZ.js.map} +1 -1
- package/dist/{chunk-CZP7FF3E.cjs → chunk-ONGNP4JM.cjs} +4 -4
- package/dist/{chunk-CZP7FF3E.cjs.map → chunk-ONGNP4JM.cjs.map} +1 -1
- package/dist/{chunk-KRAUMKBG.js → chunk-QQLCQP24.js} +5 -3
- package/dist/chunk-QQLCQP24.js.map +1 -0
- package/dist/{chunk-LYGJVSNM.js → chunk-UORYHG2Z.js} +4 -4
- package/dist/{chunk-LYGJVSNM.js.map → chunk-UORYHG2Z.js.map} +1 -1
- package/dist/{chunk-MQ7LZWGP.js → chunk-VHGJG32Q.js} +3 -3
- package/dist/{chunk-MQ7LZWGP.js.map → chunk-VHGJG32Q.js.map} +1 -1
- package/dist/{chunk-7NHOKV7N.cjs → chunk-XMUC5NIJ.cjs} +7 -3
- package/dist/chunk-XMUC5NIJ.cjs.map +1 -0
- package/dist/{chunk-NA3FJX37.js → chunk-Y3MTRA7D.js} +11 -3
- package/dist/chunk-Y3MTRA7D.js.map +1 -0
- package/dist/{chunk-QQ7SCJRY.cjs → chunk-YIUUTRMQ.cjs} +2 -2
- package/dist/{chunk-QQ7SCJRY.cjs.map → chunk-YIUUTRMQ.cjs.map} +1 -1
- package/dist/document-tools/index.cjs +42 -42
- package/dist/document-tools/index.js +4 -4
- package/dist/index.cjs +1163 -1137
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-BO71E6NO.d.cts → index.d-BLw5AN0H.d.cts} +2 -2
- package/dist/{index.d-BO71E6NO.d.ts → index.d-BLw5AN0H.d.ts} +2 -2
- package/dist/{index.d-DscWCwr2.d.cts → index.d-DklHLjcu.d.cts} +32 -3
- package/dist/{index.d-DscWCwr2.d.ts → index.d-DklHLjcu.d.ts} +32 -3
- package/dist/index.d.cts +32 -9
- package/dist/index.d.ts +32 -9
- package/dist/index.js +35 -25
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +33 -33
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +2 -2
- package/dist/ui/index.cjs +167 -159
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -2
- package/dist/viewers/index.cjs +2 -2
- package/dist/viewers/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-3WIBD44F.js.map +0 -1
- package/dist/chunk-5YWIUUUT.cjs.map +0 -1
- package/dist/chunk-7NHOKV7N.cjs.map +0 -1
- package/dist/chunk-I4WI3MNH.js.map +0 -1
- package/dist/chunk-KRAUMKBG.js.map +0 -1
- package/dist/chunk-NA3FJX37.js.map +0 -1
- package/dist/chunk-TUKW4MCI.cjs.map +0 -1
- package/dist/chunk-YBIW7T66.cjs.map +0 -1
package/dist/artifacts/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk2ERRXEOB_cjs = require('../chunk-2ERRXEOB.cjs');
|
|
4
|
+
var chunkGSOAMP6Z_cjs = require('../chunk-GSOAMP6Z.cjs');
|
|
5
5
|
var chunk3AADNIOK_cjs = require('../chunk-3AADNIOK.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkOC7F5SNA_cjs = require('../chunk-OC7F5SNA.cjs');
|
|
7
7
|
require('../chunk-N73IMVFF.cjs');
|
|
8
|
+
var chunkRRWAX52L_cjs = require('../chunk-RRWAX52L.cjs');
|
|
8
9
|
var chunkZWFMFOGP_cjs = require('../chunk-ZWFMFOGP.cjs');
|
|
9
10
|
var chunkVOFNX4P6_cjs = require('../chunk-VOFNX4P6.cjs');
|
|
10
|
-
var chunkOC7F5SNA_cjs = require('../chunk-OC7F5SNA.cjs');
|
|
11
11
|
require('../chunk-Z3LLUO32.cjs');
|
|
12
12
|
require('../chunk-S6A6FSG7.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkYIUUTRMQ_cjs = require('../chunk-YIUUTRMQ.cjs');
|
|
14
14
|
require('../chunk-RCKA7BEF.cjs');
|
|
15
15
|
var react = require('react');
|
|
16
16
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -279,7 +279,7 @@ var isRefusal = (error) => {
|
|
|
279
279
|
return code === 401 || code === 403;
|
|
280
280
|
};
|
|
281
281
|
function useArtifactText(docId, options) {
|
|
282
|
-
const arbi =
|
|
282
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
283
283
|
const { attempts, baseDelayMs, maxDelayMs } = {
|
|
284
284
|
...DEFAULT_ARTIFACT_TEXT_RETRY,
|
|
285
285
|
...options?.retry
|
|
@@ -335,12 +335,12 @@ function useArtifactText(docId, options) {
|
|
|
335
335
|
// src/artifacts/useArtifactSession.ts
|
|
336
336
|
function useArtifactVersions(workspaceId, docId) {
|
|
337
337
|
const plainId = docId ? chunkZWFMFOGP_cjs.parseVersionRef(docId).docId : null;
|
|
338
|
-
const { data: documents } =
|
|
338
|
+
const { data: documents } = chunk2ERRXEOB_cjs.useDocuments(workspaceId);
|
|
339
339
|
const listed = react.useMemo(
|
|
340
340
|
() => (documents ?? []).find((d) => d.external_id === plainId),
|
|
341
341
|
[documents, plainId]
|
|
342
342
|
);
|
|
343
|
-
const { data: history } =
|
|
343
|
+
const { data: history } = chunkGSOAMP6Z_cjs.useDocumentVersionList(plainId, {
|
|
344
344
|
enabled: !!plainId && documents !== void 0 && !listed
|
|
345
345
|
});
|
|
346
346
|
return react.useMemo(
|
|
@@ -349,7 +349,7 @@ function useArtifactVersions(workspaceId, docId) {
|
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
function useSaveArtifactVersion() {
|
|
352
|
-
const arbi =
|
|
352
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
353
353
|
const queryClient = reactQuery.useQueryClient();
|
|
354
354
|
return reactQuery.useMutation({
|
|
355
355
|
mutationFn: async ({ title, content, versionOf, configId, wpType }) => {
|
|
@@ -364,7 +364,7 @@ function useSaveArtifactVersion() {
|
|
|
364
364
|
}
|
|
365
365
|
);
|
|
366
366
|
const docId = result.doc_ext_ids?.[0];
|
|
367
|
-
if (docId) await
|
|
367
|
+
if (docId) await chunk2ERRXEOB_cjs.refreshDocuments(queryClient, arbi, [docId]);
|
|
368
368
|
await queryClient.invalidateQueries({ queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.allDocumentVersions() });
|
|
369
369
|
if (docId)
|
|
370
370
|
await queryClient.invalidateQueries({ queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.parsedDocument(docId) });
|
|
@@ -484,7 +484,7 @@ function useArtifactSession(options) {
|
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
486
|
function useArtifactSource(documentId, enabled = true) {
|
|
487
|
-
const arbi =
|
|
487
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
488
488
|
return reactQuery.useQuery({
|
|
489
489
|
queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.artifactSource(documentId ?? ""),
|
|
490
490
|
queryFn: async () => (await arbi.documents.download(documentId)).text(),
|
package/dist/artifacts/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useDocuments, refreshDocuments } from '../chunk-
|
|
2
|
-
import { useDocumentVersionList } from '../chunk-
|
|
1
|
+
import { useDocuments, refreshDocuments } from '../chunk-VHGJG32Q.js';
|
|
2
|
+
import { useDocumentVersionList } from '../chunk-UORYHG2Z.js';
|
|
3
3
|
import { revertRedlineRegion, buildHybridRedlineWithRegions, buildHybridRedlineMarkdown } from '../chunk-74N436VK.js';
|
|
4
4
|
export { buildHybridRedlineMarkdown, buildHybridRedlineWithRegions, revertRedlineRegion } from '../chunk-74N436VK.js';
|
|
5
|
-
import {
|
|
5
|
+
import { MarkdownRenderer } from '../chunk-C44GO33B.js';
|
|
6
6
|
import '../chunk-DPYBZDJB.js';
|
|
7
|
+
import { arbiQueryKeys } from '../chunk-PBXJFMES.js';
|
|
7
8
|
import { isDocumentId, parseVersionRef, flattenChunks, documentVersions, toArtifactVersions, findVersion, versionLabel, cleanDraftWithReport } from '../chunk-NNWMHMEC.js';
|
|
8
9
|
export { cleanDraftMarkdown, cleanDraftWithReport, documentVersions, findVersion, flattenChunks, isDocumentId, parseVersionRef, promoteBoldTitle, repairParsedStructure, repairParsedTitle, savedFromId, stripAgentPreamble, toArtifactVersions, unescapeMarkdown, unwrapCitationLinks, versionLabel, versionRef } from '../chunk-NNWMHMEC.js';
|
|
9
10
|
import { normalizeMarkdown } from '../chunk-WUTL62MC.js';
|
|
10
11
|
export { normalizeMarkdown } from '../chunk-WUTL62MC.js';
|
|
11
|
-
import { MarkdownRenderer } from '../chunk-C44GO33B.js';
|
|
12
12
|
import '../chunk-QRCMKEE6.js';
|
|
13
13
|
import '../chunk-SN5YV6FF.js';
|
|
14
|
-
import { useArbi } from '../chunk-
|
|
14
|
+
import { useArbi } from '../chunk-MB34NKBZ.js';
|
|
15
15
|
import '../chunk-CPZ36AQS.js';
|
|
16
16
|
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
17
17
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkAXZF5ODQ_cjs = require('../../chunk-AXZF5ODQ.cjs');
|
|
4
|
+
require('../../chunk-GSOAMP6Z.cjs');
|
|
5
|
+
require('../../chunk-EEIYXVM4.cjs');
|
|
6
6
|
var chunkVAMPYLQ4_cjs = require('../../chunk-VAMPYLQ4.cjs');
|
|
7
7
|
require('../../chunk-N73IMVFF.cjs');
|
|
8
|
+
require('../../chunk-RRWAX52L.cjs');
|
|
8
9
|
require('../../chunk-ZWFMFOGP.cjs');
|
|
9
10
|
require('../../chunk-VOFNX4P6.cjs');
|
|
10
|
-
require('../../chunk-EEIYXVM4.cjs');
|
|
11
11
|
require('../../chunk-Z3LLUO32.cjs');
|
|
12
12
|
require('../../chunk-S6A6FSG7.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkYIUUTRMQ_cjs = require('../../chunk-YIUUTRMQ.cjs');
|
|
14
14
|
require('../../chunk-RCKA7BEF.cjs');
|
|
15
15
|
var react = require('react');
|
|
16
16
|
var livekitClient = require('livekit-client');
|
|
@@ -122,11 +122,11 @@ function useCallTranscriber({
|
|
|
122
122
|
const room = componentsReact.useRoomContext();
|
|
123
123
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
124
124
|
const myIdentity = localParticipant.identity;
|
|
125
|
-
const arbi =
|
|
125
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
126
126
|
const queryClient = reactQuery.useQueryClient();
|
|
127
127
|
const profile = arbi.isLoggedIn ? arbi.user.profile() : null;
|
|
128
|
-
const myProfileName = profile &&
|
|
129
|
-
const deploymentAvailable =
|
|
128
|
+
const myProfileName = profile && chunkAXZF5ODQ_cjs.toProfileView(profile).fullName || null;
|
|
129
|
+
const deploymentAvailable = chunkAXZF5ODQ_cjs.useCallTranscriptionAvailable();
|
|
130
130
|
const available = deploymentAvailable && !!callKey;
|
|
131
131
|
const [state, setState] = react.useState(null);
|
|
132
132
|
const [creatorExtId, setCreatorExtId] = react.useState(null);
|
|
@@ -169,7 +169,7 @@ function useCallTranscriber({
|
|
|
169
169
|
};
|
|
170
170
|
}, [available, callExtId]);
|
|
171
171
|
react.useEffect(
|
|
172
|
-
() =>
|
|
172
|
+
() => chunkAXZF5ODQ_cjs.onCallEvent("call.transcription", (message) => {
|
|
173
173
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
174
174
|
}),
|
|
175
175
|
[callExtId, applyState]
|
|
@@ -185,7 +185,7 @@ function useCallTranscriber({
|
|
|
185
185
|
const persist = react.useCallback(
|
|
186
186
|
(segment, speakerNeedsProxy) => {
|
|
187
187
|
if (!callKey || persisted.current.has(segment.segmentId)) return;
|
|
188
|
-
const role =
|
|
188
|
+
const role = chunkAXZF5ODQ_cjs.transcriptPersistRole({
|
|
189
189
|
myIdentity,
|
|
190
190
|
canPost: canPost && (segment.speakerIdentity !== myIdentity || selfPosts.current),
|
|
191
191
|
hasCallKey: true,
|
|
@@ -194,7 +194,7 @@ function useCallTranscriber({
|
|
|
194
194
|
});
|
|
195
195
|
if (!role) return;
|
|
196
196
|
persisted.current.add(segment.segmentId);
|
|
197
|
-
|
|
197
|
+
chunkAXZF5ODQ_cjs.persistTranscriptSegment(arbi, queryClient, callExtId, callKey, segment).catch(
|
|
198
198
|
(err) => {
|
|
199
199
|
persisted.current.delete(segment.segmentId);
|
|
200
200
|
if (role === "own" && err?.status === 403) {
|
|
@@ -214,7 +214,7 @@ function useCallTranscriber({
|
|
|
214
214
|
);
|
|
215
215
|
react.useEffect(() => {
|
|
216
216
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
217
|
-
if (topic ===
|
|
217
|
+
if (topic === chunkAXZF5ODQ_cjs.CALL_TRANSCRIPTION_TOPIC) {
|
|
218
218
|
if (participant || participantIdentity) return;
|
|
219
219
|
try {
|
|
220
220
|
const next = browser.calls.transcriptionStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -223,10 +223,10 @@ function useCallTranscriber({
|
|
|
223
223
|
}
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
if (topic !==
|
|
226
|
+
if (topic !== chunkAXZF5ODQ_cjs.CALL_CAPTION_TOPIC || !callKey) return;
|
|
227
227
|
const identity = participant?.identity ?? participantIdentity;
|
|
228
228
|
if (!identity || identity === myIdentity) return;
|
|
229
|
-
void
|
|
229
|
+
void chunkAXZF5ODQ_cjs.decodeCaptionPacket(payload, callKey).then((packet) => {
|
|
230
230
|
if (!packet || packet.identity !== identity) return;
|
|
231
231
|
const name = participant?.name || packet.name || identity;
|
|
232
232
|
const t = Math.min(packet.t, Date.now());
|
|
@@ -266,7 +266,7 @@ function useCallTranscriber({
|
|
|
266
266
|
})) {
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
const segmentId =
|
|
269
|
+
const segmentId = chunkAXZF5ODQ_cjs.newSegmentId();
|
|
270
270
|
const startedAt = new Date(segment.startedAt).toISOString();
|
|
271
271
|
let text;
|
|
272
272
|
try {
|
|
@@ -300,7 +300,7 @@ function useCallTranscriber({
|
|
|
300
300
|
});
|
|
301
301
|
try {
|
|
302
302
|
await localParticipant.publishData(
|
|
303
|
-
await
|
|
303
|
+
await chunkAXZF5ODQ_cjs.encodeCaptionPacket(
|
|
304
304
|
{
|
|
305
305
|
v: 1,
|
|
306
306
|
segment_id: segmentId,
|
|
@@ -312,7 +312,7 @@ function useCallTranscriber({
|
|
|
312
312
|
},
|
|
313
313
|
callKey
|
|
314
314
|
),
|
|
315
|
-
{ reliable: true, topic:
|
|
315
|
+
{ reliable: true, topic: chunkAXZF5ODQ_cjs.CALL_CAPTION_TOPIC }
|
|
316
316
|
);
|
|
317
317
|
} catch (err) {
|
|
318
318
|
console.warn("[calls] could not broadcast a caption", err);
|
|
@@ -393,7 +393,7 @@ function useCallRecorder({
|
|
|
393
393
|
isCreator,
|
|
394
394
|
linkVersion = null
|
|
395
395
|
}) {
|
|
396
|
-
const arbi =
|
|
396
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
397
397
|
const queryClient = reactQuery.useQueryClient();
|
|
398
398
|
const room = componentsReact.useRoomContext();
|
|
399
399
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
@@ -427,14 +427,14 @@ function useCallRecorder({
|
|
|
427
427
|
};
|
|
428
428
|
}, [callExtId]);
|
|
429
429
|
react.useEffect(
|
|
430
|
-
() =>
|
|
430
|
+
() => chunkAXZF5ODQ_cjs.onCallEvent("call.recording", (message) => {
|
|
431
431
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
432
432
|
}),
|
|
433
433
|
[callExtId, applyState]
|
|
434
434
|
);
|
|
435
435
|
react.useEffect(() => {
|
|
436
436
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
437
|
-
if (topic !==
|
|
437
|
+
if (topic !== chunkAXZF5ODQ_cjs.CALL_RECORDING_TOPIC) return;
|
|
438
438
|
if (participant || participantIdentity) return;
|
|
439
439
|
try {
|
|
440
440
|
const next = browser.calls.recordingStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -455,7 +455,7 @@ function useCallRecorder({
|
|
|
455
455
|
try {
|
|
456
456
|
const row = call ?? await arbi.calls.get(callExtId);
|
|
457
457
|
if (!row.workspace_locked && !row.chat_ext_id && callKey) {
|
|
458
|
-
const ref = await
|
|
458
|
+
const ref = await chunkAXZF5ODQ_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
459
459
|
if (ref.kind === "chat") setCall({ ...row, chat_ext_id: ref.chatExtId });
|
|
460
460
|
}
|
|
461
461
|
const answer = await arbi.calls.recording.start(callExtId, mode);
|
|
@@ -553,11 +553,11 @@ function useCallRecorder({
|
|
|
553
553
|
}
|
|
554
554
|
function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
555
555
|
const { recordingExtId, call, startedAt, shouldCapture, markStopped, linkVersion } = recording;
|
|
556
|
-
const arbi =
|
|
556
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
557
557
|
const queryClient = reactQuery.useQueryClient();
|
|
558
558
|
return react.useMemo(() => {
|
|
559
559
|
if (!shouldCapture || !recordingExtId || !call) return null;
|
|
560
|
-
return
|
|
560
|
+
return chunkAXZF5ODQ_cjs.trackUploaderFor({
|
|
561
561
|
arbi,
|
|
562
562
|
callExtId: call.external_id,
|
|
563
563
|
recordingExtId,
|
|
@@ -565,7 +565,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
|
565
565
|
mimeType,
|
|
566
566
|
recordingStartedAt: startedAt,
|
|
567
567
|
linkVersion,
|
|
568
|
-
conversationKey: () =>
|
|
568
|
+
conversationKey: () => chunkAXZF5ODQ_cjs.conversationKeyForCall(arbi, queryClient, call, { callKey }),
|
|
569
569
|
// The server stopped the recording at the quota (its state event says so too).
|
|
570
570
|
onStopped: () => markStopped()
|
|
571
571
|
});
|
|
@@ -593,9 +593,9 @@ function useInCallChat({
|
|
|
593
593
|
const room = componentsReact.useRoomContext();
|
|
594
594
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
595
595
|
const myIdentity = localParticipant.identity;
|
|
596
|
-
const arbi =
|
|
596
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
597
597
|
const queryClient = reactQuery.useQueryClient();
|
|
598
|
-
const openMeetingChat =
|
|
598
|
+
const openMeetingChat = chunkYIUUTRMQ_cjs.useArbiHost().calls?.openMeetingChat;
|
|
599
599
|
const signedIn = arbi.isLoggedIn;
|
|
600
600
|
const persists = !!callKey && signedIn && !readOnly && persist;
|
|
601
601
|
const [live, setLive] = react.useState([]);
|
|
@@ -614,10 +614,10 @@ function useInCallChat({
|
|
|
614
614
|
react.useEffect(() => {
|
|
615
615
|
if (!callKey) return;
|
|
616
616
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
617
|
-
if (topic !==
|
|
617
|
+
if (topic !== chunkAXZF5ODQ_cjs.CALL_CHAT_TOPIC) return;
|
|
618
618
|
const identity = participant?.identity ?? participantIdentity;
|
|
619
619
|
if (!identity || identity === myIdentity) return;
|
|
620
|
-
void
|
|
620
|
+
void chunkAXZF5ODQ_cjs.decodeCallChatPacket(payload, callKey).then((packet) => {
|
|
621
621
|
if (!packet) return;
|
|
622
622
|
const key = `${identity}:${packet.id}`;
|
|
623
623
|
if (seen.current.has(key)) return;
|
|
@@ -647,7 +647,7 @@ function useInCallChat({
|
|
|
647
647
|
if (!open || !canRead || historyRequested.current) return;
|
|
648
648
|
historyRequested.current = true;
|
|
649
649
|
setHistoryLoading(true);
|
|
650
|
-
|
|
650
|
+
chunkAXZF5ODQ_cjs.loadMeetingHistory(arbi, queryClient, callExtId).then((result) => {
|
|
651
651
|
if (!result) return;
|
|
652
652
|
setMeetingChat(result.ref);
|
|
653
653
|
setHistory(result.messages);
|
|
@@ -658,13 +658,13 @@ function useInCallChat({
|
|
|
658
658
|
}, [open, canRead, callExtId]);
|
|
659
659
|
const send = react.useCallback(
|
|
660
660
|
async (raw) => {
|
|
661
|
-
const text = raw.trim().slice(0,
|
|
661
|
+
const text = raw.trim().slice(0, chunkAXZF5ODQ_cjs.CALL_CHAT_MAX_CHARS);
|
|
662
662
|
if (!text || !callKey || readOnly) return;
|
|
663
|
-
const id =
|
|
663
|
+
const id = chunkAXZF5ODQ_cjs.newPacketId();
|
|
664
664
|
const at = Date.now();
|
|
665
665
|
await localParticipant.publishData(
|
|
666
|
-
await
|
|
667
|
-
{ reliable: true, topic:
|
|
666
|
+
await chunkAXZF5ODQ_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
|
|
667
|
+
{ reliable: true, topic: chunkAXZF5ODQ_cjs.CALL_CHAT_TOPIC }
|
|
668
668
|
);
|
|
669
669
|
setLive((prev) => [
|
|
670
670
|
...prev,
|
|
@@ -683,7 +683,7 @@ function useInCallChat({
|
|
|
683
683
|
(prev) => prev.map((l) => l.id === id && l.senderIdentity === myIdentity ? { ...l, status } : l)
|
|
684
684
|
);
|
|
685
685
|
try {
|
|
686
|
-
setMeetingChat(await
|
|
686
|
+
setMeetingChat(await chunkAXZF5ODQ_cjs.persistMeetingMessage(arbi, queryClient, callExtId, callKey, text));
|
|
687
687
|
mark("saved");
|
|
688
688
|
} catch (err) {
|
|
689
689
|
console.warn("[calls] could not keep the message in the meeting chat", err);
|
|
@@ -695,7 +695,7 @@ function useInCallChat({
|
|
|
695
695
|
const openMeeting = react.useCallback(async () => {
|
|
696
696
|
if (!callKey) return;
|
|
697
697
|
try {
|
|
698
|
-
const ref = meetingChat ?? await
|
|
698
|
+
const ref = meetingChat ?? await chunkAXZF5ODQ_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
699
699
|
setMeetingChat(ref);
|
|
700
700
|
openMeetingChat?.(ref);
|
|
701
701
|
} catch (err) {
|
|
@@ -703,7 +703,7 @@ function useInCallChat({
|
|
|
703
703
|
}
|
|
704
704
|
}, [callExtId, callKey, meetingChat]);
|
|
705
705
|
const lines = react.useMemo(
|
|
706
|
-
() =>
|
|
706
|
+
() => chunkAXZF5ODQ_cjs.mergeChatLines(history, live, {
|
|
707
707
|
myIdentity,
|
|
708
708
|
nameOf: (identity) => identity === myIdentity ? localParticipant.name || "You" : room.remoteParticipants.get(identity)?.name || null
|
|
709
709
|
}),
|
|
@@ -735,7 +735,7 @@ function useWebinar({
|
|
|
735
735
|
linkVersion = null,
|
|
736
736
|
callKey
|
|
737
737
|
}) {
|
|
738
|
-
const arbi =
|
|
738
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
739
739
|
const webinarApi = react.useCallback(() => arbi.calls.webinar, [arbi]);
|
|
740
740
|
const enabled = !!roleHint;
|
|
741
741
|
const room = componentsReact.useRoomContext();
|
|
@@ -762,7 +762,7 @@ function useWebinar({
|
|
|
762
762
|
const n = ++questionsRead.current;
|
|
763
763
|
try {
|
|
764
764
|
const rows = await webinarApi().questions.list(callExtId, linkVersion);
|
|
765
|
-
const opened = await Promise.all(rows.map((q) =>
|
|
765
|
+
const opened = await Promise.all(rows.map((q) => chunkAXZF5ODQ_cjs.openQuestion(q, callKey)));
|
|
766
766
|
if (n === questionsRead.current) setQuestions(opened);
|
|
767
767
|
} catch (err) {
|
|
768
768
|
console.warn("[calls] could not load the questions", err);
|
|
@@ -774,7 +774,7 @@ function useWebinar({
|
|
|
774
774
|
}, [refresh, refreshQuestions]);
|
|
775
775
|
react.useEffect(() => {
|
|
776
776
|
if (!enabled) return;
|
|
777
|
-
return
|
|
777
|
+
return chunkAXZF5ODQ_cjs.onCallEvent("call.webinar", (m) => {
|
|
778
778
|
if (m.call_ext_id !== callExtId) return;
|
|
779
779
|
setState((s) => s ? { ...s, live: m.live, chat: m.chat } : s);
|
|
780
780
|
});
|
|
@@ -783,8 +783,8 @@ function useWebinar({
|
|
|
783
783
|
react.useEffect(() => {
|
|
784
784
|
if (!enabled) return;
|
|
785
785
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
786
|
-
if (topic !==
|
|
787
|
-
const packet =
|
|
786
|
+
if (topic !== chunkAXZF5ODQ_cjs.CALL_WEBINAR_TOPIC) return;
|
|
787
|
+
const packet = chunkAXZF5ODQ_cjs.parseWebinarPacket(payload, !!(participant || participantIdentity));
|
|
788
788
|
if (!packet) return;
|
|
789
789
|
switch (packet.type) {
|
|
790
790
|
case "state":
|
|
@@ -805,7 +805,7 @@ function useWebinar({
|
|
|
805
805
|
return;
|
|
806
806
|
case "demoted":
|
|
807
807
|
setStageCheck(false);
|
|
808
|
-
|
|
808
|
+
chunkAXZF5ODQ_cjs.markRejoining(callExtId);
|
|
809
809
|
if (fallback.current) clearTimeout(fallback.current);
|
|
810
810
|
fallback.current = setTimeout(() => void room.disconnect(), DEMOTE_REJOIN_FALLBACK_MS);
|
|
811
811
|
return;
|
|
@@ -832,12 +832,12 @@ function useWebinar({
|
|
|
832
832
|
[callExtId, linkVersion]
|
|
833
833
|
);
|
|
834
834
|
const stepDown = react.useCallback(async () => {
|
|
835
|
-
|
|
835
|
+
chunkAXZF5ODQ_cjs.markRejoining(callExtId);
|
|
836
836
|
setStageCheck(false);
|
|
837
837
|
try {
|
|
838
838
|
await webinarApi().demote(callExtId, myIdentity, linkVersion);
|
|
839
839
|
} catch (err) {
|
|
840
|
-
|
|
840
|
+
chunkAXZF5ODQ_cjs.markRejoining(callExtId, false);
|
|
841
841
|
failed("leave the stage")(err);
|
|
842
842
|
}
|
|
843
843
|
}, [callExtId, myIdentity, linkVersion]);
|
|
@@ -897,7 +897,7 @@ function useWebinar({
|
|
|
897
897
|
if (!callKey) throw new Error("This call has no key.");
|
|
898
898
|
await webinarApi().questions.ask(
|
|
899
899
|
callExtId,
|
|
900
|
-
await
|
|
900
|
+
await chunkAXZF5ODQ_cjs.sealQuestionText(text, callKey),
|
|
901
901
|
linkVersion
|
|
902
902
|
);
|
|
903
903
|
}, "ask the question"),
|
|
@@ -911,7 +911,7 @@ function useWebinar({
|
|
|
911
911
|
await webinarApi().questions.update(
|
|
912
912
|
callExtId,
|
|
913
913
|
id,
|
|
914
|
-
{ answer: await
|
|
914
|
+
{ answer: await chunkAXZF5ODQ_cjs.sealQuestionText(text, callKey) },
|
|
915
915
|
linkVersion
|
|
916
916
|
);
|
|
917
917
|
}, "answer the question"),
|
|
@@ -941,15 +941,15 @@ function useWebinar({
|
|
|
941
941
|
function useHostMuteNotice(callExtId) {
|
|
942
942
|
const room = componentsReact.useRoomContext();
|
|
943
943
|
react.useEffect(() => {
|
|
944
|
-
const notifyMuted =
|
|
944
|
+
const notifyMuted = chunkAXZF5ODQ_cjs.createMutedNotifier((text) => chunkVAMPYLQ4_cjs.notify.info(text));
|
|
945
945
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
946
|
-
if (topic !==
|
|
946
|
+
if (topic !== chunkAXZF5ODQ_cjs.CALL_MODERATION_TOPIC) return;
|
|
947
947
|
if (participant || participantIdentity) return;
|
|
948
|
-
const notice =
|
|
948
|
+
const notice = chunkAXZF5ODQ_cjs.mutedNoticeFromPacket(payload);
|
|
949
949
|
if (notice) notifyMuted(notice);
|
|
950
950
|
};
|
|
951
951
|
room.on(livekitClient.RoomEvent.DataReceived, onData);
|
|
952
|
-
const offWs =
|
|
952
|
+
const offWs = chunkAXZF5ODQ_cjs.onCallEvent("call.muted", (message) => {
|
|
953
953
|
if (message.callExtId === callExtId) notifyMuted(message);
|
|
954
954
|
});
|
|
955
955
|
return () => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { toProfileView, useCallTranscriptionAvailable, onCallEvent, transcriptPersistRole, persistTranscriptSegment, newSegmentId, encodeCaptionPacket, CALL_CAPTION_TOPIC, ensureMeetingChat, trackUploaderFor, conversationKeyForCall, loadMeetingHistory, CALL_CHAT_MAX_CHARS, newPacketId, encodeCallChatPacket, CALL_CHAT_TOPIC, persistMeetingMessage, mergeChatLines, openQuestion, markRejoining, sealQuestionText, createMutedNotifier, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, decodeCaptionPacket, CALL_MODERATION_TOPIC, mutedNoticeFromPacket, decodeCallChatPacket, CALL_WEBINAR_TOPIC, parseWebinarPacket } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
import { toProfileView, useCallTranscriptionAvailable, onCallEvent, transcriptPersistRole, persistTranscriptSegment, newSegmentId, encodeCaptionPacket, CALL_CAPTION_TOPIC, ensureMeetingChat, trackUploaderFor, conversationKeyForCall, loadMeetingHistory, CALL_CHAT_MAX_CHARS, newPacketId, encodeCallChatPacket, CALL_CHAT_TOPIC, persistMeetingMessage, mergeChatLines, openQuestion, markRejoining, sealQuestionText, createMutedNotifier, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, decodeCaptionPacket, CALL_MODERATION_TOPIC, mutedNoticeFromPacket, decodeCallChatPacket, CALL_WEBINAR_TOPIC, parseWebinarPacket } from '../../chunk-LTEMUGPQ.js';
|
|
2
|
+
import '../../chunk-UORYHG2Z.js';
|
|
3
|
+
import '../../chunk-APZZQZ6P.js';
|
|
4
4
|
import { notify } from '../../chunk-5HDC43MF.js';
|
|
5
5
|
import '../../chunk-DPYBZDJB.js';
|
|
6
|
+
import '../../chunk-PBXJFMES.js';
|
|
6
7
|
import '../../chunk-NNWMHMEC.js';
|
|
7
8
|
import '../../chunk-WUTL62MC.js';
|
|
8
|
-
import '../../chunk-APZZQZ6P.js';
|
|
9
9
|
import '../../chunk-QRCMKEE6.js';
|
|
10
10
|
import '../../chunk-SN5YV6FF.js';
|
|
11
|
-
import { useArbi, useArbiHost } from '../../chunk-
|
|
11
|
+
import { useArbi, useArbiHost } from '../../chunk-MB34NKBZ.js';
|
|
12
12
|
import '../../chunk-CPZ36AQS.js';
|
|
13
13
|
import { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
14
14
|
import { RoomEvent, ExternalE2EEKeyProvider, Room } from 'livekit-client';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkRRWAX52L_cjs = require('./chunk-RRWAX52L.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkYIUUTRMQ_cjs = require('./chunk-YIUUTRMQ.cjs');
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -144,7 +144,7 @@ function invalidateTagData(qc, workspaceId) {
|
|
|
144
144
|
]);
|
|
145
145
|
}
|
|
146
146
|
function useInvalidateTagData() {
|
|
147
|
-
const arbi =
|
|
147
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
148
148
|
const qc = reactQuery.useQueryClient();
|
|
149
149
|
return react.useCallback(() => {
|
|
150
150
|
const workspaceId = openWorkspaceId(arbi);
|
|
@@ -177,7 +177,7 @@ var replayableTagMutations = [
|
|
|
177
177
|
}
|
|
178
178
|
];
|
|
179
179
|
function useCreateTag() {
|
|
180
|
-
const arbi =
|
|
180
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
181
181
|
const qc = reactQuery.useQueryClient();
|
|
182
182
|
return reactQuery.useMutation({
|
|
183
183
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.createTag(),
|
|
@@ -199,7 +199,7 @@ function useIsCreatingTag() {
|
|
|
199
199
|
);
|
|
200
200
|
}
|
|
201
201
|
function useUpdateTag() {
|
|
202
|
-
const arbi =
|
|
202
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
203
203
|
const qc = reactQuery.useQueryClient();
|
|
204
204
|
return reactQuery.useMutation({
|
|
205
205
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.updateTag(),
|
|
@@ -208,7 +208,7 @@ function useUpdateTag() {
|
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
function useSetTagValues() {
|
|
211
|
-
const arbi =
|
|
211
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
212
212
|
const qc = reactQuery.useQueryClient();
|
|
213
213
|
return reactQuery.useMutation({
|
|
214
214
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.updateTag(),
|
|
@@ -220,7 +220,7 @@ function useSetTagValues() {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
function useDeleteTag() {
|
|
223
|
-
const arbi =
|
|
223
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
224
224
|
const qc = reactQuery.useQueryClient();
|
|
225
225
|
return reactQuery.useMutation({
|
|
226
226
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.deleteTag(),
|
|
@@ -242,7 +242,7 @@ function useDeleteTag() {
|
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
function useExtractEntities() {
|
|
245
|
-
const arbi =
|
|
245
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
246
246
|
return reactQuery.useMutation({
|
|
247
247
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.extractEntities(),
|
|
248
248
|
mutationFn: (docIds) => arbi.tags.extractEntities(docIds),
|
|
@@ -250,7 +250,7 @@ function useExtractEntities() {
|
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
function useTagKindSchema(kind, options) {
|
|
253
|
-
const arbi =
|
|
253
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
254
254
|
const workspaceId = openWorkspaceId(arbi) ?? "";
|
|
255
255
|
return reactQuery.useQuery({
|
|
256
256
|
queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.tagKind(workspaceId, kind ?? ""),
|
|
@@ -259,7 +259,7 @@ function useTagKindSchema(kind, options) {
|
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
function useUpdateTagKindSchema() {
|
|
262
|
-
const arbi =
|
|
262
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
263
263
|
const qc = reactQuery.useQueryClient();
|
|
264
264
|
return reactQuery.useMutation({
|
|
265
265
|
mutationKey: chunkRRWAX52L_cjs.arbiMutationKeys.updateTagKindSchema(),
|
|
@@ -426,7 +426,7 @@ function openWorkspaceId2(arbi) {
|
|
|
426
426
|
return arbi.hasWorkspace ? arbi.getWorkspaceId() : null;
|
|
427
427
|
}
|
|
428
428
|
function useDocuments(workspaceId, options) {
|
|
429
|
-
const arbi =
|
|
429
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
430
430
|
const qc = reactQuery.useQueryClient();
|
|
431
431
|
const workspace = workspaceId ?? openWorkspaceId2(arbi) ?? "";
|
|
432
432
|
return reactQuery.useQuery({
|
|
@@ -448,7 +448,7 @@ function processingInterval(doc) {
|
|
|
448
448
|
return doc?.status && !FINISHED_DOCUMENT_STATUSES.has(doc.status) ? DOCUMENT_STATUS_POLL_MS : false;
|
|
449
449
|
}
|
|
450
450
|
function useDocument(docId, options) {
|
|
451
|
-
const arbi =
|
|
451
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
452
452
|
return reactQuery.useQuery({
|
|
453
453
|
queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.document(docId ?? ""),
|
|
454
454
|
queryFn: async () => (await arbi.documents.get([docId]))[0] ?? null,
|
|
@@ -457,7 +457,7 @@ function useDocument(docId, options) {
|
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
459
|
function useDocumentsById(docIds, options) {
|
|
460
|
-
const arbi =
|
|
460
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
461
461
|
return reactQuery.useQuery({
|
|
462
462
|
queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.documentsById(docIds),
|
|
463
463
|
queryFn: () => arbi.documents.get(docIds),
|
|
@@ -466,7 +466,7 @@ function useDocumentsById(docIds, options) {
|
|
|
466
466
|
}
|
|
467
467
|
var SIMILARITY_THRESHOLD = 0.98;
|
|
468
468
|
function useSimilarDocuments(options) {
|
|
469
|
-
const arbi =
|
|
469
|
+
const arbi = chunkYIUUTRMQ_cjs.useArbi();
|
|
470
470
|
const workspace = openWorkspaceId2(arbi) ?? "";
|
|
471
471
|
return reactQuery.useQuery({
|
|
472
472
|
queryKey: chunkRRWAX52L_cjs.arbiQueryKeys.similarDocuments(workspace, SIMILARITY_THRESHOLD),
|
|
@@ -572,5 +572,5 @@ exports.useSimilarDocuments = useSimilarDocuments;
|
|
|
572
572
|
exports.useTagKindSchema = useTagKindSchema;
|
|
573
573
|
exports.useUpdateTag = useUpdateTag;
|
|
574
574
|
exports.useUpdateTagKindSchema = useUpdateTagKindSchema;
|
|
575
|
-
//# sourceMappingURL=chunk-
|
|
576
|
-
//# sourceMappingURL=chunk-
|
|
575
|
+
//# sourceMappingURL=chunk-2ERRXEOB.cjs.map
|
|
576
|
+
//# sourceMappingURL=chunk-2ERRXEOB.cjs.map
|