@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
|
@@ -5,6 +5,9 @@ import { P as ProductionChoices, A as AnnotationStore } from '../ProductionDialo
|
|
|
5
5
|
import { a as BundleFile, b as BundleIndexEntry } from '../bundle.d-BnCSbHy2.cjs';
|
|
6
6
|
import { A as Annotation, b as AnnotationLayer } from '../model.d-D63gedpb.cjs';
|
|
7
7
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
8
|
+
import { D as DocumentBytesKind } from '../query-keys.d-Kw0JMoff.cjs';
|
|
9
|
+
export { f as documentBytesKey } from '../query-keys.d-Kw0JMoff.cjs';
|
|
10
|
+
import '@arbidocs/sdk/browser';
|
|
8
11
|
|
|
9
12
|
type DocumentToolsClient = ArbiClient['fetch'];
|
|
10
13
|
type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning';
|
|
@@ -431,10 +434,6 @@ declare function canAnnotate(s: AnnotatableState): boolean;
|
|
|
431
434
|
*/
|
|
432
435
|
declare function useIsOnline(): boolean;
|
|
433
436
|
|
|
434
|
-
/** `pdf`: the document as a PDF; `original`: the stored file (an image, a recording, a sheet). */
|
|
435
|
-
type DocumentBytesKind = 'pdf' | 'original';
|
|
436
|
-
/** Every version and kind of a document's bytes: the prefix a new version invalidates. */
|
|
437
|
-
declare const documentBytesKey: (documentRef: string, version?: number | null, kind?: DocumentBytesKind) => readonly ["arbi", "documentBytes", string] | readonly ["arbi", "documentBytes", string, number | null, DocumentBytesKind];
|
|
438
437
|
interface UseDocumentBytesOptions {
|
|
439
438
|
/** The document's current version, so a new one reads afresh. */
|
|
440
439
|
version: number | null | undefined;
|
|
@@ -933,4 +932,4 @@ declare function pngSize(base64: string): {
|
|
|
933
932
|
height: number;
|
|
934
933
|
};
|
|
935
934
|
|
|
936
|
-
export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE,
|
|
935
|
+
export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type NamedSigner, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, type SaveSignatureRequestVars, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldSuggestions, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, type SignerProgress, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, deleteSavedSignature, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, signatureFieldSuggestions, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useInviteSigners, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };
|
|
@@ -5,6 +5,9 @@ import { P as ProductionChoices, A as AnnotationStore } from '../ProductionDialo
|
|
|
5
5
|
import { a as BundleFile, b as BundleIndexEntry } from '../bundle.d-BnCSbHy2.js';
|
|
6
6
|
import { A as Annotation, b as AnnotationLayer } from '../model.d-D63gedpb.js';
|
|
7
7
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
8
|
+
import { D as DocumentBytesKind } from '../query-keys.d-Kw0JMoff.js';
|
|
9
|
+
export { f as documentBytesKey } from '../query-keys.d-Kw0JMoff.js';
|
|
10
|
+
import '@arbidocs/sdk/browser';
|
|
8
11
|
|
|
9
12
|
type DocumentToolsClient = ArbiClient['fetch'];
|
|
10
13
|
type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning';
|
|
@@ -431,10 +434,6 @@ declare function canAnnotate(s: AnnotatableState): boolean;
|
|
|
431
434
|
*/
|
|
432
435
|
declare function useIsOnline(): boolean;
|
|
433
436
|
|
|
434
|
-
/** `pdf`: the document as a PDF; `original`: the stored file (an image, a recording, a sheet). */
|
|
435
|
-
type DocumentBytesKind = 'pdf' | 'original';
|
|
436
|
-
/** Every version and kind of a document's bytes: the prefix a new version invalidates. */
|
|
437
|
-
declare const documentBytesKey: (documentRef: string, version?: number | null, kind?: DocumentBytesKind) => readonly ["arbi", "documentBytes", string] | readonly ["arbi", "documentBytes", string, number | null, DocumentBytesKind];
|
|
438
437
|
interface UseDocumentBytesOptions {
|
|
439
438
|
/** The document's current version, so a new one reads afresh. */
|
|
440
439
|
version: number | null | undefined;
|
|
@@ -933,4 +932,4 @@ declare function pngSize(base64: string): {
|
|
|
933
932
|
height: number;
|
|
934
933
|
};
|
|
935
934
|
|
|
936
|
-
export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE,
|
|
935
|
+
export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type NamedSigner, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, type SaveSignatureRequestVars, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldSuggestions, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, type SignerProgress, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, deleteSavedSignature, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, signatureFieldSuggestions, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useInviteSigners, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { fetchDocumentFile, fetchDocumentPdf, DocumentFetchError, useDocumentTools } from '../chunk-
|
|
2
|
-
export { DocumentFetchError, DocumentToolsProvider, certificateLink, clientUpload, contentDispositionFileName, defaultCertificateUrl, downloadBlob, fetchDocumentFile, fetchDocumentPdf, uploadQueryString, useDocumentTools, useOptionalDocumentTools } from '../chunk-
|
|
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';
|
|
3
3
|
import { mergeLayers, AnnotationStoreOfflineError } from '../chunk-S33P6THG.js';
|
|
4
4
|
import { parseLayer, emptyLayer, LAYER_SCHEMA_VERSION } from '../chunk-NBIW7AEE.js';
|
|
5
|
+
import { documentBytesKey, arbiQueryKeys } from '../chunk-NVAIVJID.js';
|
|
6
|
+
export { documentBytesKey } from '../chunk-NVAIVJID.js';
|
|
5
7
|
import { parseVersionRef } from '../chunk-NNWMHMEC.js';
|
|
6
8
|
import '../chunk-WUTL62MC.js';
|
|
7
9
|
import '../chunk-YNNAJJ5Z.js';
|
|
8
|
-
import '../chunk-QRCMKEE6.js';
|
|
9
10
|
import '../chunk-47CCGUWR.js';
|
|
11
|
+
import '../chunk-QRCMKEE6.js';
|
|
10
12
|
import '../chunk-SN5YV6FF.js';
|
|
11
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-KGCGA452.js';
|
|
12
14
|
import '../chunk-CPZ36AQS.js';
|
|
13
15
|
import { useMemo, useState, useCallback, useEffect, useSyncExternalStore } from 'react';
|
|
14
16
|
import { onlineManager, useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
15
17
|
import { unlockIdentityWithPassword, signMessage, getUserEncryptionKeypair, sealedBoxDecrypt, sealedBoxEncrypt, initSodium } from '@arbidocs/client';
|
|
18
|
+
import { workspaces } from '@arbidocs/sdk/browser';
|
|
16
19
|
|
|
17
20
|
// src/document-tools/production.ts
|
|
18
21
|
var PRODUCTIONS_FOLDER = "Productions";
|
|
@@ -344,45 +347,6 @@ async function copyOpenThreads(documentId, fromVersion, client) {
|
|
|
344
347
|
function versionsWithMarkup(versions) {
|
|
345
348
|
return (versions ?? []).filter((v) => (v.markup_count ?? 0) > 0);
|
|
346
349
|
}
|
|
347
|
-
|
|
348
|
-
// src/document-tools/markup-download.ts
|
|
349
|
-
var SIGNED_LOCKED_REASON = "Signed documents can't be changed \u2014 download the signed file instead";
|
|
350
|
-
function isSignedVersion(doc, version) {
|
|
351
|
-
const n = version ?? doc.current_version ?? 1;
|
|
352
|
-
return (doc.versions ?? []).some((v) => v.n === n && v.reason === "signed");
|
|
353
|
-
}
|
|
354
|
-
var MarkupDownloadError = class extends Error {
|
|
355
|
-
constructor(message, status) {
|
|
356
|
-
super(message);
|
|
357
|
-
this.status = status;
|
|
358
|
-
this.name = "MarkupDownloadError";
|
|
359
|
-
}
|
|
360
|
-
status;
|
|
361
|
-
};
|
|
362
|
-
function currentHasMarkup(doc) {
|
|
363
|
-
const n = doc.current_version ?? 1;
|
|
364
|
-
return (doc.versions ?? []).some((v) => v.n === n && (v.markup_count ?? 0) > 0);
|
|
365
|
-
}
|
|
366
|
-
async function fetchMarkupPdf(client, documentId, version) {
|
|
367
|
-
const { data, response } = await client.GET("/v1/document/{document_ext_id}/markup/pdf", {
|
|
368
|
-
params: { path: { document_ext_id: documentId }, query: version ? { version } : {} },
|
|
369
|
-
parseAs: "blob"
|
|
370
|
-
});
|
|
371
|
-
if (!response.ok || !data) {
|
|
372
|
-
throw new MarkupDownloadError(
|
|
373
|
-
response.status === 404 ? "This document has no markup yet" : (
|
|
374
|
-
// The server refuses a signed version: its PDF takes no more changes.
|
|
375
|
-
response.status === 409 ? SIGNED_LOCKED_REASON : "The markup could not be downloaded"
|
|
376
|
-
),
|
|
377
|
-
response.status
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
const disposition = response.headers.get("content-disposition") ?? "";
|
|
381
|
-
const utf8 = /filename\*=UTF-8''([^;]+)/i.exec(disposition)?.[1];
|
|
382
|
-
const plain = /filename="([^"]+)"/i.exec(disposition)?.[1];
|
|
383
|
-
const fileName = utf8 ? decodeURIComponent(utf8) : plain ?? "markup.pdf";
|
|
384
|
-
return { blob: data, fileName };
|
|
385
|
-
}
|
|
386
350
|
var SIGNED_UNCHANGED = "The signed PDF is unchanged: the comments are kept beside it as markup.";
|
|
387
351
|
function useDocumentMarkup(documentData, snapshotVersion, currentSigned = false) {
|
|
388
352
|
const { client, notify, saveFile, onDocumentsChanged } = useDocumentTools();
|
|
@@ -556,7 +520,6 @@ function useIsOnline() {
|
|
|
556
520
|
() => true
|
|
557
521
|
);
|
|
558
522
|
}
|
|
559
|
-
var documentBytesKey = (documentRef, version, kind) => version === void 0 ? ["arbi", "documentBytes", documentRef] : ["arbi", "documentBytes", documentRef, version, kind ?? "pdf"];
|
|
560
523
|
function useDocumentBytes(documentRef, options) {
|
|
561
524
|
const { client } = useDocumentTools();
|
|
562
525
|
const { version, kind, enabled = true, fallback } = options;
|
|
@@ -600,7 +563,6 @@ function isLegibleSignatureBox(rect) {
|
|
|
600
563
|
return rect.w >= MIN_SIGNATURE_BOX.width && rect.h >= MIN_SIGNATURE_BOX.height;
|
|
601
564
|
}
|
|
602
565
|
var SIGNATURES_PATH = "/v1/document/{document_ext_id}/signatures";
|
|
603
|
-
var SIGNATURES_KEY = ["get", SIGNATURES_PATH];
|
|
604
566
|
function errorDetail(error, fallback) {
|
|
605
567
|
const detail3 = error?.detail;
|
|
606
568
|
return typeof detail3 === "string" ? detail3 : fallback;
|
|
@@ -617,10 +579,7 @@ function useDocumentSignatures(documentId, enabled = true) {
|
|
|
617
579
|
const { client } = useDocumentTools();
|
|
618
580
|
const { docId, version } = parseVersionRef(documentId);
|
|
619
581
|
return useQuery({
|
|
620
|
-
queryKey:
|
|
621
|
-
...SIGNATURES_KEY,
|
|
622
|
-
{ params: { path: { document_ext_id: docId }, ...version ? { query: { version } } : {} } }
|
|
623
|
-
],
|
|
582
|
+
queryKey: arbiQueryKeys.documentSignatures(docId ?? "", version),
|
|
624
583
|
queryFn: () => fetchDocumentSignatures(client, documentId),
|
|
625
584
|
enabled: enabled && !!docId,
|
|
626
585
|
staleTime: 6e4
|
|
@@ -694,7 +653,7 @@ function useSignDocument() {
|
|
|
694
653
|
},
|
|
695
654
|
onSuccess: async (result) => {
|
|
696
655
|
await env.onDocumentsChanged?.([result.doc_ext_id], "signed");
|
|
697
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
656
|
+
await queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentSignatures() });
|
|
698
657
|
}
|
|
699
658
|
});
|
|
700
659
|
}
|
|
@@ -733,7 +692,7 @@ async function fetchSignatureVerification(client, reference) {
|
|
|
733
692
|
function useSignatureVerification(reference) {
|
|
734
693
|
const { client } = useDocumentTools();
|
|
735
694
|
return useQuery({
|
|
736
|
-
queryKey:
|
|
695
|
+
queryKey: arbiQueryKeys.signatureVerification(reference ?? ""),
|
|
737
696
|
queryFn: () => fetchSignatureVerification(client, reference),
|
|
738
697
|
enabled: !!reference,
|
|
739
698
|
retry: false
|
|
@@ -773,7 +732,6 @@ var SIGNER_PROGRESS_LABELS = {
|
|
|
773
732
|
var EMAIL = /^[^@\s<>,;]{1,64}@[^@\s<>,;]{1,255}\.[^@\s<>,;]{1,63}$/;
|
|
774
733
|
var isEmailSigner = (signer) => EMAIL.test(signer.trim());
|
|
775
734
|
var MARK_FIELD_TYPES = ["signature", "initials"];
|
|
776
|
-
var REQUESTS_KEY = ["signature-requests"];
|
|
777
735
|
function detail(error, fallback) {
|
|
778
736
|
const d = error?.detail;
|
|
779
737
|
if (typeof d === "string") return d;
|
|
@@ -837,7 +795,7 @@ async function fetchDocumentSignatureRequests(client, documentId) {
|
|
|
837
795
|
function useDocumentSignatureRequests(documentId, enabled = true) {
|
|
838
796
|
const { client } = useDocumentTools();
|
|
839
797
|
return useQuery({
|
|
840
|
-
queryKey:
|
|
798
|
+
queryKey: arbiQueryKeys.signatureRequestsForDocument(documentId ?? ""),
|
|
841
799
|
queryFn: () => fetchDocumentSignatureRequests(client, documentId),
|
|
842
800
|
enabled: enabled && !!documentId,
|
|
843
801
|
staleTime: 15e3
|
|
@@ -846,7 +804,7 @@ function useDocumentSignatureRequests(documentId, enabled = true) {
|
|
|
846
804
|
function useSignatureRequestsAwaitingMe(enabled = true) {
|
|
847
805
|
const { client } = useDocumentTools();
|
|
848
806
|
return useQuery({
|
|
849
|
-
queryKey:
|
|
807
|
+
queryKey: arbiQueryKeys.signatureRequestsAwaitingMe(),
|
|
850
808
|
queryFn: async () => {
|
|
851
809
|
const { data, error } = await client.GET("/v1/signature-requests", {
|
|
852
810
|
params: { query: { awaiting_me: true } }
|
|
@@ -861,7 +819,7 @@ function useSignatureRequestsAwaitingMe(enabled = true) {
|
|
|
861
819
|
function useSignatureRequest(requestId) {
|
|
862
820
|
const { client } = useDocumentTools();
|
|
863
821
|
return useQuery({
|
|
864
|
-
queryKey:
|
|
822
|
+
queryKey: arbiQueryKeys.signatureRequest(requestId ?? ""),
|
|
865
823
|
queryFn: async () => {
|
|
866
824
|
const { data, error } = await client.GET("/v1/signature-requests/{request_ext_id}", {
|
|
867
825
|
params: { path: { request_ext_id: requestId } }
|
|
@@ -909,7 +867,7 @@ async function saveSignatureRequest(client, { documentId, version, fields, messa
|
|
|
909
867
|
}
|
|
910
868
|
function useInvalidateRequests() {
|
|
911
869
|
const queryClient = useQueryClient();
|
|
912
|
-
return () => queryClient.invalidateQueries({ queryKey:
|
|
870
|
+
return () => queryClient.invalidateQueries({ queryKey: arbiQueryKeys.signatureRequests() });
|
|
913
871
|
}
|
|
914
872
|
function useSaveSignatureRequest() {
|
|
915
873
|
const { client } = useDocumentTools();
|
|
@@ -986,9 +944,7 @@ function useSignSignatureRequest() {
|
|
|
986
944
|
await invalidate();
|
|
987
945
|
if (result.completed && result.request.doc_ext_id) {
|
|
988
946
|
await env.onDocumentsChanged?.([result.request.doc_ext_id], "signed");
|
|
989
|
-
await queryClient.invalidateQueries({
|
|
990
|
-
queryKey: ["get", "/v1/document/{document_ext_id}/signatures"]
|
|
991
|
-
});
|
|
947
|
+
await queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentSignatures() });
|
|
992
948
|
}
|
|
993
949
|
}
|
|
994
950
|
});
|
|
@@ -996,7 +952,7 @@ function useSignSignatureRequest() {
|
|
|
996
952
|
function useSignerCandidates(enabled = true) {
|
|
997
953
|
const { client, user } = useDocumentTools();
|
|
998
954
|
return useQuery({
|
|
999
|
-
queryKey:
|
|
955
|
+
queryKey: arbiQueryKeys.signatureCandidates(),
|
|
1000
956
|
queryFn: async () => {
|
|
1001
957
|
const { data, error } = await client.GET("/v1/workspace/users");
|
|
1002
958
|
if (!data) throw new Error(detail(error, "The workspace members could not be read"));
|
|
@@ -1018,13 +974,13 @@ function useSignerCandidates(enabled = true) {
|
|
|
1018
974
|
async function inviteSigners(client, documentId, emails) {
|
|
1019
975
|
if (!emails.length) return;
|
|
1020
976
|
const { error, response } = await client.POST("/v1/workspace/users", {
|
|
1021
|
-
body: {
|
|
977
|
+
body: workspaces.addWorkspaceMembersBody({
|
|
1022
978
|
emails,
|
|
1023
979
|
role: "guest",
|
|
1024
980
|
confirm_invite: true,
|
|
1025
981
|
resource_type: "document",
|
|
1026
982
|
resource_ext_id: documentId
|
|
1027
|
-
}
|
|
983
|
+
})
|
|
1028
984
|
});
|
|
1029
985
|
if (response.status === 409) {
|
|
1030
986
|
throw new Error("Share the document with the workspace before asking others to sign it.");
|
|
@@ -1041,12 +997,11 @@ function useInviteSigners() {
|
|
|
1041
997
|
mutationFn: ({ documentId, emails }) => inviteSigners(client, documentId, emails),
|
|
1042
998
|
onSuccess: async () => {
|
|
1043
999
|
await invalidate();
|
|
1044
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
1000
|
+
await queryClient.invalidateQueries({ queryKey: arbiQueryKeys.signatureCandidates() });
|
|
1045
1001
|
}
|
|
1046
1002
|
});
|
|
1047
1003
|
}
|
|
1048
1004
|
var INFORMAL_SIGNATURE_NOTE = "Informal signature: for verified signing, use Request signatures.";
|
|
1049
|
-
var KEY = ["saved-signature"];
|
|
1050
1005
|
async function keypair(source = getUserEncryptionKeypair) {
|
|
1051
1006
|
await initSodium();
|
|
1052
1007
|
const pair = await source();
|
|
@@ -1081,7 +1036,7 @@ async function deleteSavedSignature(client) {
|
|
|
1081
1036
|
function useSavedSignature(enabled = true) {
|
|
1082
1037
|
const { client } = useDocumentTools();
|
|
1083
1038
|
return useQuery({
|
|
1084
|
-
queryKey:
|
|
1039
|
+
queryKey: arbiQueryKeys.savedSignature(),
|
|
1085
1040
|
queryFn: () => fetchSavedSignature(client),
|
|
1086
1041
|
enabled,
|
|
1087
1042
|
staleTime: 6e4,
|
|
@@ -1093,7 +1048,7 @@ function useStoreSavedSignature() {
|
|
|
1093
1048
|
const queryClient = useQueryClient();
|
|
1094
1049
|
return useMutation({
|
|
1095
1050
|
mutationFn: (signature) => storeSavedSignature(client, signature),
|
|
1096
|
-
onSuccess: (_, signature) => queryClient.setQueryData(
|
|
1051
|
+
onSuccess: (_, signature) => queryClient.setQueryData(arbiQueryKeys.savedSignature(), signature)
|
|
1097
1052
|
});
|
|
1098
1053
|
}
|
|
1099
1054
|
function useDeleteSavedSignature() {
|
|
@@ -1101,7 +1056,7 @@ function useDeleteSavedSignature() {
|
|
|
1101
1056
|
const queryClient = useQueryClient();
|
|
1102
1057
|
return useMutation({
|
|
1103
1058
|
mutationFn: () => deleteSavedSignature(client),
|
|
1104
|
-
onSuccess: () => queryClient.setQueryData(
|
|
1059
|
+
onSuccess: () => queryClient.setQueryData(arbiQueryKeys.savedSignature(), null)
|
|
1105
1060
|
});
|
|
1106
1061
|
}
|
|
1107
1062
|
function pngBytes(base64) {
|
|
@@ -1116,6 +1071,6 @@ function pngSize(base64) {
|
|
|
1116
1071
|
return { width: view.getUint32(16), height: view.getUint32(20) };
|
|
1117
1072
|
}
|
|
1118
1073
|
|
|
1119
|
-
export { DEFAULT_FIELD_SIZE, FIELD_TYPE_LABELS, INFORMAL_SIGNATURE_NOTE, LEGACY_LAYER_PREFIX, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS,
|
|
1074
|
+
export { DEFAULT_FIELD_SIZE, FIELD_TYPE_LABELS, INFORMAL_SIGNATURE_NOTE, LEGACY_LAYER_PREFIX, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, MarkupStoreError, PRODUCTIONS_FOLDER, SIGNATURE_FIELD_TYPES, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, SignatureVerificationError, SigningError, VERIFY_PATH, addToMarkup, buildProduction, canAnnotate, copyOpenThreads, createMarkupStore, deleteSavedSignature, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchProductionPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isPdfDocument, isSignatureReference, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, signatureFieldSuggestions, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useInviteSigners, useIsOnline, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };
|
|
1120
1075
|
//# sourceMappingURL=index.js.map
|
|
1121
1076
|
//# sourceMappingURL=index.js.map
|