@segnavia/format 0.5.0 → 0.7.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/book.d.ts +17 -0
- package/dist/book.js +10 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/book.d.ts
CHANGED
|
@@ -61,6 +61,23 @@ export declare const BookPage: z.ZodObject<{
|
|
|
61
61
|
}, z.core.$strip>;
|
|
62
62
|
}, z.core.$strip>;
|
|
63
63
|
export type BookPage = z.infer<typeof BookPage>;
|
|
64
|
+
export declare const BookView: z.ZodObject<{
|
|
65
|
+
dir: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
ltr: "ltr";
|
|
67
|
+
rtl: "rtl";
|
|
68
|
+
auto: "auto";
|
|
69
|
+
}>>;
|
|
70
|
+
scripts: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
refuse: "refuse";
|
|
72
|
+
sandboxed: "sandboxed";
|
|
73
|
+
}>>;
|
|
74
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
html: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type BookView = z.infer<typeof BookView>;
|
|
79
|
+
export type BookViewInput = z.input<typeof BookView>;
|
|
80
|
+
export declare function isHebrew(lang: string | undefined): boolean;
|
|
64
81
|
export declare const Book: z.ZodPipe<z.ZodObject<{
|
|
65
82
|
title: z.ZodString;
|
|
66
83
|
mode: z.ZodEnum<{
|
package/dist/book.js
CHANGED
|
@@ -64,6 +64,15 @@ const BookShape = z.object({
|
|
|
64
64
|
depth: 2
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
|
+
const BookView = BookShape.pick({
|
|
68
|
+
title: true,
|
|
69
|
+
dir: true,
|
|
70
|
+
lang: true,
|
|
71
|
+
scripts: true
|
|
72
|
+
}).extend({
|
|
73
|
+
title: BookShape.shape.title.optional(),
|
|
74
|
+
html: z.string()
|
|
75
|
+
});
|
|
67
76
|
function isHebrew(lang) {
|
|
68
77
|
const primary = lang?.split("-")[0]?.toLowerCase();
|
|
69
78
|
return primary === "he" || primary === "iw";
|
|
@@ -128,4 +137,4 @@ function noteMarkerIssues(book, used) {
|
|
|
128
137
|
return [`footnote and endnote markers are both ${book.footnotes.marker}; the two must differ when both kinds are used`];
|
|
129
138
|
}
|
|
130
139
|
//#endregion
|
|
131
|
-
export { Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookShape, Chapter, isBookContents, noteMarkerIssues };
|
|
140
|
+
export { Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookShape, BookView, Chapter, isBookContents, isHebrew, noteMarkerIssues };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Book, BookContents, BookFrontMatterEntry, BookInput, BookMode, BookPage, BookSection, Chapter, isBookContents, noteMarkerIssues } from "./book.js";
|
|
1
|
+
import { Book, BookContents, BookFrontMatterEntry, BookInput, BookMode, BookPage, BookSection, BookView, BookViewInput, Chapter, isBookContents, isHebrew, noteMarkerIssues } from "./book.js";
|
|
2
2
|
import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckInput, DeckLimits, Manifest, Narration, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits } from "./deck.js";
|
|
3
3
|
import { DeckFromSlidesOptions, SlideRow, deckFromSlides } from "./deck-from-slides.js";
|
|
4
4
|
import { Direction, TextDirection, firstStrongDirection, languageDirection, resolveDirection } from "./direction.js";
|
|
@@ -284,6 +284,20 @@ export declare function jsonSchemas(): {
|
|
|
284
284
|
depth: z.ZodDefault<z.ZodNumber>;
|
|
285
285
|
}, z.core.$strip>>;
|
|
286
286
|
}, z.core.$strip>>;
|
|
287
|
+
bookView: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
288
|
+
dir: z.ZodOptional<z.ZodEnum<{
|
|
289
|
+
ltr: "ltr";
|
|
290
|
+
rtl: "rtl";
|
|
291
|
+
auto: "auto";
|
|
292
|
+
}>>;
|
|
293
|
+
scripts: z.ZodDefault<z.ZodEnum<{
|
|
294
|
+
refuse: "refuse";
|
|
295
|
+
sandboxed: "sandboxed";
|
|
296
|
+
}>>;
|
|
297
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
298
|
+
title: z.ZodOptional<z.ZodString>;
|
|
299
|
+
html: z.ZodString;
|
|
300
|
+
}, z.core.$strip>>;
|
|
287
301
|
page: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
288
302
|
html: z.ZodString;
|
|
289
303
|
size: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"fluid">, z.ZodObject<{
|
|
@@ -632,4 +646,4 @@ export declare function jsonSchemas(): {
|
|
|
632
646
|
}, z.core.$strip>>;
|
|
633
647
|
};
|
|
634
648
|
//#endregion
|
|
635
|
-
export { Annotation, Book, BookContents, BookFrontMatterEntry, type BookInput, BookMode, BookPage, BookSection, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, type DeckFromSlidesOptions, type DeckInput, type DeckLimits, Direction, type Imposed, Lexicon, MARK_GAP_MM, MARK_LENGTH_MM, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, type MillimeterEdges, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PX_PER_MM, type PageFit, type PagePlacementKind, type PagePlacementLayout, Paper, type PaperBox, type Placement, Point, PronunciationEntry, PublishedShot, SHOT_KEY, Scripts, Shot, type ShotUse, Size, Slide, SlideContent, type SlideRow, type TextDirection, Transition, TransitionInput, Word, annotationCueIssues, deckFromSlides, exceedsLimits, firstStrongDirection, fitPage, formatNumber, impose, isBookContents, languageDirection, lexiconVersion, mirrorPlacement, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, resolveDirection, roundMillimeters, sheetMm, shotsUsed, toMillimeters };
|
|
649
|
+
export { Annotation, Book, BookContents, BookFrontMatterEntry, type BookInput, BookMode, BookPage, BookSection, BookView, type BookViewInput, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, type DeckFromSlidesOptions, type DeckInput, type DeckLimits, Direction, type Imposed, Lexicon, MARK_GAP_MM, MARK_LENGTH_MM, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, type MillimeterEdges, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PX_PER_MM, type PageFit, type PagePlacementKind, type PagePlacementLayout, Paper, type PaperBox, type Placement, Point, PronunciationEntry, PublishedShot, SHOT_KEY, Scripts, Shot, type ShotUse, Size, Slide, SlideContent, type SlideRow, type TextDirection, Transition, TransitionInput, Word, annotationCueIssues, deckFromSlides, exceedsLimits, firstStrongDirection, fitPage, formatNumber, impose, isBookContents, isHebrew, languageDirection, lexiconVersion, mirrorPlacement, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, resolveDirection, roundMillimeters, sheetMm, shotsUsed, toMillimeters };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Direction, firstStrongDirection, languageDirection, resolveDirection }
|
|
|
2
2
|
import { NoteMarker, NumberSystem, formatNumber, noteMarker } from "./numbering.js";
|
|
3
3
|
import { MARK_GAP_MM, MARK_LENGTH_MM, MM_PER_PT, NAMED_PAPERS, PAPER_MM, PX_PER_MM, Paper, printBoxes, printPadding, printProperties, roundMillimeters, sheetMm, toMillimeters } from "./paper.js";
|
|
4
4
|
import { Scripts } from "./scripts.js";
|
|
5
|
-
import { Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookShape, Chapter, isBookContents, noteMarkerIssues } from "./book.js";
|
|
5
|
+
import { Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookShape, BookView, Chapter, isBookContents, isHebrew, noteMarkerIssues } from "./book.js";
|
|
6
6
|
import { MAX_SLIDE_TIMING_MS } from "./timing.js";
|
|
7
7
|
import { DEFAULT_TRANSITION_DURATION_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, Transition } from "./transition.js";
|
|
8
8
|
import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckShape, Manifest, Narration, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits } from "./deck.js";
|
|
@@ -141,6 +141,7 @@ const Page = z.object({
|
|
|
141
141
|
function jsonSchemas() {
|
|
142
142
|
return {
|
|
143
143
|
book: z.toJSONSchema(BookShape, { io: "input" }),
|
|
144
|
+
bookView: z.toJSONSchema(BookView, { io: "input" }),
|
|
144
145
|
page: z.toJSONSchema(Page, { io: "input" }),
|
|
145
146
|
lexicon: z.toJSONSchema(Lexicon, { io: "input" }),
|
|
146
147
|
imposition: z.toJSONSchema(Imposition, { io: "input" }),
|
|
@@ -150,4 +151,4 @@ function jsonSchemas() {
|
|
|
150
151
|
};
|
|
151
152
|
}
|
|
152
153
|
//#endregion
|
|
153
|
-
export { Annotation, Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, Direction, Imposition, Lexicon, MARK_GAP_MM, MARK_LENGTH_MM, MAX_IMPOSITION_CELLS, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, Margin, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PX_PER_MM, Page, PageSize, Paper, Point, Print, PronunciationEntry, PublishedShot, SHOT_KEY, Scripts, Shot, Size, Slide, SlideContent, Transition, Word, annotationCueIssues, deckFromSlides, exceedsLimits, firstStrongDirection, fitPage, formatNumber, impose, isBookContents, jsonSchemas, languageDirection, lexiconVersion, mirrorPlacement, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, resolveDirection, roundMillimeters, sheetMm, shotsUsed, toMillimeters };
|
|
154
|
+
export { Annotation, Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookView, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, Direction, Imposition, Lexicon, MARK_GAP_MM, MARK_LENGTH_MM, MAX_IMPOSITION_CELLS, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, Margin, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PX_PER_MM, Page, PageSize, Paper, Point, Print, PronunciationEntry, PublishedShot, SHOT_KEY, Scripts, Shot, Size, Slide, SlideContent, Transition, Word, annotationCueIssues, deckFromSlides, exceedsLimits, firstStrongDirection, fitPage, formatNumber, impose, isBookContents, isHebrew, jsonSchemas, languageDirection, lexiconVersion, mirrorPlacement, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, resolveDirection, roundMillimeters, sheetMm, shotsUsed, toMillimeters };
|