@dloizides/poster-render 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - FLIER-2 "Flier Studio follow-ups" D30 (sample parity, gap table `apps/flier-studio/docs/design/FLIER-2-sample-parity/gap.md`), all optional:
6
+ - `tuning.headerTop` (title top, px at a 1080 short edge), `tuning.titleScriptGap` / `tuning.scriptTitleGap` (separate gaps between the header lines), `tuning.titleScale` / `tuning.titleBottomScale`.
7
+ - `rows.icons` (`RowIcon` person / people / ticket per schedule and price row, optional `size`): a filled disc with a white line icon; a short list repeats its last icon.
8
+ - `rows.dividers` (`thickness`, `color`, `gap`, `toPicture`, `reach`): a rule above the venue and below every row but the last; `toPicture` runs each rule to the picture edge, drawn under the picture.
9
+ - `picture.overlap` (`scale` 1-1.5, `dx`, `dy`): the picture grows and shifts over the rows, stays on the canvas, and text is drawn over it.
10
+ - `BackgroundStyle.Brush`: deterministic dry-brush strokes beside the picture in `palette.brush`.
11
+ - `PaletteId.KizombaSample` (measured: page #fefefe, title #6d645d, ink #45372f, accent #ad8164, script #e5bb97, icon #cca383, rule #d5bca8, brush) and `FontSetId.KizombaSample` (Anton / Sacramento / Barlow Semi Condensed). Optional palette fields `script`, `icon`, `rule`, `brush`.
12
+ - `RenderReport.ruleBoxes`. Docs without the new fields render pixel-identical to 0.5.0 (45 sha256 snapshots unchanged).
13
+
3
14
  ## 0.5.0
4
15
 
5
16
  - FLIER-2 "Flier Studio follow-ups" AC-38/39/40 (D25, D26, D29): optional `FlierDoc.lineStyles`, a per-line override keyed by line path (`title`, `venue.1`, `schedule.0.time`, `items.2.date`, see `LINE_KEY_PATTERN`) with `font`, `sizeScale`, `color`, `weight`, `italic`, `letterSpacing` (em) and `align` (`LineAlign`).
package/dist/index.d.mts CHANGED
@@ -1,14 +1,16 @@
1
1
  declare enum BackgroundStyle {
2
2
  Solid = "solid",
3
3
  Tint = "tint",
4
- Horizon = "horizon"
4
+ Horizon = "horizon",
5
+ Brush = "brush"
5
6
  }
6
7
 
7
8
  declare enum FontSetId {
8
9
  Classic = "classic",
9
10
  Modern = "modern",
10
11
  Elegant = "elegant",
11
- Coastal = "coastal"
12
+ Coastal = "coastal",
13
+ KizombaSample = "kizomba-sample"
12
14
  }
13
15
 
14
16
  declare enum FormatId {
@@ -36,7 +38,8 @@ declare enum PaletteId {
36
38
  Night = "night",
37
39
  Sea = "sea",
38
40
  Rose = "rose",
39
- GoldenHorizon = "golden-horizon"
41
+ GoldenHorizon = "golden-horizon",
42
+ KizombaSample = "kizomba-sample"
40
43
  }
41
44
 
42
45
  declare enum PictureAnchor {
@@ -56,6 +59,12 @@ declare enum LineTieKind {
56
59
  Size = "size"
57
60
  }
58
61
 
62
+ declare enum RowIcon {
63
+ Person = "person",
64
+ People = "people",
65
+ Ticket = "ticket"
66
+ }
67
+
59
68
  interface JsonSchema {
60
69
  $schema?: string;
61
70
  $id?: string;
@@ -112,6 +121,28 @@ interface PictureSlot {
112
121
  imageId: string;
113
122
  anchor: PictureAnchor;
114
123
  scale: number;
124
+ overlap?: PictureOverlap;
125
+ }
126
+ /** Grows the picture by scale around its anchor and shifts it by dx, dy (canvas fractions); text is drawn over it. */
127
+ interface PictureOverlap {
128
+ scale: number;
129
+ dx: number;
130
+ dy: number;
131
+ }
132
+ /** Row icon discs and divider rules; a short icon list repeats its last icon; px at a 1080 short edge. */
133
+ interface RowTheme {
134
+ icons?: {
135
+ schedule?: RowIcon[];
136
+ prices?: RowIcon[];
137
+ size?: number;
138
+ };
139
+ dividers?: {
140
+ thickness: number;
141
+ color?: string;
142
+ gap?: number;
143
+ toPicture?: boolean;
144
+ reach?: number;
145
+ };
115
146
  }
116
147
  interface LogoSlot {
117
148
  imageId: string;
@@ -130,6 +161,7 @@ interface FlierDoc {
130
161
  tuning?: PosterTuning;
131
162
  lineStyles?: Record<LineKey, LineStyle | undefined>;
132
163
  lineTies?: LineTie[];
164
+ rows?: RowTheme;
133
165
  }
134
166
  /** A text line path such as "title", "venue.1", "schedule.0.time" or "items.2.date" (see LINE_KEY_PATTERN). */
135
167
  type LineKey = string;
@@ -152,6 +184,11 @@ interface LineTie {
152
184
  interface PosterTuning {
153
185
  headerGap?: number;
154
186
  itemDateScale?: number;
187
+ headerTop?: number;
188
+ titleScriptGap?: number;
189
+ scriptTitleGap?: number;
190
+ titleScale?: number;
191
+ titleBottomScale?: number;
155
192
  }
156
193
  interface Rect {
157
194
  x: number;
@@ -204,6 +241,7 @@ interface RenderReport {
204
241
  textBoxes: Rect[];
205
242
  cardBoxes: Rect[];
206
243
  iconBoxes: Rect[];
244
+ ruleBoxes: Rect[];
207
245
  logo: Rect | null;
208
246
  backdrop: Rect | null;
209
247
  }
@@ -217,6 +255,10 @@ interface Palette {
217
255
  card: string;
218
256
  arch: string;
219
257
  sky?: readonly SkyStop[];
258
+ script?: string;
259
+ icon?: string;
260
+ rule?: string;
261
+ brush?: readonly string[];
220
262
  }
221
263
  /** One gradient stop of a horizon sky: offset 0 (top) to 1 (bottom) and its colour. */
222
264
  type SkyStop = readonly [number, string];
@@ -280,4 +322,4 @@ declare function defaultLayoutFor(format: FormatId): LayoutId;
280
322
  declare const kizombaWorkshop: FlierDoc;
281
323
  declare const kizombaWorkshopDocs: FlierDoc[];
282
324
 
283
- export { BackgroundStyle, type DataUrlCanvas, FONT_SETS, FORMAT_SIZES, type FlierBlocks, type FlierDoc, FlierDocError, type FlierDocResult, type FontSet, FontSetId, FormatId, type FormatSize, type IncludesBlock, type JsonSchema, LAYOUT_CATALOGUE, LINE_KEY_PATTERN, type LayoutCatalogueEntry, LayoutId, LineAlign, type LineKey, type LineStyle, type LineTie, LineTieKind, type ListItem, type LogoSlot, PALETTES, type Palette, PaletteId, PictureAnchor, type PictureSlot, type PosterAssets, type PosterCanvas, type PosterContext, type PosterGradient, type PosterImage, type PosterTuning, type PriceRow, type Rect, type RenderReport, type ScheduleRow, type SkyStop, type TextMetricsLike, defaultLayoutFor, exportPng, flierDocSchema, kizombaWorkshop, kizombaWorkshopDocs, render, sameSize, sameWidth, validateFlierDoc };
325
+ export { BackgroundStyle, type DataUrlCanvas, FONT_SETS, FORMAT_SIZES, type FlierBlocks, type FlierDoc, FlierDocError, type FlierDocResult, type FontSet, FontSetId, FormatId, type FormatSize, type IncludesBlock, type JsonSchema, LAYOUT_CATALOGUE, LINE_KEY_PATTERN, type LayoutCatalogueEntry, LayoutId, LineAlign, type LineKey, type LineStyle, type LineTie, LineTieKind, type ListItem, type LogoSlot, PALETTES, type Palette, PaletteId, PictureAnchor, type PictureOverlap, type PictureSlot, type PosterAssets, type PosterCanvas, type PosterContext, type PosterGradient, type PosterImage, type PosterTuning, type PriceRow, type Rect, type RenderReport, RowIcon, type RowTheme, type ScheduleRow, type SkyStop, type TextMetricsLike, defaultLayoutFor, exportPng, flierDocSchema, kizombaWorkshop, kizombaWorkshopDocs, render, sameSize, sameWidth, validateFlierDoc };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  declare enum BackgroundStyle {
2
2
  Solid = "solid",
3
3
  Tint = "tint",
4
- Horizon = "horizon"
4
+ Horizon = "horizon",
5
+ Brush = "brush"
5
6
  }
6
7
 
7
8
  declare enum FontSetId {
8
9
  Classic = "classic",
9
10
  Modern = "modern",
10
11
  Elegant = "elegant",
11
- Coastal = "coastal"
12
+ Coastal = "coastal",
13
+ KizombaSample = "kizomba-sample"
12
14
  }
13
15
 
14
16
  declare enum FormatId {
@@ -36,7 +38,8 @@ declare enum PaletteId {
36
38
  Night = "night",
37
39
  Sea = "sea",
38
40
  Rose = "rose",
39
- GoldenHorizon = "golden-horizon"
41
+ GoldenHorizon = "golden-horizon",
42
+ KizombaSample = "kizomba-sample"
40
43
  }
41
44
 
42
45
  declare enum PictureAnchor {
@@ -56,6 +59,12 @@ declare enum LineTieKind {
56
59
  Size = "size"
57
60
  }
58
61
 
62
+ declare enum RowIcon {
63
+ Person = "person",
64
+ People = "people",
65
+ Ticket = "ticket"
66
+ }
67
+
59
68
  interface JsonSchema {
60
69
  $schema?: string;
61
70
  $id?: string;
@@ -112,6 +121,28 @@ interface PictureSlot {
112
121
  imageId: string;
113
122
  anchor: PictureAnchor;
114
123
  scale: number;
124
+ overlap?: PictureOverlap;
125
+ }
126
+ /** Grows the picture by scale around its anchor and shifts it by dx, dy (canvas fractions); text is drawn over it. */
127
+ interface PictureOverlap {
128
+ scale: number;
129
+ dx: number;
130
+ dy: number;
131
+ }
132
+ /** Row icon discs and divider rules; a short icon list repeats its last icon; px at a 1080 short edge. */
133
+ interface RowTheme {
134
+ icons?: {
135
+ schedule?: RowIcon[];
136
+ prices?: RowIcon[];
137
+ size?: number;
138
+ };
139
+ dividers?: {
140
+ thickness: number;
141
+ color?: string;
142
+ gap?: number;
143
+ toPicture?: boolean;
144
+ reach?: number;
145
+ };
115
146
  }
116
147
  interface LogoSlot {
117
148
  imageId: string;
@@ -130,6 +161,7 @@ interface FlierDoc {
130
161
  tuning?: PosterTuning;
131
162
  lineStyles?: Record<LineKey, LineStyle | undefined>;
132
163
  lineTies?: LineTie[];
164
+ rows?: RowTheme;
133
165
  }
134
166
  /** A text line path such as "title", "venue.1", "schedule.0.time" or "items.2.date" (see LINE_KEY_PATTERN). */
135
167
  type LineKey = string;
@@ -152,6 +184,11 @@ interface LineTie {
152
184
  interface PosterTuning {
153
185
  headerGap?: number;
154
186
  itemDateScale?: number;
187
+ headerTop?: number;
188
+ titleScriptGap?: number;
189
+ scriptTitleGap?: number;
190
+ titleScale?: number;
191
+ titleBottomScale?: number;
155
192
  }
156
193
  interface Rect {
157
194
  x: number;
@@ -204,6 +241,7 @@ interface RenderReport {
204
241
  textBoxes: Rect[];
205
242
  cardBoxes: Rect[];
206
243
  iconBoxes: Rect[];
244
+ ruleBoxes: Rect[];
207
245
  logo: Rect | null;
208
246
  backdrop: Rect | null;
209
247
  }
@@ -217,6 +255,10 @@ interface Palette {
217
255
  card: string;
218
256
  arch: string;
219
257
  sky?: readonly SkyStop[];
258
+ script?: string;
259
+ icon?: string;
260
+ rule?: string;
261
+ brush?: readonly string[];
220
262
  }
221
263
  /** One gradient stop of a horizon sky: offset 0 (top) to 1 (bottom) and its colour. */
222
264
  type SkyStop = readonly [number, string];
@@ -280,4 +322,4 @@ declare function defaultLayoutFor(format: FormatId): LayoutId;
280
322
  declare const kizombaWorkshop: FlierDoc;
281
323
  declare const kizombaWorkshopDocs: FlierDoc[];
282
324
 
283
- export { BackgroundStyle, type DataUrlCanvas, FONT_SETS, FORMAT_SIZES, type FlierBlocks, type FlierDoc, FlierDocError, type FlierDocResult, type FontSet, FontSetId, FormatId, type FormatSize, type IncludesBlock, type JsonSchema, LAYOUT_CATALOGUE, LINE_KEY_PATTERN, type LayoutCatalogueEntry, LayoutId, LineAlign, type LineKey, type LineStyle, type LineTie, LineTieKind, type ListItem, type LogoSlot, PALETTES, type Palette, PaletteId, PictureAnchor, type PictureSlot, type PosterAssets, type PosterCanvas, type PosterContext, type PosterGradient, type PosterImage, type PosterTuning, type PriceRow, type Rect, type RenderReport, type ScheduleRow, type SkyStop, type TextMetricsLike, defaultLayoutFor, exportPng, flierDocSchema, kizombaWorkshop, kizombaWorkshopDocs, render, sameSize, sameWidth, validateFlierDoc };
325
+ export { BackgroundStyle, type DataUrlCanvas, FONT_SETS, FORMAT_SIZES, type FlierBlocks, type FlierDoc, FlierDocError, type FlierDocResult, type FontSet, FontSetId, FormatId, type FormatSize, type IncludesBlock, type JsonSchema, LAYOUT_CATALOGUE, LINE_KEY_PATTERN, type LayoutCatalogueEntry, LayoutId, LineAlign, type LineKey, type LineStyle, type LineTie, LineTieKind, type ListItem, type LogoSlot, PALETTES, type Palette, PaletteId, PictureAnchor, type PictureOverlap, type PictureSlot, type PosterAssets, type PosterCanvas, type PosterContext, type PosterGradient, type PosterImage, type PosterTuning, type PriceRow, type Rect, type RenderReport, RowIcon, type RowTheme, type ScheduleRow, type SkyStop, type TextMetricsLike, defaultLayoutFor, exportPng, flierDocSchema, kizombaWorkshop, kizombaWorkshopDocs, render, sameSize, sameWidth, validateFlierDoc };