@jsxpdf/jsxpdf 0.0.1-alpha.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/node.js ADDED
@@ -0,0 +1,690 @@
1
+ // src/node.ts
2
+ import {
3
+ Canvas,
4
+ Circle,
5
+ Checkbox,
6
+ ClipPath,
7
+ Defs,
8
+ Document as Document2,
9
+ Ellipse,
10
+ Table,
11
+ TableBody,
12
+ TableCell,
13
+ TableFooter,
14
+ TableHead,
15
+ TableRow,
16
+ FieldSet,
17
+ G,
18
+ Image,
19
+ Line,
20
+ LinearGradient,
21
+ Link,
22
+ List,
23
+ Note,
24
+ Page as Page2,
25
+ PageBreak,
26
+ Path,
27
+ Polygon,
28
+ Polyline,
29
+ RadialGradient,
30
+ Rect,
31
+ Select,
32
+ Stop,
33
+ Svg,
34
+ Text,
35
+ TextInput,
36
+ Tspan,
37
+ View as View2
38
+ } from "@jsxpdf/core";
39
+ import { Font, StyleSheet } from "@jsxpdf/core";
40
+
41
+ // src/render.ts
42
+ import { concatUint8Arrays } from "@jsxpdf/core";
43
+ import {
44
+ createPdfRuntime
45
+ } from "@jsxpdf/render";
46
+ import { renderPdf } from "@jsxpdf/render-pdfkit";
47
+ var runtime = createPdfRuntime(renderPdf);
48
+ var chunkToUint8Array = (chunk2) => {
49
+ if (chunk2 instanceof Uint8Array) return chunk2;
50
+ if (typeof chunk2 === "string") return new TextEncoder().encode(chunk2);
51
+ return new Uint8Array(chunk2);
52
+ };
53
+ var collectStreamBytes = (stream) => new Promise((resolve, reject) => {
54
+ const chunks = [];
55
+ let ended = false;
56
+ let finished = false;
57
+ let settled = false;
58
+ let resolveTimer = null;
59
+ const settle = () => {
60
+ if (settled) return;
61
+ settled = true;
62
+ if (resolveTimer) clearTimeout(resolveTimer);
63
+ resolve(concatUint8Arrays(chunks));
64
+ };
65
+ const maybeResolve = () => {
66
+ if (settled) return;
67
+ if (ended && finished) return settle();
68
+ if (ended || finished) {
69
+ if (resolveTimer) clearTimeout(resolveTimer);
70
+ resolveTimer = setTimeout(settle, 0);
71
+ }
72
+ };
73
+ stream.on("data", (chunk2) => {
74
+ chunks.push(chunkToUint8Array(chunk2));
75
+ });
76
+ stream.on("end", () => {
77
+ ended = true;
78
+ maybeResolve();
79
+ });
80
+ stream.on("finish", () => {
81
+ finished = true;
82
+ maybeResolve();
83
+ });
84
+ stream.on("error", reject);
85
+ });
86
+ var wrapInstance = (instance) => ({
87
+ ...instance,
88
+ async toUint8Array() {
89
+ return collectStreamBytes(await instance.toStream());
90
+ },
91
+ async toBlob() {
92
+ const bytes = await this.toUint8Array();
93
+ return new Blob([Uint8Array.from(bytes)], { type: "application/pdf" });
94
+ }
95
+ });
96
+ var pdf = (initialValue, options = {}) => {
97
+ return wrapInstance(runtime.pdf(initialValue, options));
98
+ };
99
+ var renderToUint8Array = (element, options = {}) => pdf(element, options).toUint8Array();
100
+ var renderToBlob = (element, options = {}) => pdf(element, options).toBlob();
101
+
102
+ // src/repeat.ts
103
+ import { Document, Page, View, createBindingToken, isBindingToken, materializeChildren, materializeElement, parseSizeValue } from "@jsxpdf/core";
104
+ import {
105
+ buildConcatenatedDocumentLayout,
106
+ compilePrecompiledTemplateSync,
107
+ initCompiledRenderState,
108
+ runSinglePageIncrementalPipeline
109
+ } from "@jsxpdf/layout";
110
+
111
+ // src/jsx-runtime.ts
112
+ import { Fragment, jsx, jsxs, jsxDEV } from "@jsxpdf/core/jsx-runtime";
113
+
114
+ // src/repeat.ts
115
+ var pageSizes = {
116
+ A0: [2383.94, 3370.39],
117
+ A1: [1683.78, 2383.94],
118
+ A2: [1190.55, 1683.78],
119
+ A3: [841.89, 1190.55],
120
+ A4: [595.28, 841.89],
121
+ A5: [419.53, 595.28],
122
+ A6: [297.64, 419.53],
123
+ LETTER: [612, 792],
124
+ LEGAL: [612, 1008],
125
+ TABLOID: [792, 1224]
126
+ };
127
+ var TRACKED_PATH_SYMBOL = /* @__PURE__ */ Symbol.for("jsxpdf.trackedPath");
128
+ var h = (type, props, ...children) => {
129
+ const normalizedChildren = children.flat(Infinity).filter((child) => child !== void 0 && child !== null && child !== false);
130
+ const nextProps = { ...props ?? {} };
131
+ if (normalizedChildren.length === 1) {
132
+ nextProps.children = normalizedChildren[0];
133
+ } else if (normalizedChildren.length > 1) {
134
+ nextProps.children = normalizedChildren;
135
+ }
136
+ const key = nextProps.key;
137
+ delete nextProps.key;
138
+ return Array.isArray(nextProps.children) ? jsxs(type, nextProps, key) : jsx(type, nextProps, key);
139
+ };
140
+ var chunk = (items, size) => {
141
+ const result = [];
142
+ for (let index = 0; index < items.length; index += size) {
143
+ result.push(items.slice(index, index + size));
144
+ }
145
+ return result;
146
+ };
147
+ var resolveRepeatPageSize = (size, orientation, dpi = 72) => {
148
+ let resolved;
149
+ if (typeof size === "string") {
150
+ resolved = pageSizes[size.toUpperCase()] ?? pageSizes.A4;
151
+ } else if (Array.isArray(size)) {
152
+ resolved = [
153
+ parseSizeValue(size[0], 0, dpi) ?? pageSizes.A4[0],
154
+ parseSizeValue(size[1], 0, dpi) ?? pageSizes.A4[1]
155
+ ];
156
+ } else if (typeof size === "number") {
157
+ resolved = [size, size];
158
+ } else if (size && typeof size === "object") {
159
+ resolved = [
160
+ parseSizeValue(size.width, 0, dpi) ?? pageSizes.A4[0],
161
+ parseSizeValue(size.height, 0, dpi) ?? pageSizes.A4[1]
162
+ ];
163
+ } else {
164
+ resolved = pageSizes.A4;
165
+ }
166
+ return orientation === "landscape" ? [resolved[1], resolved[0]] : resolved;
167
+ };
168
+ var reorderForColumnFill = (items, columns, rows) => {
169
+ const perPage = Math.max(1, columns * rows);
170
+ const reordered = [];
171
+ for (const pageItems of chunk(items, perPage)) {
172
+ for (let row = 0; row < rows; row += 1) {
173
+ for (let column = 0; column < columns; column += 1) {
174
+ const sourceIndex = column * rows + row;
175
+ const item = pageItems[sourceIndex];
176
+ if (item !== void 0) reordered.push(item);
177
+ }
178
+ }
179
+ }
180
+ return reordered;
181
+ };
182
+ var isElement = (value) => typeof value === "object" && value !== null && "type" in value && "props" in value;
183
+ var resolveTrackedPathValue = (root, path) => {
184
+ let current = root;
185
+ for (const segment of path) {
186
+ if (current == null) return void 0;
187
+ current = current[segment];
188
+ }
189
+ return current;
190
+ };
191
+ var resolveBindingValues = (value, rootProps) => {
192
+ if (isBindingToken(value)) {
193
+ return resolveTrackedPathValue(rootProps, value.path);
194
+ }
195
+ if (Array.isArray(value)) {
196
+ return value.map((entry) => resolveBindingValues(entry, rootProps));
197
+ }
198
+ if (value instanceof Date || value instanceof Uint8Array) return value;
199
+ if (typeof value === "function") return value;
200
+ if (value && typeof value === "object") {
201
+ const source = value;
202
+ const resolved = {};
203
+ for (const [key, entry] of Object.entries(source)) {
204
+ resolved[key] = resolveBindingValues(entry, rootProps);
205
+ }
206
+ return resolved;
207
+ }
208
+ return value;
209
+ };
210
+ var extractConcatDocuments = (value) => {
211
+ const resolved = materializeElement(value);
212
+ const children = materializeChildren(resolved);
213
+ const documents = [];
214
+ for (const child of children) {
215
+ const resolvedChild = materializeElement(child);
216
+ if (!isElement(resolvedChild)) continue;
217
+ if (resolvedChild.type === Document) {
218
+ documents.push(resolvedChild);
219
+ continue;
220
+ }
221
+ if (resolvedChild.type === Page) {
222
+ documents.push(h(Document, null, resolvedChild));
223
+ continue;
224
+ }
225
+ throw new Error(`Concat only accepts Document, RepeatedDocument, or Page children. Received ${String(resolvedChild.type)}.`);
226
+ }
227
+ return documents;
228
+ };
229
+ function CardSlot(props) {
230
+ const { __repeatSlotMetrics, padding = 0, overflow = "clip", clip, wrap, style, children, ...rest } = props;
231
+ if (!__repeatSlotMetrics) {
232
+ throw new Error("CardSlot must be used inside Repeat.");
233
+ }
234
+ const contentWidth = Math.max(0, __repeatSlotMetrics.width - padding * 2);
235
+ const contentHeight = Math.max(0, __repeatSlotMetrics.height - padding * 2);
236
+ return h(
237
+ View,
238
+ {
239
+ ...rest,
240
+ wrap: wrap ?? false,
241
+ clip: clip ?? overflow !== "error",
242
+ repeatSlotConfig: {
243
+ overflow,
244
+ contentWidth,
245
+ contentHeight
246
+ },
247
+ style: [
248
+ style,
249
+ {
250
+ left: __repeatSlotMetrics.x,
251
+ top: __repeatSlotMetrics.y,
252
+ width: __repeatSlotMetrics.width,
253
+ height: __repeatSlotMetrics.height,
254
+ paddingTop: padding,
255
+ paddingRight: padding,
256
+ paddingBottom: padding,
257
+ paddingLeft: padding,
258
+ position: "absolute"
259
+ }
260
+ ]
261
+ },
262
+ h(
263
+ View,
264
+ {
265
+ repeatSlotContent: true,
266
+ wrap: false,
267
+ style: {
268
+ width: contentWidth,
269
+ height: contentHeight,
270
+ position: "relative"
271
+ }
272
+ },
273
+ children
274
+ )
275
+ );
276
+ }
277
+ var getRepeatedDocumentPlan = (props) => {
278
+ if (isBindingToken(props.items)) {
279
+ throw new Error("jsxpdf.compile.unsupported: RepeatedDocument requires static items during layout.");
280
+ }
281
+ const items = props.fill === "column" ? reorderForColumnFill(props.items, props.slots.columns, props.slots.rows) : [...props.items];
282
+ const columns = Math.max(1, Math.floor(props.slots.columns));
283
+ const rows = Math.max(1, Math.floor(props.slots.rows));
284
+ const gap = Math.max(0, props.gap ?? 0);
285
+ const perPage = columns * rows;
286
+ const [pageWidth, pageHeight] = resolveRepeatPageSize(
287
+ props.page?.size,
288
+ props.page?.orientation,
289
+ props.page?.dpi
290
+ );
291
+ const totalHorizontalGap = gap * (columns - 1);
292
+ const totalVerticalGap = gap * (rows - 1);
293
+ const slotWidth = (pageWidth - totalHorizontalGap) / columns;
294
+ const slotHeight = (pageHeight - totalVerticalGap) / rows;
295
+ const pageCount = Math.ceil(items.length / perPage);
296
+ return {
297
+ items,
298
+ columns,
299
+ gap,
300
+ perPage,
301
+ pageWidth,
302
+ pageHeight,
303
+ pageCount,
304
+ slotWidth,
305
+ slotHeight
306
+ };
307
+ };
308
+ var createRepeatedPageDocument = (props, pageIndex) => {
309
+ const plan = getRepeatedDocumentPlan(props);
310
+ const pageItems = plan.items.slice(pageIndex * plan.perPage, pageIndex * plan.perPage + plan.perPage);
311
+ const trackedItemPaths = pageItems.map((item) => item && typeof item === "object" && Array.isArray(item[TRACKED_PATH_SYMBOL]) ? [...item[TRACKED_PATH_SYMBOL]] : null).filter((path) => Array.isArray(path) && path.length >= 2 && typeof path[path.length - 1] === "number");
312
+ const firstTrackedPath = trackedItemPaths[0];
313
+ const pageCollectionPath = firstTrackedPath && trackedItemPaths.every(
314
+ (path) => path.length === firstTrackedPath.length && path.slice(0, -1).every((segment, index) => segment === firstTrackedPath[index])
315
+ ) ? firstTrackedPath.slice(0, -1) : void 0;
316
+ const pageIndexRange = pageCollectionPath && trackedItemPaths.length > 0 ? [
317
+ Math.min(...trackedItemPaths.map((path) => path[path.length - 1])),
318
+ Math.max(...trackedItemPaths.map((path) => path[path.length - 1]))
319
+ ] : void 0;
320
+ return h(
321
+ Document,
322
+ {
323
+ key: `repeated-document-${pageIndex + 1}`
324
+ },
325
+ h(
326
+ Page,
327
+ {
328
+ key: `repeat-page-${pageIndex + 1}`,
329
+ size: [plan.pageWidth, plan.pageHeight],
330
+ dpi: props.page?.dpi,
331
+ __repeatTrackedCollectionPath: pageCollectionPath,
332
+ __repeatTrackedIndexRange: pageIndexRange,
333
+ style: [
334
+ {
335
+ padding: 0,
336
+ position: "relative"
337
+ },
338
+ props.page?.style
339
+ ]
340
+ },
341
+ ...pageItems.map((item, itemIndex) => {
342
+ const childIndex = pageIndex * plan.perPage + itemIndex;
343
+ const row = Math.floor(itemIndex / plan.columns);
344
+ const column = itemIndex % plan.columns;
345
+ const rendered = typeof props.children === "function" ? props.children(item, childIndex) : props.children;
346
+ const metrics = {
347
+ x: column * (plan.slotWidth + plan.gap),
348
+ y: row * (plan.slotHeight + plan.gap),
349
+ width: plan.slotWidth,
350
+ height: plan.slotHeight
351
+ };
352
+ const repeatTrackedItemPath = item && typeof item === "object" && Array.isArray(item[TRACKED_PATH_SYMBOL]) ? [...item[TRACKED_PATH_SYMBOL]] : void 0;
353
+ if (isElement(rendered) && rendered.type === CardSlot) {
354
+ return {
355
+ ...rendered,
356
+ props: {
357
+ ...rendered.props,
358
+ __repeatSlotMetrics: metrics,
359
+ __repeatTrackedItemPath: repeatTrackedItemPath
360
+ }
361
+ };
362
+ }
363
+ return h(CardSlot, {
364
+ key: `repeat-slot-${childIndex + 1}`,
365
+ __repeatSlotMetrics: metrics,
366
+ __repeatTrackedItemPath: repeatTrackedItemPath,
367
+ children: rendered
368
+ });
369
+ })
370
+ )
371
+ );
372
+ };
373
+ var createRepeatedPages = (props) => {
374
+ const plan = getRepeatedDocumentPlan(props);
375
+ return Array.from({ length: plan.pageCount }, (_, pageIndex) => {
376
+ const document = createRepeatedPageDocument(props, pageIndex);
377
+ return materializeChildren(document.props.children ?? [])[0];
378
+ });
379
+ };
380
+ var createRepeatedSlotElement = (props, item, itemIndex, metrics) => {
381
+ const rendered = typeof props.children === "function" ? props.children(item, itemIndex) : props.children;
382
+ const repeatTrackedItemPath = item && typeof item === "object" && Array.isArray(item[TRACKED_PATH_SYMBOL]) ? [...item[TRACKED_PATH_SYMBOL]] : void 0;
383
+ if (isElement(rendered) && rendered.type === CardSlot) {
384
+ return {
385
+ ...rendered,
386
+ props: {
387
+ ...rendered.props,
388
+ __repeatSlotMetrics: metrics,
389
+ __repeatTrackedItemPath: repeatTrackedItemPath
390
+ }
391
+ };
392
+ }
393
+ return h(CardSlot, {
394
+ key: `repeat-slot-${itemIndex + 1}`,
395
+ __repeatSlotMetrics: metrics,
396
+ __repeatTrackedItemPath: repeatTrackedItemPath,
397
+ children: rendered
398
+ });
399
+ };
400
+ var canCompileRepeatedSchema = (props) => {
401
+ if (!isBindingToken(props.items)) return false;
402
+ if (isBindingToken(props.page?.size) || isBindingToken(props.page?.orientation) || isBindingToken(props.page?.dpi)) return false;
403
+ if (isBindingToken(props.gap) || isBindingToken(props.fill)) return false;
404
+ if (isBindingToken(props.slots.columns) || isBindingToken(props.slots.rows)) return false;
405
+ return true;
406
+ };
407
+ var createRepeatedSchemaRender = (props) => {
408
+ if (!isBindingToken(props.items)) {
409
+ throw new Error("jsxpdf.compile.unsupported: RepeatedDocument schema render requires binding-token items.");
410
+ }
411
+ const itemsPath = [...props.items.path];
412
+ const staticPlan = getRepeatedDocumentPlan({
413
+ ...props,
414
+ items: []
415
+ });
416
+ const documentTemplate = compilePrecompiledTemplateSync(h(Document, {
417
+ title: props.title,
418
+ author: props.author,
419
+ subject: props.subject,
420
+ creator: props.creator,
421
+ keywords: props.keywords,
422
+ producer: props.producer,
423
+ language: props.language,
424
+ creationDate: props.creationDate,
425
+ modificationDate: props.modificationDate,
426
+ pdfVersion: props.pdfVersion,
427
+ tagged: props.tagged,
428
+ attachments: props.attachments,
429
+ xmp: props.xmp,
430
+ pdfaid: props.pdfaid,
431
+ pageMode: props.pageMode,
432
+ pageLayout: props.pageLayout
433
+ }));
434
+ const pageTemplate = compilePrecompiledTemplateSync(
435
+ h(
436
+ Document,
437
+ null,
438
+ h(
439
+ Page,
440
+ {
441
+ size: [staticPlan.pageWidth, staticPlan.pageHeight],
442
+ dpi: props.page?.dpi,
443
+ style: [
444
+ {
445
+ padding: 0,
446
+ position: "relative"
447
+ },
448
+ props.page?.style
449
+ ]
450
+ }
451
+ )
452
+ )
453
+ );
454
+ const slotTemplate = compilePrecompiledTemplateSync(
455
+ createRepeatedSlotElement(
456
+ props,
457
+ createBindingToken(["__repeatItem"], "", void 0, true),
458
+ 0,
459
+ {
460
+ x: 0,
461
+ y: 0,
462
+ width: staticPlan.slotWidth,
463
+ height: staticPlan.slotHeight
464
+ }
465
+ )
466
+ );
467
+ const declaredBindingPaths = [
468
+ itemsPath,
469
+ ...documentTemplate.placeholders.flatMap((entry) => [
470
+ ...entry.bindingPath ? [entry.bindingPath] : [],
471
+ ...entry.bindingPaths ?? []
472
+ ]),
473
+ ...pageTemplate.placeholders.flatMap((entry) => [
474
+ ...entry.bindingPath ? [entry.bindingPath] : [],
475
+ ...entry.bindingPaths ?? []
476
+ ]),
477
+ ...slotTemplate.placeholders.flatMap((entry) => [
478
+ ...entry.bindingPath ? [entry.bindingPath] : [],
479
+ ...entry.bindingPaths ?? []
480
+ ])
481
+ ].flatMap((path) => path[0] === "__repeatItem" ? [path] : Array.from({ length: path.length }, (_, index) => path.slice(0, index + 1)));
482
+ const uniqueBindingPaths = declaredBindingPaths.filter(
483
+ (path, index, all) => all.findIndex(
484
+ (candidate) => candidate.length === path.length && candidate.every((segment, segmentIndex) => segment === path[segmentIndex])
485
+ ) === index
486
+ );
487
+ const indexedSlotElements = Array.from({ length: staticPlan.perPage }, (_, i) => {
488
+ const row = Math.floor(i / staticPlan.columns);
489
+ const col = i % staticPlan.columns;
490
+ return createRepeatedSlotElement(
491
+ props,
492
+ createBindingToken(["__slots", i], "", void 0, true),
493
+ i,
494
+ {
495
+ x: col * (staticPlan.slotWidth + staticPlan.gap),
496
+ y: row * (staticPlan.slotHeight + staticPlan.gap),
497
+ width: staticPlan.slotWidth,
498
+ height: staticPlan.slotHeight
499
+ }
500
+ );
501
+ });
502
+ const perPageCompiledTemplate = compilePrecompiledTemplateSync(
503
+ h(
504
+ Document,
505
+ null,
506
+ h(Page, {
507
+ size: [staticPlan.pageWidth, staticPlan.pageHeight],
508
+ dpi: props.page?.dpi,
509
+ style: [{ padding: 0, position: "relative" }, props.page?.style]
510
+ }, ...indexedSlotElements)
511
+ )
512
+ );
513
+ let pageOptimizedStatePromise = null;
514
+ let renderQueue = Promise.resolve();
515
+ const getPageOptimizedState = () => {
516
+ if (!pageOptimizedStatePromise) {
517
+ pageOptimizedStatePromise = initCompiledRenderState(perPageCompiledTemplate).then(
518
+ ({ renderState, incrementalLayoutState }) => ({ renderState, incrementalState: incrementalLayoutState })
519
+ );
520
+ }
521
+ return pageOptimizedStatePromise;
522
+ };
523
+ return Object.assign(
524
+ (rootProps) => {
525
+ const resolvedItems = resolveTrackedPathValue(rootProps, itemsPath);
526
+ if (!Array.isArray(resolvedItems)) {
527
+ throw new Error("jsxpdf.compile.unsupported: RepeatedDocument items must resolve to an array at render time.");
528
+ }
529
+ const allItems = props.fill === "column" ? reorderForColumnFill(resolvedItems, staticPlan.columns, staticPlan.perPage / staticPlan.columns) : resolvedItems;
530
+ const pageCount = Math.ceil(allItems.length / staticPlan.perPage);
531
+ if (allItems.length > 0 && allItems.length % staticPlan.perPage === 0) {
532
+ const result = renderQueue.then(async () => {
533
+ const state = await getPageOptimizedState();
534
+ const pageLayouts = [];
535
+ for (let pageIndex = 0; pageIndex < pageCount; pageIndex++) {
536
+ const pageItems = allItems.slice(pageIndex * staticPlan.perPage, (pageIndex + 1) * staticPlan.perPage);
537
+ const { pageLayout, incrementalState: nextState } = await runSinglePageIncrementalPipeline(
538
+ state.renderState,
539
+ state.incrementalState,
540
+ { __slots: pageItems }
541
+ );
542
+ state.incrementalState = nextState;
543
+ pageLayouts.push(pageLayout);
544
+ }
545
+ const documentProps = resolveBindingValues({
546
+ title: props.title,
547
+ author: props.author,
548
+ subject: props.subject,
549
+ creator: props.creator,
550
+ keywords: props.keywords,
551
+ producer: props.producer,
552
+ language: props.language,
553
+ creationDate: props.creationDate,
554
+ modificationDate: props.modificationDate,
555
+ pdfVersion: props.pdfVersion,
556
+ tagged: props.tagged,
557
+ attachments: props.attachments,
558
+ xmp: props.xmp,
559
+ pdfaid: props.pdfaid,
560
+ pageMode: props.pageMode,
561
+ pageLayout: props.pageLayout
562
+ }, rootProps);
563
+ return buildConcatenatedDocumentLayout(documentProps, pageLayouts);
564
+ });
565
+ renderQueue = result.then(() => {
566
+ }).catch(() => {
567
+ });
568
+ return result;
569
+ }
570
+ const concreteProps = {
571
+ ...resolveBindingValues(props, rootProps),
572
+ items: resolvedItems
573
+ };
574
+ return materializeElement(createRepeatedDocumentElement(concreteProps));
575
+ },
576
+ { bindingPaths: uniqueBindingPaths }
577
+ );
578
+ };
579
+ var createRepeatedDocumentElement = (props) => {
580
+ const concatDocuments = createRepeatedPages(props).map((page) => h(Document, null, page));
581
+ return h(
582
+ Document,
583
+ {
584
+ title: props.title,
585
+ author: props.author,
586
+ subject: props.subject,
587
+ creator: props.creator,
588
+ keywords: props.keywords,
589
+ producer: props.producer,
590
+ language: props.language,
591
+ creationDate: props.creationDate,
592
+ modificationDate: props.modificationDate,
593
+ pdfVersion: props.pdfVersion,
594
+ tagged: props.tagged,
595
+ attachments: props.attachments,
596
+ xmp: props.xmp,
597
+ pdfaid: props.pdfaid,
598
+ pageMode: props.pageMode,
599
+ pageLayout: props.pageLayout,
600
+ concatDocuments
601
+ }
602
+ );
603
+ };
604
+ function RepeatedDocument(props) {
605
+ if (canCompileRepeatedSchema(props)) {
606
+ const schemaRender = createRepeatedSchemaRender(props);
607
+ return h(
608
+ Document,
609
+ {
610
+ title: typeof props.title === "string" ? props.title : void 0,
611
+ __compiledBindingPaths: schemaRender.bindingPaths,
612
+ __compiledSchemaRender: schemaRender
613
+ }
614
+ );
615
+ }
616
+ if (isBindingToken(props.items)) {
617
+ throw new Error("jsxpdf.compile.unsupported: RepeatedDocument requires static layout props during compile.");
618
+ }
619
+ return createRepeatedDocumentElement(props);
620
+ }
621
+ function Repeat(props) {
622
+ return h(Fragment, null, ...createRepeatedPages(props));
623
+ }
624
+ function Concat(props) {
625
+ const { children, ...documentProps } = props;
626
+ return h(
627
+ Document,
628
+ {
629
+ ...documentProps,
630
+ concatDocuments: extractConcatDocuments(children ?? [])
631
+ }
632
+ );
633
+ }
634
+
635
+ // src/node.ts
636
+ import { pdf as pdf2, compile, renderToBuffer, renderToFile, renderToStream } from "@jsxpdf/node";
637
+ import { configureYogaRuntime, getYogaBackend } from "@jsxpdf/layout";
638
+ export {
639
+ Canvas,
640
+ CardSlot,
641
+ Checkbox,
642
+ Circle,
643
+ ClipPath,
644
+ Concat,
645
+ Defs,
646
+ Document2 as Document,
647
+ Ellipse,
648
+ FieldSet,
649
+ Font,
650
+ G,
651
+ Image,
652
+ Line,
653
+ LinearGradient,
654
+ Link,
655
+ List,
656
+ Note,
657
+ Page2 as Page,
658
+ PageBreak,
659
+ Path,
660
+ Polygon,
661
+ Polyline,
662
+ RadialGradient,
663
+ Rect,
664
+ Repeat,
665
+ RepeatedDocument,
666
+ Select,
667
+ Stop,
668
+ StyleSheet,
669
+ Svg,
670
+ Table,
671
+ TableBody,
672
+ TableCell,
673
+ TableFooter,
674
+ TableHead,
675
+ TableRow,
676
+ Text,
677
+ TextInput,
678
+ Tspan,
679
+ View2 as View,
680
+ compile,
681
+ configureYogaRuntime,
682
+ getYogaBackend,
683
+ pdf2 as pdf,
684
+ renderToBlob,
685
+ renderToBuffer,
686
+ renderToFile,
687
+ renderToStream,
688
+ renderToUint8Array
689
+ };
690
+ //# sourceMappingURL=node.js.map