@arbidocs/react 0.5.106 → 0.5.107
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 +9 -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-XOS7ISIR.cjs → chunk-5HDKL6XB.cjs} +57 -57
- package/dist/chunk-5HDKL6XB.cjs.map +1 -0
- package/dist/{chunk-M74JCOXW.js → chunk-6H3O63TQ.js} +7 -4
- package/dist/chunk-6H3O63TQ.js.map +1 -0
- package/dist/{chunk-Q2GNEVG2.cjs → chunk-7LIMHY56.cjs} +7 -4
- package/dist/chunk-7LIMHY56.cjs.map +1 -0
- package/dist/{chunk-ZGGDH54R.js → chunk-CPQ3CU4B.js} +3 -3
- package/dist/{chunk-ZGGDH54R.js.map → chunk-CPQ3CU4B.js.map} +1 -1
- package/dist/{chunk-VAO76OJO.js → chunk-DQALOQPI.js} +4 -4
- package/dist/chunk-DQALOQPI.js.map +1 -0
- package/dist/{chunk-7NKF3VUN.js → chunk-FZJMA32S.js} +4 -4
- package/dist/{chunk-7NKF3VUN.js.map → chunk-FZJMA32S.js.map} +1 -1
- package/dist/{chunk-AXKIOI2U.js → chunk-H5M7FXLB.js} +4 -4
- package/dist/chunk-H5M7FXLB.js.map +1 -0
- package/dist/{chunk-K7UUWND5.cjs → chunk-HD5H2PPP.cjs} +66 -66
- package/dist/chunk-HD5H2PPP.cjs.map +1 -0
- package/dist/{chunk-FQVNZCTD.cjs → chunk-LBAG7KL7.cjs} +3 -3
- package/dist/{chunk-FQVNZCTD.cjs.map → chunk-LBAG7KL7.cjs.map} +1 -1
- package/dist/{chunk-DPR7LVZO.js → chunk-NNAJLY6B.js} +3 -3
- package/dist/{chunk-DPR7LVZO.js.map → chunk-NNAJLY6B.js.map} +1 -1
- package/dist/{chunk-OSFKAJT2.js → chunk-OYPKKHXY.js} +3 -3
- package/dist/{chunk-OSFKAJT2.js.map → chunk-OYPKKHXY.js.map} +1 -1
- package/dist/{chunk-MAUZSNQY.js → chunk-P6WLV5UY.js} +3 -3
- package/dist/{chunk-MAUZSNQY.js.map → chunk-P6WLV5UY.js.map} +1 -1
- package/dist/{chunk-2YRQJ3DR.cjs → chunk-QF2BW6HZ.cjs} +38 -38
- package/dist/{chunk-2YRQJ3DR.cjs.map → chunk-QF2BW6HZ.cjs.map} +1 -1
- package/dist/{chunk-IXE7HCCA.cjs → chunk-RVUGSM65.cjs} +44 -44
- package/dist/{chunk-IXE7HCCA.cjs.map → chunk-RVUGSM65.cjs.map} +1 -1
- package/dist/{chunk-YUESCKE2.cjs → chunk-W2FATOTX.cjs} +4 -4
- package/dist/{chunk-YUESCKE2.cjs.map → chunk-W2FATOTX.cjs.map} +1 -1
- package/dist/{chunk-C72FSQUE.cjs → chunk-Z3W4XFWB.cjs} +3 -3
- package/dist/{chunk-C72FSQUE.cjs.map → chunk-Z3W4XFWB.cjs.map} +1 -1
- package/dist/document-tools/core.cjs +99 -99
- package/dist/document-tools/core.d.cts +2 -2
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/core.js +4 -4
- package/dist/document-tools/index.cjs +101 -101
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +5 -5
- package/dist/index.cjs +1951 -1599
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +180 -4
- package/dist/index.d.ts +180 -4
- package/dist/index.js +363 -24
- package/dist/index.js.map +1 -1
- package/dist/{query-keys.d-Bpb7R_lB.d.cts → query-keys.d-ChgpJLPF.d.cts} +5 -2
- package/dist/{query-keys.d-Bpb7R_lB.d.ts → query-keys.d-ChgpJLPF.d.ts} +5 -2
- package/dist/shell/index.cjs +37 -37
- package/dist/shell/index.js +2 -2
- package/dist/ui/index.cjs +154 -154
- package/dist/ui/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-AXKIOI2U.js.map +0 -1
- package/dist/chunk-K7UUWND5.cjs.map +0 -1
- package/dist/chunk-M74JCOXW.js.map +0 -1
- package/dist/chunk-Q2GNEVG2.cjs.map +0 -1
- package/dist/chunk-VAO76OJO.js.map +0 -1
- package/dist/chunk-XOS7ISIR.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -314,9 +314,17 @@ A host handles other message types with `handlers`, by type, before the `useArbi
|
|
|
314
314
|
subscribers:
|
|
315
315
|
|
|
316
316
|
```tsx
|
|
317
|
-
<ArbiWebSocketProvider enabled={signedIn} handlers={
|
|
317
|
+
<ArbiWebSocketProvider enabled={signedIn} handlers={useRemoteControlHandlers()}>
|
|
318
318
|
```
|
|
319
319
|
|
|
320
|
+
**Remote control.** An `agt-…` assistant asking to drive the UI (`remote_control`) is consent-gated.
|
|
321
|
+
Its state is a session transient view (`REMOTE_CONTROL_VIEW`, never saved; blocks' remote control
|
|
322
|
+
resets it at every sign-in, sign-out, expiry and change of user): `useRemoteControl(selector)` reads
|
|
323
|
+
it, `remoteControlActions(session)` changes it (`reset()` back to the start),
|
|
324
|
+
and `toRemoteControlRequest(message, isSequenceId)` narrows the message to a runnable request. The
|
|
325
|
+
handler, the consent prompt and the guided cursor are `@arbidocs/blocks`'
|
|
326
|
+
(`useRemoteControlHandlers`, `ConnectedRemoteControlConsent`).
|
|
327
|
+
|
|
320
328
|
## Cache invalidation
|
|
321
329
|
|
|
322
330
|
```tsx
|
package/dist/artifacts/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkRVUGSM65_cjs = require('../chunk-RVUGSM65.cjs');
|
|
4
|
+
var chunk5HDKL6XB_cjs = require('../chunk-5HDKL6XB.cjs');
|
|
5
5
|
var chunk3AADNIOK_cjs = require('../chunk-3AADNIOK.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk7LIMHY56_cjs = require('../chunk-7LIMHY56.cjs');
|
|
7
7
|
require('../chunk-N73IMVFF.cjs');
|
|
8
8
|
var chunkNDIKMOBJ_cjs = require('../chunk-NDIKMOBJ.cjs');
|
|
9
9
|
var chunkVOFNX4P6_cjs = require('../chunk-VOFNX4P6.cjs');
|
|
@@ -270,7 +270,7 @@ var isRefusal = (error) => {
|
|
|
270
270
|
return code === 401 || code === 403;
|
|
271
271
|
};
|
|
272
272
|
function useArtifactText(docId, options) {
|
|
273
|
-
const arbi =
|
|
273
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
274
274
|
const { attempts, baseDelayMs, maxDelayMs } = {
|
|
275
275
|
...DEFAULT_ARTIFACT_TEXT_RETRY,
|
|
276
276
|
...options?.retry
|
|
@@ -278,7 +278,7 @@ function useArtifactText(docId, options) {
|
|
|
278
278
|
const enabled = (options?.enabled ?? true) && chunkNDIKMOBJ_cjs.isDocumentId(docId) && arbi.hasWorkspace;
|
|
279
279
|
const query = reactQuery.useQuery({
|
|
280
280
|
// Under the shared `parsedDoc` key, so a document's invalidation reaches it too.
|
|
281
|
-
queryKey: [...
|
|
281
|
+
queryKey: [...chunk7LIMHY56_cjs.arbiQueryKeys.parsedDoc(docId ?? "", "marker"), "artifact-text"],
|
|
282
282
|
queryFn: async () => {
|
|
283
283
|
const { docId: plainId, version } = chunkNDIKMOBJ_cjs.parseVersionRef(docId);
|
|
284
284
|
const parsed = await arbi.documents.getParsedContent(
|
|
@@ -326,12 +326,12 @@ function useArtifactText(docId, options) {
|
|
|
326
326
|
// src/artifacts/useArtifactSession.ts
|
|
327
327
|
function useArtifactVersions(workspaceId, docId) {
|
|
328
328
|
const plainId = docId ? chunkNDIKMOBJ_cjs.parseVersionRef(docId).docId : null;
|
|
329
|
-
const { data: documents } =
|
|
329
|
+
const { data: documents } = chunkRVUGSM65_cjs.useDocuments(workspaceId);
|
|
330
330
|
const listed = react.useMemo(
|
|
331
331
|
() => (documents ?? []).find((d) => d.external_id === plainId),
|
|
332
332
|
[documents, plainId]
|
|
333
333
|
);
|
|
334
|
-
const { data: history } =
|
|
334
|
+
const { data: history } = chunk5HDKL6XB_cjs.useDocumentVersionList(plainId, {
|
|
335
335
|
enabled: !!plainId && documents !== void 0 && !listed
|
|
336
336
|
});
|
|
337
337
|
return react.useMemo(
|
|
@@ -340,7 +340,7 @@ function useArtifactVersions(workspaceId, docId) {
|
|
|
340
340
|
);
|
|
341
341
|
}
|
|
342
342
|
function useSaveArtifactVersion() {
|
|
343
|
-
const arbi =
|
|
343
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
344
344
|
const queryClient = reactQuery.useQueryClient();
|
|
345
345
|
return reactQuery.useMutation({
|
|
346
346
|
mutationFn: async ({ title, content, versionOf, configId, wpType }) => {
|
|
@@ -355,10 +355,10 @@ function useSaveArtifactVersion() {
|
|
|
355
355
|
}
|
|
356
356
|
);
|
|
357
357
|
const docId = result.doc_ext_ids?.[0];
|
|
358
|
-
if (docId) await
|
|
359
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
358
|
+
if (docId) await chunkRVUGSM65_cjs.refreshDocuments(queryClient, arbi, [docId]);
|
|
359
|
+
await queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.allDocumentVersions() });
|
|
360
360
|
if (docId)
|
|
361
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
361
|
+
await queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.parsedDocument(docId) });
|
|
362
362
|
return { docId, version: result.version ?? void 0 };
|
|
363
363
|
}
|
|
364
364
|
});
|
|
@@ -475,9 +475,9 @@ function useArtifactSession(options) {
|
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
477
|
function useArtifactSource(documentId, enabled = true) {
|
|
478
|
-
const arbi =
|
|
478
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
479
479
|
return reactQuery.useQuery({
|
|
480
|
-
queryKey:
|
|
480
|
+
queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.artifactSource(documentId ?? ""),
|
|
481
481
|
queryFn: async () => (await arbi.documents.download(documentId)).text(),
|
|
482
482
|
enabled: enabled && !!documentId && arbi.isLoggedIn,
|
|
483
483
|
staleTime: 5 * 60 * 1e3
|
package/dist/artifacts/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useDocuments, refreshDocuments } from '../chunk-
|
|
2
|
-
import { useDocumentVersionList } from '../chunk-
|
|
1
|
+
import { useDocuments, refreshDocuments } from '../chunk-P6WLV5UY.js';
|
|
2
|
+
import { useDocumentVersionList } from '../chunk-H5M7FXLB.js';
|
|
3
3
|
import { revertRedlineRegion, buildHybridRedlineWithRegions, buildHybridRedlineMarkdown } from '../chunk-74N436VK.js';
|
|
4
4
|
export { buildHybridRedlineMarkdown, buildHybridRedlineWithRegions, revertRedlineRegion } from '../chunk-74N436VK.js';
|
|
5
|
-
import { useArbi, arbiQueryKeys } from '../chunk-
|
|
5
|
+
import { useArbi, arbiQueryKeys } from '../chunk-6H3O63TQ.js';
|
|
6
6
|
import '../chunk-DPYBZDJB.js';
|
|
7
7
|
import { isDocumentId, parseVersionRef, flattenChunks, documentVersions, toArtifactVersions, findVersion, versionLabel, cleanDraftWithReport } from '../chunk-UW2SGTI5.js';
|
|
8
8
|
export { cleanDraftMarkdown, cleanDraftWithReport, documentVersions, findVersion, flattenChunks, isDocumentId, parseVersionRef, promoteBoldTitle, repairParsedStructure, repairParsedTitle, savedFromId, stripAgentPreamble, toArtifactVersions, unescapeMarkdown, unwrapCitationLinks, versionLabel, versionRef } from '../chunk-UW2SGTI5.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
var
|
|
3
|
+
var chunkHD5H2PPP_cjs = require('../../chunk-HD5H2PPP.cjs');
|
|
4
|
+
require('../../chunk-5HDKL6XB.cjs');
|
|
5
|
+
var chunk7LIMHY56_cjs = require('../../chunk-7LIMHY56.cjs');
|
|
6
6
|
var chunkRLSBRZ6Z_cjs = require('../../chunk-RLSBRZ6Z.cjs');
|
|
7
7
|
require('../../chunk-N73IMVFF.cjs');
|
|
8
8
|
require('../../chunk-NDIKMOBJ.cjs');
|
|
@@ -120,11 +120,11 @@ function useCallTranscriber({
|
|
|
120
120
|
const room = componentsReact.useRoomContext();
|
|
121
121
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
122
122
|
const myIdentity = localParticipant.identity;
|
|
123
|
-
const arbi =
|
|
123
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
124
124
|
const queryClient = reactQuery.useQueryClient();
|
|
125
125
|
const profile = arbi.isLoggedIn ? arbi.user.profile() : null;
|
|
126
|
-
const myProfileName = profile &&
|
|
127
|
-
const deploymentAvailable =
|
|
126
|
+
const myProfileName = profile && chunkHD5H2PPP_cjs.toProfileView(profile).fullName || null;
|
|
127
|
+
const deploymentAvailable = chunkHD5H2PPP_cjs.useCallTranscriptionAvailable();
|
|
128
128
|
const available = deploymentAvailable && !!callKey;
|
|
129
129
|
const [state, setState] = react.useState(null);
|
|
130
130
|
const [creatorExtId, setCreatorExtId] = react.useState(null);
|
|
@@ -167,7 +167,7 @@ function useCallTranscriber({
|
|
|
167
167
|
};
|
|
168
168
|
}, [available, callExtId]);
|
|
169
169
|
react.useEffect(
|
|
170
|
-
() =>
|
|
170
|
+
() => chunkHD5H2PPP_cjs.onCallEvent("call.transcription", (message) => {
|
|
171
171
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
172
172
|
}),
|
|
173
173
|
[callExtId, applyState]
|
|
@@ -183,7 +183,7 @@ function useCallTranscriber({
|
|
|
183
183
|
const persist = react.useCallback(
|
|
184
184
|
(segment, speakerNeedsProxy) => {
|
|
185
185
|
if (!callKey || persisted.current.has(segment.segmentId)) return;
|
|
186
|
-
const role =
|
|
186
|
+
const role = chunkHD5H2PPP_cjs.transcriptPersistRole({
|
|
187
187
|
myIdentity,
|
|
188
188
|
canPost: canPost && (segment.speakerIdentity !== myIdentity || selfPosts.current),
|
|
189
189
|
hasCallKey: true,
|
|
@@ -192,7 +192,7 @@ function useCallTranscriber({
|
|
|
192
192
|
});
|
|
193
193
|
if (!role) return;
|
|
194
194
|
persisted.current.add(segment.segmentId);
|
|
195
|
-
|
|
195
|
+
chunkHD5H2PPP_cjs.persistTranscriptSegment(arbi, queryClient, callExtId, callKey, segment).catch(
|
|
196
196
|
(err) => {
|
|
197
197
|
persisted.current.delete(segment.segmentId);
|
|
198
198
|
if (role === "own" && err?.status === 403) {
|
|
@@ -212,7 +212,7 @@ function useCallTranscriber({
|
|
|
212
212
|
);
|
|
213
213
|
react.useEffect(() => {
|
|
214
214
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
215
|
-
if (topic ===
|
|
215
|
+
if (topic === chunkHD5H2PPP_cjs.CALL_TRANSCRIPTION_TOPIC) {
|
|
216
216
|
if (participant || participantIdentity) return;
|
|
217
217
|
try {
|
|
218
218
|
const next = browser.calls.transcriptionStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -221,10 +221,10 @@ function useCallTranscriber({
|
|
|
221
221
|
}
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
if (topic !==
|
|
224
|
+
if (topic !== chunkHD5H2PPP_cjs.CALL_CAPTION_TOPIC || !callKey) return;
|
|
225
225
|
const identity = participant?.identity ?? participantIdentity;
|
|
226
226
|
if (!identity || identity === myIdentity) return;
|
|
227
|
-
void
|
|
227
|
+
void chunkHD5H2PPP_cjs.decodeCaptionPacket(payload, callKey).then((packet) => {
|
|
228
228
|
if (!packet || packet.identity !== identity) return;
|
|
229
229
|
const name = participant?.name || packet.name || identity;
|
|
230
230
|
const t = Math.min(packet.t, Date.now());
|
|
@@ -264,7 +264,7 @@ function useCallTranscriber({
|
|
|
264
264
|
})) {
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
const segmentId =
|
|
267
|
+
const segmentId = chunkHD5H2PPP_cjs.newSegmentId();
|
|
268
268
|
const startedAt = new Date(segment.startedAt).toISOString();
|
|
269
269
|
let text;
|
|
270
270
|
try {
|
|
@@ -298,7 +298,7 @@ function useCallTranscriber({
|
|
|
298
298
|
});
|
|
299
299
|
try {
|
|
300
300
|
await localParticipant.publishData(
|
|
301
|
-
await
|
|
301
|
+
await chunkHD5H2PPP_cjs.encodeCaptionPacket(
|
|
302
302
|
{
|
|
303
303
|
v: 1,
|
|
304
304
|
segment_id: segmentId,
|
|
@@ -310,7 +310,7 @@ function useCallTranscriber({
|
|
|
310
310
|
},
|
|
311
311
|
callKey
|
|
312
312
|
),
|
|
313
|
-
{ reliable: true, topic:
|
|
313
|
+
{ reliable: true, topic: chunkHD5H2PPP_cjs.CALL_CAPTION_TOPIC }
|
|
314
314
|
);
|
|
315
315
|
} catch (err) {
|
|
316
316
|
console.warn("[calls] could not broadcast a caption", err);
|
|
@@ -391,7 +391,7 @@ function useCallRecorder({
|
|
|
391
391
|
isCreator,
|
|
392
392
|
linkVersion = null
|
|
393
393
|
}) {
|
|
394
|
-
const arbi =
|
|
394
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
395
395
|
const queryClient = reactQuery.useQueryClient();
|
|
396
396
|
const room = componentsReact.useRoomContext();
|
|
397
397
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
@@ -425,14 +425,14 @@ function useCallRecorder({
|
|
|
425
425
|
};
|
|
426
426
|
}, [callExtId]);
|
|
427
427
|
react.useEffect(
|
|
428
|
-
() =>
|
|
428
|
+
() => chunkHD5H2PPP_cjs.onCallEvent("call.recording", (message) => {
|
|
429
429
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
430
430
|
}),
|
|
431
431
|
[callExtId, applyState]
|
|
432
432
|
);
|
|
433
433
|
react.useEffect(() => {
|
|
434
434
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
435
|
-
if (topic !==
|
|
435
|
+
if (topic !== chunkHD5H2PPP_cjs.CALL_RECORDING_TOPIC) return;
|
|
436
436
|
if (participant || participantIdentity) return;
|
|
437
437
|
try {
|
|
438
438
|
const next = browser.calls.recordingStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -453,7 +453,7 @@ function useCallRecorder({
|
|
|
453
453
|
try {
|
|
454
454
|
const row = call ?? await arbi.calls.get(callExtId);
|
|
455
455
|
if (!row.workspace_locked && !row.chat_ext_id && callKey) {
|
|
456
|
-
const ref = await
|
|
456
|
+
const ref = await chunkHD5H2PPP_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
457
457
|
if (ref.kind === "chat") setCall({ ...row, chat_ext_id: ref.chatExtId });
|
|
458
458
|
}
|
|
459
459
|
const answer = await arbi.calls.recording.start(callExtId, mode);
|
|
@@ -551,11 +551,11 @@ function useCallRecorder({
|
|
|
551
551
|
}
|
|
552
552
|
function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
553
553
|
const { recordingExtId, call, startedAt, shouldCapture, markStopped, linkVersion } = recording;
|
|
554
|
-
const arbi =
|
|
554
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
555
555
|
const queryClient = reactQuery.useQueryClient();
|
|
556
556
|
return react.useMemo(() => {
|
|
557
557
|
if (!shouldCapture || !recordingExtId || !call) return null;
|
|
558
|
-
return
|
|
558
|
+
return chunkHD5H2PPP_cjs.trackUploaderFor({
|
|
559
559
|
arbi,
|
|
560
560
|
callExtId: call.external_id,
|
|
561
561
|
recordingExtId,
|
|
@@ -563,7 +563,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
|
563
563
|
mimeType,
|
|
564
564
|
recordingStartedAt: startedAt,
|
|
565
565
|
linkVersion,
|
|
566
|
-
conversationKey: () =>
|
|
566
|
+
conversationKey: () => chunkHD5H2PPP_cjs.conversationKeyForCall(arbi, queryClient, call, { callKey }),
|
|
567
567
|
// The server stopped the recording at the quota (its state event says so too).
|
|
568
568
|
onStopped: () => markStopped()
|
|
569
569
|
});
|
|
@@ -591,9 +591,9 @@ function useInCallChat({
|
|
|
591
591
|
const room = componentsReact.useRoomContext();
|
|
592
592
|
const { localParticipant } = componentsReact.useLocalParticipant();
|
|
593
593
|
const myIdentity = localParticipant.identity;
|
|
594
|
-
const arbi =
|
|
594
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
595
595
|
const queryClient = reactQuery.useQueryClient();
|
|
596
|
-
const openMeetingChat =
|
|
596
|
+
const openMeetingChat = chunk7LIMHY56_cjs.useArbiHost().calls?.openMeetingChat;
|
|
597
597
|
const signedIn = arbi.isLoggedIn;
|
|
598
598
|
const persists = !!callKey && signedIn && !readOnly && persist;
|
|
599
599
|
const [live, setLive] = react.useState([]);
|
|
@@ -612,10 +612,10 @@ function useInCallChat({
|
|
|
612
612
|
react.useEffect(() => {
|
|
613
613
|
if (!callKey) return;
|
|
614
614
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
615
|
-
if (topic !==
|
|
615
|
+
if (topic !== chunkHD5H2PPP_cjs.CALL_CHAT_TOPIC) return;
|
|
616
616
|
const identity = participant?.identity ?? participantIdentity;
|
|
617
617
|
if (!identity || identity === myIdentity) return;
|
|
618
|
-
void
|
|
618
|
+
void chunkHD5H2PPP_cjs.decodeCallChatPacket(payload, callKey).then((packet) => {
|
|
619
619
|
if (!packet) return;
|
|
620
620
|
const key = `${identity}:${packet.id}`;
|
|
621
621
|
if (seen.current.has(key)) return;
|
|
@@ -645,7 +645,7 @@ function useInCallChat({
|
|
|
645
645
|
if (!open || !canRead || historyRequested.current) return;
|
|
646
646
|
historyRequested.current = true;
|
|
647
647
|
setHistoryLoading(true);
|
|
648
|
-
|
|
648
|
+
chunkHD5H2PPP_cjs.loadMeetingHistory(arbi, queryClient, callExtId).then((result) => {
|
|
649
649
|
if (!result) return;
|
|
650
650
|
setMeetingChat(result.ref);
|
|
651
651
|
setHistory(result.messages);
|
|
@@ -656,13 +656,13 @@ function useInCallChat({
|
|
|
656
656
|
}, [open, canRead, callExtId]);
|
|
657
657
|
const send = react.useCallback(
|
|
658
658
|
async (raw) => {
|
|
659
|
-
const text = raw.trim().slice(0,
|
|
659
|
+
const text = raw.trim().slice(0, chunkHD5H2PPP_cjs.CALL_CHAT_MAX_CHARS);
|
|
660
660
|
if (!text || !callKey || readOnly) return;
|
|
661
|
-
const id =
|
|
661
|
+
const id = chunkHD5H2PPP_cjs.newPacketId();
|
|
662
662
|
const at = Date.now();
|
|
663
663
|
await localParticipant.publishData(
|
|
664
|
-
await
|
|
665
|
-
{ reliable: true, topic:
|
|
664
|
+
await chunkHD5H2PPP_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
|
|
665
|
+
{ reliable: true, topic: chunkHD5H2PPP_cjs.CALL_CHAT_TOPIC }
|
|
666
666
|
);
|
|
667
667
|
setLive((prev) => [
|
|
668
668
|
...prev,
|
|
@@ -681,7 +681,7 @@ function useInCallChat({
|
|
|
681
681
|
(prev) => prev.map((l) => l.id === id && l.senderIdentity === myIdentity ? { ...l, status } : l)
|
|
682
682
|
);
|
|
683
683
|
try {
|
|
684
|
-
setMeetingChat(await
|
|
684
|
+
setMeetingChat(await chunkHD5H2PPP_cjs.persistMeetingMessage(arbi, queryClient, callExtId, callKey, text));
|
|
685
685
|
mark("saved");
|
|
686
686
|
} catch (err) {
|
|
687
687
|
console.warn("[calls] could not keep the message in the meeting chat", err);
|
|
@@ -693,7 +693,7 @@ function useInCallChat({
|
|
|
693
693
|
const openMeeting = react.useCallback(async () => {
|
|
694
694
|
if (!callKey) return;
|
|
695
695
|
try {
|
|
696
|
-
const ref = meetingChat ?? await
|
|
696
|
+
const ref = meetingChat ?? await chunkHD5H2PPP_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
697
697
|
setMeetingChat(ref);
|
|
698
698
|
openMeetingChat?.(ref);
|
|
699
699
|
} catch (err) {
|
|
@@ -701,7 +701,7 @@ function useInCallChat({
|
|
|
701
701
|
}
|
|
702
702
|
}, [callExtId, callKey, meetingChat]);
|
|
703
703
|
const lines = react.useMemo(
|
|
704
|
-
() =>
|
|
704
|
+
() => chunkHD5H2PPP_cjs.mergeChatLines(history, live, {
|
|
705
705
|
myIdentity,
|
|
706
706
|
nameOf: (identity) => identity === myIdentity ? localParticipant.name || "You" : room.remoteParticipants.get(identity)?.name || null
|
|
707
707
|
}),
|
|
@@ -733,7 +733,7 @@ function useWebinar({
|
|
|
733
733
|
linkVersion = null,
|
|
734
734
|
callKey
|
|
735
735
|
}) {
|
|
736
|
-
const arbi =
|
|
736
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
737
737
|
const webinarApi = react.useCallback(() => arbi.calls.webinar, [arbi]);
|
|
738
738
|
const enabled = !!roleHint;
|
|
739
739
|
const room = componentsReact.useRoomContext();
|
|
@@ -760,7 +760,7 @@ function useWebinar({
|
|
|
760
760
|
const n = ++questionsRead.current;
|
|
761
761
|
try {
|
|
762
762
|
const rows = await webinarApi().questions.list(callExtId, linkVersion);
|
|
763
|
-
const opened = await Promise.all(rows.map((q) =>
|
|
763
|
+
const opened = await Promise.all(rows.map((q) => chunkHD5H2PPP_cjs.openQuestion(q, callKey)));
|
|
764
764
|
if (n === questionsRead.current) setQuestions(opened);
|
|
765
765
|
} catch (err) {
|
|
766
766
|
console.warn("[calls] could not load the questions", err);
|
|
@@ -772,7 +772,7 @@ function useWebinar({
|
|
|
772
772
|
}, [refresh, refreshQuestions]);
|
|
773
773
|
react.useEffect(() => {
|
|
774
774
|
if (!enabled) return;
|
|
775
|
-
return
|
|
775
|
+
return chunkHD5H2PPP_cjs.onCallEvent("call.webinar", (m) => {
|
|
776
776
|
if (m.call_ext_id !== callExtId) return;
|
|
777
777
|
setState((s) => s ? { ...s, live: m.live, chat: m.chat } : s);
|
|
778
778
|
});
|
|
@@ -781,8 +781,8 @@ function useWebinar({
|
|
|
781
781
|
react.useEffect(() => {
|
|
782
782
|
if (!enabled) return;
|
|
783
783
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
784
|
-
if (topic !==
|
|
785
|
-
const packet =
|
|
784
|
+
if (topic !== chunkHD5H2PPP_cjs.CALL_WEBINAR_TOPIC) return;
|
|
785
|
+
const packet = chunkHD5H2PPP_cjs.parseWebinarPacket(payload, !!(participant || participantIdentity));
|
|
786
786
|
if (!packet) return;
|
|
787
787
|
switch (packet.type) {
|
|
788
788
|
case "state":
|
|
@@ -803,7 +803,7 @@ function useWebinar({
|
|
|
803
803
|
return;
|
|
804
804
|
case "demoted":
|
|
805
805
|
setStageCheck(false);
|
|
806
|
-
|
|
806
|
+
chunkHD5H2PPP_cjs.markRejoining(callExtId);
|
|
807
807
|
if (fallback.current) clearTimeout(fallback.current);
|
|
808
808
|
fallback.current = setTimeout(() => void room.disconnect(), DEMOTE_REJOIN_FALLBACK_MS);
|
|
809
809
|
return;
|
|
@@ -830,12 +830,12 @@ function useWebinar({
|
|
|
830
830
|
[callExtId, linkVersion]
|
|
831
831
|
);
|
|
832
832
|
const stepDown = react.useCallback(async () => {
|
|
833
|
-
|
|
833
|
+
chunkHD5H2PPP_cjs.markRejoining(callExtId);
|
|
834
834
|
setStageCheck(false);
|
|
835
835
|
try {
|
|
836
836
|
await webinarApi().demote(callExtId, myIdentity, linkVersion);
|
|
837
837
|
} catch (err) {
|
|
838
|
-
|
|
838
|
+
chunkHD5H2PPP_cjs.markRejoining(callExtId, false);
|
|
839
839
|
failed("leave the stage")(err);
|
|
840
840
|
}
|
|
841
841
|
}, [callExtId, myIdentity, linkVersion]);
|
|
@@ -895,7 +895,7 @@ function useWebinar({
|
|
|
895
895
|
if (!callKey) throw new Error("This call has no key.");
|
|
896
896
|
await webinarApi().questions.ask(
|
|
897
897
|
callExtId,
|
|
898
|
-
await
|
|
898
|
+
await chunkHD5H2PPP_cjs.sealQuestionText(text, callKey),
|
|
899
899
|
linkVersion
|
|
900
900
|
);
|
|
901
901
|
}, "ask the question"),
|
|
@@ -909,7 +909,7 @@ function useWebinar({
|
|
|
909
909
|
await webinarApi().questions.update(
|
|
910
910
|
callExtId,
|
|
911
911
|
id,
|
|
912
|
-
{ answer: await
|
|
912
|
+
{ answer: await chunkHD5H2PPP_cjs.sealQuestionText(text, callKey) },
|
|
913
913
|
linkVersion
|
|
914
914
|
);
|
|
915
915
|
}, "answer the question"),
|
|
@@ -939,15 +939,15 @@ function useWebinar({
|
|
|
939
939
|
function useHostMuteNotice(callExtId) {
|
|
940
940
|
const room = componentsReact.useRoomContext();
|
|
941
941
|
react.useEffect(() => {
|
|
942
|
-
const notifyMuted =
|
|
942
|
+
const notifyMuted = chunkHD5H2PPP_cjs.createMutedNotifier((text) => chunkRLSBRZ6Z_cjs.notify.info(text));
|
|
943
943
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
944
|
-
if (topic !==
|
|
944
|
+
if (topic !== chunkHD5H2PPP_cjs.CALL_MODERATION_TOPIC) return;
|
|
945
945
|
if (participant || participantIdentity) return;
|
|
946
|
-
const notice =
|
|
946
|
+
const notice = chunkHD5H2PPP_cjs.mutedNoticeFromPacket(payload);
|
|
947
947
|
if (notice) notifyMuted(notice);
|
|
948
948
|
};
|
|
949
949
|
room.on(livekitClient.RoomEvent.DataReceived, onData);
|
|
950
|
-
const offWs =
|
|
950
|
+
const offWs = chunkHD5H2PPP_cjs.onCallEvent("call.muted", (message) => {
|
|
951
951
|
if (message.callExtId === callExtId) notifyMuted(message);
|
|
952
952
|
});
|
|
953
953
|
return () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { useArbi, useArbiHost } from '../../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-DQALOQPI.js';
|
|
2
|
+
import '../../chunk-H5M7FXLB.js';
|
|
3
|
+
import { useArbi, useArbiHost } from '../../chunk-6H3O63TQ.js';
|
|
4
4
|
import { notify } from '../../chunk-BF5KW5ZI.js';
|
|
5
5
|
import '../../chunk-DPYBZDJB.js';
|
|
6
6
|
import '../../chunk-UW2SGTI5.js';
|