@pdfme/common 6.1.0 → 6.1.1-dev.5
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/helper.d.ts +30 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +177 -28
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +95 -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
|
@@ -100,6 +100,17 @@ export declare const Dict: z.ZodObject<{
|
|
|
100
100
|
'schemas.select.options': z.ZodString;
|
|
101
101
|
'schemas.select.optionPlaceholder': z.ZodString;
|
|
102
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;
|
|
103
114
|
}, z.core.$strip>;
|
|
104
115
|
export declare const Mode: z.ZodEnum<{
|
|
105
116
|
viewer: "viewer";
|
|
@@ -132,6 +143,10 @@ export declare const Schema: z.ZodObject<{
|
|
|
132
143
|
start: z.ZodNumber;
|
|
133
144
|
end: z.ZodOptional<z.ZodNumber>;
|
|
134
145
|
}, z.core.$strip>>;
|
|
146
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
start: z.ZodNumber;
|
|
148
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
135
150
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
136
151
|
}, z.core.$loose>;
|
|
137
152
|
export declare const SchemaForUI: z.ZodObject<{
|
|
@@ -152,6 +167,10 @@ export declare const SchemaForUI: z.ZodObject<{
|
|
|
152
167
|
start: z.ZodNumber;
|
|
153
168
|
end: z.ZodOptional<z.ZodNumber>;
|
|
154
169
|
}, z.core.$strip>>;
|
|
170
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
start: z.ZodNumber;
|
|
172
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
155
174
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
156
175
|
id: z.ZodString;
|
|
157
176
|
}, z.core.$strip>;
|
|
@@ -177,6 +196,10 @@ export declare const BlankPdf: z.ZodObject<{
|
|
|
177
196
|
start: z.ZodNumber;
|
|
178
197
|
end: z.ZodOptional<z.ZodNumber>;
|
|
179
198
|
}, z.core.$strip>>;
|
|
199
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
start: z.ZodNumber;
|
|
201
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
180
203
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
181
204
|
}, z.core.$loose>>>;
|
|
182
205
|
}, z.core.$strip>;
|
|
@@ -203,6 +226,10 @@ export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodStr
|
|
|
203
226
|
start: z.ZodNumber;
|
|
204
227
|
end: z.ZodOptional<z.ZodNumber>;
|
|
205
228
|
}, z.core.$strip>>;
|
|
229
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
start: z.ZodNumber;
|
|
231
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
206
233
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
207
234
|
}, z.core.$loose>>>;
|
|
208
235
|
}, z.core.$strip>]>;
|
|
@@ -224,6 +251,10 @@ export declare const LegacySchemaPageArray: z.ZodArray<z.ZodRecord<z.ZodString,
|
|
|
224
251
|
start: z.ZodNumber;
|
|
225
252
|
end: z.ZodOptional<z.ZodNumber>;
|
|
226
253
|
}, z.core.$strip>>;
|
|
254
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
start: z.ZodNumber;
|
|
256
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
}, z.core.$strip>>;
|
|
227
258
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
228
259
|
}, z.core.$loose>>>;
|
|
229
260
|
export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
@@ -244,6 +275,10 @@ export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
|
244
275
|
start: z.ZodNumber;
|
|
245
276
|
end: z.ZodOptional<z.ZodNumber>;
|
|
246
277
|
}, z.core.$strip>>;
|
|
278
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
279
|
+
start: z.ZodNumber;
|
|
280
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
247
282
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
248
283
|
}, z.core.$loose>>>;
|
|
249
284
|
export declare const Template: z.ZodObject<{
|
|
@@ -265,6 +300,10 @@ export declare const Template: z.ZodObject<{
|
|
|
265
300
|
start: z.ZodNumber;
|
|
266
301
|
end: z.ZodOptional<z.ZodNumber>;
|
|
267
302
|
}, z.core.$strip>>;
|
|
303
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
start: z.ZodNumber;
|
|
305
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
}, z.core.$strip>>;
|
|
268
307
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
269
308
|
}, z.core.$loose>>>;
|
|
270
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<{
|
|
@@ -289,6 +328,10 @@ export declare const Template: z.ZodObject<{
|
|
|
289
328
|
start: z.ZodNumber;
|
|
290
329
|
end: z.ZodOptional<z.ZodNumber>;
|
|
291
330
|
}, z.core.$strip>>;
|
|
331
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
332
|
+
start: z.ZodNumber;
|
|
333
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
}, z.core.$strip>>;
|
|
292
335
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
293
336
|
}, z.core.$loose>>>;
|
|
294
337
|
}, z.core.$strip>]>;
|
|
@@ -324,6 +367,10 @@ export declare const Plugin: z.ZodObject<{
|
|
|
324
367
|
start: z.ZodNumber;
|
|
325
368
|
end: z.ZodOptional<z.ZodNumber>;
|
|
326
369
|
}, z.core.$strip>>;
|
|
370
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
start: z.ZodNumber;
|
|
372
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
373
|
+
}, z.core.$strip>>;
|
|
327
374
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
328
375
|
}, z.core.$loose>;
|
|
329
376
|
}, z.core.$strip>;
|
|
@@ -388,6 +435,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
388
435
|
start: z.ZodNumber;
|
|
389
436
|
end: z.ZodOptional<z.ZodNumber>;
|
|
390
437
|
}, z.core.$strip>>;
|
|
438
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
439
|
+
start: z.ZodNumber;
|
|
440
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
441
|
+
}, z.core.$strip>>;
|
|
391
442
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
392
443
|
}, z.core.$loose>>>;
|
|
393
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<{
|
|
@@ -412,6 +463,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
412
463
|
start: z.ZodNumber;
|
|
413
464
|
end: z.ZodOptional<z.ZodNumber>;
|
|
414
465
|
}, z.core.$strip>>;
|
|
466
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
467
|
+
start: z.ZodNumber;
|
|
468
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
}, z.core.$strip>>;
|
|
415
470
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
416
471
|
}, z.core.$loose>>>;
|
|
417
472
|
}, z.core.$strip>]>;
|
|
@@ -441,6 +496,10 @@ export declare const GenerateProps: z.ZodObject<{
|
|
|
441
496
|
start: z.ZodNumber;
|
|
442
497
|
end: z.ZodOptional<z.ZodNumber>;
|
|
443
498
|
}, z.core.$strip>>;
|
|
499
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
500
|
+
start: z.ZodNumber;
|
|
501
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
}, z.core.$strip>>;
|
|
444
503
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
445
504
|
}, z.core.$loose>;
|
|
446
505
|
}, z.core.$strip>;
|
|
@@ -527,6 +586,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
527
586
|
start: z.ZodNumber;
|
|
528
587
|
end: z.ZodOptional<z.ZodNumber>;
|
|
529
588
|
}, z.core.$strip>>;
|
|
589
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
590
|
+
start: z.ZodNumber;
|
|
591
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
}, z.core.$strip>>;
|
|
530
593
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
531
594
|
}, z.core.$loose>>>;
|
|
532
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<{
|
|
@@ -551,6 +614,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
551
614
|
start: z.ZodNumber;
|
|
552
615
|
end: z.ZodOptional<z.ZodNumber>;
|
|
553
616
|
}, z.core.$strip>>;
|
|
617
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
618
|
+
start: z.ZodNumber;
|
|
619
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
620
|
+
}, z.core.$strip>>;
|
|
554
621
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
555
622
|
}, z.core.$loose>>>;
|
|
556
623
|
}, z.core.$strip>]>;
|
|
@@ -580,6 +647,10 @@ export declare const UIProps: z.ZodObject<{
|
|
|
580
647
|
start: z.ZodNumber;
|
|
581
648
|
end: z.ZodOptional<z.ZodNumber>;
|
|
582
649
|
}, z.core.$strip>>;
|
|
650
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
651
|
+
start: z.ZodNumber;
|
|
652
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
}, z.core.$strip>>;
|
|
583
654
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
584
655
|
}, z.core.$loose>;
|
|
585
656
|
}, z.core.$strip>;
|
|
@@ -634,6 +705,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
634
705
|
start: z.ZodNumber;
|
|
635
706
|
end: z.ZodOptional<z.ZodNumber>;
|
|
636
707
|
}, z.core.$strip>>;
|
|
708
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
709
|
+
start: z.ZodNumber;
|
|
710
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
711
|
+
}, z.core.$strip>>;
|
|
637
712
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
638
713
|
}, z.core.$loose>>>;
|
|
639
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<{
|
|
@@ -658,6 +733,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
658
733
|
start: z.ZodNumber;
|
|
659
734
|
end: z.ZodOptional<z.ZodNumber>;
|
|
660
735
|
}, z.core.$strip>>;
|
|
736
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
start: z.ZodNumber;
|
|
738
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
}, z.core.$strip>>;
|
|
661
740
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
662
741
|
}, z.core.$loose>>>;
|
|
663
742
|
}, z.core.$strip>]>;
|
|
@@ -687,6 +766,10 @@ export declare const PreviewProps: z.ZodObject<{
|
|
|
687
766
|
start: z.ZodNumber;
|
|
688
767
|
end: z.ZodOptional<z.ZodNumber>;
|
|
689
768
|
}, z.core.$strip>>;
|
|
769
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
770
|
+
start: z.ZodNumber;
|
|
771
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
}, z.core.$strip>>;
|
|
690
773
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
691
774
|
}, z.core.$loose>;
|
|
692
775
|
}, z.core.$strip>;
|
|
@@ -742,6 +825,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
742
825
|
start: z.ZodNumber;
|
|
743
826
|
end: z.ZodOptional<z.ZodNumber>;
|
|
744
827
|
}, z.core.$strip>>;
|
|
828
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
829
|
+
start: z.ZodNumber;
|
|
830
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
}, z.core.$strip>>;
|
|
745
832
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
746
833
|
}, z.core.$loose>>>;
|
|
747
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<{
|
|
@@ -766,6 +853,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
766
853
|
start: z.ZodNumber;
|
|
767
854
|
end: z.ZodOptional<z.ZodNumber>;
|
|
768
855
|
}, z.core.$strip>>;
|
|
856
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
857
|
+
start: z.ZodNumber;
|
|
858
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
859
|
+
}, z.core.$strip>>;
|
|
769
860
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
770
861
|
}, z.core.$loose>>>;
|
|
771
862
|
}, z.core.$strip>]>;
|
|
@@ -795,6 +886,10 @@ export declare const DesignerProps: z.ZodObject<{
|
|
|
795
886
|
start: z.ZodNumber;
|
|
796
887
|
end: z.ZodOptional<z.ZodNumber>;
|
|
797
888
|
}, z.core.$strip>>;
|
|
889
|
+
__itemRange: z.ZodOptional<z.ZodObject<{
|
|
890
|
+
start: z.ZodNumber;
|
|
891
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
892
|
+
}, z.core.$strip>>;
|
|
798
893
|
__isSplit: z.ZodOptional<z.ZodBoolean>;
|
|
799
894
|
}, z.core.$loose>;
|
|
800
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.1.
|
|
1
|
+
export declare const PDFME_VERSION = "6.1.1";
|
package/package.json
CHANGED