@unlev/exeq 0.5.7 → 0.6.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/dist/index.d.mts +4 -229
- package/dist/index.d.ts +4 -229
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -612
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +34 -0
- package/dist/server.d.ts +34 -0
- package/dist/server.js +663 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +61 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +13 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { A as A4, B as BUILTIN_TRANSFORMS, C as Calibration, c as CreatePdfBuilderOptions, D as DEFAULT_CALIBRATION, d as DEFAULT_SIGNER_ROLES, e as FIELD_DEFAULTS, f as FONT_FAMILIES, b as FieldType, g as FillPdfOptions, F as FormField, P as PdfBuilder, h as PdfMetadata, S as SIGNER_ROLE_COLORS, T as Template, i as TextSubtype, j as TransformFn, a as TransformMap, U as US_LEGAL, k as US_LETTER, l as applyCalibration, m as createField, n as createPdfBuilder, p as generateFilledPdf, q as generateId, r as getCssFontFamily, s as getFieldValues, t as getInputType, u as getSignerColor, v as isRedactField, w as isSignatureField, x as isTextLikeField, y as parseDate, E as preserveFieldValues, G as resolveAllFormulas, H as resolveFormula, I as sortFieldsByPosition, J as uniqueLabel } from './pdfFiller-Btf-SnEB.mjs';
|
|
2
|
+
import 'pdf-lib';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared "shrink text to fit a field" logic, used by BOTH the PDF filler and
|
|
6
|
+
* the on-screen signer/designer overlay so the live preview matches the
|
|
7
|
+
* generated PDF exactly (previously the PDF auto-shrank long values but the
|
|
8
|
+
* overlay rendered them at the raw font size, so the two disagreed).
|
|
9
|
+
*
|
|
10
|
+
* The measurement is injected so each side can supply its own text-width
|
|
11
|
+
* function (pdf-lib's font metrics for the PDF; canvas measureText for the
|
|
12
|
+
* browser) while sharing the identical fit algorithm.
|
|
13
|
+
*/
|
|
14
|
+
interface FitFontSizeOptions {
|
|
15
|
+
value: string;
|
|
16
|
+
/** The field's configured font size, in points. */
|
|
17
|
+
fontSize: number;
|
|
18
|
+
/** When true, cap at 70% of field height and shrink to fit the width. */
|
|
19
|
+
autoShrink?: boolean;
|
|
20
|
+
/** Field width in points. */
|
|
21
|
+
fieldWidthPt: number;
|
|
22
|
+
/** Field height in points. */
|
|
23
|
+
fieldHeightPt: number;
|
|
24
|
+
/** Width of `text` at `size` (points), in the same units as fieldWidthPt. */
|
|
25
|
+
measure: (text: string, size: number) => number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mirrors the algorithm in pdfFiller: start from the configured size (capped at
|
|
29
|
+
* height*0.7 when autoShrink), then step down by 0.5pt until the value fits the
|
|
30
|
+
* field width minus a small padding. Floored at 4pt.
|
|
31
|
+
*/
|
|
32
|
+
declare function fitFontSize(o: FitFontSizeOptions): number;
|
|
33
|
+
|
|
34
|
+
export { type FitFontSizeOptions, fitFontSize };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { A as A4, B as BUILTIN_TRANSFORMS, C as Calibration, c as CreatePdfBuilderOptions, D as DEFAULT_CALIBRATION, d as DEFAULT_SIGNER_ROLES, e as FIELD_DEFAULTS, f as FONT_FAMILIES, b as FieldType, g as FillPdfOptions, F as FormField, P as PdfBuilder, h as PdfMetadata, S as SIGNER_ROLE_COLORS, T as Template, i as TextSubtype, j as TransformFn, a as TransformMap, U as US_LEGAL, k as US_LETTER, l as applyCalibration, m as createField, n as createPdfBuilder, p as generateFilledPdf, q as generateId, r as getCssFontFamily, s as getFieldValues, t as getInputType, u as getSignerColor, v as isRedactField, w as isSignatureField, x as isTextLikeField, y as parseDate, E as preserveFieldValues, G as resolveAllFormulas, H as resolveFormula, I as sortFieldsByPosition, J as uniqueLabel } from './pdfFiller-Btf-SnEB.js';
|
|
2
|
+
import 'pdf-lib';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared "shrink text to fit a field" logic, used by BOTH the PDF filler and
|
|
6
|
+
* the on-screen signer/designer overlay so the live preview matches the
|
|
7
|
+
* generated PDF exactly (previously the PDF auto-shrank long values but the
|
|
8
|
+
* overlay rendered them at the raw font size, so the two disagreed).
|
|
9
|
+
*
|
|
10
|
+
* The measurement is injected so each side can supply its own text-width
|
|
11
|
+
* function (pdf-lib's font metrics for the PDF; canvas measureText for the
|
|
12
|
+
* browser) while sharing the identical fit algorithm.
|
|
13
|
+
*/
|
|
14
|
+
interface FitFontSizeOptions {
|
|
15
|
+
value: string;
|
|
16
|
+
/** The field's configured font size, in points. */
|
|
17
|
+
fontSize: number;
|
|
18
|
+
/** When true, cap at 70% of field height and shrink to fit the width. */
|
|
19
|
+
autoShrink?: boolean;
|
|
20
|
+
/** Field width in points. */
|
|
21
|
+
fieldWidthPt: number;
|
|
22
|
+
/** Field height in points. */
|
|
23
|
+
fieldHeightPt: number;
|
|
24
|
+
/** Width of `text` at `size` (points), in the same units as fieldWidthPt. */
|
|
25
|
+
measure: (text: string, size: number) => number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mirrors the algorithm in pdfFiller: start from the configured size (capped at
|
|
29
|
+
* height*0.7 when autoShrink), then step down by 0.5pt until the value fits the
|
|
30
|
+
* field width minus a small padding. Floored at 4pt.
|
|
31
|
+
*/
|
|
32
|
+
declare function fitFontSize(o: FitFontSizeOptions): number;
|
|
33
|
+
|
|
34
|
+
export { type FitFontSizeOptions, fitFontSize };
|