@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
package/dist/index.d.cts CHANGED
@@ -1,24 +1,53 @@
1
- import { _ as FillItem, a as FormHostCapability, b as WidgetHit, d as PlacedField, f as WidgetActivationResult, g as FormToolDef, h as FORM_TOOL_BY_ID, i as FormCommitStatus, l as FormUiEffect, m as FORM_TOOLS, n as FormCapability, o as FormPluginOptions, p as AuthorableFormFamily, r as FormCommitResult, s as FormState, t as FormAction, u as PlaceFieldInput, v as Box, x as fieldKeyOf, y as FieldKey } from "./types-Bpc32Qmx.cjs";
2
- import { FormFieldDTO, FormFieldPatch, FormFieldRef, FormToken, WidgetAppearance } from "./contract.cjs";
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, _ 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, q as FormToken, 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 { t as FormHostCapability } from "./host-contract-1epLfK1S.cjs";
3
3
  import { FormScriptingController, createFormScriptingController } from "./scripting.cjs";
4
- import { createSerialQueue } from "@embedpdf/core";
4
+ import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
5
+ import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
5
6
  //#region src/form.plugin.d.ts
6
7
  /**
7
- * The form plugin: the FIELD plane. Document-scoped; requires the
8
- * interaction hub. Fill mode works with no annotation plugin at all —
9
- * geometry is read from the engine's widget DTOs. When the annotation
10
- * plugin IS present, a Behavior keeps widgets geometry-inert while the
11
- * active tool carries 'form-fill' (the built-in pointer/pan tools do, so
12
- * filling is the resting state) and stands the fill controls down under
13
- * every other tool — the single-active-tool hub IS the mode switch.
14
- * Design mode = the 'form-edit' / palette tools: no 'form-fill' tag, so
15
- * widgets become ordinary editable annotations.
8
+ * The form plugin: the field plane. Document-scoped; requires the
9
+ * interaction hub. Filling works without the annotation plugin, because
10
+ * widget geometry is read from the engine's widget records. The active tool
11
+ * is the mode switch: while it carries 'form-fill' (the built-in pointer and
12
+ * pan tools do, so filling is the resting state), the form layer draws and
13
+ * fills every widget. Design mode is the 'form-edit' and palette tools: with
14
+ * the annotation plugin present, the form lends it the widgets, which its
15
+ * tools then select, move, restyle and delete. The render plugin draws the
16
+ * widgets' pictures in both modes. `config` is the settings the app
17
+ * registers, over {@link FORM_DEFAULTS}.
16
18
  */
17
- declare const formPlugin: (options?: FormPluginOptions) => import("@embedpdf/core").PluginDef<FormState, FormAction, FormHostCapability>;
19
+ declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDef<Readonly<Record<string, never>>, FormHostCapability, FormSettings>;
18
20
  //#endregion
19
- //#region src/mutationQueue.d.ts
20
- /** The core serial queue under its historical form-plugin name. */
21
- declare const createSerialMutationQueue: typeof createSerialQueue;
21
+ //#region src/state.d.ts
22
+ declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, {
23
+ fields: readonly FormFieldDTO$1[];
24
+ status: import("@embedpdf/core").ResourceStatus;
25
+ formKind: import("@embedpdf/engine-core/runtime").FormKind;
26
+ selectedField: FormFieldDTO$1 | null;
27
+ }>;
22
28
  //#endregion
23
- export { type AuthorableFormFamily, type Box, FORM_TOOLS, FORM_TOOL_BY_ID, type FieldKey, type FillItem, type FormAction, type FormCapability, type FormCommitResult, type FormCommitStatus, type FormFieldDTO, type FormFieldPatch, type FormFieldRef, type FormPluginOptions, FormScriptingController, type FormState, FormToken, type FormToolDef, type FormUiEffect, type PlaceFieldInput, type PlacedField, type WidgetActivationResult, type WidgetAppearance, type WidgetHit, createFormScriptingController, createSerialMutationQueue, fieldKeyOf, formPlugin };
29
+ //#region src/tools/definitions.d.ts
30
+ /** The families the palette places. */
31
+ type AuthorableFormFamily = Exclude<FormFieldFamily$1, 'unknown'>;
32
+ interface FormToolDef {
33
+ id: string;
34
+ /** The field family the tool places (the form plane's vocabulary). */
35
+ family: AuthorableFormFamily;
36
+ /** The client kind the annotation registry routes on (props panel).
37
+ * Not a PDF subtype — every widget is PDF `widget`; this is the view. */
38
+ visualKind: 'widget-text' | 'widget-choice' | 'widget-button' | 'widget-toggle' | 'widget-radio' | 'widget-box';
39
+ /** What a bare click places (box policies only — fields are boxes). */
40
+ clickCreate: Extract<ClickCreate, {
41
+ width: number;
42
+ }>;
43
+ /** Seed drawing defaults, the widget's appearance fields: a placed field is
44
+ * visible (white box, gray border) and restylable per tool through the
45
+ * shared style panel. */
46
+ defaults: WidgetAppearance;
47
+ cursor: string;
48
+ }
49
+ declare const FORM_TOOLS: readonly FormToolDef[];
50
+ declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDef>;
51
+ //#endregion
52
+ export { type AuthorableFormFamily, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, type FormImportDrop, type FormImportDropReason, type FormImportOptions, FormImportResult, type FormKind, FormPlainValue, type FormRepairOptions, type FormRepairResult, FormResetResult, FormResyncedEvent, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, FormToken, type FormToolDef, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
24
53
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,24 +1,53 @@
1
- import { _ as FillItem, a as FormHostCapability, b as WidgetHit, d as PlacedField, f as WidgetActivationResult, g as FormToolDef, h as FORM_TOOL_BY_ID, i as FormCommitStatus, l as FormUiEffect, m as FORM_TOOLS, n as FormCapability, o as FormPluginOptions, p as AuthorableFormFamily, r as FormCommitResult, s as FormState, t as FormAction, u as PlaceFieldInput, v as Box, x as fieldKeyOf, y as FieldKey } from "./types-DRirhZKr.js";
2
- import { FormFieldDTO, FormFieldPatch, FormFieldRef, FormToken, WidgetAppearance } from "./contract.js";
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, _ 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, q as FormToken, 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 { t as FormHostCapability } from "./host-contract-BRYUbpT_.js";
3
3
  import { FormScriptingController, createFormScriptingController } from "./scripting.js";
4
- import { createSerialQueue } from "@embedpdf/core";
4
+ import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
5
+ import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
5
6
  //#region src/form.plugin.d.ts
6
7
  /**
7
- * The form plugin: the FIELD plane. Document-scoped; requires the
8
- * interaction hub. Fill mode works with no annotation plugin at all —
9
- * geometry is read from the engine's widget DTOs. When the annotation
10
- * plugin IS present, a Behavior keeps widgets geometry-inert while the
11
- * active tool carries 'form-fill' (the built-in pointer/pan tools do, so
12
- * filling is the resting state) and stands the fill controls down under
13
- * every other tool — the single-active-tool hub IS the mode switch.
14
- * Design mode = the 'form-edit' / palette tools: no 'form-fill' tag, so
15
- * widgets become ordinary editable annotations.
8
+ * The form plugin: the field plane. Document-scoped; requires the
9
+ * interaction hub. Filling works without the annotation plugin, because
10
+ * widget geometry is read from the engine's widget records. The active tool
11
+ * is the mode switch: while it carries 'form-fill' (the built-in pointer and
12
+ * pan tools do, so filling is the resting state), the form layer draws and
13
+ * fills every widget. Design mode is the 'form-edit' and palette tools: with
14
+ * the annotation plugin present, the form lends it the widgets, which its
15
+ * tools then select, move, restyle and delete. The render plugin draws the
16
+ * widgets' pictures in both modes. `config` is the settings the app
17
+ * registers, over {@link FORM_DEFAULTS}.
16
18
  */
17
- declare const formPlugin: (options?: FormPluginOptions) => import("@embedpdf/core").PluginDef<FormState, FormAction, FormHostCapability>;
19
+ declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDef<Readonly<Record<string, never>>, FormHostCapability, FormSettings>;
18
20
  //#endregion
19
- //#region src/mutationQueue.d.ts
20
- /** The core serial queue under its historical form-plugin name. */
21
- declare const createSerialMutationQueue: typeof createSerialQueue;
21
+ //#region src/state.d.ts
22
+ declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, {
23
+ fields: readonly FormFieldDTO$1[];
24
+ status: import("@embedpdf/core").ResourceStatus;
25
+ formKind: import("@embedpdf/engine-core/runtime").FormKind;
26
+ selectedField: FormFieldDTO$1 | null;
27
+ }>;
22
28
  //#endregion
23
- export { type AuthorableFormFamily, type Box, FORM_TOOLS, FORM_TOOL_BY_ID, type FieldKey, type FillItem, type FormAction, type FormCapability, type FormCommitResult, type FormCommitStatus, type FormFieldDTO, type FormFieldPatch, type FormFieldRef, type FormPluginOptions, FormScriptingController, type FormState, FormToken, type FormToolDef, type FormUiEffect, type PlaceFieldInput, type PlacedField, type WidgetActivationResult, type WidgetAppearance, type WidgetHit, createFormScriptingController, createSerialMutationQueue, fieldKeyOf, formPlugin };
29
+ //#region src/tools/definitions.d.ts
30
+ /** The families the palette places. */
31
+ type AuthorableFormFamily = Exclude<FormFieldFamily$1, 'unknown'>;
32
+ interface FormToolDef {
33
+ id: string;
34
+ /** The field family the tool places (the form plane's vocabulary). */
35
+ family: AuthorableFormFamily;
36
+ /** The client kind the annotation registry routes on (props panel).
37
+ * Not a PDF subtype — every widget is PDF `widget`; this is the view. */
38
+ visualKind: 'widget-text' | 'widget-choice' | 'widget-button' | 'widget-toggle' | 'widget-radio' | 'widget-box';
39
+ /** What a bare click places (box policies only — fields are boxes). */
40
+ clickCreate: Extract<ClickCreate, {
41
+ width: number;
42
+ }>;
43
+ /** Seed drawing defaults, the widget's appearance fields: a placed field is
44
+ * visible (white box, gray border) and restylable per tool through the
45
+ * shared style panel. */
46
+ defaults: WidgetAppearance;
47
+ cursor: string;
48
+ }
49
+ declare const FORM_TOOLS: readonly FormToolDef[];
50
+ declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDef>;
51
+ //#endregion
52
+ export { type AuthorableFormFamily, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, type FormImportDrop, type FormImportDropReason, type FormImportOptions, FormImportResult, type FormKind, FormPlainValue, type FormRepairOptions, type FormRepairResult, FormResetResult, FormResyncedEvent, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, FormToken, type FormToolDef, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
24
53
  //# sourceMappingURL=index.d.ts.map