@kopjra/pdf-sentinel 1.11.3 → 1.11.4

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 (45) hide show
  1. package/dist/preact/pdf-sentinel.js +2365 -2409
  2. package/dist/preact/pdf-sentinel.js.map +1 -1
  3. package/dist/preact/src/__tests__/annotationUtils.test.d.ts +1 -0
  4. package/dist/preact/src/__tests__/annotations.test.d.ts +1 -0
  5. package/dist/preact/src/__tests__/frameworkExports.test.d.ts +1 -0
  6. package/dist/preact/src/__tests__/readAnnotationFields.test.d.ts +1 -0
  7. package/dist/preact/src/__tests__/renderers.test.d.ts +1 -0
  8. package/dist/preact/src/__tests__/renderersRender.test.d.ts +1 -0
  9. package/dist/preact/src/__tests__/shared.test.d.ts +1 -0
  10. package/dist/preact/src/__tests__/signatureColors.test.d.ts +1 -0
  11. package/dist/preact/src/__tests__/textRendererReadonly.test.d.ts +1 -0
  12. package/dist/preact/src/__tests__/toolbar.test.d.ts +1 -0
  13. package/dist/preact/src/__tests__/tools.test.d.ts +1 -0
  14. package/dist/preact/src/__tests__/toolsAdvanced.test.d.ts +1 -0
  15. package/dist/preact/src/__tests__/translations.test.d.ts +1 -0
  16. package/dist/preact/src/__tests__/useDeepMemo.test.d.ts +1 -0
  17. package/dist/preact/src/__tests__/usePdfSentinel.test.d.ts +1 -0
  18. package/dist/preact/src/framework/index.d.ts +2 -0
  19. package/dist/preact/src/framework/preact.d.ts +2 -0
  20. package/dist/preact/src/plugins/forms/hooks/usePdfForms.d.ts +2 -3
  21. package/dist/preact/src/plugins/forms/shared.d.ts +17 -2
  22. package/dist/react/pdf-sentinel.js +3090 -3134
  23. package/dist/react/pdf-sentinel.js.map +1 -1
  24. package/dist/react/src/__tests__/annotationUtils.test.d.ts +1 -0
  25. package/dist/react/src/__tests__/annotations.test.d.ts +1 -0
  26. package/dist/react/src/__tests__/frameworkExports.test.d.ts +1 -0
  27. package/dist/react/src/__tests__/readAnnotationFields.test.d.ts +1 -0
  28. package/dist/react/src/__tests__/renderers.test.d.ts +1 -0
  29. package/dist/react/src/__tests__/renderersRender.test.d.ts +1 -0
  30. package/dist/react/src/__tests__/shared.test.d.ts +1 -0
  31. package/dist/react/src/__tests__/signatureColors.test.d.ts +1 -0
  32. package/dist/react/src/__tests__/textRendererReadonly.test.d.ts +1 -0
  33. package/dist/react/src/__tests__/toolbar.test.d.ts +1 -0
  34. package/dist/react/src/__tests__/tools.test.d.ts +1 -0
  35. package/dist/react/src/__tests__/toolsAdvanced.test.d.ts +1 -0
  36. package/dist/react/src/__tests__/translations.test.d.ts +1 -0
  37. package/dist/react/src/__tests__/useDeepMemo.test.d.ts +1 -0
  38. package/dist/react/src/__tests__/usePdfSentinel.test.d.ts +1 -0
  39. package/dist/react/src/framework/index.d.ts +2 -0
  40. package/dist/react/src/framework/preact.d.ts +2 -0
  41. package/dist/react/src/plugins/forms/hooks/usePdfForms.d.ts +2 -3
  42. package/dist/react/src/plugins/forms/shared.d.ts +17 -2
  43. package/package.json +28 -20
  44. package/dist/preact/src/utils/raper.d.ts +0 -8
  45. package/dist/react/src/utils/raper.d.ts +0 -8
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -37,3 +37,5 @@ export { HistoryPluginPackage, useHistoryCapability } from '@embedpdf/plugin-his
37
37
  export type { HistoryCapability } from '@embedpdf/plugin-history/react';
38
38
  export { AnnotationPluginPackage, AnnotationLayer, useAnnotation, AnnotationPlugin, useAnnotationCapability, } from '@embedpdf/plugin-annotation/react';
39
39
  export type { CustomAnnotationRenderer, CustomAnnotationRendererProps, AnnotationCapability, AnnotationSelectionMenuProps } from '@embedpdf/plugin-annotation/react';
40
+ export { FormPluginPackage, useFormCapability } from '@embedpdf/plugin-form/react';
41
+ export type { FormCapability, FormScope, FormFieldInfo } from '@embedpdf/plugin-form/react';
@@ -38,3 +38,5 @@ export { HistoryPluginPackage, useHistoryCapability } from '@embedpdf/plugin-his
38
38
  export type { HistoryCapability } from '@embedpdf/plugin-history/preact';
39
39
  export { AnnotationPluginPackage, AnnotationLayer, useAnnotation, AnnotationPlugin, useAnnotationCapability } from '@embedpdf/plugin-annotation/preact';
40
40
  export type { CustomAnnotationRenderer, CustomAnnotationRendererProps, AnnotationCapability, AnnotationSelectionMenuProps } from '@embedpdf/plugin-annotation/preact';
41
+ export { FormPluginPackage, useFormCapability } from '@embedpdf/plugin-form/preact';
42
+ export type { FormCapability, FormScope, FormFieldInfo } from '@embedpdf/plugin-form/preact';
@@ -1,6 +1,5 @@
1
1
  import { Field as SharedField } from '../shared.ts';
2
- import { DocumentManagerCapability, ScrollCapability, ViewportCapability } from '../../../framework/preact.ts';
3
- import { PdfEngine } from '@embedpdf/models';
2
+ import { DocumentManagerCapability, FormCapability, ScrollCapability, ViewportCapability } from '../../../framework/preact.ts';
4
3
  import { ConditionalSignature, InitialValuesType } from '../../../hooks/usePdfSentinel.tsx';
5
4
  type Field = SharedField;
6
5
  export type UsePdfFormsResult = {
@@ -16,5 +15,5 @@ export type UsePdfFormsResult = {
16
15
  showErrors: boolean;
17
16
  scrollToConditionalSignature: (index: string) => Generator;
18
17
  };
19
- export declare function usePdfForms(documentId: string, initialValues: InitialValuesType, conditionalSignatures: ConditionalSignature[] | undefined, signatureFieldNames: string[] | undefined, engine: PdfEngine<Blob> | null, loader: DocumentManagerCapability | null, scrollCapability: ScrollCapability | null, viewportCapability: ViewportCapability | null): UsePdfFormsResult;
18
+ export declare function usePdfForms(documentId: string, initialValues: InitialValuesType, conditionalSignatures: ConditionalSignature[] | undefined, signatureFieldNames: string[] | undefined, formCapability: FormCapability | null, loader: DocumentManagerCapability | null, scrollCapability: ScrollCapability | null, viewportCapability: ViewportCapability | null): UsePdfFormsResult;
20
19
  export {};
@@ -1,5 +1,5 @@
1
1
  import { PdfAnnotationObject, PdfDocumentObject, PdfEngine } from '@embedpdf/models';
2
- import { DocumentManagerCapability } from '../../framework/preact.ts';
2
+ import { DocumentManagerCapability, FormCapability } from '../../framework/preact.ts';
3
3
  import { ConditionalSignature, InitialValuesType } from '../../hooks/usePdfSentinel.tsx';
4
4
  export type Field = {
5
5
  name: string;
@@ -16,13 +16,28 @@ export type Field = {
16
16
  required?: boolean;
17
17
  conditionalIndex?: string;
18
18
  };
19
+ /**
20
+ * Extracts form fields from a PDF document using the raw engine API.
21
+ *
22
+ * Kept for use-cases that operate outside the EmbedPDF component tree
23
+ * (e.g. readAnnotationFieldsAndClean in tools.ts).
24
+ */
19
25
  export declare function getFormFieldsFromDocument(document: PdfDocumentObject, engine: PdfEngine<Blob>, initialValues?: InitialValuesType, conditionalSignatures?: ConditionalSignature[], signatureFieldNames?: string[], readAllFields?: boolean): AsyncGenerator<{
20
26
  field: Field;
21
27
  annotation: PdfAnnotationObject;
22
28
  }>;
29
+ /**
30
+ * Checks whether a PDF annotation (widget) currently holds a value.
31
+ * Uses native `isWidgetChecked` for toggle fields (2.14.0+).
32
+ */
23
33
  export declare function hasValue(annotation: PdfAnnotationObject): boolean;
24
34
  export declare function makeReadOnlyAndNotRequired(annotation: PdfAnnotationObject): PdfAnnotationObject;
25
- export declare function getFormFields(documentId: string, initialValues: InitialValuesType, conditionalSignatures: ConditionalSignature[], signatureFieldNames: string[] | undefined, engine: PdfEngine<Blob> | null, loader: DocumentManagerCapability | null): Promise<{
35
+ /**
36
+ * Collects form fields and their values using the `@embedpdf/plugin-form`
37
+ * capability. This replaces the old engine-level annotation scanning for the
38
+ * interactive form-usage path.
39
+ */
40
+ export declare function getFormFieldsViaCapability(documentId: string, initialValues: InitialValuesType, conditionalSignatures: ConditionalSignature[], signatureFieldNames: string[] | undefined, formCapability: FormCapability | null, loader: DocumentManagerCapability | null): Promise<{
26
41
  fields: Field[];
27
42
  values: Record<string, string | boolean>;
28
43
  }>;