@segnavia/format 0.38.0 → 0.39.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/board-edit.d.ts +2 -1
- package/dist/board-geometry.d.ts +2 -1
- package/dist/board-section-grid.d.ts +2 -1
- package/dist/board-sections.d.ts +2 -1
- package/dist/board.d.ts +8 -8
- package/dist/board.js +15 -11
- package/dist/book-exports.d.ts +2 -2
- package/dist/book-section.d.ts +171 -0
- package/dist/book-section.js +13 -2
- package/dist/book.d.ts +185 -43
- package/dist/book.js +18 -2
- package/dist/cover.d.ts +337 -0
- package/dist/cover.js +100 -0
- package/dist/deck-from-slides.d.ts +23 -4
- package/dist/deck.d.ts +144 -42
- package/dist/deck.js +22 -24
- package/dist/direction.d.ts +1 -1
- package/dist/font-collection.d.ts +8 -0
- package/dist/font-collection.js +191 -0
- package/dist/font-face.d.ts +8 -0
- package/dist/font-face.js +24 -0
- package/dist/font-refusal.d.ts +5 -0
- package/dist/font-refusal.js +9 -0
- package/dist/font-signature.d.ts +5 -0
- package/dist/font-signature.js +13 -0
- package/dist/fonts.d.ts +6 -1
- package/dist/fonts.js +3 -1
- package/dist/geometry.d.ts +20 -0
- package/dist/geometry.js +18 -0
- package/dist/image-fit.d.ts +10 -0
- package/dist/image-fit.js +10 -0
- package/dist/imposition-marks.d.ts +1 -1
- package/dist/imposition-schema.d.ts +185 -0
- package/dist/imposition-schema.js +122 -0
- package/dist/imposition.d.ts +8 -6
- package/dist/index.d.ts +23 -1756
- package/dist/index.js +29 -212
- package/dist/json-schemas.d.ts +1860 -0
- package/dist/json-schemas.js +43 -0
- package/dist/media.d.ts +152 -0
- package/dist/media.js +119 -0
- package/dist/note-series.d.ts +4 -4
- package/dist/note-series.js +0 -5
- package/dist/page.d.ts +174 -0
- package/dist/page.js +37 -0
- package/dist/paper.d.ts +1 -1
- package/dist/placement-cycle.d.ts +5 -0
- package/dist/placement-cycle.js +30 -0
- package/dist/placement-refusal.d.ts +5 -0
- package/dist/placement-refusal.js +6 -0
- package/dist/placement.d.ts +76 -0
- package/dist/placement.js +100 -0
- package/dist/print.d.ts +72 -0
- package/dist/print.js +38 -0
- package/dist/printed-page-imposition.d.ts +2 -1
- package/dist/shots-used.d.ts +0 -1
- package/dist/shots-used.js +2 -2
- package/dist/slots.d.ts +13 -13
- 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<{
|
|
@@ -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
|
+
bleed: "bleed";
|
|
233
|
+
crop: "crop";
|
|
234
|
+
trim: "trim";
|
|
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" | "
|
|
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" | "
|
|
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;
|
|
@@ -449,15 +505,15 @@ export declare const BookViewPagination: z.ZodObject<{
|
|
|
449
505
|
}, z.core.$strip>;
|
|
450
506
|
export type BookViewPagination = z.infer<typeof BookViewPagination>;
|
|
451
507
|
export declare const BookView: z.ZodObject<{
|
|
452
|
-
dir: z.ZodOptional<z.ZodEnum<{
|
|
453
|
-
ltr: "ltr";
|
|
454
|
-
rtl: "rtl";
|
|
455
|
-
auto: "auto";
|
|
456
|
-
}>>;
|
|
457
508
|
scripts: z.ZodDefault<z.ZodEnum<{
|
|
458
509
|
refuse: "refuse";
|
|
459
510
|
sandboxed: "sandboxed";
|
|
460
511
|
}>>;
|
|
512
|
+
dir: z.ZodOptional<z.ZodEnum<{
|
|
513
|
+
auto: "auto";
|
|
514
|
+
ltr: "ltr";
|
|
515
|
+
rtl: "rtl";
|
|
516
|
+
}>>;
|
|
461
517
|
lang: z.ZodOptional<z.ZodString>;
|
|
462
518
|
fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
463
519
|
app: z.ZodString;
|
|
@@ -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;
|
|
@@ -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
|
+
bleed: "bleed";
|
|
746
|
+
crop: "crop";
|
|
747
|
+
trim: "trim";
|
|
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" | "
|
|
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" | "
|
|
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: "
|
|
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: "
|
|
958
|
+
placement: "book" | "chapter";
|
|
847
959
|
};
|
|
848
960
|
notes: ResolvedNoteSeries[];
|
|
849
961
|
title: string;
|
|
@@ -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?: "
|
|
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" | "
|
|
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: "
|
|
1079
|
+
restart: "book" | "chapter";
|
|
968
1080
|
marker?: "arabic" | "roman-lower" | "roman-upper" | "hebrew" | "symbols" | undefined;
|
|
969
1081
|
};
|
|
970
1082
|
endnotes: {
|
|
971
|
-
placement: "
|
|
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" | "
|
|
978
|
-
numbering?: "
|
|
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
|
}[];
|
|
@@ -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?: "
|
|
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" | "bleed" | "crop" | "trim" | "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" | "
|
|
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: "
|
|
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: "
|
|
1240
|
+
placement: "book" | "chapter";
|
|
1099
1241
|
};
|
|
1100
1242
|
notes: ResolvedNoteSeries[];
|
|
1101
1243
|
title: string;
|
|
@@ -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?: "
|
|
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" | "
|
|
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: "
|
|
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: "
|
|
1341
|
+
placement: "book" | "chapter";
|
|
1200
1342
|
};
|
|
1201
1343
|
notes: ResolvedNoteSeries[];
|
|
1202
1344
|
title: string;
|
|
@@ -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?: "
|
|
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" | "
|
|
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 };
|