@formepdf/react 0.10.4 → 0.11.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/components.d.ts +131 -1
- package/dist/components.js +156 -0
- package/dist/font.d.ts +2 -11
- package/dist/font.js +1 -23
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -2
- package/dist/serialize.d.ts +1 -6
- package/dist/serialize.js +175 -991
- package/dist/types.d.ts +79 -766
- package/package.json +4 -1
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentProps, PageProps, ViewProps, TextProps, ImageProps, TableProps, RowProps, CellProps, FixedProps, SvgProps, QrCodeProps, BarcodeProps, CanvasProps, WatermarkProps, BarChartProps, LineChartProps, PieChartProps, AreaChartProps, DotPlotProps, TextFieldProps, CheckboxProps, DropdownProps, RadioButtonProps } from './types.js';
|
|
1
|
+
import type { DocumentProps, PageProps, ViewProps, TextProps, HeadingProps, OrderedListProps, UnorderedListProps, ListItemProps, StrongProps, EmProps, CodeProps, LinkProps, ImageProps, TableProps, RowProps, CellProps, FixedProps, SvgProps, QrCodeProps, BarcodeProps, CanvasProps, WatermarkProps, BarChartProps, LineChartProps, PieChartProps, AreaChartProps, DotPlotProps, TextFieldProps, CheckboxProps, DropdownProps, RadioButtonProps } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Root document container. Must be the top-level element in every Forme document.
|
|
4
4
|
*
|
|
@@ -75,6 +75,136 @@ export declare function View(_props: ViewProps): null;
|
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
77
|
export declare function Text(_props: TextProps): null;
|
|
78
|
+
/**
|
|
79
|
+
* Semantic heading components. `<H1>` … `<H6>`. Each level has sensible
|
|
80
|
+
* defaults (font size, weight, margin-top, margin-bottom) tuned for
|
|
81
|
+
* document layout; pass `style` to override individual properties (your
|
|
82
|
+
* values win on conflict).
|
|
83
|
+
*
|
|
84
|
+
* In tagged PDFs (`<Document tagged>` or `<Document pdfUa>`), headings
|
|
85
|
+
* map to the corresponding `/H1` – `/H6` PDF structure elements
|
|
86
|
+
* automatically — useful for screen-reader accessibility and for tools
|
|
87
|
+
* that build a table of contents from the structure tree.
|
|
88
|
+
*
|
|
89
|
+
* Inline formatting components work inside: `<H1>Chapter <Em>1</Em></H1>`.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* <H1>Annual Report</H1>
|
|
94
|
+
* <H2 style={{ marginTop: 32 }}>Executive Summary</H2>
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function H1(_props: HeadingProps): null;
|
|
98
|
+
export declare function H2(_props: HeadingProps): null;
|
|
99
|
+
export declare function H3(_props: HeadingProps): null;
|
|
100
|
+
export declare function H4(_props: HeadingProps): null;
|
|
101
|
+
export declare function H5(_props: HeadingProps): null;
|
|
102
|
+
export declare function H6(_props: HeadingProps): null;
|
|
103
|
+
/**
|
|
104
|
+
* An ordered (numbered) list. Children must be `<ListItem>` elements.
|
|
105
|
+
*
|
|
106
|
+
* Numbering continues across page breaks. The marker gutter is sized
|
|
107
|
+
* automatically to fit the widest number the list will render.
|
|
108
|
+
*
|
|
109
|
+
* @param props.type - Numbering style. `'decimal'` (default) | `'lower-alpha'`
|
|
110
|
+
* | `'upper-alpha'` | `'lower-roman'` | `'upper-roman'`.
|
|
111
|
+
* @param props.start - Starting index. Defaults to `1`.
|
|
112
|
+
* @param props.style - Container style overrides.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <OrderedList type="lower-alpha">
|
|
117
|
+
* <ListItem>first</ListItem>
|
|
118
|
+
* <ListItem>second</ListItem>
|
|
119
|
+
* </OrderedList>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare function OrderedList(_props: OrderedListProps): null;
|
|
123
|
+
/**
|
|
124
|
+
* An unordered (bulleted) list. Children must be `<ListItem>` elements.
|
|
125
|
+
*
|
|
126
|
+
* v1 ships with the standard "•" bullet glyph for `disc`, `circle`, and
|
|
127
|
+
* `square` (proper distinct glyphs for circle and square are a follow-up).
|
|
128
|
+
* `none` suppresses the marker entirely.
|
|
129
|
+
*
|
|
130
|
+
* @param props.marker - Bullet style. `'disc'` (default) | `'circle'`
|
|
131
|
+
* | `'square'` | `'none'`.
|
|
132
|
+
* @param props.style - Container style overrides.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* <UnorderedList>
|
|
137
|
+
* <ListItem>first</ListItem>
|
|
138
|
+
* <ListItem>second</ListItem>
|
|
139
|
+
* </UnorderedList>
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
export declare function UnorderedList(_props: UnorderedListProps): null;
|
|
143
|
+
/**
|
|
144
|
+
* One item inside an `<OrderedList>` or `<UnorderedList>`. Content can
|
|
145
|
+
* be text, inline-formatted runs, nested lists, or any Forme content
|
|
146
|
+
* node — the marker is rendered to the left, content (including any
|
|
147
|
+
* wrapped lines) aligns to the right of the marker gutter.
|
|
148
|
+
*/
|
|
149
|
+
export declare function ListItem(_props: ListItemProps): null;
|
|
150
|
+
/**
|
|
151
|
+
* Inline bold text. Use inside `<Text>` for runs of bold content.
|
|
152
|
+
* Equivalent to wrapping content in a `<Text style={{ fontWeight: 700 }}>`
|
|
153
|
+
* — just shorter. Composes with nested inline-formatting components
|
|
154
|
+
* (e.g. `<Strong><Em>both</Em></Strong>` produces bold + italic).
|
|
155
|
+
*
|
|
156
|
+
* @param props.style - Optional style overrides (merged on top of the
|
|
157
|
+
* default `fontWeight: 700`)
|
|
158
|
+
* @param props.children - Inline content (text, numbers, or other inline
|
|
159
|
+
* components like `<Em>`)
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <Text>Read the <Strong>fine print</Strong> carefully.</Text>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export declare function Strong(_props: StrongProps): null;
|
|
167
|
+
/**
|
|
168
|
+
* Inline italic text. Use inside `<Text>` for runs of emphasized
|
|
169
|
+
* content. Equivalent to `<Text style={{ fontStyle: 'italic' }}>`.
|
|
170
|
+
*
|
|
171
|
+
* @param props.style - Optional style overrides
|
|
172
|
+
* @param props.children - Inline content
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```tsx
|
|
176
|
+
* <Text>This is <Em>important</Em> to remember.</Text>
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
export declare function Em(_props: EmProps): null;
|
|
180
|
+
/**
|
|
181
|
+
* Inline monospace text with a subtle background — like Markdown's
|
|
182
|
+
* `` `code` ``. Use inside `<Text>` for runs of inline code or paths.
|
|
183
|
+
*
|
|
184
|
+
* @param props.style - Optional style overrides (merged on top of the
|
|
185
|
+
* default font/background/padding)
|
|
186
|
+
* @param props.children - Inline content
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <Text>Run <Code>npm install</Code> to get started.</Text>
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function Code(_props: CodeProps): null;
|
|
194
|
+
/**
|
|
195
|
+
* Inline hyperlink. Renders blue + underlined and is clickable in the
|
|
196
|
+
* output PDF. Use inside `<Text>` for inline links.
|
|
197
|
+
*
|
|
198
|
+
* @param props.href - The URL to link to (required)
|
|
199
|
+
* @param props.style - Optional style overrides
|
|
200
|
+
* @param props.children - Inline link content (the visible link text)
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```tsx
|
|
204
|
+
* <Text>See the <Link href="https://docs.formepdf.com">docs</Link>.</Text>
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
export declare function Link(_props: LinkProps): null;
|
|
78
208
|
/**
|
|
79
209
|
* An image element. Supports JPEG, PNG, and WebP via data URIs or file paths.
|
|
80
210
|
*
|
package/dist/components.js
CHANGED
|
@@ -84,6 +84,162 @@ export function View(_props) {
|
|
|
84
84
|
export function Text(_props) {
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Semantic heading components. `<H1>` … `<H6>`. Each level has sensible
|
|
89
|
+
* defaults (font size, weight, margin-top, margin-bottom) tuned for
|
|
90
|
+
* document layout; pass `style` to override individual properties (your
|
|
91
|
+
* values win on conflict).
|
|
92
|
+
*
|
|
93
|
+
* In tagged PDFs (`<Document tagged>` or `<Document pdfUa>`), headings
|
|
94
|
+
* map to the corresponding `/H1` – `/H6` PDF structure elements
|
|
95
|
+
* automatically — useful for screen-reader accessibility and for tools
|
|
96
|
+
* that build a table of contents from the structure tree.
|
|
97
|
+
*
|
|
98
|
+
* Inline formatting components work inside: `<H1>Chapter <Em>1</Em></H1>`.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <H1>Annual Report</H1>
|
|
103
|
+
* <H2 style={{ marginTop: 32 }}>Executive Summary</H2>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export function H1(_props) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
export function H2(_props) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
export function H3(_props) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
export function H4(_props) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
export function H5(_props) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
export function H6(_props) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* An ordered (numbered) list. Children must be `<ListItem>` elements.
|
|
126
|
+
*
|
|
127
|
+
* Numbering continues across page breaks. The marker gutter is sized
|
|
128
|
+
* automatically to fit the widest number the list will render.
|
|
129
|
+
*
|
|
130
|
+
* @param props.type - Numbering style. `'decimal'` (default) | `'lower-alpha'`
|
|
131
|
+
* | `'upper-alpha'` | `'lower-roman'` | `'upper-roman'`.
|
|
132
|
+
* @param props.start - Starting index. Defaults to `1`.
|
|
133
|
+
* @param props.style - Container style overrides.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <OrderedList type="lower-alpha">
|
|
138
|
+
* <ListItem>first</ListItem>
|
|
139
|
+
* <ListItem>second</ListItem>
|
|
140
|
+
* </OrderedList>
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
export function OrderedList(_props) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* An unordered (bulleted) list. Children must be `<ListItem>` elements.
|
|
148
|
+
*
|
|
149
|
+
* v1 ships with the standard "•" bullet glyph for `disc`, `circle`, and
|
|
150
|
+
* `square` (proper distinct glyphs for circle and square are a follow-up).
|
|
151
|
+
* `none` suppresses the marker entirely.
|
|
152
|
+
*
|
|
153
|
+
* @param props.marker - Bullet style. `'disc'` (default) | `'circle'`
|
|
154
|
+
* | `'square'` | `'none'`.
|
|
155
|
+
* @param props.style - Container style overrides.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* <UnorderedList>
|
|
160
|
+
* <ListItem>first</ListItem>
|
|
161
|
+
* <ListItem>second</ListItem>
|
|
162
|
+
* </UnorderedList>
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
export function UnorderedList(_props) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* One item inside an `<OrderedList>` or `<UnorderedList>`. Content can
|
|
170
|
+
* be text, inline-formatted runs, nested lists, or any Forme content
|
|
171
|
+
* node — the marker is rendered to the left, content (including any
|
|
172
|
+
* wrapped lines) aligns to the right of the marker gutter.
|
|
173
|
+
*/
|
|
174
|
+
export function ListItem(_props) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Inline bold text. Use inside `<Text>` for runs of bold content.
|
|
179
|
+
* Equivalent to wrapping content in a `<Text style={{ fontWeight: 700 }}>`
|
|
180
|
+
* — just shorter. Composes with nested inline-formatting components
|
|
181
|
+
* (e.g. `<Strong><Em>both</Em></Strong>` produces bold + italic).
|
|
182
|
+
*
|
|
183
|
+
* @param props.style - Optional style overrides (merged on top of the
|
|
184
|
+
* default `fontWeight: 700`)
|
|
185
|
+
* @param props.children - Inline content (text, numbers, or other inline
|
|
186
|
+
* components like `<Em>`)
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <Text>Read the <Strong>fine print</Strong> carefully.</Text>
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export function Strong(_props) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Inline italic text. Use inside `<Text>` for runs of emphasized
|
|
198
|
+
* content. Equivalent to `<Text style={{ fontStyle: 'italic' }}>`.
|
|
199
|
+
*
|
|
200
|
+
* @param props.style - Optional style overrides
|
|
201
|
+
* @param props.children - Inline content
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```tsx
|
|
205
|
+
* <Text>This is <Em>important</Em> to remember.</Text>
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export function Em(_props) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Inline monospace text with a subtle background — like Markdown's
|
|
213
|
+
* `` `code` ``. Use inside `<Text>` for runs of inline code or paths.
|
|
214
|
+
*
|
|
215
|
+
* @param props.style - Optional style overrides (merged on top of the
|
|
216
|
+
* default font/background/padding)
|
|
217
|
+
* @param props.children - Inline content
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```tsx
|
|
221
|
+
* <Text>Run <Code>npm install</Code> to get started.</Text>
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export function Code(_props) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Inline hyperlink. Renders blue + underlined and is clickable in the
|
|
229
|
+
* output PDF. Use inside `<Text>` for inline links.
|
|
230
|
+
*
|
|
231
|
+
* @param props.href - The URL to link to (required)
|
|
232
|
+
* @param props.style - Optional style overrides
|
|
233
|
+
* @param props.children - Inline link content (the visible link text)
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```tsx
|
|
237
|
+
* <Text>See the <Link href="https://docs.formepdf.com">docs</Link>.</Text>
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export function Link(_props) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
87
243
|
/**
|
|
88
244
|
* An image element. Supports JPEG, PNG, and WebP via data URIs or file paths.
|
|
89
245
|
*
|
package/dist/font.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
src: string | Uint8Array;
|
|
4
|
-
fontWeight?: number | 'normal' | 'bold';
|
|
5
|
-
fontStyle?: 'normal' | 'italic' | 'oblique';
|
|
6
|
-
}
|
|
7
|
-
export declare const Font: {
|
|
8
|
-
register(options: FontRegistration): void;
|
|
9
|
-
clear(): void;
|
|
10
|
-
getRegistered(): FontRegistration[];
|
|
11
|
-
};
|
|
1
|
+
export { Font } from '@formepdf/shared';
|
|
2
|
+
export type { FontRegistration } from '@formepdf/shared';
|
package/dist/font.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function normalizeWeight(w) {
|
|
3
|
-
if (w === undefined || w === 'normal')
|
|
4
|
-
return 400;
|
|
5
|
-
if (w === 'bold')
|
|
6
|
-
return 700;
|
|
7
|
-
return typeof w === 'number' ? w : (parseInt(w, 10) || 400);
|
|
8
|
-
}
|
|
9
|
-
export const Font = {
|
|
10
|
-
register(options) {
|
|
11
|
-
globalFonts.push({
|
|
12
|
-
...options,
|
|
13
|
-
fontWeight: normalizeWeight(options.fontWeight),
|
|
14
|
-
fontStyle: options.fontStyle || 'normal',
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
clear() {
|
|
18
|
-
globalFonts.length = 0;
|
|
19
|
-
},
|
|
20
|
-
getRegistered() {
|
|
21
|
-
return [...globalFonts];
|
|
22
|
-
},
|
|
23
|
-
};
|
|
1
|
+
export { Font } from '@formepdf/shared';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { Document, Page, View, Text, Image, Table, Row, Cell, Fixed, Svg, QrCode, Barcode, Canvas, Watermark, PageBreak, BarChart, LineChart, PieChart, AreaChart, DotPlot, TextField, Checkbox, Dropdown, RadioButton } from './components.js';
|
|
1
|
+
export { Document, Page, View, Text, H1, H2, H3, H4, H5, H6, OrderedList, UnorderedList, ListItem, Strong, Em, Code, Link, Image, Table, Row, Cell, Fixed, Svg, QrCode, Barcode, Canvas, Watermark, PageBreak, BarChart, LineChart, PieChart, AreaChart, DotPlot, TextField, Checkbox, Dropdown, RadioButton } from './components.js';
|
|
2
2
|
export { LegacyBarChart, LegacyLineChart, LegacyPieChart } from './charts.js';
|
|
3
|
-
export { serialize, serializeTemplate
|
|
3
|
+
export { serialize, serializeTemplate } from './serialize.js';
|
|
4
|
+
export { mapStyle, mapDimension, parseColor, expandEdges, expandCorners } from '@formepdf/shared';
|
|
4
5
|
export { StyleSheet } from './stylesheet.js';
|
|
5
6
|
export { Font } from './font.js';
|
|
6
7
|
export type { FontRegistration } from './font.js';
|
|
7
8
|
export { createDataProxy, isRefMarker, isEachMarker, isExprMarker } from './template-proxy.js';
|
|
8
9
|
export { expr } from './expr.js';
|
|
9
10
|
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, CertificationConfig, SignatureConfig, FormeDocument, FormeFont, FormeNode, FormeNodeKind, FormeStyle, FormePageConfig, FormePageSize, FormeEdges, FormeMetadata, FormeColumnDef, FormeColumnWidth, FormeDimension, FormeColor, FormeEdgeValues, FormeCornerValues, FormeGridTrackSize, FormeGridPlacement, } from './types.js';
|
|
11
|
+
export type { Style, GridTrackSize, Edges, Corners, EdgeColors, DocumentProps, PageProps, ViewProps, TextProps, HeadingProps, OrderedListProps, UnorderedListProps, ListItemProps, ListMarker, StrongProps, EmProps, CodeProps, LinkProps, 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/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Components
|
|
2
|
-
export { Document, Page, View, Text, Image, Table, Row, Cell, Fixed, Svg, QrCode, Barcode, Canvas, Watermark, PageBreak, BarChart, LineChart, PieChart, AreaChart, DotPlot, TextField, Checkbox, Dropdown, RadioButton } from './components.js';
|
|
2
|
+
export { Document, Page, View, Text, H1, H2, H3, H4, H5, H6, OrderedList, UnorderedList, ListItem, Strong, Em, Code, Link, Image, Table, Row, Cell, Fixed, Svg, QrCode, Barcode, Canvas, Watermark, PageBreak, BarChart, LineChart, PieChart, AreaChart, DotPlot, TextField, Checkbox, Dropdown, RadioButton } from './components.js';
|
|
3
3
|
export { LegacyBarChart, LegacyLineChart, LegacyPieChart } from './charts.js';
|
|
4
4
|
// Serialization
|
|
5
|
-
export { serialize, serializeTemplate
|
|
5
|
+
export { serialize, serializeTemplate } from './serialize.js';
|
|
6
|
+
export { mapStyle, mapDimension, parseColor, expandEdges, expandCorners } from '@formepdf/shared';
|
|
6
7
|
// StyleSheet
|
|
7
8
|
export { StyleSheet } from './stylesheet.js';
|
|
8
9
|
// Font registration
|
package/dist/serialize.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FormeDocument } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Serialize a React element tree into a Forme JSON document object.
|
|
5
5
|
* The top-level element must be a <Document> (or a component that returns one).
|
|
6
6
|
*/
|
|
7
7
|
export declare function serialize(element: ReactElement): FormeDocument;
|
|
8
|
-
export declare function mapStyle(style?: Style): FormeStyle;
|
|
9
|
-
export declare function mapDimension(val: number | string): FormeDimension;
|
|
10
|
-
export declare function parseColor(hex: string): FormeColor;
|
|
11
|
-
export declare function expandEdges(val: number | string | number[] | Edges): FormeEdges;
|
|
12
|
-
export declare function expandCorners(val: number | Corners): FormeCornerValues;
|
|
13
8
|
/**
|
|
14
9
|
* Serialize a React element tree into a Forme template JSON document.
|
|
15
10
|
* Like `serialize()` but with expression marker detection for template compilation.
|