@formepdf/react 0.8.3 → 0.9.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/index.d.ts +1 -1
- package/dist/serialize.js +14 -4
- package/dist/types.d.ts +11 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export type { FontRegistration } from './font.js';
|
|
|
7
7
|
export { createDataProxy, isRefMarker, isEachMarker, isExprMarker } from './template-proxy.js';
|
|
8
8
|
export { expr } from './expr.js';
|
|
9
9
|
export { render, renderToObject } from './render.js';
|
|
10
|
-
export type { Style, GridTrackSize, Edges, Corners, EdgeColors, DocumentProps, PageProps, ViewProps, TextProps, ImageProps, ColumnDef, TableProps, RowProps, CellProps, FixedProps, SvgProps, QrCodeProps, BarcodeProps, BarcodeFormat, CanvasProps, CanvasContext, CanvasOp, WatermarkProps, ChartDataPoint, PieDataPoint, ChartSeries, DotPlotGroup, BarChartProps, LineChartProps, PieChartProps, AreaChartProps, DotPlotProps, TextFieldProps, CheckboxProps, DropdownProps, RadioButtonProps, TextRun, SignatureConfig, FormeDocument, FormeFont, FormeNode, FormeNodeKind, FormeStyle, FormePageConfig, FormePageSize, FormeEdges, FormeMetadata, FormeColumnDef, FormeColumnWidth, FormeDimension, FormeColor, FormeEdgeValues, FormeCornerValues, FormeGridTrackSize, FormeGridPlacement, } from './types.js';
|
|
10
|
+
export type { Style, GridTrackSize, Edges, Corners, EdgeColors, DocumentProps, PageProps, ViewProps, TextProps, ImageProps, ColumnDef, TableProps, RowProps, CellProps, FixedProps, SvgProps, QrCodeProps, BarcodeProps, BarcodeFormat, CanvasProps, CanvasContext, CanvasOp, WatermarkProps, ChartDataPoint, PieDataPoint, ChartSeries, DotPlotGroup, BarChartProps, LineChartProps, PieChartProps, AreaChartProps, DotPlotProps, TextFieldProps, CheckboxProps, DropdownProps, RadioButtonProps, TextRun, CertificationConfig, SignatureConfig, FormeDocument, FormeFont, FormeNode, FormeNodeKind, FormeStyle, FormePageConfig, FormePageSize, FormeEdges, FormeMetadata, FormeColumnDef, FormeColumnWidth, FormeDimension, FormeColor, FormeEdgeValues, FormeCornerValues, FormeGridTrackSize, FormeGridPlacement, } from './types.js';
|
package/dist/serialize.js
CHANGED
|
@@ -144,8 +144,13 @@ export function serialize(element) {
|
|
|
144
144
|
result.pdfa = props.pdfa;
|
|
145
145
|
if (props.pdfUa)
|
|
146
146
|
result.pdfUa = true;
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
const cert = props.certification ?? props.signature;
|
|
148
|
+
if (cert) {
|
|
149
|
+
if (props.signature && !props.certification) {
|
|
150
|
+
console.warn('[Forme] The `signature` prop is deprecated. Use `certification` instead.');
|
|
151
|
+
}
|
|
152
|
+
result.certification = cert;
|
|
153
|
+
}
|
|
149
154
|
if (mergedFonts.length > 0) {
|
|
150
155
|
result.fonts = mergedFonts;
|
|
151
156
|
}
|
|
@@ -1504,8 +1509,13 @@ export function serializeTemplate(element) {
|
|
|
1504
1509
|
result.pdfa = props.pdfa;
|
|
1505
1510
|
if (props.pdfUa)
|
|
1506
1511
|
result.pdfUa = true;
|
|
1507
|
-
|
|
1508
|
-
|
|
1512
|
+
const cert = props.certification ?? props.signature;
|
|
1513
|
+
if (cert) {
|
|
1514
|
+
if (props.signature && !props.certification) {
|
|
1515
|
+
console.warn('[Forme] The `signature` prop is deprecated. Use `certification` instead.');
|
|
1516
|
+
}
|
|
1517
|
+
result.certification = cert;
|
|
1518
|
+
}
|
|
1509
1519
|
if (mergedFonts.length > 0) {
|
|
1510
1520
|
result.fonts = mergedFonts;
|
|
1511
1521
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -140,16 +140,16 @@ export interface Style {
|
|
|
140
140
|
minWidowLines?: number;
|
|
141
141
|
minOrphanLines?: number;
|
|
142
142
|
}
|
|
143
|
-
export interface
|
|
143
|
+
export interface CertificationConfig {
|
|
144
144
|
/** PEM-encoded X.509 certificate. */
|
|
145
145
|
certificatePem: string;
|
|
146
146
|
/** PEM-encoded RSA private key (PKCS#8). */
|
|
147
147
|
privateKeyPem: string;
|
|
148
|
-
/** Reason for
|
|
148
|
+
/** Reason for certification (e.g. "Approved"). */
|
|
149
149
|
reason?: string;
|
|
150
|
-
/** Location of
|
|
150
|
+
/** Location of certification (e.g. "New York, NY"). */
|
|
151
151
|
location?: string;
|
|
152
|
-
/** Contact info for the
|
|
152
|
+
/** Contact info for the certifier. */
|
|
153
153
|
contact?: string;
|
|
154
154
|
/** Whether to show a visible signature annotation on the page. */
|
|
155
155
|
visible?: boolean;
|
|
@@ -162,6 +162,8 @@ export interface SignatureConfig {
|
|
|
162
162
|
/** Height in points for visible signature. */
|
|
163
163
|
height?: number;
|
|
164
164
|
}
|
|
165
|
+
/** @deprecated Use CertificationConfig */
|
|
166
|
+
export type SignatureConfig = CertificationConfig;
|
|
165
167
|
export interface DocumentProps {
|
|
166
168
|
title?: string;
|
|
167
169
|
author?: string;
|
|
@@ -177,8 +179,10 @@ export interface DocumentProps {
|
|
|
177
179
|
pdfa?: '2a' | '2b';
|
|
178
180
|
/** When true, the PDF claims PDF/UA-1 conformance. Forces tagging. */
|
|
179
181
|
pdfUa?: boolean;
|
|
180
|
-
/** Digital
|
|
181
|
-
|
|
182
|
+
/** Digital certification configuration. Certifies the PDF with an X.509 certificate. */
|
|
183
|
+
certification?: CertificationConfig;
|
|
184
|
+
/** @deprecated Use certification */
|
|
185
|
+
signature?: CertificationConfig;
|
|
182
186
|
fonts?: FontRegistration[];
|
|
183
187
|
children?: ReactNode;
|
|
184
188
|
}
|
|
@@ -596,7 +600,7 @@ export interface FormeDocument {
|
|
|
596
600
|
pdfa?: '2a' | '2b';
|
|
597
601
|
pdfUa?: boolean;
|
|
598
602
|
flattenForms?: boolean;
|
|
599
|
-
|
|
603
|
+
certification?: CertificationConfig;
|
|
600
604
|
}
|
|
601
605
|
export interface FormeMetadata {
|
|
602
606
|
title?: string;
|