@embedpdf/react 3.0.0-next.14 → 3.0.0-next.16
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/AnnotationList-DcyhF2kU-CiBFOq1z.d.cts +878 -0
- package/dist/AnnotationList-DcyhF2kU-CiBFOq1z.d.ts +878 -0
- package/dist/actions.cjs +25 -5
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +18 -5
- package/dist/actions.d.ts +18 -5
- package/dist/actions.js +22 -6
- package/dist/actions.js.map +1 -1
- package/dist/anchored-DeX95xSd.d.ts +85 -0
- package/dist/anchored-DzN3JywS.d.cts +85 -0
- package/dist/anchored.cjs +71 -28
- package/dist/anchored.cjs.map +1 -1
- package/dist/anchored.d.cts +2 -45
- package/dist/anchored.d.ts +2 -45
- package/dist/anchored.js +56 -19
- package/dist/anchored.js.map +1 -1
- package/dist/annotation-3UvABfJm.d.cts +305 -0
- package/dist/annotation-BNHQpMKv.cjs +806 -0
- package/dist/annotation-BNHQpMKv.cjs.map +1 -0
- package/dist/annotation-CDI8CFb3.js +684 -0
- package/dist/annotation-CDI8CFb3.js.map +1 -0
- package/dist/annotation-DhEfs0pH.d.ts +305 -0
- package/dist/annotation.cjs +20 -784
- package/dist/annotation.d.cts +2 -2
- package/dist/annotation.d.ts +2 -2
- package/dist/annotation.js +2 -769
- package/dist/attachment.cjs +39 -0
- package/dist/attachment.cjs.map +1 -0
- package/dist/attachment.d.cts +29 -0
- package/dist/attachment.d.ts +29 -0
- package/dist/attachment.js +28 -0
- package/dist/attachment.js.map +1 -0
- package/dist/commands.cjs +68 -28
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +37 -10
- package/dist/commands.d.ts +37 -10
- package/dist/commands.js +68 -31
- package/dist/commands.js.map +1 -1
- package/dist/form-BSGvjA5D.js +511 -0
- package/dist/form-BSGvjA5D.js.map +1 -0
- package/dist/form-BgztZyOK.cjs +548 -0
- package/dist/form-BgztZyOK.cjs.map +1 -0
- package/dist/form.cjs +5 -5
- package/dist/form.d.cts +41 -2
- package/dist/form.d.ts +41 -2
- package/dist/form.js +2 -3
- package/dist/history.cjs +38 -0
- package/dist/history.cjs.map +1 -0
- package/dist/history.d.cts +27 -0
- package/dist/history.d.ts +27 -0
- package/dist/history.js +27 -0
- package/dist/history.js.map +1 -0
- package/dist/i18n.cjs +26 -30
- package/dist/i18n.cjs.map +1 -1
- package/dist/i18n.d.cts +24 -21
- package/dist/i18n.d.ts +24 -21
- package/dist/i18n.js +24 -31
- package/dist/i18n.js.map +1 -1
- package/dist/index.cjs +227 -57
- package/dist/index.d.cts +35 -32
- package/dist/index.d.ts +35 -32
- package/dist/index.js +36 -30
- package/dist/inert-CmBEbKCn.cjs +19 -0
- package/dist/inert-CmBEbKCn.cjs.map +1 -0
- package/dist/inert-D8fkennb.js +14 -0
- package/dist/inert-D8fkennb.js.map +1 -0
- package/dist/interaction.cjs +48 -102
- package/dist/interaction.cjs.map +1 -1
- package/dist/interaction.d.cts +23 -32
- package/dist/interaction.d.ts +23 -32
- package/dist/interaction.js +33 -102
- package/dist/interaction.js.map +1 -1
- package/dist/link.cjs +65 -104
- package/dist/link.cjs.map +1 -1
- package/dist/link.d.cts +21 -16
- package/dist/link.d.ts +22 -17
- package/dist/link.js +67 -107
- package/dist/link.js.map +1 -1
- package/dist/measurement.cjs +36 -11
- package/dist/measurement.cjs.map +1 -1
- package/dist/measurement.d.cts +33 -7
- package/dist/measurement.d.ts +33 -7
- package/dist/measurement.js +35 -14
- package/dist/measurement.js.map +1 -1
- package/dist/metadata.cjs +20 -7
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +22 -7
- package/dist/metadata.d.ts +22 -7
- package/dist/metadata.js +20 -10
- package/dist/metadata.js.map +1 -1
- package/dist/outline.cjs +39 -0
- package/dist/outline.cjs.map +1 -0
- package/dist/outline.d.cts +31 -0
- package/dist/outline.d.ts +31 -0
- package/dist/outline.js +28 -0
- package/dist/outline.js.map +1 -0
- package/dist/page-edit.cjs +15 -3
- package/dist/page-edit.cjs.map +1 -1
- package/dist/page-edit.d.cts +17 -2
- package/dist/page-edit.d.ts +17 -2
- package/dist/page-edit.js +15 -5
- package/dist/page-edit.js.map +1 -1
- package/dist/page-layers-Bkaaz8Zf.js +26 -0
- package/dist/page-layers-Bkaaz8Zf.js.map +1 -0
- package/dist/page-layers-BloZDoOV.cjs +37 -0
- package/dist/page-layers-BloZDoOV.cjs.map +1 -0
- package/dist/page-view.cjs +89 -82
- package/dist/page-view.cjs.map +1 -1
- package/dist/page-view.d.cts +14 -7
- package/dist/page-view.d.ts +18 -11
- package/dist/page-view.js +86 -81
- package/dist/page-view.js.map +1 -1
- package/dist/redaction.cjs +30 -15
- package/dist/redaction.cjs.map +1 -1
- package/dist/redaction.d.cts +27 -9
- package/dist/redaction.d.ts +27 -9
- package/dist/redaction.js +29 -18
- package/dist/redaction.js.map +1 -1
- package/dist/render.cjs +71 -46
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +17 -5
- package/dist/render.d.ts +17 -5
- package/dist/render.js +70 -49
- package/dist/render.js.map +1 -1
- package/dist/runtime-BfnpyfY0.cjs +556 -0
- package/dist/runtime-BfnpyfY0.cjs.map +1 -0
- package/dist/runtime-DBEBlpQV.d.cts +237 -0
- package/dist/runtime-V3MVMb91.d.ts +237 -0
- package/dist/runtime-tD5iJU83.js +399 -0
- package/dist/runtime-tD5iJU83.js.map +1 -0
- package/dist/runtime.cjs +45 -324
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +2 -306
- package/dist/search.cjs +81 -50
- package/dist/search.cjs.map +1 -1
- package/dist/search.d.cts +37 -24
- package/dist/search.d.ts +37 -24
- package/dist/search.js +81 -53
- package/dist/search.js.map +1 -1
- package/dist/selection.cjs +105 -108
- package/dist/selection.cjs.map +1 -1
- package/dist/selection.d.cts +54 -26
- package/dist/selection.d.ts +56 -28
- package/dist/selection.js +103 -110
- package/dist/selection.js.map +1 -1
- package/dist/shell.cjs +36 -21
- package/dist/shell.cjs.map +1 -1
- package/dist/shell.d.cts +32 -17
- package/dist/shell.d.ts +32 -17
- package/dist/shell.js +36 -24
- package/dist/shell.js.map +1 -1
- package/dist/signature.cjs +29 -48
- package/dist/signature.cjs.map +1 -1
- package/dist/signature.d.cts +26 -26
- package/dist/signature.d.ts +26 -26
- package/dist/signature.js +30 -48
- package/dist/signature.js.map +1 -1
- package/dist/stage-B7BG2e8Q.cjs +369 -0
- package/dist/stage-B7BG2e8Q.cjs.map +1 -0
- package/dist/stage-BqfBjDu6.js +302 -0
- package/dist/stage-BqfBjDu6.js.map +1 -0
- package/dist/stage-ByFPD-Fv.d.cts +117 -0
- package/dist/stage-DaboaheR.d.ts +117 -0
- package/dist/stage-scope-CQgCuf1w.cjs +46 -0
- package/dist/stage-scope-CQgCuf1w.cjs.map +1 -0
- package/dist/stage-scope-D7ZeNduT.js +23 -0
- package/dist/stage-scope-D7ZeNduT.js.map +1 -0
- package/dist/stage.cjs +12 -235
- package/dist/stage.d.cts +2 -116
- package/dist/stage.d.ts +2 -116
- package/dist/stage.js +3 -228
- package/dist/stamp.cjs +41 -35
- package/dist/stamp.cjs.map +1 -1
- package/dist/stamp.d.cts +25 -18
- package/dist/stamp.d.ts +25 -18
- package/dist/stamp.js +40 -37
- package/dist/stamp.js.map +1 -1
- package/dist/state-0K1I5cM4.d.cts +29 -0
- package/dist/state-0K1I5cM4.d.ts +29 -0
- package/dist/state-CzI2KlZb.js +62 -0
- package/dist/state-CzI2KlZb.js.map +1 -0
- package/dist/state-Dtf8HAue.cjs +73 -0
- package/dist/state-Dtf8HAue.cjs.map +1 -0
- package/dist/svg-shapes-Dm1yTR1b.js +40 -0
- package/dist/svg-shapes-Dm1yTR1b.js.map +1 -0
- package/dist/svg-shapes-zo0GNkc9.cjs +53 -0
- package/dist/svg-shapes-zo0GNkc9.cjs.map +1 -0
- package/dist/toolbar.cjs +297 -295
- package/dist/toolbar.cjs.map +1 -1
- package/dist/toolbar.d.cts +58 -68
- package/dist/toolbar.d.ts +67 -77
- package/dist/toolbar.js +271 -293
- package/dist/toolbar.js.map +1 -1
- package/dist/view-manager.cjs +34 -0
- package/dist/view-manager.cjs.map +1 -0
- package/dist/view-manager.d.cts +21 -0
- package/dist/view-manager.d.ts +21 -0
- package/dist/view-manager.js +23 -0
- package/dist/view-manager.js.map +1 -0
- package/package.json +47 -39
- package/dist/annotation-BCED_p9H.d.cts +0 -160
- package/dist/annotation-anchors-CetwM1g7.js +0 -15
- package/dist/annotation-anchors-CetwM1g7.js.map +0 -1
- package/dist/annotation-anchors-DuYRBJLl.cjs +0 -26
- package/dist/annotation-anchors-DuYRBJLl.cjs.map +0 -1
- package/dist/annotation-hooks-BB5ZhPpf.cjs +0 -16
- package/dist/annotation-hooks-BB5ZhPpf.cjs.map +0 -1
- package/dist/annotation-hooks-Df8EmzDO.js +0 -11
- package/dist/annotation-hooks-Df8EmzDO.js.map +0 -1
- package/dist/annotation-k38KDlIZ.d.ts +0 -160
- package/dist/annotation-menu.cjs +0 -64
- package/dist/annotation-menu.cjs.map +0 -1
- package/dist/annotation-menu.d.cts +0 -33
- package/dist/annotation-menu.d.ts +0 -33
- package/dist/annotation-menu.js +0 -48
- package/dist/annotation-menu.js.map +0 -1
- package/dist/annotation.cjs.map +0 -1
- package/dist/annotation.js.map +0 -1
- package/dist/form-BVumS7up.cjs +0 -926
- package/dist/form-BVumS7up.cjs.map +0 -1
- package/dist/form-Bdjk0Z3T.d.cts +0 -537
- package/dist/form-CK3mp99m.js +0 -895
- package/dist/form-CK3mp99m.js.map +0 -1
- package/dist/form-CYRYgthn.d.ts +0 -537
- package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
- package/dist/runtime-DE76hlnl.d.ts +0 -216
- package/dist/runtime-umHA_xHt.d.cts +0 -216
- package/dist/runtime.cjs.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/scrollbar.cjs +0 -241
- package/dist/scrollbar.cjs.map +0 -1
- package/dist/scrollbar.d.cts +0 -42
- package/dist/scrollbar.d.ts +0 -42
- package/dist/scrollbar.js +0 -213
- package/dist/scrollbar.js.map +0 -1
- package/dist/stage.cjs.map +0 -1
- package/dist/stage.js.map +0 -1
- package/dist/views.cjs +0 -35
- package/dist/views.cjs.map +0 -1
- package/dist/views.d.cts +0 -21
- package/dist/views.d.ts +0 -21
- package/dist/views.js +0 -27
- package/dist/views.js.map +0 -1
package/dist/form-Bdjk0Z3T.d.cts
DELETED
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
import { o as AnnotationRenderer } from "./annotation-BCED_p9H.cjs";
|
|
2
|
-
import { FormFieldDTO } from "@embedpdf/plugin-form";
|
|
3
|
-
//#region ../../engine/core/dist/AnnotationListSnapshot-D9R5n2Kf.d.ts
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/identity/PageObjectNumber.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* PDF indirect object number for a page.
|
|
8
|
-
*
|
|
9
|
-
* Resolved via the PDFium runtime helper `EPDFPage_GetObjectNumber(pagePtr)`.
|
|
10
|
-
* Always > 0 for well-formed PDFs. This replaces the v2 page index as the
|
|
11
|
-
* primary addressing key. The page index is kept on `PageHandle` as display
|
|
12
|
-
* metadata only, because it can shift when pages are inserted, deleted, or
|
|
13
|
-
* reordered while a session is open.
|
|
14
|
-
*/
|
|
15
|
-
type PageObjectNumber = number;
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/dto/PdfDestination.d.ts
|
|
18
|
-
/**
|
|
19
|
-
* An explicit PDF destination (ISO 32000-1 §12.3.2.2): a page, a location,
|
|
20
|
-
* and a magnification. Produced by outlines/bookmarks, link annotations,
|
|
21
|
-
* `/OpenAction`, and GoTo actions; named destinations resolve to one of
|
|
22
|
-
* these through the catalog's `/Dests` dictionary or name tree — the
|
|
23
|
-
* ENGINE does that resolution, so the viewer only ever sees this explicit
|
|
24
|
-
* form.
|
|
25
|
-
*
|
|
26
|
-
* Coordinates are PDF user space (y-up, points, absolute — NOT
|
|
27
|
-
* crop-relative). `null` means "retain the current value" (the spec's
|
|
28
|
-
* meaning for null array entries); a `/XYZ` zoom of `0` is equivalent to
|
|
29
|
-
* null. The `fitB*` kinds refer to the page's content BOUNDING box rather
|
|
30
|
-
* than the crop box.
|
|
31
|
-
*
|
|
32
|
-
* Viewers translate these onto the stage's reveal primitive — see
|
|
33
|
-
* `destinationToReveal` in `@embedpdf/plugin-stage`.
|
|
34
|
-
*/
|
|
35
|
-
type PdfDestination = {
|
|
36
|
-
kind: 'xyz';
|
|
37
|
-
pageObjectNumber: PageObjectNumber;
|
|
38
|
-
left?: number | null;
|
|
39
|
-
top?: number | null;
|
|
40
|
-
zoom?: number | null;
|
|
41
|
-
} | {
|
|
42
|
-
kind: 'fit';
|
|
43
|
-
pageObjectNumber: PageObjectNumber;
|
|
44
|
-
} | {
|
|
45
|
-
kind: 'fitH';
|
|
46
|
-
pageObjectNumber: PageObjectNumber;
|
|
47
|
-
top?: number | null;
|
|
48
|
-
} | {
|
|
49
|
-
kind: 'fitV';
|
|
50
|
-
pageObjectNumber: PageObjectNumber;
|
|
51
|
-
left?: number | null;
|
|
52
|
-
} | {
|
|
53
|
-
kind: 'fitR';
|
|
54
|
-
pageObjectNumber: PageObjectNumber;
|
|
55
|
-
left: number;
|
|
56
|
-
bottom: number;
|
|
57
|
-
right: number;
|
|
58
|
-
top: number;
|
|
59
|
-
} | {
|
|
60
|
-
kind: 'fitB';
|
|
61
|
-
pageObjectNumber: PageObjectNumber;
|
|
62
|
-
} | {
|
|
63
|
-
kind: 'fitBH';
|
|
64
|
-
pageObjectNumber: PageObjectNumber;
|
|
65
|
-
top?: number | null;
|
|
66
|
-
} | {
|
|
67
|
-
kind: 'fitBV';
|
|
68
|
-
pageObjectNumber: PageObjectNumber;
|
|
69
|
-
left?: number | null;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* One Hide `/T` or ResetForm `/Fields` entry. Deliberately UNSCOPED: a
|
|
73
|
-
* dictionary reference carries no page, so resolution (a name to widgets, an
|
|
74
|
-
* object number to an annotation or field) is the interpreter's job — never
|
|
75
|
-
* the extractor's.
|
|
76
|
-
*/
|
|
77
|
-
type PdfActionTargetRef = {
|
|
78
|
-
kind: 'name';
|
|
79
|
-
name: string;
|
|
80
|
-
} | {
|
|
81
|
-
kind: 'objectNumber';
|
|
82
|
-
objectNumber: number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Decoded SubmitForm `/Flags` word (ISO 32000-2:2020 Table 240) plus the raw
|
|
86
|
-
* value. `exclude` is DERIVED from bit 1 — never stored separately, so the
|
|
87
|
-
* two cannot disagree. Note the two easily-missed positions verified against
|
|
88
|
-
* the spec: bit 12 is `ExclFKey` (not "ExclFDFTemplate") and bit 13 is
|
|
89
|
-
* reserved/undefined, so `EmbedForm` is bit 14.
|
|
90
|
-
*/
|
|
91
|
-
interface SubmitFormFlags {
|
|
92
|
-
raw: number;
|
|
93
|
-
/** Bit 1: set → `fields` lists EXCLUDED fields. */
|
|
94
|
-
exclude: boolean;
|
|
95
|
-
/** Bit 2: submit designated valueless fields too, as name-only entries. */
|
|
96
|
-
includeNoValueFields: boolean;
|
|
97
|
-
/** Bits 3/6/9 folded into one verdict: bit 9 SubmitPDF dominates ("all
|
|
98
|
-
* other flags shall be ignored except GetMethod"), else bit 6 XFDF, else
|
|
99
|
-
* bit 3 HTML Form format, else FDF (the Table 240 default). */
|
|
100
|
-
format: 'fdf' | 'html' | 'xfdf' | 'pdf';
|
|
101
|
-
/** Bit 4. ISO makes GetMethod meaningful only with ExportFormat set, and
|
|
102
|
-
* the bit-9 rule keeps it alive for SubmitPDF — so `'get'` only for
|
|
103
|
-
* `'html'` and `'pdf'`; everything else posts. */
|
|
104
|
-
method: 'post' | 'get';
|
|
105
|
-
/** Bit 5 (meaningful only with ExportFormat; passed through — this stack
|
|
106
|
-
* does not capture click coordinates). */
|
|
107
|
-
submitCoordinates: boolean;
|
|
108
|
-
/** Bit 7 (FDF only): include incremental updates via FDF `Differences`. */
|
|
109
|
-
includeAppendSaves: boolean;
|
|
110
|
-
/** Bit 8 (FDF only): include markup annotations. */
|
|
111
|
-
includeAnnotations: boolean;
|
|
112
|
-
/** Bit 10: convert date-like values to the standard date format. */
|
|
113
|
-
canonicalFormat: boolean;
|
|
114
|
-
/** Bit 11 (FDF, with IncludeAnnotations): only the current user's
|
|
115
|
-
* annotations. */
|
|
116
|
-
exclNonUserAnnots: boolean;
|
|
117
|
-
/** Bit 12: the submitted FDF excludes its `F` entry. */
|
|
118
|
-
exclFKey: boolean;
|
|
119
|
-
/** Bit 14 (bit 13 is reserved): the FDF `F` entry embeds the source PDF. */
|
|
120
|
-
embedForm: boolean;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* SubmitForm's extracted intent. ATOMIC on purpose: either every required
|
|
124
|
-
* component resolved (a complete, executable payload) or the node carries no
|
|
125
|
-
* payload at all — partial states are unrepresentable. An unreadable
|
|
126
|
-
* REQUIRED component (`/F`) degrades the whole node to `unknown` +
|
|
127
|
-
* `payload-dropped` at read time instead.
|
|
128
|
-
*/
|
|
129
|
-
interface SubmitFormPayload {
|
|
130
|
-
/** Resolved `/F` URL — a `<< /FS /URL >>` file specification (7.11.5,
|
|
131
|
-
* `/UF` preferred over `/F` per 7.11.2); a bare string `/F` is accepted
|
|
132
|
-
* as a producer-compat extension. */
|
|
133
|
-
url: string;
|
|
134
|
-
/**
|
|
135
|
-
* `null` = `/Fields` ABSENT → Include/Exclude is ignored and every field
|
|
136
|
-
* except NoExport-flagged ones is submitted (Table 239). `[]` =
|
|
137
|
-
* present-but-empty: include mode submits NOTHING, exclude mode submits
|
|
138
|
-
* everything eligible — presence and emptiness are different states.
|
|
139
|
-
*/
|
|
140
|
-
fields: PdfActionTargetRef[] | null;
|
|
141
|
-
flags: SubmitFormFlags;
|
|
142
|
-
/** `/CharSet` (PDF 2.0), extracted but not encoded by this stack. */
|
|
143
|
-
charSet?: string;
|
|
144
|
-
}
|
|
145
|
-
interface PdfActionNodeCommon {
|
|
146
|
-
/** Raw `/S` name, retained for unknown and future action types. */
|
|
147
|
-
subtype: string;
|
|
148
|
-
/** Normalized `/Next` children in PDF order. */
|
|
149
|
-
next: PdfActionNode[];
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* One detached node in a normalized PDF action tree, discriminated on the
|
|
153
|
-
* interpreter that would execute it. Every executable arm carries its full
|
|
154
|
-
* payload — a `goto` without a destination or a `uri` without a URI is
|
|
155
|
-
* unrepresentable. A payload the reader cannot materialize degrades the node
|
|
156
|
-
* to `unknown` (original `/S` kept on `subtype`) and appends the tree-level
|
|
157
|
-
* `'payload-dropped'` warning.
|
|
158
|
-
*/
|
|
159
|
-
type PdfActionNode = PdfActionNodeCommon & ({
|
|
160
|
-
type: 'javascript';
|
|
161
|
-
script: string;
|
|
162
|
-
} | {
|
|
163
|
-
type: 'goto';
|
|
164
|
-
destination: PdfDestination;
|
|
165
|
-
} | {
|
|
166
|
-
type: 'uri';
|
|
167
|
-
uri: string;
|
|
168
|
-
isMap: boolean;
|
|
169
|
-
} | {
|
|
170
|
-
type: 'named';
|
|
171
|
-
name: string;
|
|
172
|
-
} | {
|
|
173
|
-
type: 'hide';
|
|
174
|
-
targets: PdfActionTargetRef[];
|
|
175
|
-
hide: boolean;
|
|
176
|
-
} | {
|
|
177
|
-
type: 'reset-form';
|
|
178
|
-
/**
|
|
179
|
-
* `null` = `/Fields` ABSENT → reset every field (`exclude` is
|
|
180
|
-
* meaningless). `[]` = present-but-empty: with `exclude` false reset
|
|
181
|
-
* NOTHING, with `exclude` true reset EVERYTHING — PDFium's executor
|
|
182
|
-
* branches on presence first.
|
|
183
|
-
*/
|
|
184
|
-
fields: PdfActionTargetRef[] | null;
|
|
185
|
-
exclude: boolean;
|
|
186
|
-
} |
|
|
187
|
-
/** Reported, never executed. */
|
|
188
|
-
{
|
|
189
|
-
type: 'goto-remote';
|
|
190
|
-
filePath: string;
|
|
191
|
-
} | {
|
|
192
|
-
type: 'goto-embedded';
|
|
193
|
-
filePath: string;
|
|
194
|
-
} | {
|
|
195
|
-
type: 'launch';
|
|
196
|
-
filePath: string;
|
|
197
|
-
} |
|
|
198
|
-
/** ISO allows `/Rendition` to carry `/JS`; preserved, not collected. */
|
|
199
|
-
{
|
|
200
|
-
type: 'rendition';
|
|
201
|
-
script?: string;
|
|
202
|
-
} |
|
|
203
|
-
/** Recognized; executable only when `payload` is present. Absent payload
|
|
204
|
-
* = extracted by an older runtime (skew) — the node stays
|
|
205
|
-
* recognized-inert exactly as before this payload existed. */
|
|
206
|
-
{
|
|
207
|
-
type: 'submit-form';
|
|
208
|
-
payload?: SubmitFormPayload;
|
|
209
|
-
} | {
|
|
210
|
-
type: 'thread';
|
|
211
|
-
} | {
|
|
212
|
-
type: 'sound';
|
|
213
|
-
} | {
|
|
214
|
-
type: 'movie';
|
|
215
|
-
} | {
|
|
216
|
-
type: 'import-data';
|
|
217
|
-
} | {
|
|
218
|
-
type: 'set-ocg-state';
|
|
219
|
-
} | {
|
|
220
|
-
type: 'transition';
|
|
221
|
-
} | {
|
|
222
|
-
type: 'goto-3d-view';
|
|
223
|
-
} | {
|
|
224
|
-
type: 'unknown';
|
|
225
|
-
});
|
|
226
|
-
type PdfActionWarning = 'cycle-dropped' | 'malformed-next' | 'incomplete' |
|
|
227
|
-
/** A node's payload could not be read; that node degraded to `unknown`. */
|
|
228
|
-
'payload-dropped';
|
|
229
|
-
/**
|
|
230
|
-
* One extracted action root plus the native reader's safety verdict.
|
|
231
|
-
* Consumers must never execute a tree whose `incomplete` flag is true.
|
|
232
|
-
*/
|
|
233
|
-
interface PdfActionTree {
|
|
234
|
-
/** Null when the model was valid but its root exceeded a safety bound. */
|
|
235
|
-
root: PdfActionNode | null;
|
|
236
|
-
incomplete: boolean;
|
|
237
|
-
/** Raw native bits, retained so newer warnings survive older SDKs.
|
|
238
|
-
* TS-detected warnings (`payload-dropped`) appear only in `warnings`. */
|
|
239
|
-
warningFlags: number;
|
|
240
|
-
warnings: PdfActionWarning[];
|
|
241
|
-
}
|
|
242
|
-
interface PdfFieldActions {
|
|
243
|
-
keystroke?: PdfActionTree;
|
|
244
|
-
format?: PdfActionTree;
|
|
245
|
-
validate?: PdfActionTree;
|
|
246
|
-
calculate?: PdfActionTree;
|
|
247
|
-
}
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/identity/FormFieldRef.d.ts
|
|
250
|
-
/**
|
|
251
|
-
* How callers address a logical form field.
|
|
252
|
-
*
|
|
253
|
-
* - `objectNumber` — the indirect object number of the field dictionary.
|
|
254
|
-
* ISO 32000 guarantees every real AcroForm field dictionary is an
|
|
255
|
-
* indirect object, and the layer runtime never renumbers (frozen base +
|
|
256
|
-
* incremental deltas), so this is the durable identity for the lifetime
|
|
257
|
-
* of a document. Preferred for all engine calls.
|
|
258
|
-
* - `fqn` — the fully qualified field name ("billing.name"). The portable,
|
|
259
|
-
* semantic identity used by interchange formats (FDF/XFDF) and analytics;
|
|
260
|
-
* survives document rewrites but is only as unique as the producer made
|
|
261
|
-
* it. The engine resolves it against the reconciled field tree.
|
|
262
|
-
*/
|
|
263
|
-
type FormFieldRef = {
|
|
264
|
-
kind: 'objectNumber';
|
|
265
|
-
fieldObjectNumber: number;
|
|
266
|
-
} | {
|
|
267
|
-
kind: 'fqn';
|
|
268
|
-
name: string;
|
|
269
|
-
};
|
|
270
|
-
/** A widget annotation of a field, as the forms subsystem sees it. */
|
|
271
|
-
interface FormWidgetRef {
|
|
272
|
-
/**
|
|
273
|
-
* Indirect object number of the widget annotation — the join key to the
|
|
274
|
-
* annotation subsystem's `objectNumber` refs. `0` when the widget is
|
|
275
|
-
* stored as a direct object (spec-violating; cannot be addressed).
|
|
276
|
-
*/
|
|
277
|
-
annotObjectNumber: number;
|
|
278
|
-
/**
|
|
279
|
-
* Object number of the page whose /Annots array references the widget.
|
|
280
|
-
* `0` when the widget is not reachable from any page ("unplaced").
|
|
281
|
-
*/
|
|
282
|
-
pageObjectNumber: PageObjectNumber;
|
|
283
|
-
}
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region src/forms/value-entry.d.ts
|
|
286
|
-
/** Lossless shape of a field's effective PDF `/V` or `/DV` object. */
|
|
287
|
-
type FormValueEntry = {
|
|
288
|
-
kind: 'none';
|
|
289
|
-
} | {
|
|
290
|
-
kind: 'scalar';
|
|
291
|
-
value: string;
|
|
292
|
-
} | {
|
|
293
|
-
kind: 'array';
|
|
294
|
-
values: string[];
|
|
295
|
-
} | {
|
|
296
|
-
kind: 'unsupported';
|
|
297
|
-
};
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region src/forms/field.d.ts
|
|
300
|
-
/**
|
|
301
|
-
* The field family — the discriminant of {@link FormFieldDTO}. Narrowing on
|
|
302
|
-
* it reveals exactly the members that are meaningful for that family, the
|
|
303
|
-
* same way annotation DTOs narrow on `subtype`.
|
|
304
|
-
*/
|
|
305
|
-
type FormFieldFamily = 'text' | 'checkbox' | 'radio' | 'combobox' | 'listbox' | 'pushbutton' | 'signature' | 'unknown';
|
|
306
|
-
/**
|
|
307
|
-
* Where the field was found.
|
|
308
|
-
*
|
|
309
|
-
* - `acroform` — reachable from the /AcroForm /Fields tree, as the spec
|
|
310
|
-
* requires.
|
|
311
|
-
* - `recovered` — only reachable through a page's /Annots array (a common
|
|
312
|
-
* producer bug). The engine reconciles these on every read so they work
|
|
313
|
-
* like any other field, but other PDF processors will not see them until
|
|
314
|
-
* {@link DocumentFormsService.repair} makes the fix durable.
|
|
315
|
-
*/
|
|
316
|
-
type FormFieldOrigin = 'acroform' | 'recovered';
|
|
317
|
-
/**
|
|
318
|
-
* The /Ff flags every field family shares. Family-specific flags (comb,
|
|
319
|
-
* multi-select, radios-in-unison, ...) live as plain booleans on the
|
|
320
|
-
* family DTOs where they are always meaningful.
|
|
321
|
-
*/
|
|
322
|
-
interface FormFieldFlags {
|
|
323
|
-
/**
|
|
324
|
-
* The user must not change the value. The engine's write transactions
|
|
325
|
-
* still accept programmatic writes to read-only fields (calculated
|
|
326
|
-
* fields are read-only yet script-written); enforcing fill policy is
|
|
327
|
-
* the application's job.
|
|
328
|
-
*/
|
|
329
|
-
readOnly: boolean;
|
|
330
|
-
required: boolean;
|
|
331
|
-
noExport: boolean;
|
|
332
|
-
/** The raw /Ff integer, for anything not surfaced. */
|
|
333
|
-
raw: number;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* A widget of a toggle (checkbox/radio) field. Toggle widgets always carry
|
|
337
|
-
* their appearance-state machinery — no nullable fields to probe.
|
|
338
|
-
*/
|
|
339
|
-
interface ToggleFieldWidget extends FormWidgetRef {
|
|
340
|
-
/**
|
|
341
|
-
* The widget's appearance state name (the non-"Off" key of its /AP /N
|
|
342
|
-
* dictionary) — the token toggle writes address widgets by.
|
|
343
|
-
*/
|
|
344
|
-
onState: string;
|
|
345
|
-
/**
|
|
346
|
-
* The widget's export value (/Opt entry when present, else the
|
|
347
|
-
* on-state). The identity FDF/XFDF carry.
|
|
348
|
-
*/
|
|
349
|
-
exportValue: string;
|
|
350
|
-
/** Whether this widget is currently checked. */
|
|
351
|
-
checked: boolean;
|
|
352
|
-
}
|
|
353
|
-
/** One option of a choice (combo/list box) field. */
|
|
354
|
-
interface FormFieldOption {
|
|
355
|
-
/** Display label shown to the user. */
|
|
356
|
-
label: string;
|
|
357
|
-
/** Export value used by /V, interchange, and `FormFieldValue.choice`. */
|
|
358
|
-
value: string;
|
|
359
|
-
/** Whether the option is currently selected. */
|
|
360
|
-
selected: boolean;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* The trunk every field family shares: identity, provenance, universal
|
|
364
|
-
* flags, and widget placement. A logical field is the document-scoped
|
|
365
|
-
* record that holds the value; its widgets are page-scoped views — join
|
|
366
|
-
* them to the annotation subsystem via `annotObjectNumber`.
|
|
367
|
-
*/
|
|
368
|
-
interface FormFieldBase {
|
|
369
|
-
/** Durable ref (`objectNumber` whenever the field dictionary is indirect). */
|
|
370
|
-
ref: FormFieldRef;
|
|
371
|
-
/** Field dictionary object number; `0` for direct (spec-violating) dicts. */
|
|
372
|
-
fieldObjectNumber: number;
|
|
373
|
-
/** Fully qualified name, e.g. `"billing.name"`. */
|
|
374
|
-
name: string;
|
|
375
|
-
family: FormFieldFamily;
|
|
376
|
-
origin: FormFieldOrigin;
|
|
377
|
-
flags: FormFieldFlags;
|
|
378
|
-
/** /TU — the accessible tooltip / alternate name. */
|
|
379
|
-
alternateName: string | null;
|
|
380
|
-
/** /TM — the export mapping name. */
|
|
381
|
-
mappingName: string | null;
|
|
382
|
-
/** Exact effective `/V` object shape; family conveniences below are derived. */
|
|
383
|
-
valueEntry: FormValueEntry;
|
|
384
|
-
/** Exact effective `/DV` object shape, including absent and malformed values. */
|
|
385
|
-
defaultValueEntry: FormValueEntry;
|
|
386
|
-
/** Effective inherited field `/AA` actions. */
|
|
387
|
-
actions?: PdfFieldActions;
|
|
388
|
-
/** The field's widget annotations, in control order. May be empty ("unplaced"). */
|
|
389
|
-
widgets: FormWidgetRef[];
|
|
390
|
-
}
|
|
391
|
-
/** A text field. Write with `{ type: 'text', value }`. */
|
|
392
|
-
interface TextFieldDTO extends FormFieldBase {
|
|
393
|
-
family: 'text';
|
|
394
|
-
value: string;
|
|
395
|
-
/** /DV — restored by `reset()`. */
|
|
396
|
-
defaultValue: string;
|
|
397
|
-
/** /MaxLen; `null` when unlimited. Longer writes are truncated to this length. */
|
|
398
|
-
maxLength: number | null;
|
|
399
|
-
multiline: boolean;
|
|
400
|
-
password: boolean;
|
|
401
|
-
/** Fixed character cells; meaningful with `maxLength`. */
|
|
402
|
-
comb: boolean;
|
|
403
|
-
}
|
|
404
|
-
/** A checkbox. Write with `{ type: 'toggle', state: onState | null }`. */
|
|
405
|
-
interface CheckboxFieldDTO extends FormFieldBase {
|
|
406
|
-
family: 'checkbox';
|
|
407
|
-
checked: boolean;
|
|
408
|
-
/** The export value reported while checked ("Off" is never exported). */
|
|
409
|
-
exportValue: string;
|
|
410
|
-
widgets: ToggleFieldWidget[];
|
|
411
|
-
}
|
|
412
|
-
/** A radio group: ONE field, N widgets. Write with `{ type: 'toggle', state }`. */
|
|
413
|
-
interface RadioFieldDTO extends FormFieldBase {
|
|
414
|
-
family: 'radio';
|
|
415
|
-
/** The checked widget's export value, or `"Off"` when the group is clear. */
|
|
416
|
-
value: string;
|
|
417
|
-
/** Widgets sharing an export value check together. */
|
|
418
|
-
radiosInUnison: boolean;
|
|
419
|
-
/** The group cannot be cleared once a choice is made. */
|
|
420
|
-
noToggleToOff: boolean;
|
|
421
|
-
widgets: ToggleFieldWidget[];
|
|
422
|
-
}
|
|
423
|
-
/** A combo box (dropdown). Write with `{ type: 'choice', values: [v] }`. */
|
|
424
|
-
interface ComboBoxFieldDTO extends FormFieldBase {
|
|
425
|
-
family: 'combobox';
|
|
426
|
-
/** An option export value — or free text when `edit` is set. */
|
|
427
|
-
value: string;
|
|
428
|
-
/** /DV — restored by `reset()`. */
|
|
429
|
-
defaultValue: string;
|
|
430
|
-
/** Free text is allowed in addition to the options. */
|
|
431
|
-
edit: boolean;
|
|
432
|
-
options: FormFieldOption[];
|
|
433
|
-
}
|
|
434
|
-
/** A list box. Write with `{ type: 'choice', values }`. */
|
|
435
|
-
interface ListBoxFieldDTO extends FormFieldBase {
|
|
436
|
-
family: 'listbox';
|
|
437
|
-
/** Selected option export values, in option order. */
|
|
438
|
-
selectedValues: string[];
|
|
439
|
-
/** Whether several options may be selected at once. */
|
|
440
|
-
multiSelect: boolean;
|
|
441
|
-
options: FormFieldOption[];
|
|
442
|
-
}
|
|
443
|
-
/** A push button: pure trigger, holds no value. Never written or exported. */
|
|
444
|
-
interface PushButtonFieldDTO extends FormFieldBase {
|
|
445
|
-
family: 'pushbutton';
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* A signature field. Identity and placement only for now — the engine
|
|
449
|
-
* never writes signature values; signing is a future capability.
|
|
450
|
-
*/
|
|
451
|
-
interface SignatureFieldDTO extends FormFieldBase {
|
|
452
|
-
family: 'signature';
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Forward-compat placeholder for field types the engine does not model,
|
|
456
|
-
* mirroring the `unsupported` annotation kind. Round-trips safely.
|
|
457
|
-
*/
|
|
458
|
-
interface UnknownFieldDTO extends FormFieldBase {
|
|
459
|
-
family: 'unknown';
|
|
460
|
-
/** The raw /V value as text, for diagnostics. */
|
|
461
|
-
rawValue: string;
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* A logical form field. Discriminated on `family`:
|
|
465
|
-
*
|
|
466
|
-
* ```ts
|
|
467
|
-
* if (field.family === 'listbox') {
|
|
468
|
-
* field.selectedValues; // string[]
|
|
469
|
-
* }
|
|
470
|
-
* ```
|
|
471
|
-
*/
|
|
472
|
-
type FormFieldDTO$1 = TextFieldDTO | CheckboxFieldDTO | RadioFieldDTO | ComboBoxFieldDTO | ListBoxFieldDTO | PushButtonFieldDTO | SignatureFieldDTO | UnknownFieldDTO;
|
|
473
|
-
//#endregion
|
|
474
|
-
//#region src/forms/snapshot.d.ts
|
|
475
|
-
/**
|
|
476
|
-
* What kind of interactive form the document declares.
|
|
477
|
-
*
|
|
478
|
-
* - `none` — no /AcroForm dictionary. Recovered fields may still exist
|
|
479
|
-
* (see {@link FormFieldOrigin}); `repair()` can bootstrap the dictionary.
|
|
480
|
-
* - `acroform` — a standard AcroForm.
|
|
481
|
-
* - `xfa` — the /AcroForm carries an /XFA entry. The engine serves the
|
|
482
|
-
* AcroForm shell read-only and never executes XFA.
|
|
483
|
-
*/
|
|
484
|
-
type FormKind = 'none' | 'acroform' | 'xfa';
|
|
485
|
-
/**
|
|
486
|
-
* The document's complete form state at one instant: the reconciled field
|
|
487
|
-
* tree flattened to terminal fields with fully qualified names.
|
|
488
|
-
*
|
|
489
|
-
* Snapshots are detached and immutable — any mutation (a value write, an
|
|
490
|
-
* annotation edit, a page operation) makes previously returned snapshots
|
|
491
|
-
* stale. Re-read after mutating; the engine caches the underlying model
|
|
492
|
-
* per document version, so repeated reads between mutations are cheap.
|
|
493
|
-
*/
|
|
494
|
-
interface FormSnapshot {
|
|
495
|
-
formKind: FormKind;
|
|
496
|
-
/**
|
|
497
|
-
* Whether the /AcroForm sets /NeedAppearances (viewer-generated widget
|
|
498
|
-
* appearances). The engine bakes appearances on every write regardless;
|
|
499
|
-
* `repair({ bakeAppearances: true })` can clear the flag document-wide.
|
|
500
|
-
*/
|
|
501
|
-
needsAppearances: boolean;
|
|
502
|
-
fields: FormFieldDTO$1[];
|
|
503
|
-
/** `/AcroForm /CO` order; null preserves each malformed/unresolved slot. */
|
|
504
|
-
calculationOrder: Array<FormFieldRef | null>;
|
|
505
|
-
}
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region src/form.d.ts
|
|
508
|
-
/**
|
|
509
|
-
* The form plugin's renderer entry, ready for
|
|
510
|
-
* `<AnnotationLayer renderers={[formWidgetRenderer]} />`. It answers for the
|
|
511
|
-
* PLUGIN-registered 'form-widgets' Behavior — the form plugin decides when
|
|
512
|
-
* widgets are fill controls vs. editable annotations, never the app.
|
|
513
|
-
*/
|
|
514
|
-
declare const formWidgetRenderer: AnnotationRenderer;
|
|
515
|
-
/**
|
|
516
|
-
* Fill-mode form controls for one page, positioned from the form model's own
|
|
517
|
-
* widget geometry — the ANNOTATION-LESS path (a fill-only viewer whose page
|
|
518
|
-
* pixels come from an annotated RenderLayer raster). Active whenever the
|
|
519
|
-
* active tool carries the 'form-fill' tag (the built-in pointer/pan tools
|
|
520
|
-
* do); any other tool stands the controls down. Do not mount next to an
|
|
521
|
-
* AnnotationLayer wired with `formWidgetBehaviors`.
|
|
522
|
-
*/
|
|
523
|
-
declare function FormLayer(): import("react/jsx-runtime").JSX.Element | null;
|
|
524
|
-
/** The form capability — values, interchange, design-mode verbs. */
|
|
525
|
-
declare function useForm(): import("@embedpdf/plugin-form").FormCapability;
|
|
526
|
-
/** The reconciled form snapshot (null until the first load lands),
|
|
527
|
-
* re-rendering on every form model change. */
|
|
528
|
-
declare function useFormSnapshot(): FormSnapshot | null;
|
|
529
|
-
/**
|
|
530
|
-
* The FIELD behind the currently selected widget annotation (single
|
|
531
|
-
* selection), or null. The design-mode join: widget selection lives in the
|
|
532
|
-
* annotation plane, field properties live here.
|
|
533
|
-
*/
|
|
534
|
-
declare function useFormField(): FormFieldDTO | null;
|
|
535
|
-
//#endregion
|
|
536
|
-
export { useFormSnapshot as a, useFormField as i, formWidgetRenderer as n, useForm as r, FormLayer as t };
|
|
537
|
-
//# sourceMappingURL=form-Bdjk0Z3T.d.cts.map
|