@docuninja/builder2.0 0.0.70 → 0.0.71
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/builder/builder-store.d.ts +54 -0
- package/dist/builder/cache-store.d.ts +12 -0
- package/dist/builder/component-types.d.ts +149 -0
- package/dist/builder/helpers.d.ts +9 -0
- package/dist/builder/hooks/use-cookie-consent-height.d.ts +1 -0
- package/dist/builder/hooks/use-label-position.d.ts +3 -0
- package/dist/builder/index.d.ts +97 -0
- package/dist/builder/password-files.d.ts +3 -0
- package/dist/builder/pdf-worker.d.ts +2 -0
- package/dist/builder/root.d.ts +2 -0
- package/dist/builder/sensor.d.ts +14 -0
- package/dist/builder/sign/actions.d.ts +21 -0
- package/dist/builder/sign/checkbox-panel.d.ts +5 -0
- package/dist/builder/sign/component-types.d.ts +68 -0
- package/dist/builder/sign/consent.d.ts +7 -0
- package/dist/builder/sign/date-panel.d.ts +5 -0
- package/dist/builder/sign/file.d.ts +10 -0
- package/dist/builder/sign/font-selector.d.ts +6 -0
- package/dist/builder/sign/fonts.d.ts +1 -0
- package/dist/builder/sign/index.d.ts +50 -0
- package/dist/builder/sign/initials-panel.d.ts +5 -0
- package/dist/builder/sign/initials-signature-panel.d.ts +6 -0
- package/dist/builder/sign/multiselect-panel.d.ts +5 -0
- package/dist/builder/sign/number-panel.d.ts +5 -0
- package/dist/builder/sign/radio-panel.d.ts +5 -0
- package/dist/builder/sign/select-panel.d.ts +5 -0
- package/dist/builder/sign/sign-panel.d.ts +5 -0
- package/dist/builder/sign/signature.d.ts +6 -0
- package/dist/builder/sign/success.d.ts +3 -0
- package/dist/builder/sign/text-panel.d.ts +5 -0
- package/dist/builder/sign/voided.d.ts +1 -0
- package/dist/builder/sign-store.d.ts +49 -0
- package/dist/builder/standalone.d.ts +13 -0
- package/dist/builder/types/api.d.ts +352 -0
- package/dist/builder/ui/delete.d.ts +7 -0
- package/dist/builder/ui/document.d.ts +5 -0
- package/dist/builder/ui/editable.d.ts +7 -0
- package/dist/builder/ui/files.d.ts +6 -0
- package/dist/builder/ui/frame.d.ts +1 -0
- package/dist/builder/ui/index.d.ts +124 -0
- package/dist/builder/ui/index.iife.d.ts +2 -0
- package/dist/builder/ui/options-modal.d.ts +11 -0
- package/dist/builder/ui/preview.d.ts +7 -0
- package/dist/builder/ui/rectangles.d.ts +9 -0
- package/dist/builder/ui/save.d.ts +11 -0
- package/dist/builder/ui/send-confirmation.d.ts +9 -0
- package/dist/builder/ui/settings-modal.d.ts +10 -0
- package/dist/builder/ui/signatories.d.ts +23 -0
- package/dist/builder/ui/signatory.d.ts +51 -0
- package/dist/builder/ui/title.d.ts +7 -0
- package/dist/builder/ui/toolbox-context.d.ts +14 -0
- package/dist/builder/ui/toolbox.d.ts +3 -0
- package/dist/builder/ui/upload.d.ts +16 -0
- package/dist/builder/ui/validation-errors.d.ts +5 -0
- package/dist/builder/ui/websockets.d.ts +38 -0
- package/dist/builder/websocket-manager.d.ts +75 -0
- package/dist/builder/websockets-store.d.ts +20 -0
- package/dist/builder.iife.js +294 -0
- package/dist/builder2.0.css +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Document, DocumentFile, DocumentInvitation } from './types/api';
|
|
2
|
+
import { InputType, Rectangle, Rectangles, TSignatory, TSignatoryType } from '.';
|
|
3
|
+
type State = {
|
|
4
|
+
document: Document | null;
|
|
5
|
+
setupCompletedAt: Date | null;
|
|
6
|
+
blueprint: boolean;
|
|
7
|
+
rectangles: Rectangles;
|
|
8
|
+
signatories: TSignatory[];
|
|
9
|
+
activeSignatory: string | null;
|
|
10
|
+
colors: string[];
|
|
11
|
+
filesOrder: string[];
|
|
12
|
+
tempRectangleType: InputType;
|
|
13
|
+
signatoryOrder: string[];
|
|
14
|
+
signatoryMetadata: Record<string, unknown>;
|
|
15
|
+
focusedRectangleId: string | null;
|
|
16
|
+
};
|
|
17
|
+
type SetupOptions = {
|
|
18
|
+
blueprint: boolean;
|
|
19
|
+
};
|
|
20
|
+
type Actions = {
|
|
21
|
+
setup: (document: Document, options: SetupOptions) => void;
|
|
22
|
+
reset: () => void;
|
|
23
|
+
applySnapshot: (snapshot: State) => void;
|
|
24
|
+
findRectangles: () => Rectangle[];
|
|
25
|
+
findRectangle: (id: string | null) => Rectangle | null;
|
|
26
|
+
findRectanglesForId: (id: string) => Rectangle[];
|
|
27
|
+
findRectanglesForSignatory: (id: string) => Rectangle[];
|
|
28
|
+
findFileByRectangleId: (id: string) => DocumentFile | undefined;
|
|
29
|
+
createRectangle: (rectangle: Rectangle) => void;
|
|
30
|
+
updateRectangle: (id: string, rectangle: Rectangle) => void;
|
|
31
|
+
deleteRectangle: (id: string) => void;
|
|
32
|
+
createSignatory: (id: string, type: TSignatoryType, metadata?: Record<string, unknown>, signing_order?: number) => void;
|
|
33
|
+
findSignatory: (id: string) => TSignatory | null;
|
|
34
|
+
updateActiveSignatory: (id: string | null) => void;
|
|
35
|
+
updateSignatoryOrder: (signatoryId: string, newOrder: number) => void;
|
|
36
|
+
rebuildSignatories: (invitations: DocumentInvitation[]) => void;
|
|
37
|
+
deleteSignatory: (id: string, type: TSignatoryType) => void;
|
|
38
|
+
isPersistedSignatory: (id: string, type: TSignatoryType) => boolean;
|
|
39
|
+
generateColors: () => void;
|
|
40
|
+
moveFile: (id: string, direction: "up" | "down") => void;
|
|
41
|
+
cleanUpSignatures: (id: string) => void;
|
|
42
|
+
setTempRectangleType: (type: InputType) => void;
|
|
43
|
+
setDocument: (document: Document) => void;
|
|
44
|
+
syncRectangleColors: () => void;
|
|
45
|
+
createBlueprintSignatory: () => void;
|
|
46
|
+
updateSignatoryPosition: (id: string, index: number) => void;
|
|
47
|
+
setSignatoryOrder: (order: string[]) => void;
|
|
48
|
+
updateSignatory: (id: string, signatory: Partial<TSignatory>) => void;
|
|
49
|
+
updateSignatoryMetadata: (key: string, value: unknown) => void;
|
|
50
|
+
setFocusedRectangleId: (id: string | null) => void;
|
|
51
|
+
};
|
|
52
|
+
export type BuilderStore = State & Actions;
|
|
53
|
+
export declare const useBuilderStore: import('zustand').UseBoundStore<import('zustand').StoreApi<BuilderStore>>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ClientContact, User } from './types/api';
|
|
2
|
+
type State = {
|
|
3
|
+
contacts: ClientContact[];
|
|
4
|
+
users: User[];
|
|
5
|
+
};
|
|
6
|
+
type Actions = {
|
|
7
|
+
updateContacts: (contact: ClientContact) => void;
|
|
8
|
+
updateUsers: (user: User) => void;
|
|
9
|
+
};
|
|
10
|
+
export type CacheStore = State & Actions;
|
|
11
|
+
export declare const useCacheStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CacheStore>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Rectangle, TSignatory } from './index';
|
|
2
|
+
import { Document, DocumentInvitation, ValidationBag } from './types/api';
|
|
3
|
+
import { SelectOption, SelectProps } from './ui/signatories';
|
|
4
|
+
import { CreateDialogFieldProps } from './ui/signatory';
|
|
5
|
+
import { ToolboxOption } from './ui/toolbox-context';
|
|
6
|
+
export type ConfirmationDialogButtonProps = {
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type SaveButtonProps = {
|
|
10
|
+
isSubmitting: boolean;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type SendButtonProps = {
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type SendDialogProps = {
|
|
17
|
+
open: boolean;
|
|
18
|
+
onOpenChange: (open: boolean) => void;
|
|
19
|
+
content: React.ReactNode;
|
|
20
|
+
action: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export type SendDialogButtonProps = {
|
|
23
|
+
isSubmitting: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type DeleteDialogProps = {
|
|
26
|
+
open: boolean;
|
|
27
|
+
onOpenChange: (open: boolean) => void;
|
|
28
|
+
action: React.ReactNode;
|
|
29
|
+
};
|
|
30
|
+
export type DeleteDialogButtonProps = {
|
|
31
|
+
isSubmitting: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type UploadProps = {
|
|
34
|
+
onClick: () => void;
|
|
35
|
+
};
|
|
36
|
+
export type UploadDialogProps = {
|
|
37
|
+
open: boolean;
|
|
38
|
+
onOpenChange: (open: boolean) => void;
|
|
39
|
+
content: React.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
export type ConfirmationDialogProps = {
|
|
42
|
+
isOpen: boolean;
|
|
43
|
+
onOpenChange: (open: boolean) => void;
|
|
44
|
+
content: React.ReactNode;
|
|
45
|
+
action: React.ReactNode;
|
|
46
|
+
};
|
|
47
|
+
export type ValidationErrorsProps = {
|
|
48
|
+
content: React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
export type SignatorySelectorProps = {
|
|
51
|
+
results: SelectOption[];
|
|
52
|
+
onSelect: SelectProps["onSelect"];
|
|
53
|
+
value: SelectProps["value"];
|
|
54
|
+
setCreateDialogOpen: (open: boolean) => void;
|
|
55
|
+
trigger?: React.ReactNode;
|
|
56
|
+
signatories: TSignatory[];
|
|
57
|
+
};
|
|
58
|
+
export type CreateBlueprintSignatoryProps = {
|
|
59
|
+
onClick: () => void;
|
|
60
|
+
};
|
|
61
|
+
export type UninviteDialogProps = {
|
|
62
|
+
open: boolean;
|
|
63
|
+
onOpenChange: (open: boolean) => void;
|
|
64
|
+
content: React.ReactNode;
|
|
65
|
+
action: React.ReactNode;
|
|
66
|
+
};
|
|
67
|
+
export type UninviteDialogButtonProps = {
|
|
68
|
+
isSubmitting: boolean;
|
|
69
|
+
form: string;
|
|
70
|
+
};
|
|
71
|
+
export type CreateDialogProps = {
|
|
72
|
+
open: boolean;
|
|
73
|
+
onOpenChange: (open: boolean) => void;
|
|
74
|
+
client: React.ReactNode;
|
|
75
|
+
user: React.ReactNode;
|
|
76
|
+
};
|
|
77
|
+
export type CreateClientTabProps = {
|
|
78
|
+
fields: CreateDialogFieldProps<Record<string, unknown>>[];
|
|
79
|
+
errors: ValidationBag | null;
|
|
80
|
+
};
|
|
81
|
+
export type CreateDialogTabButtonProps = {
|
|
82
|
+
form: string;
|
|
83
|
+
isSubmitting: boolean;
|
|
84
|
+
};
|
|
85
|
+
export type SignProps = {
|
|
86
|
+
document: Document;
|
|
87
|
+
invitation: DocumentInvitation;
|
|
88
|
+
};
|
|
89
|
+
export type ToolboxContextProps = {
|
|
90
|
+
options?: ToolboxOption[];
|
|
91
|
+
rectangle: Rectangle;
|
|
92
|
+
};
|
|
93
|
+
export type SignatorySwapProps = SignatorySelectorProps;
|
|
94
|
+
export type AlertProps = {
|
|
95
|
+
title: React.ReactNode;
|
|
96
|
+
children: React.ReactNode;
|
|
97
|
+
};
|
|
98
|
+
export type ImportFromButtonProps = {
|
|
99
|
+
onClick: () => void;
|
|
100
|
+
isSubmitting: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type RectangleSettingsDialogProps = {
|
|
103
|
+
open: boolean;
|
|
104
|
+
onOpenChange: (open: boolean) => void;
|
|
105
|
+
title: React.ReactNode;
|
|
106
|
+
children: React.ReactNode;
|
|
107
|
+
};
|
|
108
|
+
export type RectangleSettingsDialogButtonProps = {
|
|
109
|
+
onClick: () => void;
|
|
110
|
+
label: string;
|
|
111
|
+
id?: string;
|
|
112
|
+
};
|
|
113
|
+
export type RectangleSettingsInputProps = {
|
|
114
|
+
id: string;
|
|
115
|
+
type?: "text" | "number";
|
|
116
|
+
value: string | number;
|
|
117
|
+
onChange: (value: string) => void;
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
maxLength?: number;
|
|
120
|
+
min?: number;
|
|
121
|
+
max?: number;
|
|
122
|
+
step?: string;
|
|
123
|
+
};
|
|
124
|
+
export type RectangleSettingsLabelProps = {
|
|
125
|
+
htmlFor: string;
|
|
126
|
+
children: React.ReactNode;
|
|
127
|
+
};
|
|
128
|
+
export type RectangleSettingsCheckboxProps = {
|
|
129
|
+
id: string;
|
|
130
|
+
checked: boolean;
|
|
131
|
+
onChange: (checked: boolean) => void;
|
|
132
|
+
label: string;
|
|
133
|
+
};
|
|
134
|
+
export type RectangleSettingsSelectProps = {
|
|
135
|
+
id: string;
|
|
136
|
+
value: string;
|
|
137
|
+
onChange: (value: string) => void;
|
|
138
|
+
children: React.ReactNode;
|
|
139
|
+
};
|
|
140
|
+
export type RectangleSettingsRemoveButtonProps = {
|
|
141
|
+
onClick: () => void;
|
|
142
|
+
};
|
|
143
|
+
export type RectangleSettingsOptionItemProps = {
|
|
144
|
+
children: React.ReactNode;
|
|
145
|
+
};
|
|
146
|
+
export type RectangleSettingsOptionsListProps = {
|
|
147
|
+
id: string;
|
|
148
|
+
children: React.ReactNode;
|
|
149
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function $scroll(querySelector: string, offset?: number): void;
|
|
2
|
+
export declare function $focus(id: string): void;
|
|
3
|
+
export declare function $delete(id: string): void;
|
|
4
|
+
export declare function $settings(id: string): void;
|
|
5
|
+
export declare function $save(): void;
|
|
6
|
+
export declare function $noSignatoryWarning(): void;
|
|
7
|
+
export declare function $openCreateDialog(): void;
|
|
8
|
+
export declare function $connectWebsockets(): void;
|
|
9
|
+
export declare function $retryImage(element: HTMLImageElement, initialDelay?: number): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCookieConsentHeight(): number;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Builder as BuilderContext } from './ui';
|
|
2
|
+
/** Hey there, you! So you want to add a prop onto this interface huh? No probs, but PLEASE notify upstream that this interface has changed so we can update the types in all repos :) */
|
|
3
|
+
export type Rectangle = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
page: number;
|
|
11
|
+
signature: string | null;
|
|
12
|
+
type: InputType;
|
|
13
|
+
value: string | null;
|
|
14
|
+
file_id: string;
|
|
15
|
+
signatory_id: string;
|
|
16
|
+
color: string;
|
|
17
|
+
required: boolean;
|
|
18
|
+
options?: RectangleOptions;
|
|
19
|
+
show_label?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type InputType = "signature" | "input" | "date" | "checkbox" | "initial" | "select" | "radio" | "multiselect" | "number";
|
|
22
|
+
export type Rectangles = Record<string, Rectangle[]>;
|
|
23
|
+
export type TSignatoryType = "contact" | "user" | "blueprint";
|
|
24
|
+
export type DateFormat = "YYYY-MM-DD" | "MM/DD/YYYY" | "DD/MM/YYYY";
|
|
25
|
+
export type NumberFormat = "123456789.567" | "$123,456,789.57" | "123 456 789,57 €" | "£123,456,789.57" | "123,456,789.567" | "123.456.789,567" | "123 456 789,567";
|
|
26
|
+
export type ValidationRule = "none" | "length" | "ssn" | "ein" | "email" | "url" | "zip" | "numbers_only" | "letters_only" | "custom";
|
|
27
|
+
export type SelectOption = {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
value: string;
|
|
31
|
+
};
|
|
32
|
+
export type RectangleOptions = {
|
|
33
|
+
date?: {
|
|
34
|
+
format: DateFormat;
|
|
35
|
+
defaultToSigningDate: boolean;
|
|
36
|
+
};
|
|
37
|
+
input?: {
|
|
38
|
+
useDefaultValue: boolean;
|
|
39
|
+
defaultText: string;
|
|
40
|
+
validationRule: ValidationRule;
|
|
41
|
+
customRegex?: string;
|
|
42
|
+
minLength?: number;
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
};
|
|
45
|
+
checkbox?: {
|
|
46
|
+
defaultValue: boolean;
|
|
47
|
+
};
|
|
48
|
+
initial?: {
|
|
49
|
+
useDefaultValue: boolean;
|
|
50
|
+
defaultText: string;
|
|
51
|
+
};
|
|
52
|
+
select?: {
|
|
53
|
+
options: SelectOption[];
|
|
54
|
+
defaultValue: string | null;
|
|
55
|
+
};
|
|
56
|
+
radio?: {
|
|
57
|
+
options: SelectOption[];
|
|
58
|
+
defaultValue: string | null;
|
|
59
|
+
};
|
|
60
|
+
multiselect?: {
|
|
61
|
+
options: SelectOption[];
|
|
62
|
+
defaultValues: string[];
|
|
63
|
+
};
|
|
64
|
+
number?: {
|
|
65
|
+
useDefaultValue: boolean;
|
|
66
|
+
defaultValue: number;
|
|
67
|
+
format: NumberFormat;
|
|
68
|
+
minValue?: number;
|
|
69
|
+
maxValue?: number;
|
|
70
|
+
decimalPlaces?: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export declare function useConstructDefaultOptionsFor(): (type: InputType) => RectangleOptions;
|
|
74
|
+
export type TSignatory = {
|
|
75
|
+
id: string;
|
|
76
|
+
color: string;
|
|
77
|
+
type: TSignatoryType;
|
|
78
|
+
signing_order?: number;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
};
|
|
81
|
+
export type TSignatories = TSignatory[];
|
|
82
|
+
export type BuilderProps = {
|
|
83
|
+
fileId: string;
|
|
84
|
+
readOnly: boolean;
|
|
85
|
+
url: string;
|
|
86
|
+
rectangles: Rectangle[];
|
|
87
|
+
pages: string[];
|
|
88
|
+
tempRectangleType?: InputType;
|
|
89
|
+
styles?: BuilderContext["styles"];
|
|
90
|
+
onRectangleClick?: (rectangleId: string) => void;
|
|
91
|
+
};
|
|
92
|
+
export declare function Builder({ fileId, readOnly, rectangles, pages: $pages, tempRectangleType, styles, onRectangleClick, }: BuilderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
93
|
+
type RectangleIconProps = {
|
|
94
|
+
rectangle: Rectangle;
|
|
95
|
+
};
|
|
96
|
+
export declare function RectangleIcon({ rectangle }: RectangleIconProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MouseSensor, TouchSensor } from '@dnd-kit/core';
|
|
2
|
+
import { MouseEvent, TouchEvent } from 'react';
|
|
3
|
+
export declare class MouseSensor$ extends MouseSensor {
|
|
4
|
+
static activators: {
|
|
5
|
+
eventName: "onMouseDown";
|
|
6
|
+
handler: ({ nativeEvent: event }: MouseEvent) => boolean;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export declare class TouchSensor$ extends TouchSensor {
|
|
10
|
+
static activators: {
|
|
11
|
+
eventName: "onTouchStart";
|
|
12
|
+
handler: ({ nativeEvent: event }: TouchEvent<Element>) => boolean;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Rectangle } from '..';
|
|
2
|
+
type ActionsProps = {
|
|
3
|
+
onContinue: () => void;
|
|
4
|
+
currentIndex: number;
|
|
5
|
+
rectangles: Rectangle[];
|
|
6
|
+
};
|
|
7
|
+
export declare function Actions({ onContinue, currentIndex, rectangles, }: ActionsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
type UseIsSubmissionValidProps = {
|
|
9
|
+
currentIndex: number;
|
|
10
|
+
rectangles: Rectangle[];
|
|
11
|
+
};
|
|
12
|
+
export declare function validateAllRequiredFields(rectangles: Rectangle[]): {
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
firstUnfilledIndex: number | null;
|
|
15
|
+
};
|
|
16
|
+
export declare function useIsSubmissionValid({ currentIndex, rectangles, }: UseIsSubmissionValidProps): boolean;
|
|
17
|
+
type LabelAttributes = {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function Label({ id }: LabelAttributes): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export type StartSigningButtonProps = {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
};
|
|
5
|
+
export type MinimizeButtonProps = StartSigningButtonProps;
|
|
6
|
+
export type SubmitButtonProps = {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
isSubmitting: boolean;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type DateInputProps = {
|
|
12
|
+
value: string;
|
|
13
|
+
onChange: (date: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export type SignatureSelectorDialogProps = {
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
18
|
+
trigger: React.ReactNode;
|
|
19
|
+
input: React.ReactNode;
|
|
20
|
+
content: React.ReactNode;
|
|
21
|
+
useSignatureButton: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export type SignatureSelectorInputProps = {
|
|
24
|
+
value: string;
|
|
25
|
+
onChange: (value: string) => void;
|
|
26
|
+
};
|
|
27
|
+
export type SignatureSelectorButtonProps = {
|
|
28
|
+
onClick: () => void;
|
|
29
|
+
};
|
|
30
|
+
export type SignCardProps = {
|
|
31
|
+
headerRef: RefObject<HTMLDivElement>;
|
|
32
|
+
contentRef: RefObject<HTMLDivElement>;
|
|
33
|
+
footerRef: RefObject<HTMLDivElement>;
|
|
34
|
+
header: React.ReactNode;
|
|
35
|
+
content: React.ReactNode;
|
|
36
|
+
footer: React.ReactNode;
|
|
37
|
+
hasSignature: boolean;
|
|
38
|
+
toggled: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type SignCardHeaderProps = {
|
|
41
|
+
toggled: boolean;
|
|
42
|
+
next: React.ReactNode;
|
|
43
|
+
previous: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
export type SignCardFooterProps = {
|
|
46
|
+
toggled: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type SignCardNextButtonProps = {
|
|
49
|
+
onClick: () => void;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type NavigateButtonProps = {
|
|
53
|
+
onClick: () => void;
|
|
54
|
+
disabled: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type SuccessProps = {
|
|
57
|
+
closeTab: () => void;
|
|
58
|
+
};
|
|
59
|
+
export type ConsentScreenProps = {
|
|
60
|
+
onCheckboxChange: (checked: boolean) => void;
|
|
61
|
+
};
|
|
62
|
+
export type ConsentDownloadButtonProps = {
|
|
63
|
+
onClick: () => void;
|
|
64
|
+
};
|
|
65
|
+
export type ConsentContinueButtonProps = {
|
|
66
|
+
onClick: () => void;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InvitationWithToken } from '../ui';
|
|
2
|
+
type ConsentProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
entity: InvitationWithToken;
|
|
5
|
+
};
|
|
6
|
+
export declare function Consent({ children, entity }: ConsentProps): string | number | boolean | Iterable<import('react').ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DocumentFile } from '../types/api';
|
|
2
|
+
import { Builder as Builder$ } from '../ui';
|
|
3
|
+
type FileProps = {
|
|
4
|
+
file: DocumentFile;
|
|
5
|
+
invitationId: string;
|
|
6
|
+
styles: Builder$["styles"];
|
|
7
|
+
onRectangleClick?: (rectangleId: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function File({ file, invitationId, styles, onRectangleClick, }: FileProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type SignatureFontSelectorProps = {
|
|
2
|
+
onSignatureCreated?: (signatureImage: string) => void;
|
|
3
|
+
triggerButtonText?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function SignatureFontSelector({ onSignatureCreated, }: SignatureFontSelectorProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFonts(): null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
import { Document } from '../types/api';
|
|
3
|
+
import { Builder } from '../ui';
|
|
4
|
+
import { ConsentContinueButtonProps, ConsentDownloadButtonProps, ConsentScreenProps, DateInputProps, MinimizeButtonProps, NavigateButtonProps, SignCardProps, SignatureSelectorButtonProps, SignatureSelectorDialogProps, SignatureSelectorInputProps, StartSigningButtonProps, SubmitButtonProps, SuccessProps } from './component-types';
|
|
5
|
+
export type Sign = {
|
|
6
|
+
document: string;
|
|
7
|
+
invitation: string;
|
|
8
|
+
sig?: string;
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
components: {
|
|
11
|
+
start: React.ComponentType<StartSigningButtonProps>;
|
|
12
|
+
minimize: React.ComponentType<MinimizeButtonProps>;
|
|
13
|
+
submit: React.ComponentType<SubmitButtonProps>;
|
|
14
|
+
dateInput: React.ComponentType<DateInputProps>;
|
|
15
|
+
success: React.ComponentType<SuccessProps>;
|
|
16
|
+
card: {
|
|
17
|
+
card: React.ComponentType<SignCardProps>;
|
|
18
|
+
};
|
|
19
|
+
signatureSelector: {
|
|
20
|
+
dialog: React.ComponentType<SignatureSelectorDialogProps>;
|
|
21
|
+
input: React.ComponentType<SignatureSelectorInputProps>;
|
|
22
|
+
button: React.ComponentType<SignatureSelectorButtonProps>;
|
|
23
|
+
clear: React.ComponentType<SignatureSelectorButtonProps>;
|
|
24
|
+
useSignature: React.ComponentType<SignatureSelectorButtonProps>;
|
|
25
|
+
};
|
|
26
|
+
next: React.ComponentType<NavigateButtonProps>;
|
|
27
|
+
previous: React.ComponentType<NavigateButtonProps>;
|
|
28
|
+
consent?: {
|
|
29
|
+
screen: React.ComponentType<ConsentScreenProps>;
|
|
30
|
+
download: React.ComponentType<ConsentDownloadButtonProps>;
|
|
31
|
+
continue: React.ComponentType<ConsentContinueButtonProps>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
styles: Builder["styles"];
|
|
35
|
+
company?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const SignContext: import('react').Context<Sign | null>;
|
|
38
|
+
export declare const SignContextPlus: import('react').Context<(Sign & {
|
|
39
|
+
http: Axios;
|
|
40
|
+
}) | null>;
|
|
41
|
+
export declare function useSignContext(): Sign;
|
|
42
|
+
export declare function useSignContextPlus(): Sign & {
|
|
43
|
+
http: Axios;
|
|
44
|
+
};
|
|
45
|
+
export declare function Sign(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
46
|
+
export type InvitationWithToken = Document & {
|
|
47
|
+
"X-Signer-Token"?: string;
|
|
48
|
+
"X-Signer-Token-Expires"?: string;
|
|
49
|
+
};
|
|
50
|
+
export declare function refetchInterval(expires: string): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Voided(): import("@emotion/react/jsx-runtime").JSX.Element;
|