@superdoc-dev/esign 1.4.2 → 2.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,24 +1,29 @@
1
- import { jsxs as x, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as le, useState as v, useRef as b, useEffect as F, useCallback as y, useImperativeHandle as de } from "react";
3
- const ue = ({
4
- value: d,
5
- onChange: m,
6
- isDisabled: c,
7
- label: s
8
- }) => /* @__PURE__ */ x(
1
+ import { jsxs as b, jsx as d } from "react/jsx-runtime";
2
+ import { forwardRef as ye, useState as v, useRef as C, useEffect as A, useCallback as D, useImperativeHandle as ve } from "react";
3
+ const be = (u) => {
4
+ const l = globalThis.document.createElement("canvas"), s = l.getContext("2d"), o = 30;
5
+ s.font = `italic ${o}px cursive`;
6
+ const a = s.measureText(u).width, m = o * 1.3, p = 4, R = 6;
7
+ return l.width = Math.ceil(a + p * 2) + 20, l.height = Math.ceil(m + R * 2), s.font = `italic ${o}px cursive`, s.fillStyle = "black", s.textAlign = "center", s.textBaseline = "middle", s.fillText(u, l.width / 2, l.height / 2), l.toDataURL("image/png");
8
+ }, xe = ({
9
+ value: u,
10
+ onChange: l,
11
+ isDisabled: s,
12
+ label: o
13
+ }) => /* @__PURE__ */ b(
9
14
  "div",
10
15
  {
11
16
  className: "superdoc-esign-signature-input",
12
17
  style: { display: "flex", flexDirection: "column", gap: "8px" },
13
18
  children: [
14
- s && /* @__PURE__ */ a("label", { children: s }),
15
- /* @__PURE__ */ a(
19
+ o && /* @__PURE__ */ d("label", { children: o }),
20
+ /* @__PURE__ */ d(
16
21
  "input",
17
22
  {
18
23
  type: "text",
19
- value: String(d || ""),
20
- onChange: (r) => m(r.target.value),
21
- disabled: c,
24
+ value: String(u || ""),
25
+ onChange: (r) => l(r.target.value),
26
+ disabled: s,
22
27
  placeholder: "Type your full name",
23
28
  style: {
24
29
  fontFamily: "cursive",
@@ -28,323 +33,401 @@ const ue = ({
28
33
  )
29
34
  ]
30
35
  }
31
- ), pe = ({
32
- value: d,
33
- onChange: m,
34
- isDisabled: c,
35
- label: s
36
- }) => /* @__PURE__ */ x("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
37
- /* @__PURE__ */ a(
36
+ ), we = ({
37
+ value: u,
38
+ onChange: l,
39
+ isDisabled: s,
40
+ label: o
41
+ }) => /* @__PURE__ */ b("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
42
+ /* @__PURE__ */ d(
38
43
  "input",
39
44
  {
40
45
  type: "checkbox",
41
- checked: !!d,
42
- onChange: (r) => m(r.target.checked),
43
- disabled: c
46
+ checked: !!u,
47
+ onChange: (r) => l(r.target.checked),
48
+ disabled: s
44
49
  }
45
50
  ),
46
- /* @__PURE__ */ a("span", { children: s })
47
- ] }), me = (d) => ({ onClick: c, fileName: s, isDisabled: r }) => {
48
- const u = d?.label || "Download";
49
- return /* @__PURE__ */ x(
51
+ /* @__PURE__ */ d("span", { children: o })
52
+ ] }), Se = (u) => ({
53
+ onClick: s,
54
+ fileName: o,
55
+ isDisabled: r,
56
+ isDownloading: a
57
+ }) => {
58
+ const m = u?.label || "Download", p = r || a;
59
+ return /* @__PURE__ */ b(
50
60
  "button",
51
61
  {
52
- onClick: c,
53
- disabled: r,
54
- className: "superdoc-esign-btn superdoc-esign-btn--download",
62
+ onClick: s,
63
+ disabled: p,
64
+ className: `superdoc-esign-btn superdoc-esign-btn--download${a ? " superdoc-esign-btn--loading" : ""}`,
55
65
  style: {
56
66
  padding: "8px 16px",
57
67
  borderRadius: "6px",
58
68
  border: "1px solid #d0d5dd",
59
69
  background: "#ffffff",
60
70
  color: "#333",
61
- cursor: r ? "not-allowed" : "pointer",
62
- opacity: r ? 0.5 : 1,
71
+ cursor: p ? "not-allowed" : "pointer",
72
+ opacity: p ? 0.7 : 1,
63
73
  fontSize: "16px",
64
- fontWeight: "bold"
74
+ fontWeight: "bold",
75
+ display: "inline-flex",
76
+ alignItems: "center",
77
+ gap: "8px",
78
+ transition: "opacity 0.2s ease"
65
79
  },
66
80
  children: [
67
- u,
68
- " ",
69
- s && `(${s})`
81
+ a && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner" }),
82
+ a ? "Downloading..." : m,
83
+ !a && o && ` (${o})`
70
84
  ]
71
85
  }
72
86
  );
73
- }, ge = (d) => ({
74
- onClick: c,
75
- isValid: s,
87
+ }, Ce = (u) => ({
88
+ onClick: s,
89
+ isValid: o,
76
90
  isDisabled: r,
77
- isSubmitting: u
78
- }) => /* @__PURE__ */ a(
79
- "button",
80
- {
81
- onClick: c,
82
- disabled: !s || r || u,
83
- className: "superdoc-esign-btn superdoc-esign-btn--submit",
84
- style: {
85
- padding: "12px 24px",
86
- borderRadius: "6px",
87
- border: "none",
88
- background: "#007bff",
89
- color: "#fff",
90
- cursor: !s || r ? "not-allowed" : "pointer",
91
- opacity: !s || r ? 0.5 : 1,
92
- fontSize: "16px",
93
- fontWeight: "bold"
94
- },
95
- children: d?.label || "Submit"
96
- }
97
- ), fe = le(
98
- (d, m) => {
91
+ isSubmitting: a
92
+ }) => {
93
+ const m = u?.label || "Submit", p = !o || r || a;
94
+ return /* @__PURE__ */ b(
95
+ "button",
96
+ {
97
+ onClick: s,
98
+ disabled: p,
99
+ className: `superdoc-esign-btn superdoc-esign-btn--submit${a ? " superdoc-esign-btn--loading" : ""}`,
100
+ style: {
101
+ padding: "12px 24px",
102
+ borderRadius: "6px",
103
+ border: "none",
104
+ background: "#007bff",
105
+ color: "#fff",
106
+ cursor: p ? "not-allowed" : "pointer",
107
+ opacity: p && !a ? 0.5 : 1,
108
+ fontSize: "16px",
109
+ fontWeight: "bold",
110
+ display: "inline-flex",
111
+ alignItems: "center",
112
+ gap: "8px",
113
+ transition: "opacity 0.2s ease"
114
+ },
115
+ children: [
116
+ a && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
117
+ a ? "Submitting..." : m
118
+ ]
119
+ }
120
+ );
121
+ }, De = ye(
122
+ (u, l) => {
99
123
  const {
100
- eventId: c,
101
- document: s,
124
+ eventId: s,
125
+ document: o,
102
126
  fields: r = {},
103
- download: u,
104
- submit: R,
105
- onSubmit: k,
106
- onDownload: M,
107
- onStateChange: A,
108
- onFieldChange: I,
109
- onFieldsDiscovered: q,
110
- isDisabled: g = !1,
111
- className: P,
112
- style: K,
113
- documentHeight: X = "600px"
114
- } = d, [S, B] = v(!s.validation?.scroll?.required), [l, _] = v(/* @__PURE__ */ new Map()), [w, U] = v(!1), [f, V] = v(!1), [H, L] = v([]), [z, Y] = v(!1), N = b(null), T = b(null), G = b(Date.now()), h = b(r), C = b([]), O = b(q);
115
- h.current = r, O.current = q, F(() => {
116
- C.current = H;
117
- }, [H]);
118
- const E = y((e) => {
119
- if (!T.current?.activeEditor) return;
120
- const t = T.current.activeEditor, n = h.current.signer?.find((o) => o.id === e.id);
121
- let i;
122
- n?.type === "signature" && e.value ? i = {
127
+ download: a,
128
+ submit: m,
129
+ onSubmit: p,
130
+ onDownload: R,
131
+ onStateChange: _,
132
+ onFieldChange: z,
133
+ onFieldsDiscovered: U,
134
+ isDisabled: f = !1,
135
+ className: te,
136
+ style: ne,
137
+ documentHeight: oe = "600px"
138
+ } = u, [x, $] = v(!o.validation?.scroll?.required), [g, H] = v(/* @__PURE__ */ new Map()), [w, O] = v(!1), [h, j] = v(!1), [q, P] = v(!1), [W, L] = v([]), [K, re] = v(!1), k = C(null), F = C(null), se = C(Date.now()), S = C(r), M = C([]), X = C(U);
139
+ S.current = r, X.current = U, A(() => {
140
+ M.current = W;
141
+ }, [W]);
142
+ const y = D((e) => {
143
+ if (!F.current?.activeEditor) return;
144
+ const t = F.current.activeEditor, i = S.current.signer?.find((n) => n.id === e.id);
145
+ if (e.type === "table" && Array.isArray(e.value)) {
146
+ const T = t.helpers?.structuredContentCommands?.getStructuredContentTablesById?.(e.id, t.state) || [];
147
+ if (T.length) {
148
+ const { node: B, pos: me } = T[0], Q = B.childCount;
149
+ if (Q > 1) {
150
+ let E = t.state.tr;
151
+ for (let I = Q - 1; I >= 1; I--) {
152
+ let Z = 1;
153
+ for (let V = 0; V < I; V++)
154
+ Z += B.child(V).nodeSize;
155
+ const fe = B.child(I), ee = me + Z, he = ee + fe.nodeSize;
156
+ E = E.delete(E.mapping.map(ee), E.mapping.map(he));
157
+ }
158
+ t.view?.dispatch(E);
159
+ }
160
+ t.commands?.appendRowsToStructuredContentTable?.({
161
+ id: e.id,
162
+ rows: e.value,
163
+ copyRowStyle: !0
164
+ });
165
+ }
166
+ return;
167
+ }
168
+ let c;
169
+ i?.type === "signature" && e.value ? c = {
123
170
  json: {
124
171
  type: "image",
125
- attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : J(String(e.value)), alt: "Signature" }
172
+ attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : be(String(e.value)), alt: "Signature" }
126
173
  }
127
- } : i = { text: String(e.value ?? "") }, e.id && t.commands.updateStructuredContentById(e.id, i);
128
- }, []);
129
- function J(e) {
130
- const t = globalThis.document.createElement("canvas"), n = t.getContext("2d"), i = 30;
131
- n.font = `italic ${i}px cursive`;
132
- const p = n.measureText(e).width, ie = i * 1.3, ae = 4, ce = 6;
133
- return t.width = Math.ceil(p + ae * 2) + 20, t.height = Math.ceil(ie + ce * 2), n.font = `italic ${i}px cursive`, n.fillStyle = "black", n.textAlign = "center", n.textBaseline = "middle", n.fillText(e, t.width / 2, t.height / 2), t.toDataURL("image/png");
134
- }
135
- const W = y(
174
+ } : c = { text: String(e.value ?? "") }, e.id && t.commands?.updateStructuredContentById?.(e.id, c);
175
+ }, []), Y = D(
136
176
  (e) => {
137
177
  if (!e) return;
138
178
  const t = e.helpers.structuredContentCommands.getStructuredContentTags(
139
179
  e.state
140
- ), n = /* @__PURE__ */ new Map();
141
- h.current.document?.forEach((o) => {
142
- o.id && n.set(o.id, o.value);
143
- }), h.current.signer?.forEach((o) => {
144
- o.value !== void 0 && n.set(o.id, o.value);
180
+ ), i = /* @__PURE__ */ new Map();
181
+ S.current.document?.forEach((n) => {
182
+ n.id && i.set(n.id, n.value);
183
+ }), S.current.signer?.forEach((n) => {
184
+ n.value !== void 0 && i.set(n.id, n.value);
145
185
  });
146
- const i = t.map(({ node: o }) => ({
147
- id: o.attrs.id,
148
- label: o.attrs.label,
149
- value: n.get(o.attrs.id) ?? o.textContent ?? ""
150
- })).filter((o) => o.id);
151
- i.length > 0 && (O.current?.(i), [
152
- ...h.current.document || [],
153
- ...h.current.signer || []
154
- ].filter((p) => p.value !== void 0).forEach(
155
- (p) => E({
156
- id: p.id,
157
- value: p.value
186
+ const c = t.map(({ node: n }) => ({
187
+ id: n.attrs.id,
188
+ label: n.attrs.label,
189
+ value: i.get(n.attrs.id) ?? n.textContent ?? ""
190
+ })).filter((n) => n.id);
191
+ c.length > 0 && (X.current?.(c), (S.current.document || []).filter((n) => n.value !== void 0).forEach(
192
+ (n) => y({
193
+ id: n.id,
194
+ value: n.value,
195
+ type: n.type
196
+ })
197
+ ), (S.current.signer || []).filter((n) => n.value !== void 0).forEach(
198
+ (n) => y({
199
+ id: n.id,
200
+ value: n.value
158
201
  })
159
202
  ));
160
203
  },
161
- [E]
162
- ), D = (e) => {
204
+ [y]
205
+ ), N = (e) => {
163
206
  const t = {
164
207
  ...e,
165
208
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
166
- }, n = globalThis?.__SUPERDOC_AUDIT_MOCK__;
167
- n && n(t);
168
- const i = [...C.current, t];
169
- return C.current = i, L(i), i;
209
+ }, i = globalThis?.__SUPERDOC_AUDIT_MOCK__;
210
+ i && i(t);
211
+ const c = [...M.current, t];
212
+ return M.current = c, L(c), c;
170
213
  };
171
- F(() => {
172
- if (!N.current) return;
214
+ A(() => {
215
+ if (!k.current) return;
173
216
  let e = !1, t = null;
174
217
  return (async () => {
175
- const { SuperDoc: i } = await import("superdoc");
176
- e || (t = new i({
177
- selector: N.current,
178
- document: s.source,
218
+ const { SuperDoc: c } = await import("superdoc");
219
+ e || (t = new c({
220
+ selector: k.current,
221
+ document: o.source,
179
222
  documentMode: "viewing",
180
223
  modules: {
181
224
  comments: !1
182
225
  },
226
+ // @ts-expect-error - layoutMode is not supported in SuperDoc v1.1.0 yet
227
+ layoutMode: o.layoutMode,
228
+ layoutMargins: o.layoutMargins,
183
229
  onReady: () => {
184
- e || (t?.activeEditor && W(t.activeEditor), D({ type: "ready" }), Y(!0));
230
+ e || (t?.activeEditor && Y(t.activeEditor), N({ type: "ready" }), re(!0));
185
231
  }
186
- }), T.current = t);
232
+ }), F.current = t);
187
233
  })(), () => {
188
- e = !0, t && typeof t.destroy == "function" && t.destroy(), T.current = null;
234
+ e = !0, t && typeof t.destroy == "function" && t.destroy(), F.current = null;
189
235
  };
190
- }, [s.source, s.mode, W]), F(() => {
191
- if (!s.validation?.scroll?.required || !z) return;
192
- const e = N.current;
236
+ }, [
237
+ o.source,
238
+ o.mode,
239
+ o.layoutMode,
240
+ o.layoutMargins?.top,
241
+ o.layoutMargins?.bottom,
242
+ o.layoutMargins?.left,
243
+ o.layoutMargins?.right,
244
+ Y
245
+ ]), A(() => {
246
+ if (!o.validation?.scroll?.required || !K) return;
247
+ const e = k.current;
193
248
  if (!e) return;
194
249
  const t = () => {
195
- const { scrollTop: n, scrollHeight: i, clientHeight: o } = e, p = n / (i - o);
196
- (p >= 0.95 || i <= o) && (B(!0), D({
250
+ const { scrollTop: i, scrollHeight: c, clientHeight: n } = e, T = i / (c - n);
251
+ (T >= 0.95 || c <= n) && ($(!0), N({
197
252
  type: "scroll",
198
- data: { percent: Math.round(p * 100) }
253
+ data: { percent: Math.round(T * 100) }
199
254
  }));
200
255
  };
201
256
  return e.addEventListener("scroll", t), t(), () => e.removeEventListener("scroll", t);
202
- }, [s.validation?.scroll?.required, z]);
203
- const Q = y(
257
+ }, [o.validation?.scroll?.required, K]);
258
+ const ae = D(
204
259
  (e, t) => {
205
- _((n) => {
206
- const i = n.get(e), o = new Map(n);
207
- return o.set(e, t), E({
260
+ H((i) => {
261
+ const c = i.get(e), n = new Map(i);
262
+ return n.set(e, t), y({
208
263
  id: e,
209
264
  value: t
210
- }), D({
265
+ }), N({
211
266
  type: "field_change",
212
- data: { fieldId: e, value: t, previousValue: i }
213
- }), I?.({
267
+ data: { fieldId: e, value: t, previousValue: c }
268
+ }), z?.({
214
269
  id: e,
215
270
  value: t,
216
- previousValue: i
217
- }), o;
271
+ previousValue: c
272
+ }), n;
218
273
  });
219
274
  },
220
- [I, E]
221
- ), $ = y(() => s.validation?.scroll?.required && !S ? !1 : (r.signer || []).every((e) => {
275
+ [z, y]
276
+ ), G = D(() => o.validation?.scroll?.required && !x ? !1 : (r.signer || []).every((e) => {
222
277
  if (!e.validation?.required) return !0;
223
- const t = l.get(e.id);
278
+ const t = g.get(e.id);
224
279
  return t && (typeof t != "string" || t.trim());
225
- }), [S, r.signer, l, s.validation?.scroll?.required]);
226
- F(() => {
227
- const e = $();
228
- U(e), A?.({
229
- scrolled: S,
230
- fields: l,
280
+ }), [x, r.signer, g, o.validation?.scroll?.required]);
281
+ A(() => {
282
+ const e = G();
283
+ O(e), _?.({
284
+ scrolled: x,
285
+ fields: g,
231
286
  isValid: e,
232
- isSubmitting: f
287
+ isSubmitting: h
233
288
  });
234
- }, [S, l, f, $, A]);
235
- const Z = y(async () => {
236
- if (g) return;
289
+ }, [x, g, h, G, _]);
290
+ const ie = D(async () => {
291
+ if (f || q) return;
292
+ P(!0);
237
293
  const e = {
238
- eventId: c,
239
- documentSource: s.source,
294
+ eventId: s,
295
+ documentSource: o.source,
240
296
  fields: {
241
297
  document: r.document || [],
242
298
  signer: (r.signer || []).map((t) => ({
243
299
  id: t.id,
244
- value: l.get(t.id) ?? null
300
+ value: g.get(t.id) ?? null
245
301
  }))
246
302
  },
247
- fileName: u?.fileName || "document.pdf"
303
+ fileName: a?.fileName || "document.pdf"
248
304
  };
249
- await M?.(e);
250
- }, [g, c, s.source, r, l, u, M]), ee = y(async () => {
251
- if (!w || g || f) return;
252
- V(!0), D({ type: "submit" });
253
- const e = D({ type: "submit" }), t = {
254
- eventId: c,
305
+ try {
306
+ await R?.(e);
307
+ } finally {
308
+ P(!1);
309
+ }
310
+ }, [
311
+ f,
312
+ q,
313
+ s,
314
+ o.source,
315
+ r,
316
+ g,
317
+ a,
318
+ R
319
+ ]), ce = D(async () => {
320
+ if (!w || f || h) return;
321
+ j(!0), N({ type: "submit" });
322
+ const e = N({ type: "submit" }), t = {
323
+ eventId: s,
255
324
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
256
- duration: Math.floor((Date.now() - G.current) / 1e3),
325
+ duration: Math.floor((Date.now() - se.current) / 1e3),
257
326
  auditTrail: e,
258
327
  documentFields: r.document || [],
259
- signerFields: (r.signer || []).map((n) => ({
260
- id: n.id,
261
- value: l.get(n.id) ?? null
328
+ signerFields: (r.signer || []).map((i) => ({
329
+ id: i.id,
330
+ value: g.get(i.id) ?? null
262
331
  })),
263
332
  isFullyCompleted: w
264
333
  };
265
334
  try {
266
- await k(t);
335
+ await p(t);
267
336
  } finally {
268
- V(!1);
337
+ j(!1);
269
338
  }
270
- }, [w, g, f, c, r, l, k]), te = (e) => {
271
- const t = e.component || ne(e.type);
272
- return /* @__PURE__ */ a(
339
+ }, [w, f, h, s, r, g, p]), le = (e) => {
340
+ const t = e.component || de(e.type);
341
+ return /* @__PURE__ */ d(
273
342
  t,
274
343
  {
275
- value: l.get(e.id) ?? null,
276
- onChange: (n) => Q(e.id, n),
277
- isDisabled: g,
344
+ value: g.get(e.id) ?? null,
345
+ onChange: (i) => ae(e.id, i),
346
+ isDisabled: f,
278
347
  label: e.label
279
348
  },
280
349
  e.id
281
350
  );
282
- }, ne = (e) => {
351
+ }, de = (e) => {
283
352
  switch (e) {
284
353
  case "signature":
285
354
  case "text":
286
- return ue;
355
+ return xe;
287
356
  case "checkbox":
288
- return pe;
357
+ return we;
289
358
  }
290
- }, re = () => {
291
- const e = u?.component || me(u);
292
- return e ? /* @__PURE__ */ a(
359
+ }, ue = () => {
360
+ const e = a?.component || Se(a);
361
+ return e ? /* @__PURE__ */ d(
293
362
  e,
294
363
  {
295
- onClick: Z,
296
- fileName: u?.fileName,
297
- isDisabled: g
364
+ onClick: ie,
365
+ fileName: a?.fileName,
366
+ isDisabled: f,
367
+ isDownloading: q
298
368
  }
299
369
  ) : null;
300
- }, oe = () => {
301
- if (s.mode === "download")
370
+ }, pe = () => {
371
+ if (o.mode === "download")
302
372
  return null;
303
- const e = R?.component || ge(R);
304
- return /* @__PURE__ */ a("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ a(
373
+ const e = m?.component || Ce(m);
374
+ return /* @__PURE__ */ d("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ d(
305
375
  e,
306
376
  {
307
- onClick: ee,
377
+ onClick: ce,
308
378
  isValid: w,
309
- isDisabled: g,
310
- isSubmitting: f
379
+ isDisabled: f,
380
+ isSubmitting: h
311
381
  }
312
382
  ) });
313
- }, j = re(), se = oe();
314
- return de(m, () => ({
315
- getState: () => ({
316
- scrolled: S,
317
- fields: l,
318
- isValid: w,
319
- isSubmitting: f
383
+ }, J = ue(), ge = pe();
384
+ return ve(
385
+ l,
386
+ () => ({
387
+ getState: () => ({
388
+ scrolled: x,
389
+ fields: g,
390
+ isValid: w,
391
+ isSubmitting: h
392
+ }),
393
+ getAuditTrail: () => M.current,
394
+ reset: () => {
395
+ $(!o.validation?.scroll?.required), H(/* @__PURE__ */ new Map()), O(!1), M.current = [], L([]);
396
+ },
397
+ updateFieldInDocument: y
320
398
  }),
321
- getAuditTrail: () => C.current,
322
- reset: () => {
323
- B(!s.validation?.scroll?.required), _(/* @__PURE__ */ new Map()), U(!1), C.current = [], L([]);
324
- }
325
- })), /* @__PURE__ */ x("div", { className: `superdoc-esign-container ${P || ""}`, style: K, children: [
326
- /* @__PURE__ */ x("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
327
- j && /* @__PURE__ */ a("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ a("div", { className: "superdoc-esign-document-controls", children: j }) }),
328
- /* @__PURE__ */ a(
399
+ [
400
+ x,
401
+ g,
402
+ w,
403
+ h,
404
+ o.validation?.scroll?.required,
405
+ y
406
+ ]
407
+ ), /* @__PURE__ */ b("div", { className: `superdoc-esign-container ${te || ""}`, style: ne, children: [
408
+ /* @__PURE__ */ b("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
409
+ J && /* @__PURE__ */ d("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ d("div", { className: "superdoc-esign-document-controls", children: J }) }),
410
+ /* @__PURE__ */ d(
329
411
  "div",
330
412
  {
331
- ref: N,
413
+ ref: k,
332
414
  className: "superdoc-esign-document-viewer",
333
415
  "data-testid": "superdoc-scroll-container",
334
- style: { height: X, overflow: "auto" }
416
+ style: { height: oe, overflow: "auto" }
335
417
  }
336
418
  )
337
419
  ] }),
338
- /* @__PURE__ */ x("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
339
- r.signer && r.signer.length > 0 && /* @__PURE__ */ a("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: r.signer.map(te) }),
340
- se
420
+ /* @__PURE__ */ b("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
421
+ r.signer && r.signer.length > 0 && /* @__PURE__ */ d("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: r.signer.map(le) }),
422
+ ge
341
423
  ] })
342
424
  ] });
343
425
  }
344
426
  );
345
- fe.displayName = "SuperDocESign";
427
+ De.displayName = "SuperDocESign";
346
428
  export {
347
- pe as CheckboxInput,
348
- ue as SignatureInput,
349
- fe as default
429
+ we as CheckboxInput,
430
+ xe as SignatureInput,
431
+ De as default,
432
+ be as textToImageDataUrl
350
433
  };