@pdfme/common 6.1.1-dev.5 → 6.1.1-dev.8

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.
@@ -0,0 +1,53 @@
1
+ export type PageOrientation = 'portrait' | 'landscape';
2
+ export declare const PAGE_SIZE_PRESETS: {
3
+ readonly A3: {
4
+ readonly width: 297;
5
+ readonly height: 420;
6
+ };
7
+ readonly A4: {
8
+ readonly width: 210;
9
+ readonly height: 297;
10
+ };
11
+ readonly A5: {
12
+ readonly width: 148;
13
+ readonly height: 210;
14
+ };
15
+ readonly A6: {
16
+ readonly width: 105;
17
+ readonly height: 148;
18
+ };
19
+ readonly B4: {
20
+ readonly width: 250;
21
+ readonly height: 353;
22
+ };
23
+ readonly B5: {
24
+ readonly width: 176;
25
+ readonly height: 250;
26
+ };
27
+ readonly B6: {
28
+ readonly width: 125;
29
+ readonly height: 176;
30
+ };
31
+ readonly Letter: {
32
+ readonly width: 215.9;
33
+ readonly height: 279.4;
34
+ };
35
+ readonly Legal: {
36
+ readonly width: 215.9;
37
+ readonly height: 355.6;
38
+ };
39
+ readonly Tabloid: {
40
+ readonly width: 279.4;
41
+ readonly height: 431.8;
42
+ };
43
+ };
44
+ export type PageSizePreset = keyof typeof PAGE_SIZE_PRESETS;
45
+ export type PageSize = PageSizePreset | {
46
+ width: number;
47
+ height: number;
48
+ };
49
+ export declare const resolvePageSize: (size?: PageSize, orientation?: PageOrientation) => {
50
+ width: number;
51
+ height: number;
52
+ };
53
+ export declare const detectPaperSize: (width: number, height: number, tolerance?: number) => `${PageSizePreset} ${PageOrientation}` | null;
package/dist/schema.d.ts CHANGED
@@ -70,6 +70,9 @@ export declare const Dict: z.ZodObject<{
70
70
  'schemas.text.max': z.ZodString;
71
71
  'schemas.text.fit': z.ZodString;
72
72
  'schemas.text.dynamicFontSize': z.ZodString;
73
+ 'schemas.text.overflow': z.ZodString;
74
+ 'schemas.text.overflowVisible': z.ZodString;
75
+ 'schemas.text.overflowExpand': z.ZodString;
73
76
  'schemas.text.format': z.ZodString;
74
77
  'schemas.text.plain': z.ZodString;
75
78
  'schemas.text.inlineMarkdown': z.ZodString;
@@ -147,6 +150,10 @@ export declare const Schema: z.ZodObject<{
147
150
  start: z.ZodNumber;
148
151
  end: z.ZodOptional<z.ZodNumber>;
149
152
  }, z.core.$strip>>;
153
+ __textLineRange: z.ZodOptional<z.ZodObject<{
154
+ start: z.ZodNumber;
155
+ end: z.ZodOptional<z.ZodNumber>;
156
+ }, z.core.$strip>>;
150
157
  __isSplit: z.ZodOptional<z.ZodBoolean>;
151
158
  }, z.core.$loose>;
152
159
  export declare const SchemaForUI: z.ZodObject<{
@@ -171,6 +178,10 @@ export declare const SchemaForUI: z.ZodObject<{
171
178
  start: z.ZodNumber;
172
179
  end: z.ZodOptional<z.ZodNumber>;
173
180
  }, z.core.$strip>>;
181
+ __textLineRange: z.ZodOptional<z.ZodObject<{
182
+ start: z.ZodNumber;
183
+ end: z.ZodOptional<z.ZodNumber>;
184
+ }, z.core.$strip>>;
174
185
  __isSplit: z.ZodOptional<z.ZodBoolean>;
175
186
  id: z.ZodString;
176
187
  }, z.core.$strip>;
@@ -200,6 +211,10 @@ export declare const BlankPdf: z.ZodObject<{
200
211
  start: z.ZodNumber;
201
212
  end: z.ZodOptional<z.ZodNumber>;
202
213
  }, z.core.$strip>>;
214
+ __textLineRange: z.ZodOptional<z.ZodObject<{
215
+ start: z.ZodNumber;
216
+ end: z.ZodOptional<z.ZodNumber>;
217
+ }, z.core.$strip>>;
203
218
  __isSplit: z.ZodOptional<z.ZodBoolean>;
204
219
  }, z.core.$loose>>>;
205
220
  }, z.core.$strip>;
@@ -230,6 +245,10 @@ export declare const BasePdf: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodStr
230
245
  start: z.ZodNumber;
231
246
  end: z.ZodOptional<z.ZodNumber>;
232
247
  }, z.core.$strip>>;
248
+ __textLineRange: z.ZodOptional<z.ZodObject<{
249
+ start: z.ZodNumber;
250
+ end: z.ZodOptional<z.ZodNumber>;
251
+ }, z.core.$strip>>;
233
252
  __isSplit: z.ZodOptional<z.ZodBoolean>;
234
253
  }, z.core.$loose>>>;
235
254
  }, z.core.$strip>]>;
@@ -255,6 +274,10 @@ export declare const LegacySchemaPageArray: z.ZodArray<z.ZodRecord<z.ZodString,
255
274
  start: z.ZodNumber;
256
275
  end: z.ZodOptional<z.ZodNumber>;
257
276
  }, z.core.$strip>>;
277
+ __textLineRange: z.ZodOptional<z.ZodObject<{
278
+ start: z.ZodNumber;
279
+ end: z.ZodOptional<z.ZodNumber>;
280
+ }, z.core.$strip>>;
258
281
  __isSplit: z.ZodOptional<z.ZodBoolean>;
259
282
  }, z.core.$loose>>>;
260
283
  export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
@@ -279,6 +302,10 @@ export declare const SchemaPageArray: z.ZodArray<z.ZodArray<z.ZodObject<{
279
302
  start: z.ZodNumber;
280
303
  end: z.ZodOptional<z.ZodNumber>;
281
304
  }, z.core.$strip>>;
305
+ __textLineRange: z.ZodOptional<z.ZodObject<{
306
+ start: z.ZodNumber;
307
+ end: z.ZodOptional<z.ZodNumber>;
308
+ }, z.core.$strip>>;
282
309
  __isSplit: z.ZodOptional<z.ZodBoolean>;
283
310
  }, z.core.$loose>>>;
284
311
  export declare const Template: z.ZodObject<{
@@ -304,6 +331,10 @@ export declare const Template: z.ZodObject<{
304
331
  start: z.ZodNumber;
305
332
  end: z.ZodOptional<z.ZodNumber>;
306
333
  }, z.core.$strip>>;
334
+ __textLineRange: z.ZodOptional<z.ZodObject<{
335
+ start: z.ZodNumber;
336
+ end: z.ZodOptional<z.ZodNumber>;
337
+ }, z.core.$strip>>;
307
338
  __isSplit: z.ZodOptional<z.ZodBoolean>;
308
339
  }, z.core.$loose>>>;
309
340
  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<{
@@ -332,6 +363,10 @@ export declare const Template: z.ZodObject<{
332
363
  start: z.ZodNumber;
333
364
  end: z.ZodOptional<z.ZodNumber>;
334
365
  }, z.core.$strip>>;
366
+ __textLineRange: z.ZodOptional<z.ZodObject<{
367
+ start: z.ZodNumber;
368
+ end: z.ZodOptional<z.ZodNumber>;
369
+ }, z.core.$strip>>;
335
370
  __isSplit: z.ZodOptional<z.ZodBoolean>;
336
371
  }, z.core.$loose>>>;
337
372
  }, z.core.$strip>]>;
@@ -371,6 +406,10 @@ export declare const Plugin: z.ZodObject<{
371
406
  start: z.ZodNumber;
372
407
  end: z.ZodOptional<z.ZodNumber>;
373
408
  }, z.core.$strip>>;
409
+ __textLineRange: z.ZodOptional<z.ZodObject<{
410
+ start: z.ZodNumber;
411
+ end: z.ZodOptional<z.ZodNumber>;
412
+ }, z.core.$strip>>;
374
413
  __isSplit: z.ZodOptional<z.ZodBoolean>;
375
414
  }, z.core.$loose>;
376
415
  }, z.core.$strip>;
@@ -439,6 +478,10 @@ export declare const GenerateProps: z.ZodObject<{
439
478
  start: z.ZodNumber;
440
479
  end: z.ZodOptional<z.ZodNumber>;
441
480
  }, z.core.$strip>>;
481
+ __textLineRange: z.ZodOptional<z.ZodObject<{
482
+ start: z.ZodNumber;
483
+ end: z.ZodOptional<z.ZodNumber>;
484
+ }, z.core.$strip>>;
442
485
  __isSplit: z.ZodOptional<z.ZodBoolean>;
443
486
  }, z.core.$loose>>>;
444
487
  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<{
@@ -467,6 +510,10 @@ export declare const GenerateProps: z.ZodObject<{
467
510
  start: z.ZodNumber;
468
511
  end: z.ZodOptional<z.ZodNumber>;
469
512
  }, z.core.$strip>>;
513
+ __textLineRange: z.ZodOptional<z.ZodObject<{
514
+ start: z.ZodNumber;
515
+ end: z.ZodOptional<z.ZodNumber>;
516
+ }, z.core.$strip>>;
470
517
  __isSplit: z.ZodOptional<z.ZodBoolean>;
471
518
  }, z.core.$loose>>>;
472
519
  }, z.core.$strip>]>;
@@ -500,6 +547,10 @@ export declare const GenerateProps: z.ZodObject<{
500
547
  start: z.ZodNumber;
501
548
  end: z.ZodOptional<z.ZodNumber>;
502
549
  }, z.core.$strip>>;
550
+ __textLineRange: z.ZodOptional<z.ZodObject<{
551
+ start: z.ZodNumber;
552
+ end: z.ZodOptional<z.ZodNumber>;
553
+ }, z.core.$strip>>;
503
554
  __isSplit: z.ZodOptional<z.ZodBoolean>;
504
555
  }, z.core.$loose>;
505
556
  }, z.core.$strip>;
@@ -590,6 +641,10 @@ export declare const UIProps: z.ZodObject<{
590
641
  start: z.ZodNumber;
591
642
  end: z.ZodOptional<z.ZodNumber>;
592
643
  }, z.core.$strip>>;
644
+ __textLineRange: z.ZodOptional<z.ZodObject<{
645
+ start: z.ZodNumber;
646
+ end: z.ZodOptional<z.ZodNumber>;
647
+ }, z.core.$strip>>;
593
648
  __isSplit: z.ZodOptional<z.ZodBoolean>;
594
649
  }, z.core.$loose>>>;
595
650
  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<{
@@ -618,6 +673,10 @@ export declare const UIProps: z.ZodObject<{
618
673
  start: z.ZodNumber;
619
674
  end: z.ZodOptional<z.ZodNumber>;
620
675
  }, z.core.$strip>>;
676
+ __textLineRange: z.ZodOptional<z.ZodObject<{
677
+ start: z.ZodNumber;
678
+ end: z.ZodOptional<z.ZodNumber>;
679
+ }, z.core.$strip>>;
621
680
  __isSplit: z.ZodOptional<z.ZodBoolean>;
622
681
  }, z.core.$loose>>>;
623
682
  }, z.core.$strip>]>;
@@ -651,6 +710,10 @@ export declare const UIProps: z.ZodObject<{
651
710
  start: z.ZodNumber;
652
711
  end: z.ZodOptional<z.ZodNumber>;
653
712
  }, z.core.$strip>>;
713
+ __textLineRange: z.ZodOptional<z.ZodObject<{
714
+ start: z.ZodNumber;
715
+ end: z.ZodOptional<z.ZodNumber>;
716
+ }, z.core.$strip>>;
654
717
  __isSplit: z.ZodOptional<z.ZodBoolean>;
655
718
  }, z.core.$loose>;
656
719
  }, z.core.$strip>;
@@ -709,6 +772,10 @@ export declare const PreviewProps: z.ZodObject<{
709
772
  start: z.ZodNumber;
710
773
  end: z.ZodOptional<z.ZodNumber>;
711
774
  }, z.core.$strip>>;
775
+ __textLineRange: z.ZodOptional<z.ZodObject<{
776
+ start: z.ZodNumber;
777
+ end: z.ZodOptional<z.ZodNumber>;
778
+ }, z.core.$strip>>;
712
779
  __isSplit: z.ZodOptional<z.ZodBoolean>;
713
780
  }, z.core.$loose>>>;
714
781
  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<{
@@ -737,6 +804,10 @@ export declare const PreviewProps: z.ZodObject<{
737
804
  start: z.ZodNumber;
738
805
  end: z.ZodOptional<z.ZodNumber>;
739
806
  }, z.core.$strip>>;
807
+ __textLineRange: z.ZodOptional<z.ZodObject<{
808
+ start: z.ZodNumber;
809
+ end: z.ZodOptional<z.ZodNumber>;
810
+ }, z.core.$strip>>;
740
811
  __isSplit: z.ZodOptional<z.ZodBoolean>;
741
812
  }, z.core.$loose>>>;
742
813
  }, z.core.$strip>]>;
@@ -770,6 +841,10 @@ export declare const PreviewProps: z.ZodObject<{
770
841
  start: z.ZodNumber;
771
842
  end: z.ZodOptional<z.ZodNumber>;
772
843
  }, z.core.$strip>>;
844
+ __textLineRange: z.ZodOptional<z.ZodObject<{
845
+ start: z.ZodNumber;
846
+ end: z.ZodOptional<z.ZodNumber>;
847
+ }, z.core.$strip>>;
773
848
  __isSplit: z.ZodOptional<z.ZodBoolean>;
774
849
  }, z.core.$loose>;
775
850
  }, z.core.$strip>;
@@ -829,6 +904,10 @@ export declare const DesignerProps: z.ZodObject<{
829
904
  start: z.ZodNumber;
830
905
  end: z.ZodOptional<z.ZodNumber>;
831
906
  }, z.core.$strip>>;
907
+ __textLineRange: z.ZodOptional<z.ZodObject<{
908
+ start: z.ZodNumber;
909
+ end: z.ZodOptional<z.ZodNumber>;
910
+ }, z.core.$strip>>;
832
911
  __isSplit: z.ZodOptional<z.ZodBoolean>;
833
912
  }, z.core.$loose>>>;
834
913
  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<{
@@ -857,6 +936,10 @@ export declare const DesignerProps: z.ZodObject<{
857
936
  start: z.ZodNumber;
858
937
  end: z.ZodOptional<z.ZodNumber>;
859
938
  }, z.core.$strip>>;
939
+ __textLineRange: z.ZodOptional<z.ZodObject<{
940
+ start: z.ZodNumber;
941
+ end: z.ZodOptional<z.ZodNumber>;
942
+ }, z.core.$strip>>;
860
943
  __isSplit: z.ZodOptional<z.ZodBoolean>;
861
944
  }, z.core.$loose>>>;
862
945
  }, z.core.$strip>]>;
@@ -890,6 +973,10 @@ export declare const DesignerProps: z.ZodObject<{
890
973
  start: z.ZodNumber;
891
974
  end: z.ZodOptional<z.ZodNumber>;
892
975
  }, z.core.$strip>>;
976
+ __textLineRange: z.ZodOptional<z.ZodObject<{
977
+ start: z.ZodNumber;
978
+ end: z.ZodOptional<z.ZodNumber>;
979
+ }, z.core.$strip>>;
893
980
  __isSplit: z.ZodOptional<z.ZodBoolean>;
894
981
  }, z.core.$loose>;
895
982
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "6.1.1-dev.5",
3
+ "version": "6.1.1-dev.8",
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",