@pdfme/common 6.0.6-dev.9 → 6.1.0-dev.2
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/dynamicTemplate.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +73 -33
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +106 -0
- package/dist/types.d.ts +20 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -71,10 +71,21 @@ export declare const Dict: z.ZodObject<{
|
|
|
71
71
|
'schemas.text.fit': z.ZodString;
|
|
72
72
|
'schemas.text.dynamicFontSize': z.ZodString;
|
|
73
73
|
'schemas.text.format': z.ZodString;
|
|
74
|
+
'schemas.text.plain': z.ZodString;
|
|
75
|
+
'schemas.text.inlineMarkdown': z.ZodString;
|
|
76
|
+
'schemas.text.markdownFonts': z.ZodString;
|
|
77
|
+
'schemas.text.boldFont': z.ZodString;
|
|
78
|
+
'schemas.text.italicFont': z.ZodString;
|
|
79
|
+
'schemas.text.boldItalicFont': z.ZodString;
|
|
80
|
+
'schemas.text.codeFont': z.ZodString;
|
|
81
|
+
'schemas.text.variantFallback': z.ZodString;
|
|
82
|
+
'schemas.text.synthetic': z.ZodString;
|
|
83
|
+
'schemas.text.error': z.ZodString;
|
|
74
84
|
'schemas.radius': z.ZodString;
|
|
75
85
|
'schemas.mvt.typingInstructions': z.ZodString;
|
|
76
86
|
'schemas.mvt.sampleField': z.ZodString;
|
|
77
87
|
'schemas.mvt.variablesSampleData': z.ZodString;
|
|
88
|
+
'schemas.mvt.placeholderDynamicVariable': z.ZodString;
|
|
78
89
|
'schemas.barcodes.barColor': z.ZodString;
|
|
79
90
|
'schemas.barcodes.includetext': z.ZodString;
|
|
80
91
|
'schemas.table.alternateBackgroundColor': z.ZodString;
|
|
@@ -89,6 +100,17 @@ export declare const Dict: z.ZodObject<{
|
|
|
89
100
|
'schemas.select.options': z.ZodString;
|
|
90
101
|
'schemas.select.optionPlaceholder': z.ZodString;
|
|
91
102
|
'schemas.radioGroup.groupName': z.ZodString;
|
|
103
|
+
'schemas.list.listStyle': z.ZodString;
|
|
104
|
+
'schemas.list.bullet': z.ZodString;
|
|
105
|
+
'schemas.list.ordered': z.ZodString;
|
|
106
|
+
'schemas.list.markerWidth': z.ZodString;
|
|
107
|
+
'schemas.list.markerGap': z.ZodString;
|
|
108
|
+
'schemas.list.indentSize': z.ZodString;
|
|
109
|
+
'schemas.list.itemSpacing': z.ZodString;
|
|
110
|
+
'schemas.list.addItem': z.ZodString;
|
|
111
|
+
'schemas.list.removeItem': z.ZodString;
|
|
112
|
+
'schemas.list.indentItem': z.ZodString;
|
|
113
|
+
'schemas.list.outdentItem': z.ZodString;
|
|
92
114
|
}, z.core.$strip>;
|
|
93
115
|
export declare const Mode: z.ZodEnum<{
|
|
94
116
|
viewer: "viewer";
|
|
@@ -121,6 +143,10 @@ export declare const Schema: z.ZodObject<{
|
|
|
121
143
|
start: z.ZodNumber;
|
|
122
144
|
end: z.ZodOptional<z.ZodNumber>;
|
|
123
145
|
}, z.core.$strip>>;
|
|
146
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
start: z.ZodNumber;
|
|
148
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
124
150
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
125
151
|
}, z.core.$loose>;
|
|
126
152
|
export declare const SchemaForUI: z.ZodObject<{
|
|
@@ -141,6 +167,10 @@ export declare const SchemaForUI: z.ZodObject<{
|
|
|
141
167
|
start: z.ZodNumber;
|
|
142
168
|
end: z.ZodOptional<z.ZodNumber>;
|
|
143
169
|
}, z.core.$strip>>;
|
|
170
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
start: z.ZodNumber;
|
|
172
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
144
174
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
145
175
|
id: z.ZodString;
|
|
146
176
|
}, z.core.$strip>;
|
|
@@ -166,6 +196,10 @@ export declare const BlankPdf: z.ZodObject<{
|
|
|
166
196
|
start: z.ZodNumber;
|
|
167
197
|
end: z.ZodOptional<z.ZodNumber>;
|
|
168
198
|
}, z.core.$strip>>;
|
|
199
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
start: z.ZodNumber;
|
|
201
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
169
203
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
170
204
|
}, z.core.$loose>>>;
|
|
171
205
|
}, z.core.$strip>;
|
|
@@ -192,6 +226,10 @@ export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodStr
|
|
|
192
226
|
start: z.ZodNumber;
|
|
193
227
|
end: z.ZodOptional<z.ZodNumber>;
|
|
194
228
|
}, z.core.$strip>>;
|
|
229
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
start: z.ZodNumber;
|
|
231
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
195
233
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
196
234
|
}, z.core.$loose>>>;
|
|
197
235
|
}, z.core.$strip>]>;
|
|
@@ -213,6 +251,10 @@ export declare const LegacySchemaPageArray: z.ZodArray<z.ZodRecord<z.ZodString,
|
|
|
213
251
|
start: z.ZodNumber;
|
|
214
252
|
end: z.ZodOptional<z.ZodNumber>;
|
|
215
253
|
}, z.core.$strip>>;
|
|
254
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
start: z.ZodNumber;
|
|
256
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
}, z.core.$strip>>;
|
|
216
258
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
217
259
|
}, z.core.$loose>>>;
|
|
218
260
|
export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
@@ -233,6 +275,10 @@ export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
|
233
275
|
start: z.ZodNumber;
|
|
234
276
|
end: z.ZodOptional<z.ZodNumber>;
|
|
235
277
|
}, z.core.$strip>>;
|
|
278
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
279
|
+
start: z.ZodNumber;
|
|
280
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
236
282
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
237
283
|
}, z.core.$loose>>>;
|
|
238
284
|
export declare const Template: z.ZodObject<{
|
|
@@ -254,6 +300,10 @@ export declare const Template: z.ZodObject<{
|
|
|
254
300
|
start: z.ZodNumber;
|
|
255
301
|
end: z.ZodOptional<z.ZodNumber>;
|
|
256
302
|
}, z.core.$strip>>;
|
|
303
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
start: z.ZodNumber;
|
|
305
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
}, z.core.$strip>>;
|
|
257
307
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
258
308
|
}, z.core.$loose>>>;
|
|
259
309
|
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodType<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodType<Uint8Array<ArrayBuffer>, unknown, z.core.$ZodTypeInternals<Uint8Array<ArrayBuffer>, unknown>>]>, z.ZodObject<{
|
|
@@ -278,6 +328,10 @@ export declare const Template: z.ZodObject<{
|
|
|
278
328
|
start: z.ZodNumber;
|
|
279
329
|
end: z.ZodOptional<z.ZodNumber>;
|
|
280
330
|
}, z.core.$strip>>;
|
|
331
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
332
|
+
start: z.ZodNumber;
|
|
333
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
}, z.core.$strip>>;
|
|
281
335
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
282
336
|
}, z.core.$loose>>>;
|
|
283
337
|
}, z.core.$strip>]>;
|
|
@@ -313,6 +367,10 @@ export declare const Plugin: z.ZodObject<{
|
|
|
313
367
|
start: z.ZodNumber;
|
|
314
368
|
end: z.ZodOptional<z.ZodNumber>;
|
|
315
369
|
}, z.core.$strip>>;
|
|
370
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
start: z.ZodNumber;
|
|
372
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
373
|
+
}, z.core.$strip>>;
|
|
316
374
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
317
375
|
}, z.core.$loose>;
|
|
318
376
|
}, z.core.$strip>;
|
|
@@ -377,6 +435,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
377
435
|
start: z.ZodNumber;
|
|
378
436
|
end: z.ZodOptional<z.ZodNumber>;
|
|
379
437
|
}, z.core.$strip>>;
|
|
438
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
439
|
+
start: z.ZodNumber;
|
|
440
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
441
|
+
}, z.core.$strip>>;
|
|
380
442
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
381
443
|
}, z.core.$loose>>>;
|
|
382
444
|
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodType<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodType<Uint8Array<ArrayBuffer>, unknown, z.core.$ZodTypeInternals<Uint8Array<ArrayBuffer>, unknown>>]>, z.ZodObject<{
|
|
@@ -401,6 +463,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
401
463
|
start: z.ZodNumber;
|
|
402
464
|
end: z.ZodOptional<z.ZodNumber>;
|
|
403
465
|
}, z.core.$strip>>;
|
|
466
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
467
|
+
start: z.ZodNumber;
|
|
468
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
}, z.core.$strip>>;
|
|
404
470
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
405
471
|
}, z.core.$loose>>>;
|
|
406
472
|
}, z.core.$strip>]>;
|
|
@@ -430,6 +496,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
430
496
|
start: z.ZodNumber;
|
|
431
497
|
end: z.ZodOptional<z.ZodNumber>;
|
|
432
498
|
}, z.core.$strip>>;
|
|
499
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
500
|
+
start: z.ZodNumber;
|
|
501
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
}, z.core.$strip>>;
|
|
433
503
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
434
504
|
}, z.core.$loose>;
|
|
435
505
|
}, z.core.$strip>;
|
|
@@ -516,6 +586,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
516
586
|
start: z.ZodNumber;
|
|
517
587
|
end: z.ZodOptional<z.ZodNumber>;
|
|
518
588
|
}, z.core.$strip>>;
|
|
589
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
590
|
+
start: z.ZodNumber;
|
|
591
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
}, z.core.$strip>>;
|
|
519
593
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
520
594
|
}, z.core.$loose>>>;
|
|
521
595
|
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodType<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodType<Uint8Array<ArrayBuffer>, unknown, z.core.$ZodTypeInternals<Uint8Array<ArrayBuffer>, unknown>>]>, z.ZodObject<{
|
|
@@ -540,6 +614,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
540
614
|
start: z.ZodNumber;
|
|
541
615
|
end: z.ZodOptional<z.ZodNumber>;
|
|
542
616
|
}, z.core.$strip>>;
|
|
617
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
618
|
+
start: z.ZodNumber;
|
|
619
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
620
|
+
}, z.core.$strip>>;
|
|
543
621
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
544
622
|
}, z.core.$loose>>>;
|
|
545
623
|
}, z.core.$strip>]>;
|
|
@@ -569,6 +647,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
569
647
|
start: z.ZodNumber;
|
|
570
648
|
end: z.ZodOptional<z.ZodNumber>;
|
|
571
649
|
}, z.core.$strip>>;
|
|
650
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
651
|
+
start: z.ZodNumber;
|
|
652
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
}, z.core.$strip>>;
|
|
572
654
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
573
655
|
}, z.core.$loose>;
|
|
574
656
|
}, z.core.$strip>;
|
|
@@ -623,6 +705,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
623
705
|
start: z.ZodNumber;
|
|
624
706
|
end: z.ZodOptional<z.ZodNumber>;
|
|
625
707
|
}, z.core.$strip>>;
|
|
708
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
709
|
+
start: z.ZodNumber;
|
|
710
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
711
|
+
}, z.core.$strip>>;
|
|
626
712
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
627
713
|
}, z.core.$loose>>>;
|
|
628
714
|
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodType<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodType<Uint8Array<ArrayBuffer>, unknown, z.core.$ZodTypeInternals<Uint8Array<ArrayBuffer>, unknown>>]>, z.ZodObject<{
|
|
@@ -647,6 +733,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
647
733
|
start: z.ZodNumber;
|
|
648
734
|
end: z.ZodOptional<z.ZodNumber>;
|
|
649
735
|
}, z.core.$strip>>;
|
|
736
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
start: z.ZodNumber;
|
|
738
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
}, z.core.$strip>>;
|
|
650
740
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
651
741
|
}, z.core.$loose>>>;
|
|
652
742
|
}, z.core.$strip>]>;
|
|
@@ -676,6 +766,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
676
766
|
start: z.ZodNumber;
|
|
677
767
|
end: z.ZodOptional<z.ZodNumber>;
|
|
678
768
|
}, z.core.$strip>>;
|
|
769
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
770
|
+
start: z.ZodNumber;
|
|
771
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
}, z.core.$strip>>;
|
|
679
773
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
680
774
|
}, z.core.$loose>;
|
|
681
775
|
}, z.core.$strip>;
|
|
@@ -731,6 +825,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
731
825
|
start: z.ZodNumber;
|
|
732
826
|
end: z.ZodOptional<z.ZodNumber>;
|
|
733
827
|
}, z.core.$strip>>;
|
|
828
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
829
|
+
start: z.ZodNumber;
|
|
830
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
}, z.core.$strip>>;
|
|
734
832
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
735
833
|
}, z.core.$loose>>>;
|
|
736
834
|
basePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodType<ArrayBuffer, unknown, z.core.$ZodTypeInternals<ArrayBuffer, unknown>>, z.ZodType<Uint8Array<ArrayBuffer>, unknown, z.core.$ZodTypeInternals<Uint8Array<ArrayBuffer>, unknown>>]>, z.ZodObject<{
|
|
@@ -755,6 +853,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
755
853
|
start: z.ZodNumber;
|
|
756
854
|
end: z.ZodOptional<z.ZodNumber>;
|
|
757
855
|
}, z.core.$strip>>;
|
|
856
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
857
|
+
start: z.ZodNumber;
|
|
858
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
859
|
+
}, z.core.$strip>>;
|
|
758
860
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
759
861
|
}, z.core.$loose>>>;
|
|
760
862
|
}, z.core.$strip>]>;
|
|
@@ -784,6 +886,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
784
886
|
start: z.ZodNumber;
|
|
785
887
|
end: z.ZodOptional<z.ZodNumber>;
|
|
786
888
|
}, z.core.$strip>>;
|
|
889
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
890
|
+
start: z.ZodNumber;
|
|
891
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
892
|
+
}, z.core.$strip>>;
|
|
787
893
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
788
894
|
}, z.core.$loose>;
|
|
789
895
|
}, z.core.$strip>;
|
package/dist/types.d.ts
CHANGED
|
@@ -225,4 +225,24 @@ export type DesignerProps = Omit<z.infer<typeof DesignerProps>, 'plugins'> & {
|
|
|
225
225
|
};
|
|
226
226
|
export type SchemaPageArray = z.infer<typeof SchemaPageArray>;
|
|
227
227
|
export type LegacySchemaPageArray = z.infer<typeof LegacySchemaPageArray>;
|
|
228
|
+
export type DynamicLayoutPatchArgs = {
|
|
229
|
+
schema: Schema;
|
|
230
|
+
start: number;
|
|
231
|
+
end: number;
|
|
232
|
+
isSplit: boolean;
|
|
233
|
+
chunkHeight: number;
|
|
234
|
+
};
|
|
235
|
+
export type DynamicLayoutResult = {
|
|
236
|
+
heights: number[];
|
|
237
|
+
avoidFirstUnitOnly?: boolean;
|
|
238
|
+
patchSplitSchema?: (args: DynamicLayoutPatchArgs) => Partial<Schema>;
|
|
239
|
+
};
|
|
240
|
+
export type DynamicLayoutCallbackResult = DynamicLayoutResult | number[];
|
|
241
|
+
export type DynamicLayoutArgs = {
|
|
242
|
+
schema: Schema;
|
|
243
|
+
basePdf: BasePdf;
|
|
244
|
+
options: CommonOptions;
|
|
245
|
+
_cache: Map<string | number, unknown>;
|
|
246
|
+
};
|
|
247
|
+
export type GetDynamicLayout = (value: string, args: DynamicLayoutArgs) => Promise<DynamicLayoutCallbackResult>;
|
|
228
248
|
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PDFME_VERSION = "6.0
|
|
1
|
+
export declare const PDFME_VERSION = "6.1.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfme/common",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0-dev.2",
|
|
4
4
|
"description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pdf",
|