@embedpdf/plugin-form 3.3.0 → 3.4.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.
@@ -1,2 +1,2 @@
1
- import { $ as FormWidgetItem, A as FormImportOptions, B as FormSettings, C as FormFieldValue, D as FormFocusOptions, E as FormFocusNextOptions, F as FormRepairResult, G as FormValidationRejectedEvent, H as FormTransfer, I as FormResetResult, J as WidgetActivationResult, K as FormValueChangedEvent, L as FormResyncedEvent, M as FormKind, N as FormPlainValue, O as FormImportDrop, P as FormRepairOptions, Q as FormToken, R as FormSetValueResult, S as FormFieldUpdatedEvent, T as FormFocusChangedEvent, U as FormUiEffect, V as FormSnapshot, W as FormValidation, X as WidgetAnnotation, Y as WidgetAddress, Z as toFieldRef, _ as FormFieldPatch, a as FormCommitResult, b as FormFieldSetting, c as FormDuplicateOptions, d as FormField, et as Box, f as FormFieldCreatedEvent, g as FormFieldKind, h as FormFieldFlagSetting, i as FormCapability, it as WidgetHit, j as FormImportResult, k as FormImportDropReason, l as FormDuplicateResult, m as FormFieldDraft, n as FillableFields, nt as FormWidgetLook, o as FormCommitStatus, p as FormFieldDeletedEvent, q as FormWidgetAddResult, r as FormBundle, s as FormConfig, t as FORM_DEFAULTS, u as FormExportSelection, v as FormFieldRef, w as FormFilter, x as FormFieldSettings, y as FormFieldResult, z as FormSetValueStatus } from "./contract-DJLVUeAe.js";
2
- export { type Box, FORM_DEFAULTS, FillableFields, type FormBundle, FormCapability, FormCommitResult, FormCommitStatus, FormConfig, FormDuplicateOptions, FormDuplicateResult, FormExportSelection, type FormField, FormFieldCreatedEvent, FormFieldDeletedEvent, type FormFieldDraft, FormFieldFlagSetting, type FormFieldKind, type FormFieldPatch, type FormFieldRef, FormFieldResult, FormFieldSetting, FormFieldSettings, FormFieldUpdatedEvent, type FormFieldValue, FormFilter, FormFocusChangedEvent, FormFocusNextOptions, FormFocusOptions, 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, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, toFieldRef };
1
+ import { $ as WidgetActivationResult, A as FormGroupMoveResult, B as FormResetResult, C as FormFieldUpdatedEvent, D as FormFocusNextOptions, E as FormFocusChangedEvent, F as FormImportResult, G as FormSnapshot, H as FormSetValueResult, I as FormKind, J as FormValidation, K as FormTransfer, L as FormPlainValue, M as FormImportDrop, N as FormImportDropReason, O as FormFocusOptions, P as FormImportOptions, Q as FormWidgetAnchor, R as FormRepairOptions, S as FormFieldSettings, T as FormFilter, U as FormSetValueStatus, V as FormResyncedEvent, W as FormSettings, X as FormValueChangedEvent, Y as FormValidationRejectedEvent, Z as FormWidgetAddResult, _ as FormFieldKind, a as FormCommitResult, at as GroupPosition, b as FormFieldResult, c as FormDesignGroupChangedEvent, d as FormExportSelection, dt as WidgetHit, et as WidgetAddress, f as FormField, ft as WidgetPlace, g as FormFieldFlagSetting, h as FormFieldDraft, i as FormCapability, it as FormWidgetItem, j as FormGroupsChangedEvent, k as FormGroupInput, l as FormDuplicateOptions, lt as FormWidgetLook, m as FormFieldDeletedEvent, n as FillableFields, nt as toFieldRef, o as FormCommitStatus, ot as FormGroup, p as FormFieldCreatedEvent, q as FormUiEffect, r as FormBundle, rt as FormToken, s as FormConfig, st as Box, t as FORM_DEFAULTS, tt as WidgetAnnotation, u as FormDuplicateResult, v as FormFieldPatch, w as FormFieldValue, x as FormFieldSetting, y as FormFieldRef, z as FormRepairResult } from "./contract-BkTJQ39E.js";
2
+ export { type Box, FORM_DEFAULTS, FillableFields, type FormBundle, FormCapability, FormCommitResult, FormCommitStatus, FormConfig, FormDesignGroupChangedEvent, FormDuplicateOptions, FormDuplicateResult, FormExportSelection, type FormField, FormFieldCreatedEvent, FormFieldDeletedEvent, type FormFieldDraft, FormFieldFlagSetting, type FormFieldKind, type FormFieldPatch, type FormFieldRef, FormFieldResult, FormFieldSetting, FormFieldSettings, FormFieldUpdatedEvent, type FormFieldValue, FormFilter, FormFocusChangedEvent, FormFocusNextOptions, FormFocusOptions, type FormGroup, FormGroupInput, FormGroupMoveResult, FormGroupsChangedEvent, 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, FormWidgetAnchor, type FormWidgetItem, type FormWidgetLook, type GroupPosition, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, type WidgetPlace, toFieldRef };
package/dist/contract.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as FormToken, n as FormTransfer, r as toFieldRef, t as FORM_DEFAULTS } from "./contract-Bu3RA2jA.js";
1
+ import { i as FormToken, n as FormTransfer, r as toFieldRef, t as FORM_DEFAULTS } from "./contract-J_QN_Igp.js";
2
2
  export { FORM_DEFAULTS, FormToken, FormTransfer, toFieldRef };
@@ -1,12 +1,12 @@
1
- import { R as FormSetValueResult, a as FormCommitResult, et as Box, i as FormCapability, rt as ShownWidget } from "./contract-Bq_ewUE5.cjs";
1
+ import { H as FormSetValueResult, Q as FormWidgetAnchor, a as FormCommitResult, i as FormCapability, st as Box, ut as ShownWidget } from "./contract-B7rB7jYx.cjs";
2
2
  import "@embedpdf/core";
3
3
  import { AnnotationRef, FormEffect, FormField, FormFieldRef, PageRef, PdfActionTargetRef, WidgetAnnotation } from "@embedpdf/engine-core/runtime";
4
4
  import { ActionContext, ActionDiagnostic, ActionOrigin, ActionSubmitRequest, PdfAnnotationEventKind, SubmitIntent } from "@embedpdf/plugin-actions/contract";
5
+ import { SceneNode } from "@embedpdf/core-annotation";
5
6
  import { TextEditorLayout, TextEditorLayout as TextEditorLayout$1 } from "@embedpdf/core-form";
6
7
  import { FormCommitSinkResult } from "@embedpdf/plugin-actions/contract/host";
7
8
  import { FontCss } from "@embedpdf/plugin-fonts/contract";
8
9
  import { AppearancePicture } from "@embedpdf/plugin-render/contract/host";
9
- import { SceneNode } from "@embedpdf/core-annotation";
10
10
  //#region src/services/looks.d.ts
11
11
  /** A widget as the painter draws it: its scene on the page (its text carries the faces it needs). */
12
12
  interface WidgetPainting {
@@ -21,10 +21,22 @@ interface WidgetPainting {
21
21
  * into view.
22
22
  */
23
23
  interface FormFocusTarget {
24
- /** Take the cursor; `select` selects a text box's text, so typing replaces it. */
24
+ /**
25
+ * Whether the control takes the cursor, asked each time the cursor is about to move. A box
26
+ * that holds nothing to focus says no: a signature field with nothing to sign it, a control
27
+ * of an app's own with no element Tab stops at. `focus()`, `focusNext()` and Tab pass over
28
+ * its field. A target without it takes the cursor.
29
+ */
30
+ takesCursor?(): boolean;
31
+ /**
32
+ * Take the cursor; `select` selects a text box's text, so typing replaces it. `false` when
33
+ * nothing took it after all: the cursor then passes over the box, as over one that says it
34
+ * takes none. A target that answers anything else, or nothing, took it: the return is
35
+ * `unknown`, so one whose `focus` returns a timer or a promise fits too.
36
+ */
25
37
  focus(options: {
26
38
  readonly select: boolean;
27
- }): void;
39
+ }): unknown;
28
40
  }
29
41
  /**
30
42
  * The host lens: members for the framework layers and sibling plugins (the
@@ -79,10 +91,20 @@ interface FormHostCapability extends FormCapability {
79
91
  getWidgetFontCss(widget: AnnotationRef): FontCss | null;
80
92
  /** The page box in page space, for keeping a placement on the page; `null` for a page that isn't there. */
81
93
  getPageBox(page: PageRef): Box | null;
94
+ /**
95
+ * Where UI attaches to one box of a field: its page and where the box stands, following the box
96
+ * as it is moved in design mode. The same object until the box moves; `null` for a box that
97
+ * isn't there, or that shows nowhere.
98
+ */
99
+ getWidgetAnchor(widget: AnnotationRef): FormWidgetAnchor | null;
100
+ /** Whether the cursor is in this box. */
101
+ isWidgetFocused(widget: AnnotationRef): boolean;
82
102
  /**
83
103
  * Lend the plugin a box's control while it's on screen, so `focus()` and `focusNext()` can put
84
104
  * the cursor in it; a box `focus()` asked for before its page came in takes the cursor now.
85
- * Returns the call that takes it back.
105
+ * Lend one for a box that holds nothing to focus too, saying so (`takesCursor`): the cursor
106
+ * passes over a box on screen that takes none, and nothing else tells the plugin that a box
107
+ * it hasn't seen can't take it. Returns the call that takes it back.
86
108
  */
87
109
  attachFocusTarget(widget: AnnotationRef, target: FormFocusTarget): () => void;
88
110
  /**
@@ -116,4 +138,4 @@ interface FormHostCapability extends FormCapability {
116
138
  declare const FormToken: import("@embedpdf/core").CapabilityToken<FormHostCapability>;
117
139
  //#endregion
118
140
  export { WidgetPainting as a, TextEditorLayout$1 as i, FormHostCapability as n, FormToken as r, FormFocusTarget as t };
119
- //# sourceMappingURL=host-contract-DI1Gf4fB.d.cts.map
141
+ //# sourceMappingURL=host-contract-C8HiD6sJ.d.cts.map
@@ -1,4 +1,4 @@
1
- import { R as FormSetValueResult, a as FormCommitResult, et as Box, i as FormCapability, rt as ShownWidget } from "./contract-DJLVUeAe.js";
1
+ import { H as FormSetValueResult, Q as FormWidgetAnchor, a as FormCommitResult, i as FormCapability, st as Box, ut as ShownWidget } from "./contract-BkTJQ39E.js";
2
2
  import "@embedpdf/core";
3
3
  import { ActionContext, ActionDiagnostic, ActionOrigin, ActionSubmitRequest, PdfAnnotationEventKind, SubmitIntent } from "@embedpdf/plugin-actions/contract";
4
4
  import { FontCss } from "@embedpdf/plugin-fonts/contract";
@@ -21,10 +21,22 @@ interface WidgetPainting {
21
21
  * into view.
22
22
  */
23
23
  interface FormFocusTarget {
24
- /** Take the cursor; `select` selects a text box's text, so typing replaces it. */
24
+ /**
25
+ * Whether the control takes the cursor, asked each time the cursor is about to move. A box
26
+ * that holds nothing to focus says no: a signature field with nothing to sign it, a control
27
+ * of an app's own with no element Tab stops at. `focus()`, `focusNext()` and Tab pass over
28
+ * its field. A target without it takes the cursor.
29
+ */
30
+ takesCursor?(): boolean;
31
+ /**
32
+ * Take the cursor; `select` selects a text box's text, so typing replaces it. `false` when
33
+ * nothing took it after all: the cursor then passes over the box, as over one that says it
34
+ * takes none. A target that answers anything else, or nothing, took it: the return is
35
+ * `unknown`, so one whose `focus` returns a timer or a promise fits too.
36
+ */
25
37
  focus(options: {
26
38
  readonly select: boolean;
27
- }): void;
39
+ }): unknown;
28
40
  }
29
41
  /**
30
42
  * The host lens: members for the framework layers and sibling plugins (the
@@ -79,10 +91,20 @@ interface FormHostCapability extends FormCapability {
79
91
  getWidgetFontCss(widget: AnnotationRef): FontCss | null;
80
92
  /** The page box in page space, for keeping a placement on the page; `null` for a page that isn't there. */
81
93
  getPageBox(page: PageRef): Box | null;
94
+ /**
95
+ * Where UI attaches to one box of a field: its page and where the box stands, following the box
96
+ * as it is moved in design mode. The same object until the box moves; `null` for a box that
97
+ * isn't there, or that shows nowhere.
98
+ */
99
+ getWidgetAnchor(widget: AnnotationRef): FormWidgetAnchor | null;
100
+ /** Whether the cursor is in this box. */
101
+ isWidgetFocused(widget: AnnotationRef): boolean;
82
102
  /**
83
103
  * Lend the plugin a box's control while it's on screen, so `focus()` and `focusNext()` can put
84
104
  * the cursor in it; a box `focus()` asked for before its page came in takes the cursor now.
85
- * Returns the call that takes it back.
105
+ * Lend one for a box that holds nothing to focus too, saying so (`takesCursor`): the cursor
106
+ * passes over a box on screen that takes none, and nothing else tells the plugin that a box
107
+ * it hasn't seen can't take it. Returns the call that takes it back.
86
108
  */
87
109
  attachFocusTarget(widget: AnnotationRef, target: FormFocusTarget): () => void;
88
110
  /**
@@ -116,4 +138,4 @@ interface FormHostCapability extends FormCapability {
116
138
  declare const FormToken: import("@embedpdf/core").CapabilityToken<FormHostCapability>;
117
139
  //#endregion
118
140
  export { WidgetPainting as a, TextEditorLayout$1 as i, FormHostCapability as n, FormToken as r, FormFocusTarget as t };
119
- //# sourceMappingURL=host-contract-D9NExKAu.d.ts.map
141
+ //# sourceMappingURL=host-contract-cOcPAwaN.d.ts.map