@embedpdf/plugin-signature 2.13.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.
- package/LICENSE +21 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +516 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions.d.ts +14 -0
- package/dist/lib/handlers/signature-ink.handler.d.ts +4 -0
- package/dist/lib/handlers/signature-stamp.handler.d.ts +4 -0
- package/dist/lib/index.d.ts +12 -0
- package/dist/lib/manifest.d.ts +4 -0
- package/dist/lib/reducer.d.ts +5 -0
- package/dist/lib/serialization.d.ts +30 -0
- package/dist/lib/signature-plugin.d.ts +27 -0
- package/dist/lib/tools.d.ts +113 -0
- package/dist/lib/types.d.ts +114 -0
- package/dist/preact/adapter.d.ts +5 -0
- package/dist/preact/annotation.d.ts +1 -0
- package/dist/preact/core.d.ts +1 -0
- package/dist/preact/index.cjs +2 -0
- package/dist/preact/index.cjs.map +1 -0
- package/dist/preact/index.d.ts +1 -0
- package/dist/preact/index.js +464 -0
- package/dist/preact/index.js.map +1 -0
- package/dist/react/adapter.d.ts +2 -0
- package/dist/react/annotation.d.ts +1 -0
- package/dist/react/core.d.ts +1 -0
- package/dist/react/index.cjs +2 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +463 -0
- package/dist/react/index.js.map +1 -0
- package/dist/shared/components/crop-canvas.d.ts +14 -0
- package/dist/shared/components/index.d.ts +2 -0
- package/dist/shared/components/signature-draw-pad.d.ts +12 -0
- package/dist/shared/components/signature-type-pad.d.ts +14 -0
- package/dist/shared/hooks/index.d.ts +2 -0
- package/dist/shared/hooks/use-signature-upload.d.ts +21 -0
- package/dist/shared/hooks/use-signature.d.ts +16 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared-preact/components/crop-canvas.d.ts +14 -0
- package/dist/shared-preact/components/index.d.ts +2 -0
- package/dist/shared-preact/components/signature-draw-pad.d.ts +12 -0
- package/dist/shared-preact/components/signature-type-pad.d.ts +14 -0
- package/dist/shared-preact/hooks/index.d.ts +2 -0
- package/dist/shared-preact/hooks/use-signature-upload.d.ts +21 -0
- package/dist/shared-preact/hooks/use-signature.d.ts +16 -0
- package/dist/shared-preact/index.d.ts +4 -0
- package/dist/shared-react/components/crop-canvas.d.ts +14 -0
- package/dist/shared-react/components/index.d.ts +2 -0
- package/dist/shared-react/components/signature-draw-pad.d.ts +12 -0
- package/dist/shared-react/components/signature-type-pad.d.ts +14 -0
- package/dist/shared-react/hooks/index.d.ts +2 -0
- package/dist/shared-react/hooks/use-signature-upload.d.ts +21 -0
- package/dist/shared-react/hooks/use-signature.d.ts +16 -0
- package/dist/shared-react/index.d.ts +4 -0
- package/dist/shared-vue/components/crop-canvas.d.ts +14 -0
- package/dist/svelte/components/SignatureDrawPad.svelte.d.ts +12 -0
- package/dist/svelte/components/SignatureTypePad.svelte.d.ts +14 -0
- package/dist/svelte/components/index.d.ts +2 -0
- package/dist/svelte/hooks/index.d.ts +2 -0
- package/dist/svelte/hooks/use-signature-upload.svelte.d.ts +21 -0
- package/dist/svelte/hooks/use-signature.svelte.d.ts +17 -0
- package/dist/svelte/index.cjs +2 -0
- package/dist/svelte/index.cjs.map +1 -0
- package/dist/svelte/index.d.ts +4 -0
- package/dist/svelte/index.js +415 -0
- package/dist/svelte/index.js.map +1 -0
- package/dist/vue/components/SignatureDrawPad.vue.d.ts +15 -0
- package/dist/vue/components/SignatureTypePad.vue.d.ts +19 -0
- package/dist/vue/components/index.d.ts +2 -0
- package/dist/vue/hooks/index.d.ts +2 -0
- package/dist/vue/hooks/use-signature-upload.d.ts +20 -0
- package/dist/vue/hooks/use-signature.d.ts +176 -0
- package/dist/vue/index.cjs +2 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.js +453 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
+
import { SignaturePlugin, SignatureCreationType, SignaturePluginPackage as SignaturePluginPackage$1 } from "@embedpdf/plugin-signature";
|
|
3
|
+
export * from "@embedpdf/plugin-signature";
|
|
4
|
+
import { useCapability, usePlugin } from "@embedpdf/core/preact";
|
|
5
|
+
import "preact";
|
|
6
|
+
import { useState, useEffect, useRef, useCallback } from "preact/hooks";
|
|
7
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
8
|
+
const useSignaturePlugin = () => usePlugin(SignaturePlugin.id);
|
|
9
|
+
const useSignatureCapability = () => useCapability(SignaturePlugin.id);
|
|
10
|
+
const useSignatureEntries = () => {
|
|
11
|
+
const { provides } = useSignatureCapability();
|
|
12
|
+
const [entries, setEntries] = useState((provides == null ? void 0 : provides.getEntries()) ?? []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!provides) return;
|
|
15
|
+
setEntries(provides.getEntries());
|
|
16
|
+
return provides.onEntriesChange((updated) => {
|
|
17
|
+
setEntries(updated);
|
|
18
|
+
});
|
|
19
|
+
}, [provides]);
|
|
20
|
+
return { entries, provides };
|
|
21
|
+
};
|
|
22
|
+
const useActivePlacement = (documentId) => {
|
|
23
|
+
const { provides } = useSignatureCapability();
|
|
24
|
+
const [activePlacement, setActivePlacement] = useState(null);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!provides) return;
|
|
27
|
+
const scope = provides.forDocument(documentId);
|
|
28
|
+
setActivePlacement(scope.getActivePlacement());
|
|
29
|
+
return scope.onActivePlacementChange(setActivePlacement);
|
|
30
|
+
}, [provides, documentId]);
|
|
31
|
+
return activePlacement;
|
|
32
|
+
};
|
|
33
|
+
function useSignatureUpload({
|
|
34
|
+
accept = "image/png,image/jpeg,image/svg+xml",
|
|
35
|
+
onResult
|
|
36
|
+
}) {
|
|
37
|
+
const inputRef = useRef(null);
|
|
38
|
+
const [previewUrl, setPreviewUrl] = useState(null);
|
|
39
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
40
|
+
const processFile = useCallback(
|
|
41
|
+
(file) => {
|
|
42
|
+
const reader = new FileReader();
|
|
43
|
+
reader.onload = () => {
|
|
44
|
+
const arrayBuffer = reader.result;
|
|
45
|
+
const blob = new Blob([arrayBuffer], { type: file.type });
|
|
46
|
+
const dataUrl = URL.createObjectURL(blob);
|
|
47
|
+
setPreviewUrl((prev) => {
|
|
48
|
+
if (prev) URL.revokeObjectURL(prev);
|
|
49
|
+
return dataUrl;
|
|
50
|
+
});
|
|
51
|
+
const img = new Image();
|
|
52
|
+
img.onload = () => {
|
|
53
|
+
const previewCanvas = document.createElement("canvas");
|
|
54
|
+
previewCanvas.width = img.width;
|
|
55
|
+
previewCanvas.height = img.height;
|
|
56
|
+
const ctx = previewCanvas.getContext("2d");
|
|
57
|
+
if (ctx) {
|
|
58
|
+
ctx.drawImage(img, 0, 0);
|
|
59
|
+
}
|
|
60
|
+
const result = {
|
|
61
|
+
creationType: SignatureCreationType.Upload,
|
|
62
|
+
imageMimeType: file.type,
|
|
63
|
+
imageSize: { width: img.width, height: img.height },
|
|
64
|
+
previewDataUrl: previewCanvas.toDataURL("image/png"),
|
|
65
|
+
imageData: arrayBuffer
|
|
66
|
+
};
|
|
67
|
+
onResult(result);
|
|
68
|
+
};
|
|
69
|
+
img.src = dataUrl;
|
|
70
|
+
};
|
|
71
|
+
reader.readAsArrayBuffer(file);
|
|
72
|
+
},
|
|
73
|
+
[onResult]
|
|
74
|
+
);
|
|
75
|
+
const handleFileInputChange = useCallback(
|
|
76
|
+
(e) => {
|
|
77
|
+
const files = e.target.files;
|
|
78
|
+
if (files && files[0]) {
|
|
79
|
+
processFile(files[0]);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[processFile]
|
|
83
|
+
);
|
|
84
|
+
const handleDrop = useCallback(
|
|
85
|
+
(e) => {
|
|
86
|
+
var _a;
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
setIsDragging(false);
|
|
89
|
+
const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
|
|
90
|
+
if (files && files[0]) {
|
|
91
|
+
processFile(files[0]);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
[processFile]
|
|
95
|
+
);
|
|
96
|
+
const handleDragOver = useCallback((e) => {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
setIsDragging(true);
|
|
99
|
+
}, []);
|
|
100
|
+
const handleDragLeave = useCallback(() => {
|
|
101
|
+
setIsDragging(false);
|
|
102
|
+
}, []);
|
|
103
|
+
const openFilePicker = useCallback(() => {
|
|
104
|
+
var _a;
|
|
105
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
106
|
+
}, []);
|
|
107
|
+
const clear = useCallback(() => {
|
|
108
|
+
setPreviewUrl((prev) => {
|
|
109
|
+
if (prev) URL.revokeObjectURL(prev);
|
|
110
|
+
return null;
|
|
111
|
+
});
|
|
112
|
+
onResult(null);
|
|
113
|
+
if (inputRef.current) {
|
|
114
|
+
inputRef.current.value = "";
|
|
115
|
+
}
|
|
116
|
+
}, [onResult]);
|
|
117
|
+
return {
|
|
118
|
+
inputRef,
|
|
119
|
+
openFilePicker,
|
|
120
|
+
processFile,
|
|
121
|
+
handleFileInputChange,
|
|
122
|
+
handleDrop,
|
|
123
|
+
handleDragOver,
|
|
124
|
+
handleDragLeave,
|
|
125
|
+
previewUrl,
|
|
126
|
+
isDragging,
|
|
127
|
+
clear,
|
|
128
|
+
accept
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function cropCanvas(source, padding = 4) {
|
|
132
|
+
const ctx = source.getContext("2d");
|
|
133
|
+
if (!ctx) return null;
|
|
134
|
+
const { width, height } = source;
|
|
135
|
+
if (width === 0 || height === 0) return null;
|
|
136
|
+
const imageData = ctx.getImageData(0, 0, width, height);
|
|
137
|
+
const { data } = imageData;
|
|
138
|
+
let minX = width;
|
|
139
|
+
let minY = height;
|
|
140
|
+
let maxX = 0;
|
|
141
|
+
let maxY = 0;
|
|
142
|
+
for (let y = 0; y < height; y++) {
|
|
143
|
+
for (let x = 0; x < width; x++) {
|
|
144
|
+
const alpha = data[(y * width + x) * 4 + 3];
|
|
145
|
+
if (alpha > 0) {
|
|
146
|
+
if (x < minX) minX = x;
|
|
147
|
+
if (x > maxX) maxX = x;
|
|
148
|
+
if (y < minY) minY = y;
|
|
149
|
+
if (y > maxY) maxY = y;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (maxX < minX || maxY < minY) return null;
|
|
154
|
+
const cropX = Math.max(0, minX - padding);
|
|
155
|
+
const cropY = Math.max(0, minY - padding);
|
|
156
|
+
const cropW = Math.min(width, maxX + padding + 1) - cropX;
|
|
157
|
+
const cropH = Math.min(height, maxY + padding + 1) - cropY;
|
|
158
|
+
const cropped = document.createElement("canvas");
|
|
159
|
+
cropped.width = cropW;
|
|
160
|
+
cropped.height = cropH;
|
|
161
|
+
const croppedCtx = cropped.getContext("2d");
|
|
162
|
+
if (!croppedCtx) return null;
|
|
163
|
+
croppedCtx.drawImage(source, cropX, cropY, cropW, cropH, 0, 0, cropW, cropH);
|
|
164
|
+
return {
|
|
165
|
+
canvas: cropped,
|
|
166
|
+
bounds: { x: cropX, y: cropY, width: cropW, height: cropH }
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function SignatureDrawPad({
|
|
170
|
+
onResult,
|
|
171
|
+
padRef,
|
|
172
|
+
strokeColor = "#000000",
|
|
173
|
+
strokeWidth = 4,
|
|
174
|
+
className
|
|
175
|
+
}) {
|
|
176
|
+
const canvasRef = useRef(null);
|
|
177
|
+
const [strokes, setStrokes] = useState([]);
|
|
178
|
+
const isDrawingRef = useRef(false);
|
|
179
|
+
const sizeRef = useRef({ width: 0, height: 0 });
|
|
180
|
+
const strokesRef = useRef(strokes);
|
|
181
|
+
strokesRef.current = strokes;
|
|
182
|
+
const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
|
|
183
|
+
const getCanvasPos = useCallback(
|
|
184
|
+
(e) => {
|
|
185
|
+
const canvas = canvasRef.current;
|
|
186
|
+
if (!canvas) return { x: 0, y: 0 };
|
|
187
|
+
const rect = canvas.getBoundingClientRect();
|
|
188
|
+
return {
|
|
189
|
+
x: (e.clientX - rect.left) * (canvas.width / dpr / rect.width),
|
|
190
|
+
y: (e.clientY - rect.top) * (canvas.height / dpr / rect.height)
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
[dpr]
|
|
194
|
+
);
|
|
195
|
+
const redraw = useCallback(
|
|
196
|
+
(currentStrokes) => {
|
|
197
|
+
const canvas = canvasRef.current;
|
|
198
|
+
if (!canvas) return;
|
|
199
|
+
const ctx = canvas.getContext("2d");
|
|
200
|
+
if (!ctx) return;
|
|
201
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
202
|
+
ctx.save();
|
|
203
|
+
ctx.scale(dpr, dpr);
|
|
204
|
+
ctx.strokeStyle = strokeColor;
|
|
205
|
+
ctx.lineWidth = strokeWidth;
|
|
206
|
+
ctx.lineCap = "round";
|
|
207
|
+
ctx.lineJoin = "round";
|
|
208
|
+
for (const stroke of currentStrokes) {
|
|
209
|
+
if (stroke.points.length === 0) continue;
|
|
210
|
+
ctx.beginPath();
|
|
211
|
+
ctx.moveTo(stroke.points[0].x, stroke.points[0].y);
|
|
212
|
+
for (let i = 1; i < stroke.points.length; i++) {
|
|
213
|
+
ctx.lineTo(stroke.points[i].x, stroke.points[i].y);
|
|
214
|
+
}
|
|
215
|
+
ctx.stroke();
|
|
216
|
+
}
|
|
217
|
+
ctx.restore();
|
|
218
|
+
},
|
|
219
|
+
[dpr, strokeColor, strokeWidth]
|
|
220
|
+
);
|
|
221
|
+
const redrawRef = useRef(redraw);
|
|
222
|
+
redrawRef.current = redraw;
|
|
223
|
+
const emitResult = useCallback(
|
|
224
|
+
(currentStrokes) => {
|
|
225
|
+
if (currentStrokes.length === 0 || currentStrokes.every((s) => s.points.length < 2)) {
|
|
226
|
+
onResult(null);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const canvas = canvasRef.current;
|
|
230
|
+
if (!canvas) return;
|
|
231
|
+
const cropped = cropCanvas(canvas, Math.ceil(strokeWidth * dpr));
|
|
232
|
+
if (!cropped) {
|
|
233
|
+
onResult(null);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const offsetX = cropped.bounds.x / dpr;
|
|
237
|
+
const offsetY = cropped.bounds.y / dpr;
|
|
238
|
+
const croppedWidth = Math.round(cropped.bounds.width / dpr);
|
|
239
|
+
const croppedHeight = Math.round(cropped.bounds.height / dpr);
|
|
240
|
+
const result = {
|
|
241
|
+
creationType: SignatureCreationType.Draw,
|
|
242
|
+
inkData: {
|
|
243
|
+
inkList: currentStrokes.filter((s) => s.points.length >= 2).map((s) => ({
|
|
244
|
+
points: s.points.map((p) => ({
|
|
245
|
+
x: p.x - offsetX,
|
|
246
|
+
y: p.y - offsetY
|
|
247
|
+
}))
|
|
248
|
+
})),
|
|
249
|
+
strokeWidth,
|
|
250
|
+
strokeColor,
|
|
251
|
+
size: { width: croppedWidth, height: croppedHeight }
|
|
252
|
+
},
|
|
253
|
+
previewDataUrl: cropped.canvas.toDataURL("image/png")
|
|
254
|
+
};
|
|
255
|
+
onResult(result);
|
|
256
|
+
},
|
|
257
|
+
[onResult, strokeWidth, strokeColor, dpr]
|
|
258
|
+
);
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
const canvas = canvasRef.current;
|
|
261
|
+
if (!canvas) return;
|
|
262
|
+
const observer = new ResizeObserver((entries) => {
|
|
263
|
+
const { width: w, height: h } = entries[0].contentRect;
|
|
264
|
+
if (w > 0 && h > 0) {
|
|
265
|
+
sizeRef.current = { width: Math.round(w), height: Math.round(h) };
|
|
266
|
+
canvas.width = Math.round(w) * dpr;
|
|
267
|
+
canvas.height = Math.round(h) * dpr;
|
|
268
|
+
redrawRef.current(strokesRef.current);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
observer.observe(canvas);
|
|
272
|
+
return () => observer.disconnect();
|
|
273
|
+
}, [dpr]);
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
redraw(strokes);
|
|
276
|
+
if (strokes.length > 0 && strokes.some((s) => s.points.length >= 2)) {
|
|
277
|
+
emitResult(strokes);
|
|
278
|
+
}
|
|
279
|
+
}, [strokeColor, strokeWidth]);
|
|
280
|
+
const handleClear = useCallback(() => {
|
|
281
|
+
setStrokes([]);
|
|
282
|
+
redraw([]);
|
|
283
|
+
onResult(null);
|
|
284
|
+
}, [redraw, onResult]);
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
padRef == null ? void 0 : padRef({ clear: handleClear });
|
|
287
|
+
return () => padRef == null ? void 0 : padRef(null);
|
|
288
|
+
}, [padRef, handleClear]);
|
|
289
|
+
const handlePointerDown = useCallback(
|
|
290
|
+
(e) => {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
isDrawingRef.current = true;
|
|
293
|
+
const pos = getCanvasPos(e);
|
|
294
|
+
const newStrokes = [...strokes, { points: [pos] }];
|
|
295
|
+
setStrokes(newStrokes);
|
|
296
|
+
redraw(newStrokes);
|
|
297
|
+
(_b = (_a = e.target) == null ? void 0 : _a.setPointerCapture) == null ? void 0 : _b.call(_a, e.pointerId);
|
|
298
|
+
},
|
|
299
|
+
[strokes, getCanvasPos, redraw]
|
|
300
|
+
);
|
|
301
|
+
const handlePointerMove = useCallback(
|
|
302
|
+
(e) => {
|
|
303
|
+
if (!isDrawingRef.current) return;
|
|
304
|
+
const pos = getCanvasPos(e);
|
|
305
|
+
const newStrokes = [...strokes];
|
|
306
|
+
const last = newStrokes[newStrokes.length - 1];
|
|
307
|
+
if (last) {
|
|
308
|
+
last.points.push(pos);
|
|
309
|
+
setStrokes(newStrokes);
|
|
310
|
+
redraw(newStrokes);
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
[strokes, getCanvasPos, redraw]
|
|
314
|
+
);
|
|
315
|
+
const handlePointerUp = useCallback(
|
|
316
|
+
(e) => {
|
|
317
|
+
var _a, _b;
|
|
318
|
+
isDrawingRef.current = false;
|
|
319
|
+
(_b = (_a = e.target) == null ? void 0 : _a.releasePointerCapture) == null ? void 0 : _b.call(_a, e.pointerId);
|
|
320
|
+
emitResult(strokes);
|
|
321
|
+
},
|
|
322
|
+
[strokes, emitResult]
|
|
323
|
+
);
|
|
324
|
+
return /* @__PURE__ */ jsx(
|
|
325
|
+
"canvas",
|
|
326
|
+
{
|
|
327
|
+
ref: canvasRef,
|
|
328
|
+
className,
|
|
329
|
+
style: { touchAction: "none", width: "100%", height: "100%", display: "block" },
|
|
330
|
+
onPointerDown: handlePointerDown,
|
|
331
|
+
onPointerMove: handlePointerMove,
|
|
332
|
+
onPointerUp: handlePointerUp
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
function SignatureTypePad({
|
|
337
|
+
onResult,
|
|
338
|
+
padRef,
|
|
339
|
+
fontFamily = "'Dancing Script', cursive",
|
|
340
|
+
fontSize = 48,
|
|
341
|
+
color = "#000000",
|
|
342
|
+
className,
|
|
343
|
+
placeholder = "Type your signature..."
|
|
344
|
+
}) {
|
|
345
|
+
const canvasRef = useRef(null);
|
|
346
|
+
const wrapperRef = useRef(null);
|
|
347
|
+
const inputId = useRef(`sig-type-${Math.random().toString(36).slice(2, 8)}`).current;
|
|
348
|
+
const sizeRef = useRef({ width: 0, height: 0 });
|
|
349
|
+
const [text, setText] = useState("");
|
|
350
|
+
const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
|
|
351
|
+
const renderText = useCallback(
|
|
352
|
+
(currentText) => {
|
|
353
|
+
const canvas = canvasRef.current;
|
|
354
|
+
if (!canvas) return;
|
|
355
|
+
const { width, height } = sizeRef.current;
|
|
356
|
+
if (width === 0 || height === 0) return;
|
|
357
|
+
canvas.width = width * dpr;
|
|
358
|
+
canvas.height = height * dpr;
|
|
359
|
+
const ctx = canvas.getContext("2d");
|
|
360
|
+
if (!ctx) return;
|
|
361
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
362
|
+
if (!currentText.trim()) {
|
|
363
|
+
onResult(null);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
ctx.scale(dpr, dpr);
|
|
367
|
+
ctx.fillStyle = color;
|
|
368
|
+
ctx.font = `${fontSize}px ${fontFamily}`;
|
|
369
|
+
ctx.textBaseline = "middle";
|
|
370
|
+
ctx.textAlign = "center";
|
|
371
|
+
ctx.fillText(currentText, width / 2, height / 2, width - 20);
|
|
372
|
+
const cropped = cropCanvas(canvas, Math.ceil(4 * dpr));
|
|
373
|
+
if (!cropped) {
|
|
374
|
+
onResult(null);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const croppedWidth = Math.round(cropped.bounds.width / dpr);
|
|
378
|
+
const croppedHeight = Math.round(cropped.bounds.height / dpr);
|
|
379
|
+
cropped.canvas.toBlob((blob) => {
|
|
380
|
+
if (!blob) return;
|
|
381
|
+
blob.arrayBuffer().then((imageData) => {
|
|
382
|
+
const result = {
|
|
383
|
+
creationType: SignatureCreationType.Type,
|
|
384
|
+
label: currentText,
|
|
385
|
+
imageMimeType: "image/png",
|
|
386
|
+
imageSize: { width: croppedWidth, height: croppedHeight },
|
|
387
|
+
previewDataUrl: cropped.canvas.toDataURL("image/png"),
|
|
388
|
+
imageData
|
|
389
|
+
};
|
|
390
|
+
onResult(result);
|
|
391
|
+
});
|
|
392
|
+
}, "image/png");
|
|
393
|
+
},
|
|
394
|
+
[onResult, color, fontSize, fontFamily, dpr]
|
|
395
|
+
);
|
|
396
|
+
const renderTextRef = useRef(renderText);
|
|
397
|
+
renderTextRef.current = renderText;
|
|
398
|
+
const textRef = useRef(text);
|
|
399
|
+
textRef.current = text;
|
|
400
|
+
useEffect(() => {
|
|
401
|
+
const wrapper = wrapperRef.current;
|
|
402
|
+
if (!wrapper) return;
|
|
403
|
+
const observer = new ResizeObserver((entries) => {
|
|
404
|
+
const { width: w, height: h } = entries[0].contentRect;
|
|
405
|
+
if (w > 0 && h > 0) {
|
|
406
|
+
sizeRef.current = { width: Math.round(w), height: Math.round(h) };
|
|
407
|
+
renderTextRef.current(textRef.current);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
observer.observe(wrapper);
|
|
411
|
+
return () => observer.disconnect();
|
|
412
|
+
}, []);
|
|
413
|
+
useEffect(() => {
|
|
414
|
+
renderText(text);
|
|
415
|
+
}, [text, fontFamily, renderText]);
|
|
416
|
+
const handleClear = useCallback(() => {
|
|
417
|
+
setText("");
|
|
418
|
+
onResult(null);
|
|
419
|
+
}, [onResult]);
|
|
420
|
+
useEffect(() => {
|
|
421
|
+
padRef == null ? void 0 : padRef({ clear: handleClear });
|
|
422
|
+
return () => padRef == null ? void 0 : padRef(null);
|
|
423
|
+
}, [padRef, handleClear]);
|
|
424
|
+
const handleTextChange = useCallback((e) => {
|
|
425
|
+
setText(e.target.value);
|
|
426
|
+
}, []);
|
|
427
|
+
return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, className, style: { width: "100%", height: "100%" }, children: [
|
|
428
|
+
/* @__PURE__ */ jsx("style", { children: `#${inputId}::placeholder { color: ${color}; opacity: 0.5; }` }),
|
|
429
|
+
/* @__PURE__ */ jsx(
|
|
430
|
+
"input",
|
|
431
|
+
{
|
|
432
|
+
id: inputId,
|
|
433
|
+
type: "text",
|
|
434
|
+
value: text,
|
|
435
|
+
onInput: handleTextChange,
|
|
436
|
+
placeholder,
|
|
437
|
+
style: {
|
|
438
|
+
fontFamily,
|
|
439
|
+
fontSize: `${Math.min(fontSize, 32)}px`,
|
|
440
|
+
color,
|
|
441
|
+
width: "100%",
|
|
442
|
+
height: "100%",
|
|
443
|
+
border: "none",
|
|
444
|
+
outline: "none",
|
|
445
|
+
background: "transparent",
|
|
446
|
+
textIndent: "8px"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, style: { display: "none" } })
|
|
451
|
+
] });
|
|
452
|
+
}
|
|
453
|
+
const SignaturePluginPackage = createPluginPackage(SignaturePluginPackage$1).build();
|
|
454
|
+
export {
|
|
455
|
+
SignatureDrawPad,
|
|
456
|
+
SignaturePluginPackage,
|
|
457
|
+
SignatureTypePad,
|
|
458
|
+
useActivePlacement,
|
|
459
|
+
useSignatureCapability,
|
|
460
|
+
useSignatureEntries,
|
|
461
|
+
useSignaturePlugin,
|
|
462
|
+
useSignatureUpload
|
|
463
|
+
};
|
|
464
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-signature.ts","../../src/shared/hooks/use-signature-upload.ts","../../src/shared/components/crop-canvas.ts","../../src/shared/components/signature-draw-pad.tsx","../../src/shared/components/signature-type-pad.tsx","../../src/shared/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { SignaturePlugin, SignatureEntry, ActivePlacementInfo } from '@embedpdf/plugin-signature';\nimport { useState, useEffect } from '@framework';\n\nexport const useSignaturePlugin = () => usePlugin<SignaturePlugin>(SignaturePlugin.id);\nexport const useSignatureCapability = () => useCapability<SignaturePlugin>(SignaturePlugin.id);\n\nexport const useSignatureEntries = () => {\n const { provides } = useSignatureCapability();\n const [entries, setEntries] = useState<SignatureEntry[]>(provides?.getEntries() ?? []);\n\n useEffect(() => {\n if (!provides) return;\n setEntries(provides.getEntries());\n return provides.onEntriesChange((updated) => {\n setEntries(updated);\n });\n }, [provides]);\n\n return { entries, provides };\n};\n\nexport const useActivePlacement = (documentId: string) => {\n const { provides } = useSignatureCapability();\n const [activePlacement, setActivePlacement] = useState<ActivePlacementInfo | null>(null);\n\n useEffect(() => {\n if (!provides) return;\n const scope = provides.forDocument(documentId);\n setActivePlacement(scope.getActivePlacement());\n return scope.onActivePlacementChange(setActivePlacement);\n }, [provides, documentId]);\n\n return activePlacement;\n};\n","import { useRef, useState, useCallback } from '@framework';\nimport { SignatureStampFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\n\nexport interface UseSignatureUploadOptions {\n accept?: string;\n onResult: (result: SignatureStampFieldDefinition | null) => void;\n}\n\nexport interface UseSignatureUploadReturn {\n inputRef: { current: HTMLInputElement | null };\n openFilePicker: () => void;\n processFile: (file: File) => void;\n handleFileInputChange: (e: Event) => void;\n handleDrop: (e: DragEvent) => void;\n handleDragOver: (e: DragEvent) => void;\n handleDragLeave: () => void;\n previewUrl: string | null;\n isDragging: boolean;\n clear: () => void;\n accept: string;\n}\n\nexport function useSignatureUpload({\n accept = 'image/png,image/jpeg,image/svg+xml',\n onResult,\n}: UseSignatureUploadOptions): UseSignatureUploadReturn {\n const inputRef = useRef<HTMLInputElement>(null);\n const [previewUrl, setPreviewUrl] = useState<string | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n\n const processFile = useCallback(\n (file: File) => {\n const reader = new FileReader();\n reader.onload = () => {\n const arrayBuffer = reader.result as ArrayBuffer;\n const blob = new Blob([arrayBuffer], { type: file.type });\n const dataUrl = URL.createObjectURL(blob);\n\n setPreviewUrl((prev) => {\n if (prev) URL.revokeObjectURL(prev);\n return dataUrl;\n });\n\n const img = new Image();\n img.onload = () => {\n const previewCanvas = document.createElement('canvas');\n previewCanvas.width = img.width;\n previewCanvas.height = img.height;\n const ctx = previewCanvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0);\n }\n\n const result: SignatureStampFieldDefinition = {\n creationType: SignatureCreationType.Upload,\n imageMimeType: file.type,\n imageSize: { width: img.width, height: img.height },\n previewDataUrl: previewCanvas.toDataURL('image/png'),\n imageData: arrayBuffer,\n };\n onResult(result);\n };\n img.src = dataUrl;\n };\n reader.readAsArrayBuffer(file);\n },\n [onResult],\n );\n\n const handleFileInputChange = useCallback(\n (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files && files[0]) {\n processFile(files[0]);\n }\n },\n [processFile],\n );\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault();\n setIsDragging(false);\n const files = e.dataTransfer?.files;\n if (files && files[0]) {\n processFile(files[0]);\n }\n },\n [processFile],\n );\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n setIsDragging(true);\n }, []);\n\n const handleDragLeave = useCallback(() => {\n setIsDragging(false);\n }, []);\n\n const openFilePicker = useCallback(() => {\n inputRef.current?.click();\n }, []);\n\n const clear = useCallback(() => {\n setPreviewUrl((prev) => {\n if (prev) URL.revokeObjectURL(prev);\n return null;\n });\n onResult(null);\n if (inputRef.current) {\n inputRef.current.value = '';\n }\n }, [onResult]);\n\n return {\n inputRef,\n openFilePicker,\n processFile,\n handleFileInputChange,\n handleDrop,\n handleDragOver,\n handleDragLeave,\n previewUrl,\n isDragging,\n clear,\n accept,\n };\n}\n","export interface CropResult {\n canvas: HTMLCanvasElement;\n bounds: { x: number; y: number; width: number; height: number };\n}\n\n/**\n * Scans a canvas for non-transparent pixels and returns a tightly cropped copy.\n * Returns null if the canvas has no visible content.\n */\nexport function cropCanvas(source: HTMLCanvasElement, padding = 4): CropResult | null {\n const ctx = source.getContext('2d');\n if (!ctx) return null;\n\n const { width, height } = source;\n if (width === 0 || height === 0) return null;\n\n const imageData = ctx.getImageData(0, 0, width, height);\n const { data } = imageData;\n\n let minX = width;\n let minY = height;\n let maxX = 0;\n let maxY = 0;\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const alpha = data[(y * width + x) * 4 + 3];\n if (alpha > 0) {\n if (x < minX) minX = x;\n if (x > maxX) maxX = x;\n if (y < minY) minY = y;\n if (y > maxY) maxY = y;\n }\n }\n }\n\n if (maxX < minX || maxY < minY) return null;\n\n const cropX = Math.max(0, minX - padding);\n const cropY = Math.max(0, minY - padding);\n const cropW = Math.min(width, maxX + padding + 1) - cropX;\n const cropH = Math.min(height, maxY + padding + 1) - cropY;\n\n const cropped = document.createElement('canvas');\n cropped.width = cropW;\n cropped.height = cropH;\n\n const croppedCtx = cropped.getContext('2d');\n if (!croppedCtx) return null;\n\n croppedCtx.drawImage(source, cropX, cropY, cropW, cropH, 0, 0, cropW, cropH);\n\n return {\n canvas: cropped,\n bounds: { x: cropX, y: cropY, width: cropW, height: cropH },\n };\n}\n","import { useEffect, useRef, useState, useCallback } from '@framework';\nimport { SignatureInkFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\nimport { cropCanvas } from './crop-canvas';\n\nexport interface SignatureDrawPadHandle {\n clear(): void;\n}\n\nexport interface SignatureDrawPadProps {\n onResult: (result: SignatureInkFieldDefinition | null) => void;\n padRef?: (handle: SignatureDrawPadHandle | null) => void;\n strokeColor?: string;\n strokeWidth?: number;\n className?: string;\n}\n\nexport function SignatureDrawPad({\n onResult,\n padRef,\n strokeColor = '#000000',\n strokeWidth = 4,\n className,\n}: SignatureDrawPadProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [strokes, setStrokes] = useState<Array<{ points: Array<{ x: number; y: number }> }>>([]);\n const isDrawingRef = useRef(false);\n const sizeRef = useRef({ width: 0, height: 0 });\n const strokesRef = useRef(strokes);\n strokesRef.current = strokes;\n const dpr = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n\n const getCanvasPos = useCallback(\n (e: PointerEvent): { x: number; y: number } => {\n const canvas = canvasRef.current;\n if (!canvas) return { x: 0, y: 0 };\n const rect = canvas.getBoundingClientRect();\n return {\n x: (e.clientX - rect.left) * (canvas.width / dpr / rect.width),\n y: (e.clientY - rect.top) * (canvas.height / dpr / rect.height),\n };\n },\n [dpr],\n );\n\n const redraw = useCallback(\n (currentStrokes: Array<{ points: Array<{ x: number; y: number }> }>) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.scale(dpr, dpr);\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = strokeWidth;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n\n for (const stroke of currentStrokes) {\n if (stroke.points.length === 0) continue;\n ctx.beginPath();\n ctx.moveTo(stroke.points[0].x, stroke.points[0].y);\n for (let i = 1; i < stroke.points.length; i++) {\n ctx.lineTo(stroke.points[i].x, stroke.points[i].y);\n }\n ctx.stroke();\n }\n ctx.restore();\n },\n [dpr, strokeColor, strokeWidth],\n );\n\n const redrawRef = useRef(redraw);\n redrawRef.current = redraw;\n\n const emitResult = useCallback(\n (currentStrokes: Array<{ points: Array<{ x: number; y: number }> }>) => {\n if (currentStrokes.length === 0 || currentStrokes.every((s) => s.points.length < 2)) {\n onResult(null);\n return;\n }\n\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const cropped = cropCanvas(canvas, Math.ceil(strokeWidth * dpr));\n if (!cropped) {\n onResult(null);\n return;\n }\n\n const offsetX = cropped.bounds.x / dpr;\n const offsetY = cropped.bounds.y / dpr;\n const croppedWidth = Math.round(cropped.bounds.width / dpr);\n const croppedHeight = Math.round(cropped.bounds.height / dpr);\n\n const result: SignatureInkFieldDefinition = {\n creationType: SignatureCreationType.Draw,\n inkData: {\n inkList: currentStrokes\n .filter((s) => s.points.length >= 2)\n .map((s) => ({\n points: s.points.map((p) => ({\n x: p.x - offsetX,\n y: p.y - offsetY,\n })),\n })),\n strokeWidth,\n strokeColor,\n size: { width: croppedWidth, height: croppedHeight },\n },\n previewDataUrl: cropped.canvas.toDataURL('image/png'),\n };\n\n onResult(result);\n },\n [onResult, strokeWidth, strokeColor, dpr],\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const observer = new ResizeObserver((entries) => {\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n sizeRef.current = { width: Math.round(w), height: Math.round(h) };\n canvas.width = Math.round(w) * dpr;\n canvas.height = Math.round(h) * dpr;\n redrawRef.current(strokesRef.current);\n }\n });\n observer.observe(canvas);\n return () => observer.disconnect();\n }, [dpr]);\n\n useEffect(() => {\n redraw(strokes);\n if (strokes.length > 0 && strokes.some((s) => s.points.length >= 2)) {\n emitResult(strokes);\n }\n }, [strokeColor, strokeWidth]);\n\n const handleClear = useCallback(() => {\n setStrokes([]);\n redraw([]);\n onResult(null);\n }, [redraw, onResult]);\n\n useEffect(() => {\n padRef?.({ clear: handleClear });\n return () => padRef?.(null);\n }, [padRef, handleClear]);\n\n const handlePointerDown = useCallback(\n (e: PointerEvent) => {\n isDrawingRef.current = true;\n const pos = getCanvasPos(e);\n const newStrokes = [...strokes, { points: [pos] }];\n setStrokes(newStrokes);\n redraw(newStrokes);\n (e.target as HTMLElement)?.setPointerCapture?.(e.pointerId);\n },\n [strokes, getCanvasPos, redraw],\n );\n\n const handlePointerMove = useCallback(\n (e: PointerEvent) => {\n if (!isDrawingRef.current) return;\n const pos = getCanvasPos(e);\n const newStrokes = [...strokes];\n const last = newStrokes[newStrokes.length - 1];\n if (last) {\n last.points.push(pos);\n setStrokes(newStrokes);\n redraw(newStrokes);\n }\n },\n [strokes, getCanvasPos, redraw],\n );\n\n const handlePointerUp = useCallback(\n (e: PointerEvent) => {\n isDrawingRef.current = false;\n (e.target as HTMLElement)?.releasePointerCapture?.(e.pointerId);\n emitResult(strokes);\n },\n [strokes, emitResult],\n );\n\n return (\n <canvas\n ref={canvasRef}\n className={className}\n style={{ touchAction: 'none', width: '100%', height: '100%', display: 'block' }}\n onPointerDown={handlePointerDown as any}\n onPointerMove={handlePointerMove as any}\n onPointerUp={handlePointerUp as any}\n />\n );\n}\n","import { useEffect, useRef, useState, useCallback } from '@framework';\nimport { SignatureStampFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\nimport { cropCanvas } from './crop-canvas';\n\nexport interface SignatureTypePadHandle {\n clear(): void;\n}\n\nexport interface SignatureTypePadProps {\n onResult: (result: SignatureStampFieldDefinition | null) => void;\n padRef?: (handle: SignatureTypePadHandle | null) => void;\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n className?: string;\n placeholder?: string;\n}\n\nexport function SignatureTypePad({\n onResult,\n padRef,\n fontFamily = \"'Dancing Script', cursive\",\n fontSize = 48,\n color = '#000000',\n className,\n placeholder = 'Type your signature...',\n}: SignatureTypePadProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const inputId = useRef(`sig-type-${Math.random().toString(36).slice(2, 8)}`).current;\n const sizeRef = useRef({ width: 0, height: 0 });\n const [text, setText] = useState('');\n const dpr = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n\n const renderText = useCallback(\n (currentText: string) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const { width, height } = sizeRef.current;\n if (width === 0 || height === 0) return;\n\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (!currentText.trim()) {\n onResult(null);\n return;\n }\n\n ctx.scale(dpr, dpr);\n ctx.fillStyle = color;\n ctx.font = `${fontSize}px ${fontFamily}`;\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n ctx.fillText(currentText, width / 2, height / 2, width - 20);\n\n const cropped = cropCanvas(canvas, Math.ceil(4 * dpr));\n if (!cropped) {\n onResult(null);\n return;\n }\n\n const croppedWidth = Math.round(cropped.bounds.width / dpr);\n const croppedHeight = Math.round(cropped.bounds.height / dpr);\n\n cropped.canvas.toBlob((blob) => {\n if (!blob) return;\n blob.arrayBuffer().then((imageData) => {\n const result: SignatureStampFieldDefinition = {\n creationType: SignatureCreationType.Type,\n label: currentText,\n imageMimeType: 'image/png',\n imageSize: { width: croppedWidth, height: croppedHeight },\n previewDataUrl: cropped.canvas.toDataURL('image/png'),\n imageData,\n };\n onResult(result);\n });\n }, 'image/png');\n },\n [onResult, color, fontSize, fontFamily, dpr],\n );\n\n const renderTextRef = useRef(renderText);\n renderTextRef.current = renderText;\n const textRef = useRef(text);\n textRef.current = text;\n\n useEffect(() => {\n const wrapper = wrapperRef.current;\n if (!wrapper) return;\n const observer = new ResizeObserver((entries) => {\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n sizeRef.current = { width: Math.round(w), height: Math.round(h) };\n renderTextRef.current(textRef.current);\n }\n });\n observer.observe(wrapper);\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n renderText(text);\n }, [text, fontFamily, renderText]);\n\n const handleClear = useCallback(() => {\n setText('');\n onResult(null);\n }, [onResult]);\n\n useEffect(() => {\n padRef?.({ clear: handleClear });\n return () => padRef?.(null);\n }, [padRef, handleClear]);\n\n const handleTextChange = useCallback((e: Event) => {\n setText((e.target as HTMLInputElement).value);\n }, []);\n\n return (\n <div ref={wrapperRef} className={className} style={{ width: '100%', height: '100%' }}>\n <style>{`#${inputId}::placeholder { color: ${color}; opacity: 0.5; }`}</style>\n <input\n id={inputId}\n type=\"text\"\n value={text}\n onInput={handleTextChange as any}\n placeholder={placeholder}\n style={{\n fontFamily,\n fontSize: `${Math.min(fontSize, 32)}px`,\n color,\n width: '100%',\n height: '100%',\n border: 'none',\n outline: 'none',\n background: 'transparent',\n textIndent: '8px',\n }}\n />\n <canvas ref={canvasRef} style={{ display: 'none' }} />\n </div>\n );\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { SignaturePluginPackage as BaseSignaturePackage } from '@embedpdf/plugin-signature';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-signature';\n\nexport const SignaturePluginPackage = createPluginPackage(BaseSignaturePackage).build();\n"],"names":["BaseSignaturePackage"],"mappings":";;;;;;;AAIO,MAAM,qBAAqB,MAAM,UAA2B,gBAAgB,EAAE;AAC9E,MAAM,yBAAyB,MAAM,cAA+B,gBAAgB,EAAE;AAEtF,MAAM,sBAAsB,MAAM;AACvC,QAAM,EAAE,SAAA,IAAa,uBAAA;AACrB,QA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AC;AAEjC,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ,EAAE;AACV,aAAS,IAAI;AAAA,EACf,GAAG,CAAC,QAAQ,CAAC;AAEb,YAAU,MAAM;AACd,qCAAS,EAAE,OAAO;AAClB,WAAO,MAAM,iCAAS;AAAA,EACxB,GAAG,CAAC,QAAQ,WAAW,CAAC;AAExB,QAAM,mBAAmB,YAAY,CAAC,MAAa;AACjD,YAAS,EAAE,OAA4B,KAAK;AAAA,EAC9C,GAAG,CAAA,CAAE;AAEL,SACE,qBAAC,OAAA,EAAI,KAAK,YAAY,WAAsB,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,GAC1E,UAAA;AAAA,IAAA,oBAAC,SAAA,EAAO,UAAA,IAAI,OAAO,0BAA0B,KAAK,qBAAoB;AAAA,IACtE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,QACJ,MAAK;AAAA,QACL,OAAO;AAAA,QACP,SAAS;AAAA,QACT;AAAA,QACA,OAAO;AAAA,UACL;AAAA,UACA,UAAU,GAAG,KAAK,IAAI,UAAU,EAAE,CAAC;AAAA,UACnC;AAAA,UACA,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,YAAY;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,IAEF,oBAAC,YAAO,KAAK,WAAW,OAAO,EAAE,SAAS,SAAO,CAAG;AAAA,EAAA,GACtD;AAEJ;AC/IO,MAAM,yBAAyB,oBAAoBA,wBAAoB,EAAE,MAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@embedpdf/plugin-annotation/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@embedpdf/core/react';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-signature"),n=require("@embedpdf/core/react"),r=require("react"),i=require("react/jsx-runtime"),a=()=>n.useCapability(t.SignaturePlugin.id);function o(e,t=4){const n=e.getContext("2d");if(!n)return null;const{width:r,height:i}=e;if(0===r||0===i)return null;const a=n.getImageData(0,0,r,i),{data:o}=a;let l=r,u=i,s=0,c=0;for(let m=0;m<i;m++)for(let e=0;e<r;e++){o[4*(m*r+e)+3]>0&&(e<l&&(l=e),e>s&&(s=e),m<u&&(u=m),m>c&&(c=m))}if(s<l||c<u)return null;const d=Math.max(0,l-t),h=Math.max(0,u-t),g=Math.min(r,s+t+1)-d,p=Math.min(i,c+t+1)-h,f=document.createElement("canvas");f.width=g,f.height=p;const v=f.getContext("2d");return v?(v.drawImage(e,d,h,g,p,0,0,g,p),{canvas:f,bounds:{x:d,y:h,width:g,height:p}}):null}const l=e.createPluginPackage(t.SignaturePluginPackage).build();exports.SignatureDrawPad=function({onResult:e,padRef:n,strokeColor:a="#000000",strokeWidth:l=4,className:u}){const s=r.useRef(null),[c,d]=r.useState([]),h=r.useRef(!1),g=r.useRef({width:0,height:0}),p=r.useRef(c);p.current=c;const f="undefined"!=typeof window&&window.devicePixelRatio||1,v=r.useCallback(e=>{const t=s.current;if(!t)return{x:0,y:0};const n=t.getBoundingClientRect();return{x:(e.clientX-n.left)*(t.width/f/n.width),y:(e.clientY-n.top)*(t.height/f/n.height)}},[f]),m=r.useCallback(e=>{const t=s.current;if(!t)return;const n=t.getContext("2d");if(n){n.clearRect(0,0,t.width,t.height),n.save(),n.scale(f,f),n.strokeStyle=a,n.lineWidth=l,n.lineCap="round",n.lineJoin="round";for(const t of e)if(0!==t.points.length){n.beginPath(),n.moveTo(t.points[0].x,t.points[0].y);for(let e=1;e<t.points.length;e++)n.lineTo(t.points[e].x,t.points[e].y);n.stroke()}n.restore()}},[f,a,l]),b=r.useRef(m);b.current=m;const w=r.useCallback(n=>{if(0===n.length||n.every(e=>e.points.length<2))return void e(null);const r=s.current;if(!r)return;const i=o(r,Math.ceil(l*f));if(!i)return void e(null);const u=i.bounds.x/f,c=i.bounds.y/f,d=Math.round(i.bounds.width/f),h=Math.round(i.bounds.height/f),g={creationType:t.SignatureCreationType.Draw,inkData:{inkList:n.filter(e=>e.points.length>=2).map(e=>({points:e.points.map(e=>({x:e.x-u,y:e.y-c}))})),strokeWidth:l,strokeColor:a,size:{width:d,height:h}},previewDataUrl:i.canvas.toDataURL("image/png")};e(g)},[e,l,a,f]);r.useEffect(()=>{const e=s.current;if(!e)return;const t=new ResizeObserver(t=>{const{width:n,height:r}=t[0].contentRect;n>0&&r>0&&(g.current={width:Math.round(n),height:Math.round(r)},e.width=Math.round(n)*f,e.height=Math.round(r)*f,b.current(p.current))});return t.observe(e),()=>t.disconnect()},[f]),r.useEffect(()=>{m(c),c.length>0&&c.some(e=>e.points.length>=2)&&w(c)},[a,l]);const y=r.useCallback(()=>{d([]),m([]),e(null)},[m,e]);r.useEffect(()=>(null==n||n({clear:y}),()=>null==n?void 0:n(null)),[n,y]);const x=r.useCallback(e=>{var t,n;h.current=!0;const r=v(e),i=[...c,{points:[r]}];d(i),m(i),null==(n=null==(t=e.target)?void 0:t.setPointerCapture)||n.call(t,e.pointerId)},[c,v,m]),R=r.useCallback(e=>{if(!h.current)return;const t=v(e),n=[...c],r=n[n.length-1];r&&(r.points.push(t),d(n),m(n))},[c,v,m]),C=r.useCallback(e=>{var t,n;h.current=!1,null==(n=null==(t=e.target)?void 0:t.releasePointerCapture)||n.call(t,e.pointerId),w(c)},[c,w]);return i.jsx("canvas",{ref:s,className:u,style:{touchAction:"none",width:"100%",height:"100%",display:"block"},onPointerDown:x,onPointerMove:R,onPointerUp:C})},exports.SignaturePluginPackage=l,exports.SignatureTypePad=function({onResult:e,padRef:n,fontFamily:a="'Dancing Script', cursive",fontSize:l=48,color:u="#000000",className:s,placeholder:c="Type your signature..."}){const d=r.useRef(null),h=r.useRef(null),g=r.useRef(`sig-type-${Math.random().toString(36).slice(2,8)}`).current,p=r.useRef({width:0,height:0}),[f,v]=r.useState(""),m="undefined"!=typeof window&&window.devicePixelRatio||1,b=r.useCallback(n=>{const r=d.current;if(!r)return;const{width:i,height:s}=p.current;if(0===i||0===s)return;r.width=i*m,r.height=s*m;const c=r.getContext("2d");if(!c)return;if(c.clearRect(0,0,r.width,r.height),!n.trim())return void e(null);c.scale(m,m),c.fillStyle=u,c.font=`${l}px ${a}`,c.textBaseline="middle",c.textAlign="center",c.fillText(n,i/2,s/2,i-20);const h=o(r,Math.ceil(4*m));if(!h)return void e(null);const g=Math.round(h.bounds.width/m),f=Math.round(h.bounds.height/m);h.canvas.toBlob(r=>{r&&r.arrayBuffer().then(r=>{const i={creationType:t.SignatureCreationType.Type,label:n,imageMimeType:"image/png",imageSize:{width:g,height:f},previewDataUrl:h.canvas.toDataURL("image/png"),imageData:r};e(i)})},"image/png")},[e,u,l,a,m]),w=r.useRef(b);w.current=b;const y=r.useRef(f);y.current=f,r.useEffect(()=>{const e=h.current;if(!e)return;const t=new ResizeObserver(e=>{const{width:t,height:n}=e[0].contentRect;t>0&&n>0&&(p.current={width:Math.round(t),height:Math.round(n)},w.current(y.current))});return t.observe(e),()=>t.disconnect()},[]),r.useEffect(()=>{b(f)},[f,a,b]);const x=r.useCallback(()=>{v(""),e(null)},[e]);r.useEffect(()=>(null==n||n({clear:x}),()=>null==n?void 0:n(null)),[n,x]);const R=r.useCallback(e=>{v(e.target.value)},[]);return i.jsxs("div",{ref:h,className:s,style:{width:"100%",height:"100%"},children:[i.jsx("style",{children:`#${g}::placeholder { color: ${u}; opacity: 0.5; }`}),i.jsx("input",{id:g,type:"text",value:f,onInput:R,placeholder:c,style:{fontFamily:a,fontSize:`${Math.min(l,32)}px`,color:u,width:"100%",height:"100%",border:"none",outline:"none",background:"transparent",textIndent:"8px"}}),i.jsx("canvas",{ref:d,style:{display:"none"}})]})},exports.useActivePlacement=e=>{const{provides:t}=a(),[n,i]=r.useState(null);return r.useEffect(()=>{if(!t)return;const n=t.forDocument(e);return i(n.getActivePlacement()),n.onActivePlacementChange(i)},[t,e]),n},exports.useSignatureCapability=a,exports.useSignatureEntries=()=>{const{provides:e}=a(),[t,n]=r.useState((null==e?void 0:e.getEntries())??[]);return r.useEffect(()=>{if(e)return n(e.getEntries()),e.onEntriesChange(e=>{n(e)})},[e]),{entries:t,provides:e}},exports.useSignaturePlugin=()=>n.usePlugin(t.SignaturePlugin.id),exports.useSignatureUpload=function({accept:e="image/png,image/jpeg,image/svg+xml",onResult:n}){const i=r.useRef(null),[a,o]=r.useState(null),[l,u]=r.useState(!1),s=r.useCallback(e=>{const r=new FileReader;r.onload=()=>{const i=r.result,a=new Blob([i],{type:e.type}),l=URL.createObjectURL(a);o(e=>(e&&URL.revokeObjectURL(e),l));const u=new Image;u.onload=()=>{const r=document.createElement("canvas");r.width=u.width,r.height=u.height;const a=r.getContext("2d");a&&a.drawImage(u,0,0);const o={creationType:t.SignatureCreationType.Upload,imageMimeType:e.type,imageSize:{width:u.width,height:u.height},previewDataUrl:r.toDataURL("image/png"),imageData:i};n(o)},u.src=l},r.readAsArrayBuffer(e)},[n]),c=r.useCallback(e=>{const t=e.target.files;t&&t[0]&&s(t[0])},[s]),d=r.useCallback(e=>{var t;e.preventDefault(),u(!1);const n=null==(t=e.dataTransfer)?void 0:t.files;n&&n[0]&&s(n[0])},[s]),h=r.useCallback(e=>{e.preventDefault(),u(!0)},[]),g=r.useCallback(()=>{u(!1)},[]),p=r.useCallback(()=>{var e;null==(e=i.current)||e.click()},[]),f=r.useCallback(()=>{o(e=>(e&&URL.revokeObjectURL(e),null)),n(null),i.current&&(i.current.value="")},[n]);return{inputRef:i,openFilePicker:p,processFile:s,handleFileInputChange:c,handleDrop:d,handleDragOver:h,handleDragLeave:g,previewUrl:a,isDragging:l,clear:f,accept:e}},Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-signature.ts","../../src/shared/components/crop-canvas.ts","../../src/shared/index.ts","../../src/shared/components/signature-draw-pad.tsx","../../src/shared/components/signature-type-pad.tsx","../../src/shared/hooks/use-signature-upload.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { SignaturePlugin, SignatureEntry, ActivePlacementInfo } from '@embedpdf/plugin-signature';\nimport { useState, useEffect } from '@framework';\n\nexport const useSignaturePlugin = () => usePlugin<SignaturePlugin>(SignaturePlugin.id);\nexport const useSignatureCapability = () => useCapability<SignaturePlugin>(SignaturePlugin.id);\n\nexport const useSignatureEntries = () => {\n const { provides } = useSignatureCapability();\n const [entries, setEntries] = useState<SignatureEntry[]>(provides?.getEntries() ?? []);\n\n useEffect(() => {\n if (!provides) return;\n setEntries(provides.getEntries());\n return provides.onEntriesChange((updated) => {\n setEntries(updated);\n });\n }, [provides]);\n\n return { entries, provides };\n};\n\nexport const useActivePlacement = (documentId: string) => {\n const { provides } = useSignatureCapability();\n const [activePlacement, setActivePlacement] = useState<ActivePlacementInfo | null>(null);\n\n useEffect(() => {\n if (!provides) return;\n const scope = provides.forDocument(documentId);\n setActivePlacement(scope.getActivePlacement());\n return scope.onActivePlacementChange(setActivePlacement);\n }, [provides, documentId]);\n\n return activePlacement;\n};\n","export interface CropResult {\n canvas: HTMLCanvasElement;\n bounds: { x: number; y: number; width: number; height: number };\n}\n\n/**\n * Scans a canvas for non-transparent pixels and returns a tightly cropped copy.\n * Returns null if the canvas has no visible content.\n */\nexport function cropCanvas(source: HTMLCanvasElement, padding = 4): CropResult | null {\n const ctx = source.getContext('2d');\n if (!ctx) return null;\n\n const { width, height } = source;\n if (width === 0 || height === 0) return null;\n\n const imageData = ctx.getImageData(0, 0, width, height);\n const { data } = imageData;\n\n let minX = width;\n let minY = height;\n let maxX = 0;\n let maxY = 0;\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const alpha = data[(y * width + x) * 4 + 3];\n if (alpha > 0) {\n if (x < minX) minX = x;\n if (x > maxX) maxX = x;\n if (y < minY) minY = y;\n if (y > maxY) maxY = y;\n }\n }\n }\n\n if (maxX < minX || maxY < minY) return null;\n\n const cropX = Math.max(0, minX - padding);\n const cropY = Math.max(0, minY - padding);\n const cropW = Math.min(width, maxX + padding + 1) - cropX;\n const cropH = Math.min(height, maxY + padding + 1) - cropY;\n\n const cropped = document.createElement('canvas');\n cropped.width = cropW;\n cropped.height = cropH;\n\n const croppedCtx = cropped.getContext('2d');\n if (!croppedCtx) return null;\n\n croppedCtx.drawImage(source, cropX, cropY, cropW, cropH, 0, 0, cropW, cropH);\n\n return {\n canvas: cropped,\n bounds: { x: cropX, y: cropY, width: cropW, height: cropH },\n };\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { SignaturePluginPackage as BaseSignaturePackage } from '@embedpdf/plugin-signature';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-signature';\n\nexport const SignaturePluginPackage = createPluginPackage(BaseSignaturePackage).build();\n","import { useEffect, useRef, useState, useCallback } from '@framework';\nimport { SignatureInkFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\nimport { cropCanvas } from './crop-canvas';\n\nexport interface SignatureDrawPadHandle {\n clear(): void;\n}\n\nexport interface SignatureDrawPadProps {\n onResult: (result: SignatureInkFieldDefinition | null) => void;\n padRef?: (handle: SignatureDrawPadHandle | null) => void;\n strokeColor?: string;\n strokeWidth?: number;\n className?: string;\n}\n\nexport function SignatureDrawPad({\n onResult,\n padRef,\n strokeColor = '#000000',\n strokeWidth = 4,\n className,\n}: SignatureDrawPadProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [strokes, setStrokes] = useState<Array<{ points: Array<{ x: number; y: number }> }>>([]);\n const isDrawingRef = useRef(false);\n const sizeRef = useRef({ width: 0, height: 0 });\n const strokesRef = useRef(strokes);\n strokesRef.current = strokes;\n const dpr = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n\n const getCanvasPos = useCallback(\n (e: PointerEvent): { x: number; y: number } => {\n const canvas = canvasRef.current;\n if (!canvas) return { x: 0, y: 0 };\n const rect = canvas.getBoundingClientRect();\n return {\n x: (e.clientX - rect.left) * (canvas.width / dpr / rect.width),\n y: (e.clientY - rect.top) * (canvas.height / dpr / rect.height),\n };\n },\n [dpr],\n );\n\n const redraw = useCallback(\n (currentStrokes: Array<{ points: Array<{ x: number; y: number }> }>) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.scale(dpr, dpr);\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = strokeWidth;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n\n for (const stroke of currentStrokes) {\n if (stroke.points.length === 0) continue;\n ctx.beginPath();\n ctx.moveTo(stroke.points[0].x, stroke.points[0].y);\n for (let i = 1; i < stroke.points.length; i++) {\n ctx.lineTo(stroke.points[i].x, stroke.points[i].y);\n }\n ctx.stroke();\n }\n ctx.restore();\n },\n [dpr, strokeColor, strokeWidth],\n );\n\n const redrawRef = useRef(redraw);\n redrawRef.current = redraw;\n\n const emitResult = useCallback(\n (currentStrokes: Array<{ points: Array<{ x: number; y: number }> }>) => {\n if (currentStrokes.length === 0 || currentStrokes.every((s) => s.points.length < 2)) {\n onResult(null);\n return;\n }\n\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const cropped = cropCanvas(canvas, Math.ceil(strokeWidth * dpr));\n if (!cropped) {\n onResult(null);\n return;\n }\n\n const offsetX = cropped.bounds.x / dpr;\n const offsetY = cropped.bounds.y / dpr;\n const croppedWidth = Math.round(cropped.bounds.width / dpr);\n const croppedHeight = Math.round(cropped.bounds.height / dpr);\n\n const result: SignatureInkFieldDefinition = {\n creationType: SignatureCreationType.Draw,\n inkData: {\n inkList: currentStrokes\n .filter((s) => s.points.length >= 2)\n .map((s) => ({\n points: s.points.map((p) => ({\n x: p.x - offsetX,\n y: p.y - offsetY,\n })),\n })),\n strokeWidth,\n strokeColor,\n size: { width: croppedWidth, height: croppedHeight },\n },\n previewDataUrl: cropped.canvas.toDataURL('image/png'),\n };\n\n onResult(result);\n },\n [onResult, strokeWidth, strokeColor, dpr],\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const observer = new ResizeObserver((entries) => {\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n sizeRef.current = { width: Math.round(w), height: Math.round(h) };\n canvas.width = Math.round(w) * dpr;\n canvas.height = Math.round(h) * dpr;\n redrawRef.current(strokesRef.current);\n }\n });\n observer.observe(canvas);\n return () => observer.disconnect();\n }, [dpr]);\n\n useEffect(() => {\n redraw(strokes);\n if (strokes.length > 0 && strokes.some((s) => s.points.length >= 2)) {\n emitResult(strokes);\n }\n }, [strokeColor, strokeWidth]);\n\n const handleClear = useCallback(() => {\n setStrokes([]);\n redraw([]);\n onResult(null);\n }, [redraw, onResult]);\n\n useEffect(() => {\n padRef?.({ clear: handleClear });\n return () => padRef?.(null);\n }, [padRef, handleClear]);\n\n const handlePointerDown = useCallback(\n (e: PointerEvent) => {\n isDrawingRef.current = true;\n const pos = getCanvasPos(e);\n const newStrokes = [...strokes, { points: [pos] }];\n setStrokes(newStrokes);\n redraw(newStrokes);\n (e.target as HTMLElement)?.setPointerCapture?.(e.pointerId);\n },\n [strokes, getCanvasPos, redraw],\n );\n\n const handlePointerMove = useCallback(\n (e: PointerEvent) => {\n if (!isDrawingRef.current) return;\n const pos = getCanvasPos(e);\n const newStrokes = [...strokes];\n const last = newStrokes[newStrokes.length - 1];\n if (last) {\n last.points.push(pos);\n setStrokes(newStrokes);\n redraw(newStrokes);\n }\n },\n [strokes, getCanvasPos, redraw],\n );\n\n const handlePointerUp = useCallback(\n (e: PointerEvent) => {\n isDrawingRef.current = false;\n (e.target as HTMLElement)?.releasePointerCapture?.(e.pointerId);\n emitResult(strokes);\n },\n [strokes, emitResult],\n );\n\n return (\n <canvas\n ref={canvasRef}\n className={className}\n style={{ touchAction: 'none', width: '100%', height: '100%', display: 'block' }}\n onPointerDown={handlePointerDown as any}\n onPointerMove={handlePointerMove as any}\n onPointerUp={handlePointerUp as any}\n />\n );\n}\n","import { useEffect, useRef, useState, useCallback } from '@framework';\nimport { SignatureStampFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\nimport { cropCanvas } from './crop-canvas';\n\nexport interface SignatureTypePadHandle {\n clear(): void;\n}\n\nexport interface SignatureTypePadProps {\n onResult: (result: SignatureStampFieldDefinition | null) => void;\n padRef?: (handle: SignatureTypePadHandle | null) => void;\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n className?: string;\n placeholder?: string;\n}\n\nexport function SignatureTypePad({\n onResult,\n padRef,\n fontFamily = \"'Dancing Script', cursive\",\n fontSize = 48,\n color = '#000000',\n className,\n placeholder = 'Type your signature...',\n}: SignatureTypePadProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const inputId = useRef(`sig-type-${Math.random().toString(36).slice(2, 8)}`).current;\n const sizeRef = useRef({ width: 0, height: 0 });\n const [text, setText] = useState('');\n const dpr = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n\n const renderText = useCallback(\n (currentText: string) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const { width, height } = sizeRef.current;\n if (width === 0 || height === 0) return;\n\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (!currentText.trim()) {\n onResult(null);\n return;\n }\n\n ctx.scale(dpr, dpr);\n ctx.fillStyle = color;\n ctx.font = `${fontSize}px ${fontFamily}`;\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n ctx.fillText(currentText, width / 2, height / 2, width - 20);\n\n const cropped = cropCanvas(canvas, Math.ceil(4 * dpr));\n if (!cropped) {\n onResult(null);\n return;\n }\n\n const croppedWidth = Math.round(cropped.bounds.width / dpr);\n const croppedHeight = Math.round(cropped.bounds.height / dpr);\n\n cropped.canvas.toBlob((blob) => {\n if (!blob) return;\n blob.arrayBuffer().then((imageData) => {\n const result: SignatureStampFieldDefinition = {\n creationType: SignatureCreationType.Type,\n label: currentText,\n imageMimeType: 'image/png',\n imageSize: { width: croppedWidth, height: croppedHeight },\n previewDataUrl: cropped.canvas.toDataURL('image/png'),\n imageData,\n };\n onResult(result);\n });\n }, 'image/png');\n },\n [onResult, color, fontSize, fontFamily, dpr],\n );\n\n const renderTextRef = useRef(renderText);\n renderTextRef.current = renderText;\n const textRef = useRef(text);\n textRef.current = text;\n\n useEffect(() => {\n const wrapper = wrapperRef.current;\n if (!wrapper) return;\n const observer = new ResizeObserver((entries) => {\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n sizeRef.current = { width: Math.round(w), height: Math.round(h) };\n renderTextRef.current(textRef.current);\n }\n });\n observer.observe(wrapper);\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n renderText(text);\n }, [text, fontFamily, renderText]);\n\n const handleClear = useCallback(() => {\n setText('');\n onResult(null);\n }, [onResult]);\n\n useEffect(() => {\n padRef?.({ clear: handleClear });\n return () => padRef?.(null);\n }, [padRef, handleClear]);\n\n const handleTextChange = useCallback((e: Event) => {\n setText((e.target as HTMLInputElement).value);\n }, []);\n\n return (\n <div ref={wrapperRef} className={className} style={{ width: '100%', height: '100%' }}>\n <style>{`#${inputId}::placeholder { color: ${color}; opacity: 0.5; }`}</style>\n <input\n id={inputId}\n type=\"text\"\n value={text}\n onInput={handleTextChange as any}\n placeholder={placeholder}\n style={{\n fontFamily,\n fontSize: `${Math.min(fontSize, 32)}px`,\n color,\n width: '100%',\n height: '100%',\n border: 'none',\n outline: 'none',\n background: 'transparent',\n textIndent: '8px',\n }}\n />\n <canvas ref={canvasRef} style={{ display: 'none' }} />\n </div>\n );\n}\n","import { useRef, useState, useCallback } from '@framework';\nimport { SignatureStampFieldDefinition, SignatureCreationType } from '@embedpdf/plugin-signature';\n\nexport interface UseSignatureUploadOptions {\n accept?: string;\n onResult: (result: SignatureStampFieldDefinition | null) => void;\n}\n\nexport interface UseSignatureUploadReturn {\n inputRef: { current: HTMLInputElement | null };\n openFilePicker: () => void;\n processFile: (file: File) => void;\n handleFileInputChange: (e: Event) => void;\n handleDrop: (e: DragEvent) => void;\n handleDragOver: (e: DragEvent) => void;\n handleDragLeave: () => void;\n previewUrl: string | null;\n isDragging: boolean;\n clear: () => void;\n accept: string;\n}\n\nexport function useSignatureUpload({\n accept = 'image/png,image/jpeg,image/svg+xml',\n onResult,\n}: UseSignatureUploadOptions): UseSignatureUploadReturn {\n const inputRef = useRef<HTMLInputElement>(null);\n const [previewUrl, setPreviewUrl] = useState<string | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n\n const processFile = useCallback(\n (file: File) => {\n const reader = new FileReader();\n reader.onload = () => {\n const arrayBuffer = reader.result as ArrayBuffer;\n const blob = new Blob([arrayBuffer], { type: file.type });\n const dataUrl = URL.createObjectURL(blob);\n\n setPreviewUrl((prev) => {\n if (prev) URL.revokeObjectURL(prev);\n return dataUrl;\n });\n\n const img = new Image();\n img.onload = () => {\n const previewCanvas = document.createElement('canvas');\n previewCanvas.width = img.width;\n previewCanvas.height = img.height;\n const ctx = previewCanvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0);\n }\n\n const result: SignatureStampFieldDefinition = {\n creationType: SignatureCreationType.Upload,\n imageMimeType: file.type,\n imageSize: { width: img.width, height: img.height },\n previewDataUrl: previewCanvas.toDataURL('image/png'),\n imageData: arrayBuffer,\n };\n onResult(result);\n };\n img.src = dataUrl;\n };\n reader.readAsArrayBuffer(file);\n },\n [onResult],\n );\n\n const handleFileInputChange = useCallback(\n (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files && files[0]) {\n processFile(files[0]);\n }\n },\n [processFile],\n );\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault();\n setIsDragging(false);\n const files = e.dataTransfer?.files;\n if (files && files[0]) {\n processFile(files[0]);\n }\n },\n [processFile],\n );\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n setIsDragging(true);\n }, []);\n\n const handleDragLeave = useCallback(() => {\n setIsDragging(false);\n }, []);\n\n const openFilePicker = useCallback(() => {\n inputRef.current?.click();\n }, []);\n\n const clear = useCallback(() => {\n setPreviewUrl((prev) => {\n if (prev) URL.revokeObjectURL(prev);\n return null;\n });\n onResult(null);\n if (inputRef.current) {\n inputRef.current.value = '';\n }\n }, [onResult]);\n\n return {\n inputRef,\n openFilePicker,\n processFile,\n handleFileInputChange,\n handleDrop,\n handleDragOver,\n handleDragLeave,\n previewUrl,\n isDragging,\n clear,\n accept,\n };\n}\n"],"names":["useSignatureCapability","useCapability","SignaturePlugin","id","cropCanvas","source","padding","ctx","getContext","width","height","imageData","getImageData","data","minX","minY","maxX","maxY","y","x","cropX","Math","max","cropY","cropW","min","cropH","cropped","document","createElement","croppedCtx","drawImage","canvas","bounds","SignaturePluginPackage","createPluginPackage","BaseSignaturePackage","build","onResult","padRef","strokeColor","strokeWidth","className","canvasRef","useRef","strokes","setStrokes","useState","isDrawingRef","sizeRef","strokesRef","current","dpr","window","devicePixelRatio","getCanvasPos","useCallback","e","rect","getBoundingClientRect","clientX","left","clientY","top","redraw","currentStrokes","clearRect","save","scale","strokeStyle","lineWidth","lineCap","lineJoin","stroke","points","length","beginPath","moveTo","i","lineTo","restore","redrawRef","emitResult","every","s","ceil","offsetX","offsetY","croppedWidth","round","croppedHeight","result","creationType","SignatureCreationType","Draw","inkData","inkList","filter","map","p","size","previewDataUrl","toDataURL","useEffect","observer","ResizeObserver","entries","w","h","contentRect","observe","disconnect","some","handleClear","clear","handlePointerDown","pos","newStrokes","_b","_a","target","setPointerCapture","call","pointerId","handlePointerMove","last","push","handlePointerUp","releasePointerCapture","jsx","ref","style","touchAction","display","onPointerDown","onPointerMove","onPointerUp","fontFamily","fontSize","color","placeholder","wrapperRef","inputId","random","toString","slice","text","setText","renderText","currentText","trim","fillStyle","font","textBaseline","textAlign","fillText","toBlob","blob","arrayBuffer","then","Type","label","imageMimeType","imageSize","renderTextRef","textRef","wrapper","handleTextChange","value","jsxs","children","type","onInput","border","outline","background","textIndent","documentId","provides","activePlacement","setActivePlacement","scope","forDocument","getActivePlacement","onActivePlacementChange","setEntries","getEntries","onEntriesChange","updated","usePlugin","accept","inputRef","previewUrl","setPreviewUrl","isDragging","setIsDragging","processFile","file","reader","FileReader","onload","Blob","dataUrl","URL","createObjectURL","prev","revokeObjectURL","img","Image","previewCanvas","Upload","src","readAsArrayBuffer","handleFileInputChange","files","handleDrop","preventDefault","dataTransfer","handleDragOver","handleDragLeave","openFilePicker","click"],"mappings":"8OAKaA,EAAyB,IAAMC,gBAA+BC,EAAAA,gBAAgBC,ICIpF,SAASC,EAAWC,EAA2BC,EAAU,GAC9D,MAAMC,EAAMF,EAAOG,WAAW,MAC9B,IAAKD,EAAK,OAAO,KAEjB,MAAME,MAAEA,EAAAC,OAAOA,GAAWL,EAC1B,GAAc,IAAVI,GAA0B,IAAXC,EAAc,OAAO,KAExC,MAAMC,EAAYJ,EAAIK,aAAa,EAAG,EAAGH,EAAOC,IAC1CG,KAAEA,GAASF,EAEjB,IAAIG,EAAOL,EACPM,EAAOL,EACPM,EAAO,EACPC,EAAO,EAEX,IAAA,IAASC,EAAI,EAAGA,EAAIR,EAAQQ,IAC1B,IAAA,IAASC,EAAI,EAAGA,EAAIV,EAAOU,IAAK,CAChBN,EAAuB,GAAjBK,EAAIT,EAAQU,GAAS,GAC7B,IACNA,EAAIL,IAAMA,EAAOK,GACjBA,EAAIH,IAAMA,EAAOG,GACjBD,EAAIH,IAAMA,EAAOG,GACjBA,EAAID,IAAMA,EAA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