@arbidocs/react 0.5.105 → 0.5.106
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/calls/livekit/index.cjs +40 -40
- package/dist/calls/livekit/index.js +1 -1
- package/dist/{chunk-DM4KTNKI.cjs → chunk-2YRQJ3DR.cjs} +22 -22
- package/dist/{chunk-DM4KTNKI.cjs.map → chunk-2YRQJ3DR.cjs.map} +1 -1
- package/dist/{chunk-RKTBXAS4.js → chunk-7NKF3VUN.js} +4 -4
- package/dist/{chunk-RKTBXAS4.js.map → chunk-7NKF3VUN.js.map} +1 -1
- package/dist/{chunk-Z3W4XFWB.cjs → chunk-C72FSQUE.cjs} +3 -3
- package/dist/{chunk-Z3W4XFWB.cjs.map → chunk-C72FSQUE.cjs.map} +1 -1
- package/dist/{chunk-NNAJLY6B.js → chunk-DPR7LVZO.js} +3 -3
- package/dist/{chunk-NNAJLY6B.js.map → chunk-DPR7LVZO.js.map} +1 -1
- package/dist/{chunk-LBAG7KL7.cjs → chunk-FQVNZCTD.cjs} +3 -3
- package/dist/{chunk-LBAG7KL7.cjs.map → chunk-FQVNZCTD.cjs.map} +1 -1
- package/dist/{chunk-TV4QQVZM.cjs → chunk-K7UUWND5.cjs} +3 -2
- package/dist/chunk-K7UUWND5.cjs.map +1 -0
- package/dist/{chunk-OYPKKHXY.js → chunk-OSFKAJT2.js} +3 -3
- package/dist/{chunk-OYPKKHXY.js.map → chunk-OSFKAJT2.js.map} +1 -1
- package/dist/{chunk-PJMCBB6E.js → chunk-VAO76OJO.js} +3 -2
- package/dist/chunk-VAO76OJO.js.map +1 -0
- package/dist/{chunk-XBYVYPU5.cjs → chunk-YUESCKE2.cjs} +17 -5
- package/dist/chunk-YUESCKE2.cjs.map +1 -0
- package/dist/{chunk-4UUZ67JL.js → chunk-ZGGDH54R.js} +17 -5
- package/dist/chunk-ZGGDH54R.js.map +1 -0
- package/dist/document-tools/core.cjs +98 -98
- package/dist/document-tools/core.d.cts +2 -1
- package/dist/document-tools/core.d.ts +2 -1
- package/dist/document-tools/core.js +4 -4
- package/dist/document-tools/index.cjs +100 -100
- package/dist/document-tools/index.js +5 -5
- package/dist/index.cjs +720 -668
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +135 -10
- package/dist/index.d.ts +135 -10
- package/dist/index.js +64 -12
- package/dist/index.js.map +1 -1
- 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-4UUZ67JL.js.map +0 -1
- package/dist/chunk-PJMCBB6E.js.map +0 -1
- package/dist/chunk-TV4QQVZM.cjs.map +0 -1
- package/dist/chunk-XBYVYPU5.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK7UUWND5_cjs = require('../../chunk-K7UUWND5.cjs');
|
|
4
4
|
require('../../chunk-XOS7ISIR.cjs');
|
|
5
5
|
var chunkQ2GNEVG2_cjs = require('../../chunk-Q2GNEVG2.cjs');
|
|
6
6
|
var chunkRLSBRZ6Z_cjs = require('../../chunk-RLSBRZ6Z.cjs');
|
|
@@ -123,8 +123,8 @@ function useCallTranscriber({
|
|
|
123
123
|
const arbi = chunkQ2GNEVG2_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 && chunkK7UUWND5_cjs.toProfileView(profile).fullName || null;
|
|
127
|
+
const deploymentAvailable = chunkK7UUWND5_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
|
+
() => chunkK7UUWND5_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 = chunkK7UUWND5_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
|
+
chunkK7UUWND5_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 === chunkK7UUWND5_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 !== chunkK7UUWND5_cjs.CALL_CAPTION_TOPIC || !callKey) return;
|
|
225
225
|
const identity = participant?.identity ?? participantIdentity;
|
|
226
226
|
if (!identity || identity === myIdentity) return;
|
|
227
|
-
void
|
|
227
|
+
void chunkK7UUWND5_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 = chunkK7UUWND5_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 chunkK7UUWND5_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: chunkK7UUWND5_cjs.CALL_CAPTION_TOPIC }
|
|
314
314
|
);
|
|
315
315
|
} catch (err) {
|
|
316
316
|
console.warn("[calls] could not broadcast a caption", err);
|
|
@@ -425,14 +425,14 @@ function useCallRecorder({
|
|
|
425
425
|
};
|
|
426
426
|
}, [callExtId]);
|
|
427
427
|
react.useEffect(
|
|
428
|
-
() =>
|
|
428
|
+
() => chunkK7UUWND5_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 !== chunkK7UUWND5_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 chunkK7UUWND5_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);
|
|
@@ -555,7 +555,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
|
555
555
|
const queryClient = reactQuery.useQueryClient();
|
|
556
556
|
return react.useMemo(() => {
|
|
557
557
|
if (!shouldCapture || !recordingExtId || !call) return null;
|
|
558
|
-
return
|
|
558
|
+
return chunkK7UUWND5_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: () => chunkK7UUWND5_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
|
});
|
|
@@ -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 !== chunkK7UUWND5_cjs.CALL_CHAT_TOPIC) return;
|
|
616
616
|
const identity = participant?.identity ?? participantIdentity;
|
|
617
617
|
if (!identity || identity === myIdentity) return;
|
|
618
|
-
void
|
|
618
|
+
void chunkK7UUWND5_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
|
+
chunkK7UUWND5_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, chunkK7UUWND5_cjs.CALL_CHAT_MAX_CHARS);
|
|
660
660
|
if (!text || !callKey || readOnly) return;
|
|
661
|
-
const id =
|
|
661
|
+
const id = chunkK7UUWND5_cjs.newPacketId();
|
|
662
662
|
const at = Date.now();
|
|
663
663
|
await localParticipant.publishData(
|
|
664
|
-
await
|
|
665
|
-
{ reliable: true, topic:
|
|
664
|
+
await chunkK7UUWND5_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
|
|
665
|
+
{ reliable: true, topic: chunkK7UUWND5_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 chunkK7UUWND5_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 chunkK7UUWND5_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
|
+
() => chunkK7UUWND5_cjs.mergeChatLines(history, live, {
|
|
705
705
|
myIdentity,
|
|
706
706
|
nameOf: (identity) => identity === myIdentity ? localParticipant.name || "You" : room.remoteParticipants.get(identity)?.name || null
|
|
707
707
|
}),
|
|
@@ -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) => chunkK7UUWND5_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 chunkK7UUWND5_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 !== chunkK7UUWND5_cjs.CALL_WEBINAR_TOPIC) return;
|
|
785
|
+
const packet = chunkK7UUWND5_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
|
+
chunkK7UUWND5_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
|
+
chunkK7UUWND5_cjs.markRejoining(callExtId);
|
|
834
834
|
setStageCheck(false);
|
|
835
835
|
try {
|
|
836
836
|
await webinarApi().demote(callExtId, myIdentity, linkVersion);
|
|
837
837
|
} catch (err) {
|
|
838
|
-
|
|
838
|
+
chunkK7UUWND5_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 chunkK7UUWND5_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 chunkK7UUWND5_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 = chunkK7UUWND5_cjs.createMutedNotifier((text) => chunkRLSBRZ6Z_cjs.notify.info(text));
|
|
943
943
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
944
|
-
if (topic !==
|
|
944
|
+
if (topic !== chunkK7UUWND5_cjs.CALL_MODERATION_TOPIC) return;
|
|
945
945
|
if (participant || participantIdentity) return;
|
|
946
|
-
const notice =
|
|
946
|
+
const notice = chunkK7UUWND5_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 = chunkK7UUWND5_cjs.onCallEvent("call.muted", (message) => {
|
|
951
951
|
if (message.callExtId === callExtId) notifyMuted(message);
|
|
952
952
|
});
|
|
953
953
|
return () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-VAO76OJO.js';
|
|
2
2
|
import '../../chunk-AXKIOI2U.js';
|
|
3
3
|
import { useArbi, useArbiHost } from '../../chunk-M74JCOXW.js';
|
|
4
4
|
import { notify } from '../../chunk-BF5KW5ZI.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYUESCKE2_cjs = require('./chunk-YUESCKE2.cjs');
|
|
4
|
+
var chunkQ2GNEVG2_cjs = require('./chunk-Q2GNEVG2.cjs');
|
|
4
5
|
var chunkSUZORMAB_cjs = require('./chunk-SUZORMAB.cjs');
|
|
5
6
|
var chunk2IJP73ZG_cjs = require('./chunk-2IJP73ZG.cjs');
|
|
6
|
-
var chunkQ2GNEVG2_cjs = require('./chunk-Q2GNEVG2.cjs');
|
|
7
7
|
var chunkNDIKMOBJ_cjs = require('./chunk-NDIKMOBJ.cjs');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -210,7 +210,7 @@ function versionsWithMarkup(versions) {
|
|
|
210
210
|
}
|
|
211
211
|
var SIGNED_UNCHANGED = "The signed PDF is unchanged: the comments are kept beside it as markup.";
|
|
212
212
|
function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false) {
|
|
213
|
-
const { client, notify, saveFile, onDocumentsChanged } =
|
|
213
|
+
const { client, notify, saveFile, onDocumentsChanged } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
214
214
|
const documentId = documentData?.external_id;
|
|
215
215
|
const currentVersion = documentData?.current_version ?? 1;
|
|
216
216
|
const shownVersion = snapshotVersion ?? currentVersion;
|
|
@@ -241,11 +241,11 @@ function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false)
|
|
|
241
241
|
const downloadMarkup = react.useCallback(async () => {
|
|
242
242
|
if (!documentId) return;
|
|
243
243
|
if (currentSigned) {
|
|
244
|
-
notify(
|
|
244
|
+
notify(chunkYUESCKE2_cjs.SIGNED_LOCKED_REASON, "info");
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
247
|
try {
|
|
248
|
-
const { blob, fileName } = await
|
|
248
|
+
const { blob, fileName } = await chunkYUESCKE2_cjs.fetchMarkupPdf(
|
|
249
249
|
client,
|
|
250
250
|
documentId,
|
|
251
251
|
snapshotVersion ? snapshotVersion : void 0
|
|
@@ -383,7 +383,7 @@ function useIsOnline() {
|
|
|
383
383
|
);
|
|
384
384
|
}
|
|
385
385
|
function useDocumentBytes(documentRef, options) {
|
|
386
|
-
const { client } =
|
|
386
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
387
387
|
const { version, kind, enabled = true, fallback } = options;
|
|
388
388
|
return reactQuery.useQuery({
|
|
389
389
|
queryKey: chunkQ2GNEVG2_cjs.documentBytesKey(documentRef, version ?? null, kind),
|
|
@@ -393,7 +393,7 @@ function useDocumentBytes(documentRef, options) {
|
|
|
393
393
|
if (offline) return offline;
|
|
394
394
|
}
|
|
395
395
|
try {
|
|
396
|
-
return await (kind === "original" ?
|
|
396
|
+
return await (kind === "original" ? chunkYUESCKE2_cjs.fetchDocumentFile : chunkYUESCKE2_cjs.fetchDocumentPdf)(
|
|
397
397
|
client,
|
|
398
398
|
documentRef,
|
|
399
399
|
{ signal }
|
|
@@ -438,7 +438,7 @@ async function fetchDocumentSignatures(client, documentRef) {
|
|
|
438
438
|
return data;
|
|
439
439
|
}
|
|
440
440
|
function useDocumentSignatures(documentId, enabled = true) {
|
|
441
|
-
const { client } =
|
|
441
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
442
442
|
const { docId, version } = chunkNDIKMOBJ_cjs.parseVersionRef(documentId);
|
|
443
443
|
return reactQuery.useQuery({
|
|
444
444
|
queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.documentSignatures(docId ?? "", version),
|
|
@@ -506,7 +506,7 @@ async function signDocument(client$1, deploymentDomain, {
|
|
|
506
506
|
return signed.data;
|
|
507
507
|
}
|
|
508
508
|
function useSignDocument() {
|
|
509
|
-
const env =
|
|
509
|
+
const env = chunkYUESCKE2_cjs.useDocumentTools();
|
|
510
510
|
const queryClient = reactQuery.useQueryClient();
|
|
511
511
|
return reactQuery.useMutation({
|
|
512
512
|
mutationFn: (vars) => {
|
|
@@ -552,7 +552,7 @@ async function fetchSignatureVerification(client, reference) {
|
|
|
552
552
|
return data;
|
|
553
553
|
}
|
|
554
554
|
function useSignatureVerification(reference) {
|
|
555
|
-
const { client } =
|
|
555
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
556
556
|
return reactQuery.useQuery({
|
|
557
557
|
queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.signatureVerification(reference ?? ""),
|
|
558
558
|
queryFn: () => fetchSignatureVerification(client, reference),
|
|
@@ -661,7 +661,7 @@ async function fetchDocumentSignatureRequests(client, documentId) {
|
|
|
661
661
|
return data;
|
|
662
662
|
}
|
|
663
663
|
function useDocumentSignatureRequests(documentId, enabled = true) {
|
|
664
|
-
const { client } =
|
|
664
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
665
665
|
return reactQuery.useQuery({
|
|
666
666
|
queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
|
|
667
667
|
queryFn: () => fetchDocumentSignatureRequests(client, documentId),
|
|
@@ -709,7 +709,7 @@ function useInvalidateRequests() {
|
|
|
709
709
|
return () => queryClient.invalidateQueries({ queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.signatureRequests() });
|
|
710
710
|
}
|
|
711
711
|
function useSaveSignatureRequest() {
|
|
712
|
-
const { client } =
|
|
712
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
713
713
|
const invalidate = useInvalidateRequests();
|
|
714
714
|
return reactQuery.useMutation({
|
|
715
715
|
mutationFn: (vars) => saveSignatureRequest(client, vars),
|
|
@@ -717,7 +717,7 @@ function useSaveSignatureRequest() {
|
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
719
|
function useVoidSignatureRequest() {
|
|
720
|
-
const { client } =
|
|
720
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
721
721
|
const invalidate = useInvalidateRequests();
|
|
722
722
|
return reactQuery.useMutation({
|
|
723
723
|
mutationFn: async (requestId) => {
|
|
@@ -731,7 +731,7 @@ function useVoidSignatureRequest() {
|
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
function useDeclineSignatureRequest() {
|
|
734
|
-
const { client } =
|
|
734
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
735
735
|
const invalidate = useInvalidateRequests();
|
|
736
736
|
return reactQuery.useMutation({
|
|
737
737
|
mutationFn: async ({ requestId, reason }) => {
|
|
@@ -771,7 +771,7 @@ async function signSignatureRequest(client$1, deploymentDomain, { request, pdfBl
|
|
|
771
771
|
return signed.data;
|
|
772
772
|
}
|
|
773
773
|
function useSignSignatureRequest() {
|
|
774
|
-
const env =
|
|
774
|
+
const env = chunkYUESCKE2_cjs.useDocumentTools();
|
|
775
775
|
const invalidate = useInvalidateRequests();
|
|
776
776
|
const queryClient = reactQuery.useQueryClient();
|
|
777
777
|
return reactQuery.useMutation({
|
|
@@ -789,7 +789,7 @@ function useSignSignatureRequest() {
|
|
|
789
789
|
});
|
|
790
790
|
}
|
|
791
791
|
function useSignerCandidates(enabled = true) {
|
|
792
|
-
const { client, user } =
|
|
792
|
+
const { client, user } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
793
793
|
const { workspaceId, read } = useOpenWorkspaceRead();
|
|
794
794
|
return reactQuery.useQuery({
|
|
795
795
|
queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.signatureCandidates(workspaceId ?? ""),
|
|
@@ -830,7 +830,7 @@ async function inviteSigners(client, documentId, emails) {
|
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
function useInviteSigners() {
|
|
833
|
-
const { client } =
|
|
833
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
834
834
|
const invalidate = useInvalidateRequests();
|
|
835
835
|
const queryClient = reactQuery.useQueryClient();
|
|
836
836
|
return reactQuery.useMutation({
|
|
@@ -874,7 +874,7 @@ async function deleteSavedSignature(client) {
|
|
|
874
874
|
if (!response.ok) throw new Error(detail2(error, "Your saved signature could not be deleted"));
|
|
875
875
|
}
|
|
876
876
|
function useSavedSignature(enabled = true) {
|
|
877
|
-
const { client } =
|
|
877
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
878
878
|
return reactQuery.useQuery({
|
|
879
879
|
queryKey: chunkQ2GNEVG2_cjs.arbiQueryKeys.savedSignature(),
|
|
880
880
|
queryFn: () => fetchSavedSignature(client),
|
|
@@ -884,7 +884,7 @@ function useSavedSignature(enabled = true) {
|
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
886
|
function useStoreSavedSignature() {
|
|
887
|
-
const { client } =
|
|
887
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
888
888
|
const queryClient = reactQuery.useQueryClient();
|
|
889
889
|
return reactQuery.useMutation({
|
|
890
890
|
mutationFn: (signature) => storeSavedSignature(client, signature),
|
|
@@ -892,7 +892,7 @@ function useStoreSavedSignature() {
|
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
894
|
function useDeleteSavedSignature() {
|
|
895
|
-
const { client } =
|
|
895
|
+
const { client } = chunkYUESCKE2_cjs.useDocumentTools();
|
|
896
896
|
const queryClient = reactQuery.useQueryClient();
|
|
897
897
|
return reactQuery.useMutation({
|
|
898
898
|
mutationFn: () => deleteSavedSignature(client),
|
|
@@ -1085,5 +1085,5 @@ exports.useSignerCandidates = useSignerCandidates;
|
|
|
1085
1085
|
exports.useStoreSavedSignature = useStoreSavedSignature;
|
|
1086
1086
|
exports.useVoidSignatureRequest = useVoidSignatureRequest;
|
|
1087
1087
|
exports.versionsWithMarkup = versionsWithMarkup;
|
|
1088
|
-
//# sourceMappingURL=chunk-
|
|
1089
|
-
//# sourceMappingURL=chunk-
|
|
1088
|
+
//# sourceMappingURL=chunk-2YRQJ3DR.cjs.map
|
|
1089
|
+
//# sourceMappingURL=chunk-2YRQJ3DR.cjs.map
|