@treasure-ai/treasure-deck 2026.11.1 → 2026.11.3

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.
Files changed (47) hide show
  1. package/dist/build.js +3 -1
  2. package/dist/build.js.map +1 -1
  3. package/dist/cli.js +64 -42
  4. package/dist/cli.js.map +1 -1
  5. package/dist/deckstyle.d.ts +16 -2
  6. package/dist/deckstyle.js +232 -44
  7. package/dist/deckstyle.js.map +1 -1
  8. package/dist/dev.d.ts +6 -0
  9. package/dist/dev.js +36 -1
  10. package/dist/dev.js.map +1 -1
  11. package/dist/host.d.ts +18 -0
  12. package/dist/host.js +28 -1
  13. package/dist/host.js.map +1 -1
  14. package/dist/import.d.ts +5 -1
  15. package/dist/import.js +9 -2
  16. package/dist/import.js.map +1 -1
  17. package/dist/parse.d.ts +6 -0
  18. package/dist/parse.js +15 -0
  19. package/dist/parse.js.map +1 -1
  20. package/dist/render.d.ts +1 -1
  21. package/dist/render.js +7 -3
  22. package/dist/render.js.map +1 -1
  23. package/dist/slides.d.ts +8 -2
  24. package/dist/slides.js +8 -3
  25. package/dist/slides.js.map +1 -1
  26. package/dist/slidesexport.d.ts +38 -0
  27. package/dist/slidesexport.js +51 -0
  28. package/dist/slidesexport.js.map +1 -0
  29. package/dist/slideslayout.d.ts +1 -5
  30. package/dist/slideslayout.js +148 -37
  31. package/dist/slideslayout.js.map +1 -1
  32. package/dist/themecheck.d.ts +1 -1
  33. package/docs/commands.md +5 -2
  34. package/docs/editor.md +21 -3
  35. package/docs/syntax.md +4 -1
  36. package/docs/themes.md +1 -0
  37. package/package.json +1 -1
  38. package/runtime/base.css +12 -8
  39. package/runtime/edit-core.cjs +58 -0
  40. package/runtime/embed.js +365 -54
  41. package/skills/treasure-deck/SKILL.md +3 -3
  42. package/templates/specimen/specimen.md +2 -0
  43. package/themes/editorial/theme.css +1 -1
  44. package/themes/gold/theme.css +2 -2
  45. package/themes/treasure-ai/theme.css +2 -2
  46. package/themes/treasure-ai-2026/theme.css +4 -4
  47. package/themes/wvlet/theme.css +2 -2
package/docs/themes.md CHANGED
@@ -55,6 +55,7 @@ A theme sets a few **seed** colors on `.slide` (and again for dark slides): `--d
55
55
  | `--deck-diagram-<role>-fill/-fill-2/-text` for `accent`, `dark`, `muted`, `light` | Diagram nodes with `:::role` |
56
56
  | `--code-comment/-keyword/-string/-number/-title/-type/-variable/-operator/-meta` on `pre.code` | Code highlighting |
57
57
  | `--deck-scale-*`, `--deck-pad-*` (on `.deck`) | Density: type sizes and margins |
58
+ | `--deck-text-scale` (set by the build) | The deck's `text_size:` as a factor (default 1); multiply a text size a theme sets in px by it, as base.css does for each `--deck-scale-*`, so the text follows |
58
59
  | `--deck-col-rule` | Opt-in divider between columns |
59
60
 
60
61
  A theme must style the four layouts, every semantic class, and the standard Markdown elements (lists, tables, blockquotes, code, images). `:name:` icons and `{.steps}` lists are already styled by base.css from the theme's tokens (accent, chip, on-accent), so a theme only restyles them if it wants to. Beyond that it can do anything CSS allows: generated backgrounds, decorations per layout. Creativity lives in how a theme renders the same four layouts, not in extra layouts, so every deck works under every theme.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasure-ai/treasure-deck",
3
- "version": "2026.11.1",
3
+ "version": "2026.11.3",
4
4
  "description": "Markdown presentations without <div> markup: four layouts, themes, and a single-file HTML output that publishes to Apps Script",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://www.npmjs.com/package/@treasure-ai/treasure-deck",
package/runtime/base.css CHANGED
@@ -21,7 +21,7 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
21
21
  .slide {
22
22
  position: absolute; inset: 0; width: 1280px; height: 720px; overflow: hidden;
23
23
  background: var(--deck-bg); color: var(--deck-fg);
24
- font-family: var(--deck-font-body); font-size: var(--deck-scale-body); line-height: 1.4;
24
+ font-family: var(--deck-font-body); font-size: calc(var(--deck-scale-body) * var(--deck-text-scale, 1)); line-height: 1.4;
25
25
  visibility: hidden; opacity: 0;
26
26
  }
27
27
  .slide.active { visibility: visible; opacity: 1; z-index: 1; }
@@ -87,9 +87,9 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
87
87
  .slide-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
88
88
  .section-num { font-weight: 700; font-size: 150px; line-height: .9; letter-spacing: -.05em; margin-bottom: 12px; }
89
89
 
90
- .slide h1 { font-family: var(--deck-font-display); font-size: var(--deck-scale-h1); line-height: 1.15; margin: 0 0 .55em; }
91
- .slide h2 { font-family: var(--deck-font-display); font-size: var(--deck-scale-h2); line-height: 1.2; margin: .4em 0 .35em; }
92
- .slide h3 { font-size: var(--deck-scale-h3); line-height: 1.25; margin: .5em 0 .25em; }
90
+ .slide h1 { font-family: var(--deck-font-display); font-size: calc(var(--deck-scale-h1) * var(--deck-text-scale, 1)); line-height: 1.15; margin: 0 0 .55em; }
91
+ .slide h2 { font-family: var(--deck-font-display); font-size: calc(var(--deck-scale-h2) * var(--deck-text-scale, 1)); line-height: 1.2; margin: .4em 0 .35em; }
92
+ .slide h3 { font-size: calc(var(--deck-scale-h3) * var(--deck-text-scale, 1)); line-height: 1.25; margin: .5em 0 .25em; }
93
93
  .slide h4 { font-size: 1em; margin: .5em 0 .2em; }
94
94
  .slide p { margin: 0 0 .5em; }
95
95
  .slide-body ul, .slide-body ol { margin: 0 0 .5em; padding-left: 1.2em; }
@@ -103,15 +103,18 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
103
103
  .slide th { padding-top: .5em; padding-bottom: .5em; }
104
104
  /* Table options: `{nowrap}` on the table or a header cell (its column) keeps cells on one line; `{wrap}` undoes it for a column or cell. */
105
105
  .slide :is(table.nowrap :is(th, td), th.nowrap, td.nowrap) { white-space: nowrap; }
106
+ /* `{center}` or `{right}` on a table places it in its column, as on an image. */
107
+ .slide table.table-center { margin-left: auto; margin-right: auto; }
108
+ .slide table.table-right { margin-left: auto; margin-right: 0; }
106
109
  .slide table :is(th, td).wrap { white-space: normal; }
107
110
  /* Lines are blocks carrying the horizontal padding, so a highlighted band and its edge bar span the panel with no seams. */
108
- .slide pre.code { margin: 0 0 .6em; padding: 14px 0; overflow: hidden; font-family: var(--deck-font-mono); font-size: var(--deck-scale-code); line-height: 1.45; }
111
+ .slide pre.code { margin: 0 0 .6em; padding: 14px 0; overflow: hidden; font-family: var(--deck-font-mono); font-size: calc(var(--deck-scale-code) * var(--deck-text-scale, 1)); line-height: 1.45; }
109
112
  .slide pre.code .line { display: block; padding: 0 18px; }
110
113
  .slide pre.code.has-line-hl .line:not(.line-hl) { opacity: .45; }
111
114
  .slide code { font-family: var(--deck-font-mono); font-size: .9em; }
112
115
  /* Show code as typed: no programming ligatures (JetBrains Mono would draw `===` or `->` as single glyphs). */
113
116
  .slide :is(code, pre) { font-variant-ligatures: none; font-feature-settings: 'calt' 0, 'liga' 0; }
114
- .slide .slide-content:has(> pre.code:only-child) pre.code { font-size: var(--deck-scale-code-solo); }
117
+ .slide .slide-content:has(> pre.code:only-child) pre.code { font-size: calc(var(--deck-scale-code-solo) * var(--deck-text-scale, 1)); }
115
118
 
116
119
  /* Syntax highlighting: highlight.js scopes (added at build time), colored by --code-* tokens.
117
120
  The defaults suit a light code panel; themes with dark panels override the tokens on pre.code. */
@@ -159,8 +162,8 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
159
162
  /* Layouts */
160
163
  .layout-title .slide-body, .layout-section .slide-body { justify-content: center; }
161
164
  .layout-title .slide-body { align-items: flex-start; }
162
- .layout-title h1 { font-size: var(--deck-scale-title); }
163
- .layout-section h1, .layout-section h2 { font-size: var(--deck-scale-section); margin: 0; }
165
+ .layout-title h1 { font-size: calc(var(--deck-scale-title) * var(--deck-text-scale, 1)); }
166
+ .layout-section h1, .layout-section h2 { font-size: calc(var(--deck-scale-section) * var(--deck-text-scale, 1)); margin: 0; }
164
167
  .layout-columns .cols { display: grid; gap: var(--deck-col-gap); flex: 1; min-height: 0; align-items: start; }
165
168
  .layout-columns .col { min-width: 0; min-height: 0; }
166
169
  /* Rows (=== row): bands of columns stacked top to bottom, each as tall as its content. */
@@ -178,6 +181,7 @@ body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
178
181
 
179
182
  /* Semantic classes: structure only; themes add color and type. */
180
183
  .slide .center { text-align: center; }
184
+ .slide .right { text-align: right; }
181
185
  .slide .lead { font-size: 1.25em; }
182
186
  .slide .small { font-size: .75em; }
183
187
  .slide .del { text-decoration: line-through; }
@@ -295,6 +295,11 @@
295
295
  return m ? m[2].split(/\s+/).filter(function (t) { return t[0] === '.'; }).map(function (t) { return t.slice(1); }) : [];
296
296
  }
297
297
 
298
+ /** A patch that replaces line lineNo with `text`. */
299
+ function replaceLine(lines, lineNo, text) {
300
+ return patch(lines, lineNo, lineNo, text);
301
+ }
302
+
298
303
  /** Set or clear a class in a one-line block's trailing {…}, adding or removing the braces as needed. */
299
304
  function setLineClass(lines, lineNo, cls, on) {
300
305
  var line = lines[lineNo - 1];
@@ -312,6 +317,53 @@
312
317
  return next === line ? null : patch(lines, lineNo, lineNo, next);
313
318
  }
314
319
 
320
+ // A list, table, or quote takes its {…} on a line of its own right after it: the next line, or for a list or table
321
+ // (`apart`) the one after a blank line (a quote's braces there style an empty paragraph). The parser counts braces
322
+ // right under a table, or under a list's last item, as part of the block, so the block's own last line may be them.
323
+ // (Unindented: indented braces belong to a nested list or an item.)
324
+ var BRACES_LINE = /^\{([^{}]*)\}\s*$/;
325
+ function isBracesLine(line) { return BRACES_LINE.test(line || ''); }
326
+ function afterAttrsLine(lines, start, end, apart) {
327
+ if (end > start && BRACES_LINE.test(lines[end - 1] || '')) return end;
328
+ if (BRACES_LINE.test(lines[end] || '')) return end + 1;
329
+ if (apart && end < lines.length && !/\S/.test(lines[end]) && BRACES_LINE.test(lines[end + 1] || '')) return end + 2;
330
+ return 0;
331
+ }
332
+
333
+ /** The attributes on the {…} line after the block at lines start..end (a list, table, or quote; `apart` as above). */
334
+ function afterAttrs(lines, start, end, apart) {
335
+ var at = afterAttrsLine(lines, start, end, apart);
336
+ return at ? BRACES_LINE.exec(lines[at - 1])[1].trim() : '';
337
+ }
338
+
339
+ /** The classes on the {…} line after the block at lines start..end. */
340
+ function afterClasses(lines, start, end, apart) {
341
+ return afterAttrs(lines, start, end, apart).split(/\s+/).filter(function (t) { return t[0] === '.'; }).map(function (t) { return t.slice(1); });
342
+ }
343
+
344
+ /**
345
+ * Change the attributes on the {…} line after the block at lines start..end (a list, table, or quote): `set` keys
346
+ * to values (null takes one out; true or false turns a flag such as `center` on or off), `classes` on or off. The line is added right after the block when there is none,
347
+ * and taken out (with a blank line before it) when its last attribute goes.
348
+ */
349
+ function setAfterAttrs(lines, start, end, set, classes, apart) {
350
+ var at = afterAttrsLine(lines, start, end, apart);
351
+ var was = at ? BRACES_LINE.exec(lines[at - 1])[1].trim() : '', tokens = was;
352
+ Object.keys(set || {}).forEach(function (k) { tokens = typeof set[k] === 'boolean' ? setFlag(tokens, k, set[k]) : setAttr(tokens, k, set[k]); });
353
+ Object.keys(classes || {}).forEach(function (c) { tokens = setFlag(tokens, '.' + c, classes[c]); });
354
+ if (tokens === was) return null;
355
+ if (!at) return { start: end + 1, end: end, expected: '', text: '{' + tokens + '}' };
356
+ if (tokens) return patch(lines, at, at, '{' + tokens + '}');
357
+ return patch(lines, at === end + 2 ? end + 1 : at, at, null);
358
+ }
359
+
360
+ /** Set or clear a class on the {…} line after the block at lines start..end. */
361
+ function setAfterClass(lines, start, end, cls, on, apart) {
362
+ var classes = {};
363
+ classes[cls] = on;
364
+ return setAfterAttrs(lines, start, end, null, classes, apart);
365
+ }
366
+
315
367
  // ![alt](src "title"){attrs}, the path bare or in <…> (which allows spaces)
316
368
  var IMAGE = /!\[(?:[^\]\\]|\\.)*\]\(\s*(?:<([^>\n]*)>|([^\s)]+))(?:\s+(?:"[^"]*"|'[^']*'))?\s*\)(\{[^{}]*\})?/g;
317
369
  // The build reports a path as markdown-it normalized it (percent-encoded); compare both decoded.
@@ -1111,6 +1163,12 @@
1111
1163
  clipMarks: clipMarks,
1112
1164
  lineClasses: lineClasses,
1113
1165
  setLineClass: setLineClass,
1166
+ replaceLine: replaceLine,
1167
+ afterAttrs: afterAttrs,
1168
+ afterClasses: afterClasses,
1169
+ setAfterAttrs: setAfterAttrs,
1170
+ isBracesLine: isBracesLine,
1171
+ setAfterClass: setAfterClass,
1114
1172
  findImage: findImage,
1115
1173
  removeImage: removeImage,
1116
1174
  attrValue: attrValue,