@embedpdf/plugin-form 3.0.0-next.14 → 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 +14 -13
  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
@@ -1,3 +1,30 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_types = require("../types-C1uIIYfn.cjs");
3
- exports.FormToken = require_types.FormToken;
2
+ const require_contract = require("../contract-CU0jrI_D.cjs");
3
+ let _embedpdf_core = require("@embedpdf/core");
4
+ let _embedpdf_engine_core_public = require("@embedpdf/engine-core/public");
5
+ let _embedpdf_engine_core_runtime = require("@embedpdf/engine-core/runtime");
6
+ //#region src/host-contract.ts
7
+ /**
8
+ * @embedpdf/plugin-form/contract/host: the host lens, for the framework
9
+ * layers and the actions plugin: loading a page's widgets, the widget event
10
+ * feed, the text being typed, and the actions plugin's executors and sinks.
11
+ * Same runtime token as the public one, typed wider.
12
+ */
13
+ const FormToken = (0, _embedpdf_core.createHostToken)(require_contract.FormToken);
14
+ //#endregion
15
+ exports.FORM_DEFAULTS = require_contract.FORM_DEFAULTS;
16
+ exports.FormToken = FormToken;
17
+ Object.defineProperty(exports, "FormTransfer", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return _embedpdf_engine_core_public.FormTransfer;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "toFieldRef", {
24
+ enumerable: true,
25
+ get: function() {
26
+ return _embedpdf_engine_core_runtime.toFieldRef;
27
+ }
28
+ });
29
+
30
+ //# sourceMappingURL=host.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.cjs","names":["PublicFormToken"],"sources":["../../src/host-contract.ts"],"sourcesContent":["/**\n * @embedpdf/plugin-form/contract/host: the host lens, for the framework\n * layers and the actions plugin: loading a page's widgets, the widget event\n * feed, the text being typed, and the actions plugin's executors and sinks.\n * Same runtime token as the public one, typed wider.\n */\nimport { createHostToken } from '@embedpdf/core';\nimport type { TextEditorLayout } from '@embedpdf/core-form';\nimport type {\n AnnotationRef,\n FormEffect,\n FormFieldRef,\n PageRef,\n PdfActionTargetRef,\n} from '@embedpdf/engine-core/runtime';\nimport type {\n ActionContext,\n ActionDiagnostic,\n ActionOrigin,\n ActionSubmitRequest,\n PdfAnnotationEventKind,\n SubmitIntent,\n} from '@embedpdf/plugin-actions/contract';\nimport type { FormCommitSinkResult } from '@embedpdf/plugin-actions/contract/host';\nimport type { AppearancePicture } from '@embedpdf/plugin-render/contract/host';\n\nimport type { FormCapability, FormCommitResult, FormSetValueResult } from './contract';\nimport type { Box, ShownWidget } from './model';\nimport type { WidgetPainting } from './services/looks';\nimport { FormToken as PublicFormToken } from './token';\n\nexport * from './contract';\nexport type { ShownWidget } from './model';\nexport type { WidgetPainting } from './services/looks';\nexport type { TextEditorLayout } from '@embedpdf/core-form';\n\n/**\n * The host lens: members for the framework layers and sibling plugins (the\n * widget event feed, the text being typed, and the actions plugin's\n * executors and sinks). Application code uses the public capability.\n */\nexport interface FormHostCapability extends FormCapability {\n /** Load a page's widgets (one annotation read per page), so `listWidgets(page)` has them. */\n ensureLoaded(page: PageRef): Promise<void>;\n /**\n * The widgets a page shows, in the order the page draws them, each with the appearance state it\n * shows and whether its look is `pending` (the view's isn't the confirmed one yet); hidden ones\n * are left out. The form layer paints their pictures from it, and the painter's drawing\n * (`getWidgetPainting`) for a pending one or one whose picture is older than its look. In design\n * mode, while the widgets are lent to the annotation plugin, none: the annotation layer draws\n * them.\n */\n listShownWidgets(page: PageRef): readonly ShownWidget[];\n /**\n * What a page's widget pictures depend on: its widgets at their picture\n * versions (`5@2|6@7`). Load the pictures again when it changes, or when\n * the appearance scale does. A checkbox that only switches its state\n * doesn't move it.\n */\n getAppearanceEpoch(page: PageRef): string;\n /**\n * Every picture of a page's widgets, at rest, in every state, each with the\n * picture version of its widget (`ShownWidget.pictureVersion`), through the\n * render plugin; none without it. The form layer and design mode share them.\n */\n renderAppearances(\n page: PageRef,\n scale: number,\n signal?: AbortSignal,\n ): Promise<readonly AppearancePicture[]>;\n /**\n * What the widget looks like as the view has it, drawn by the painter (`@embedpdf/core-form`): its\n * scene in page space, its text in the engine's own faces (each glyphs node carries the program\n * to mount). The same object while nothing it shows changes; `null` for a widget the painter\n * doesn't draw (a signature).\n */\n getWidgetPainting(widget: AnnotationRef): WidgetPainting | null;\n /**\n * Where a text field's editor shows `text` (what is typed in it), so it sits where the engine\n * will draw it: the face, the size the engine draws at (a fitted size resolved for `text`),\n * the text's box inside the widget's, one line's height and a comb's spacing, in page points.\n * `null` for a widget that isn't a text field's.\n */\n getTextEditorLayout(widget: AnnotationRef, text: string): TextEditorLayout | null;\n /** The page box in page space, for keeping a placement on the page; `null` for a page that isn't there. */\n getPageBox(page: PageRef): Box | null;\n /** Send a widget's pointer or focus event to the actions plugin, which runs its `/AA` actions. */\n notifyWidgetEvent(\n field: FormFieldRef,\n widget: AnnotationRef,\n event: PdfAnnotationEventKind,\n ): void;\n /** Run a ResetForm action: reset the fields it names (or all but them), then recalculate. */\n resetFormAction(\n fields: PdfActionTargetRef[] | null,\n exclude: boolean,\n origin?: ActionOrigin,\n ): Promise<FormCommitResult>;\n /** The fields a SubmitForm action sends: the form as the user sees it, once every fill on its way is answered. */\n resolveSubmitDataset(\n intent: SubmitIntent,\n actionContext: ActionContext,\n diagnose: (diagnostic: ActionDiagnostic) => void,\n ): Promise<ActionSubmitRequest>;\n /**\n * Write what a document script changed in the fields, with the calculations a value causes,\n * as one change: shown at once, sent once the script's transaction ends. Never rejects; a\n * change it can't stage reports why, and the engine's refusal comes through the change queue.\n */\n commitScriptFormEffects(effects: FormEffect[]): Promise<FormCommitSinkResult>;\n /**\n * The text someone is typing in a field, before it's written (write/typing.ts): a keystroke\n * calls `draftText`, blur or Enter `commitDraftText` (the field's scripts run then), Escape\n * `discardDraftText`. A download writes a draft first, like Acrobat commits the field being\n * edited before it saves. `commitDraftText` resolves `null` when there's nothing to write.\n */\n draftText(field: FormFieldRef, text: string): void;\n commitDraftText(field: FormFieldRef): Promise<FormSetValueResult | null>;\n discardDraftText(field: FormFieldRef): void;\n}\n\nexport const FormToken = createHostToken<FormHostCapability>(PublicFormToken);\n"],"mappings":";;;;;;;;;;;;AAyHA,MAAa,aAAA,GAAA,eAAA,gBAAA,CAAgDA,iBAAAA,SAAe"}
@@ -1,2 +1,3 @@
1
- import { a as FormHostCapability, c as FormToken } from "../types-Bpc32Qmx.cjs";
2
- export { type FormHostCapability, FormToken };
1
+ import { A as FormRepairResult, B as FormValidationRejectedEvent, C as FormImportDrop, D as FormKind, E as FormImportResult, F as FormSettings, G as WidgetAnnotation, H as FormWidgetAddResult, I as FormSnapshot, J as FormWidgetItem, K as toFieldRef, L as FormTransfer, M as FormResyncedEvent, N as FormSetValueResult, O as FormPlainValue, P as FormSetValueStatus, Q as WidgetHit, R as FormUiEffect, S as FormFilter, T as FormImportOptions, U as WidgetActivationResult, V as FormValueChangedEvent, W as WidgetAddress, X as FormWidgetLook, Y as Box, Z as ShownWidget, _ as FormFieldResult, a as FormCommitResult, b as FormFieldUpdatedEvent, c as FormExportSelection, d as FormFieldDeletedEvent, f as FormFieldDraft, g as FormFieldRef, h as FormFieldPatch, i as FormCapability, j as FormResetResult, k as FormRepairOptions, l as FormFieldCreatedEvent, m as FormFieldFlagSetting, n as FillableFields, o as FormCommitStatus, p as FormFieldFamily, r as FormBundle, s as FormConfig, t as FORM_DEFAULTS, u as FormFieldDTO, v as FormFieldSetting, w as FormImportDropReason, x as FormFieldValue, y as FormFieldSettings, z as FormValidation } from "../contract-D-yQxw3H.cjs";
2
+ import { i as WidgetPainting, n as FormToken, r as TextEditorLayout, t as FormHostCapability } from "../host-contract-1epLfK1S.cjs";
3
+ export { type Box, FORM_DEFAULTS, FillableFields, type FormBundle, FormCapability, FormCommitResult, FormCommitStatus, FormConfig, FormExportSelection, FormFieldCreatedEvent, type FormFieldDTO, FormFieldDeletedEvent, type FormFieldDraft, type FormFieldFamily, FormFieldFlagSetting, type FormFieldPatch, type FormFieldRef, FormFieldResult, FormFieldSetting, FormFieldSettings, FormFieldUpdatedEvent, type FormFieldValue, FormFilter, FormHostCapability, type FormImportDrop, type FormImportDropReason, type FormImportOptions, FormImportResult, type FormKind, FormPlainValue, type FormRepairOptions, type FormRepairResult, FormResetResult, FormResyncedEvent, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, FormToken, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, type ShownWidget, type TextEditorLayout, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, type WidgetPainting, toFieldRef };
@@ -1,2 +1,3 @@
1
- import { a as FormHostCapability, c as FormToken } from "../types-DRirhZKr.js";
2
- export { type FormHostCapability, FormToken };
1
+ import { A as FormRepairResult, B as FormValidationRejectedEvent, C as FormImportDrop, D as FormKind, E as FormImportResult, F as FormSettings, G as WidgetAnnotation, H as FormWidgetAddResult, I as FormSnapshot, J as FormWidgetItem, K as toFieldRef, L as FormTransfer, M as FormResyncedEvent, N as FormSetValueResult, O as FormPlainValue, P as FormSetValueStatus, Q as WidgetHit, R as FormUiEffect, S as FormFilter, T as FormImportOptions, U as WidgetActivationResult, V as FormValueChangedEvent, W as WidgetAddress, X as FormWidgetLook, Y as Box, Z as ShownWidget, _ as FormFieldResult, a as FormCommitResult, b as FormFieldUpdatedEvent, c as FormExportSelection, d as FormFieldDeletedEvent, f as FormFieldDraft, g as FormFieldRef, h as FormFieldPatch, i as FormCapability, j as FormResetResult, k as FormRepairOptions, l as FormFieldCreatedEvent, m as FormFieldFlagSetting, n as FillableFields, o as FormCommitStatus, p as FormFieldFamily, r as FormBundle, s as FormConfig, t as FORM_DEFAULTS, u as FormFieldDTO, v as FormFieldSetting, w as FormImportDropReason, x as FormFieldValue, y as FormFieldSettings, z as FormValidation } from "../contract-BwcgtCOD.js";
2
+ import { i as WidgetPainting, n as FormToken, r as TextEditorLayout, t as FormHostCapability } from "../host-contract-BRYUbpT_.js";
3
+ export { type Box, FORM_DEFAULTS, FillableFields, type FormBundle, FormCapability, FormCommitResult, FormCommitStatus, FormConfig, FormExportSelection, FormFieldCreatedEvent, type FormFieldDTO, FormFieldDeletedEvent, type FormFieldDraft, type FormFieldFamily, FormFieldFlagSetting, type FormFieldPatch, type FormFieldRef, FormFieldResult, FormFieldSetting, FormFieldSettings, FormFieldUpdatedEvent, type FormFieldValue, FormFilter, FormHostCapability, type FormImportDrop, type FormImportDropReason, type FormImportOptions, FormImportResult, type FormKind, FormPlainValue, type FormRepairOptions, type FormRepairResult, FormResetResult, FormResyncedEvent, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, FormToken, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, type ShownWidget, type TextEditorLayout, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, type WidgetPainting, toFieldRef };
@@ -1,2 +1,14 @@
1
- import { t as FormToken } from "../types-DkQmmcTG.js";
2
- export { FormToken };
1
+ import { i as FormToken$1, n as FormTransfer, r as toFieldRef, t as FORM_DEFAULTS } from "../contract-DcncvPcF.js";
2
+ import { createHostToken } from "@embedpdf/core";
3
+ //#region src/host-contract.ts
4
+ /**
5
+ * @embedpdf/plugin-form/contract/host: the host lens, for the framework
6
+ * layers and the actions plugin: loading a page's widgets, the widget event
7
+ * feed, the text being typed, and the actions plugin's executors and sinks.
8
+ * Same runtime token as the public one, typed wider.
9
+ */
10
+ const FormToken = createHostToken(FormToken$1);
11
+ //#endregion
12
+ export { FORM_DEFAULTS, FormToken, FormTransfer, toFieldRef };
13
+
14
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","names":["PublicFormToken"],"sources":["../../src/host-contract.ts"],"sourcesContent":["/**\n * @embedpdf/plugin-form/contract/host: the host lens, for the framework\n * layers and the actions plugin: loading a page's widgets, the widget event\n * feed, the text being typed, and the actions plugin's executors and sinks.\n * Same runtime token as the public one, typed wider.\n */\nimport { createHostToken } from '@embedpdf/core';\nimport type { TextEditorLayout } from '@embedpdf/core-form';\nimport type {\n AnnotationRef,\n FormEffect,\n FormFieldRef,\n PageRef,\n PdfActionTargetRef,\n} from '@embedpdf/engine-core/runtime';\nimport type {\n ActionContext,\n ActionDiagnostic,\n ActionOrigin,\n ActionSubmitRequest,\n PdfAnnotationEventKind,\n SubmitIntent,\n} from '@embedpdf/plugin-actions/contract';\nimport type { FormCommitSinkResult } from '@embedpdf/plugin-actions/contract/host';\nimport type { AppearancePicture } from '@embedpdf/plugin-render/contract/host';\n\nimport type { FormCapability, FormCommitResult, FormSetValueResult } from './contract';\nimport type { Box, ShownWidget } from './model';\nimport type { WidgetPainting } from './services/looks';\nimport { FormToken as PublicFormToken } from './token';\n\nexport * from './contract';\nexport type { ShownWidget } from './model';\nexport type { WidgetPainting } from './services/looks';\nexport type { TextEditorLayout } from '@embedpdf/core-form';\n\n/**\n * The host lens: members for the framework layers and sibling plugins (the\n * widget event feed, the text being typed, and the actions plugin's\n * executors and sinks). Application code uses the public capability.\n */\nexport interface FormHostCapability extends FormCapability {\n /** Load a page's widgets (one annotation read per page), so `listWidgets(page)` has them. */\n ensureLoaded(page: PageRef): Promise<void>;\n /**\n * The widgets a page shows, in the order the page draws them, each with the appearance state it\n * shows and whether its look is `pending` (the view's isn't the confirmed one yet); hidden ones\n * are left out. The form layer paints their pictures from it, and the painter's drawing\n * (`getWidgetPainting`) for a pending one or one whose picture is older than its look. In design\n * mode, while the widgets are lent to the annotation plugin, none: the annotation layer draws\n * them.\n */\n listShownWidgets(page: PageRef): readonly ShownWidget[];\n /**\n * What a page's widget pictures depend on: its widgets at their picture\n * versions (`5@2|6@7`). Load the pictures again when it changes, or when\n * the appearance scale does. A checkbox that only switches its state\n * doesn't move it.\n */\n getAppearanceEpoch(page: PageRef): string;\n /**\n * Every picture of a page's widgets, at rest, in every state, each with the\n * picture version of its widget (`ShownWidget.pictureVersion`), through the\n * render plugin; none without it. The form layer and design mode share them.\n */\n renderAppearances(\n page: PageRef,\n scale: number,\n signal?: AbortSignal,\n ): Promise<readonly AppearancePicture[]>;\n /**\n * What the widget looks like as the view has it, drawn by the painter (`@embedpdf/core-form`): its\n * scene in page space, its text in the engine's own faces (each glyphs node carries the program\n * to mount). The same object while nothing it shows changes; `null` for a widget the painter\n * doesn't draw (a signature).\n */\n getWidgetPainting(widget: AnnotationRef): WidgetPainting | null;\n /**\n * Where a text field's editor shows `text` (what is typed in it), so it sits where the engine\n * will draw it: the face, the size the engine draws at (a fitted size resolved for `text`),\n * the text's box inside the widget's, one line's height and a comb's spacing, in page points.\n * `null` for a widget that isn't a text field's.\n */\n getTextEditorLayout(widget: AnnotationRef, text: string): TextEditorLayout | null;\n /** The page box in page space, for keeping a placement on the page; `null` for a page that isn't there. */\n getPageBox(page: PageRef): Box | null;\n /** Send a widget's pointer or focus event to the actions plugin, which runs its `/AA` actions. */\n notifyWidgetEvent(\n field: FormFieldRef,\n widget: AnnotationRef,\n event: PdfAnnotationEventKind,\n ): void;\n /** Run a ResetForm action: reset the fields it names (or all but them), then recalculate. */\n resetFormAction(\n fields: PdfActionTargetRef[] | null,\n exclude: boolean,\n origin?: ActionOrigin,\n ): Promise<FormCommitResult>;\n /** The fields a SubmitForm action sends: the form as the user sees it, once every fill on its way is answered. */\n resolveSubmitDataset(\n intent: SubmitIntent,\n actionContext: ActionContext,\n diagnose: (diagnostic: ActionDiagnostic) => void,\n ): Promise<ActionSubmitRequest>;\n /**\n * Write what a document script changed in the fields, with the calculations a value causes,\n * as one change: shown at once, sent once the script's transaction ends. Never rejects; a\n * change it can't stage reports why, and the engine's refusal comes through the change queue.\n */\n commitScriptFormEffects(effects: FormEffect[]): Promise<FormCommitSinkResult>;\n /**\n * The text someone is typing in a field, before it's written (write/typing.ts): a keystroke\n * calls `draftText`, blur or Enter `commitDraftText` (the field's scripts run then), Escape\n * `discardDraftText`. A download writes a draft first, like Acrobat commits the field being\n * edited before it saves. `commitDraftText` resolves `null` when there's nothing to write.\n */\n draftText(field: FormFieldRef, text: string): void;\n commitDraftText(field: FormFieldRef): Promise<FormSetValueResult | null>;\n discardDraftText(field: FormFieldRef): void;\n}\n\nexport const FormToken = createHostToken<FormHostCapability>(PublicFormToken);\n"],"mappings":";;;;;;;;;AAyHA,MAAa,YAAY,gBAAoCA,WAAe"}