@formepdf/preact 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.
package/dist/serialize.js CHANGED
@@ -178,8 +178,12 @@ export function serialize(element) {
178
178
  result.tagged = props.tagged;
179
179
  if (props.pdfa !== undefined)
180
180
  result.pdfa = props.pdfa;
181
+ if (props.pdfVersion !== undefined)
182
+ result.pdfVersion = props.pdfVersion;
181
183
  if (props.pdfUa)
182
184
  result.pdfUa = true;
185
+ if (props.pdfUa2)
186
+ result.pdfUa2 = true;
183
187
  const cert = props.certification ?? props.signature;
184
188
  if (cert) {
185
189
  if (props.signature && !props.certification) {
@@ -1027,8 +1031,12 @@ export function serializeTemplate(element) {
1027
1031
  result.tagged = props.tagged;
1028
1032
  if (props.pdfa !== undefined)
1029
1033
  result.pdfa = props.pdfa;
1034
+ if (props.pdfVersion !== undefined)
1035
+ result.pdfVersion = props.pdfVersion;
1030
1036
  if (props.pdfUa)
1031
1037
  result.pdfUa = true;
1038
+ if (props.pdfUa2)
1039
+ result.pdfUa2 = true;
1032
1040
  const cert = props.certification ?? props.signature;
1033
1041
  if (cert) {
1034
1042
  if (props.signature && !props.certification) {
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { ComponentChild as ReactNode } from 'preact';
2
+ import type { FormeDocumentClaimProps } from '@formepdf/shared';
2
3
  import type { FontRegistration } from './font.js';
3
4
  import type { Style, Edges, ColumnDef, BarcodeFormat, CanvasContext, CertificationConfig } from '@formepdf/shared';
4
5
  export type { Edges, Corners, GridTrackSize, EdgeColors, Style, CertificationConfig, SignatureConfig, ColumnDef, BarcodeFormat, ChartDataPoint, PieDataPoint, ChartSeries, DotPlotGroup, BarChartProps, LineChartProps, PieChartProps, AreaChartProps, DotPlotProps, CanvasContext, CanvasOp, TextRun, FormeFont, FormeDocument, FormeMetadata, FormePageConfig, FormePageSize, FormeEdges, FormeBoxShadow, FormeGradientStop, FormeBackground, FormeMarginEdges, FormeNode, FormeNodeKind, FormeColumnDef, FormeColumnWidth, FormeDimension, FormeColor, FormeEdgeValues, FormeCornerValues, FormeGridTrackSize, FormeGridPlacement, FormeStyle, ListMarker, FormeListMarkerType, FormeTransformOp, } from '@formepdf/shared';
@@ -14,9 +15,13 @@ export interface DocumentProps {
14
15
  /** Whether to produce a tagged (accessible) PDF with structure tree. */
15
16
  tagged?: boolean;
16
17
  /** PDF/A conformance level. "2a" requires tagging, "2b" is visual-only compliance. */
17
- pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u';
18
+ pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u' | '4' | '4f';
19
+ /** Output PDF version. "2.0" (ISO 32000-2) requires every font embedded; pdfa "4"/"4f" imply it. Default "1.7". */
20
+ pdfVersion?: '1.7' | '2.0';
18
21
  /** When true, the PDF claims PDF/UA-1 conformance. Forces tagging. */
19
22
  pdfUa?: boolean;
23
+ /** 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". */
24
+ pdfUa2?: boolean;
20
25
  /** Digital certification configuration. Certifies the PDF with an X.509 certificate. */
21
26
  certification?: CertificationConfig;
22
27
  /** @deprecated Use certification */
@@ -284,3 +289,6 @@ export interface CanvasProps {
284
289
  draw: (ctx: CanvasContext) => void;
285
290
  style?: Style;
286
291
  }
292
+ type Exact<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;
293
+ type AssertTrue<T extends true> = T;
294
+ export type _DocumentClaimParity = AssertTrue<Exact<Pick<DocumentProps, keyof FormeDocumentClaimProps>, FormeDocumentClaimProps>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formepdf/preact",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "Preact-native adapter for Forme PDF engine. Same components, same props as @formepdf/react, without the React runtime.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,13 +18,13 @@
18
18
  "test:watch": "vitest"
19
19
  },
20
20
  "dependencies": {
21
- "@formepdf/shared": "0.21.0"
21
+ "@formepdf/shared": "0.22.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "preact": "^10.19.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@formepdf/react": "0.21.0",
27
+ "@formepdf/react": "0.22.0",
28
28
  "@types/react": "^19.0.0",
29
29
  "preact": "^10.19.0",
30
30
  "react": "^19.0.0",