@arbidocs/react 0.5.2 → 0.5.3

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.
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunk2M4B4FFA_cjs = require('../chunk-2M4B4FFA.cjs');
3
+ var chunkO4IWCDEJ_cjs = require('../chunk-O4IWCDEJ.cjs');
4
4
  var chunkRDF2Q45F_cjs = require('../chunk-RDF2Q45F.cjs');
5
5
  var chunkLRBOMQ6Q_cjs = require('../chunk-LRBOMQ6Q.cjs');
6
6
  var chunkVLK52VXC_cjs = require('../chunk-VLK52VXC.cjs');
7
+ require('../chunk-WYZJLZ67.cjs');
8
+ require('../chunk-QQ7SCJRY.cjs');
7
9
  var chunkZWFMFOGP_cjs = require('../chunk-ZWFMFOGP.cjs');
8
10
  require('../chunk-VOFNX4P6.cjs');
9
- require('../chunk-WYZJLZ67.cjs');
10
11
  require('../chunk-HJDR5HEO.cjs');
11
12
  require('../chunk-Z3LLUO32.cjs');
12
13
  require('../chunk-S6A6FSG7.cjs');
13
- require('../chunk-QQ7SCJRY.cjs');
14
14
  require('../chunk-RCKA7BEF.cjs');
15
15
  var react = require('react');
16
16
  var reactQuery = require('@tanstack/react-query');
@@ -42,9 +42,9 @@ async function fetchProductionPdf(client, doc) {
42
42
  const pdf = isPdfDocument(doc);
43
43
  let blob;
44
44
  try {
45
- blob = await (pdf ? chunk2M4B4FFA_cjs.fetchDocumentFile : chunk2M4B4FFA_cjs.fetchDocumentPdf)(client, doc.external_id);
45
+ blob = await (pdf ? chunkO4IWCDEJ_cjs.fetchDocumentFile : chunkO4IWCDEJ_cjs.fetchDocumentPdf)(client, doc.external_id);
46
46
  } catch (e) {
47
- if (!pdf && e instanceof chunk2M4B4FFA_cjs.DocumentFetchError) return null;
47
+ if (!pdf && e instanceof chunkO4IWCDEJ_cjs.DocumentFetchError) return null;
48
48
  throw e;
49
49
  }
50
50
  const bytes = new Uint8Array(await blob.arrayBuffer());
@@ -349,7 +349,7 @@ function versionsWithMarkup(versions) {
349
349
  }
350
350
  var SIGNED_UNCHANGED = "The signed PDF is unchanged: the comments are kept beside it as markup.";
351
351
  function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false) {
352
- const { client, notify, saveFile, onDocumentsChanged } = chunk2M4B4FFA_cjs.useDocumentTools();
352
+ const { client, notify, saveFile, onDocumentsChanged } = chunkO4IWCDEJ_cjs.useDocumentTools();
353
353
  const documentId = documentData?.external_id;
354
354
  const currentVersion = documentData?.current_version ?? 1;
355
355
  const shownVersion = snapshotVersion ?? currentVersion;
@@ -380,11 +380,11 @@ function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false)
380
380
  const downloadMarkup = react.useCallback(async () => {
381
381
  if (!documentId) return;
382
382
  if (currentSigned) {
383
- notify(chunk2M4B4FFA_cjs.SIGNED_LOCKED_REASON, "info");
383
+ notify(chunkO4IWCDEJ_cjs.SIGNED_LOCKED_REASON, "info");
384
384
  return;
385
385
  }
386
386
  try {
387
- const { blob, fileName } = await chunk2M4B4FFA_cjs.fetchMarkupPdf(
387
+ const { blob, fileName } = await chunkO4IWCDEJ_cjs.fetchMarkupPdf(
388
388
  client,
389
389
  documentId,
390
390
  snapshotVersion ? snapshotVersion : void 0
@@ -521,7 +521,7 @@ function useIsOnline() {
521
521
  );
522
522
  }
523
523
  function useDocumentBytes(documentRef, options) {
524
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
524
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
525
525
  const { version, kind, enabled = true, fallback } = options;
526
526
  return reactQuery.useQuery({
527
527
  queryKey: chunkVLK52VXC_cjs.documentBytesKey(documentRef, version ?? null, kind),
@@ -531,7 +531,7 @@ function useDocumentBytes(documentRef, options) {
531
531
  if (offline) return offline;
532
532
  }
533
533
  try {
534
- return await (kind === "original" ? chunk2M4B4FFA_cjs.fetchDocumentFile : chunk2M4B4FFA_cjs.fetchDocumentPdf)(
534
+ return await (kind === "original" ? chunkO4IWCDEJ_cjs.fetchDocumentFile : chunkO4IWCDEJ_cjs.fetchDocumentPdf)(
535
535
  client,
536
536
  documentRef,
537
537
  { signal }
@@ -576,7 +576,7 @@ async function fetchDocumentSignatures(client, documentRef) {
576
576
  return data;
577
577
  }
578
578
  function useDocumentSignatures(documentId, enabled = true) {
579
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
579
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
580
580
  const { docId, version } = chunkZWFMFOGP_cjs.parseVersionRef(documentId);
581
581
  return reactQuery.useQuery({
582
582
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.documentSignatures(docId ?? "", version),
@@ -644,7 +644,7 @@ async function signDocument(client$1, deploymentDomain, {
644
644
  return signed.data;
645
645
  }
646
646
  function useSignDocument() {
647
- const env = chunk2M4B4FFA_cjs.useDocumentTools();
647
+ const env = chunkO4IWCDEJ_cjs.useDocumentTools();
648
648
  const queryClient = reactQuery.useQueryClient();
649
649
  return reactQuery.useMutation({
650
650
  mutationFn: (vars) => {
@@ -690,7 +690,7 @@ async function fetchSignatureVerification(client, reference) {
690
690
  return data;
691
691
  }
692
692
  function useSignatureVerification(reference) {
693
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
693
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
694
694
  return reactQuery.useQuery({
695
695
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureVerification(reference ?? ""),
696
696
  queryFn: () => fetchSignatureVerification(client, reference),
@@ -793,7 +793,7 @@ async function fetchDocumentSignatureRequests(client, documentId) {
793
793
  return data;
794
794
  }
795
795
  function useDocumentSignatureRequests(documentId, enabled = true) {
796
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
796
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
797
797
  return reactQuery.useQuery({
798
798
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
799
799
  queryFn: () => fetchDocumentSignatureRequests(client, documentId),
@@ -802,7 +802,7 @@ function useDocumentSignatureRequests(documentId, enabled = true) {
802
802
  });
803
803
  }
804
804
  function useSignatureRequestsAwaitingMe(enabled = true) {
805
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
805
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
806
806
  return reactQuery.useQuery({
807
807
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequestsAwaitingMe(),
808
808
  queryFn: async () => {
@@ -817,7 +817,7 @@ function useSignatureRequestsAwaitingMe(enabled = true) {
817
817
  });
818
818
  }
819
819
  function useSignatureRequest(requestId) {
820
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
820
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
821
821
  return reactQuery.useQuery({
822
822
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequest(requestId ?? ""),
823
823
  queryFn: async () => {
@@ -870,7 +870,7 @@ function useInvalidateRequests() {
870
870
  return () => queryClient.invalidateQueries({ queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureRequests() });
871
871
  }
872
872
  function useSaveSignatureRequest() {
873
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
873
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
874
874
  const invalidate = useInvalidateRequests();
875
875
  return reactQuery.useMutation({
876
876
  mutationFn: (vars) => saveSignatureRequest(client, vars),
@@ -878,7 +878,7 @@ function useSaveSignatureRequest() {
878
878
  });
879
879
  }
880
880
  function useVoidSignatureRequest() {
881
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
881
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
882
882
  const invalidate = useInvalidateRequests();
883
883
  return reactQuery.useMutation({
884
884
  mutationFn: async (requestId) => {
@@ -892,7 +892,7 @@ function useVoidSignatureRequest() {
892
892
  });
893
893
  }
894
894
  function useDeclineSignatureRequest() {
895
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
895
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
896
896
  const invalidate = useInvalidateRequests();
897
897
  return reactQuery.useMutation({
898
898
  mutationFn: async ({ requestId, reason }) => {
@@ -932,7 +932,7 @@ async function signSignatureRequest(client$1, deploymentDomain, { request, pdfBl
932
932
  return signed.data;
933
933
  }
934
934
  function useSignSignatureRequest() {
935
- const env = chunk2M4B4FFA_cjs.useDocumentTools();
935
+ const env = chunkO4IWCDEJ_cjs.useDocumentTools();
936
936
  const invalidate = useInvalidateRequests();
937
937
  const queryClient = reactQuery.useQueryClient();
938
938
  return reactQuery.useMutation({
@@ -950,7 +950,7 @@ function useSignSignatureRequest() {
950
950
  });
951
951
  }
952
952
  function useSignerCandidates(enabled = true) {
953
- const { client, user } = chunk2M4B4FFA_cjs.useDocumentTools();
953
+ const { client, user } = chunkO4IWCDEJ_cjs.useDocumentTools();
954
954
  return reactQuery.useQuery({
955
955
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.signatureCandidates(),
956
956
  queryFn: async () => {
@@ -990,7 +990,7 @@ async function inviteSigners(client, documentId, emails) {
990
990
  }
991
991
  }
992
992
  function useInviteSigners() {
993
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
993
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
994
994
  const invalidate = useInvalidateRequests();
995
995
  const queryClient = reactQuery.useQueryClient();
996
996
  return reactQuery.useMutation({
@@ -1034,7 +1034,7 @@ async function deleteSavedSignature(client) {
1034
1034
  if (!response.ok) throw new Error(detail2(error, "Your saved signature could not be deleted"));
1035
1035
  }
1036
1036
  function useSavedSignature(enabled = true) {
1037
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
1037
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
1038
1038
  return reactQuery.useQuery({
1039
1039
  queryKey: chunkVLK52VXC_cjs.arbiQueryKeys.savedSignature(),
1040
1040
  queryFn: () => fetchSavedSignature(client),
@@ -1044,7 +1044,7 @@ function useSavedSignature(enabled = true) {
1044
1044
  });
1045
1045
  }
1046
1046
  function useStoreSavedSignature() {
1047
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
1047
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
1048
1048
  const queryClient = reactQuery.useQueryClient();
1049
1049
  return reactQuery.useMutation({
1050
1050
  mutationFn: (signature) => storeSavedSignature(client, signature),
@@ -1052,7 +1052,7 @@ function useStoreSavedSignature() {
1052
1052
  });
1053
1053
  }
1054
1054
  function useDeleteSavedSignature() {
1055
- const { client } = chunk2M4B4FFA_cjs.useDocumentTools();
1055
+ const { client } = chunkO4IWCDEJ_cjs.useDocumentTools();
1056
1056
  const queryClient = reactQuery.useQueryClient();
1057
1057
  return reactQuery.useMutation({
1058
1058
  mutationFn: () => deleteSavedSignature(client),
@@ -1073,71 +1073,71 @@ function pngSize(base64) {
1073
1073
 
1074
1074
  Object.defineProperty(exports, "DocumentFetchError", {
1075
1075
  enumerable: true,
1076
- get: function () { return chunk2M4B4FFA_cjs.DocumentFetchError; }
1076
+ get: function () { return chunkO4IWCDEJ_cjs.DocumentFetchError; }
1077
1077
  });
1078
1078
  Object.defineProperty(exports, "DocumentToolsProvider", {
1079
1079
  enumerable: true,
1080
- get: function () { return chunk2M4B4FFA_cjs.DocumentToolsProvider; }
1080
+ get: function () { return chunkO4IWCDEJ_cjs.DocumentToolsProvider; }
1081
1081
  });
1082
1082
  Object.defineProperty(exports, "MarkupDownloadError", {
1083
1083
  enumerable: true,
1084
- get: function () { return chunk2M4B4FFA_cjs.MarkupDownloadError; }
1084
+ get: function () { return chunkO4IWCDEJ_cjs.MarkupDownloadError; }
1085
1085
  });
1086
1086
  Object.defineProperty(exports, "SIGNED_LOCKED_REASON", {
1087
1087
  enumerable: true,
1088
- get: function () { return chunk2M4B4FFA_cjs.SIGNED_LOCKED_REASON; }
1088
+ get: function () { return chunkO4IWCDEJ_cjs.SIGNED_LOCKED_REASON; }
1089
1089
  });
1090
1090
  Object.defineProperty(exports, "certificateLink", {
1091
1091
  enumerable: true,
1092
- get: function () { return chunk2M4B4FFA_cjs.certificateLink; }
1092
+ get: function () { return chunkO4IWCDEJ_cjs.certificateLink; }
1093
1093
  });
1094
1094
  Object.defineProperty(exports, "clientUpload", {
1095
1095
  enumerable: true,
1096
- get: function () { return chunk2M4B4FFA_cjs.clientUpload; }
1096
+ get: function () { return chunkO4IWCDEJ_cjs.clientUpload; }
1097
1097
  });
1098
1098
  Object.defineProperty(exports, "contentDispositionFileName", {
1099
1099
  enumerable: true,
1100
- get: function () { return chunk2M4B4FFA_cjs.contentDispositionFileName; }
1100
+ get: function () { return chunkO4IWCDEJ_cjs.contentDispositionFileName; }
1101
1101
  });
1102
1102
  Object.defineProperty(exports, "currentHasMarkup", {
1103
1103
  enumerable: true,
1104
- get: function () { return chunk2M4B4FFA_cjs.currentHasMarkup; }
1104
+ get: function () { return chunkO4IWCDEJ_cjs.currentHasMarkup; }
1105
1105
  });
1106
1106
  Object.defineProperty(exports, "defaultCertificateUrl", {
1107
1107
  enumerable: true,
1108
- get: function () { return chunk2M4B4FFA_cjs.defaultCertificateUrl; }
1108
+ get: function () { return chunkO4IWCDEJ_cjs.defaultCertificateUrl; }
1109
1109
  });
1110
1110
  Object.defineProperty(exports, "downloadBlob", {
1111
1111
  enumerable: true,
1112
- get: function () { return chunk2M4B4FFA_cjs.downloadBlob; }
1112
+ get: function () { return chunkO4IWCDEJ_cjs.downloadBlob; }
1113
1113
  });
1114
1114
  Object.defineProperty(exports, "fetchDocumentFile", {
1115
1115
  enumerable: true,
1116
- get: function () { return chunk2M4B4FFA_cjs.fetchDocumentFile; }
1116
+ get: function () { return chunkO4IWCDEJ_cjs.fetchDocumentFile; }
1117
1117
  });
1118
1118
  Object.defineProperty(exports, "fetchDocumentPdf", {
1119
1119
  enumerable: true,
1120
- get: function () { return chunk2M4B4FFA_cjs.fetchDocumentPdf; }
1120
+ get: function () { return chunkO4IWCDEJ_cjs.fetchDocumentPdf; }
1121
1121
  });
1122
1122
  Object.defineProperty(exports, "fetchMarkupPdf", {
1123
1123
  enumerable: true,
1124
- get: function () { return chunk2M4B4FFA_cjs.fetchMarkupPdf; }
1124
+ get: function () { return chunkO4IWCDEJ_cjs.fetchMarkupPdf; }
1125
1125
  });
1126
1126
  Object.defineProperty(exports, "isSignedVersion", {
1127
1127
  enumerable: true,
1128
- get: function () { return chunk2M4B4FFA_cjs.isSignedVersion; }
1128
+ get: function () { return chunkO4IWCDEJ_cjs.isSignedVersion; }
1129
1129
  });
1130
1130
  Object.defineProperty(exports, "uploadQueryString", {
1131
1131
  enumerable: true,
1132
- get: function () { return chunk2M4B4FFA_cjs.uploadQueryString; }
1132
+ get: function () { return chunkO4IWCDEJ_cjs.uploadQueryString; }
1133
1133
  });
1134
1134
  Object.defineProperty(exports, "useDocumentTools", {
1135
1135
  enumerable: true,
1136
- get: function () { return chunk2M4B4FFA_cjs.useDocumentTools; }
1136
+ get: function () { return chunkO4IWCDEJ_cjs.useDocumentTools; }
1137
1137
  });
1138
1138
  Object.defineProperty(exports, "useOptionalDocumentTools", {
1139
1139
  enumerable: true,
1140
- get: function () { return chunk2M4B4FFA_cjs.useOptionalDocumentTools; }
1140
+ get: function () { return chunkO4IWCDEJ_cjs.useOptionalDocumentTools; }
1141
1141
  });
1142
1142
  Object.defineProperty(exports, "documentBytesKey", {
1143
1143
  enumerable: true,
@@ -1,16 +1,16 @@
1
- import { fetchDocumentFile, fetchDocumentPdf, DocumentFetchError, useDocumentTools, SIGNED_LOCKED_REASON, fetchMarkupPdf } from '../chunk-YWYCEEBF.js';
2
- export { DocumentFetchError, DocumentToolsProvider, MarkupDownloadError, SIGNED_LOCKED_REASON, certificateLink, clientUpload, contentDispositionFileName, currentHasMarkup, defaultCertificateUrl, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchMarkupPdf, isSignedVersion, uploadQueryString, useDocumentTools, useOptionalDocumentTools } from '../chunk-YWYCEEBF.js';
1
+ import { fetchDocumentFile, fetchDocumentPdf, DocumentFetchError, useDocumentTools, SIGNED_LOCKED_REASON, fetchMarkupPdf } from '../chunk-5JR64WMK.js';
2
+ export { DocumentFetchError, DocumentToolsProvider, MarkupDownloadError, SIGNED_LOCKED_REASON, certificateLink, clientUpload, contentDispositionFileName, currentHasMarkup, defaultCertificateUrl, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchMarkupPdf, isSignedVersion, uploadQueryString, useDocumentTools, useOptionalDocumentTools } from '../chunk-5JR64WMK.js';
3
3
  import { mergeLayers, AnnotationStoreOfflineError } from '../chunk-S33P6THG.js';
4
4
  import { parseLayer, emptyLayer, LAYER_SCHEMA_VERSION } from '../chunk-NBIW7AEE.js';
5
5
  import { documentBytesKey, arbiQueryKeys } from '../chunk-NVAIVJID.js';
6
6
  export { documentBytesKey } from '../chunk-NVAIVJID.js';
7
+ import '../chunk-YNNAJJ5Z.js';
8
+ import '../chunk-KGCGA452.js';
7
9
  import { parseVersionRef } from '../chunk-NNWMHMEC.js';
8
10
  import '../chunk-WUTL62MC.js';
9
- import '../chunk-YNNAJJ5Z.js';
10
11
  import '../chunk-47CCGUWR.js';
11
12
  import '../chunk-QRCMKEE6.js';
12
13
  import '../chunk-SN5YV6FF.js';
13
- import '../chunk-KGCGA452.js';
14
14
  import '../chunk-CPZ36AQS.js';
15
15
  import { useMemo, useState, useCallback, useEffect, useSyncExternalStore } from 'react';
16
16
  import { onlineManager, useQuery, useQueryClient, useMutation } from '@tanstack/react-query';