@arbidocs/blocks 0.4.158 → 0.4.159
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/{ConnectedNativeDocxComparison-64RDIFEI.cjs → ConnectedNativeDocxComparison-R6RU5TZE.cjs} +12 -11
- package/dist/{ConnectedNativeDocxComparison-64RDIFEI.cjs.map → ConnectedNativeDocxComparison-R6RU5TZE.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-GYBCBAJZ.js → ConnectedNativeDocxComparison-XMZ5KLD4.js} +11 -10
- package/dist/{ConnectedStreamedWordArtifact-GYBCBAJZ.js.map → ConnectedNativeDocxComparison-XMZ5KLD4.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-UAAICR4X.cjs → ConnectedNativeDocxEditor-LBATSM3M.cjs} +11 -10
- package/dist/{ConnectedNativeDocxEditor-UAAICR4X.cjs.map → ConnectedNativeDocxEditor-LBATSM3M.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-OT5DLWCM.js → ConnectedNativeDocxEditor-NGUK2AX6.js} +9 -8
- package/dist/{ConnectedNativeDocxEditor-OT5DLWCM.js.map → ConnectedNativeDocxEditor-NGUK2AX6.js.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-AJXPNTT3.cjs → ConnectedStreamedWordArtifact-CWFR6A37.cjs} +12 -11
- package/dist/ConnectedStreamedWordArtifact-CWFR6A37.cjs.map +1 -0
- package/dist/{ConnectedNativeDocxComparison-JOWYEINS.js → ConnectedStreamedWordArtifact-IXRJ7MUE.js} +11 -10
- package/dist/{ConnectedNativeDocxComparison-JOWYEINS.js.map → ConnectedStreamedWordArtifact-IXRJ7MUE.js.map} +1 -1
- package/dist/{NativeDocxEditor-M3I776GD.cjs → NativeDocxEditor-T2PJIZMU.cjs} +9 -7
- package/dist/{NativeDocxEditor-M3I776GD.cjs.map → NativeDocxEditor-T2PJIZMU.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-JBQMH3MP.js → NativeDocxEditor-TBTBD6TC.js} +5 -3
- package/dist/{NativeDocxEditor-JBQMH3MP.js.map → NativeDocxEditor-TBTBD6TC.js.map} +1 -1
- package/dist/{WorkspaceTableView-FQPJQWUE.js → WorkspaceTableView-DWUE4VQF.js} +7 -6
- package/dist/WorkspaceTableView-DWUE4VQF.js.map +1 -0
- package/dist/{WorkspaceTableView-CZEFIAVT.cjs → WorkspaceTableView-EYLEUZZT.cjs} +9 -8
- package/dist/WorkspaceTableView-EYLEUZZT.cjs.map +1 -0
- package/dist/agents/index.cjs +241 -241
- package/dist/agents/index.js +7 -7
- package/dist/calls/index.cjs +3 -3
- package/dist/calls/index.js +2 -2
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/{chunk-RJUXSXBH.cjs → chunk-2BHDRVVL.cjs} +18 -8
- package/dist/chunk-2BHDRVVL.cjs.map +1 -0
- package/dist/chunk-2R3GGNPA.js +151 -0
- package/dist/chunk-2R3GGNPA.js.map +1 -0
- package/dist/{chunk-Y7PPQ7UT.js → chunk-3OCNUKGX.js} +4 -4
- package/dist/{chunk-Y7PPQ7UT.js.map → chunk-3OCNUKGX.js.map} +1 -1
- package/dist/{chunk-D3WFIFRY.cjs → chunk-3VW7ZXQ6.cjs} +211 -5
- package/dist/chunk-3VW7ZXQ6.cjs.map +1 -0
- package/dist/{chunk-JSQEAPTC.cjs → chunk-4GITK3Q5.cjs} +398 -75
- package/dist/chunk-4GITK3Q5.cjs.map +1 -0
- package/dist/{chunk-7KWUQQIB.js → chunk-5ZIYPZYE.js} +3 -3
- package/dist/{chunk-7KWUQQIB.js.map → chunk-5ZIYPZYE.js.map} +1 -1
- package/dist/{chunk-AUDUNQO6.cjs → chunk-6QAAIDQQ.cjs} +50 -50
- package/dist/{chunk-AUDUNQO6.cjs.map → chunk-6QAAIDQQ.cjs.map} +1 -1
- package/dist/{chunk-V3HG3LK3.js → chunk-7UENVUA6.js} +4 -4
- package/dist/{chunk-V3HG3LK3.js.map → chunk-7UENVUA6.js.map} +1 -1
- package/dist/{chunk-EWCJXUBP.js → chunk-AVXRXPII.js} +3 -3
- package/dist/{chunk-EWCJXUBP.js.map → chunk-AVXRXPII.js.map} +1 -1
- package/dist/{chunk-TAWPVD6C.cjs → chunk-B3FMUFAW.cjs} +3 -3
- package/dist/{chunk-TAWPVD6C.cjs.map → chunk-B3FMUFAW.cjs.map} +1 -1
- package/dist/{chunk-7IRSCMNK.js → chunk-BGXWPVHR.js} +3 -3
- package/dist/{chunk-7IRSCMNK.js.map → chunk-BGXWPVHR.js.map} +1 -1
- package/dist/chunk-DAN7EJ4O.js +482 -0
- package/dist/chunk-DAN7EJ4O.js.map +1 -0
- package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
- package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
- package/dist/chunk-E4H5H2C3.cjs +18 -0
- package/dist/{chunk-DVIQWBDM.cjs.map → chunk-E4H5H2C3.cjs.map} +1 -1
- package/dist/{chunk-VY4UFXTM.cjs → chunk-ETJFC6MO.cjs} +4 -4
- package/dist/{chunk-VY4UFXTM.cjs.map → chunk-ETJFC6MO.cjs.map} +1 -1
- package/dist/{chunk-FGI3YFQH.js → chunk-FTZ45WHY.js} +4 -4
- package/dist/{chunk-FGI3YFQH.js.map → chunk-FTZ45WHY.js.map} +1 -1
- package/dist/{chunk-FBSIWJSG.cjs → chunk-GC2FSPSQ.cjs} +6 -6
- package/dist/{chunk-FBSIWJSG.cjs.map → chunk-GC2FSPSQ.cjs.map} +1 -1
- package/dist/{chunk-TQIY2SVY.cjs → chunk-GFVIFXWT.cjs} +5 -5
- package/dist/{chunk-TQIY2SVY.cjs.map → chunk-GFVIFXWT.cjs.map} +1 -1
- package/dist/chunk-JPWPR6QU.cjs +485 -0
- package/dist/chunk-JPWPR6QU.cjs.map +1 -0
- package/dist/{chunk-KQYPP72K.js → chunk-JTJCCL2E.js} +212 -9
- package/dist/chunk-JTJCCL2E.js.map +1 -0
- package/dist/{chunk-P6FMKXAB.js → chunk-KFMRBZQK.js} +16 -6
- package/dist/chunk-KFMRBZQK.js.map +1 -0
- package/dist/{chunk-VMFLWFXK.js → chunk-MNG7N6M2.js} +4 -4
- package/dist/{chunk-VMFLWFXK.js.map → chunk-MNG7N6M2.js.map} +1 -1
- package/dist/chunk-NMZI3K6R.cjs +159 -0
- package/dist/chunk-NMZI3K6R.cjs.map +1 -0
- package/dist/{chunk-UYC5BJCB.cjs → chunk-NPLGB4LI.cjs} +5 -5
- package/dist/{chunk-UYC5BJCB.cjs.map → chunk-NPLGB4LI.cjs.map} +1 -1
- package/dist/{chunk-SCK3GAE5.cjs → chunk-P2YM67Y5.cjs} +5 -5
- package/dist/{chunk-SCK3GAE5.cjs.map → chunk-P2YM67Y5.cjs.map} +1 -1
- package/dist/{chunk-VE6S6NRQ.js → chunk-P6RIBIVN.js} +4 -4
- package/dist/{chunk-VE6S6NRQ.js.map → chunk-P6RIBIVN.js.map} +1 -1
- package/dist/chunk-Q2XGM372.cjs +18 -0
- package/dist/{chunk-GWGUZ5X6.cjs.map → chunk-Q2XGM372.cjs.map} +1 -1
- package/dist/{chunk-FWIBFGUQ.cjs → chunk-QJFJ5JBF.cjs} +3 -3
- package/dist/{chunk-FWIBFGUQ.cjs.map → chunk-QJFJ5JBF.cjs.map} +1 -1
- package/dist/{chunk-2DQHFJNP.js → chunk-QKR5LWDO.js} +7 -7
- package/dist/{chunk-2DQHFJNP.js.map → chunk-QKR5LWDO.js.map} +1 -1
- package/dist/{chunk-GDRLM2EX.js → chunk-RATEAOKT.js} +3 -3
- package/dist/{chunk-GDRLM2EX.js.map → chunk-RATEAOKT.js.map} +1 -1
- package/dist/{chunk-NFI46I77.cjs → chunk-TQUYWUEE.cjs} +11 -157
- package/dist/chunk-TQUYWUEE.cjs.map +1 -0
- package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
- package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
- package/dist/{chunk-ZO7PJMCO.js → chunk-WU34CHU5.js} +3 -3
- package/dist/{chunk-ZO7PJMCO.js.map → chunk-WU34CHU5.js.map} +1 -1
- package/dist/{chunk-ONTUMV74.js → chunk-XER3JLC7.js} +398 -78
- package/dist/chunk-XER3JLC7.js.map +1 -0
- package/dist/{chunk-LY37J3AC.cjs → chunk-YF3QUHKN.cjs} +4 -4
- package/dist/{chunk-LY37J3AC.cjs.map → chunk-YF3QUHKN.cjs.map} +1 -1
- package/dist/{chunk-Y73X65FF.js → chunk-ZDOKJD44.js} +5 -144
- package/dist/chunk-ZDOKJD44.js.map +1 -0
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +15 -14
- package/dist/connect/docx.js +11 -10
- package/dist/connect/index.cjs +542 -540
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +27 -25
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +90 -69
- package/dist/connect/viewer.cjs.map +1 -1
- package/dist/connect/viewer.js +40 -19
- package/dist/connect/viewer.js.map +1 -1
- package/dist/connection/viewer/ViewerPdfPane.d.ts +7 -1
- package/dist/document-tools/AdoptSignatureDialog.d.ts +39 -4
- package/dist/document-tools/PlaceMySignatureButton.d.ts +16 -0
- package/dist/document-tools/SavedSignatureSettings.d.ts +10 -0
- package/dist/document-tools/index.cjs +38 -23
- package/dist/document-tools/index.d.ts +2 -0
- package/dist/document-tools/index.js +6 -3
- package/dist/document-tools/viewer/AnnotatedPdfViewer.d.ts +10 -1
- package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +7 -4
- package/dist/document-tools/viewer/index.cjs +184 -18
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/document-tools/viewer/index.js +184 -18
- package/dist/document-tools/viewer/index.js.map +1 -1
- package/dist/docx/NativeDocxEditor.d.ts +5 -0
- package/dist/docx/index.cjs +61 -47
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/index.js +5 -3
- package/dist/docx/signatures/SignatureFields.d.ts +50 -0
- package/dist/facts/index.cjs +56 -56
- package/dist/facts/index.js +6 -6
- package/dist/files/index.cjs +239 -239
- package/dist/files/index.js +6 -6
- package/dist/home/index.cjs +2 -2
- package/dist/home/index.js +2 -2
- package/dist/index.cjs +409 -409
- package/dist/index.js +14 -14
- package/dist/retrieval/index.cjs +1 -1
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +187 -186
- package/dist/settings/index.js +4 -3
- package/dist/shell/index.cjs +3 -3
- package/dist/shell/index.js +3 -3
- package/dist/studio/index.cjs +3 -3
- package/dist/studio/index.js +3 -3
- package/dist/workflow-canvas/index.cjs +19 -19
- package/dist/workflow-canvas/index.js +7 -7
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +109 -16
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +84 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +84 -1
- package/node_modules/@arbidocs/coedit/dist/commands.js +99 -17
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/docx/styles.css +50 -0
- package/dist/ConnectedStreamedWordArtifact-AJXPNTT3.cjs.map +0 -1
- package/dist/WorkspaceTableView-CZEFIAVT.cjs.map +0 -1
- package/dist/WorkspaceTableView-FQPJQWUE.js.map +0 -1
- package/dist/chunk-6MG62I5B.cjs +0 -272
- package/dist/chunk-6MG62I5B.cjs.map +0 -1
- package/dist/chunk-D3WFIFRY.cjs.map +0 -1
- package/dist/chunk-DVIQWBDM.cjs +0 -18
- package/dist/chunk-EQB3WELX.js +0 -269
- package/dist/chunk-EQB3WELX.js.map +0 -1
- package/dist/chunk-GWGUZ5X6.cjs +0 -18
- package/dist/chunk-JSQEAPTC.cjs.map +0 -1
- package/dist/chunk-KQYPP72K.js.map +0 -1
- package/dist/chunk-NFI46I77.cjs.map +0 -1
- package/dist/chunk-ONTUMV74.js.map +0 -1
- package/dist/chunk-P6FMKXAB.js.map +0 -1
- package/dist/chunk-RJUXSXBH.cjs.map +0 -1
- package/dist/chunk-Y73X65FF.js.map +0 -1
|
@@ -42,5 +42,11 @@ export interface ViewerPdfPaneProps {
|
|
|
42
42
|
markup: ReturnType<typeof useDocumentMarkup>;
|
|
43
43
|
pdfSnapshotNumber: number | undefined;
|
|
44
44
|
isSigned: boolean;
|
|
45
|
+
/** One's saved signature or initials to place as a picture stamp (PDF tab › My signature). */
|
|
46
|
+
placeMark?: {
|
|
47
|
+
image: string;
|
|
48
|
+
label: string;
|
|
49
|
+
key: number;
|
|
50
|
+
} | null;
|
|
45
51
|
}
|
|
46
|
-
export declare function ViewerPdfPane({ documentId, doc, pdfBlob, isPdfLoading, pdfError, onDownload, viewerProps, signatureFlow, onSignatureFlow, currentUserId, placingSignature, onPlacingDone, annotating, markup, pdfSnapshotNumber, isSigned, }: ViewerPdfPaneProps): import("react").JSX.Element;
|
|
52
|
+
export declare function ViewerPdfPane({ documentId, doc, pdfBlob, isPdfLoading, pdfError, onDownload, viewerProps, signatureFlow, onSignatureFlow, currentUserId, placingSignature, onPlacingDone, annotating, markup, pdfSnapshotNumber, isSigned, placeMark, }: ViewerPdfPaneProps): import("react").JSX.Element;
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adopt a signature once, before applying it at each field: type it (the name in a signature
|
|
3
|
-
* face, as the signed PDF draws it), draw it, or upload an image of it
|
|
4
|
-
* or uploaded
|
|
3
|
+
* face, as the signed PDF draws it), draw it, or upload an image of it; initials likewise typed or
|
|
4
|
+
* drawn. A drawn or uploaded mark is handed on as a PNG (white made transparent); the server
|
|
5
|
+
* re-encodes it.
|
|
6
|
+
*
|
|
7
|
+
* The drawing pad spans the screen's width on a phone and is a generous box on a tablet or desktop.
|
|
8
|
+
* Its canvas is backed at the device's pixel ratio (crisp strokes on a retina screen), and it takes
|
|
9
|
+
* every touch for itself (`touch-action: none`): drawing with a finger never scrolls or zooms the
|
|
10
|
+
* page. Strokes are kept as points, so a resize (turning the phone) redraws them at the new size.
|
|
11
|
+
*
|
|
12
|
+
* With `onSave`, the person may also tick "Save to my account for future use": the signature and
|
|
13
|
+
* initials are then sealed to their own key and kept for next time (`saved` prefills the dialog).
|
|
14
|
+
* In `mode="save"` (account settings) the dialog only saves.
|
|
5
15
|
*/
|
|
6
16
|
import { type ReactElement } from 'react';
|
|
7
|
-
import { type AdoptedSignature } from '@arbidocs/react/document-tools';
|
|
17
|
+
import { type AdoptedSignature, type SavedSignature } from '@arbidocs/react/document-tools';
|
|
8
18
|
export interface AdoptedMark {
|
|
9
19
|
adopted: AdoptedSignature;
|
|
10
20
|
/** A data URL of the drawn/uploaded signature, for showing it at each field; null when typed. */
|
|
11
21
|
signatureUrl: string | null;
|
|
22
|
+
/** A data URL of the drawn initials; null when typed. */
|
|
23
|
+
initialsUrl?: string | null;
|
|
12
24
|
}
|
|
13
25
|
export interface AdoptSignatureDialogProps {
|
|
14
26
|
open: boolean;
|
|
15
27
|
onOpenChange: (open: boolean) => void;
|
|
16
28
|
defaultName: string;
|
|
17
29
|
onAdopt: (mark: AdoptedMark) => void;
|
|
30
|
+
/** The signature saved to the account: the dialog starts from it. */
|
|
31
|
+
saved?: SavedSignature | null;
|
|
32
|
+
/** Present: offer "Save to my account for future use" (and save when ticked). */
|
|
33
|
+
onSave?: (signature: SavedSignature) => Promise<void>;
|
|
34
|
+
/** `save`: account settings, the dialog only saves the signature (no signing). */
|
|
35
|
+
mode?: 'adopt' | 'save';
|
|
18
36
|
}
|
|
19
37
|
/** Typed signatures look like the PDF will: an italic serif in ink blue. */
|
|
20
38
|
export declare const TYPED_SIGNATURE_STYLE: {
|
|
@@ -22,4 +40,21 @@ export declare const TYPED_SIGNATURE_STYLE: {
|
|
|
22
40
|
readonly fontStyle: "italic";
|
|
23
41
|
readonly color: "#0d1a59";
|
|
24
42
|
};
|
|
25
|
-
export
|
|
43
|
+
export interface SignaturePadHandle {
|
|
44
|
+
isBlank: () => boolean;
|
|
45
|
+
toDataUrl: () => string | null;
|
|
46
|
+
clear: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A drawing pad: strokes in fractions of the pad, painted on a canvas at the device's pixel ratio.
|
|
50
|
+
* `onInk` fires when the first stroke lands or the pad is cleared.
|
|
51
|
+
*/
|
|
52
|
+
export declare const SignaturePad: import("react").ForwardRefExoticComponent<{
|
|
53
|
+
label: string;
|
|
54
|
+
className?: string;
|
|
55
|
+
onInk: (has: boolean) => void;
|
|
56
|
+
testId?: string;
|
|
57
|
+
} & import("react").RefAttributes<SignaturePadHandle>>;
|
|
58
|
+
/** A typed mark as a picture (transparent, ink blue, the signature face): what is saved for it. */
|
|
59
|
+
export declare function typedPng(text: string, height?: number): string;
|
|
60
|
+
export declare function AdoptSignatureDialog({ open, onOpenChange, defaultName, onAdopt, saved, onSave, mode, }: AdoptSignatureDialogProps): ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF tab › My signature: place one's own saved signature or initials on the page as a picture stamp
|
|
3
|
+
* in the markup layer (then drag and resize it like any stamp). Nothing saved yet: the adopt dialog
|
|
4
|
+
* opens first and saves it. An informal signature; verified signing is Request signatures. Needs a
|
|
5
|
+
* `<DocumentToolsProvider>` inside a React Query `QueryClientProvider`.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactElement } from 'react';
|
|
8
|
+
export type PlacedMark = {
|
|
9
|
+
image: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function PlaceMySignatureButton({ onPlace, compact, }: {
|
|
13
|
+
/** Arm the stamp tool with this picture: the next click on a page places it. */
|
|
14
|
+
onPlace: (mark: PlacedMark) => void;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
}): ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account settings › Your signature: the signature and initials saved to the account (sealed with
|
|
3
|
+
* the user's own key), with Replace (the adopt dialog, saving over it) and Delete (removed from the
|
|
4
|
+
* account completely; what was already placed in documents or sealed in signed PDFs stays as it
|
|
5
|
+
* is). Needs a `<DocumentToolsProvider>` inside a React Query `QueryClientProvider`.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactElement } from 'react';
|
|
8
|
+
export declare const DELETE_SAVED_SIGNATURE_TEXT: string;
|
|
9
|
+
export declare function SavedSignatureSettings(): ReactElement;
|
|
10
|
+
export default SavedSignatureSettings;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var chunk6MG62I5B_cjs = require('../chunk-6MG62I5B.cjs');
|
|
6
|
-
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
4
|
+
var chunk3VW7ZXQ6_cjs = require('../chunk-3VW7ZXQ6.cjs');
|
|
7
5
|
require('../chunk-UWIILWDI.cjs');
|
|
6
|
+
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
7
|
+
require('../chunk-NMZI3K6R.cjs');
|
|
8
|
+
var chunkJPWPR6QU_cjs = require('../chunk-JPWPR6QU.cjs');
|
|
9
|
+
require('../chunk-DWZXSPMB.cjs');
|
|
10
|
+
require('../chunk-MHVNT4J3.cjs');
|
|
8
11
|
require('../chunk-ULWRNGGE.cjs');
|
|
9
12
|
require('../chunk-DES3K4SD.cjs');
|
|
10
13
|
|
|
@@ -12,71 +15,83 @@ require('../chunk-DES3K4SD.cjs');
|
|
|
12
15
|
|
|
13
16
|
Object.defineProperty(exports, "AnnotateButton", {
|
|
14
17
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk3VW7ZXQ6_cjs.AnnotateButton; }
|
|
16
19
|
});
|
|
17
20
|
Object.defineProperty(exports, "DEFAULT_VERSION_SNAPSHOT_BAR_LABELS", {
|
|
18
21
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk3VW7ZXQ6_cjs.DEFAULT_VERSION_SNAPSHOT_BAR_LABELS; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "DELETE_SAVED_SIGNATURE_TEXT", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunk3VW7ZXQ6_cjs.DELETE_SAVED_SIGNATURE_TEXT; }
|
|
20
27
|
});
|
|
21
28
|
Object.defineProperty(exports, "DownloadMarkupButton", {
|
|
22
29
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk3VW7ZXQ6_cjs.DownloadMarkupButton; }
|
|
24
31
|
});
|
|
25
32
|
Object.defineProperty(exports, "MarkupNotices", {
|
|
26
33
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk3VW7ZXQ6_cjs.MarkupNotices; }
|
|
28
35
|
});
|
|
29
36
|
Object.defineProperty(exports, "MarkupViewNote", {
|
|
30
37
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk3VW7ZXQ6_cjs.MarkupViewNote; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "PlaceMySignatureButton", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunk3VW7ZXQ6_cjs.PlaceMySignatureButton; }
|
|
32
43
|
});
|
|
33
44
|
Object.defineProperty(exports, "RequestSignaturesButton", {
|
|
34
45
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk3VW7ZXQ6_cjs.RequestSignaturesButton; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "SavedSignatureSettings", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SavedSignatureSettings; }
|
|
36
51
|
});
|
|
37
52
|
Object.defineProperty(exports, "ShowOriginalButton", {
|
|
38
53
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk3VW7ZXQ6_cjs.ShowOriginalButton; }
|
|
40
55
|
});
|
|
41
56
|
Object.defineProperty(exports, "SignButton", {
|
|
42
57
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SignButton; }
|
|
44
59
|
});
|
|
45
60
|
Object.defineProperty(exports, "SignatureCertificate", {
|
|
46
61
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SignatureCertificate; }
|
|
48
63
|
});
|
|
49
64
|
Object.defineProperty(exports, "SignatureRequestBanner", {
|
|
50
65
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SignatureRequestBanner; }
|
|
52
67
|
});
|
|
53
68
|
Object.defineProperty(exports, "SignatureStatus", {
|
|
54
69
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SignatureStatus; }
|
|
56
71
|
});
|
|
57
72
|
Object.defineProperty(exports, "SignedEditNote", {
|
|
58
73
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunk3VW7ZXQ6_cjs.SignedEditNote; }
|
|
60
75
|
});
|
|
61
76
|
Object.defineProperty(exports, "VersionSnapshotBar", {
|
|
62
77
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunk3VW7ZXQ6_cjs.VersionSnapshotBar; }
|
|
64
79
|
});
|
|
65
80
|
Object.defineProperty(exports, "formatSignedAt", {
|
|
66
81
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk3VW7ZXQ6_cjs.formatSignedAt; }
|
|
68
83
|
});
|
|
69
|
-
Object.defineProperty(exports, "
|
|
84
|
+
Object.defineProperty(exports, "SignDocumentDialog", {
|
|
70
85
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkJH6JTI76_cjs.SignDocumentDialog; }
|
|
72
87
|
});
|
|
73
|
-
Object.defineProperty(exports, "
|
|
88
|
+
Object.defineProperty(exports, "AdoptSignatureDialog", {
|
|
74
89
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkJPWPR6QU_cjs.AdoptSignatureDialog; }
|
|
76
91
|
});
|
|
77
|
-
Object.defineProperty(exports, "
|
|
92
|
+
Object.defineProperty(exports, "TYPED_SIGNATURE_STYLE", {
|
|
78
93
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkJPWPR6QU_cjs.TYPED_SIGNATURE_STYLE; }
|
|
80
95
|
});
|
|
81
96
|
//# sourceMappingURL=index.cjs.map
|
|
82
97
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -6,4 +6,6 @@ export { SignatureStatus, formatSignedAt, type SignatureStatusProps } from './Si
|
|
|
6
6
|
export { SignatureCertificate, type SignatureCertificateProps } from './SignatureCertificate';
|
|
7
7
|
export { DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, VersionSnapshotBar, type VersionSnapshotBarLabels, type VersionSnapshotBarProps, } from './VersionSnapshotBar';
|
|
8
8
|
export { AdoptSignatureDialog, TYPED_SIGNATURE_STYLE, type AdoptSignatureDialogProps, type AdoptedMark, } from './AdoptSignatureDialog';
|
|
9
|
+
export { PlaceMySignatureButton, type PlacedMark } from './PlaceMySignatureButton';
|
|
10
|
+
export { SavedSignatureSettings, DELETE_SAVED_SIGNATURE_TEXT } from './SavedSignatureSettings';
|
|
9
11
|
export { SignatureRequestBanner, type SignatureRequestBannerProps } from './SignatureRequestBanner';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { AnnotateButton, DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, DownloadMarkupButton, MarkupNotices, MarkupViewNote, RequestSignaturesButton, ShowOriginalButton, SignButton, SignatureCertificate, SignatureRequestBanner, SignatureStatus, SignedEditNote, VersionSnapshotBar, formatSignedAt } from '../chunk-
|
|
3
|
-
export { AdoptSignatureDialog, TYPED_SIGNATURE_STYLE } from '../chunk-EQB3WELX.js';
|
|
4
|
-
export { SignDocumentDialog } from '../chunk-2YOVK524.js';
|
|
2
|
+
export { AnnotateButton, DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, DELETE_SAVED_SIGNATURE_TEXT, DownloadMarkupButton, MarkupNotices, MarkupViewNote, PlaceMySignatureButton, RequestSignaturesButton, SavedSignatureSettings, ShowOriginalButton, SignButton, SignatureCertificate, SignatureRequestBanner, SignatureStatus, SignedEditNote, VersionSnapshotBar, formatSignedAt } from '../chunk-JTJCCL2E.js';
|
|
5
3
|
import '../chunk-6HKLTYNN.js';
|
|
4
|
+
export { SignDocumentDialog } from '../chunk-2YOVK524.js';
|
|
5
|
+
import '../chunk-2R3GGNPA.js';
|
|
6
|
+
export { AdoptSignatureDialog, TYPED_SIGNATURE_STYLE } from '../chunk-DAN7EJ4O.js';
|
|
7
|
+
import '../chunk-VHJHY7TT.js';
|
|
8
|
+
import '../chunk-7F6CBP3Z.js';
|
|
6
9
|
import '../chunk-TX2ZICS7.js';
|
|
7
10
|
import '../chunk-VUNV25KB.js';
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -49,6 +49,15 @@ export interface AnnotatedPdfViewerProps extends Omit<PdfViewerProps, 'file' | '
|
|
|
49
49
|
* "Download with markup" (they are never written into its PDF).
|
|
50
50
|
*/
|
|
51
51
|
signed?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* One's saved signature or initials to place (PDF tab › My signature): arms the stamp tool with
|
|
54
|
+
* the picture; the next click on a page places it. A new `key` arms it again.
|
|
55
|
+
*/
|
|
56
|
+
placeStamp?: {
|
|
57
|
+
image: string;
|
|
58
|
+
label: string;
|
|
59
|
+
key: number;
|
|
60
|
+
} | null;
|
|
52
61
|
}
|
|
53
|
-
export declare function AnnotatedPdfViewer({ file, documentId, version, fileName, shared, folder, editing, onMarkupChange, store: storeOverride, viewer: PdfViewer, signed, ...viewerProps }: AnnotatedPdfViewerProps): import("react").JSX.Element;
|
|
62
|
+
export declare function AnnotatedPdfViewer({ file, documentId, version, fileName, shared, folder, editing, onMarkupChange, store: storeOverride, viewer: PdfViewer, signed, placeStamp, ...viewerProps }: AnnotatedPdfViewerProps): import("react").JSX.Element;
|
|
54
63
|
export default AnnotatedPdfViewer;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prepare a document for signature: add the signers, then place each field (signature, initials,
|
|
3
3
|
* date signed, name) where it goes on the PDF of the version shown, for the signer it is for.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A Word document's own signature fields (Insert › Signature field) are placed on opening, each
|
|
5
|
+
* for the signer it names. "Find signature blocks" proposes fields from the document's execution
|
|
6
|
+
* blocks ("Director", "Witness name", "[Signature]", "Date:"); the author assigns a signer per
|
|
7
|
+
* block. A signer is a workspace member or anyone by email: someone not in the workspace is
|
|
8
|
+
* invited (as a guest) when it is sent, and signs once they join. Save it as a draft or send it:
|
|
9
|
+
* each signer is notified and walked through their fields. Needs a `<DocumentToolsProvider>`
|
|
10
|
+
* inside a React Query `QueryClientProvider`.
|
|
8
11
|
*/
|
|
9
12
|
import { type ReactElement } from 'react';
|
|
10
13
|
import { type SignatureRequest } from '@arbidocs/react/document-tools';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkJPWPR6QU_cjs = require('../../chunk-JPWPR6QU.cjs');
|
|
5
5
|
var chunkULWRNGGE_cjs = require('../../chunk-ULWRNGGE.cjs');
|
|
6
6
|
require('../../chunk-DES3K4SD.cjs');
|
|
7
7
|
var react = require('react');
|
|
@@ -32,6 +32,7 @@ function AnnotatedPdfViewer({
|
|
|
32
32
|
store: storeOverride,
|
|
33
33
|
viewer: PdfViewer = viewers.PdfViewer,
|
|
34
34
|
signed = false,
|
|
35
|
+
placeStamp = null,
|
|
35
36
|
...viewerProps
|
|
36
37
|
}) {
|
|
37
38
|
const { client, user, notify, saveFile, uploadDocument, openDocument, onDocumentsChanged } = documentTools.useDocumentTools();
|
|
@@ -63,6 +64,12 @@ function AnnotatedPdfViewer({
|
|
|
63
64
|
() => editing && !controller.readOnly ? controller : viewOnly(controller),
|
|
64
65
|
[editing, controller]
|
|
65
66
|
);
|
|
67
|
+
const { setSettings, setTool } = controller;
|
|
68
|
+
react.useEffect(() => {
|
|
69
|
+
if (!placeStamp) return;
|
|
70
|
+
setSettings({ stampImage: { image: placeStamp.image, label: placeStamp.label } });
|
|
71
|
+
setTool("stamp");
|
|
72
|
+
}, [placeStamp?.key]);
|
|
66
73
|
const { flush } = controller;
|
|
67
74
|
react.useEffect(() => {
|
|
68
75
|
if (!editing) void flush();
|
|
@@ -493,6 +500,8 @@ function GuidedSigningViewer({
|
|
|
493
500
|
}) {
|
|
494
501
|
const { user, notify } = documentTools.useDocumentTools();
|
|
495
502
|
const sign = documentTools.useSignSignatureRequest();
|
|
503
|
+
const savedSignature = documentTools.useSavedSignature();
|
|
504
|
+
const storeSignature = documentTools.useStoreSavedSignature();
|
|
496
505
|
const decline = documentTools.useDeclineSignatureRequest();
|
|
497
506
|
const mine = react.useMemo(() => documentTools.fieldsInSigningOrder(request.fields, signer), [request.fields, signer]);
|
|
498
507
|
const [mark, setMark] = react.useState(null);
|
|
@@ -572,9 +581,17 @@ function GuidedSigningViewer({
|
|
|
572
581
|
const renderContent = react.useCallback(
|
|
573
582
|
(field) => {
|
|
574
583
|
if (!applied.has(field.id) || !mark) return null;
|
|
575
|
-
const { adopted, signatureUrl } = mark;
|
|
576
|
-
|
|
577
|
-
|
|
584
|
+
const { adopted, signatureUrl, initialsUrl } = mark;
|
|
585
|
+
const image = field.type === "signature" ? signatureUrl : field.type === "initials" ? initialsUrl : null;
|
|
586
|
+
if (image) {
|
|
587
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
588
|
+
"img",
|
|
589
|
+
{
|
|
590
|
+
src: image,
|
|
591
|
+
alt: field.type === "signature" ? "Your signature" : "Your initials",
|
|
592
|
+
className: "h-full w-full object-contain"
|
|
593
|
+
}
|
|
594
|
+
);
|
|
578
595
|
}
|
|
579
596
|
const text = field.type === "signature" ? adopted.name : field.type === "initials" ? adopted.initials : field.type === "date" ? signingDate() : adopted.name;
|
|
580
597
|
const typed = documentTools.MARK_FIELD_TYPES.includes(field.type);
|
|
@@ -582,7 +599,7 @@ function GuidedSigningViewer({
|
|
|
582
599
|
"span",
|
|
583
600
|
{
|
|
584
601
|
className: "flex h-full w-full items-center px-1 whitespace-nowrap [container-type:size]",
|
|
585
|
-
style: typed ?
|
|
602
|
+
style: typed ? chunkJPWPR6QU_cjs.TYPED_SIGNATURE_STYLE : { color: "#1a1a26" },
|
|
586
603
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: typed ? "70cqh" : "62cqh", lineHeight: 1 }, children: text })
|
|
587
604
|
}
|
|
588
605
|
);
|
|
@@ -772,12 +789,14 @@ function GuidedSigningViewer({
|
|
|
772
789
|
}
|
|
773
790
|
) }),
|
|
774
791
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
775
|
-
|
|
792
|
+
chunkJPWPR6QU_cjs.AdoptSignatureDialog,
|
|
776
793
|
{
|
|
777
794
|
open: !!adoptFor,
|
|
778
795
|
onOpenChange: (open) => !open && setAdoptFor(null),
|
|
779
796
|
defaultName: user?.name ?? "",
|
|
780
|
-
onAdopt
|
|
797
|
+
onAdopt,
|
|
798
|
+
saved: savedSignature.data ?? null,
|
|
799
|
+
onSave: async (signature) => void await storeSignature.mutateAsync(signature)
|
|
781
800
|
}
|
|
782
801
|
),
|
|
783
802
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -875,9 +894,10 @@ function SignatureRequestEditor({
|
|
|
875
894
|
viewer: PdfViewer = viewers.PdfViewer,
|
|
876
895
|
...viewerProps
|
|
877
896
|
}) {
|
|
878
|
-
const { client, notify } = documentTools.useDocumentTools();
|
|
897
|
+
const { client, notify, user } = documentTools.useDocumentTools();
|
|
879
898
|
const candidates = documentTools.useSignerCandidates();
|
|
880
899
|
const save = documentTools.useSaveSignatureRequest();
|
|
900
|
+
const invite = documentTools.useInviteSigners();
|
|
881
901
|
const [fields, setFields] = react.useState(() => draft?.fields ?? []);
|
|
882
902
|
const [signers, setSigners] = react.useState(() => [
|
|
883
903
|
...new Set((draft?.fields ?? []).map((f) => f.signer))
|
|
@@ -890,11 +910,31 @@ function SignatureRequestEditor({
|
|
|
890
910
|
const [assign, setAssign] = react.useState({});
|
|
891
911
|
const [finding, setFinding] = react.useState(false);
|
|
892
912
|
const [error, setError] = react.useState(null);
|
|
913
|
+
const [newEmail, setNewEmail] = react.useState("");
|
|
914
|
+
const [givenNames, setGivenNames] = react.useState({});
|
|
915
|
+
const [confirmInvite, setConfirmInvite] = react.useState(null);
|
|
893
916
|
const people = react.useMemo(() => candidates.data ?? [], [candidates.data]);
|
|
894
|
-
const
|
|
895
|
-
(
|
|
917
|
+
const members = react.useMemo(
|
|
918
|
+
() => new Map(people.map((p) => [p.email.toLowerCase(), p.externalId])),
|
|
896
919
|
[people]
|
|
897
920
|
);
|
|
921
|
+
const me = people.find((p) => p.email.toLowerCase() === user?.email?.toLowerCase());
|
|
922
|
+
const nameOf = react.useCallback(
|
|
923
|
+
(token) => {
|
|
924
|
+
const person = people.find((p) => p.externalId === token);
|
|
925
|
+
if (person) return person.name;
|
|
926
|
+
const invited = draft?.signers.find((s) => s.external_id === token);
|
|
927
|
+
if (invited) return invited.name || invited.email || token;
|
|
928
|
+
const email = token.toLowerCase();
|
|
929
|
+
const member = people.find((p) => p.email.toLowerCase() === email);
|
|
930
|
+
return member?.name ?? givenNames[email] ?? token;
|
|
931
|
+
},
|
|
932
|
+
[people, draft, givenNames]
|
|
933
|
+
);
|
|
934
|
+
const isInvitee = react.useCallback(
|
|
935
|
+
(token) => documentTools.isEmailSigner(token) && !members.has(token.toLowerCase()) || draft?.signers.find((s) => s.external_id === token)?.progress === "invited",
|
|
936
|
+
[members, draft]
|
|
937
|
+
);
|
|
898
938
|
const colorOf = react.useCallback(
|
|
899
939
|
(ext) => {
|
|
900
940
|
const i = signers.indexOf(ext);
|
|
@@ -904,8 +944,10 @@ function SignatureRequestEditor({
|
|
|
904
944
|
);
|
|
905
945
|
const selected = fields.find((f) => f.id === selectedId) ?? null;
|
|
906
946
|
const blocker = signers.length === 0 ? "Add a signer." : documentTools.sendBlocker(fields);
|
|
907
|
-
const addSigner = (
|
|
908
|
-
if (!
|
|
947
|
+
const addSigner = (token) => {
|
|
948
|
+
if (!token) return;
|
|
949
|
+
const ext = documentTools.isEmailSigner(token) ? members.get(token.trim().toLowerCase()) ?? token.trim().toLowerCase() : token;
|
|
950
|
+
if (signers.includes(ext)) return;
|
|
909
951
|
setSigners((s) => [...s, ext]);
|
|
910
952
|
setCurrent(ext);
|
|
911
953
|
setPlacing((p) => p ?? "signature");
|
|
@@ -916,6 +958,41 @@ function SignatureRequestEditor({
|
|
|
916
958
|
if (current === ext) setCurrent(signers.find((x) => x !== ext) ?? null);
|
|
917
959
|
};
|
|
918
960
|
const updateField = (id, patch) => setFields((fs) => fs.map((f) => f.id === id ? { ...f, ...patch } : f));
|
|
961
|
+
const placedOnce = react.useRef(false);
|
|
962
|
+
react.useEffect(() => {
|
|
963
|
+
if (draft || placedOnce.current || candidates.isLoading) return;
|
|
964
|
+
placedOnce.current = true;
|
|
965
|
+
let live = true;
|
|
966
|
+
void documentTools.suggestSignatureFields(client, documentId, version).then((found) => {
|
|
967
|
+
if (!live) return;
|
|
968
|
+
const { placed, extras } = documentTools.splitSuggestions(found ?? []);
|
|
969
|
+
if (!placed.length) return;
|
|
970
|
+
const named = Object.fromEntries(
|
|
971
|
+
placed.flatMap(
|
|
972
|
+
(s) => s.signer_email && s.signer_name ? [[s.signer_email.toLowerCase(), s.signer_name]] : []
|
|
973
|
+
)
|
|
974
|
+
);
|
|
975
|
+
setGivenNames((n) => ({ ...n, ...named }));
|
|
976
|
+
const added = documentTools.fieldsFromSuggestions(placed, {}, members);
|
|
977
|
+
setFields((fs) => [...fs, ...added]);
|
|
978
|
+
const assigned = [...new Set(added.map((f) => f.signer))];
|
|
979
|
+
setSigners((s) => [...s, ...assigned.filter((t) => !s.includes(t))]);
|
|
980
|
+
setCurrent((c) => c ?? assigned[0] ?? null);
|
|
981
|
+
const open = placed.filter((s) => !s.signer_email);
|
|
982
|
+
if (open.length || extras.length) {
|
|
983
|
+
setSuggestions([...open, ...extras]);
|
|
984
|
+
setAssign({});
|
|
985
|
+
}
|
|
986
|
+
notify(
|
|
987
|
+
`${added.length} field${added.length === 1 ? "" : "s"} placed from the document.`,
|
|
988
|
+
"success"
|
|
989
|
+
);
|
|
990
|
+
}).catch(() => {
|
|
991
|
+
});
|
|
992
|
+
return () => {
|
|
993
|
+
live = false;
|
|
994
|
+
};
|
|
995
|
+
}, [draft, candidates.isLoading, client, documentId, version, members, notify]);
|
|
919
996
|
const findBlocks = async () => {
|
|
920
997
|
setFinding(true);
|
|
921
998
|
setError(null);
|
|
@@ -933,7 +1010,7 @@ function SignatureRequestEditor({
|
|
|
933
1010
|
};
|
|
934
1011
|
const applySuggestions = () => {
|
|
935
1012
|
if (!suggestions) return;
|
|
936
|
-
const added = documentTools.fieldsFromSuggestions(suggestions, assign);
|
|
1013
|
+
const added = documentTools.fieldsFromSuggestions(suggestions, assign, members);
|
|
937
1014
|
setFields((fs) => [...fs, ...added]);
|
|
938
1015
|
const assigned = [...new Set(added.map((f) => f.signer))];
|
|
939
1016
|
setSigners((s) => [...s, ...assigned.filter((ext) => !s.includes(ext))]);
|
|
@@ -941,9 +1018,17 @@ function SignatureRequestEditor({
|
|
|
941
1018
|
setSuggestions(null);
|
|
942
1019
|
notify(`${added.length} field${added.length === 1 ? "" : "s"} added.`, "success");
|
|
943
1020
|
};
|
|
944
|
-
const submit = async (send) => {
|
|
1021
|
+
const submit = async (send, invited = false) => {
|
|
945
1022
|
setError(null);
|
|
1023
|
+
const invitees = signers.filter((t) => documentTools.isEmailSigner(t) && !members.has(t.toLowerCase()));
|
|
1024
|
+
if (send && invitees.length && !invited) {
|
|
1025
|
+
setConfirmInvite(invitees);
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
946
1028
|
try {
|
|
1029
|
+
if (send && invitees.length && me?.role === "owner") {
|
|
1030
|
+
await invite.mutateAsync({ documentId, emails: invitees });
|
|
1031
|
+
}
|
|
947
1032
|
const request = await save.mutateAsync({
|
|
948
1033
|
documentId,
|
|
949
1034
|
version,
|
|
@@ -952,10 +1037,12 @@ function SignatureRequestEditor({
|
|
|
952
1037
|
requestId: draft?.status === "draft" ? draft.external_id : void 0,
|
|
953
1038
|
send
|
|
954
1039
|
});
|
|
1040
|
+
const waiting = request.signers.filter((s) => s.progress === "invited").length;
|
|
955
1041
|
notify(
|
|
956
|
-
send ? `Sent for signature to ${request.signers.length} signer${request.signers.length === 1 ? "" : "s"}.` : "Draft saved.",
|
|
1042
|
+
send ? `Sent for signature to ${request.signers.length} signer${request.signers.length === 1 ? "" : "s"}.` + (waiting ? ` ${waiting} ${waiting === 1 ? "is" : "are"} asked once they join the workspace.` : "") : "Draft saved.",
|
|
957
1043
|
"success"
|
|
958
1044
|
);
|
|
1045
|
+
setConfirmInvite(null);
|
|
959
1046
|
onSaved(request);
|
|
960
1047
|
} catch (err) {
|
|
961
1048
|
setError(err instanceof Error ? err.message : "The request could not be saved");
|
|
@@ -1019,7 +1106,8 @@ function SignatureRequestEditor({
|
|
|
1019
1106
|
"data-testid": `signer-chip-${ext}`,
|
|
1020
1107
|
children: [
|
|
1021
1108
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-2.5 rounded-full", style: { background: colorOf(ext) } }),
|
|
1022
|
-
nameOf(ext)
|
|
1109
|
+
nameOf(ext),
|
|
1110
|
+
isInvitee(ext) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", "data-testid": "signer-invited", children: "(to invite)" })
|
|
1023
1111
|
]
|
|
1024
1112
|
}
|
|
1025
1113
|
),
|
|
@@ -1059,7 +1147,45 @@ function SignatureRequestEditor({
|
|
|
1059
1147
|
]
|
|
1060
1148
|
}
|
|
1061
1149
|
)
|
|
1062
|
-
] })
|
|
1150
|
+
] }),
|
|
1151
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1152
|
+
"form",
|
|
1153
|
+
{
|
|
1154
|
+
className: "inline-flex items-center gap-1",
|
|
1155
|
+
onSubmit: (e) => {
|
|
1156
|
+
e.preventDefault();
|
|
1157
|
+
if (!documentTools.isEmailSigner(newEmail)) return;
|
|
1158
|
+
addSigner(newEmail);
|
|
1159
|
+
setNewEmail("");
|
|
1160
|
+
},
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1163
|
+
ui.Input,
|
|
1164
|
+
{
|
|
1165
|
+
type: "email",
|
|
1166
|
+
value: newEmail,
|
|
1167
|
+
onChange: (e) => setNewEmail(e.target.value),
|
|
1168
|
+
placeholder: "Or anyone, by email",
|
|
1169
|
+
"aria-label": "Signer's email",
|
|
1170
|
+
className: "h-8 w-52",
|
|
1171
|
+
"data-testid": "signature-add-email"
|
|
1172
|
+
}
|
|
1173
|
+
),
|
|
1174
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1175
|
+
ui.Button,
|
|
1176
|
+
{
|
|
1177
|
+
type: "submit",
|
|
1178
|
+
size: "sm",
|
|
1179
|
+
variant: "ghost",
|
|
1180
|
+
disabled: !documentTools.isEmailSigner(newEmail),
|
|
1181
|
+
"aria-label": "Add this signer",
|
|
1182
|
+
"data-testid": "signature-add-email-submit",
|
|
1183
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MailPlus, { className: "size-4", "aria-hidden": true })
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1186
|
+
]
|
|
1187
|
+
}
|
|
1188
|
+
)
|
|
1063
1189
|
] }),
|
|
1064
1190
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1065
1191
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: current ? `Place for ${nameOf(current)}:` : "Add a signer, then place their fields." }),
|
|
@@ -1216,7 +1342,8 @@ function SignatureRequestEditor({
|
|
|
1216
1342
|
"data-testid": `signature-suggestion-signer-${g}`,
|
|
1217
1343
|
children: [
|
|
1218
1344
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Skip" }),
|
|
1219
|
-
people.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.externalId, children: p.name }, p.externalId))
|
|
1345
|
+
people.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.externalId, children: p.name }, p.externalId)),
|
|
1346
|
+
signers.filter((t) => !people.some((p) => p.externalId === t)).map((t) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: t, children: nameOf(t) }, t))
|
|
1220
1347
|
]
|
|
1221
1348
|
}
|
|
1222
1349
|
)
|
|
@@ -1237,6 +1364,45 @@ function SignatureRequestEditor({
|
|
|
1237
1364
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { type: "button", size: "sm", variant: "ghost", onClick: () => setSuggestions(null), children: "Dismiss" })
|
|
1238
1365
|
] })
|
|
1239
1366
|
] }),
|
|
1367
|
+
confirmInvite && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1368
|
+
"div",
|
|
1369
|
+
{
|
|
1370
|
+
className: "space-y-1.5 rounded-md border border-amber-300 bg-amber-50 p-2 text-amber-950 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100",
|
|
1371
|
+
"data-testid": "signature-invite-confirm",
|
|
1372
|
+
children: [
|
|
1373
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
1374
|
+
"Not in this workspace yet: ",
|
|
1375
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: confirmInvite.map(nameOf).join(", ") }),
|
|
1376
|
+
".",
|
|
1377
|
+
" ",
|
|
1378
|
+
me?.role === "owner" ? "They are invited as guests and asked to sign when they join." : "Ask a workspace owner to invite them: they are asked to sign when they join."
|
|
1379
|
+
] }),
|
|
1380
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1381
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1382
|
+
ui.Button,
|
|
1383
|
+
{
|
|
1384
|
+
type: "button",
|
|
1385
|
+
size: "sm",
|
|
1386
|
+
onClick: () => submit(true, true),
|
|
1387
|
+
disabled: save.isPending || invite.isPending,
|
|
1388
|
+
"data-testid": "signature-invite-send",
|
|
1389
|
+
children: me?.role === "owner" ? "Invite and send" : "Send"
|
|
1390
|
+
}
|
|
1391
|
+
),
|
|
1392
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1393
|
+
ui.Button,
|
|
1394
|
+
{
|
|
1395
|
+
type: "button",
|
|
1396
|
+
size: "sm",
|
|
1397
|
+
variant: "ghost",
|
|
1398
|
+
onClick: () => setConfirmInvite(null),
|
|
1399
|
+
children: "Cancel"
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
] })
|
|
1403
|
+
]
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1240
1406
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-text", role: "alert", "data-testid": "signature-editor-error", children: error })
|
|
1241
1407
|
] }),
|
|
1242
1408
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(PdfViewer, { ...viewerProps, file, renderPageOverlay }) })
|