@formepdf/react 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 +8 -0
- package/dist/types.d.ts +9 -1
- package/package.json +2 -2
package/dist/serialize.js
CHANGED
|
@@ -173,8 +173,12 @@ export function serialize(element) {
|
|
|
173
173
|
result.tagged = props.tagged;
|
|
174
174
|
if (props.pdfa !== undefined)
|
|
175
175
|
result.pdfa = props.pdfa;
|
|
176
|
+
if (props.pdfVersion !== undefined)
|
|
177
|
+
result.pdfVersion = props.pdfVersion;
|
|
176
178
|
if (props.pdfUa)
|
|
177
179
|
result.pdfUa = true;
|
|
180
|
+
if (props.pdfUa2)
|
|
181
|
+
result.pdfUa2 = true;
|
|
178
182
|
const cert = props.certification ?? props.signature;
|
|
179
183
|
if (cert) {
|
|
180
184
|
if (props.signature && !props.certification) {
|
|
@@ -1022,8 +1026,12 @@ export function serializeTemplate(element) {
|
|
|
1022
1026
|
result.tagged = props.tagged;
|
|
1023
1027
|
if (props.pdfa !== undefined)
|
|
1024
1028
|
result.pdfa = props.pdfa;
|
|
1029
|
+
if (props.pdfVersion !== undefined)
|
|
1030
|
+
result.pdfVersion = props.pdfVersion;
|
|
1025
1031
|
if (props.pdfUa)
|
|
1026
1032
|
result.pdfUa = true;
|
|
1033
|
+
if (props.pdfUa2)
|
|
1034
|
+
result.pdfUa2 = true;
|
|
1027
1035
|
const cert = props.certification ?? props.signature;
|
|
1028
1036
|
if (cert) {
|
|
1029
1037
|
if (props.signature && !props.certification) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
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';
|
|
@@ -15,9 +16,13 @@ export interface DocumentProps {
|
|
|
15
16
|
tagged?: boolean;
|
|
16
17
|
/** PDF/A conformance level. "2b" is visual-only, "2u" adds a Unicode
|
|
17
18
|
* mapping for all text, "2a" additionally requires full tagging. */
|
|
18
|
-
pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u';
|
|
19
|
+
pdfa?: '2a' | '2b' | '2u' | '3a' | '3b' | '3u' | '4' | '4f';
|
|
20
|
+
/** Output PDF version. "2.0" (ISO 32000-2) requires every font embedded; pdfa "4"/"4f" imply it. Default "1.7". */
|
|
21
|
+
pdfVersion?: '1.7' | '2.0';
|
|
19
22
|
/** When true, the PDF claims PDF/UA-1 conformance. Forces tagging. */
|
|
20
23
|
pdfUa?: boolean;
|
|
24
|
+
/** 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". */
|
|
25
|
+
pdfUa2?: boolean;
|
|
21
26
|
/** Digital certification configuration. Certifies the PDF with an X.509 certificate. */
|
|
22
27
|
certification?: CertificationConfig;
|
|
23
28
|
/** @deprecated Use certification */
|
|
@@ -285,3 +290,6 @@ export interface CanvasProps {
|
|
|
285
290
|
draw: (ctx: CanvasContext) => void;
|
|
286
291
|
style?: Style;
|
|
287
292
|
}
|
|
293
|
+
type Exact<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;
|
|
294
|
+
type AssertTrue<T extends true> = T;
|
|
295
|
+
export type _DocumentClaimParity = AssertTrue<Exact<Pick<DocumentProps, keyof FormeDocumentClaimProps>, FormeDocumentClaimProps>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formepdf/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "JSX-to-JSON serializer for Forme PDF engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test:watch": "vitest"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@formepdf/shared": "0.
|
|
21
|
+
"@formepdf/shared": "0.22.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18 || ^19"
|