@segnavia/format 0.38.0 → 0.40.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.
Files changed (60) hide show
  1. package/dist/board-edit.d.ts +2 -1
  2. package/dist/board-geometry.d.ts +2 -1
  3. package/dist/board-section-grid.d.ts +2 -1
  4. package/dist/board-sections.d.ts +2 -1
  5. package/dist/board.d.ts +8 -8
  6. package/dist/board.js +15 -11
  7. package/dist/book-exports.d.ts +2 -2
  8. package/dist/book-section.d.ts +171 -0
  9. package/dist/book-section.js +13 -2
  10. package/dist/book.d.ts +189 -47
  11. package/dist/book.js +18 -2
  12. package/dist/cover.d.ts +500 -0
  13. package/dist/cover.js +100 -0
  14. package/dist/deck-from-slides.d.ts +23 -4
  15. package/dist/deck.d.ts +144 -42
  16. package/dist/deck.js +22 -24
  17. package/dist/direction.d.ts +1 -1
  18. package/dist/font-collection.d.ts +8 -0
  19. package/dist/font-collection.js +191 -0
  20. package/dist/font-face.d.ts +8 -0
  21. package/dist/font-face.js +24 -0
  22. package/dist/font-refusal.d.ts +5 -0
  23. package/dist/font-refusal.js +9 -0
  24. package/dist/font-signature.d.ts +5 -0
  25. package/dist/font-signature.js +13 -0
  26. package/dist/fonts.d.ts +6 -1
  27. package/dist/fonts.js +3 -1
  28. package/dist/geometry.d.ts +20 -0
  29. package/dist/geometry.js +18 -0
  30. package/dist/image-fit.d.ts +10 -0
  31. package/dist/image-fit.js +10 -0
  32. package/dist/imposition-marks.d.ts +1 -1
  33. package/dist/imposition-schema.d.ts +185 -0
  34. package/dist/imposition-schema.js +122 -0
  35. package/dist/imposition.d.ts +8 -6
  36. package/dist/imposition.js +53 -42
  37. package/dist/index.d.ts +23 -1756
  38. package/dist/index.js +29 -212
  39. package/dist/json-schemas.d.ts +2181 -0
  40. package/dist/json-schemas.js +43 -0
  41. package/dist/media.d.ts +152 -0
  42. package/dist/media.js +119 -0
  43. package/dist/note-series.d.ts +4 -4
  44. package/dist/note-series.js +0 -5
  45. package/dist/page.d.ts +359 -0
  46. package/dist/page.js +110 -0
  47. package/dist/paper.d.ts +5 -5
  48. package/dist/placement-cycle.d.ts +5 -0
  49. package/dist/placement-cycle.js +30 -0
  50. package/dist/placement-refusal.d.ts +5 -0
  51. package/dist/placement-refusal.js +6 -0
  52. package/dist/placement.d.ts +76 -0
  53. package/dist/placement.js +100 -0
  54. package/dist/print.d.ts +72 -0
  55. package/dist/print.js +38 -0
  56. package/dist/printed-page-imposition.d.ts +2 -1
  57. package/dist/shots-used.d.ts +0 -1
  58. package/dist/shots-used.js +2 -2
  59. package/dist/slots.d.ts +13 -13
  60. package/package.json +1 -1
package/dist/book.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BookChapterEntry, BookContents, BookDivision, BookDivisions, BookFrontMatterEntry, BookItem, BookOpens, BookSection, BookSectionEntry, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isTemplatedSection } from "./book-section.js";
2
1
  import { ResolvedNoteSeries } from "./note-series.js";
2
+ import { BookChapterEntry, BookContents, BookDivision, BookDivisions, BookFrontMatterEntry, BookItem, BookOpens, BookSection, BookSectionEntry, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, PlacedSection, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isPlacedSection, isTemplatedSection } from "./book-section.js";
3
3
  import { z } from "zod";
4
4
  //#region src/book.d.ts
5
5
  export declare const BookMode: z.ZodEnum<{
@@ -40,8 +40,8 @@ export declare const BookPage: z.ZodObject<{
40
40
  width: z.ZodNumber;
41
41
  height: z.ZodNumber;
42
42
  unit: z.ZodEnum<{
43
- mm: "mm";
44
43
  in: "in";
44
+ mm: "mm";
45
45
  pt: "pt";
46
46
  }>;
47
47
  }, z.core.$strip>]>;
@@ -130,8 +130,8 @@ export declare const BookShape: z.ZodObject<{
130
130
  width: z.ZodNumber;
131
131
  height: z.ZodNumber;
132
132
  unit: z.ZodEnum<{
133
- mm: "mm";
134
133
  in: "in";
134
+ mm: "mm";
135
135
  pt: "pt";
136
136
  }>;
137
137
  }, z.core.$strip>]>;
@@ -152,9 +152,9 @@ export declare const BookShape: z.ZodObject<{
152
152
  sandboxed: "sandboxed";
153
153
  }>>;
154
154
  dir: z.ZodOptional<z.ZodEnum<{
155
+ auto: "auto";
155
156
  ltr: "ltr";
156
157
  rtl: "rtl";
157
- auto: "auto";
158
158
  }>>;
159
159
  lang: z.ZodOptional<z.ZodString>;
160
160
  frontMatter: z.ZodDefault<z.ZodArray<z.ZodType<BookItem, unknown, z.core.$ZodTypeInternals<BookItem, unknown>>>>;
@@ -200,6 +200,62 @@ export declare const BookShape: z.ZodObject<{
200
200
  fixed: z.ZodOptional<z.ZodString>;
201
201
  }, z.core.$strip>>;
202
202
  kind: z.ZodLiteral<"templated">;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ title: z.ZodOptional<z.ZodString>;
205
+ contents: z.ZodDefault<z.ZodBoolean>;
206
+ opens: z.ZodOptional<z.ZodEnum<{
207
+ any: "any";
208
+ recto: "recto";
209
+ verso: "verso";
210
+ }>>;
211
+ parents: z.ZodOptional<z.ZodObject<{
212
+ opener: z.ZodOptional<z.ZodString>;
213
+ recto: z.ZodOptional<z.ZodString>;
214
+ verso: z.ZodOptional<z.ZodString>;
215
+ blank: z.ZodOptional<z.ZodString>;
216
+ fixed: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strip>>;
218
+ kind: z.ZodLiteral<"placed">;
219
+ placement: z.ZodObject<{
220
+ kind: z.ZodEnum<{
221
+ deck: "deck";
222
+ page: "page";
223
+ paper: "paper";
224
+ book: "book";
225
+ media: "media";
226
+ shot: "shot";
227
+ }>;
228
+ address: z.ZodString;
229
+ page: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
230
+ box: z.ZodOptional<z.ZodEnum<{
231
+ media: "media";
232
+ crop: "crop";
233
+ trim: "trim";
234
+ bleed: "bleed";
235
+ art: "art";
236
+ }>>;
237
+ crop: z.ZodOptional<z.ZodObject<{
238
+ top: z.ZodOptional<z.ZodString>;
239
+ right: z.ZodOptional<z.ZodString>;
240
+ bottom: z.ZodOptional<z.ZodString>;
241
+ left: z.ZodOptional<z.ZodString>;
242
+ }, z.core.$strip>>;
243
+ fit: z.ZodOptional<z.ZodEnum<{
244
+ width: "width";
245
+ contain: "contain";
246
+ cover: "cover";
247
+ focus: "focus";
248
+ }>>;
249
+ alt: z.ZodOptional<z.ZodObject<{
250
+ text: z.ZodString;
251
+ lang: z.ZodOptional<z.ZodString>;
252
+ dir: z.ZodOptional<z.ZodEnum<{
253
+ auto: "auto";
254
+ ltr: "ltr";
255
+ rtl: "rtl";
256
+ }>>;
257
+ }, z.core.$strip>>;
258
+ }, z.core.$strip>;
203
259
  }, z.core.$strip>, z.ZodObject<{
204
260
  title: z.ZodString;
205
261
  html: z.ZodString;
@@ -246,11 +302,11 @@ export declare const BookShape: z.ZodObject<{
246
302
  label: z.ZodString;
247
303
  type: z.ZodEnum<{
248
304
  text: "text";
305
+ image: "image";
249
306
  phone: "phone";
250
307
  email: "email";
251
308
  link: "link";
252
309
  qr: "qr";
253
- image: "image";
254
310
  }>;
255
311
  required: z.ZodDefault<z.ZodBoolean>;
256
312
  placeholder: z.ZodOptional<z.ZodString>;
@@ -264,7 +320,7 @@ export declare const BookShape: z.ZodObject<{
264
320
  }, z.core.$strip>, z.ZodTransform<{
265
321
  key: string;
266
322
  label: string;
267
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
323
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
268
324
  required: boolean;
269
325
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
270
326
  placeholder?: string | undefined;
@@ -272,7 +328,7 @@ export declare const BookShape: z.ZodObject<{
272
328
  }, {
273
329
  key: string;
274
330
  label: string;
275
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
331
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
276
332
  required: boolean;
277
333
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
278
334
  placeholder?: string | undefined;
@@ -307,8 +363,8 @@ export declare const BookShape: z.ZodObject<{
307
363
  hebrew: "hebrew";
308
364
  }>, z.ZodLiteral<"symbols">]>>;
309
365
  restart: z.ZodDefault<z.ZodEnum<{
310
- chapter: "chapter";
311
366
  book: "book";
367
+ chapter: "chapter";
312
368
  }>>;
313
369
  }, z.core.$strip>>;
314
370
  endnotes: z.ZodDefault<z.ZodObject<{
@@ -319,8 +375,8 @@ export declare const BookShape: z.ZodObject<{
319
375
  hebrew: "hebrew";
320
376
  }>, z.ZodLiteral<"symbols">]>>;
321
377
  placement: z.ZodDefault<z.ZodEnum<{
322
- chapter: "chapter";
323
378
  book: "book";
379
+ chapter: "chapter";
324
380
  }>>;
325
381
  title: z.ZodOptional<z.ZodString>;
326
382
  }, z.core.$strip>>;
@@ -328,13 +384,13 @@ export declare const BookShape: z.ZodObject<{
328
384
  name: z.ZodString;
329
385
  placement: z.ZodOptional<z.ZodEnum<{
330
386
  page: "page";
331
- chapter: "chapter";
332
387
  book: "book";
388
+ chapter: "chapter";
333
389
  part: "part";
334
390
  }>>;
335
391
  numbering: z.ZodOptional<z.ZodEnum<{
336
- chapter: "chapter";
337
392
  book: "book";
393
+ chapter: "chapter";
338
394
  part: "part";
339
395
  }>>;
340
396
  marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -419,8 +475,8 @@ export declare const BookViewPagination: z.ZodObject<{
419
475
  foot: z.ZodOptional<z.ZodString>;
420
476
  }, z.core.$strip>>;
421
477
  endnotePlacement: z.ZodEnum<{
422
- chapter: "chapter";
423
478
  book: "book";
479
+ chapter: "chapter";
424
480
  }>;
425
481
  contents: z.ZodObject<{
426
482
  pageNumbers: z.ZodBoolean;
@@ -450,15 +506,15 @@ export declare const BookViewPagination: z.ZodObject<{
450
506
  export type BookViewPagination = z.infer<typeof BookViewPagination>;
451
507
  export declare const BookView: z.ZodObject<{
452
508
  dir: z.ZodOptional<z.ZodEnum<{
509
+ auto: "auto";
453
510
  ltr: "ltr";
454
511
  rtl: "rtl";
455
- auto: "auto";
456
512
  }>>;
513
+ lang: z.ZodOptional<z.ZodString>;
457
514
  scripts: z.ZodDefault<z.ZodEnum<{
458
515
  refuse: "refuse";
459
516
  sandboxed: "sandboxed";
460
517
  }>>;
461
- lang: z.ZodOptional<z.ZodString>;
462
518
  fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
463
519
  app: z.ZodString;
464
520
  }, z.core.$strip>, z.ZodObject<{
@@ -515,8 +571,8 @@ export declare const BookView: z.ZodObject<{
515
571
  foot: z.ZodOptional<z.ZodString>;
516
572
  }, z.core.$strip>>;
517
573
  endnotePlacement: z.ZodEnum<{
518
- chapter: "chapter";
519
574
  book: "book";
575
+ chapter: "chapter";
520
576
  }>;
521
577
  contents: z.ZodObject<{
522
578
  pageNumbers: z.ZodBoolean;
@@ -587,8 +643,8 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
587
643
  width: z.ZodNumber;
588
644
  height: z.ZodNumber;
589
645
  unit: z.ZodEnum<{
590
- mm: "mm";
591
646
  in: "in";
647
+ mm: "mm";
592
648
  pt: "pt";
593
649
  }>;
594
650
  }, z.core.$strip>]>;
@@ -609,9 +665,9 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
609
665
  sandboxed: "sandboxed";
610
666
  }>>;
611
667
  dir: z.ZodOptional<z.ZodEnum<{
668
+ auto: "auto";
612
669
  ltr: "ltr";
613
670
  rtl: "rtl";
614
- auto: "auto";
615
671
  }>>;
616
672
  lang: z.ZodOptional<z.ZodString>;
617
673
  frontMatter: z.ZodDefault<z.ZodArray<z.ZodType<BookItem, unknown, z.core.$ZodTypeInternals<BookItem, unknown>>>>;
@@ -657,6 +713,62 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
657
713
  fixed: z.ZodOptional<z.ZodString>;
658
714
  }, z.core.$strip>>;
659
715
  kind: z.ZodLiteral<"templated">;
716
+ }, z.core.$strip>, z.ZodObject<{
717
+ title: z.ZodOptional<z.ZodString>;
718
+ contents: z.ZodDefault<z.ZodBoolean>;
719
+ opens: z.ZodOptional<z.ZodEnum<{
720
+ any: "any";
721
+ recto: "recto";
722
+ verso: "verso";
723
+ }>>;
724
+ parents: z.ZodOptional<z.ZodObject<{
725
+ opener: z.ZodOptional<z.ZodString>;
726
+ recto: z.ZodOptional<z.ZodString>;
727
+ verso: z.ZodOptional<z.ZodString>;
728
+ blank: z.ZodOptional<z.ZodString>;
729
+ fixed: z.ZodOptional<z.ZodString>;
730
+ }, z.core.$strip>>;
731
+ kind: z.ZodLiteral<"placed">;
732
+ placement: z.ZodObject<{
733
+ kind: z.ZodEnum<{
734
+ deck: "deck";
735
+ page: "page";
736
+ paper: "paper";
737
+ book: "book";
738
+ media: "media";
739
+ shot: "shot";
740
+ }>;
741
+ address: z.ZodString;
742
+ page: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
743
+ box: z.ZodOptional<z.ZodEnum<{
744
+ media: "media";
745
+ crop: "crop";
746
+ trim: "trim";
747
+ bleed: "bleed";
748
+ art: "art";
749
+ }>>;
750
+ crop: z.ZodOptional<z.ZodObject<{
751
+ top: z.ZodOptional<z.ZodString>;
752
+ right: z.ZodOptional<z.ZodString>;
753
+ bottom: z.ZodOptional<z.ZodString>;
754
+ left: z.ZodOptional<z.ZodString>;
755
+ }, z.core.$strip>>;
756
+ fit: z.ZodOptional<z.ZodEnum<{
757
+ width: "width";
758
+ contain: "contain";
759
+ cover: "cover";
760
+ focus: "focus";
761
+ }>>;
762
+ alt: z.ZodOptional<z.ZodObject<{
763
+ text: z.ZodString;
764
+ lang: z.ZodOptional<z.ZodString>;
765
+ dir: z.ZodOptional<z.ZodEnum<{
766
+ auto: "auto";
767
+ ltr: "ltr";
768
+ rtl: "rtl";
769
+ }>>;
770
+ }, z.core.$strip>>;
771
+ }, z.core.$strip>;
660
772
  }, z.core.$strip>, z.ZodObject<{
661
773
  title: z.ZodString;
662
774
  html: z.ZodString;
@@ -703,11 +815,11 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
703
815
  label: z.ZodString;
704
816
  type: z.ZodEnum<{
705
817
  text: "text";
818
+ image: "image";
706
819
  phone: "phone";
707
820
  email: "email";
708
821
  link: "link";
709
822
  qr: "qr";
710
- image: "image";
711
823
  }>;
712
824
  required: z.ZodDefault<z.ZodBoolean>;
713
825
  placeholder: z.ZodOptional<z.ZodString>;
@@ -721,7 +833,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
721
833
  }, z.core.$strip>, z.ZodTransform<{
722
834
  key: string;
723
835
  label: string;
724
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
836
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
725
837
  required: boolean;
726
838
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
727
839
  placeholder?: string | undefined;
@@ -729,7 +841,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
729
841
  }, {
730
842
  key: string;
731
843
  label: string;
732
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
844
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
733
845
  required: boolean;
734
846
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
735
847
  placeholder?: string | undefined;
@@ -764,8 +876,8 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
764
876
  hebrew: "hebrew";
765
877
  }>, z.ZodLiteral<"symbols">]>>;
766
878
  restart: z.ZodDefault<z.ZodEnum<{
767
- chapter: "chapter";
768
879
  book: "book";
880
+ chapter: "chapter";
769
881
  }>>;
770
882
  }, z.core.$strip>>;
771
883
  endnotes: z.ZodDefault<z.ZodObject<{
@@ -776,8 +888,8 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
776
888
  hebrew: "hebrew";
777
889
  }>, z.ZodLiteral<"symbols">]>>;
778
890
  placement: z.ZodDefault<z.ZodEnum<{
779
- chapter: "chapter";
780
891
  book: "book";
892
+ chapter: "chapter";
781
893
  }>>;
782
894
  title: z.ZodOptional<z.ZodString>;
783
895
  }, z.core.$strip>>;
@@ -785,13 +897,13 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
785
897
  name: z.ZodString;
786
898
  placement: z.ZodOptional<z.ZodEnum<{
787
899
  page: "page";
788
- chapter: "chapter";
789
900
  book: "book";
901
+ chapter: "chapter";
790
902
  part: "part";
791
903
  }>>;
792
904
  numbering: z.ZodOptional<z.ZodEnum<{
793
- chapter: "chapter";
794
905
  book: "book";
906
+ chapter: "chapter";
795
907
  part: "part";
796
908
  }>>;
797
909
  marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -838,12 +950,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
838
950
  };
839
951
  footnotes: {
840
952
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
841
- restart: "chapter" | "book";
953
+ restart: "book" | "chapter";
842
954
  };
843
955
  endnotes: {
844
956
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
845
957
  title: string;
846
- placement: "chapter" | "book";
958
+ placement: "book" | "chapter";
847
959
  };
848
960
  notes: ResolvedNoteSeries[];
849
961
  title: string;
@@ -901,7 +1013,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
901
1013
  paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | "business-card-us" | "business-card-eu" | "business-card-square-us" | "business-card-slim-us" | "postcard-4x6" | "postcard-5x7" | "postcard-6x9" | "postcard-6x11" | "card-square-4in" | "half-letter" | "a6" | "dl" | "rack-card-4x9" | "rack-card-3.5x8.5" | "poster-12x18" | "poster-16x20" | "poster-18x24" | "poster-24x36" | "a2" | "a1" | "a0" | {
902
1014
  width: number;
903
1015
  height: number;
904
- unit: "mm" | "in" | "pt";
1016
+ unit: "in" | "mm" | "pt";
905
1017
  };
906
1018
  orientation: "portrait" | "landscape";
907
1019
  margin: {
@@ -912,12 +1024,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
912
1024
  };
913
1025
  columnGap: number;
914
1026
  } | undefined;
915
- dir?: "ltr" | "rtl" | "auto" | undefined;
1027
+ dir?: "auto" | "ltr" | "rtl" | undefined;
916
1028
  lang?: string | undefined;
917
1029
  slots?: {
918
1030
  key: string;
919
1031
  label: string;
920
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
1032
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
921
1033
  required: boolean;
922
1034
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
923
1035
  placeholder?: string | undefined;
@@ -964,18 +1076,18 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
964
1076
  body?: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | undefined;
965
1077
  };
966
1078
  footnotes: {
967
- restart: "chapter" | "book";
1079
+ restart: "book" | "chapter";
968
1080
  marker?: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols" | undefined;
969
1081
  };
970
1082
  endnotes: {
971
- placement: "chapter" | "book";
1083
+ placement: "book" | "chapter";
972
1084
  marker?: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols" | undefined;
973
1085
  title?: string | undefined;
974
1086
  };
975
1087
  notes: {
976
1088
  name: string;
977
- placement?: "page" | "chapter" | "book" | "part" | undefined;
978
- numbering?: "chapter" | "book" | "part" | undefined;
1089
+ placement?: "page" | "book" | "chapter" | "part" | undefined;
1090
+ numbering?: "book" | "chapter" | "part" | undefined;
979
1091
  marker?: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols" | undefined;
980
1092
  title?: string | undefined;
981
1093
  }[];
@@ -1006,7 +1118,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1006
1118
  paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | "business-card-us" | "business-card-eu" | "business-card-square-us" | "business-card-slim-us" | "postcard-4x6" | "postcard-5x7" | "postcard-6x9" | "postcard-6x11" | "card-square-4in" | "half-letter" | "a6" | "dl" | "rack-card-4x9" | "rack-card-3.5x8.5" | "poster-12x18" | "poster-16x20" | "poster-18x24" | "poster-24x36" | "a2" | "a1" | "a0" | {
1007
1119
  width: number;
1008
1120
  height: number;
1009
- unit: "mm" | "in" | "pt";
1121
+ unit: "in" | "mm" | "pt";
1010
1122
  };
1011
1123
  orientation: "portrait" | "landscape";
1012
1124
  margin: {
@@ -1017,7 +1129,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1017
1129
  };
1018
1130
  columnGap: number;
1019
1131
  } | undefined;
1020
- dir?: "ltr" | "rtl" | "auto" | undefined;
1132
+ dir?: "auto" | "ltr" | "rtl" | undefined;
1021
1133
  lang?: string | undefined;
1022
1134
  body?: BookItem[] | undefined;
1023
1135
  chapters?: ({
@@ -1052,6 +1164,36 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1052
1164
  blank?: string | undefined;
1053
1165
  fixed?: string | undefined;
1054
1166
  } | undefined;
1167
+ } | {
1168
+ contents: boolean;
1169
+ kind: "placed";
1170
+ placement: {
1171
+ kind: "deck" | "page" | "paper" | "book" | "media" | "shot";
1172
+ address: string;
1173
+ page?: string | number | undefined;
1174
+ box?: "media" | "crop" | "trim" | "bleed" | "art" | undefined;
1175
+ crop?: {
1176
+ top?: string | undefined;
1177
+ right?: string | undefined;
1178
+ bottom?: string | undefined;
1179
+ left?: string | undefined;
1180
+ } | undefined;
1181
+ fit?: "width" | "contain" | "cover" | "focus" | undefined;
1182
+ alt?: {
1183
+ text: string;
1184
+ lang?: string | undefined;
1185
+ dir?: "auto" | "ltr" | "rtl" | undefined;
1186
+ } | undefined;
1187
+ };
1188
+ title?: string | undefined;
1189
+ opens?: "any" | "recto" | "verso" | undefined;
1190
+ parents?: {
1191
+ opener?: string | undefined;
1192
+ recto?: string | undefined;
1193
+ verso?: string | undefined;
1194
+ blank?: string | undefined;
1195
+ fixed?: string | undefined;
1196
+ } | undefined;
1055
1197
  } | {
1056
1198
  title: string;
1057
1199
  html: string;
@@ -1069,7 +1211,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1069
1211
  slots?: {
1070
1212
  key: string;
1071
1213
  label: string;
1072
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
1214
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
1073
1215
  required: boolean;
1074
1216
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
1075
1217
  placeholder?: string | undefined;
@@ -1090,12 +1232,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1090
1232
  };
1091
1233
  footnotes: {
1092
1234
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
1093
- restart: "chapter" | "book";
1235
+ restart: "book" | "chapter";
1094
1236
  };
1095
1237
  endnotes: {
1096
1238
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
1097
1239
  title: string;
1098
- placement: "chapter" | "book";
1240
+ placement: "book" | "chapter";
1099
1241
  };
1100
1242
  notes: ResolvedNoteSeries[];
1101
1243
  title: string;
@@ -1153,7 +1295,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1153
1295
  paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | "business-card-us" | "business-card-eu" | "business-card-square-us" | "business-card-slim-us" | "postcard-4x6" | "postcard-5x7" | "postcard-6x9" | "postcard-6x11" | "card-square-4in" | "half-letter" | "a6" | "dl" | "rack-card-4x9" | "rack-card-3.5x8.5" | "poster-12x18" | "poster-16x20" | "poster-18x24" | "poster-24x36" | "a2" | "a1" | "a0" | {
1154
1296
  width: number;
1155
1297
  height: number;
1156
- unit: "mm" | "in" | "pt";
1298
+ unit: "in" | "mm" | "pt";
1157
1299
  };
1158
1300
  orientation: "portrait" | "landscape";
1159
1301
  margin: {
@@ -1164,12 +1306,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1164
1306
  };
1165
1307
  columnGap: number;
1166
1308
  } | undefined;
1167
- dir?: "ltr" | "rtl" | "auto" | undefined;
1309
+ dir?: "auto" | "ltr" | "rtl" | undefined;
1168
1310
  lang?: string | undefined;
1169
1311
  slots?: {
1170
1312
  key: string;
1171
1313
  label: string;
1172
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
1314
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
1173
1315
  required: boolean;
1174
1316
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
1175
1317
  placeholder?: string | undefined;
@@ -1191,12 +1333,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1191
1333
  };
1192
1334
  footnotes: {
1193
1335
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
1194
- restart: "chapter" | "book";
1336
+ restart: "book" | "chapter";
1195
1337
  };
1196
1338
  endnotes: {
1197
1339
  marker: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols";
1198
1340
  title: string;
1199
- placement: "chapter" | "book";
1341
+ placement: "book" | "chapter";
1200
1342
  };
1201
1343
  notes: ResolvedNoteSeries[];
1202
1344
  title: string;
@@ -1254,7 +1396,7 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1254
1396
  paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | "business-card-us" | "business-card-eu" | "business-card-square-us" | "business-card-slim-us" | "postcard-4x6" | "postcard-5x7" | "postcard-6x9" | "postcard-6x11" | "card-square-4in" | "half-letter" | "a6" | "dl" | "rack-card-4x9" | "rack-card-3.5x8.5" | "poster-12x18" | "poster-16x20" | "poster-18x24" | "poster-24x36" | "a2" | "a1" | "a0" | {
1255
1397
  width: number;
1256
1398
  height: number;
1257
- unit: "mm" | "in" | "pt";
1399
+ unit: "in" | "mm" | "pt";
1258
1400
  };
1259
1401
  orientation: "portrait" | "landscape";
1260
1402
  margin: {
@@ -1265,12 +1407,12 @@ export declare const Book: z.ZodPipe<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
1265
1407
  };
1266
1408
  columnGap: number;
1267
1409
  } | undefined;
1268
- dir?: "ltr" | "rtl" | "auto" | undefined;
1410
+ dir?: "auto" | "ltr" | "rtl" | undefined;
1269
1411
  lang?: string | undefined;
1270
1412
  slots?: {
1271
1413
  key: string;
1272
1414
  label: string;
1273
- type: "text" | "phone" | "email" | "link" | "qr" | "image";
1415
+ type: "text" | "image" | "phone" | "email" | "link" | "qr";
1274
1416
  required: boolean;
1275
1417
  overflow: "refuse" | "shrink" | "truncate" | "wrap";
1276
1418
  placeholder?: string | undefined;
@@ -1288,4 +1430,4 @@ export type Book = z.infer<typeof Book>;
1288
1430
  export type BookInput = z.input<typeof BookShape>;
1289
1431
  export declare function resolveBookPagination(book: Book): BookViewPagination | undefined;
1290
1432
  //#endregion
1291
- export { BookChapterEntry, BookContents, type BookDivision, type BookDivisions, BookFrontMatterEntry, BookItem, BookOpens, BookSection, type BookSectionEntry, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isTemplatedSection };
1433
+ export { BookChapterEntry, BookContents, type BookDivision, type BookDivisions, BookFrontMatterEntry, BookItem, BookOpens, BookSection, type BookSectionEntry, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, PlacedSection, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isPlacedSection, isTemplatedSection };
package/dist/book.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { Direction, resolveDirection } from "./direction.js";
2
+ import { Placement } from "./placement.js";
2
3
  import { Scripts } from "./scripts.js";
3
4
  import { Slots } from "./slots.js";
4
5
  import { FontReference } from "./fonts.js";
5
6
  import { NoteMarker, NumberSystem, isHebrew } from "./numbering.js";
6
7
  import { ParentPage, bookParentPages, flowingParentNames, resolveParentPages, textArea } from "./printed-pages.js";
7
- import { BookChapterEntry, BookContents, BookFrontMatterEntry, BookItem, BookOpens, BookSection, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, REGION_NAME, TemplatedPage, TemplatedSection, bookParentIssues, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isTemplatedSection } from "./book-section.js";
8
+ import { BookChapterEntry, BookContents, BookFrontMatterEntry, BookItem, BookOpens, BookSection, BookSectionParents, BookTemplate, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, PlacedSection, REGION_NAME, TemplatedPage, TemplatedSection, bookParentIssues, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isPlacedSection, isTemplatedSection } from "./book-section.js";
8
9
  import { NoteSeries, noteSeriesIssues, resolveNoteSeries } from "./note-series.js";
9
10
  import { Orientation, Paper, sheetMm } from "./paper.js";
10
11
  import { z } from "zod";
@@ -117,6 +118,21 @@ const BookView = BookShape.pick({
117
118
  pagination: BookViewPagination.optional()
118
119
  });
119
120
  const ResolvedBook = BookShape.superRefine((book, ctx) => {
121
+ for (const { entry, path } of bookSections({
122
+ ...book,
123
+ body: book.body ?? book.chapters ?? []
124
+ })) {
125
+ if (!isPlacedSection(entry)) continue;
126
+ try {
127
+ Placement.parse(entry.placement, "book");
128
+ } catch (error) {
129
+ ctx.addIssue({
130
+ code: "custom",
131
+ path: [...path, "placement"],
132
+ message: error instanceof Error ? error.message : String(error)
133
+ });
134
+ }
135
+ }
120
136
  const seen = /* @__PURE__ */ new Set();
121
137
  book.notes.forEach(({ name }, index) => {
122
138
  if (seen.has(name)) ctx.addIssue({
@@ -370,4 +386,4 @@ function resolveBookPagination(book) {
370
386
  };
371
387
  }
372
388
  //#endregion
373
- export { Book, BookChapterEntry, BookContents, BookFrontMatterEntry, BookItem, BookMode, BookOpens, BookPage, BookRunningHead, BookRunningHeadSource, BookSection, BookSectionParents, BookShape, BookTemplate, BookView, BookViewPagination, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isTemplatedSection, resolveBookPagination };
389
+ export { Book, BookChapterEntry, BookContents, BookFrontMatterEntry, BookItem, BookMode, BookOpens, BookPage, BookRunningHead, BookRunningHeadSource, BookSection, BookSectionParents, BookShape, BookTemplate, BookView, BookViewPagination, Chapter, DesignedPage, DesignedSection, MAX_PART_DEPTH, Part, PlacedSection, REGION_NAME, TemplatedPage, TemplatedSection, bookSections, isBookContents, isChapter, isDesignedSection, isPart, isPlacedSection, isTemplatedSection, resolveBookPagination };