@embedpdf/plugin-form 3.0.0-next.15 → 3.0.0-next.17
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.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -8
- package/dist/index.d.ts +15 -8
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
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
2
|
import { t as FormHostCapability } from "./host-contract-1epLfK1S.cjs";
|
|
3
3
|
import { FormScriptingController, createFormScriptingController } from "./scripting.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ResourceStatus } from "@embedpdf/core";
|
|
5
|
+
import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, FormKind as FormKind$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
|
|
5
6
|
import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
|
|
6
7
|
//#region src/form.plugin.d.ts
|
|
7
8
|
/**
|
|
@@ -19,12 +20,18 @@ import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
|
|
|
19
20
|
declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDef<Readonly<Record<string, never>>, FormHostCapability, FormSettings>;
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/state.d.ts
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/** Every field, whether the form is read, what kind of form it is, and the selected widget's field. */
|
|
24
|
+
interface FormState {
|
|
25
|
+
/** Every field. The same array while nothing changes. */
|
|
26
|
+
readonly fields: readonly FormFieldDTO$1[];
|
|
27
|
+
/** Whether the form is read. */
|
|
28
|
+
readonly status: ResourceStatus;
|
|
29
|
+
/** What the document has: `'none'`, `'acroform'` or `'xfa'`. */
|
|
30
|
+
readonly formKind: FormKind$1;
|
|
31
|
+
/** The field of the selected widget while one widget is selected (in design mode), or `null`. */
|
|
32
|
+
readonly selectedField: FormFieldDTO$1 | null;
|
|
33
|
+
}
|
|
34
|
+
declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, FormState>;
|
|
28
35
|
//#endregion
|
|
29
36
|
//#region src/tools/definitions.d.ts
|
|
30
37
|
/** The families the palette places. */
|
|
@@ -49,5 +56,5 @@ interface FormToolDef {
|
|
|
49
56
|
declare const FORM_TOOLS: readonly FormToolDef[];
|
|
50
57
|
declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDef>;
|
|
51
58
|
//#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 };
|
|
59
|
+
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, type FormState, FormToken, type FormToolDef, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
|
|
53
60
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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
2
|
import { t as FormHostCapability } from "./host-contract-BRYUbpT_.js";
|
|
3
3
|
import { FormScriptingController, createFormScriptingController } from "./scripting.js";
|
|
4
|
+
import { ResourceStatus } from "@embedpdf/core";
|
|
4
5
|
import { ClickCreate } from "@embedpdf/plugin-annotation/contract";
|
|
5
|
-
import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
|
|
6
|
+
import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, FormKind as FormKind$1, WidgetAppearance } from "@embedpdf/engine-core/runtime";
|
|
6
7
|
//#region src/form.plugin.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* The form plugin: the field plane. Document-scoped; requires the
|
|
@@ -19,12 +20,18 @@ import { FormFieldDTO as FormFieldDTO$1, FormFieldFamily as FormFieldFamily$1, W
|
|
|
19
20
|
declare const formPlugin: (config?: FormConfig) => import("@embedpdf/core").PluginDef<Readonly<Record<string, never>>, FormHostCapability, FormSettings>;
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/state.d.ts
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/** Every field, whether the form is read, what kind of form it is, and the selected widget's field. */
|
|
24
|
+
interface FormState {
|
|
25
|
+
/** Every field. The same array while nothing changes. */
|
|
26
|
+
readonly fields: readonly FormFieldDTO$1[];
|
|
27
|
+
/** Whether the form is read. */
|
|
28
|
+
readonly status: ResourceStatus;
|
|
29
|
+
/** What the document has: `'none'`, `'acroform'` or `'xfa'`. */
|
|
30
|
+
readonly formKind: FormKind$1;
|
|
31
|
+
/** The field of the selected widget while one widget is selected (in design mode), or `null`. */
|
|
32
|
+
readonly selectedField: FormFieldDTO$1 | null;
|
|
33
|
+
}
|
|
34
|
+
declare const formState: import("@embedpdf/core").StateDeclaration<FormCapability, FormState>;
|
|
28
35
|
//#endregion
|
|
29
36
|
//#region src/tools/definitions.d.ts
|
|
30
37
|
/** The families the palette places. */
|
|
@@ -49,5 +56,5 @@ interface FormToolDef {
|
|
|
49
56
|
declare const FORM_TOOLS: readonly FormToolDef[];
|
|
50
57
|
declare const FORM_TOOL_BY_ID: ReadonlyMap<string, FormToolDef>;
|
|
51
58
|
//#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 };
|
|
59
|
+
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, type FormState, FormToken, type FormToolDef, FormTransfer, FormUiEffect, FormValidation, FormValidationRejectedEvent, FormValueChangedEvent, FormWidgetAddResult, type FormWidgetItem, type FormWidgetLook, WidgetActivationResult, WidgetAddress, type WidgetAnnotation, type WidgetHit, createFormScriptingController, formPlugin, formState, toFieldRef };
|
|
53
60
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -533,6 +533,7 @@ function foldFormFacts(index, event) {
|
|
|
533
533
|
case "forms.repaired":
|
|
534
534
|
case "pages.deleted":
|
|
535
535
|
case "pages.inserted":
|
|
536
|
+
case "pages.restored":
|
|
536
537
|
case "pages.flattened":
|
|
537
538
|
case "annotations.flattened":
|
|
538
539
|
case "redaction.applied": return reload();
|
|
@@ -641,7 +642,7 @@ function widgetAt(index, widgets, point) {
|
|
|
641
642
|
}
|
|
642
643
|
return best;
|
|
643
644
|
}
|
|
644
|
-
const
|
|
645
|
+
const initialFormModel = () => ({});
|
|
645
646
|
//#endregion
|
|
646
647
|
//#region src/read/fields.ts
|
|
647
648
|
/**
|
|
@@ -2994,7 +2995,7 @@ const formPlugin = (config) => definePlugin({
|
|
|
2994
2995
|
ActionsToken,
|
|
2995
2996
|
RenderToken
|
|
2996
2997
|
],
|
|
2997
|
-
state:
|
|
2998
|
+
state: initialFormModel,
|
|
2998
2999
|
settings: {
|
|
2999
3000
|
defaults: FORM_DEFAULTS,
|
|
3000
3001
|
registered: config
|