@aivorynet/slaide 1.0.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 +26 -0
- package/LICENSE +201 -0
- package/README.md +87 -0
- package/bin/slaide.js +25 -0
- package/dist/assets.d.ts +10 -0
- package/dist/assets.js +54 -0
- package/dist/assets.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +433 -0
- package/dist/cli.js.map +1 -0
- package/dist/compare/index.d.ts +24 -0
- package/dist/compare/index.js +246 -0
- package/dist/compare/index.js.map +1 -0
- package/dist/compare/ssim.d.ts +2 -0
- package/dist/compare/ssim.js +46 -0
- package/dist/compare/ssim.js.map +1 -0
- package/dist/compiler/chrome.d.ts +7 -0
- package/dist/compiler/chrome.js +94 -0
- package/dist/compiler/chrome.js.map +1 -0
- package/dist/compiler/compile.d.ts +2 -0
- package/dist/compiler/compile.js +432 -0
- package/dist/compiler/compile.js.map +1 -0
- package/dist/compiler/markdown.d.ts +26 -0
- package/dist/compiler/markdown.js +439 -0
- package/dist/compiler/markdown.js.map +1 -0
- package/dist/compiler/tokens.d.ts +13 -0
- package/dist/compiler/tokens.js +127 -0
- package/dist/compiler/tokens.js.map +1 -0
- package/dist/container.d.ts +47 -0
- package/dist/container.js +309 -0
- package/dist/container.js.map +1 -0
- package/dist/engine-entry.d.ts +1 -0
- package/dist/engine-entry.js +71 -0
- package/dist/engine-entry.js.map +1 -0
- package/dist/export-keynote/keynote.d.ts +10 -0
- package/dist/export-keynote/keynote.js +58 -0
- package/dist/export-keynote/keynote.js.map +1 -0
- package/dist/export-pptx/embed-fonts.d.ts +5 -0
- package/dist/export-pptx/embed-fonts.js +159 -0
- package/dist/export-pptx/embed-fonts.js.map +1 -0
- package/dist/export-pptx/inject-anim.d.ts +28 -0
- package/dist/export-pptx/inject-anim.js +150 -0
- package/dist/export-pptx/inject-anim.js.map +1 -0
- package/dist/export-pptx/pptx.d.ts +10 -0
- package/dist/export-pptx/pptx.js +425 -0
- package/dist/export-pptx/pptx.js.map +1 -0
- package/dist/export-pptx/transitions.d.ts +16 -0
- package/dist/export-pptx/transitions.js +82 -0
- package/dist/export-pptx/transitions.js.map +1 -0
- package/dist/import/emit.d.ts +5 -0
- package/dist/import/emit.js +274 -0
- package/dist/import/emit.js.map +1 -0
- package/dist/import/index.d.ts +21 -0
- package/dist/import/index.js +192 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/pptx.d.ts +117 -0
- package/dist/import/pptx.js +1043 -0
- package/dist/import/pptx.js.map +1 -0
- package/dist/import/raster-com.d.ts +27 -0
- package/dist/import/raster-com.js +113 -0
- package/dist/import/raster-com.js.map +1 -0
- package/dist/import/raster-extension.d.ts +35 -0
- package/dist/import/raster-extension.js +27 -0
- package/dist/import/raster-extension.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +174 -0
- package/dist/index.js.map +1 -0
- package/dist/install/detect.d.ts +17 -0
- package/dist/install/detect.js +82 -0
- package/dist/install/detect.js.map +1 -0
- package/dist/install/index.d.ts +20 -0
- package/dist/install/index.js +126 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/registry.d.ts +33 -0
- package/dist/install/registry.js +169 -0
- package/dist/install/registry.js.map +1 -0
- package/dist/install/skills.d.ts +17 -0
- package/dist/install/skills.js +72 -0
- package/dist/install/skills.js.map +1 -0
- package/dist/master-io.d.ts +7 -0
- package/dist/master-io.js +55 -0
- package/dist/master-io.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.js +114 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/optimize/export-optimize.d.ts +21 -0
- package/dist/optimize/export-optimize.js +167 -0
- package/dist/optimize/export-optimize.js.map +1 -0
- package/dist/parser/frontmatter.d.ts +8 -0
- package/dist/parser/frontmatter.js +45 -0
- package/dist/parser/frontmatter.js.map +1 -0
- package/dist/parser/parse.d.ts +2 -0
- package/dist/parser/parse.js +184 -0
- package/dist/parser/parse.js.map +1 -0
- package/dist/render/anim.d.ts +50 -0
- package/dist/render/anim.js +213 -0
- package/dist/render/anim.js.map +1 -0
- package/dist/render/charts.d.ts +3 -0
- package/dist/render/charts.js +171 -0
- package/dist/render/charts.js.map +1 -0
- package/dist/render/css.d.ts +3 -0
- package/dist/render/css.js +183 -0
- package/dist/render/css.js.map +1 -0
- package/dist/render/echarts-lib.generated.d.ts +1 -0
- package/dist/render/echarts-lib.generated.js +7 -0
- package/dist/render/echarts-lib.generated.js.map +1 -0
- package/dist/render/html.d.ts +5 -0
- package/dist/render/html.js +186 -0
- package/dist/render/html.js.map +1 -0
- package/dist/render/inject.d.ts +12 -0
- package/dist/render/inject.js +19 -0
- package/dist/render/inject.js.map +1 -0
- package/dist/render/mermaid-lib.generated.d.ts +1 -0
- package/dist/render/mermaid-lib.generated.js +7 -0
- package/dist/render/mermaid-lib.generated.js.map +1 -0
- package/dist/render/runtime.d.ts +1 -0
- package/dist/render/runtime.js +393 -0
- package/dist/render/runtime.js.map +1 -0
- package/dist/render-pdf/pdf.d.ts +9 -0
- package/dist/render-pdf/pdf.js +53 -0
- package/dist/render-pdf/pdf.js.map +1 -0
- package/dist/render-png/montage.d.ts +14 -0
- package/dist/render-png/montage.js +75 -0
- package/dist/render-png/montage.js.map +1 -0
- package/dist/render-png/shoot.d.ts +25 -0
- package/dist/render-png/shoot.js +79 -0
- package/dist/render-png/shoot.js.map +1 -0
- package/dist/scaffold.d.ts +9 -0
- package/dist/scaffold.js +36 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/types.d.ts +212 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.js +28 -0
- package/dist/util.js.map +1 -0
- package/package.json +66 -0
- package/skills/slaide/SKILL.md +64 -0
- package/skills/slaide/agents/openai.yaml +12 -0
- package/skills/slaide/examples/branded-deck.slaide +198 -0
- package/skills/slaide/examples/branded-theme.slaide.yaml +187 -0
- package/skills/slaide/examples/sample.slaide +98 -0
- package/skills/slaide/reference.md +177 -0
- package/skills/slaide/themes.md +171 -0
- package/themes/aurora.slaide.yaml +136 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { SCHEMA_VERSION } from '../types.js';
|
|
2
|
+
import { resolveColors, resolveFonts, resolveTypeScale, resolveVariant } from './tokens.js';
|
|
3
|
+
import { renderRegion, isKnownColorClass, colorValue } from './markdown.js';
|
|
4
|
+
import { resolveChrome, placeholderCtx, todayFormatted } from './chrome.js';
|
|
5
|
+
import { expandAnchor } from '../util.js';
|
|
6
|
+
import { ENTRANCE_NAMES, SLIDE_TRANSITION_NAMES, entranceCss, isSlideTransition, masterAnimations, slideTransitionCss, } from '../render/anim.js';
|
|
7
|
+
function deriveCanvas(master) {
|
|
8
|
+
const c = master.canvas ?? {};
|
|
9
|
+
const aspect = c.aspect ?? '16:9';
|
|
10
|
+
let width = c.width ?? 1280;
|
|
11
|
+
let height = c.height ?? 0;
|
|
12
|
+
if (!height) {
|
|
13
|
+
const m = aspect.match(/^(\d+):(\d+)$/);
|
|
14
|
+
height = m ? Math.round((width * parseInt(m[2], 10)) / parseInt(m[1], 10)) : 720;
|
|
15
|
+
}
|
|
16
|
+
return { width, height, aspect };
|
|
17
|
+
}
|
|
18
|
+
const VALIGN = { top: 'start', center: 'center', bottom: 'end' };
|
|
19
|
+
const JUSTIFY = { left: 'start', center: 'center', right: 'end' };
|
|
20
|
+
const STYLE_MAP = {
|
|
21
|
+
font: (v) => ['font-family', `var(--font-${v})`],
|
|
22
|
+
bg: (v) => ['background', v],
|
|
23
|
+
size: (v) => ['font-size', v.match(/[\d]/) && /(px|em|rem|%|vw|vh)$/.test(v) ? v : `var(--size-${v})`],
|
|
24
|
+
// Mirror box:/bg: — fall back palette → literal so a palette name (or a raw
|
|
25
|
+
// colour) never resolves to an undefined var() and renders invisible text.
|
|
26
|
+
color: (v) => ['color', colorValue(v)],
|
|
27
|
+
fill: (v) => ['--region-fill', `var(--gradient-${v})`], // gradient text fill (see CSS .sl-region[style*="--region-fill"])
|
|
28
|
+
align: (v) => ['text-align', v],
|
|
29
|
+
valign: (v) => ['align-self', VALIGN[v] ?? v], // vertical alignment within the grid cell
|
|
30
|
+
justify: (v) => ['justify-self', JUSTIFY[v] ?? v],
|
|
31
|
+
weight: (v) => ['font-weight', v],
|
|
32
|
+
leading: (v) => ['line-height', v],
|
|
33
|
+
transform: (v) => ['text-transform', v],
|
|
34
|
+
italic: () => ['font-style', 'italic'],
|
|
35
|
+
maxw: (v) => ['max-width', v],
|
|
36
|
+
pad: (v) => ['padding', v], // text-box insets (importer) / explicit padding
|
|
37
|
+
opacity: (v) => ['opacity', v],
|
|
38
|
+
radius: (v) => ['border-radius', v],
|
|
39
|
+
border: (v) => ['border', v],
|
|
40
|
+
rotate: (v) => ['transform', /[a-z(]/i.test(v) ? v : `rotate(${v})`], // shape rotation/flip
|
|
41
|
+
};
|
|
42
|
+
// justify-content for vertically anchored (absolutely positioned) slots, where
|
|
43
|
+
// `align-self` is inert. See mapSlotStyle.
|
|
44
|
+
const VALIGN_FLEX = { top: 'flex-start', center: 'center', bottom: 'flex-end' };
|
|
45
|
+
function mapSlotStyle(style, diag) {
|
|
46
|
+
const out = {};
|
|
47
|
+
if (!style)
|
|
48
|
+
return out;
|
|
49
|
+
const anchored = 'anchor' in style;
|
|
50
|
+
// Warn when a colour/gradient reference names nothing real — it silently falls
|
|
51
|
+
// back to a literal (often invisible). Without this, `validate` says "valid"
|
|
52
|
+
// while the slide renders blank text.
|
|
53
|
+
const warnColor = (raw) => {
|
|
54
|
+
if (diag && !isKnownColorClass(raw, diag.tokens)) {
|
|
55
|
+
diag.warnings.push({
|
|
56
|
+
code: 'unknown-color',
|
|
57
|
+
message: `Slide ${diag.slide}: slot "${diag.slot}" references colour "${raw}" — not a master colour role/palette name or a CSS colour. It falls back to the literal value, which usually renders invisible or wrong.`,
|
|
58
|
+
line: diag.line,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
for (const [k, v] of Object.entries(style)) {
|
|
63
|
+
if (k === 'anchor') {
|
|
64
|
+
// absolutely position the slot region: "x% y% w% h%" of the canvas
|
|
65
|
+
Object.assign(out, expandAnchor(String(v)));
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (k === 'valign' && anchored) {
|
|
69
|
+
// On an absolutely-positioned slot, align-self does nothing. For center/bottom
|
|
70
|
+
// lay the region out as a flex column; top is already block-flow default.
|
|
71
|
+
const j = VALIGN_FLEX[String(v)] ?? String(v);
|
|
72
|
+
if (j && j !== 'flex-start') {
|
|
73
|
+
out['display'] = 'flex';
|
|
74
|
+
out['flex-direction'] = 'column';
|
|
75
|
+
out['justify-content'] = j;
|
|
76
|
+
}
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (k === 'box') {
|
|
80
|
+
// surface panel: background + padding + radius (e.g. closing card, callouts).
|
|
81
|
+
// Accepts `true` (surface role), a colour role/palette name, a raw hex/CSS colour,
|
|
82
|
+
// a **named master gradient** (e.g. box: brand), or a raw gradient literal — so a
|
|
83
|
+
// padded, rounded, gradient hero/closing panel is possible.
|
|
84
|
+
const raw = typeof v === 'string' && v !== 'true' ? v : '';
|
|
85
|
+
if (raw && diag?.tokens[`--gradient-${raw}`] !== undefined) {
|
|
86
|
+
out['background'] = `var(--gradient-${raw})`; // named master gradient
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// Warn only on a bare name (typo guard); a hex/`rgb()`/`gradient()` literal is fine.
|
|
90
|
+
if (raw && !raw.includes('('))
|
|
91
|
+
warnColor(raw);
|
|
92
|
+
out['background'] = colorValue(raw || 'surface');
|
|
93
|
+
}
|
|
94
|
+
out['padding'] = '1.4em 2em';
|
|
95
|
+
out['border-radius'] = '16px';
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (k === 'fill' && diag && diag.tokens[`--gradient-${v}`] === undefined) {
|
|
99
|
+
diag.warnings.push({
|
|
100
|
+
code: 'unknown-gradient',
|
|
101
|
+
message: `Slide ${diag.slide}: slot "${diag.slot}" fill: "${v}" is not a master gradient — the text gets no fill (often invisible).`,
|
|
102
|
+
line: diag.line,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const fn = STYLE_MAP[k];
|
|
106
|
+
if (fn) {
|
|
107
|
+
if (k === 'color')
|
|
108
|
+
warnColor(String(v));
|
|
109
|
+
const [prop, val] = fn(String(v));
|
|
110
|
+
out[prop] = val;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
// ---- contrast lint --------------------------------------------------------
|
|
116
|
+
// Catch dark-on-dark / light-on-light text that `validate` would otherwise pass:
|
|
117
|
+
// a layout's background and its slots' text colour are resolved independently, so a
|
|
118
|
+
// dark-background layout whose slots use default (light-variant) roles renders
|
|
119
|
+
// invisible. We compare each text slot's resolved colour against its background.
|
|
120
|
+
const TEXT_ROLE_BY_TYPE = {
|
|
121
|
+
title: 'heading',
|
|
122
|
+
subtitle: 'heading',
|
|
123
|
+
quote: 'heading',
|
|
124
|
+
caption: 'muted',
|
|
125
|
+
};
|
|
126
|
+
const CONTRAST_MIN = 2.5; // below this, text is effectively unreadable (not merely muted)
|
|
127
|
+
function firstHex(s) {
|
|
128
|
+
const m = s?.match(/#[0-9a-fA-F]{3,8}/);
|
|
129
|
+
return m ? m[0] : null;
|
|
130
|
+
}
|
|
131
|
+
function relLum(hex) {
|
|
132
|
+
let h = hex.replace(/^#/, '');
|
|
133
|
+
if (h.length === 3)
|
|
134
|
+
h = h.split('').map((c) => c + c).join('');
|
|
135
|
+
if (h.length < 6)
|
|
136
|
+
return null;
|
|
137
|
+
const n = parseInt(h.slice(0, 6), 16);
|
|
138
|
+
if (Number.isNaN(n))
|
|
139
|
+
return null;
|
|
140
|
+
const lin = [(n >> 16) & 255, (n >> 8) & 255, n & 255].map((v) => {
|
|
141
|
+
const s = v / 255;
|
|
142
|
+
return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
143
|
+
});
|
|
144
|
+
return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
|
|
145
|
+
}
|
|
146
|
+
function contrastRatio(a, b) {
|
|
147
|
+
const la = relLum(a);
|
|
148
|
+
const lb = relLum(b);
|
|
149
|
+
if (la === null || lb === null)
|
|
150
|
+
return null;
|
|
151
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
152
|
+
}
|
|
153
|
+
/** Resolve a colour value (hex / role / palette / var(--color-x)) to a hex, or null. */
|
|
154
|
+
function colorToHex(raw, tokens) {
|
|
155
|
+
if (!raw)
|
|
156
|
+
return null;
|
|
157
|
+
const v = raw.trim();
|
|
158
|
+
if (/^#[0-9a-fA-F]{3,8}$/.test(v))
|
|
159
|
+
return v;
|
|
160
|
+
const name = (v.match(/--(?:color|palette)-([\w-]+)/)?.[1]) ?? (/^[\w-]+$/.test(v) ? v : null);
|
|
161
|
+
if (name) {
|
|
162
|
+
const t = tokens[`--color-${name}`] ?? tokens[`--palette-${name}`];
|
|
163
|
+
if (t)
|
|
164
|
+
return firstHex(t) ?? (/^#[0-9a-fA-F]{3,8}$/.test(t.trim()) ? t.trim() : null);
|
|
165
|
+
}
|
|
166
|
+
return firstHex(v);
|
|
167
|
+
}
|
|
168
|
+
/** Candidate background colours for a slide (gradient → every stop). [] if unknowable. */
|
|
169
|
+
function bgHexes(bg, tokens) {
|
|
170
|
+
if (!bg) {
|
|
171
|
+
const h = colorToHex(tokens['--color-background'], tokens);
|
|
172
|
+
return h ? [h] : [];
|
|
173
|
+
}
|
|
174
|
+
if (bg.type === 'image')
|
|
175
|
+
return []; // can't assess a photo background
|
|
176
|
+
if (bg.type === 'solid') {
|
|
177
|
+
const h = colorToHex(bg.color, tokens);
|
|
178
|
+
return h ? [h] : [];
|
|
179
|
+
}
|
|
180
|
+
return bg.stops.map((s) => firstHex(s)).filter((h) => !!h);
|
|
181
|
+
}
|
|
182
|
+
/** Candidate hexes for a slot surface value (box:/bg:). A named/literal gradient
|
|
183
|
+
* contributes every stop (worst-case checked); a solid value its single colour. */
|
|
184
|
+
function surfaceHexes(surface, tokens) {
|
|
185
|
+
const grad = tokens[`--gradient-${surface}`] ?? (surface.includes('gradient(') ? surface : undefined);
|
|
186
|
+
if (grad)
|
|
187
|
+
return [...grad.matchAll(/#[0-9a-fA-F]{3,8}/g)].map((m) => m[0]);
|
|
188
|
+
const h = colorToHex(surface, tokens);
|
|
189
|
+
return h ? [h] : [];
|
|
190
|
+
}
|
|
191
|
+
/** Worst-case text/background contrast for a text-bearing slot, or null if unknowable. */
|
|
192
|
+
function slotContrast(slot, bg, tokens) {
|
|
193
|
+
if (slot.type === 'image' || slot.type === 'media' || slot.type === 'free')
|
|
194
|
+
return null;
|
|
195
|
+
const txt = colorToHex(slot.style?.color ?? `--color-${TEXT_ROLE_BY_TYPE[slot.type] ?? 'text'}`, tokens);
|
|
196
|
+
// A slot's own surface (box: <role|gradient>/bg: <colour>) overrides the slide background
|
|
197
|
+
// for contrast purposes — a dark panel on a light slide is perfectly readable.
|
|
198
|
+
const surface = slot.style?.box ?? slot.style?.bg;
|
|
199
|
+
if (txt && typeof surface === 'string' && surface !== 'true') {
|
|
200
|
+
const surfCands = surfaceHexes(surface, tokens);
|
|
201
|
+
if (surfCands.length) {
|
|
202
|
+
let w = Infinity;
|
|
203
|
+
for (const c of surfCands) {
|
|
204
|
+
const r = contrastRatio(c, txt);
|
|
205
|
+
if (r !== null)
|
|
206
|
+
w = Math.min(w, r);
|
|
207
|
+
}
|
|
208
|
+
if (w !== Infinity)
|
|
209
|
+
return w;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const cands = bgHexes(bg, tokens);
|
|
213
|
+
if (!txt || !cands.length)
|
|
214
|
+
return null;
|
|
215
|
+
let worst = Infinity;
|
|
216
|
+
for (const c of cands) {
|
|
217
|
+
const r = contrastRatio(c, txt);
|
|
218
|
+
if (r !== null)
|
|
219
|
+
worst = Math.min(worst, r);
|
|
220
|
+
}
|
|
221
|
+
return worst === Infinity ? null : worst;
|
|
222
|
+
}
|
|
223
|
+
function normalizeAreas(areas) {
|
|
224
|
+
// Single-quote each row so the value is safe inside a double-quoted HTML
|
|
225
|
+
// style attribute (CSS accepts single-quoted strings).
|
|
226
|
+
return areas.map((row) => `'${String(row).replace(/['"]/g, '').trim()}'`).join(' ');
|
|
227
|
+
}
|
|
228
|
+
const FALLBACK_LAYOUT = {
|
|
229
|
+
areas: ['default'],
|
|
230
|
+
slots: { default: { type: 'body' } },
|
|
231
|
+
};
|
|
232
|
+
function asString(v) {
|
|
233
|
+
return typeof v === 'string' ? v : undefined;
|
|
234
|
+
}
|
|
235
|
+
export function compile(parsed, master) {
|
|
236
|
+
const warnings = [...parsed.warnings];
|
|
237
|
+
const canvas = deriveCanvas(master);
|
|
238
|
+
const colorTokens = resolveColors(master.colors, warnings);
|
|
239
|
+
const typeTokens = resolveTypeScale(master.typeScale);
|
|
240
|
+
const { tokens: fontTokens, imports: fontImports } = resolveFonts(master.fonts, warnings);
|
|
241
|
+
const gradientTokens = {};
|
|
242
|
+
for (const [k, v] of Object.entries(master.gradients ?? {}))
|
|
243
|
+
gradientTokens[`--gradient-${k}`] = v;
|
|
244
|
+
const tokens = {
|
|
245
|
+
'--canvas-w': `${canvas.width}px`,
|
|
246
|
+
'--canvas-h': `${canvas.height}px`,
|
|
247
|
+
'--slide-padding': '6%',
|
|
248
|
+
'--slide-gap': '0.8em',
|
|
249
|
+
...colorTokens,
|
|
250
|
+
...typeTokens,
|
|
251
|
+
...fontTokens,
|
|
252
|
+
...gradientTokens,
|
|
253
|
+
...(master.tokens ?? {}), // master overrides (spacing, chrome metrics, …)
|
|
254
|
+
};
|
|
255
|
+
const today = todayFormatted();
|
|
256
|
+
const totalSlides = parsed.slides.length;
|
|
257
|
+
const transitions = {
|
|
258
|
+
default: master.transitions?.default ?? 'fade',
|
|
259
|
+
duration: master.transitions?.duration ?? 400,
|
|
260
|
+
};
|
|
261
|
+
// A master-wide default easing maps to a root --transition-ease token.
|
|
262
|
+
if (master.transitions?.ease)
|
|
263
|
+
tokens['--transition-ease'] = master.transitions.ease;
|
|
264
|
+
// The on-screen position indicator (progress bar + counter) is on by default; a master
|
|
265
|
+
// can switch it off (`ui: { progress: false }`), and deck headmatter `progress:` wins
|
|
266
|
+
// over the master. Web runtime only — print/PDF never render these elements.
|
|
267
|
+
const hmProgress = parsed.headmatter.progress;
|
|
268
|
+
const ui = {
|
|
269
|
+
progress: typeof hmProgress === 'boolean' ? hmProgress : master.ui?.progress !== false,
|
|
270
|
+
};
|
|
271
|
+
// Merge master-defined custom animations into the catalog vocabulary so they
|
|
272
|
+
// validate as known names; their CSS rides on DeckIR.animCss.
|
|
273
|
+
const custom = masterAnimations(master.animations);
|
|
274
|
+
for (const w of custom.warnings)
|
|
275
|
+
warnings.push({ code: 'bad-animation', message: w });
|
|
276
|
+
const animCss = slideTransitionCss(custom.slides) + '\n' + entranceCss(custom.entrances);
|
|
277
|
+
const customTransitions = new Set(Object.keys(custom.slides));
|
|
278
|
+
const validEntrances = new Set([...ENTRANCE_NAMES, ...Object.keys(custom.entrances)]);
|
|
279
|
+
const layoutNames = Object.keys(master.layouts ?? {});
|
|
280
|
+
const firstLayout = layoutNames[0] ?? 'blank';
|
|
281
|
+
// Cascade state: keys set with `~` prefix persist to following slides.
|
|
282
|
+
// Seed from deck headmatter `~` keys (deck-wide defaults).
|
|
283
|
+
const cascaded = {};
|
|
284
|
+
for (const [k, v] of Object.entries(parsed.headmatter)) {
|
|
285
|
+
if (k.startsWith('~'))
|
|
286
|
+
cascaded[k.slice(1)] = v;
|
|
287
|
+
}
|
|
288
|
+
const slides = [];
|
|
289
|
+
parsed.slides.forEach((pslide, i) => {
|
|
290
|
+
const scoped = {};
|
|
291
|
+
for (const [k, v] of Object.entries(pslide.frontmatter)) {
|
|
292
|
+
if (k.startsWith('~'))
|
|
293
|
+
cascaded[k.slice(1)] = v;
|
|
294
|
+
else
|
|
295
|
+
scoped[k] = v;
|
|
296
|
+
}
|
|
297
|
+
const eff = { ...cascaded, ...scoped };
|
|
298
|
+
const layoutName = asString(eff.layout) ?? firstLayout;
|
|
299
|
+
const layoutDef = master.layouts?.[layoutName] ?? FALLBACK_LAYOUT;
|
|
300
|
+
if (!master.layouts?.[layoutName]) {
|
|
301
|
+
warnings.push({
|
|
302
|
+
code: 'unknown-layout',
|
|
303
|
+
message: `Slide ${i + 1}: unknown layout "${layoutName}", using fallback.`,
|
|
304
|
+
line: pslide.sourceLine,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
const transition = asString(eff.transition) ?? transitions.default;
|
|
308
|
+
if (!isSlideTransition(transition) && !customTransitions.has(transition)) {
|
|
309
|
+
warnings.push({
|
|
310
|
+
code: 'unknown-transition',
|
|
311
|
+
message: `Slide ${i + 1}: unknown transition "${transition}". Valid: ${[...SLIDE_TRANSITION_NAMES, ...customTransitions].join(', ')}.`,
|
|
312
|
+
line: pslide.sourceLine,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
// Background (slide override > layout default).
|
|
316
|
+
const bgName = asString(eff.background) ?? layoutDef.background;
|
|
317
|
+
let background = null;
|
|
318
|
+
if (bgName) {
|
|
319
|
+
background = master.backgrounds?.[bgName] ?? null;
|
|
320
|
+
if (!background) {
|
|
321
|
+
warnings.push({
|
|
322
|
+
code: 'unknown-background',
|
|
323
|
+
message: `Slide ${i + 1}: unknown background "${bgName}".`,
|
|
324
|
+
line: pslide.sourceLine,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// Variant overrides (scoped to this slide) + per-slide animation timing.
|
|
329
|
+
// A slide's `variant:` wins; otherwise a layout may bind its own variant, so a
|
|
330
|
+
// dark layout's slots resolve light roles automatically (no dark-on-dark trap).
|
|
331
|
+
const variantName = asString(eff.variant) ?? asString(layoutDef.variant);
|
|
332
|
+
const vars = variantName ? resolveVariant(master, variantName, warnings) : {};
|
|
333
|
+
const tms = eff['transition-ms'];
|
|
334
|
+
if (tms !== undefined)
|
|
335
|
+
vars['--transition-ms'] = /^[\d.]+$/.test(String(tms)) ? `${tms}ms` : String(tms);
|
|
336
|
+
const tease = asString(eff['transition-ease']);
|
|
337
|
+
if (tease)
|
|
338
|
+
vars['--transition-ease'] = tease;
|
|
339
|
+
const morph = asString(eff.morph) ?? null;
|
|
340
|
+
// Grid from layout.
|
|
341
|
+
const rowCount = layoutDef.areas.length;
|
|
342
|
+
const grid = {
|
|
343
|
+
areas: normalizeAreas(layoutDef.areas),
|
|
344
|
+
rows: layoutDef.rows ?? Array(rowCount).fill('auto').join(' '),
|
|
345
|
+
cols: layoutDef.cols ?? '1fr',
|
|
346
|
+
padding: layoutDef.padding ?? 'var(--slide-padding)',
|
|
347
|
+
gap: layoutDef.gap ?? 'var(--slide-gap)',
|
|
348
|
+
align: layoutDef.align ?? 'start',
|
|
349
|
+
};
|
|
350
|
+
// Effective colour tokens for this slide (base + variant) — used by the contrast lint.
|
|
351
|
+
const slideTokens = { ...tokens, ...vars };
|
|
352
|
+
// Route regions into slots.
|
|
353
|
+
const slotNames = Object.keys(layoutDef.slots);
|
|
354
|
+
const primarySlot = layoutDef.slots['body'] ? 'body' : slotNames[0] ?? 'default';
|
|
355
|
+
const counter = { n: 0 };
|
|
356
|
+
const regions = [];
|
|
357
|
+
for (const region of pslide.regions) {
|
|
358
|
+
const target = region.name === 'default' ? primarySlot : region.name;
|
|
359
|
+
// `free` is a built-in, layout-independent full-slide layer for absolutely
|
|
360
|
+
// positioned shapes/boxes (placed in the source). Always accepted.
|
|
361
|
+
const slot = target === 'free' ? { type: 'free' } : layoutDef.slots[target];
|
|
362
|
+
if (!slot) {
|
|
363
|
+
// Always warn on a misrouted region — content silently disappears otherwise,
|
|
364
|
+
// and an empty `:: typo ::` is just as likely a mistake the author should see.
|
|
365
|
+
const has = region.markdown.trim() !== '';
|
|
366
|
+
const slotList = Object.keys(layoutDef.slots).join(', ') || '(none)';
|
|
367
|
+
warnings.push({
|
|
368
|
+
code: 'unknown-slot',
|
|
369
|
+
message: `Slide ${i + 1}: layout "${layoutName}" has no slot "${target}"${has ? ' — its content is dropped' : ''}. Available slots: ${slotList}.`,
|
|
370
|
+
line: pslide.sourceLine,
|
|
371
|
+
});
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
const { html } = renderRegion(region.markdown, counter, tokens, warnings, pslide.sourceLine, validEntrances);
|
|
375
|
+
if (html.trim() === '')
|
|
376
|
+
continue;
|
|
377
|
+
regions.push({
|
|
378
|
+
name: target,
|
|
379
|
+
source: region.name, // original parsed region name (source-provenance; the slot name may differ for `default`)
|
|
380
|
+
html,
|
|
381
|
+
slotType: slot.type,
|
|
382
|
+
style: mapSlotStyle(slot.style, { tokens, warnings, line: pslide.sourceLine, slide: i + 1, slot: target }),
|
|
383
|
+
});
|
|
384
|
+
// Contrast lint: text that resolves close to its background renders unreadable
|
|
385
|
+
// but `validate` can't see it — flag it so the agent doesn't ship invisible slides.
|
|
386
|
+
const cr = slotContrast(slot, background, slideTokens);
|
|
387
|
+
if (cr !== null && cr < CONTRAST_MIN) {
|
|
388
|
+
warnings.push({
|
|
389
|
+
code: 'low-contrast',
|
|
390
|
+
message: `Slide ${i + 1}: slot "${target}" text has low contrast against its background (${cr.toFixed(1)}:1) — likely hard to read or invisible. Set the slot's colour, bind a variant on the layout, or change the background.`,
|
|
391
|
+
line: pslide.sourceLine,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
// Resolve chrome (header/footer/logo) with placeholders for this slide.
|
|
396
|
+
const headingMatch = pslide.regions.map((r) => r.markdown).join('\n').match(/^#{1,6}\s+(.+)$/m);
|
|
397
|
+
const slideTitle = headingMatch ? headingMatch[1].replace(/[*_`]/g, '').trim() : null;
|
|
398
|
+
const ctx = placeholderCtx(parsed.headmatter, eff, i + 1, totalSlides, slideTitle, today);
|
|
399
|
+
const chrome = resolveChrome(master, layoutDef, eff, ctx, warnings);
|
|
400
|
+
slides.push({
|
|
401
|
+
index: i,
|
|
402
|
+
layout: layoutName,
|
|
403
|
+
transition,
|
|
404
|
+
background,
|
|
405
|
+
bgName: bgName ?? null,
|
|
406
|
+
variantName: variantName ?? null,
|
|
407
|
+
grid,
|
|
408
|
+
regions,
|
|
409
|
+
notes: pslide.notes,
|
|
410
|
+
buildCount: counter.n,
|
|
411
|
+
morph,
|
|
412
|
+
vars,
|
|
413
|
+
chrome,
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
return {
|
|
417
|
+
schema: SCHEMA_VERSION,
|
|
418
|
+
meta: {
|
|
419
|
+
title: asString(parsed.headmatter.title) ?? null,
|
|
420
|
+
author: asString(parsed.headmatter.author) ?? null,
|
|
421
|
+
},
|
|
422
|
+
canvas,
|
|
423
|
+
tokens,
|
|
424
|
+
fontImports,
|
|
425
|
+
transitions,
|
|
426
|
+
animCss,
|
|
427
|
+
ui,
|
|
428
|
+
slides,
|
|
429
|
+
warnings,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/compiler/compile.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,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E,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEpE,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,UAAU;YAClB,UAAU;YACV,UAAU;YACV,MAAM,EAAE,MAAM,IAAI,IAAI;YACtB,WAAW,EAAE,WAAW,IAAI,IAAI;YAChC,IAAI;YACJ,OAAO;YACP,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,UAAU,EAAE,OAAO,CAAC,CAAC;YACrB,KAAK;YACL,IAAI;YACJ,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,EAAE,cAAc;QACtB,IAAI,EAAE;YACJ,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI;YAChD,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI;SACnD;QACD,MAAM;QACN,MAAM;QACN,WAAW;QACX,WAAW;QACX,OAAO;QACP,EAAE;QACF,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import MarkdownIt from 'markdown-it';
|
|
2
|
+
import type { Warning } from '../types.js';
|
|
3
|
+
/** A `[text]{.X}` colour class is legitimate if X is a master role/palette token or a
|
|
4
|
+
* CSS colour; otherwise it's almost certainly a typo (e.g. `.xxlarge`, `.gradd`).
|
|
5
|
+
* Exported so slot-style `color:`/`box:` resolution can warn on the same basis. */
|
|
6
|
+
export declare function isKnownColorClass(c: string, tokens: Record<string, string>): boolean;
|
|
7
|
+
/** CSS for a colour value used by slot `color:`/`box:` and inline `.colour` spans. A bare
|
|
8
|
+
* role/palette name resolves through the master tokens (with a literal fallback so CSS
|
|
9
|
+
* named colours like `tomato` still work); anything that can't be a custom-property name
|
|
10
|
+
* — a hex (`#0af`), `rgb()/hsl()`, etc. — is emitted directly. Wrapping a hex as
|
|
11
|
+
* `var(--color-#0af, …)` is invalid CSS: the whole declaration is dropped and the text
|
|
12
|
+
* silently reverts to the inherited role (often dark-on-dark). A hex is a supported
|
|
13
|
+
* escape hatch; prefer palette names so the deck stays on-theme. */
|
|
14
|
+
export declare function colorValue(v: string): string;
|
|
15
|
+
declare const md: MarkdownIt;
|
|
16
|
+
export interface BuildCounter {
|
|
17
|
+
n: number;
|
|
18
|
+
}
|
|
19
|
+
/** Render one region's markdown to HTML, assigning absolute build indices.
|
|
20
|
+
* `warnings` (if provided) collects authoring diagnostics (unknown inline classes
|
|
21
|
+
* etc.) with the slide's `line` for self-correction. */
|
|
22
|
+
export declare function renderRegion(markdown: string, counter: BuildCounter, tokens?: Record<string, string>, warnings?: Warning[], line?: number, validEntrances?: Set<string>): {
|
|
23
|
+
html: string;
|
|
24
|
+
builds: number;
|
|
25
|
+
};
|
|
26
|
+
export { md };
|