@formepdf/svelte 0.21.0 → 0.22.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,6 +1,11 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
- import type { CertificationConfig, FontRegistration, Style } from '@formepdf/shared';
3
+ import type {
4
+ CertificationConfig,
5
+ FontRegistration,
6
+ FormeDocumentClaimProps,
7
+ Style,
8
+ } from '@formepdf/shared';
4
9
  import { encodeProps } from '@formepdf/shared';
5
10
 
6
11
  interface Props {
@@ -15,9 +20,13 @@
15
20
  /** Whether to produce a tagged (accessible) PDF with structure tree. */
16
21
  tagged?: boolean;
17
22
  /** PDF/A conformance level. "2a" requires tagging, "2b" is visual-only compliance. */
18
- pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u';
23
+ pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u' | '4' | '4f';
24
+ /** Output PDF version. "2.0" (ISO 32000-2) requires every font embedded; pdfa "4"/"4f" imply it. Default "1.7". */
25
+ pdfVersion?: '1.7' | '2.0';
19
26
  /** When true, the PDF claims PDF/UA-1 conformance. Forces tagging. */
20
27
  pdfUa?: boolean;
28
+ /** PDF/UA-2 accessibility (ISO 14289-2:2024) — the PDF 2.0 successor to pdfUa. Implies pdfVersion "2.0" (every font embedded); composes with pdfa "4"/"4f". */
29
+ pdfUa2?: boolean;
21
30
  /** Digital certification configuration. Certifies the PDF with an X.509 certificate. */
22
31
  certification?: CertificationConfig;
23
32
  /** @deprecated Use certification */
@@ -27,6 +36,17 @@
27
36
  children?: Snippet;
28
37
  }
29
38
 
39
+ // Compile-time claim parity with the serializer's accepted options
40
+ // (FormeDocumentClaimProps) — fails `npm run check` when a conformance
41
+ // claim is missing here or drifts in type.
42
+ type Exact<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2)
43
+ ? true
44
+ : false;
45
+ type AssertTrue<T extends true> = T;
46
+ type _DocumentClaimParity = AssertTrue<
47
+ Exact<Pick<Props, keyof FormeDocumentClaimProps>, FormeDocumentClaimProps>
48
+ >;
49
+
30
50
  let { children, ...rest }: Props = $props();
31
51
  </script>
32
52
 
@@ -12,9 +12,13 @@ interface Props {
12
12
  /** Whether to produce a tagged (accessible) PDF with structure tree. */
13
13
  tagged?: boolean;
14
14
  /** PDF/A conformance level. "2a" requires tagging, "2b" is visual-only compliance. */
15
- pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u';
15
+ pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u' | '4' | '4f';
16
+ /** Output PDF version. "2.0" (ISO 32000-2) requires every font embedded; pdfa "4"/"4f" imply it. Default "1.7". */
17
+ pdfVersion?: '1.7' | '2.0';
16
18
  /** When true, the PDF claims PDF/UA-1 conformance. Forces tagging. */
17
19
  pdfUa?: boolean;
20
+ /** PDF/UA-2 accessibility (ISO 14289-2:2024) — the PDF 2.0 successor to pdfUa. Implies pdfVersion "2.0" (every font embedded); composes with pdfa "4"/"4f". */
21
+ pdfUa2?: boolean;
18
22
  /** Digital certification configuration. Certifies the PDF with an X.509 certificate. */
19
23
  certification?: CertificationConfig;
20
24
  /** @deprecated Use certification */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formepdf/svelte",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "Svelte-to-JSON serializer for Forme PDF engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,11 +25,11 @@
25
25
  "test:watch": "npm run embed-preview && vitest"
26
26
  },
27
27
  "dependencies": {
28
- "@formepdf/shared": "0.21.0",
28
+ "@formepdf/shared": "0.22.0",
29
29
  "parse5": "^7.2.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@formepdf/core": "^0.21.0",
32
+ "@formepdf/core": "^0.22.0",
33
33
  "svelte": "^5.30.0"
34
34
  },
35
35
  "peerDependenciesMeta": {
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@formepdf/core": "0.21.0",
42
- "@formepdf/react": "0.21.0",
43
- "@formepdf/tailwind": "0.21.0",
41
+ "@formepdf/core": "0.22.0",
42
+ "@formepdf/react": "0.22.0",
43
+ "@formepdf/tailwind": "0.22.0",
44
44
  "@sveltejs/package": "^2.3.10",
45
45
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
46
46
  "@types/react": "^19.0.0",