@signsealer/sdk 1.13.0 → 1.19.0

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.
@@ -0,0 +1,153 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource react */
3
+ /**
4
+ * `@signsealer/sdk/react` -- a signature, taken inside your own app (1.18.0).
5
+ *
6
+ * One component, `SignaturePad`: draw with a finger, a stylus or a mouse,
7
+ * type it in a signature face, or pick a saved one your app already keeps;
8
+ * clear and redraw; see exactly what will be applied; and apply it only on
9
+ * an explicit approval, with a cancel beside it. It talks to nobody. What
10
+ * the person approved is handed to `onApply`, and your server does the rest
11
+ * -- `createApproval` and `signWithApproval` from the main entry -- because
12
+ * an API key and an application's private key belong on a server, never in
13
+ * a browser.
14
+ *
15
+ * React is a peer dependency of this entry only. The main entry still
16
+ * imports nothing, and a project that never imports `/react` never needs
17
+ * React installed.
18
+ *
19
+ * Drawing cannot be done from a keyboard, so typing is offered beside it and
20
+ * is the keyboard's road: every control is a native button, input or radio,
21
+ * the modes are a labelled tab list, the drawing area says what it is and
22
+ * that typing is the alternative, and every change of state is announced.
23
+ */
24
+ import { type CSSProperties } from "react";
25
+ export type SignatureMode = "draw" | "type" | "saved";
26
+ /** A signature your app keeps for this person: its own id and a picture of it. */
27
+ export interface SavedSignature {
28
+ /** Your id, or a reference from `addSignatureReference`: it comes back to you unchanged. */
29
+ id: string;
30
+ /** What to call it, for a person choosing between more than one. */
31
+ label?: string;
32
+ /** A data URL (PNG) of the signature, to show and to hand back. */
33
+ image: string;
34
+ }
35
+ /** What the person approved, handed to `onApply`. */
36
+ export type CapturedSignature = {
37
+ method: "drawn";
38
+ image: string;
39
+ } | {
40
+ method: "typed";
41
+ text: string;
42
+ font: string;
43
+ image: string;
44
+ } | {
45
+ method: "saved";
46
+ id: string;
47
+ image: string;
48
+ };
49
+ export interface SignaturePadProps {
50
+ /** Called when the person approves. A promise holds the pad busy until it settles; a rejection is shown as an error. */
51
+ onApply: (signature: CapturedSignature) => void | Promise<void>;
52
+ /** Called when the person cancels. No cancel button without it. */
53
+ onCancel?: () => void;
54
+ /** Which ways to offer, in order. Default: draw, type, and saved when there are any. */
55
+ modes?: SignatureMode[];
56
+ /** The person's saved signatures, which your app owns. */
57
+ savedSignatures?: SavedSignature[];
58
+ /** Put in the typing box to start with: usually the person's name. */
59
+ signerName?: string;
60
+ /**
61
+ * The words above the approve button: what applying the signature means.
62
+ * Use the document's own statement (its `intent_text`) where you have it.
63
+ */
64
+ statement?: string;
65
+ /** The approve button's words. Default "Approve and sign". */
66
+ approveLabel?: string;
67
+ /**
68
+ * Faces for a typed signature, as CSS font families. Load them in your
69
+ * app (a web font) for the look you want: what the browser cannot find
70
+ * falls back to its own cursive face. The first is the default.
71
+ */
72
+ fonts?: string[];
73
+ /** Busy from outside: controls disabled and the approve button says so. */
74
+ busy?: boolean;
75
+ /** An error from outside, shown above the buttons. */
76
+ error?: string | null;
77
+ /** Disable everything, for a document that cannot be signed now. */
78
+ disabled?: boolean;
79
+ /** The drawing area's height in CSS pixels. Default 180. */
80
+ height?: number;
81
+ className?: string;
82
+ style?: CSSProperties;
83
+ }
84
+ export declare const DEFAULT_SIGNATURE_FONTS: string[];
85
+ export type Point = {
86
+ x: number;
87
+ y: number;
88
+ pressure: number;
89
+ };
90
+ export interface PadState {
91
+ mode: SignatureMode;
92
+ step: "capture" | "review" | "applying" | "done";
93
+ strokes: Point[][];
94
+ typed: string;
95
+ font: number;
96
+ savedId: string | null;
97
+ /** The picture under review, made when the person asks to review. */
98
+ preview: CapturedSignature | null;
99
+ error: string | null;
100
+ }
101
+ export type PadAction = {
102
+ type: "mode";
103
+ mode: SignatureMode;
104
+ } | {
105
+ type: "stroke_start";
106
+ point: Point;
107
+ } | {
108
+ type: "stroke_point";
109
+ point: Point;
110
+ } | {
111
+ type: "clear";
112
+ } | {
113
+ type: "typed";
114
+ text: string;
115
+ } | {
116
+ type: "font";
117
+ index: number;
118
+ } | {
119
+ type: "saved";
120
+ id: string | null;
121
+ } | {
122
+ type: "review";
123
+ preview: CapturedSignature;
124
+ } | {
125
+ type: "back";
126
+ } | {
127
+ type: "applying";
128
+ } | {
129
+ type: "applied";
130
+ } | {
131
+ type: "failed";
132
+ error: string;
133
+ } | {
134
+ type: "not_ready";
135
+ error: string;
136
+ };
137
+ export declare function initialPadState(opts: {
138
+ modes: SignatureMode[];
139
+ signerName?: string;
140
+ savedId?: string | null;
141
+ }): PadState;
142
+ export declare function padReducer(state: PadState, action: PadAction): PadState;
143
+ /** Whether there is something to review in the current mode, and if not, why -- in words for the person. */
144
+ export declare function readiness(state: PadState): {
145
+ ready: boolean;
146
+ why: string | null;
147
+ };
148
+ /** The strokes as a PNG, at twice their size, on a transparent ground. */
149
+ export declare function strokesToPng(strokes: Point[][], width: number, height: number, ink?: string): string;
150
+ /** A typed signature as a PNG, in the face chosen. */
151
+ export declare function typedToPng(text: string, font: string, ink?: string): string;
152
+ export declare function SignaturePad(props: SignaturePadProps): import("react").JSX.Element;
153
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.tsx"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,6BAA6B;AAC7B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAA+D,KAAK,aAAa,EAA8D,MAAM,OAAO,CAAC;AAIpK,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtD,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,4FAA4F;IAC5F,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qDAAqD;AACrD,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAA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E,CAAC;AAEzC,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,QAAQ,CAKxH;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,QAAQ,CAuBvE;AAED,4GAA4G;AAC5G,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CASjF;AA8BD,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAY,GAAG,MAAM,CAQvG;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAY,GAAG,MAAM,CAc9E;AAMD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAkPpD"}
@@ -0,0 +1,321 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /** @jsxRuntime automatic */
3
+ /** @jsxImportSource react */
4
+ /**
5
+ * `@signsealer/sdk/react` -- a signature, taken inside your own app (1.18.0).
6
+ *
7
+ * One component, `SignaturePad`: draw with a finger, a stylus or a mouse,
8
+ * type it in a signature face, or pick a saved one your app already keeps;
9
+ * clear and redraw; see exactly what will be applied; and apply it only on
10
+ * an explicit approval, with a cancel beside it. It talks to nobody. What
11
+ * the person approved is handed to `onApply`, and your server does the rest
12
+ * -- `createApproval` and `signWithApproval` from the main entry -- because
13
+ * an API key and an application's private key belong on a server, never in
14
+ * a browser.
15
+ *
16
+ * React is a peer dependency of this entry only. The main entry still
17
+ * imports nothing, and a project that never imports `/react` never needs
18
+ * React installed.
19
+ *
20
+ * Drawing cannot be done from a keyboard, so typing is offered beside it and
21
+ * is the keyboard's road: every control is a native button, input or radio,
22
+ * the modes are a labelled tab list, the drawing area says what it is and
23
+ * that typing is the alternative, and every change of state is announced.
24
+ */
25
+ import { useCallback, useEffect, useId, useReducer, useRef, useState } from "react";
26
+ export const DEFAULT_SIGNATURE_FONTS = [
27
+ "\"Dancing Script\", \"Segoe Script\", \"Brush Script MT\", cursive",
28
+ "\"Caveat\", \"Bradley Hand\", \"Comic Sans MS\", cursive",
29
+ "\"Great Vibes\", \"Lucida Handwriting\", cursive",
30
+ ];
31
+ export function initialPadState(opts) {
32
+ return {
33
+ mode: opts.modes[0] ?? "draw", step: "capture", strokes: [], typed: opts.signerName ?? "", font: 0,
34
+ savedId: opts.savedId ?? null, preview: null, error: null,
35
+ };
36
+ }
37
+ export function padReducer(state, action) {
38
+ /* Nothing changes under a signature being applied, or once it has been. */
39
+ if ((state.step === "applying" || state.step === "done") && !["applied", "failed"].includes(action.type))
40
+ return state;
41
+ switch (action.type) {
42
+ case "mode": return state.step === "capture" ? { ...state, mode: action.mode, error: null } : state;
43
+ case "stroke_start": return state.step === "capture" ? { ...state, strokes: [...state.strokes, [action.point]], error: null } : state;
44
+ case "stroke_point": {
45
+ if (state.step !== "capture" || state.strokes.length === 0)
46
+ return state;
47
+ const strokes = state.strokes.slice();
48
+ strokes[strokes.length - 1] = [...strokes[strokes.length - 1], action.point];
49
+ return { ...state, strokes };
50
+ }
51
+ case "clear": return { ...state, strokes: [], step: "capture", preview: null, error: null };
52
+ case "typed": return { ...state, typed: action.text, error: null };
53
+ case "font": return { ...state, font: action.index };
54
+ case "saved": return { ...state, savedId: action.id, error: null };
55
+ case "review": return { ...state, step: "review", preview: action.preview, error: null };
56
+ case "back": return { ...state, step: "capture", preview: null, error: null };
57
+ case "applying": return state.step === "review" ? { ...state, step: "applying", error: null } : state;
58
+ case "applied": return { ...state, step: "done" };
59
+ case "failed": return { ...state, step: "review", error: action.error };
60
+ case "not_ready": return state.step === "capture" ? { ...state, error: action.error } : state;
61
+ }
62
+ }
63
+ /** Whether there is something to review in the current mode, and if not, why -- in words for the person. */
64
+ export function readiness(state) {
65
+ if (state.mode === "draw") {
66
+ const ink = state.strokes.reduce((n, s) => n + s.length, 0);
67
+ return ink >= 2 ? { ready: true, why: null } : { ready: false, why: "Draw your signature in the box first." };
68
+ }
69
+ if (state.mode === "type") {
70
+ return state.typed.trim() ? { ready: true, why: null } : { ready: false, why: "Type your name first." };
71
+ }
72
+ return state.savedId ? { ready: true, why: null } : { ready: false, why: "Choose a saved signature first." };
73
+ }
74
+ /* --------------------------------------------------------------- drawing */
75
+ function drawStrokes(ctx, strokes, scale, ink) {
76
+ ctx.lineCap = "round";
77
+ ctx.lineJoin = "round";
78
+ ctx.strokeStyle = ink;
79
+ ctx.fillStyle = ink;
80
+ for (const stroke of strokes) {
81
+ if (stroke.length === 1) {
82
+ const p = stroke[0];
83
+ ctx.beginPath();
84
+ ctx.arc(p.x * scale, p.y * scale, 1.4 * scale, 0, Math.PI * 2);
85
+ ctx.fill();
86
+ continue;
87
+ }
88
+ for (let i = 1; i < stroke.length; i++) {
89
+ const a = stroke[i - 1];
90
+ const b = stroke[i];
91
+ /* A pen's pressure thickens the line; a mouse reports 0.5 and draws an even one. */
92
+ ctx.lineWidth = (1.2 + 2.2 * ((a.pressure + b.pressure) / 2)) * scale;
93
+ ctx.beginPath();
94
+ ctx.moveTo(a.x * scale, a.y * scale);
95
+ ctx.lineTo(b.x * scale, b.y * scale);
96
+ ctx.stroke();
97
+ }
98
+ }
99
+ }
100
+ /** The strokes as a PNG, at twice their size, on a transparent ground. */
101
+ export function strokesToPng(strokes, width, height, ink = "#111827") {
102
+ const canvas = document.createElement("canvas");
103
+ canvas.width = Math.max(1, Math.round(width * 2));
104
+ canvas.height = Math.max(1, Math.round(height * 2));
105
+ const ctx = canvas.getContext("2d");
106
+ if (!ctx)
107
+ throw new Error("this browser cannot draw on a canvas");
108
+ drawStrokes(ctx, strokes, 2, ink);
109
+ return canvas.toDataURL("image/png");
110
+ }
111
+ /** A typed signature as a PNG, in the face chosen. */
112
+ export function typedToPng(text, font, ink = "#111827") {
113
+ const canvas = document.createElement("canvas");
114
+ const ctx = canvas.getContext("2d");
115
+ if (!ctx)
116
+ throw new Error("this browser cannot draw on a canvas");
117
+ const size = 96;
118
+ ctx.font = `${size}px ${font}`;
119
+ const width = Math.ceil(ctx.measureText(text).width) + size;
120
+ canvas.width = Math.max(1, width);
121
+ canvas.height = Math.round(size * 1.6);
122
+ ctx.font = `${size}px ${font}`;
123
+ ctx.fillStyle = ink;
124
+ ctx.textBaseline = "middle";
125
+ ctx.fillText(text, size / 2, canvas.height / 2);
126
+ return canvas.toDataURL("image/png");
127
+ }
128
+ /* ------------------------------------------------------------- component */
129
+ const LABELS = { draw: "Draw", type: "Type", saved: "Saved" };
130
+ export function SignaturePad(props) {
131
+ const saved = props.savedSignatures ?? [];
132
+ const modes = (props.modes ?? ["draw", "type", "saved"])
133
+ .filter((m, i, all) => all.indexOf(m) === i && (m !== "saved" || saved.length > 0));
134
+ const fonts = props.fonts?.length ? props.fonts : DEFAULT_SIGNATURE_FONTS;
135
+ const [state, dispatch] = useReducer(padReducer, { modes, signerName: props.signerName, savedId: saved.length === 1 ? saved[0].id : null }, initialPadState);
136
+ const [announce, setAnnounce] = useState("");
137
+ const [width, setWidth] = useState(0);
138
+ const canvasRef = useRef(null);
139
+ const wrapRef = useRef(null);
140
+ const drawing = useRef(false);
141
+ const id = useId();
142
+ const height = props.height ?? 180;
143
+ const locked = !!props.disabled || !!props.busy || state.step === "applying" || state.step === "done";
144
+ const error = state.error ?? props.error ?? null;
145
+ /*
146
+ Only the ways the caller allowed and that can be used now. When the one
147
+ in front of the person stops being one (saved signatures still loading,
148
+ then here; or the caller changed `modes`), the pad moves to the first
149
+ that is -- never to a way the caller did not allow.
150
+ */
151
+ const modeKey = modes.join(",");
152
+ const savedKey = saved.map((s) => s.id).join("\n");
153
+ useEffect(() => {
154
+ if (modes.length && !modes.includes(state.mode))
155
+ dispatch({ type: "mode", mode: modes[0] });
156
+ /* A choice whose signature has gone is not a choice: the one left, when one is, or none (Codex on #588). */
157
+ const chosen = state.savedId !== null && saved.some((s) => s.id === state.savedId);
158
+ if (!chosen) {
159
+ const next = saved.length === 1 ? saved[0].id : null;
160
+ if (next !== state.savedId)
161
+ dispatch({ type: "saved", id: next });
162
+ }
163
+ }, [modeKey, state.mode, state.savedId, savedKey]);
164
+ /* The drawing area follows its container, so it fits a phone held either way; the strokes are kept in CSS pixels and redrawn. */
165
+ useEffect(() => {
166
+ const el = wrapRef.current;
167
+ if (!el)
168
+ return;
169
+ const measure = () => setWidth(el.clientWidth);
170
+ measure();
171
+ if (typeof ResizeObserver === "undefined")
172
+ return;
173
+ const ro = new ResizeObserver(measure);
174
+ ro.observe(el);
175
+ return () => ro.disconnect();
176
+ }, [state.mode, state.step]);
177
+ useEffect(() => {
178
+ const canvas = canvasRef.current;
179
+ if (!canvas || !width)
180
+ return;
181
+ const ratio = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
182
+ canvas.width = Math.round(width * ratio);
183
+ canvas.height = Math.round(height * ratio);
184
+ const ctx = canvas.getContext("2d");
185
+ if (!ctx)
186
+ return;
187
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
188
+ drawStrokes(ctx, state.strokes, ratio, "#111827");
189
+ }, [width, height, state.strokes, state.mode, state.step]);
190
+ const pointFrom = (e) => {
191
+ const rect = e.currentTarget.getBoundingClientRect();
192
+ const pressure = e.pointerType === "pen" && e.pressure > 0 ? e.pressure : 0.5;
193
+ return { x: e.clientX - rect.left, y: e.clientY - rect.top, pressure };
194
+ };
195
+ const onDown = (e) => {
196
+ if (locked)
197
+ return;
198
+ e.preventDefault();
199
+ e.currentTarget.setPointerCapture?.(e.pointerId);
200
+ drawing.current = true;
201
+ dispatch({ type: "stroke_start", point: pointFrom(e) });
202
+ };
203
+ const onMove = (e) => {
204
+ if (!drawing.current || locked)
205
+ return;
206
+ e.preventDefault();
207
+ dispatch({ type: "stroke_point", point: pointFrom(e) });
208
+ };
209
+ const onUp = () => { drawing.current = false; };
210
+ const clear = () => { dispatch({ type: "clear" }); setAnnounce("Cleared. Draw your signature again."); };
211
+ const review = useCallback(() => {
212
+ const ok = readiness(state);
213
+ if (!ok.ready) {
214
+ dispatch({ type: "not_ready", error: ok.why });
215
+ setAnnounce(ok.why);
216
+ return;
217
+ }
218
+ let preview;
219
+ try {
220
+ if (state.mode === "draw")
221
+ preview = { method: "drawn", image: strokesToPng(state.strokes, width || 1, height) };
222
+ else if (state.mode === "type") {
223
+ const font = fonts[state.font] ?? fonts[0];
224
+ preview = { method: "typed", text: state.typed.trim(), font, image: typedToPng(state.typed.trim(), font) };
225
+ }
226
+ else {
227
+ const pick = saved.find((s) => s.id === state.savedId);
228
+ if (!pick) {
229
+ dispatch({ type: "not_ready", error: "Choose a saved signature first." });
230
+ setAnnounce("Choose a saved signature first.");
231
+ return;
232
+ }
233
+ preview = { method: "saved", id: pick.id, image: pick.image };
234
+ }
235
+ }
236
+ catch (e) {
237
+ setAnnounce(String(e.message));
238
+ return;
239
+ }
240
+ dispatch({ type: "review", preview });
241
+ setAnnounce("Check your signature, then approve it or go back.");
242
+ }, [state, width, height, fonts, saved]);
243
+ const apply = async () => {
244
+ if (!state.preview || state.step !== "review" || props.busy || props.disabled)
245
+ return;
246
+ dispatch({ type: "applying" });
247
+ setAnnounce("Applying your signature.");
248
+ try {
249
+ await props.onApply(state.preview);
250
+ dispatch({ type: "applied" });
251
+ setAnnounce("Your signature was applied.");
252
+ }
253
+ catch (e) {
254
+ const message = e instanceof Error && e.message ? e.message : "Your signature could not be applied. Try again.";
255
+ dispatch({ type: "failed", error: message });
256
+ setAnnounce(message);
257
+ }
258
+ };
259
+ /* Arrow keys move along the tab list, as a tab list should. */
260
+ const onTabKey = (e, i) => {
261
+ if (e.key !== "ArrowRight" && e.key !== "ArrowLeft")
262
+ return;
263
+ e.preventDefault();
264
+ const next = modes[(i + (e.key === "ArrowRight" ? 1 : modes.length - 1)) % modes.length];
265
+ dispatch({ type: "mode", mode: next });
266
+ document.getElementById(`${id}-tab-${next}`)?.focus();
267
+ };
268
+ const css = styles(height);
269
+ /* Nothing the caller allowed can be used yet: say so, rather than offer a way of signing it did not allow. */
270
+ if (modes.length === 0) {
271
+ return (_jsxs("div", { className: props.className, style: { ...css.root, ...props.style }, "data-signsealer-pad": "", "data-step": "unavailable", children: [_jsx("p", { role: "status", style: css.statement, children: "There is no way to sign here yet." }), props.onCancel && _jsx("div", { style: css.actions, children: _jsx("button", { type: "button", onClick: props.onCancel, style: css.secondary, children: "Cancel" }) })] }));
272
+ }
273
+ return (_jsxs("div", { className: props.className, style: { ...css.root, ...props.style }, "data-signsealer-pad": "", "data-step": state.step, "aria-busy": state.step === "applying" || !!props.busy, children: [_jsx("div", { "aria-live": "polite", role: "status", style: css.visuallyHidden, children: announce }), state.step === "capture" && (_jsxs(_Fragment, { children: [modes.length > 1 && (_jsx("div", { role: "tablist", "aria-label": "How to sign", style: css.tabs, children: modes.map((m, i) => (_jsx("button", { type: "button", role: "tab", id: `${id}-tab-${m}`, "aria-selected": state.mode === m, "aria-controls": `${id}-panel`, tabIndex: state.mode === m ? 0 : -1, disabled: locked, onClick: () => dispatch({ type: "mode", mode: m }), onKeyDown: (e) => onTabKey(e, i), style: state.mode === m ? { ...css.tab, ...css.tabOn } : css.tab, children: LABELS[m] }, m))) })), _jsxs("div", { id: `${id}-panel`, role: "tabpanel", "aria-labelledby": modes.length > 1 ? `${id}-tab-${state.mode}` : undefined, children: [state.mode === "draw" && (_jsxs("div", { ref: wrapRef, style: css.padWrap, children: [_jsx("canvas", { ref: canvasRef, role: "img", style: css.canvas, "aria-label": "Signature drawing area. Draw with a finger, a stylus or a mouse. To use a keyboard, choose Type.", onPointerDown: onDown, onPointerMove: onMove, onPointerUp: onUp, onPointerCancel: onUp, onPointerLeave: onUp }), _jsx("div", { "aria-hidden": "true", style: css.baseline }), state.strokes.length === 0 && _jsx("div", { "aria-hidden": "true", style: css.hint, children: "Sign here" })] })), state.mode === "type" && (_jsxs("div", { style: css.typeWrap, children: [_jsx("label", { htmlFor: `${id}-typed`, style: css.label, children: "Type your name" }), _jsx("input", { id: `${id}-typed`, type: "text", value: state.typed, disabled: locked, autoComplete: "name", maxLength: 200, onChange: (e) => dispatch({ type: "typed", text: e.target.value }), style: css.input }), _jsxs("fieldset", { style: css.fieldset, children: [_jsx("legend", { style: css.label, children: "Style" }), _jsx("div", { style: css.choices, children: fonts.map((f, i) => (_jsxs("label", { style: state.font === i ? { ...css.choice, ...css.choiceOn } : css.choice, children: [_jsx("input", { type: "radio", name: `${id}-font`, checked: state.font === i, disabled: locked, onChange: () => dispatch({ type: "font", index: i }), style: css.radio }), _jsx("span", { style: { fontFamily: f, fontSize: 28, lineHeight: 1.2 }, children: state.typed.trim() || "Your name" })] }, f))) })] })] })), state.mode === "saved" && (_jsxs("fieldset", { style: css.fieldset, children: [_jsx("legend", { style: css.label, children: "Choose a saved signature" }), _jsx("div", { style: css.choices, children: saved.map((s, i) => (_jsxs("label", { style: state.savedId === s.id ? { ...css.choice, ...css.choiceOn } : css.choice, children: [_jsx("input", { type: "radio", name: `${id}-saved`, checked: state.savedId === s.id, disabled: locked, onChange: () => dispatch({ type: "saved", id: s.id }), style: css.radio }), _jsx("img", { src: s.image, alt: s.label ?? `Saved signature ${i + 1}`, style: css.savedImg })] }, s.id))) })] }))] }), error && _jsx("p", { role: "alert", style: css.error, children: error }), _jsxs("div", { style: css.actions, children: [props.onCancel && _jsx("button", { type: "button", onClick: props.onCancel, disabled: state.step !== "capture" || !!props.busy, style: css.secondary, children: "Cancel" }), state.mode === "draw" && _jsx("button", { type: "button", onClick: clear, disabled: locked || state.strokes.length === 0, style: css.secondary, children: "Clear" }), _jsx("button", { type: "button", onClick: review, disabled: locked, style: css.primary, children: "Review" })] })] })), (state.step === "review" || state.step === "applying") && state.preview && (_jsxs(_Fragment, { children: [_jsxs("figure", { style: css.previewWrap, children: [_jsx("img", { src: state.preview.image, alt: state.preview.method === "typed" ? `Your typed signature: ${state.preview.text}` : "Your signature, as it will be applied", style: css.preview }), _jsx("figcaption", { style: css.caption, children: "This is the signature that will be applied." })] }), props.statement && _jsx("p", { style: css.statement, children: props.statement }), error && _jsx("p", { role: "alert", style: css.error, children: error }), _jsxs("div", { style: css.actions, children: [props.onCancel && _jsx("button", { type: "button", onClick: props.onCancel, disabled: state.step === "applying" || !!props.busy, style: css.secondary, children: "Cancel" }), _jsx("button", { type: "button", onClick: () => { dispatch({ type: "back" }); setAnnounce("Back to your signature."); }, disabled: state.step === "applying" || !!props.busy, style: css.secondary, children: state.preview.method === "drawn" ? "Redraw" : "Change" }), _jsx("button", { type: "button", onClick: apply, disabled: state.step === "applying" || !!props.busy || !!props.disabled, style: css.primary, children: state.step === "applying" || props.busy ? "Applying…" : props.approveLabel ?? "Approve and sign" })] })] })), state.step === "done" && (_jsx("p", { style: css.done, children: "Signature applied." }))] }));
274
+ }
275
+ /* ------------------------------------------------------------------ looks
276
+
277
+ Inline, so the component brings no stylesheet to load. Colours read CSS
278
+ custom properties first, so an app themes it from its own stylesheet:
279
+ --signsealer-accent, --signsealer-ink, --signsealer-surface,
280
+ --signsealer-border, --signsealer-muted, --signsealer-danger.
281
+ */
282
+ function styles(height) {
283
+ const accent = "var(--signsealer-accent, #1d4ed8)";
284
+ const border = "var(--signsealer-border, #cbd5e1)";
285
+ const surface = "var(--signsealer-surface, #ffffff)";
286
+ const ink = "var(--signsealer-ink, #111827)";
287
+ const muted = "var(--signsealer-muted, #475569)";
288
+ const button = {
289
+ minHeight: 44, minWidth: 44, padding: "0 16px", borderRadius: 8, font: "inherit", fontSize: 16, cursor: "pointer",
290
+ };
291
+ return {
292
+ root: { display: "flex", flexDirection: "column", gap: 12, width: "100%", maxWidth: 640, color: ink, fontFamily: "inherit", boxSizing: "border-box" },
293
+ visuallyHidden: { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap" },
294
+ tabs: { display: "flex", gap: 4, borderBottom: `1px solid ${border}` },
295
+ tab: { ...button, background: "transparent", border: "none", borderBottom: "3px solid transparent", color: muted, borderRadius: 0 },
296
+ tabOn: { color: accent, borderBottom: `3px solid ${accent}`, fontWeight: 600 },
297
+ padWrap: { position: "relative", width: "100%", height, border: `1px solid ${border}`, borderRadius: 8, background: surface, touchAction: "none" },
298
+ canvas: { display: "block", width: "100%", height, touchAction: "none", cursor: "crosshair" },
299
+ baseline: { position: "absolute", left: 16, right: 16, bottom: Math.round(height * 0.25), borderBottom: `1px dashed ${border}`, pointerEvents: "none" },
300
+ hint: { position: "absolute", left: 16, bottom: Math.round(height * 0.25) + 4, color: muted, fontSize: 14, pointerEvents: "none" },
301
+ typeWrap: { display: "flex", flexDirection: "column", gap: 8 },
302
+ label: { fontSize: 14, fontWeight: 600, color: ink, padding: 0 },
303
+ input: { minHeight: 44, padding: "0 12px", fontSize: 16, border: `1px solid ${border}`, borderRadius: 8, background: surface, color: ink, boxSizing: "border-box", width: "100%" },
304
+ fieldset: { border: "none", margin: 0, padding: 0, minWidth: 0 },
305
+ choices: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(min(100%, 220px), 1fr))", gap: 8, marginTop: 8 },
306
+ choice: { display: "flex", alignItems: "center", gap: 10, padding: 10, minHeight: 64, border: `1px solid ${border}`, borderRadius: 8, background: surface, cursor: "pointer", overflow: "hidden" },
307
+ choiceOn: { border: `2px solid ${accent}` },
308
+ radio: { width: 20, height: 20, flex: "none", accentColor: accent },
309
+ savedImg: { maxWidth: "100%", maxHeight: 72, objectFit: "contain" },
310
+ previewWrap: { margin: 0, padding: 12, border: `1px solid ${border}`, borderRadius: 8, background: surface, textAlign: "center" },
311
+ preview: { maxWidth: "100%", maxHeight: height, objectFit: "contain" },
312
+ caption: { fontSize: 14, color: muted, marginTop: 8 },
313
+ statement: { margin: 0, fontSize: 15, lineHeight: 1.5 },
314
+ error: { margin: 0, padding: "8px 12px", borderRadius: 8, color: "var(--signsealer-danger, #b91c1c)", background: "var(--signsealer-danger-surface, #fef2f2)", fontSize: 15 },
315
+ actions: { display: "flex", flexWrap: "wrap", gap: 8, justifyContent: "flex-end" },
316
+ primary: { ...button, background: accent, color: "#fff", border: `1px solid ${accent}`, fontWeight: 600 },
317
+ secondary: { ...button, background: surface, color: ink, border: `1px solid ${border}` },
318
+ done: { margin: 0, fontSize: 16, fontWeight: 600 },
319
+ };
320
+ }
321
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/react.tsx"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,6BAA6B;AAC7B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAkF,MAAM,OAAO,CAAC;AA0DpK,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,oEAAoE;IACpE,0DAA0D;IAC1D,kDAAkD;CACnD,CAAC;AAuCF,MAAM,UAAU,eAAe,CAAC,IAA8E;IAC5G,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;QAClG,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI;KAC1D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAe,EAAE,MAAiB;IAC3D,2EAA2E;IAC3E,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,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AG,EAAE;KACnD,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signsealer/sdk",
3
- "version": "1.13.0",
3
+ "version": "1.19.0",
4
4
  "description": "SignSealer \u2014 signatures with the evidence behind them. Dependency-free client for Node, edge runtimes and the browser.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://signsealer.com/docs",
@@ -16,7 +16,9 @@
16
16
  "esign",
17
17
  "ueta",
18
18
  "contract",
19
- "signsealer"
19
+ "signsealer",
20
+ "react",
21
+ "signature-pad"
20
22
  ],
21
23
  "type": "module",
22
24
  "sideEffects": false,
@@ -39,6 +41,12 @@
39
41
  "require": "./dist/cjs/index.cjs",
40
42
  "default": "./dist/esm/index.js"
41
43
  },
44
+ "./react": {
45
+ "types": "./dist/esm/react.d.ts",
46
+ "import": "./dist/esm/react.js",
47
+ "require": "./dist/cjs/react.cjs",
48
+ "default": "./dist/esm/react.js"
49
+ },
42
50
  "./package.json": "./package.json"
43
51
  },
44
52
  "scripts": {
@@ -47,9 +55,18 @@
47
55
  "prepublishOnly": "npm run build"
48
56
  },
49
57
  "devDependencies": {
58
+ "@types/react": "^19.3.0",
50
59
  "typescript": "^7.0.2"
51
60
  },
52
61
  "publishConfig": {
53
62
  "access": "public"
63
+ },
64
+ "peerDependencies": {
65
+ "react": ">=18"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "react": {
69
+ "optional": true
70
+ }
54
71
  }
55
72
  }