@dloizides/poster-render 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/CHANGELOG.md +11 -0
- package/dist/index.d.mts +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.js +369 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,33 @@ 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, divider rules, price label scale and venue face/pin; 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
|
+
};
|
|
146
|
+
priceLabelScale?: number;
|
|
147
|
+
venue?: {
|
|
148
|
+
body?: boolean;
|
|
149
|
+
bare?: boolean;
|
|
150
|
+
};
|
|
115
151
|
}
|
|
116
152
|
interface LogoSlot {
|
|
117
153
|
imageId: string;
|
|
@@ -130,6 +166,7 @@ interface FlierDoc {
|
|
|
130
166
|
tuning?: PosterTuning;
|
|
131
167
|
lineStyles?: Record<LineKey, LineStyle | undefined>;
|
|
132
168
|
lineTies?: LineTie[];
|
|
169
|
+
rows?: RowTheme;
|
|
133
170
|
}
|
|
134
171
|
/** A text line path such as "title", "venue.1", "schedule.0.time" or "items.2.date" (see LINE_KEY_PATTERN). */
|
|
135
172
|
type LineKey = string;
|
|
@@ -152,6 +189,11 @@ interface LineTie {
|
|
|
152
189
|
interface PosterTuning {
|
|
153
190
|
headerGap?: number;
|
|
154
191
|
itemDateScale?: number;
|
|
192
|
+
headerTop?: number;
|
|
193
|
+
titleScriptGap?: number;
|
|
194
|
+
scriptTitleGap?: number;
|
|
195
|
+
titleScale?: number;
|
|
196
|
+
titleBottomScale?: number;
|
|
155
197
|
}
|
|
156
198
|
interface Rect {
|
|
157
199
|
x: number;
|
|
@@ -204,6 +246,7 @@ interface RenderReport {
|
|
|
204
246
|
textBoxes: Rect[];
|
|
205
247
|
cardBoxes: Rect[];
|
|
206
248
|
iconBoxes: Rect[];
|
|
249
|
+
ruleBoxes: Rect[];
|
|
207
250
|
logo: Rect | null;
|
|
208
251
|
backdrop: Rect | null;
|
|
209
252
|
}
|
|
@@ -217,6 +260,10 @@ interface Palette {
|
|
|
217
260
|
card: string;
|
|
218
261
|
arch: string;
|
|
219
262
|
sky?: readonly SkyStop[];
|
|
263
|
+
script?: string;
|
|
264
|
+
icon?: string;
|
|
265
|
+
rule?: string;
|
|
266
|
+
brush?: readonly string[];
|
|
220
267
|
}
|
|
221
268
|
/** One gradient stop of a horizon sky: offset 0 (top) to 1 (bottom) and its colour. */
|
|
222
269
|
type SkyStop = readonly [number, string];
|
|
@@ -280,4 +327,4 @@ declare function defaultLayoutFor(format: FormatId): LayoutId;
|
|
|
280
327
|
declare const kizombaWorkshop: FlierDoc;
|
|
281
328
|
declare const kizombaWorkshopDocs: FlierDoc[];
|
|
282
329
|
|
|
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 };
|
|
330
|
+
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,33 @@ 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, divider rules, price label scale and venue face/pin; 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
|
+
};
|
|
146
|
+
priceLabelScale?: number;
|
|
147
|
+
venue?: {
|
|
148
|
+
body?: boolean;
|
|
149
|
+
bare?: boolean;
|
|
150
|
+
};
|
|
115
151
|
}
|
|
116
152
|
interface LogoSlot {
|
|
117
153
|
imageId: string;
|
|
@@ -130,6 +166,7 @@ interface FlierDoc {
|
|
|
130
166
|
tuning?: PosterTuning;
|
|
131
167
|
lineStyles?: Record<LineKey, LineStyle | undefined>;
|
|
132
168
|
lineTies?: LineTie[];
|
|
169
|
+
rows?: RowTheme;
|
|
133
170
|
}
|
|
134
171
|
/** A text line path such as "title", "venue.1", "schedule.0.time" or "items.2.date" (see LINE_KEY_PATTERN). */
|
|
135
172
|
type LineKey = string;
|
|
@@ -152,6 +189,11 @@ interface LineTie {
|
|
|
152
189
|
interface PosterTuning {
|
|
153
190
|
headerGap?: number;
|
|
154
191
|
itemDateScale?: number;
|
|
192
|
+
headerTop?: number;
|
|
193
|
+
titleScriptGap?: number;
|
|
194
|
+
scriptTitleGap?: number;
|
|
195
|
+
titleScale?: number;
|
|
196
|
+
titleBottomScale?: number;
|
|
155
197
|
}
|
|
156
198
|
interface Rect {
|
|
157
199
|
x: number;
|
|
@@ -204,6 +246,7 @@ interface RenderReport {
|
|
|
204
246
|
textBoxes: Rect[];
|
|
205
247
|
cardBoxes: Rect[];
|
|
206
248
|
iconBoxes: Rect[];
|
|
249
|
+
ruleBoxes: Rect[];
|
|
207
250
|
logo: Rect | null;
|
|
208
251
|
backdrop: Rect | null;
|
|
209
252
|
}
|
|
@@ -217,6 +260,10 @@ interface Palette {
|
|
|
217
260
|
card: string;
|
|
218
261
|
arch: string;
|
|
219
262
|
sky?: readonly SkyStop[];
|
|
263
|
+
script?: string;
|
|
264
|
+
icon?: string;
|
|
265
|
+
rule?: string;
|
|
266
|
+
brush?: readonly string[];
|
|
220
267
|
}
|
|
221
268
|
/** One gradient stop of a horizon sky: offset 0 (top) to 1 (bottom) and its colour. */
|
|
222
269
|
type SkyStop = readonly [number, string];
|
|
@@ -280,4 +327,4 @@ declare function defaultLayoutFor(format: FormatId): LayoutId;
|
|
|
280
327
|
declare const kizombaWorkshop: FlierDoc;
|
|
281
328
|
declare const kizombaWorkshopDocs: FlierDoc[];
|
|
282
329
|
|
|
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 };
|
|
330
|
+
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 };
|