@arbidocs/react 0.5.154 → 0.5.155

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.
Files changed (33) hide show
  1. package/dist/artifacts/index.cjs +14 -14
  2. package/dist/calls/livekit/index.cjs +48 -48
  3. package/dist/{chunk-H2TP7JWR.cjs → chunk-6TJL4Z2F.cjs} +10 -10
  4. package/dist/{chunk-H2TP7JWR.cjs.map → chunk-6TJL4Z2F.cjs.map} +1 -1
  5. package/dist/{chunk-ZBCTLPO5.cjs → chunk-FQ2PSM75.cjs} +57 -57
  6. package/dist/{chunk-ZBCTLPO5.cjs.map → chunk-FQ2PSM75.cjs.map} +1 -1
  7. package/dist/{chunk-5LKTSVTE.cjs → chunk-PI3PEXQW.cjs} +66 -66
  8. package/dist/{chunk-5LKTSVTE.cjs.map → chunk-PI3PEXQW.cjs.map} +1 -1
  9. package/dist/{chunk-ZELH6W5C.cjs → chunk-QV7KINWC.cjs} +37 -37
  10. package/dist/{chunk-ZELH6W5C.cjs.map → chunk-QV7KINWC.cjs.map} +1 -1
  11. package/dist/{chunk-4VHECR5O.cjs → chunk-V5WCKJEH.cjs} +44 -44
  12. package/dist/{chunk-4VHECR5O.cjs.map → chunk-V5WCKJEH.cjs.map} +1 -1
  13. package/dist/{chunk-XQLJSNAL.cjs → chunk-WJIRX5MS.cjs} +3 -3
  14. package/dist/{chunk-XQLJSNAL.cjs.map → chunk-WJIRX5MS.cjs.map} +1 -1
  15. package/dist/{chunk-5ZNO77YB.cjs → chunk-ZZBCZRA5.cjs} +4 -2
  16. package/dist/chunk-ZZBCZRA5.cjs.map +1 -0
  17. package/dist/document-tools/core.cjs +100 -100
  18. package/dist/document-tools/core.d.ts +2 -2
  19. package/dist/document-tools/index.cjs +102 -102
  20. package/dist/document-tools/index.d.ts +2 -2
  21. package/dist/{file-shares.d-CyTnJ2Re.d.ts → file-shares.d-Bwy9k3Db.d.ts} +2 -0
  22. package/dist/index.cjs +1689 -1652
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.ts +33 -4
  25. package/dist/query-keys.js +2 -0
  26. package/dist/query-keys.js.map +2 -2
  27. package/dist/ui/index.cjs +168 -168
  28. package/dist/workspaces/index.js +8 -0
  29. package/dist/workspaces/index.js.map +2 -2
  30. package/dist/workspaces/transfer.js +38 -0
  31. package/dist/workspaces/transfer.js.map +2 -2
  32. package/package.json +3 -3
  33. package/dist/chunk-5ZNO77YB.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkH2TP7JWR_cjs = require('./chunk-H2TP7JWR.cjs');
3
+ var chunk6TJL4Z2F_cjs = require('./chunk-6TJL4Z2F.cjs');
4
4
  var chunkSUZORMAB_cjs = require('./chunk-SUZORMAB.cjs');
5
5
  var chunk2IJP73ZG_cjs = require('./chunk-2IJP73ZG.cjs');
6
- var chunk5ZNO77YB_cjs = require('./chunk-5ZNO77YB.cjs');
6
+ var chunkZZBCZRA5_cjs = require('./chunk-ZZBCZRA5.cjs');
7
7
  var chunkKULS4YWP_cjs = require('./chunk-KULS4YWP.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 } = chunkH2TP7JWR_cjs.useDocumentTools();
213
+ const { client, notify, saveFile, onDocumentsChanged } = chunk6TJL4Z2F_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(chunkH2TP7JWR_cjs.SIGNED_LOCKED_REASON, "info");
244
+ notify(chunk6TJL4Z2F_cjs.SIGNED_LOCKED_REASON, "info");
245
245
  return;
246
246
  }
247
247
  try {
248
- const { blob, fileName } = await chunkH2TP7JWR_cjs.fetchMarkupPdf(
248
+ const { blob, fileName } = await chunk6TJL4Z2F_cjs.fetchMarkupPdf(
249
249
  client,
250
250
  documentId,
251
251
  snapshotVersion ? snapshotVersion : void 0
@@ -383,17 +383,17 @@ function useIsOnline() {
383
383
  );
384
384
  }
385
385
  function useDocumentBytes(documentRef, options) {
386
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
386
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
387
387
  const { version, kind, enabled = true, fallback, retryMissing = 0 } = options;
388
388
  return reactQuery.useQuery({
389
- queryKey: chunk5ZNO77YB_cjs.documentBytesKey(documentRef, version ?? null, kind),
389
+ queryKey: chunkZZBCZRA5_cjs.documentBytesKey(documentRef, version ?? null, kind),
390
390
  queryFn: async ({ signal }) => {
391
391
  if (fallback && typeof navigator !== "undefined" && navigator.onLine === false) {
392
392
  const offline = await fallback();
393
393
  if (offline) return offline;
394
394
  }
395
395
  try {
396
- return await (kind === "original" ? chunkH2TP7JWR_cjs.fetchDocumentFile : chunkH2TP7JWR_cjs.fetchDocumentPdf)(
396
+ return await (kind === "original" ? chunk6TJL4Z2F_cjs.fetchDocumentFile : chunk6TJL4Z2F_cjs.fetchDocumentPdf)(
397
397
  client,
398
398
  documentRef,
399
399
  { signal, version: chunkKULS4YWP_cjs.parseVersionRef(documentRef).version ?? version }
@@ -454,22 +454,22 @@ async function fetchSignatureVerification(client, reference) {
454
454
  return data;
455
455
  }
456
456
  function useSignatureVerification(reference) {
457
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
457
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
458
458
  return reactQuery.useQuery({
459
- queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.signatureVerification(reference ?? ""),
459
+ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.signatureVerification(reference ?? ""),
460
460
  queryFn: () => fetchSignatureVerification(client, reference),
461
461
  enabled: !!reference,
462
462
  retry: false
463
463
  });
464
464
  }
465
465
  async function matchSignedCopy(file, verification) {
466
- const hash = await chunkH2TP7JWR_cjs.sha256Hex(file);
466
+ const hash = await chunk6TJL4Z2F_cjs.sha256Hex(file);
467
467
  if (hash === verification.document_sha256.toLowerCase()) return { kind: "current" };
468
468
  const signature = verification.signatures.find((s) => s.sha256.toLowerCase() === hash);
469
469
  return signature ? { kind: "earlier", signature } : { kind: "none" };
470
470
  }
471
471
  function useOpenWorkspaceRead() {
472
- const arbi = chunk5ZNO77YB_cjs.useArbiHost().arbi;
472
+ const arbi = chunkZZBCZRA5_cjs.useArbiHost().arbi;
473
473
  const workspaceId = arbi?.hasWorkspace ? arbi.getWorkspaceId() : void 0;
474
474
  const read = (run) => arbi && workspaceId ? arbi.readInWorkspace(workspaceId, run) : run();
475
475
  return { workspaceId, read };
@@ -563,9 +563,9 @@ async function fetchDocumentSignatureRequests(client, documentId) {
563
563
  return data;
564
564
  }
565
565
  function useDocumentSignatureRequests(documentId, enabled = true) {
566
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
566
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
567
567
  return reactQuery.useQuery({
568
- queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
568
+ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
569
569
  queryFn: () => fetchDocumentSignatureRequests(client, documentId),
570
570
  enabled: enabled && !!documentId,
571
571
  staleTime: 15e3
@@ -608,10 +608,10 @@ async function saveSignatureRequest(client, { documentId, version, fields, messa
608
608
  }
609
609
  function useInvalidateRequests() {
610
610
  const queryClient = reactQuery.useQueryClient();
611
- return () => queryClient.invalidateQueries({ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.signatureRequests() });
611
+ return () => queryClient.invalidateQueries({ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.signatureRequests() });
612
612
  }
613
613
  function useSaveSignatureRequest() {
614
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
614
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
615
615
  const invalidate = useInvalidateRequests();
616
616
  return reactQuery.useMutation({
617
617
  mutationFn: (vars) => saveSignatureRequest(client, vars),
@@ -619,7 +619,7 @@ function useSaveSignatureRequest() {
619
619
  });
620
620
  }
621
621
  function useVoidSignatureRequest() {
622
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
622
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
623
623
  const invalidate = useInvalidateRequests();
624
624
  return reactQuery.useMutation({
625
625
  mutationFn: async (requestId) => {
@@ -633,7 +633,7 @@ function useVoidSignatureRequest() {
633
633
  });
634
634
  }
635
635
  function useDeclineSignatureRequest() {
636
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
636
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
637
637
  const invalidate = useInvalidateRequests();
638
638
  return reactQuery.useMutation({
639
639
  mutationFn: async ({ requestId, reason }) => {
@@ -655,13 +655,13 @@ async function signSignatureRequest(client$1, deploymentDomain, { request, pdfBl
655
655
  body
656
656
  });
657
657
  if (!prepared.data) {
658
- throw new chunkH2TP7JWR_cjs.SigningError(detail(prepared.error, "Could not prepare signing"), "failed");
658
+ throw new chunk6TJL4Z2F_cjs.SigningError(detail(prepared.error, "Could not prepare signing"), "failed");
659
659
  }
660
660
  const { statement, intent, source_sha256, timestamp } = prepared.data;
661
- if (source_sha256 !== request.source_sha256 || await chunkH2TP7JWR_cjs.sha256Hex(pdfBlob) !== source_sha256) {
662
- throw new chunkH2TP7JWR_cjs.SigningError("The document changed since it was sent. Ask for it again.", "stale");
661
+ if (source_sha256 !== request.source_sha256 || await chunk6TJL4Z2F_cjs.sha256Hex(pdfBlob) !== source_sha256) {
662
+ throw new chunk6TJL4Z2F_cjs.SigningError("The document changed since it was sent. Ask for it again.", "stale");
663
663
  }
664
- if (intent !== chunkH2TP7JWR_cjs.intentText({ name: adopted.name })) {
664
+ if (intent !== chunk6TJL4Z2F_cjs.intentText({ name: adopted.name })) {
665
665
  throw new Error("Signing statement mismatch; not signed.");
666
666
  }
667
667
  const identity = await client.unlockIdentityWithPassword(email, password, deploymentDomain);
@@ -669,11 +669,11 @@ async function signSignatureRequest(client$1, deploymentDomain, { request, pdfBl
669
669
  params: { path },
670
670
  body: { ...body, timestamp, signature: client.signMessage(statement, identity) }
671
671
  });
672
- if (!signed.data) throw new chunkH2TP7JWR_cjs.SigningError(detail(signed.error, "Signing failed"), "failed");
672
+ if (!signed.data) throw new chunk6TJL4Z2F_cjs.SigningError(detail(signed.error, "Signing failed"), "failed");
673
673
  return signed.data;
674
674
  }
675
675
  function useSignSignatureRequest() {
676
- const env = chunkH2TP7JWR_cjs.useDocumentTools();
676
+ const env = chunk6TJL4Z2F_cjs.useDocumentTools();
677
677
  const invalidate = useInvalidateRequests();
678
678
  const queryClient = reactQuery.useQueryClient();
679
679
  return reactQuery.useMutation({
@@ -685,16 +685,16 @@ function useSignSignatureRequest() {
685
685
  await invalidate();
686
686
  if (result.completed && result.request.doc_ext_id) {
687
687
  await env.onDocumentsChanged?.([result.request.doc_ext_id], "signed");
688
- await queryClient.invalidateQueries({ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.documentSignatures() });
688
+ await queryClient.invalidateQueries({ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.documentSignatures() });
689
689
  }
690
690
  }
691
691
  });
692
692
  }
693
693
  function useSignerCandidates(enabled = true) {
694
- const { client, user } = chunkH2TP7JWR_cjs.useDocumentTools();
694
+ const { client, user } = chunk6TJL4Z2F_cjs.useDocumentTools();
695
695
  const { workspaceId, read } = useOpenWorkspaceRead();
696
696
  return reactQuery.useQuery({
697
- queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.signatureCandidates(workspaceId ?? ""),
697
+ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.signatureCandidates(workspaceId ?? ""),
698
698
  queryFn: async () => {
699
699
  const { data, error } = await read(() => client.GET("/v1/workspace/users"));
700
700
  if (!data) throw new Error(detail(error, "The workspace members could not be read"));
@@ -732,14 +732,14 @@ async function inviteSigners(client, documentId, emails) {
732
732
  }
733
733
  }
734
734
  function useInviteSigners() {
735
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
735
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
736
736
  const invalidate = useInvalidateRequests();
737
737
  const queryClient = reactQuery.useQueryClient();
738
738
  return reactQuery.useMutation({
739
739
  mutationFn: ({ documentId, emails }) => inviteSigners(client, documentId, emails),
740
740
  onSuccess: async () => {
741
741
  await invalidate();
742
- await queryClient.invalidateQueries({ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.signatureCandidates() });
742
+ await queryClient.invalidateQueries({ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.signatureCandidates() });
743
743
  }
744
744
  });
745
745
  }
@@ -776,9 +776,9 @@ async function deleteSavedSignature(client) {
776
776
  if (!response.ok) throw new Error(detail2(error, "Your saved signature could not be deleted"));
777
777
  }
778
778
  function useSavedSignature(enabled = true) {
779
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
779
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
780
780
  return reactQuery.useQuery({
781
- queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.savedSignature(),
781
+ queryKey: chunkZZBCZRA5_cjs.arbiQueryKeys.savedSignature(),
782
782
  queryFn: () => fetchSavedSignature(client),
783
783
  enabled,
784
784
  staleTime: 6e4,
@@ -786,19 +786,19 @@ function useSavedSignature(enabled = true) {
786
786
  });
787
787
  }
788
788
  function useStoreSavedSignature() {
789
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
789
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
790
790
  const queryClient = reactQuery.useQueryClient();
791
791
  return reactQuery.useMutation({
792
792
  mutationFn: (signature) => storeSavedSignature(client, signature),
793
- onSuccess: (_, signature) => queryClient.setQueryData(chunk5ZNO77YB_cjs.arbiQueryKeys.savedSignature(), signature)
793
+ onSuccess: (_, signature) => queryClient.setQueryData(chunkZZBCZRA5_cjs.arbiQueryKeys.savedSignature(), signature)
794
794
  });
795
795
  }
796
796
  function useDeleteSavedSignature() {
797
- const { client } = chunkH2TP7JWR_cjs.useDocumentTools();
797
+ const { client } = chunk6TJL4Z2F_cjs.useDocumentTools();
798
798
  const queryClient = reactQuery.useQueryClient();
799
799
  return reactQuery.useMutation({
800
800
  mutationFn: () => deleteSavedSignature(client),
801
- onSuccess: () => queryClient.setQueryData(chunk5ZNO77YB_cjs.arbiQueryKeys.savedSignature(), null)
801
+ onSuccess: () => queryClient.setQueryData(chunkZZBCZRA5_cjs.arbiQueryKeys.savedSignature(), null)
802
802
  });
803
803
  }
804
804
  function pngBytes(base64) {
@@ -873,5 +873,5 @@ exports.useSignerCandidates = useSignerCandidates;
873
873
  exports.useStoreSavedSignature = useStoreSavedSignature;
874
874
  exports.useVoidSignatureRequest = useVoidSignatureRequest;
875
875
  exports.versionsWithMarkup = versionsWithMarkup;
876
- //# sourceMappingURL=chunk-ZELH6W5C.cjs.map
877
- //# sourceMappingURL=chunk-ZELH6W5C.cjs.map
876
+ //# sourceMappingURL=chunk-QV7KINWC.cjs.map
877
+ //# sourceMappingURL=chunk-QV7KINWC.cjs.map