@arbidocs/react 0.4.167 → 0.4.168
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 +15 -12
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.js +6 -3
- package/dist/artifacts/index.js.map +1 -1
- package/dist/calls/livekit/index.cjs +977 -0
- package/dist/calls/livekit/index.cjs.map +1 -0
- package/dist/calls/livekit/index.d.cts +280 -0
- package/dist/calls/livekit/index.d.ts +280 -0
- package/dist/calls/livekit/index.js +961 -0
- package/dist/calls/livekit/index.js.map +1 -0
- package/dist/{chunk-ON4PL6DQ.cjs → chunk-2M4B4FFA.cjs} +48 -4
- package/dist/chunk-2M4B4FFA.cjs.map +1 -0
- package/dist/chunk-3J7MEBOW.cjs +2551 -0
- package/dist/chunk-3J7MEBOW.cjs.map +1 -0
- package/dist/chunk-3NVSUYUV.js +528 -0
- package/dist/chunk-3NVSUYUV.js.map +1 -0
- package/dist/{chunk-QJHCVQ6C.js → chunk-3WIBD44F.js} +4734 -4673
- package/dist/chunk-3WIBD44F.js.map +1 -0
- package/dist/chunk-5B4PPJNW.cjs +1035 -0
- package/dist/chunk-5B4PPJNW.cjs.map +1 -0
- package/dist/chunk-5HDC43MF.js +145 -0
- package/dist/chunk-5HDC43MF.js.map +1 -0
- package/dist/{chunk-D66JCVBB.cjs → chunk-7NHOKV7N.cjs} +4093 -4040
- package/dist/chunk-7NHOKV7N.cjs.map +1 -0
- package/dist/chunk-APZZQZ6P.js +147 -0
- package/dist/chunk-APZZQZ6P.js.map +1 -0
- package/dist/{chunk-I5ZBQ63Y.js → chunk-DGMK3EUN.js} +188 -181
- package/dist/chunk-DGMK3EUN.js.map +1 -0
- package/dist/chunk-DPYBZDJB.js +18 -0
- package/dist/chunk-DPYBZDJB.js.map +1 -0
- package/dist/chunk-EEIYXVM4.cjs +181 -0
- package/dist/chunk-EEIYXVM4.cjs.map +1 -0
- package/dist/chunk-H3LMKO3T.js +2362 -0
- package/dist/chunk-H3LMKO3T.js.map +1 -0
- package/dist/{chunk-JSSKEXRR.js → chunk-KGCGA452.js} +2 -2
- package/dist/chunk-KGCGA452.js.map +1 -0
- package/dist/chunk-MJNZLWJD.js +986 -0
- package/dist/chunk-MJNZLWJD.js.map +1 -0
- package/dist/chunk-N73IMVFF.cjs +21 -0
- package/dist/chunk-N73IMVFF.cjs.map +1 -0
- package/dist/chunk-NVAIVJID.js +298 -0
- package/dist/chunk-NVAIVJID.js.map +1 -0
- package/dist/{chunk-GTJ667CP.cjs → chunk-QQ7SCJRY.cjs} +2 -2
- package/dist/chunk-QQ7SCJRY.cjs.map +1 -0
- package/dist/chunk-S4PCA3ES.cjs +572 -0
- package/dist/chunk-S4PCA3ES.cjs.map +1 -0
- package/dist/chunk-VAMPYLQ4.cjs +157 -0
- package/dist/chunk-VAMPYLQ4.cjs.map +1 -0
- package/dist/chunk-VLK52VXC.cjs +307 -0
- package/dist/chunk-VLK52VXC.cjs.map +1 -0
- package/dist/{chunk-SVHGCX25.js → chunk-YWYCEEBF.js} +43 -4
- package/dist/chunk-YWYCEEBF.js.map +1 -0
- package/dist/{chunk-EUC2BTNS.cjs → chunk-ZI2VJOID.cjs} +206 -199
- package/dist/chunk-ZI2VJOID.cjs.map +1 -0
- package/dist/document-tools/index.cjs +79 -107
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +4 -5
- package/dist/document-tools/index.d.ts +4 -5
- package/dist/document-tools/index.js +23 -68
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +12692 -9494
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-DfCFKora.d.cts → index.d-Bvp6rKNo.d.cts} +139 -1
- package/dist/{index.d-DfCFKora.d.ts → index.d-Bvp6rKNo.d.ts} +139 -1
- package/dist/{index.d-DCjYj7YK.d.ts → index.d-Dx9sGkW2.d.cts} +20 -8
- package/dist/{index.d-DCjYj7YK.d.cts → index.d-Dx9sGkW2.d.ts} +20 -8
- package/dist/index.d.cts +5465 -2291
- package/dist/index.d.ts +5465 -2291
- package/dist/index.js +11047 -8858
- package/dist/index.js.map +1 -1
- package/dist/query-keys.d-Kw0JMoff.d.cts +308 -0
- package/dist/query-keys.d-Kw0JMoff.d.ts +308 -0
- package/dist/shell/index.cjs +78 -21
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +6 -1
- package/dist/ui/index.cjs +200 -195
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +4 -3
- package/dist/useAudioRecorder.d-CWFDsb_S.d.cts +778 -0
- package/dist/useAudioRecorder.d-CWFDsb_S.d.ts +778 -0
- package/dist/viewers/index.cjs +2 -2
- package/dist/viewers/index.js +1 -1
- package/package.json +13 -3
- package/dist/chunk-6MTKKT2O.cjs +0 -999
- package/dist/chunk-6MTKKT2O.cjs.map +0 -1
- package/dist/chunk-CEZCFQ47.js +0 -932
- package/dist/chunk-CEZCFQ47.js.map +0 -1
- package/dist/chunk-D66JCVBB.cjs.map +0 -1
- package/dist/chunk-EUC2BTNS.cjs.map +0 -1
- package/dist/chunk-GTJ667CP.cjs.map +0 -1
- package/dist/chunk-I5ZBQ63Y.js.map +0 -1
- package/dist/chunk-JSSKEXRR.js.map +0 -1
- package/dist/chunk-ON4PL6DQ.cjs.map +0 -1
- package/dist/chunk-QJHCVQ6C.js.map +0 -1
- package/dist/chunk-SVHGCX25.js.map +0 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2M4B4FFA_cjs = require('../chunk-2M4B4FFA.cjs');
|
|
4
4
|
var chunkRDF2Q45F_cjs = require('../chunk-RDF2Q45F.cjs');
|
|
5
5
|
var chunkLRBOMQ6Q_cjs = require('../chunk-LRBOMQ6Q.cjs');
|
|
6
|
+
var chunkVLK52VXC_cjs = require('../chunk-VLK52VXC.cjs');
|
|
6
7
|
var chunkZWFMFOGP_cjs = require('../chunk-ZWFMFOGP.cjs');
|
|
7
8
|
require('../chunk-VOFNX4P6.cjs');
|
|
8
9
|
require('../chunk-WYZJLZ67.cjs');
|
|
9
|
-
require('../chunk-Z3LLUO32.cjs');
|
|
10
10
|
require('../chunk-HJDR5HEO.cjs');
|
|
11
|
+
require('../chunk-Z3LLUO32.cjs');
|
|
11
12
|
require('../chunk-S6A6FSG7.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-QQ7SCJRY.cjs');
|
|
13
14
|
require('../chunk-RCKA7BEF.cjs');
|
|
14
15
|
var react = require('react');
|
|
15
16
|
var reactQuery = require('@tanstack/react-query');
|
|
16
17
|
var client = require('@arbidocs/client');
|
|
18
|
+
var browser = require('@arbidocs/sdk/browser');
|
|
17
19
|
|
|
18
20
|
// src/document-tools/production.ts
|
|
19
21
|
var PRODUCTIONS_FOLDER = "Productions";
|
|
@@ -40,9 +42,9 @@ async function fetchProductionPdf(client, doc) {
|
|
|
40
42
|
const pdf = isPdfDocument(doc);
|
|
41
43
|
let blob;
|
|
42
44
|
try {
|
|
43
|
-
blob = await (pdf ?
|
|
45
|
+
blob = await (pdf ? chunk2M4B4FFA_cjs.fetchDocumentFile : chunk2M4B4FFA_cjs.fetchDocumentPdf)(client, doc.external_id);
|
|
44
46
|
} catch (e) {
|
|
45
|
-
if (!pdf && e instanceof
|
|
47
|
+
if (!pdf && e instanceof chunk2M4B4FFA_cjs.DocumentFetchError) return null;
|
|
46
48
|
throw e;
|
|
47
49
|
}
|
|
48
50
|
const bytes = new Uint8Array(await blob.arrayBuffer());
|
|
@@ -345,48 +347,9 @@ async function copyOpenThreads(documentId, fromVersion, client) {
|
|
|
345
347
|
function versionsWithMarkup(versions) {
|
|
346
348
|
return (versions ?? []).filter((v) => (v.markup_count ?? 0) > 0);
|
|
347
349
|
}
|
|
348
|
-
|
|
349
|
-
// src/document-tools/markup-download.ts
|
|
350
|
-
var SIGNED_LOCKED_REASON = "Signed documents can't be changed \u2014 download the signed file instead";
|
|
351
|
-
function isSignedVersion(doc, version) {
|
|
352
|
-
const n = version ?? doc.current_version ?? 1;
|
|
353
|
-
return (doc.versions ?? []).some((v) => v.n === n && v.reason === "signed");
|
|
354
|
-
}
|
|
355
|
-
var MarkupDownloadError = class extends Error {
|
|
356
|
-
constructor(message, status) {
|
|
357
|
-
super(message);
|
|
358
|
-
this.status = status;
|
|
359
|
-
this.name = "MarkupDownloadError";
|
|
360
|
-
}
|
|
361
|
-
status;
|
|
362
|
-
};
|
|
363
|
-
function currentHasMarkup(doc) {
|
|
364
|
-
const n = doc.current_version ?? 1;
|
|
365
|
-
return (doc.versions ?? []).some((v) => v.n === n && (v.markup_count ?? 0) > 0);
|
|
366
|
-
}
|
|
367
|
-
async function fetchMarkupPdf(client, documentId, version) {
|
|
368
|
-
const { data, response } = await client.GET("/v1/document/{document_ext_id}/markup/pdf", {
|
|
369
|
-
params: { path: { document_ext_id: documentId }, query: version ? { version } : {} },
|
|
370
|
-
parseAs: "blob"
|
|
371
|
-
});
|
|
372
|
-
if (!response.ok || !data) {
|
|
373
|
-
throw new MarkupDownloadError(
|
|
374
|
-
response.status === 404 ? "This document has no markup yet" : (
|
|
375
|
-
// The server refuses a signed version: its PDF takes no more changes.
|
|
376
|
-
response.status === 409 ? SIGNED_LOCKED_REASON : "The markup could not be downloaded"
|
|
377
|
-
),
|
|
378
|
-
response.status
|
|
379
|
-
);
|
|
380
|
-
}
|
|
381
|
-
const disposition = response.headers.get("content-disposition") ?? "";
|
|
382
|
-
const utf8 = /filename\*=UTF-8''([^;]+)/i.exec(disposition)?.[1];
|
|
383
|
-
const plain = /filename="([^"]+)"/i.exec(disposition)?.[1];
|
|
384
|
-
const fileName = utf8 ? decodeURIComponent(utf8) : plain ?? "markup.pdf";
|
|
385
|
-
return { blob: data, fileName };
|
|
386
|
-
}
|
|
387
350
|
var SIGNED_UNCHANGED = "The signed PDF is unchanged: the comments are kept beside it as markup.";
|
|
388
351
|
function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false) {
|
|
389
|
-
const { client, notify, saveFile, onDocumentsChanged } =
|
|
352
|
+
const { client, notify, saveFile, onDocumentsChanged } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
390
353
|
const documentId = documentData?.external_id;
|
|
391
354
|
const currentVersion = documentData?.current_version ?? 1;
|
|
392
355
|
const shownVersion = snapshotVersion ?? currentVersion;
|
|
@@ -417,11 +380,11 @@ function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false)
|
|
|
417
380
|
const downloadMarkup = react.useCallback(async () => {
|
|
418
381
|
if (!documentId) return;
|
|
419
382
|
if (currentSigned) {
|
|
420
|
-
notify(SIGNED_LOCKED_REASON, "info");
|
|
383
|
+
notify(chunk2M4B4FFA_cjs.SIGNED_LOCKED_REASON, "info");
|
|
421
384
|
return;
|
|
422
385
|
}
|
|
423
386
|
try {
|
|
424
|
-
const { blob, fileName } = await fetchMarkupPdf(
|
|
387
|
+
const { blob, fileName } = await chunk2M4B4FFA_cjs.fetchMarkupPdf(
|
|
425
388
|
client,
|
|
426
389
|
documentId,
|
|
427
390
|
snapshotVersion ? snapshotVersion : void 0
|
|
@@ -557,19 +520,18 @@ function useIsOnline() {
|
|
|
557
520
|
() => true
|
|
558
521
|
);
|
|
559
522
|
}
|
|
560
|
-
var documentBytesKey = (documentRef, version, kind) => version === void 0 ? ["arbi", "documentBytes", documentRef] : ["arbi", "documentBytes", documentRef, version, kind ?? "pdf"];
|
|
561
523
|
function useDocumentBytes(documentRef, options) {
|
|
562
|
-
const { client } =
|
|
524
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
563
525
|
const { version, kind, enabled = true, fallback } = options;
|
|
564
526
|
return reactQuery.useQuery({
|
|
565
|
-
queryKey: documentBytesKey(documentRef, version ?? null, kind),
|
|
527
|
+
queryKey: chunkVLK52VXC_cjs.documentBytesKey(documentRef, version ?? null, kind),
|
|
566
528
|
queryFn: async ({ signal }) => {
|
|
567
529
|
if (fallback && typeof navigator !== "undefined" && navigator.onLine === false) {
|
|
568
530
|
const offline = await fallback();
|
|
569
531
|
if (offline) return offline;
|
|
570
532
|
}
|
|
571
533
|
try {
|
|
572
|
-
return await (kind === "original" ?
|
|
534
|
+
return await (kind === "original" ? chunk2M4B4FFA_cjs.fetchDocumentFile : chunk2M4B4FFA_cjs.fetchDocumentPdf)(
|
|
573
535
|
client,
|
|
574
536
|
documentRef,
|
|
575
537
|
{ signal }
|
|
@@ -601,7 +563,6 @@ function isLegibleSignatureBox(rect) {
|
|
|
601
563
|
return rect.w >= MIN_SIGNATURE_BOX.width && rect.h >= MIN_SIGNATURE_BOX.height;
|
|
602
564
|
}
|
|
603
565
|
var SIGNATURES_PATH = "/v1/document/{document_ext_id}/signatures";
|
|
604
|
-
var SIGNATURES_KEY = ["get", SIGNATURES_PATH];
|
|
605
566
|
function errorDetail(error, fallback) {
|
|
606
567
|
const detail3 = error?.detail;
|
|
607
568
|
return typeof detail3 === "string" ? detail3 : fallback;
|
|
@@ -615,13 +576,10 @@ async function fetchDocumentSignatures(client, documentRef) {
|
|
|
615
576
|
return data;
|
|
616
577
|
}
|
|
617
578
|
function useDocumentSignatures(documentId, enabled = true) {
|
|
618
|
-
const { client } =
|
|
579
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
619
580
|
const { docId, version } = chunkZWFMFOGP_cjs.parseVersionRef(documentId);
|
|
620
581
|
return reactQuery.useQuery({
|
|
621
|
-
queryKey:
|
|
622
|
-
...SIGNATURES_KEY,
|
|
623
|
-
{ params: { path: { document_ext_id: docId }, ...version ? { query: { version } } : {} } }
|
|
624
|
-
],
|
|
582
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.documentSignatures(docId ?? "", version),
|
|
625
583
|
queryFn: () => fetchDocumentSignatures(client, documentId),
|
|
626
584
|
enabled: enabled && !!docId,
|
|
627
585
|
staleTime: 6e4
|
|
@@ -686,7 +644,7 @@ async function signDocument(client$1, deploymentDomain, {
|
|
|
686
644
|
return signed.data;
|
|
687
645
|
}
|
|
688
646
|
function useSignDocument() {
|
|
689
|
-
const env =
|
|
647
|
+
const env = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
690
648
|
const queryClient = reactQuery.useQueryClient();
|
|
691
649
|
return reactQuery.useMutation({
|
|
692
650
|
mutationFn: (vars) => {
|
|
@@ -695,7 +653,7 @@ function useSignDocument() {
|
|
|
695
653
|
},
|
|
696
654
|
onSuccess: async (result) => {
|
|
697
655
|
await env.onDocumentsChanged?.([result.doc_ext_id], "signed");
|
|
698
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
656
|
+
await queryClient.invalidateQueries({ queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.documentSignatures() });
|
|
699
657
|
}
|
|
700
658
|
});
|
|
701
659
|
}
|
|
@@ -732,9 +690,9 @@ async function fetchSignatureVerification(client, reference) {
|
|
|
732
690
|
return data;
|
|
733
691
|
}
|
|
734
692
|
function useSignatureVerification(reference) {
|
|
735
|
-
const { client } =
|
|
693
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
736
694
|
return reactQuery.useQuery({
|
|
737
|
-
queryKey:
|
|
695
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureVerification(reference ?? ""),
|
|
738
696
|
queryFn: () => fetchSignatureVerification(client, reference),
|
|
739
697
|
enabled: !!reference,
|
|
740
698
|
retry: false
|
|
@@ -774,7 +732,6 @@ var SIGNER_PROGRESS_LABELS = {
|
|
|
774
732
|
var EMAIL = /^[^@\s<>,;]{1,64}@[^@\s<>,;]{1,255}\.[^@\s<>,;]{1,63}$/;
|
|
775
733
|
var isEmailSigner = (signer) => EMAIL.test(signer.trim());
|
|
776
734
|
var MARK_FIELD_TYPES = ["signature", "initials"];
|
|
777
|
-
var REQUESTS_KEY = ["signature-requests"];
|
|
778
735
|
function detail(error, fallback) {
|
|
779
736
|
const d = error?.detail;
|
|
780
737
|
if (typeof d === "string") return d;
|
|
@@ -836,18 +793,18 @@ async function fetchDocumentSignatureRequests(client, documentId) {
|
|
|
836
793
|
return data;
|
|
837
794
|
}
|
|
838
795
|
function useDocumentSignatureRequests(documentId, enabled = true) {
|
|
839
|
-
const { client } =
|
|
796
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
840
797
|
return reactQuery.useQuery({
|
|
841
|
-
queryKey:
|
|
798
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
|
|
842
799
|
queryFn: () => fetchDocumentSignatureRequests(client, documentId),
|
|
843
800
|
enabled: enabled && !!documentId,
|
|
844
801
|
staleTime: 15e3
|
|
845
802
|
});
|
|
846
803
|
}
|
|
847
804
|
function useSignatureRequestsAwaitingMe(enabled = true) {
|
|
848
|
-
const { client } =
|
|
805
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
849
806
|
return reactQuery.useQuery({
|
|
850
|
-
queryKey:
|
|
807
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequestsAwaitingMe(),
|
|
851
808
|
queryFn: async () => {
|
|
852
809
|
const { data, error } = await client.GET("/v1/signature-requests", {
|
|
853
810
|
params: { query: { awaiting_me: true } }
|
|
@@ -860,9 +817,9 @@ function useSignatureRequestsAwaitingMe(enabled = true) {
|
|
|
860
817
|
});
|
|
861
818
|
}
|
|
862
819
|
function useSignatureRequest(requestId) {
|
|
863
|
-
const { client } =
|
|
820
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
864
821
|
return reactQuery.useQuery({
|
|
865
|
-
queryKey:
|
|
822
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequest(requestId ?? ""),
|
|
866
823
|
queryFn: async () => {
|
|
867
824
|
const { data, error } = await client.GET("/v1/signature-requests/{request_ext_id}", {
|
|
868
825
|
params: { path: { request_ext_id: requestId } }
|
|
@@ -910,10 +867,10 @@ async function saveSignatureRequest(client, { documentId, version, fields, messa
|
|
|
910
867
|
}
|
|
911
868
|
function useInvalidateRequests() {
|
|
912
869
|
const queryClient = reactQuery.useQueryClient();
|
|
913
|
-
return () => queryClient.invalidateQueries({ queryKey:
|
|
870
|
+
return () => queryClient.invalidateQueries({ queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequests() });
|
|
914
871
|
}
|
|
915
872
|
function useSaveSignatureRequest() {
|
|
916
|
-
const { client } =
|
|
873
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
917
874
|
const invalidate = useInvalidateRequests();
|
|
918
875
|
return reactQuery.useMutation({
|
|
919
876
|
mutationFn: (vars) => saveSignatureRequest(client, vars),
|
|
@@ -921,7 +878,7 @@ function useSaveSignatureRequest() {
|
|
|
921
878
|
});
|
|
922
879
|
}
|
|
923
880
|
function useVoidSignatureRequest() {
|
|
924
|
-
const { client } =
|
|
881
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
925
882
|
const invalidate = useInvalidateRequests();
|
|
926
883
|
return reactQuery.useMutation({
|
|
927
884
|
mutationFn: async (requestId) => {
|
|
@@ -935,7 +892,7 @@ function useVoidSignatureRequest() {
|
|
|
935
892
|
});
|
|
936
893
|
}
|
|
937
894
|
function useDeclineSignatureRequest() {
|
|
938
|
-
const { client } =
|
|
895
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
939
896
|
const invalidate = useInvalidateRequests();
|
|
940
897
|
return reactQuery.useMutation({
|
|
941
898
|
mutationFn: async ({ requestId, reason }) => {
|
|
@@ -975,7 +932,7 @@ async function signSignatureRequest(client$1, deploymentDomain, { request, pdfBl
|
|
|
975
932
|
return signed.data;
|
|
976
933
|
}
|
|
977
934
|
function useSignSignatureRequest() {
|
|
978
|
-
const env =
|
|
935
|
+
const env = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
979
936
|
const invalidate = useInvalidateRequests();
|
|
980
937
|
const queryClient = reactQuery.useQueryClient();
|
|
981
938
|
return reactQuery.useMutation({
|
|
@@ -987,17 +944,15 @@ function useSignSignatureRequest() {
|
|
|
987
944
|
await invalidate();
|
|
988
945
|
if (result.completed && result.request.doc_ext_id) {
|
|
989
946
|
await env.onDocumentsChanged?.([result.request.doc_ext_id], "signed");
|
|
990
|
-
await queryClient.invalidateQueries({
|
|
991
|
-
queryKey: ["get", "/v1/document/{document_ext_id}/signatures"]
|
|
992
|
-
});
|
|
947
|
+
await queryClient.invalidateQueries({ queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.documentSignatures() });
|
|
993
948
|
}
|
|
994
949
|
}
|
|
995
950
|
});
|
|
996
951
|
}
|
|
997
952
|
function useSignerCandidates(enabled = true) {
|
|
998
|
-
const { client, user } =
|
|
953
|
+
const { client, user } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
999
954
|
return reactQuery.useQuery({
|
|
1000
|
-
queryKey:
|
|
955
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureCandidates(),
|
|
1001
956
|
queryFn: async () => {
|
|
1002
957
|
const { data, error } = await client.GET("/v1/workspace/users");
|
|
1003
958
|
if (!data) throw new Error(detail(error, "The workspace members could not be read"));
|
|
@@ -1019,13 +974,13 @@ function useSignerCandidates(enabled = true) {
|
|
|
1019
974
|
async function inviteSigners(client, documentId, emails) {
|
|
1020
975
|
if (!emails.length) return;
|
|
1021
976
|
const { error, response } = await client.POST("/v1/workspace/users", {
|
|
1022
|
-
body: {
|
|
977
|
+
body: browser.workspaces.addWorkspaceMembersBody({
|
|
1023
978
|
emails,
|
|
1024
979
|
role: "guest",
|
|
1025
980
|
confirm_invite: true,
|
|
1026
981
|
resource_type: "document",
|
|
1027
982
|
resource_ext_id: documentId
|
|
1028
|
-
}
|
|
983
|
+
})
|
|
1029
984
|
});
|
|
1030
985
|
if (response.status === 409) {
|
|
1031
986
|
throw new Error("Share the document with the workspace before asking others to sign it.");
|
|
@@ -1035,19 +990,18 @@ async function inviteSigners(client, documentId, emails) {
|
|
|
1035
990
|
}
|
|
1036
991
|
}
|
|
1037
992
|
function useInviteSigners() {
|
|
1038
|
-
const { client } =
|
|
993
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
1039
994
|
const invalidate = useInvalidateRequests();
|
|
1040
995
|
const queryClient = reactQuery.useQueryClient();
|
|
1041
996
|
return reactQuery.useMutation({
|
|
1042
997
|
mutationFn: ({ documentId, emails }) => inviteSigners(client, documentId, emails),
|
|
1043
998
|
onSuccess: async () => {
|
|
1044
999
|
await invalidate();
|
|
1045
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
1000
|
+
await queryClient.invalidateQueries({ queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureCandidates() });
|
|
1046
1001
|
}
|
|
1047
1002
|
});
|
|
1048
1003
|
}
|
|
1049
1004
|
var INFORMAL_SIGNATURE_NOTE = "Informal signature: for verified signing, use Request signatures.";
|
|
1050
|
-
var KEY = ["saved-signature"];
|
|
1051
1005
|
async function keypair(source = client.getUserEncryptionKeypair) {
|
|
1052
1006
|
await client.initSodium();
|
|
1053
1007
|
const pair = await source();
|
|
@@ -1080,9 +1034,9 @@ async function deleteSavedSignature(client) {
|
|
|
1080
1034
|
if (!response.ok) throw new Error(detail2(error, "Your saved signature could not be deleted"));
|
|
1081
1035
|
}
|
|
1082
1036
|
function useSavedSignature(enabled = true) {
|
|
1083
|
-
const { client } =
|
|
1037
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
1084
1038
|
return reactQuery.useQuery({
|
|
1085
|
-
queryKey:
|
|
1039
|
+
queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.savedSignature(),
|
|
1086
1040
|
queryFn: () => fetchSavedSignature(client),
|
|
1087
1041
|
enabled,
|
|
1088
1042
|
staleTime: 6e4,
|
|
@@ -1090,19 +1044,19 @@ function useSavedSignature(enabled = true) {
|
|
|
1090
1044
|
});
|
|
1091
1045
|
}
|
|
1092
1046
|
function useStoreSavedSignature() {
|
|
1093
|
-
const { client } =
|
|
1047
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
1094
1048
|
const queryClient = reactQuery.useQueryClient();
|
|
1095
1049
|
return reactQuery.useMutation({
|
|
1096
1050
|
mutationFn: (signature) => storeSavedSignature(client, signature),
|
|
1097
|
-
onSuccess: (_, signature) => queryClient.setQueryData(
|
|
1051
|
+
onSuccess: (_, signature) => queryClient.setQueryData(chunkVLK52VXC_cjs.arbiQueryKeys.savedSignature(), signature)
|
|
1098
1052
|
});
|
|
1099
1053
|
}
|
|
1100
1054
|
function useDeleteSavedSignature() {
|
|
1101
|
-
const { client } =
|
|
1055
|
+
const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
|
|
1102
1056
|
const queryClient = reactQuery.useQueryClient();
|
|
1103
1057
|
return reactQuery.useMutation({
|
|
1104
1058
|
mutationFn: () => deleteSavedSignature(client),
|
|
1105
|
-
onSuccess: () => queryClient.setQueryData(
|
|
1059
|
+
onSuccess: () => queryClient.setQueryData(chunkVLK52VXC_cjs.arbiQueryKeys.savedSignature(), null)
|
|
1106
1060
|
});
|
|
1107
1061
|
}
|
|
1108
1062
|
function pngBytes(base64) {
|
|
@@ -1119,51 +1073,75 @@ function pngSize(base64) {
|
|
|
1119
1073
|
|
|
1120
1074
|
Object.defineProperty(exports, "DocumentFetchError", {
|
|
1121
1075
|
enumerable: true,
|
|
1122
|
-
get: function () { return
|
|
1076
|
+
get: function () { return chunk2M4B4FFA_cjs.DocumentFetchError; }
|
|
1123
1077
|
});
|
|
1124
1078
|
Object.defineProperty(exports, "DocumentToolsProvider", {
|
|
1125
1079
|
enumerable: true,
|
|
1126
|
-
get: function () { return
|
|
1080
|
+
get: function () { return chunk2M4B4FFA_cjs.DocumentToolsProvider; }
|
|
1081
|
+
});
|
|
1082
|
+
Object.defineProperty(exports, "MarkupDownloadError", {
|
|
1083
|
+
enumerable: true,
|
|
1084
|
+
get: function () { return chunk2M4B4FFA_cjs.MarkupDownloadError; }
|
|
1085
|
+
});
|
|
1086
|
+
Object.defineProperty(exports, "SIGNED_LOCKED_REASON", {
|
|
1087
|
+
enumerable: true,
|
|
1088
|
+
get: function () { return chunk2M4B4FFA_cjs.SIGNED_LOCKED_REASON; }
|
|
1127
1089
|
});
|
|
1128
1090
|
Object.defineProperty(exports, "certificateLink", {
|
|
1129
1091
|
enumerable: true,
|
|
1130
|
-
get: function () { return
|
|
1092
|
+
get: function () { return chunk2M4B4FFA_cjs.certificateLink; }
|
|
1131
1093
|
});
|
|
1132
1094
|
Object.defineProperty(exports, "clientUpload", {
|
|
1133
1095
|
enumerable: true,
|
|
1134
|
-
get: function () { return
|
|
1096
|
+
get: function () { return chunk2M4B4FFA_cjs.clientUpload; }
|
|
1135
1097
|
});
|
|
1136
1098
|
Object.defineProperty(exports, "contentDispositionFileName", {
|
|
1137
1099
|
enumerable: true,
|
|
1138
|
-
get: function () { return
|
|
1100
|
+
get: function () { return chunk2M4B4FFA_cjs.contentDispositionFileName; }
|
|
1101
|
+
});
|
|
1102
|
+
Object.defineProperty(exports, "currentHasMarkup", {
|
|
1103
|
+
enumerable: true,
|
|
1104
|
+
get: function () { return chunk2M4B4FFA_cjs.currentHasMarkup; }
|
|
1139
1105
|
});
|
|
1140
1106
|
Object.defineProperty(exports, "defaultCertificateUrl", {
|
|
1141
1107
|
enumerable: true,
|
|
1142
|
-
get: function () { return
|
|
1108
|
+
get: function () { return chunk2M4B4FFA_cjs.defaultCertificateUrl; }
|
|
1143
1109
|
});
|
|
1144
1110
|
Object.defineProperty(exports, "downloadBlob", {
|
|
1145
1111
|
enumerable: true,
|
|
1146
|
-
get: function () { return
|
|
1112
|
+
get: function () { return chunk2M4B4FFA_cjs.downloadBlob; }
|
|
1147
1113
|
});
|
|
1148
1114
|
Object.defineProperty(exports, "fetchDocumentFile", {
|
|
1149
1115
|
enumerable: true,
|
|
1150
|
-
get: function () { return
|
|
1116
|
+
get: function () { return chunk2M4B4FFA_cjs.fetchDocumentFile; }
|
|
1151
1117
|
});
|
|
1152
1118
|
Object.defineProperty(exports, "fetchDocumentPdf", {
|
|
1153
1119
|
enumerable: true,
|
|
1154
|
-
get: function () { return
|
|
1120
|
+
get: function () { return chunk2M4B4FFA_cjs.fetchDocumentPdf; }
|
|
1121
|
+
});
|
|
1122
|
+
Object.defineProperty(exports, "fetchMarkupPdf", {
|
|
1123
|
+
enumerable: true,
|
|
1124
|
+
get: function () { return chunk2M4B4FFA_cjs.fetchMarkupPdf; }
|
|
1125
|
+
});
|
|
1126
|
+
Object.defineProperty(exports, "isSignedVersion", {
|
|
1127
|
+
enumerable: true,
|
|
1128
|
+
get: function () { return chunk2M4B4FFA_cjs.isSignedVersion; }
|
|
1155
1129
|
});
|
|
1156
1130
|
Object.defineProperty(exports, "uploadQueryString", {
|
|
1157
1131
|
enumerable: true,
|
|
1158
|
-
get: function () { return
|
|
1132
|
+
get: function () { return chunk2M4B4FFA_cjs.uploadQueryString; }
|
|
1159
1133
|
});
|
|
1160
1134
|
Object.defineProperty(exports, "useDocumentTools", {
|
|
1161
1135
|
enumerable: true,
|
|
1162
|
-
get: function () { return
|
|
1136
|
+
get: function () { return chunk2M4B4FFA_cjs.useDocumentTools; }
|
|
1163
1137
|
});
|
|
1164
1138
|
Object.defineProperty(exports, "useOptionalDocumentTools", {
|
|
1165
1139
|
enumerable: true,
|
|
1166
|
-
get: function () { return
|
|
1140
|
+
get: function () { return chunk2M4B4FFA_cjs.useOptionalDocumentTools; }
|
|
1141
|
+
});
|
|
1142
|
+
Object.defineProperty(exports, "documentBytesKey", {
|
|
1143
|
+
enumerable: true,
|
|
1144
|
+
get: function () { return chunkVLK52VXC_cjs.documentBytesKey; }
|
|
1167
1145
|
});
|
|
1168
1146
|
exports.DEFAULT_FIELD_SIZE = DEFAULT_FIELD_SIZE;
|
|
1169
1147
|
exports.FIELD_TYPE_LABELS = FIELD_TYPE_LABELS;
|
|
@@ -1171,11 +1149,9 @@ exports.INFORMAL_SIGNATURE_NOTE = INFORMAL_SIGNATURE_NOTE;
|
|
|
1171
1149
|
exports.LEGACY_LAYER_PREFIX = LEGACY_LAYER_PREFIX;
|
|
1172
1150
|
exports.MARK_FIELD_TYPES = MARK_FIELD_TYPES;
|
|
1173
1151
|
exports.MAX_MERGE_ATTEMPTS = MAX_MERGE_ATTEMPTS;
|
|
1174
|
-
exports.MarkupDownloadError = MarkupDownloadError;
|
|
1175
1152
|
exports.MarkupStoreError = MarkupStoreError;
|
|
1176
1153
|
exports.PRODUCTIONS_FOLDER = PRODUCTIONS_FOLDER;
|
|
1177
1154
|
exports.SIGNATURE_FIELD_TYPES = SIGNATURE_FIELD_TYPES;
|
|
1178
|
-
exports.SIGNED_LOCKED_REASON = SIGNED_LOCKED_REASON;
|
|
1179
1155
|
exports.SIGNED_UNCHANGED = SIGNED_UNCHANGED;
|
|
1180
1156
|
exports.SIGNER_PROGRESS_LABELS = SIGNER_PROGRESS_LABELS;
|
|
1181
1157
|
exports.SignatureVerificationError = SignatureVerificationError;
|
|
@@ -1186,12 +1162,9 @@ exports.buildProduction = buildProduction;
|
|
|
1186
1162
|
exports.canAnnotate = canAnnotate;
|
|
1187
1163
|
exports.copyOpenThreads = copyOpenThreads;
|
|
1188
1164
|
exports.createMarkupStore = createMarkupStore;
|
|
1189
|
-
exports.currentHasMarkup = currentHasMarkup;
|
|
1190
1165
|
exports.deleteSavedSignature = deleteSavedSignature;
|
|
1191
|
-
exports.documentBytesKey = documentBytesKey;
|
|
1192
1166
|
exports.fetchDocumentSignatureRequests = fetchDocumentSignatureRequests;
|
|
1193
1167
|
exports.fetchDocumentSignatures = fetchDocumentSignatures;
|
|
1194
|
-
exports.fetchMarkupPdf = fetchMarkupPdf;
|
|
1195
1168
|
exports.fetchProductionPdf = fetchProductionPdf;
|
|
1196
1169
|
exports.fetchSavedSignature = fetchSavedSignature;
|
|
1197
1170
|
exports.fetchSignatureVerification = fetchSignatureVerification;
|
|
@@ -1207,7 +1180,6 @@ exports.isEmailSigner = isEmailSigner;
|
|
|
1207
1180
|
exports.isLegibleSignatureBox = isLegibleSignatureBox;
|
|
1208
1181
|
exports.isPdfDocument = isPdfDocument;
|
|
1209
1182
|
exports.isSignatureReference = isSignatureReference;
|
|
1210
|
-
exports.isSignedVersion = isSignedVersion;
|
|
1211
1183
|
exports.marksByVersion = marksByVersion;
|
|
1212
1184
|
exports.matchSignedCopy = matchSignedCopy;
|
|
1213
1185
|
exports.migrateLegacyLayer = migrateLegacyLayer;
|