@embedpdf/plugin-form 3.0.0-next.13 → 3.0.0-next.15

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.
Files changed (47) hide show
  1. package/dist/contract/host.cjs +29 -2
  2. package/dist/contract/host.cjs.map +1 -0
  3. package/dist/contract/host.d.cts +3 -2
  4. package/dist/contract/host.d.ts +3 -2
  5. package/dist/contract/host.js +14 -2
  6. package/dist/contract/host.js.map +1 -0
  7. package/dist/contract-BwcgtCOD.d.ts +566 -0
  8. package/dist/contract-CU0jrI_D.cjs +56 -0
  9. package/dist/contract-CU0jrI_D.cjs.map +1 -0
  10. package/dist/contract-D-yQxw3H.d.cts +566 -0
  11. package/dist/contract-DcncvPcF.js +45 -0
  12. package/dist/contract-DcncvPcF.js.map +1 -0
  13. package/dist/contract.cjs +17 -6
  14. package/dist/contract.d.cts +2 -8
  15. package/dist/contract.d.ts +2 -8
  16. package/dist/contract.js +2 -7
  17. package/dist/controller-CS6tV2m1.cjs +514 -0
  18. package/dist/controller-CS6tV2m1.cjs.map +1 -0
  19. package/dist/controller-Sr5M_8G8.js +497 -0
  20. package/dist/controller-Sr5M_8G8.js.map +1 -0
  21. package/dist/host-contract-1epLfK1S.d.cts +87 -0
  22. package/dist/host-contract-BRYUbpT_.d.ts +87 -0
  23. package/dist/index.cjs +2916 -1205
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +46 -17
  26. package/dist/index.d.ts +46 -17
  27. package/dist/index.js +2895 -1206
  28. package/dist/index.js.map +1 -1
  29. package/dist/scripting.cjs +3 -484
  30. package/dist/scripting.d.cts +58 -22
  31. package/dist/scripting.d.ts +58 -22
  32. package/dist/scripting.js +1 -482
  33. package/package.json +15 -14
  34. package/dist/contract.cjs.map +0 -1
  35. package/dist/contract.js.map +0 -1
  36. package/dist/internal.cjs +0 -4
  37. package/dist/internal.d.cts +0 -3
  38. package/dist/internal.d.ts +0 -3
  39. package/dist/internal.js +0 -3
  40. package/dist/scripting.cjs.map +0 -1
  41. package/dist/scripting.js.map +0 -1
  42. package/dist/types-Bpc32Qmx.d.cts +0 -309
  43. package/dist/types-C1uIIYfn.cjs +0 -16
  44. package/dist/types-C1uIIYfn.cjs.map +0 -1
  45. package/dist/types-DRirhZKr.d.ts +0 -309
  46. package/dist/types-DkQmmcTG.js +0 -12
  47. package/dist/types-DkQmmcTG.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ import { N as FormSetValueResult, Y as Box, Z as ShownWidget, a as FormCommitResult, i as FormCapability } from "./contract-BwcgtCOD.js";
2
+ import "@embedpdf/core";
3
+ import { ActionContext, ActionDiagnostic, ActionOrigin, ActionSubmitRequest, PdfAnnotationEventKind, SubmitIntent } from "@embedpdf/plugin-actions/contract";
4
+ import { AnnotationRef, FormEffect, FormFieldDTO, FormFieldRef, PageRef, PdfActionTargetRef, WidgetAnnotation } from "@embedpdf/engine-core/runtime";
5
+ import { FormCommitSinkResult } from "@embedpdf/plugin-actions/contract/host";
6
+ import { SceneNode } from "@embedpdf/core-annotation";
7
+ import { TextEditorLayout, TextEditorLayout as TextEditorLayout$1 } from "@embedpdf/core-form";
8
+ import { AppearancePicture } from "@embedpdf/plugin-render/contract/host";
9
+ //#region src/services/looks.d.ts
10
+ /** A widget as the painter draws it: its scene on the page (its text carries the faces it needs). */
11
+ interface WidgetPainting {
12
+ readonly scene: readonly SceneNode[];
13
+ }
14
+ //#endregion
15
+ //#region src/host-contract.d.ts
16
+ /**
17
+ * The host lens: members for the framework layers and sibling plugins (the
18
+ * widget event feed, the text being typed, and the actions plugin's
19
+ * executors and sinks). Application code uses the public capability.
20
+ */
21
+ interface FormHostCapability extends FormCapability {
22
+ /** Load a page's widgets (one annotation read per page), so `listWidgets(page)` has them. */
23
+ ensureLoaded(page: PageRef): Promise<void>;
24
+ /**
25
+ * The widgets a page shows, in the order the page draws them, each with the appearance state it
26
+ * shows and whether its look is `pending` (the view's isn't the confirmed one yet); hidden ones
27
+ * are left out. The form layer paints their pictures from it, and the painter's drawing
28
+ * (`getWidgetPainting`) for a pending one or one whose picture is older than its look. In design
29
+ * mode, while the widgets are lent to the annotation plugin, none: the annotation layer draws
30
+ * them.
31
+ */
32
+ listShownWidgets(page: PageRef): readonly ShownWidget[];
33
+ /**
34
+ * What a page's widget pictures depend on: its widgets at their picture
35
+ * versions (`5@2|6@7`). Load the pictures again when it changes, or when
36
+ * the appearance scale does. A checkbox that only switches its state
37
+ * doesn't move it.
38
+ */
39
+ getAppearanceEpoch(page: PageRef): string;
40
+ /**
41
+ * Every picture of a page's widgets, at rest, in every state, each with the
42
+ * picture version of its widget (`ShownWidget.pictureVersion`), through the
43
+ * render plugin; none without it. The form layer and design mode share them.
44
+ */
45
+ renderAppearances(page: PageRef, scale: number, signal?: AbortSignal): Promise<readonly AppearancePicture[]>;
46
+ /**
47
+ * What the widget looks like as the view has it, drawn by the painter (`@embedpdf/core-form`): its
48
+ * scene in page space, its text in the engine's own faces (each glyphs node carries the program
49
+ * to mount). The same object while nothing it shows changes; `null` for a widget the painter
50
+ * doesn't draw (a signature).
51
+ */
52
+ getWidgetPainting(widget: AnnotationRef): WidgetPainting | null;
53
+ /**
54
+ * Where a text field's editor shows `text` (what is typed in it), so it sits where the engine
55
+ * will draw it: the face, the size the engine draws at (a fitted size resolved for `text`),
56
+ * the text's box inside the widget's, one line's height and a comb's spacing, in page points.
57
+ * `null` for a widget that isn't a text field's.
58
+ */
59
+ getTextEditorLayout(widget: AnnotationRef, text: string): TextEditorLayout | null;
60
+ /** The page box in page space, for keeping a placement on the page; `null` for a page that isn't there. */
61
+ getPageBox(page: PageRef): Box | null;
62
+ /** Send a widget's pointer or focus event to the actions plugin, which runs its `/AA` actions. */
63
+ notifyWidgetEvent(field: FormFieldRef, widget: AnnotationRef, event: PdfAnnotationEventKind): void;
64
+ /** Run a ResetForm action: reset the fields it names (or all but them), then recalculate. */
65
+ resetFormAction(fields: PdfActionTargetRef[] | null, exclude: boolean, origin?: ActionOrigin): Promise<FormCommitResult>;
66
+ /** The fields a SubmitForm action sends: the form as the user sees it, once every fill on its way is answered. */
67
+ resolveSubmitDataset(intent: SubmitIntent, actionContext: ActionContext, diagnose: (diagnostic: ActionDiagnostic) => void): Promise<ActionSubmitRequest>;
68
+ /**
69
+ * Write what a document script changed in the fields, with the calculations a value causes,
70
+ * as one change: shown at once, sent once the script's transaction ends. Never rejects; a
71
+ * change it can't stage reports why, and the engine's refusal comes through the change queue.
72
+ */
73
+ commitScriptFormEffects(effects: FormEffect[]): Promise<FormCommitSinkResult>;
74
+ /**
75
+ * The text someone is typing in a field, before it's written (write/typing.ts): a keystroke
76
+ * calls `draftText`, blur or Enter `commitDraftText` (the field's scripts run then), Escape
77
+ * `discardDraftText`. A download writes a draft first, like Acrobat commits the field being
78
+ * edited before it saves. `commitDraftText` resolves `null` when there's nothing to write.
79
+ */
80
+ draftText(field: FormFieldRef, text: string): void;
81
+ commitDraftText(field: FormFieldRef): Promise<FormSetValueResult | null>;
82
+ discardDraftText(field: FormFieldRef): void;
83
+ }
84
+ declare const FormToken: import("@embedpdf/core").CapabilityToken<FormHostCapability>;
85
+ //#endregion
86
+ export { WidgetPainting as i, FormToken as n, TextEditorLayout$1 as r, FormHostCapability as t };
87
+ //# sourceMappingURL=host-contract-BRYUbpT_.d.ts.map