@segnavia/format 0.16.0 → 0.18.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 CHANGED
@@ -40,6 +40,27 @@ export declare const BookPage: z.ZodObject<{
40
40
  a3: "a3";
41
41
  a4: "a4";
42
42
  a5: "a5";
43
+ "business-card-us": "business-card-us";
44
+ "business-card-eu": "business-card-eu";
45
+ "business-card-square-us": "business-card-square-us";
46
+ "business-card-slim-us": "business-card-slim-us";
47
+ "postcard-4x6": "postcard-4x6";
48
+ "postcard-5x7": "postcard-5x7";
49
+ "postcard-6x9": "postcard-6x9";
50
+ "postcard-6x11": "postcard-6x11";
51
+ "card-square-4in": "card-square-4in";
52
+ "half-letter": "half-letter";
53
+ a6: "a6";
54
+ dl: "dl";
55
+ "rack-card-4x9": "rack-card-4x9";
56
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
57
+ "poster-12x18": "poster-12x18";
58
+ "poster-16x20": "poster-16x20";
59
+ "poster-18x24": "poster-18x24";
60
+ "poster-24x36": "poster-24x36";
61
+ a2: "a2";
62
+ a1: "a1";
63
+ a0: "a0";
43
64
  }>, z.ZodObject<{
44
65
  width: z.ZodNumber;
45
66
  height: z.ZodNumber;
@@ -92,6 +113,27 @@ export declare const Book: z.ZodPipe<z.ZodObject<{
92
113
  a3: "a3";
93
114
  a4: "a4";
94
115
  a5: "a5";
116
+ "business-card-us": "business-card-us";
117
+ "business-card-eu": "business-card-eu";
118
+ "business-card-square-us": "business-card-square-us";
119
+ "business-card-slim-us": "business-card-slim-us";
120
+ "postcard-4x6": "postcard-4x6";
121
+ "postcard-5x7": "postcard-5x7";
122
+ "postcard-6x9": "postcard-6x9";
123
+ "postcard-6x11": "postcard-6x11";
124
+ "card-square-4in": "card-square-4in";
125
+ "half-letter": "half-letter";
126
+ a6: "a6";
127
+ dl: "dl";
128
+ "rack-card-4x9": "rack-card-4x9";
129
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
130
+ "poster-12x18": "poster-12x18";
131
+ "poster-16x20": "poster-16x20";
132
+ "poster-18x24": "poster-18x24";
133
+ "poster-24x36": "poster-24x36";
134
+ a2: "a2";
135
+ a1: "a1";
136
+ a0: "a0";
95
137
  }>, z.ZodObject<{
96
138
  width: z.ZodNumber;
97
139
  height: z.ZodNumber;
@@ -215,7 +257,7 @@ export declare const Book: z.ZodPipe<z.ZodObject<{
215
257
  depth: number;
216
258
  };
217
259
  page?: {
218
- paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | {
260
+ 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" | {
219
261
  width: number;
220
262
  height: number;
221
263
  unit: "mm" | "in" | "pt";
@@ -266,7 +308,7 @@ export declare const Book: z.ZodPipe<z.ZodObject<{
266
308
  depth: number;
267
309
  };
268
310
  page?: {
269
- paper: "letter" | "legal" | "tabloid" | "a3" | "a4" | "a5" | {
311
+ 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" | {
270
312
  width: number;
271
313
  height: number;
272
314
  unit: "mm" | "in" | "pt";
@@ -112,6 +112,7 @@ export declare function deckFromSlides(rows: SlideRow[], options: DeckFromSlides
112
112
  beforeMs?: number | undefined;
113
113
  afterMs?: number | undefined;
114
114
  holdMs?: number | undefined;
115
+ printAtMs?: number | undefined;
115
116
  }[];
116
117
  dir?: "ltr" | "rtl" | "auto" | undefined;
117
118
  lang?: string | undefined;
@@ -119,7 +120,7 @@ export declare function deckFromSlides(rows: SlideRow[], options: DeckFromSlides
119
120
  kind: "none" | "fade" | "slide";
120
121
  duration: number;
121
122
  } | undefined;
122
- playback?: "continuous" | "step" | undefined;
123
+ playback?: "continuous" | "segmented" | undefined;
123
124
  captions?: "on" | "off" | "viewer" | undefined;
124
125
  };
125
126
  //#endregion
@@ -1,16 +1,18 @@
1
1
  import { Deck } from "./deck.js";
2
2
  //#region src/deck-from-slides.ts
3
+ const optionalPrintAt = (printAtMs) => printAtMs === void 0 ? {} : { printAtMs };
3
4
  function deckFromSlides(rows, options) {
4
5
  const { omitNotes = false, ...deckOptions } = options;
5
6
  const slides = rows.map(({ kind, ...row }) => {
6
- const { id, notes, narration, beforeMs, afterMs, holdMs } = row;
7
+ const { id, notes, narration, beforeMs, afterMs, holdMs, printAtMs } = row;
7
8
  const common = {
8
9
  id,
9
10
  ...!omitNotes && notes !== void 0 ? { notes } : {},
10
11
  ...narration !== void 0 ? { narration } : {},
11
12
  ...beforeMs !== void 0 ? { beforeMs } : {},
12
13
  ...afterMs !== void 0 ? { afterMs } : {},
13
- ...holdMs !== void 0 ? { holdMs } : {}
14
+ ...holdMs !== void 0 ? { holdMs } : {},
15
+ ...optionalPrintAt(printAtMs)
14
16
  };
15
17
  return kind === "html" ? {
16
18
  ...common,
package/dist/deck.d.ts CHANGED
@@ -379,12 +379,20 @@ export declare const Slide: z.ZodObject<{
379
379
  beforeMs: z.ZodOptional<z.ZodNumber>;
380
380
  afterMs: z.ZodOptional<z.ZodNumber>;
381
381
  holdMs: z.ZodOptional<z.ZodNumber>;
382
+ printAtMs: z.ZodOptional<z.ZodNumber>;
382
383
  }, z.core.$strip>;
383
384
  export type Slide = z.infer<typeof Slide>;
384
385
  export declare const DECK_SIZE: {
385
386
  readonly width: 1280;
386
387
  readonly height: 720;
387
388
  };
389
+ export declare const PLAYBACK_MODES: readonly ["segmented", "continuous"];
390
+ export type PlaybackMode = (typeof PLAYBACK_MODES)[number];
391
+ export declare const Playback: z.ZodUnion<readonly [z.ZodEnum<{
392
+ continuous: "continuous";
393
+ segmented: "segmented";
394
+ }>, z.ZodPipe<z.ZodLiteral<"step">, z.ZodTransform<"continuous" | "segmented", "step">>]>;
395
+ export declare function parsePlayback(value: unknown): PlaybackMode | undefined;
388
396
  export declare function annotationCueIssues(narration: Slide['narration'], annotations: number): string[];
389
397
  export declare const Deck: z.ZodObject<{
390
398
  title: z.ZodString;
@@ -421,10 +429,10 @@ export declare const Deck: z.ZodObject<{
421
429
  }>;
422
430
  duration: z.ZodDefault<z.ZodNumber>;
423
431
  }, z.core.$strip>>;
424
- playback: z.ZodOptional<z.ZodEnum<{
432
+ playback: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
425
433
  continuous: "continuous";
426
- step: "step";
427
- }>>;
434
+ segmented: "segmented";
435
+ }>, z.ZodPipe<z.ZodLiteral<"step">, z.ZodTransform<"continuous" | "segmented", "step">>]>>;
428
436
  captions: z.ZodOptional<z.ZodEnum<{
429
437
  on: "on";
430
438
  off: "off";
@@ -542,6 +550,7 @@ export declare const Deck: z.ZodObject<{
542
550
  beforeMs: z.ZodOptional<z.ZodNumber>;
543
551
  afterMs: z.ZodOptional<z.ZodNumber>;
544
552
  holdMs: z.ZodOptional<z.ZodNumber>;
553
+ printAtMs: z.ZodOptional<z.ZodNumber>;
545
554
  }, z.core.$strip>>;
546
555
  }, z.core.$strip>;
547
556
  export type Deck = z.infer<typeof Deck>;
package/dist/deck.js CHANGED
@@ -113,12 +113,19 @@ const Slide = z.object({
113
113
  narration: Narration.optional(),
114
114
  beforeMs: SlideTiming.optional(),
115
115
  afterMs: SlideTiming.optional(),
116
- holdMs: SlideTiming.optional()
116
+ holdMs: SlideTiming.optional(),
117
+ printAtMs: z.number().nonnegative().optional()
117
118
  });
118
119
  const DECK_SIZE = {
119
120
  width: 1280,
120
121
  height: 720
121
122
  };
123
+ const PLAYBACK_MODES = ["segmented", "continuous"];
124
+ const Playback = z.union([z.enum(PLAYBACK_MODES), z.literal("step").transform(() => "segmented")]);
125
+ function parsePlayback(value) {
126
+ const parsed = Playback.safeParse(value);
127
+ return parsed.success ? parsed.data : void 0;
128
+ }
122
129
  const DeckShape = z.object({
123
130
  title: z.string(),
124
131
  size: Size.default(DECK_SIZE),
@@ -129,7 +136,7 @@ const DeckShape = z.object({
129
136
  dir: Direction.optional(),
130
137
  lang: z.string().optional(),
131
138
  transition: Transition.optional(),
132
- playback: z.enum(["step", "continuous"]).optional(),
139
+ playback: Playback.optional(),
133
140
  captions: z.enum([
134
141
  "on",
135
142
  "off",
@@ -208,4 +215,4 @@ function exceedsLimits(deck, limits) {
208
215
  return reasons;
209
216
  }
210
217
  //#endregion
211
- export { Annotation, Box, Cue, DECK_SIZE, Deck, DeckShape, ImageFit, Manifest, Narration, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits };
218
+ export { Annotation, Box, Cue, DECK_SIZE, Deck, DeckShape, ImageFit, Manifest, Narration, PLAYBACK_MODES, Playback, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits, parsePlayback };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Board, BoardInput, BoardItem, BoardLabel, BoardSection, GridCell } from "./board.js";
2
- import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckInput, DeckLimits, ImageFit, Manifest, Narration, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits } from "./deck.js";
2
+ import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckInput, DeckLimits, ImageFit, Manifest, Narration, PLAYBACK_MODES, Playback, PlaybackMode, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits, parsePlayback } from "./deck.js";
3
3
  import { BoardItemAnchor, MIN_BOARD_ITEM_WIDTH, addItem, moveItems, moveSection, removeItems, resizeItem } from "./board-edit.js";
4
4
  import { ArrangeOptions, BoardShapes, BoardView, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, ZoomBounds, arrange, boardBounds, boardToScreen, itemAt, itemHeight, revealView, screenToBoard, visibleItems, zoomAt, zoomToFit } from "./board-geometry.js";
5
5
  import { BoardListingGroup, boardListing, boardListingIsEmpty, foldForSearch, nameMatches } from "./board-listing.js";
@@ -33,6 +33,27 @@ export declare const Print: z.ZodObject<{
33
33
  a3: "a3";
34
34
  a4: "a4";
35
35
  a5: "a5";
36
+ "business-card-us": "business-card-us";
37
+ "business-card-eu": "business-card-eu";
38
+ "business-card-square-us": "business-card-square-us";
39
+ "business-card-slim-us": "business-card-slim-us";
40
+ "postcard-4x6": "postcard-4x6";
41
+ "postcard-5x7": "postcard-5x7";
42
+ "postcard-6x9": "postcard-6x9";
43
+ "postcard-6x11": "postcard-6x11";
44
+ "card-square-4in": "card-square-4in";
45
+ "half-letter": "half-letter";
46
+ a6: "a6";
47
+ dl: "dl";
48
+ "rack-card-4x9": "rack-card-4x9";
49
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
50
+ "poster-12x18": "poster-12x18";
51
+ "poster-16x20": "poster-16x20";
52
+ "poster-18x24": "poster-18x24";
53
+ "poster-24x36": "poster-24x36";
54
+ a2: "a2";
55
+ a1: "a1";
56
+ a0: "a0";
36
57
  }>, z.ZodObject<{
37
58
  width: z.ZodNumber;
38
59
  height: z.ZodNumber;
@@ -67,6 +88,27 @@ export declare const Imposition: z.ZodObject<{
67
88
  a3: "a3";
68
89
  a4: "a4";
69
90
  a5: "a5";
91
+ "business-card-us": "business-card-us";
92
+ "business-card-eu": "business-card-eu";
93
+ "business-card-square-us": "business-card-square-us";
94
+ "business-card-slim-us": "business-card-slim-us";
95
+ "postcard-4x6": "postcard-4x6";
96
+ "postcard-5x7": "postcard-5x7";
97
+ "postcard-6x9": "postcard-6x9";
98
+ "postcard-6x11": "postcard-6x11";
99
+ "card-square-4in": "card-square-4in";
100
+ "half-letter": "half-letter";
101
+ a6: "a6";
102
+ dl: "dl";
103
+ "rack-card-4x9": "rack-card-4x9";
104
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
105
+ "poster-12x18": "poster-12x18";
106
+ "poster-16x20": "poster-16x20";
107
+ "poster-18x24": "poster-18x24";
108
+ "poster-24x36": "poster-24x36";
109
+ a2: "a2";
110
+ a1: "a1";
111
+ a0: "a0";
70
112
  }>, z.ZodObject<{
71
113
  width: z.ZodNumber;
72
114
  height: z.ZodNumber;
@@ -162,6 +204,27 @@ export declare const Page: z.ZodObject<{
162
204
  a3: "a3";
163
205
  a4: "a4";
164
206
  a5: "a5";
207
+ "business-card-us": "business-card-us";
208
+ "business-card-eu": "business-card-eu";
209
+ "business-card-square-us": "business-card-square-us";
210
+ "business-card-slim-us": "business-card-slim-us";
211
+ "postcard-4x6": "postcard-4x6";
212
+ "postcard-5x7": "postcard-5x7";
213
+ "postcard-6x9": "postcard-6x9";
214
+ "postcard-6x11": "postcard-6x11";
215
+ "card-square-4in": "card-square-4in";
216
+ "half-letter": "half-letter";
217
+ a6: "a6";
218
+ dl: "dl";
219
+ "rack-card-4x9": "rack-card-4x9";
220
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
221
+ "poster-12x18": "poster-12x18";
222
+ "poster-16x20": "poster-16x20";
223
+ "poster-18x24": "poster-18x24";
224
+ "poster-24x36": "poster-24x36";
225
+ a2: "a2";
226
+ a1: "a1";
227
+ a0: "a0";
165
228
  }>, z.ZodObject<{
166
229
  width: z.ZodNumber;
167
230
  height: z.ZodNumber;
@@ -203,6 +266,27 @@ export declare function jsonSchemas(): {
203
266
  a3: "a3";
204
267
  a4: "a4";
205
268
  a5: "a5";
269
+ "business-card-us": "business-card-us";
270
+ "business-card-eu": "business-card-eu";
271
+ "business-card-square-us": "business-card-square-us";
272
+ "business-card-slim-us": "business-card-slim-us";
273
+ "postcard-4x6": "postcard-4x6";
274
+ "postcard-5x7": "postcard-5x7";
275
+ "postcard-6x9": "postcard-6x9";
276
+ "postcard-6x11": "postcard-6x11";
277
+ "card-square-4in": "card-square-4in";
278
+ "half-letter": "half-letter";
279
+ a6: "a6";
280
+ dl: "dl";
281
+ "rack-card-4x9": "rack-card-4x9";
282
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
283
+ "poster-12x18": "poster-12x18";
284
+ "poster-16x20": "poster-16x20";
285
+ "poster-18x24": "poster-18x24";
286
+ "poster-24x36": "poster-24x36";
287
+ a2: "a2";
288
+ a1: "a1";
289
+ a0: "a0";
206
290
  }>, z.ZodObject<{
207
291
  width: z.ZodNumber;
208
292
  height: z.ZodNumber;
@@ -332,6 +416,27 @@ export declare function jsonSchemas(): {
332
416
  a3: "a3";
333
417
  a4: "a4";
334
418
  a5: "a5";
419
+ "business-card-us": "business-card-us";
420
+ "business-card-eu": "business-card-eu";
421
+ "business-card-square-us": "business-card-square-us";
422
+ "business-card-slim-us": "business-card-slim-us";
423
+ "postcard-4x6": "postcard-4x6";
424
+ "postcard-5x7": "postcard-5x7";
425
+ "postcard-6x9": "postcard-6x9";
426
+ "postcard-6x11": "postcard-6x11";
427
+ "card-square-4in": "card-square-4in";
428
+ "half-letter": "half-letter";
429
+ a6: "a6";
430
+ dl: "dl";
431
+ "rack-card-4x9": "rack-card-4x9";
432
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
433
+ "poster-12x18": "poster-12x18";
434
+ "poster-16x20": "poster-16x20";
435
+ "poster-18x24": "poster-18x24";
436
+ "poster-24x36": "poster-24x36";
437
+ a2: "a2";
438
+ a1: "a1";
439
+ a0: "a0";
335
440
  }>, z.ZodObject<{
336
441
  width: z.ZodNumber;
337
442
  height: z.ZodNumber;
@@ -371,6 +476,27 @@ export declare function jsonSchemas(): {
371
476
  a3: "a3";
372
477
  a4: "a4";
373
478
  a5: "a5";
479
+ "business-card-us": "business-card-us";
480
+ "business-card-eu": "business-card-eu";
481
+ "business-card-square-us": "business-card-square-us";
482
+ "business-card-slim-us": "business-card-slim-us";
483
+ "postcard-4x6": "postcard-4x6";
484
+ "postcard-5x7": "postcard-5x7";
485
+ "postcard-6x9": "postcard-6x9";
486
+ "postcard-6x11": "postcard-6x11";
487
+ "card-square-4in": "card-square-4in";
488
+ "half-letter": "half-letter";
489
+ a6: "a6";
490
+ dl: "dl";
491
+ "rack-card-4x9": "rack-card-4x9";
492
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
493
+ "poster-12x18": "poster-12x18";
494
+ "poster-16x20": "poster-16x20";
495
+ "poster-18x24": "poster-18x24";
496
+ "poster-24x36": "poster-24x36";
497
+ a2: "a2";
498
+ a1: "a1";
499
+ a0: "a0";
374
500
  }>, z.ZodObject<{
375
501
  width: z.ZodNumber;
376
502
  height: z.ZodNumber;
@@ -464,10 +590,10 @@ export declare function jsonSchemas(): {
464
590
  }>;
465
591
  duration: z.ZodDefault<z.ZodNumber>;
466
592
  }, z.core.$strip>>;
467
- playback: z.ZodOptional<z.ZodEnum<{
593
+ playback: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
468
594
  continuous: "continuous";
469
- step: "step";
470
- }>>;
595
+ segmented: "segmented";
596
+ }>, z.ZodPipe<z.ZodLiteral<"step">, z.ZodTransform<"continuous" | "segmented", "step">>]>>;
471
597
  captions: z.ZodOptional<z.ZodEnum<{
472
598
  on: "on";
473
599
  off: "off";
@@ -585,6 +711,7 @@ export declare function jsonSchemas(): {
585
711
  beforeMs: z.ZodOptional<z.ZodNumber>;
586
712
  afterMs: z.ZodOptional<z.ZodNumber>;
587
713
  holdMs: z.ZodOptional<z.ZodNumber>;
714
+ printAtMs: z.ZodOptional<z.ZodNumber>;
588
715
  }, z.core.$strip>>;
589
716
  }, z.core.$strip>>;
590
717
  manifest: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
@@ -733,4 +860,4 @@ export declare function jsonSchemas(): {
733
860
  }, z.core.$strip>>;
734
861
  };
735
862
  //#endregion
736
- export { Annotation, type ArrangeOptions, Board, type BoardInput, BoardItem, type BoardItemAnchor, BoardLabel, type BoardListingGroup, BoardSection, type BoardShapes, type BoardView, 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, GridCell, type GridDropTarget, ImageFit, type Imposed, Lexicon, MAKE_ROOM_LIMIT, MARK_GAP_MM, MARK_LENGTH_MM, MAX_BOARD_ZOOM, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_BOARD_ITEM_WIDTH, MIN_BOARD_ZOOM, 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, SECTION_GAP, SECTION_MIN_SIZE, SECTION_PADDING, SECTION_TITLE_ROOM, SHOT_KEY, Scripts, Shot, type ShotUse, Size, Slide, SlideContent, type SlideRow, TextDirection, Transition, TransitionInput, Word, type ZoomBounds, addItem, annotationCueIssues, arrange, assignMembership, boardBounds, boardListing, boardListingIsEmpty, boardToScreen, deckFromSlides, deriveSectionCells, exceedsLimits, firstStrongDirection, fitPage, fitSection, fitTouchedSections, foldForSearch, formatNumber, gridDropMarkerBox, gridDropTarget, impose, insertIntoGrid, isBookContents, isHebrew, itemAt, itemHeight, languageDirection, layoutSection, lexiconVersion, makeRoom, mirrorPlacement, moveItems, moveSection, nameMatches, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, removeFromGrid, removeItems, resizeItem, resolveDirection, revealView, roundMillimeters, screenToBoard, settleBoard, sheetMm, shotsUsed, toMillimeters, visibleItems, zoomAt, zoomToFit };
863
+ export { Annotation, type ArrangeOptions, Board, type BoardInput, BoardItem, type BoardItemAnchor, BoardLabel, type BoardListingGroup, BoardSection, type BoardShapes, type BoardView, 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, GridCell, type GridDropTarget, ImageFit, type Imposed, Lexicon, MAKE_ROOM_LIMIT, MARK_GAP_MM, MARK_LENGTH_MM, MAX_BOARD_ZOOM, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_BOARD_ITEM_WIDTH, MIN_BOARD_ZOOM, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, type MillimeterEdges, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PLAYBACK_MODES, PX_PER_MM, type PageFit, type PagePlacementKind, type PagePlacementLayout, Paper, type PaperBox, type Placement, Playback, type PlaybackMode, Point, PronunciationEntry, PublishedShot, SECTION_GAP, SECTION_MIN_SIZE, SECTION_PADDING, SECTION_TITLE_ROOM, SHOT_KEY, Scripts, Shot, type ShotUse, Size, Slide, SlideContent, type SlideRow, TextDirection, Transition, TransitionInput, Word, type ZoomBounds, addItem, annotationCueIssues, arrange, assignMembership, boardBounds, boardListing, boardListingIsEmpty, boardToScreen, deckFromSlides, deriveSectionCells, exceedsLimits, firstStrongDirection, fitPage, fitSection, fitTouchedSections, foldForSearch, formatNumber, gridDropMarkerBox, gridDropTarget, impose, insertIntoGrid, isBookContents, isHebrew, itemAt, itemHeight, languageDirection, layoutSection, lexiconVersion, makeRoom, mirrorPlacement, moveItems, moveSection, nameMatches, noteMarker, noteMarkerIssues, pagePlacementLayout, parsePlayback, printBoxes, printPadding, printProperties, removeFromGrid, removeItems, resizeItem, resolveDirection, revealView, roundMillimeters, screenToBoard, settleBoard, sheetMm, shotsUsed, toMillimeters, visibleItems, zoomAt, zoomToFit };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { Direction, TextDirection, firstStrongDirection, languageDirection, reso
2
2
  import { Scripts } from "./scripts.js";
3
3
  import { MAX_SLIDE_TIMING_MS } from "./timing.js";
4
4
  import { DEFAULT_TRANSITION_DURATION_MS, MAX_TRANSITION_DURATION_MS, MIN_TRANSITION_DURATION_MS, Transition } from "./transition.js";
5
- import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckShape, ImageFit, Manifest, Narration, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits } from "./deck.js";
5
+ import { Annotation, Box, Cue, DECK_SIZE, Deck, DeckShape, ImageFit, Manifest, Narration, PLAYBACK_MODES, Playback, Point, PublishedShot, SHOT_KEY, Shot, Size, Slide, SlideContent, Word, annotationCueIssues, exceedsLimits, parsePlayback } from "./deck.js";
6
6
  import { Board, BoardItem, BoardLabel, BoardSection, GridCell } from "./board.js";
7
7
  import { NoteMarker, NumberSystem, formatNumber, noteMarker } from "./numbering.js";
8
8
  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";
@@ -159,4 +159,4 @@ function jsonSchemas() {
159
159
  };
160
160
  }
161
161
  //#endregion
162
- export { Annotation, Board, BoardItem, BoardLabel, BoardSection, Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookView, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, Direction, GridCell, ImageFit, Imposition, Lexicon, MAKE_ROOM_LIMIT, MARK_GAP_MM, MARK_LENGTH_MM, MAX_BOARD_ZOOM, MAX_IMPOSITION_CELLS, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_BOARD_ITEM_WIDTH, MIN_BOARD_ZOOM, 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, SECTION_GAP, SECTION_MIN_SIZE, SECTION_PADDING, SECTION_TITLE_ROOM, SHOT_KEY, Scripts, Shot, Size, Slide, SlideContent, TextDirection, Transition, Word, addItem, annotationCueIssues, arrange, assignMembership, boardBounds, boardListing, boardListingIsEmpty, boardToScreen, deckFromSlides, deriveSectionCells, exceedsLimits, firstStrongDirection, fitPage, fitSection, fitTouchedSections, foldForSearch, formatNumber, gridDropMarkerBox, gridDropTarget, impose, insertIntoGrid, isBookContents, isHebrew, itemAt, itemHeight, jsonSchemas, languageDirection, layoutSection, lexiconVersion, makeRoom, mirrorPlacement, moveItems, moveSection, nameMatches, noteMarker, noteMarkerIssues, pagePlacementLayout, printBoxes, printPadding, printProperties, removeFromGrid, removeItems, resizeItem, resolveDirection, revealView, roundMillimeters, screenToBoard, settleBoard, sheetMm, shotsUsed, toMillimeters, visibleItems, zoomAt, zoomToFit };
162
+ export { Annotation, Board, BoardItem, BoardLabel, BoardSection, Book, BookContents, BookFrontMatterEntry, BookMode, BookPage, BookSection, BookView, Box, Chapter, Cue, DECK_SIZE, DEFAULT_TRANSITION_DURATION_MS, Deck, Direction, GridCell, ImageFit, Imposition, Lexicon, MAKE_ROOM_LIMIT, MARK_GAP_MM, MARK_LENGTH_MM, MAX_BOARD_ZOOM, MAX_IMPOSITION_CELLS, MAX_SLIDE_TIMING_MS, MAX_TRANSITION_DURATION_MS, MIN_BOARD_ITEM_WIDTH, MIN_BOARD_ZOOM, MIN_TRANSITION_DURATION_MS, MM_PER_PT, Manifest, Margin, NAMED_PAPERS, Narration, NoteMarker, NumberSystem, PAPER_MM, PLAYBACK_MODES, PX_PER_MM, Page, PageSize, Paper, Playback, Point, Print, PronunciationEntry, PublishedShot, SECTION_GAP, SECTION_MIN_SIZE, SECTION_PADDING, SECTION_TITLE_ROOM, SHOT_KEY, Scripts, Shot, Size, Slide, SlideContent, TextDirection, Transition, Word, addItem, annotationCueIssues, arrange, assignMembership, boardBounds, boardListing, boardListingIsEmpty, boardToScreen, deckFromSlides, deriveSectionCells, exceedsLimits, firstStrongDirection, fitPage, fitSection, fitTouchedSections, foldForSearch, formatNumber, gridDropMarkerBox, gridDropTarget, impose, insertIntoGrid, isBookContents, isHebrew, itemAt, itemHeight, jsonSchemas, languageDirection, layoutSection, lexiconVersion, makeRoom, mirrorPlacement, moveItems, moveSection, nameMatches, noteMarker, noteMarkerIssues, pagePlacementLayout, parsePlayback, printBoxes, printPadding, printProperties, removeFromGrid, removeItems, resizeItem, resolveDirection, revealView, roundMillimeters, screenToBoard, settleBoard, sheetMm, shotsUsed, toMillimeters, visibleItems, zoomAt, zoomToFit };
package/dist/paper.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Print } from "./index.js";
2
2
  import { z } from "zod";
3
3
  //#region src/paper.d.ts
4
- export declare const NAMED_PAPERS: readonly ["letter", "legal", "tabloid", "a3", "a4", "a5"];
4
+ export declare const NAMED_PAPERS: readonly ["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"];
5
5
  export declare const Paper: z.ZodUnion<readonly [z.ZodEnum<{
6
6
  letter: "letter";
7
7
  legal: "legal";
@@ -9,6 +9,27 @@ export declare const Paper: z.ZodUnion<readonly [z.ZodEnum<{
9
9
  a3: "a3";
10
10
  a4: "a4";
11
11
  a5: "a5";
12
+ "business-card-us": "business-card-us";
13
+ "business-card-eu": "business-card-eu";
14
+ "business-card-square-us": "business-card-square-us";
15
+ "business-card-slim-us": "business-card-slim-us";
16
+ "postcard-4x6": "postcard-4x6";
17
+ "postcard-5x7": "postcard-5x7";
18
+ "postcard-6x9": "postcard-6x9";
19
+ "postcard-6x11": "postcard-6x11";
20
+ "card-square-4in": "card-square-4in";
21
+ "half-letter": "half-letter";
22
+ a6: "a6";
23
+ dl: "dl";
24
+ "rack-card-4x9": "rack-card-4x9";
25
+ "rack-card-3.5x8.5": "rack-card-3.5x8.5";
26
+ "poster-12x18": "poster-12x18";
27
+ "poster-16x20": "poster-16x20";
28
+ "poster-18x24": "poster-18x24";
29
+ "poster-24x36": "poster-24x36";
30
+ a2: "a2";
31
+ a1: "a1";
32
+ a0: "a0";
12
33
  }>, z.ZodObject<{
13
34
  width: z.ZodNumber;
14
35
  height: z.ZodNumber;
@@ -22,12 +43,12 @@ export type Paper = z.infer<typeof Paper>;
22
43
  export declare const MM_PER_PT: number;
23
44
  export declare const MARK_LENGTH_MM = 5;
24
45
  export declare const MARK_GAP_MM = 1;
46
+ export declare const roundMillimeters: (mm: number) => number;
47
+ export declare function toMillimeters(value: number, unit: 'mm' | 'in' | 'pt'): number;
25
48
  export declare const PAPER_MM: Record<Extract<Paper, string>, {
26
49
  width: number;
27
50
  height: number;
28
51
  }>;
29
- export declare const roundMillimeters: (mm: number) => number;
30
- export declare function toMillimeters(value: number, unit: 'mm' | 'in' | 'pt'): number;
31
52
  export declare function sheetMm(print: Pick<Print, 'paper' | 'orientation'>): {
32
53
  width: number;
33
54
  height: number;
package/dist/paper.js CHANGED
@@ -6,7 +6,28 @@ const NAMED_PAPERS = [
6
6
  "tabloid",
7
7
  "a3",
8
8
  "a4",
9
- "a5"
9
+ "a5",
10
+ "business-card-us",
11
+ "business-card-eu",
12
+ "business-card-square-us",
13
+ "business-card-slim-us",
14
+ "postcard-4x6",
15
+ "postcard-5x7",
16
+ "postcard-6x9",
17
+ "postcard-6x11",
18
+ "card-square-4in",
19
+ "half-letter",
20
+ "a6",
21
+ "dl",
22
+ "rack-card-4x9",
23
+ "rack-card-3.5x8.5",
24
+ "poster-12x18",
25
+ "poster-16x20",
26
+ "poster-18x24",
27
+ "poster-24x36",
28
+ "a2",
29
+ "a1",
30
+ "a0"
10
31
  ];
11
32
  const Paper = z.union([z.enum(NAMED_PAPERS), z.object({
12
33
  width: z.number().positive(),
@@ -20,36 +41,155 @@ const Paper = z.union([z.enum(NAMED_PAPERS), z.object({
20
41
  const MM_PER_PT = 25.4 / 72;
21
42
  const MARK_LENGTH_MM = 5;
22
43
  const MARK_GAP_MM = 1;
23
- const PAPER_MM = {
44
+ const roundMillimeters = (mm) => Math.round(mm * 100) / 100;
45
+ function toMillimeters(value, unit) {
46
+ return value * (unit === "in" ? 25.4 : unit === "pt" ? MM_PER_PT : 1);
47
+ }
48
+ const PAPER_SIZE = {
24
49
  letter: {
25
- width: 215.9,
26
- height: 279.4
50
+ width: 8.5,
51
+ height: 11,
52
+ unit: "in"
27
53
  },
28
54
  legal: {
29
- width: 215.9,
30
- height: 355.6
55
+ width: 8.5,
56
+ height: 14,
57
+ unit: "in"
31
58
  },
32
59
  tabloid: {
33
- width: 279.4,
34
- height: 431.8
60
+ width: 11,
61
+ height: 17,
62
+ unit: "in"
35
63
  },
36
64
  a3: {
37
65
  width: 297,
38
- height: 420
66
+ height: 420,
67
+ unit: "mm"
39
68
  },
40
69
  a4: {
41
70
  width: 210,
42
- height: 297
71
+ height: 297,
72
+ unit: "mm"
43
73
  },
44
74
  a5: {
45
75
  width: 148,
46
- height: 210
76
+ height: 210,
77
+ unit: "mm"
78
+ },
79
+ "business-card-us": {
80
+ width: 2,
81
+ height: 3.5,
82
+ unit: "in"
83
+ },
84
+ "business-card-eu": {
85
+ width: 55,
86
+ height: 85,
87
+ unit: "mm"
88
+ },
89
+ "business-card-square-us": {
90
+ width: 2.5,
91
+ height: 2.5,
92
+ unit: "in"
93
+ },
94
+ "business-card-slim-us": {
95
+ width: 1.75,
96
+ height: 3.5,
97
+ unit: "in"
98
+ },
99
+ "postcard-4x6": {
100
+ width: 4,
101
+ height: 6,
102
+ unit: "in"
103
+ },
104
+ "postcard-5x7": {
105
+ width: 5,
106
+ height: 7,
107
+ unit: "in"
108
+ },
109
+ "postcard-6x9": {
110
+ width: 6,
111
+ height: 9,
112
+ unit: "in"
113
+ },
114
+ "postcard-6x11": {
115
+ width: 6,
116
+ height: 11,
117
+ unit: "in"
118
+ },
119
+ "card-square-4in": {
120
+ width: 4,
121
+ height: 4,
122
+ unit: "in"
123
+ },
124
+ "half-letter": {
125
+ width: 5.5,
126
+ height: 8.5,
127
+ unit: "in"
128
+ },
129
+ a6: {
130
+ width: 105,
131
+ height: 148,
132
+ unit: "mm"
133
+ },
134
+ dl: {
135
+ width: 99,
136
+ height: 210,
137
+ unit: "mm"
138
+ },
139
+ "rack-card-4x9": {
140
+ width: 4,
141
+ height: 9,
142
+ unit: "in"
143
+ },
144
+ "rack-card-3.5x8.5": {
145
+ width: 3.5,
146
+ height: 8.5,
147
+ unit: "in"
148
+ },
149
+ "poster-12x18": {
150
+ width: 12,
151
+ height: 18,
152
+ unit: "in"
153
+ },
154
+ "poster-16x20": {
155
+ width: 16,
156
+ height: 20,
157
+ unit: "in"
158
+ },
159
+ "poster-18x24": {
160
+ width: 18,
161
+ height: 24,
162
+ unit: "in"
163
+ },
164
+ "poster-24x36": {
165
+ width: 24,
166
+ height: 36,
167
+ unit: "in"
168
+ },
169
+ a2: {
170
+ width: 420,
171
+ height: 594,
172
+ unit: "mm"
173
+ },
174
+ a1: {
175
+ width: 594,
176
+ height: 841,
177
+ unit: "mm"
178
+ },
179
+ a0: {
180
+ width: 841,
181
+ height: 1189,
182
+ unit: "mm"
47
183
  }
48
184
  };
49
- const roundMillimeters = (mm) => Math.round(mm * 100) / 100;
50
- function toMillimeters(value, unit) {
51
- return value * (unit === "in" ? 25.4 : unit === "pt" ? MM_PER_PT : 1);
52
- }
185
+ const paperMillimeters = () => Object.fromEntries(NAMED_PAPERS.map((paper) => {
186
+ const { width, height, unit } = PAPER_SIZE[paper];
187
+ return [paper, {
188
+ width: roundMillimeters(toMillimeters(width, unit)),
189
+ height: roundMillimeters(toMillimeters(height, unit))
190
+ }];
191
+ }));
192
+ const PAPER_MM = paperMillimeters();
53
193
  function sheetMm(print) {
54
194
  const portrait = typeof print.paper === "string" ? PAPER_MM[print.paper] : {
55
195
  width: toMillimeters(print.paper.width, print.paper.unit),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segnavia/format",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {