@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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
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, tt as FormModel, u as FormExportSelection, v as FormFieldRef, w as FormFilter, x as FormFieldSettings, y as FormFieldResult, z as FormSetValueStatus } from "./contract-Bq_ewUE5.cjs";
2
- import { n as FormHostCapability } from "./host-contract-DI1Gf4fB.cjs";
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, ct as FormModel, 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-B7rB7jYx.cjs";
2
+ import { n as FormHostCapability } from "./host-contract-C8HiD6sJ.cjs";
3
3
  import { FormScriptingController, createFormScriptingController } from "./scripting.cjs";
4
4
  import { ResourceStatus } from "@embedpdf/core";
5
5
  import { FormField as FormField$1, FormFieldKind as FormFieldKind$1, FormKind as FormKind$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
@@ -15,13 +15,18 @@ import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
15
15
  * the annotation plugin present, the form lends it the widgets, which its
16
16
  * tools then select, move, restyle and delete. The render plugin draws the
17
17
  * widgets' pictures in both modes. With the fonts plugin, a text field in a
18
- * font of its own is edited in that font's program. `config` is the settings the app
18
+ * font of its own is edited in that font's program. With the Stage, `focus()` and
19
+ * `focusNext()` bring the box they go to into view. `config` is the settings the app
19
20
  * registers, over {@link FORM_DEFAULTS}.
20
21
  */
21
22
  declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDefinition<FormModel, FormHostCapability, FormSettings>;
22
23
  //#endregion
23
24
  //#region src/state.d.ts
24
- /** Every field, whether the form is read, what kind of form it is, the selected widget's field, and the field the cursor is in. */
25
+ /**
26
+ * Every field, whether the form is read, what kind of form it is, the selected widget's field,
27
+ * every selected field, the field the cursor is in, the document's groups, and the group new
28
+ * fields are placed for.
29
+ */
25
30
  interface FormState {
26
31
  /** Every field. The same array while nothing changes. */
27
32
  readonly fields: readonly FormField$1[];
@@ -33,6 +38,12 @@ interface FormState {
33
38
  readonly selectedField: FormField$1 | null;
34
39
  /** The field the cursor is in, or `null`. */
35
40
  readonly focusedField: FormField$1 | null;
41
+ /** Every field with a selected widget (in design mode). The same array while nothing changes. */
42
+ readonly selectedFields: readonly FormField$1[];
43
+ /** Every group the app named or the form's fields are in. The same array while nothing changes. */
44
+ readonly groups: readonly FormGroup[];
45
+ /** The group that fields placed with a tool go in (in design mode), or `null` when it names none. */
46
+ readonly designGroup: string | null;
36
47
  }
37
48
  declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, FormState>;
38
49
  //#endregion
@@ -50,6 +61,14 @@ interface FormToolDefinition {
50
61
  clickCreate: Extract<ClickCreate, {
51
62
  width: number;
52
63
  }>;
64
+ /**
65
+ * Place the field as the author sees the page: on a page shown turned, it
66
+ * shows the click's size as seen and its contents are turned to read
67
+ * upright there (a quarter turn, `/MK /R`), as Acrobat places a field on a
68
+ * rotated page. With the annotation plugin, the tool registered there
69
+ * decides (an app may change it); this is its value without it.
70
+ */
71
+ upright: boolean;
53
72
  /** Seed drawing defaults, the widget's appearance fields: a placed field is
54
73
  * visible (white box, gray border) and restylable per tool through the
55
74
  * shared style panel. */
@@ -59,5 +78,5 @@ interface FormToolDefinition {
59
78
  declare const FORM_TOOLS: readonly FormToolDefinition[];
60
79
  declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDefinition>;
61
80
  //#endregion
62
- export { type AuthorableFormKind, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, type FormState, FormToken, type FormToolDefinition, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
81
+ export { type AuthorableFormKind, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, type FormState, FormToken, type FormToolDefinition, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, FormWidgetAnchor, type FormWidgetItem, type FormWidgetLook, type GroupPosition, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, type WidgetPlace, createFormScriptingController, formPlugin, formState, toFieldRef };
63
82
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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, tt as FormModel, u as FormExportSelection, v as FormFieldRef, w as FormFilter, x as FormFieldSettings, y as FormFieldResult, z as FormSetValueStatus } from "./contract-DJLVUeAe.js";
2
- import { n as FormHostCapability } from "./host-contract-D9NExKAu.js";
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, ct as FormModel, 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
+ import { n as FormHostCapability } from "./host-contract-cOcPAwaN.js";
3
3
  import { FormScriptingController, createFormScriptingController } from "./scripting.js";
4
4
  import { ResourceStatus } from "@embedpdf/core";
5
5
  import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
@@ -15,13 +15,18 @@ import { FormField as FormField$1, FormFieldKind as FormFieldKind$1, FormKind as
15
15
  * the annotation plugin present, the form lends it the widgets, which its
16
16
  * tools then select, move, restyle and delete. The render plugin draws the
17
17
  * widgets' pictures in both modes. With the fonts plugin, a text field in a
18
- * font of its own is edited in that font's program. `config` is the settings the app
18
+ * font of its own is edited in that font's program. With the Stage, `focus()` and
19
+ * `focusNext()` bring the box they go to into view. `config` is the settings the app
19
20
  * registers, over {@link FORM_DEFAULTS}.
20
21
  */
21
22
  declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDefinition<FormModel, FormHostCapability, FormSettings>;
22
23
  //#endregion
23
24
  //#region src/state.d.ts
24
- /** Every field, whether the form is read, what kind of form it is, the selected widget's field, and the field the cursor is in. */
25
+ /**
26
+ * Every field, whether the form is read, what kind of form it is, the selected widget's field,
27
+ * every selected field, the field the cursor is in, the document's groups, and the group new
28
+ * fields are placed for.
29
+ */
25
30
  interface FormState {
26
31
  /** Every field. The same array while nothing changes. */
27
32
  readonly fields: readonly FormField$1[];
@@ -33,6 +38,12 @@ interface FormState {
33
38
  readonly selectedField: FormField$1 | null;
34
39
  /** The field the cursor is in, or `null`. */
35
40
  readonly focusedField: FormField$1 | null;
41
+ /** Every field with a selected widget (in design mode). The same array while nothing changes. */
42
+ readonly selectedFields: readonly FormField$1[];
43
+ /** Every group the app named or the form's fields are in. The same array while nothing changes. */
44
+ readonly groups: readonly FormGroup[];
45
+ /** The group that fields placed with a tool go in (in design mode), or `null` when it names none. */
46
+ readonly designGroup: string | null;
36
47
  }
37
48
  declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, FormState>;
38
49
  //#endregion
@@ -50,6 +61,14 @@ interface FormToolDefinition {
50
61
  clickCreate: Extract<ClickCreate, {
51
62
  width: number;
52
63
  }>;
64
+ /**
65
+ * Place the field as the author sees the page: on a page shown turned, it
66
+ * shows the click's size as seen and its contents are turned to read
67
+ * upright there (a quarter turn, `/MK /R`), as Acrobat places a field on a
68
+ * rotated page. With the annotation plugin, the tool registered there
69
+ * decides (an app may change it); this is its value without it.
70
+ */
71
+ upright: boolean;
53
72
  /** Seed drawing defaults, the widget's appearance fields: a placed field is
54
73
  * visible (white box, gray border) and restylable per tool through the
55
74
  * shared style panel. */
@@ -59,5 +78,5 @@ interface FormToolDefinition {
59
78
  declare const FORM_TOOLS: readonly FormToolDefinition[];
60
79
  declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDefinition>;
61
80
  //#endregion
62
- export { type AuthorableFormKind, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, type FormState, FormToken, type FormToolDefinition, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
81
+ export { type AuthorableFormKind, type Box, FORM_DEFAULTS, FORM_TOOLS, FORM_TOOL_BY_ID, 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, FormScriptingController, FormSetValueResult, FormSetValueStatus, FormSettings, type FormSnapshot, type FormState, FormToken, type FormToolDefinition, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, FormWidgetAnchor, type FormWidgetItem, type FormWidgetLook, type GroupPosition, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, type WidgetPlace, createFormScriptingController, formPlugin, formState, toFieldRef };
63
82
  //# sourceMappingURL=index.d.ts.map