@treasure-ai/treasure-deck 2026.10.7 → 2026.10.8
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/README.md +10 -9
- package/dist/chrome.d.ts +10 -1
- package/dist/chrome.js +88 -13
- package/dist/chrome.js.map +1 -1
- package/dist/dev.js +5 -11
- package/dist/dev.js.map +1 -1
- package/dist/diagrams.js +2 -2
- package/dist/diagrams.js.map +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js +1 -1
- package/dist/update.d.ts +7 -0
- package/dist/update.js +17 -5
- package/dist/update.js.map +1 -1
- package/dist/vendor.d.ts +13 -0
- package/dist/vendor.js +46 -0
- package/dist/vendor.js.map +1 -0
- package/docs/commands.md +3 -3
- package/docs/editor.md +3 -3
- package/docs/syntax.md +2 -2
- package/docs/themes.md +1 -1
- package/package.json +5 -6
- package/runtime/edit-core.cjs +236 -1
- package/runtime/embed.js +66 -151
- package/vendor/lucide/LICENSE +43 -0
- package/vendor/lucide/align-center.svg +17 -0
- package/vendor/lucide/align-left.svg +17 -0
- package/vendor/lucide/align-right.svg +17 -0
- package/vendor/lucide/arrow-down.svg +16 -0
- package/vendor/lucide/arrow-up.svg +16 -0
- package/vendor/lucide/bold.svg +15 -0
- package/vendor/lucide/chevron-down.svg +15 -0
- package/vendor/lucide/clipboard-paste.svg +19 -0
- package/vendor/lucide/code.svg +16 -0
- package/vendor/lucide/copy-plus.svg +18 -0
- package/vendor/lucide/copy.svg +16 -0
- package/vendor/lucide/external-link.svg +17 -0
- package/vendor/lucide/eye-off.svg +18 -0
- package/vendor/lucide/eye.svg +16 -0
- package/vendor/lucide/file-code.svg +18 -0
- package/vendor/lucide/heading-1.svg +18 -0
- package/vendor/lucide/heading-2.svg +18 -0
- package/vendor/lucide/heading-3.svg +19 -0
- package/vendor/lucide/highlighter.svg +16 -0
- package/vendor/lucide/italic.svg +17 -0
- package/vendor/lucide/layers.svg +17 -0
- package/vendor/lucide/link.svg +16 -0
- package/vendor/lucide/list-ordered.svg +20 -0
- package/vendor/lucide/list.svg +20 -0
- package/vendor/lucide/pilcrow.svg +17 -0
- package/vendor/lucide/pin-off.svg +18 -0
- package/vendor/lucide/play.svg +15 -0
- package/vendor/lucide/plus.svg +16 -0
- package/vendor/lucide/presentation.svg +17 -0
- package/vendor/lucide/quote.svg +16 -0
- package/vendor/lucide/redo-2.svg +16 -0
- package/vendor/lucide/repeat.svg +18 -0
- package/vendor/lucide/scissors.svg +19 -0
- package/vendor/lucide/settings.svg +16 -0
- package/vendor/lucide/sliders-horizontal.svg +23 -0
- package/vendor/lucide/square-round-corner.svg +16 -0
- package/vendor/lucide/square.svg +15 -0
- package/vendor/lucide/strikethrough.svg +17 -0
- package/vendor/lucide/trash-2.svg +19 -0
- package/vendor/lucide/undo-2.svg +16 -0
- package/vendor/mermaid/LICENSE +21 -0
- package/vendor/mermaid/mermaid.min.js +3636 -0
- package/docs/adrs/2026-10-03-chrome-over-devtools.md +0 -29
- package/docs/adrs/2026-10-03-fixed-canvas.md +0 -25
- package/docs/adrs/2026-10-03-four-layouts-plus-attributes.md +0 -25
- package/docs/adrs/2026-10-03-hybrid-pdf-over-devtools.md +0 -25
- package/docs/adrs/2026-10-03-keyword-lines-and-one-attribute-syntax.md +0 -36
- package/docs/adrs/2026-10-03-one-behavior-instead-of-settings.md +0 -30
- package/docs/adrs/2026-10-03-overflow-is-reported-not-hidden.md +0 -27
- package/docs/adrs/2026-10-03-single-file-html.md +0 -26
- package/docs/adrs/2026-10-03-strict-build-forgiving-preview.md +0 -31
- package/docs/adrs/2026-10-04-edit-in-place-by-alignment.md +0 -28
- package/docs/adrs/2026-10-04-editor-in-the-deck-page.md +0 -31
- package/docs/adrs/2026-10-04-edits-are-line-range-patches.md +0 -35
- package/docs/adrs/2026-10-04-per-slide-hot-swap.md +0 -33
- package/docs/adrs/2026-10-04-theme-colors-derive-in-css.md +0 -32
- package/docs/adrs/2026-10-05-host-owns-undo.md +0 -26
- package/docs/adrs/2026-10-07-anonymous-access-metrics.md +0 -38
- package/docs/adrs/2026-10-14-dev-links-media-by-url.md +0 -25
- package/docs/adrs/2026-10-14-media-dir-for-the-publish-limit.md +0 -28
- package/docs/adrs/2026-10-14-videos-are-inlined-images.md +0 -28
- package/docs/adrs/2026-10-15-public-npm-under-labs-terms.md +0 -37
- package/docs/adrs/2026-10-16-updates-install-after-exit.md +0 -31
- package/docs/adrs/README.md +0 -35
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Headless Chrome is the one renderer, driven over the DevTools protocol
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Several commands need a real browser: pre-rendering Mermaid diagrams at build time, `deck check`'s measurements, `deck pdf`, and `deck theme check`'s contrast sampling. Decks are viewed in Chromium-based browsers and Apps Script, and printed through Chrome.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- Chrome is the one renderer the design targets, so the CSS can use modern color functions, `zoom`, and `:has()`.
|
|
15
|
-
- `src/chrome.ts` finds a local Chrome (`CHROME_PATH` overrides), launches it headless, and drives it over the DevTools protocol with Node's built-in WebSocket: no Puppeteer or Playwright dependency.
|
|
16
|
-
- Pages signal readiness with `window.deckReady` (fonts loaded, diagrams rendered), and commands wait on it rather than on timeouts.
|
|
17
|
-
- When Chrome is missing, `deck build` still works and diagrams fall back to rendering in the browser from jsDelivr.
|
|
18
|
-
|
|
19
|
-
## Consequences
|
|
20
|
-
|
|
21
|
-
- One small driver serves four commands; `withDeckPage` is also how the tests run the editor headlessly.
|
|
22
|
-
- Commands are deterministic: they wait for `deckReady`, not for a time budget.
|
|
23
|
-
- Commands should exit as soon as Chrome does, so agents waiting on `deck check` aren't held by a timer.
|
|
24
|
-
|
|
25
|
-
## Alternatives considered
|
|
26
|
-
|
|
27
|
-
- **Puppeteer or Playwright:** a large dependency and a downloaded browser for what is a few protocol calls.
|
|
28
|
-
- **Chrome's `--print-to-pdf` / `--screenshot` flags:** see [hybrid PDF](2026-10-03-hybrid-pdf-over-devtools.md); without control over when to capture, they print before diagrams render or never exit.
|
|
29
|
-
- **Render CSS colors at build time in Node:** see [theme colors](2026-10-04-theme-colors-derive-in-css.md).
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# A fixed 1280×720 canvas
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
A slide has to look the same in the editor's preview, a browser window of any size, Apps Script's iframe, a phone, and a PDF. Layouts that reflow with the viewport look different on each.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
Slides are always 16:9 and render on a fixed 1280×720 logical canvas, CSS-scaled to the viewport. There is no aspect option. Sizes in the syntax (`w=300`, `h=400`) are canvas px.
|
|
15
|
-
|
|
16
|
-
## Consequences
|
|
17
|
-
|
|
18
|
-
- A layout looks identical everywhere, and `deck check` measures overflow at the real size.
|
|
19
|
-
- The editor writes canvas px when it resizes or moves images, converting from screen px by the slide's zoom.
|
|
20
|
-
- Portrait phones get a vertical scroll of slides instead of a reflow.
|
|
21
|
-
|
|
22
|
-
## Alternatives considered
|
|
23
|
-
|
|
24
|
-
- **1920×1080:** 1280×720 matches Marp's default, so sizes in migrated decks mean the same thing; the canvas is scaled anyway, so resolution is unaffected.
|
|
25
|
-
- **An aspect-ratio setting:** every theme and layout would need checking at each ratio.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Four layouts, and attributes for everything else
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
An early draft had 18 layouts (stats, timeline, cards, agenda, grid, quote, code, …). Each layout is syntax to learn, an inference rule to predict, and styling work in every theme.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
There are four layouts: `content`, `title`, `section`, and `columns [ratio]` (with `=== row` for bands of columns). Other kinds of slide come from attributes and plain Markdown: `{side=right}` on an image makes a split slide, `{bg}` a full-bleed image slide, `{.lead}` or `{.center}` a statement slide, and a column opening with `###` a card. Classes come from a fixed semantic vocabulary that every theme styles.
|
|
15
|
-
|
|
16
|
-
## Consequences
|
|
17
|
-
|
|
18
|
-
- Every deck works under every theme, since a theme only has to style four layouts and a known set of classes. Themes compete on how they render the same layouts.
|
|
19
|
-
- Most of the dropped layouts were a Markdown element a theme can style directly (code, quotes, lists) or something an attribute already covers.
|
|
20
|
-
- A slide that needs a new arrangement asks for an attribute or class, which is reviewed once for all themes.
|
|
21
|
-
|
|
22
|
-
## Alternatives considered
|
|
23
|
-
|
|
24
|
-
- **A rich layout catalog:** see Context. Four layouts plus attributes covered all the existing decks.
|
|
25
|
-
- **A `.takeaway` class pinned to the slide bottom** (replacing a Marp deck's custom div): it split attention between the title and the bottom of the slide, so the title carries the message instead. Using it is a build error.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Hybrid PDF: backgrounds as images, content as vectors
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
A PDF of a deck has to look like the HTML in every viewer, including Apple's (Preview, Quick Look), while text stays sharp and selectable.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
`deck pdf` loads the built page in headless Chrome over the DevTools protocol, waits for `deckReady`, and for each slide screenshots the background layer at 2× with the content hidden (`.deck.is-capture`), installing it as that slide's print background. Text, tables, code, images, and diagrams then print as vectors on top with `Page.printToPDF`, one 1280×720 page per slide. Print CSS removes blurred shadows and filters, freezes animations, and paints table-header gradients as one strip. `--vector` skips the capture.
|
|
15
|
-
|
|
16
|
-
## Consequences
|
|
17
|
-
|
|
18
|
-
- PDFs match the HTML in every viewer, text stays selectable, and files are roughly half the size of pure-vector output (1.4–5.5 MB for the 27-slide tour, down from 7.5–12 MB).
|
|
19
|
-
- A PDF takes a few seconds per deck, since every slide is captured.
|
|
20
|
-
|
|
21
|
-
## Alternatives considered
|
|
22
|
-
|
|
23
|
-
- **Pure vector PDF:** looks right in Chrome's viewer but not in Apple's: blurred shadows become soft-mask images that Quartz draws as dark gray boxes, large translucent gradients band into tiles, and per-cell header gradients show seams.
|
|
24
|
-
- **Chrome `--print-to-pdf` from the command line:** with `--virtual-time-budget` (needed for Mermaid) headless Chrome never exits, because infinite CSS animations keep virtual time from settling; without it, it prints before diagrams render.
|
|
25
|
-
- **Printing from the browser:** kept as a convenience (share panel → Print), but gradients may band.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Slides are divided by keyword lines, styled by one `{…}` syntax
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
The Marp decks this project replaces needed raw HTML for anything beyond one column: one deck had 9 `<div class="columns">` blocks with 18 nested `<div>`s, `<center>` around images, and `<p class="subtitle">` for title styling. That HTML is also what broke Treasure Work's note editor round trip (treasure-work PR #1866). Slides, columns, notes, and styling need a syntax that reads as text, survives other Markdown tools, and can be validated.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- `---` divides the deck into slides; `--- <layout> <args> {attrs}` also sets the next slide's layout and attributes.
|
|
15
|
-
- `===` plus a keyword divides a slide: `=== col`, `=== row`, `=== notes`, with the same `{…}` attributes.
|
|
16
|
-
- Both are lines of their own, split off before Markdown parsing and outside fenced code.
|
|
17
|
-
- `{…}` after a block, image, or `[span]` (markdown-it-attrs) carries every class, `key=value`, and flag. There is no second syntax for images or slides.
|
|
18
|
-
- Configuration lives in the frontmatter; there is no separate manifest.
|
|
19
|
-
|
|
20
|
-
## Consequences
|
|
21
|
-
|
|
22
|
-
- Each visual property is written in exactly one place in the source. This is what makes exact visual editing possible ([edits are line-range patches](2026-10-04-edits-are-line-range-patches.md)).
|
|
23
|
-
- In GitHub or editor previews the separators show as plain text, which keeps the structure visible.
|
|
24
|
-
- A bare `===` stays a setext underline and `=== col` inside a sentence is text, so ordinary Markdown is unaffected.
|
|
25
|
-
- One attribute syntax means one validator: unknown keys and classes are build errors.
|
|
26
|
-
|
|
27
|
-
## Alternatives considered
|
|
28
|
-
|
|
29
|
-
- **Keep Marp:** layouts need `<div>` markup and per-slide classes are HTML comments; its theme model has no layout concept for themes to restyle.
|
|
30
|
-
- **Pandoc fenced divs (`:::: columns` / `::: column`):** div markup with other punctuation, colon counting for nesting, and four fence lines per two-column slide.
|
|
31
|
-
- **Bare symbol lines (`+++`, `===`, `???`, `Notes:`):** cryptic; a bare `===` is a setext H1 underline, and `+++` means TOML frontmatter in Hugo.
|
|
32
|
-
- **Bracketed keywords (`[col]`, `[notes]`, version 0.1):** read as link text, and `[col {.muted}]` looked like a `[span]{.hl}`. The old lines fail the build with the new spelling.
|
|
33
|
-
- **`##` headings as column breaks:** can't express a column without a heading, and would turn stacked subheadings into columns.
|
|
34
|
-
- **HTML comments for notes:** the markup this design avoids.
|
|
35
|
-
- **Marp alt-text keywords for images (`![w:200 bg]`):** only works for images, so blocks and slides would still need another syntax.
|
|
36
|
-
- **A `deck.yaml` manifest:** a second file to keep in sync, for nothing the frontmatter can't hold.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# One built-in behavior instead of settings
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Presentation tools accumulate settings: transitions, page-number visibility, language, aspect ratio, section dividers. Each one is a choice an author (or Claude) has to make and a combination themes have to support.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
Where one behavior serves talks well, it is built in with no setting:
|
|
15
|
-
|
|
16
|
-
- Slides switch instantly. Themes used to animate changes (gold slid up, the others faded); the motion distracted from content, so themes no longer define transitions.
|
|
17
|
-
- Page numbers show on every slide except title and section slides.
|
|
18
|
-
- Slides containing Japanese get `lang="ja"` (Japanese line breaking and a fallback font), detected from the text.
|
|
19
|
-
- Section divider slides are hidden by default, as in Beamer, where `\section` names a part of the talk without adding a frame: the eyebrow above each title already names the section. `{show}`, `section_slides: true`, and `{nonum}` are the exceptions that proved necessary.
|
|
20
|
-
|
|
21
|
-
## Consequences
|
|
22
|
-
|
|
23
|
-
- The frontmatter stays short, and a deck renders the same everywhere.
|
|
24
|
-
- Hidden dividers are dropped before numbering, so page numbers and deep links count only the slides on screen.
|
|
25
|
-
- A setting is added only when a real deck needs the other behavior.
|
|
26
|
-
|
|
27
|
-
## Alternatives considered
|
|
28
|
-
|
|
29
|
-
- **Per-theme transitions:** removed; see above.
|
|
30
|
-
- **A section slide for every `--- section`:** mostly a title-only slide that repeats the eyebrow.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Overflow is reported, not hidden
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Text that doesn't fit a slide has to go somewhere. Many tools shrink it automatically. Auto-shrunk slides make a deck uneven, small text fails at the back of the room, and nobody notices until the talk. Decks are also increasingly written by Claude, which can't see a slide unless something renders it.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- Text has one size per theme and never shrinks on its own.
|
|
15
|
-
- `deck check` renders every slide in headless Chrome at 1280×720 and reports, with source lines: content past the slide body, text wider than its box, clipped code, failed diagrams; and as warnings, code shrunk below 14px, diagram labels below 13px, and title-only slides. It exits 1 on errors.
|
|
16
|
-
- `--- {fit}` opts one slide in to shrinking: the runtime binary-searches the largest CSS `zoom` on the body (not the title) at which nothing overflows, never below 14px text, and `deck check` warns below 16px.
|
|
17
|
-
- The one automatic exception is code: a block wider than its panel shrinks down to 12px instead of clipping, since a clipped line loses content.
|
|
18
|
-
|
|
19
|
-
## Consequences
|
|
20
|
-
|
|
21
|
-
- `deck check` (with `--snapshots` to look at the slides) is the verification loop the bundled skill requires before Claude calls a deck done.
|
|
22
|
-
- Dense slides are a visible, deliberate choice in the source.
|
|
23
|
-
|
|
24
|
-
## Alternatives considered
|
|
25
|
-
|
|
26
|
-
- **Shrink to fit by default:** see Context.
|
|
27
|
-
- **Scrollable slides:** don't exist when presenting or in a PDF.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# A deck builds to one self-contained HTML file
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Decks are shared as links (Treasure Work publishes them as Apps Script web apps, which deploy a single `index.html`), opened from disk, embedded in Google Sites, and printed. Marp exported HTML and PDF separately, and the HTML had to be shared by hand.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
`deck build` writes one HTML file with the CSS, the runtime (vanilla JS, no framework), the images, and pre-rendered Mermaid SVGs inlined. Fonts load from Google Fonts. The same file runs as a local file, in Treasure Work's preview, and under Apps Script, through a small `Host` adapter in the runtime (deep links use `google.script.history` there).
|
|
15
|
-
|
|
16
|
-
## Consequences
|
|
17
|
-
|
|
18
|
-
- Publishing is one file; republishing keeps the URL.
|
|
19
|
-
- Image-heavy decks make large files; HtmlService's size limits still need measuring.
|
|
20
|
-
- The runtime handles everything a presenter needs (overview, notes, presenter window, share panel) without a server.
|
|
21
|
-
|
|
22
|
-
## Alternatives considered
|
|
23
|
-
|
|
24
|
-
- **Slidev:** Vue components and a Vite SPA build, with multi-file output that doesn't fit a single-`index.html` deployment.
|
|
25
|
-
- **reveal.js Markdown:** attributes in `<!-- .element: … -->` comments, layouts still in HTML, and a heavier runtime.
|
|
26
|
-
- **Generate Google Slides:** loses generated backgrounds, live diagrams, and the pixel-exact canvas. It could come later as a secondary target.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-03
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Strict build, forgiving preview
|
|
7
|
-
|
|
8
|
-
Amended 2026-10-04 (forgiving preview, `plans/2026-10-04-slide-errors.md`).
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
A typo in a class or attribute that is silently ignored reaches the audience as a wrongly styled slide. But while a deck is being typed, it is broken most of the time: a half-typed header or a missing image would take the whole preview away.
|
|
13
|
-
|
|
14
|
-
## Decision
|
|
15
|
-
|
|
16
|
-
- **Strict:** an unknown layout, attribute, class, separator, or a missing image is a build error with its line number. `deck build`, `deck pdf`, and `deck check` fail on the first one.
|
|
17
|
-
- **Forgiving in the preview:** `deck dev` and `deck editor` build with `forgiving: true`. A slide that can't be parsed or rendered becomes an error slide in its place, showing the message, its line, and its source, and every other slide builds as usual. An error outside the slides (frontmatter, theme) keeps the last good build on screen with the error in a bar.
|
|
18
|
-
|
|
19
|
-
## Consequences
|
|
20
|
-
|
|
21
|
-
- Typos never reach a shared deck or a PDF.
|
|
22
|
-
- An error appears and goes away by swapping one slide, so a half-typed edit never takes the preview away, and the host can mark the line in its gutter (`build-error` with `slide`).
|
|
23
|
-
- An unclosed code fence is reported at its opening line, since it would otherwise swallow every later slide.
|
|
24
|
-
|
|
25
|
-
## Alternatives considered
|
|
26
|
-
|
|
27
|
-
- **Ignore unknown attributes:** see Context.
|
|
28
|
-
- **Forgiving everywhere, with warnings:** a shared deck or PDF with an error slide in it is worse than a failed build.
|
|
29
|
-
- **Keep the last good version of the broken slide:** it would show content that isn't in the file, and edits on it would patch lines that no longer read that way.
|
|
30
|
-
- **Skip the broken slide:** renumbers the rest, and the error is easy to miss.
|
|
31
|
-
- **An error bar only:** the preview would freeze on the last good deck, so edits to other slides wouldn't show.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-04
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Text is edited in place only where rendered text lines up with its source
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Typing into formatted text (bold words, links, typographic quotes) has to change the right characters of the Markdown. Turning the edited DOM back into Markdown can't tell `*x*` from `_x_`, and loses entities, attributes, and the author's spelling of markup.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- A block is typed in place when its rendered text lines up with its source: `alignRendered` in `edit-core` matches each rendered character to its source position, and everything between them must be markup (markers, a link's `](target)`, a span's `]{.x}`). A misreading fails instead of misplacing an edit.
|
|
15
|
-
- Typing within one text node is spliced into the source inside that run, and only the typed characters are escaped.
|
|
16
|
-
- While a block is edited, it shows its own Markdown (as in Obsidian), so what is typed is saved as typed.
|
|
17
|
-
- An edit that crosses formatting, or a block that can't be typed into (code, diagrams), opens its Markdown in place instead of guessing.
|
|
18
|
-
|
|
19
|
-
## Consequences
|
|
20
|
-
|
|
21
|
-
- Untouched source stays byte for byte; formatting buttons work through the same alignment (selecting a bold word and pressing B takes the bold off).
|
|
22
|
-
- Some edits fall back to the block's Markdown, which is always correct.
|
|
23
|
-
|
|
24
|
-
## Alternatives considered
|
|
25
|
-
|
|
26
|
-
- **Serialize the edited DOM to Markdown:** the WYSIWYG round trip again, block by block.
|
|
27
|
-
- **Rebase the edit's target after each save:** escaped text no longer equals its rendering, and the alignment would be recomputed against a DOM mid-edit; keeping the original target and moving `expected` gives the same text.
|
|
28
|
-
- **CodeMirror live preview (Markdown with markers hidden):** exact by construction, but a styled text editor rather than a formatted one, and a large dependency. The Markdown view covers the raw case.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-04
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# The whole editor lives in the deck's page
|
|
7
|
-
|
|
8
|
-
See `plans/2026-10-04-editor-layout.md`.
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
The first design put the slides in an iframe beside Treasure Work's own source pane. In a narrow dock that left each slide small and the source pane mostly empty. Treasure Work's note editor (TipTap with `tiptap-markdown`) can't host the deck flavor: it would escape `{…}`, `=== col`, and slide headers, and has no hook for another Markdown flavor.
|
|
13
|
-
|
|
14
|
-
## Decision
|
|
15
|
-
|
|
16
|
-
- The editor is part of the page `deck dev --embed` serves (`runtime/embed.js`): thumbnails, the current slide, and an editor below it with a formatted view and the file's Markdown. `deck editor` is the same page in a browser.
|
|
17
|
-
- The formatted view is the deck's own rendering of every slide's blocks, cloned with their `data-src`, so the same editing code works on it as on the slide. Images and diagrams are still picked and sized on the slide, where their size means something.
|
|
18
|
-
- The host's part is small and stable: one iframe, and a `postMessage` protocol (`{channel: 'treasure-deck', v: 1, type, …}`) for patches, slide changes, errors, undo, and presenting.
|
|
19
|
-
- The editor's chrome uses its own `--ed-*` palette and Lucide icons inlined into the page, so it needs no network.
|
|
20
|
-
|
|
21
|
-
## Consequences
|
|
22
|
-
|
|
23
|
-
- Every host gets the same editor; Treasure Work needs no source pane or layout of its own.
|
|
24
|
-
- One page to test headlessly (`test/editor.test.ts` drives it through a host page).
|
|
25
|
-
- `embed.js` is large; pure logic goes to `edit-core.cjs`, which the tests load directly.
|
|
26
|
-
|
|
27
|
-
## Alternatives considered
|
|
28
|
-
|
|
29
|
-
- **TipTap with a deck flavor:** needs a hook Treasure Work's editor lacks, still re-serializes unedited paragraphs, and adds a second Markdown parser that must agree with `render.ts`.
|
|
30
|
-
- **Keep side by side, shrink the source pane:** the slides stay small.
|
|
31
|
-
- **Build the layout in Treasure Work:** the note editor would rewrite deck syntax, and every host would rebuild the layout.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-04
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Edits are compare-and-swap patches on line ranges
|
|
7
|
-
|
|
8
|
-
See `plans/2026-10-04-visual-editor.md` and `plans/2026-10-04-live-patches.md`.
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
Treasure Work's WYSIWYG note editor turns Markdown into a document and back, which reflowed list markers, escaping, and blank lines, and broke the Marp decks. A deck file is also edited at the same time by Claude, the author's own editor, and the visual editor, so a whole-file rewrite would overwrite someone's change. The syntax writes each visual property in one place ([keyword lines and one attribute syntax](2026-10-03-keyword-lines-and-one-attribute-syntax.md)), so any visual control can be "rewrite this span".
|
|
13
|
-
|
|
14
|
-
## Decision
|
|
15
|
-
|
|
16
|
-
- The editor's build marks every slide and block with its source lines (`data-src="talk.md:12-14"`), and the page carries the exact sources it was built from (`__DECK_SOURCES__`).
|
|
17
|
-
- Every edit is a patch `{file, start, end, expected, text}`: lines `start..end` become `text` only while they still read `expected` (`end = start - 1` inserts, `text: null` deletes, line endings are kept). `src/patch.ts` applies it; `runtime/edit-core.cjs` builds the structural ones as pure functions on a file's lines.
|
|
18
|
-
- Inside a host (Treasure Work), the host applies patches to its own editor buffer. Without one, `deck editor` applies them to disk at `POST /__patch` (127.0.0.1 only, same origin, JSON only, the deck and its parts only).
|
|
19
|
-
- Typing saves 500 ms after the last change, computed from the edit's start with the last saved text as `expected`; patches of one edit share a `group` id.
|
|
20
|
-
- A rejected patch means the file changed since: the page reloads.
|
|
21
|
-
|
|
22
|
-
## Consequences
|
|
23
|
-
|
|
24
|
-
- The rest of the file stays byte for byte as written, and a concurrent change is never overwritten.
|
|
25
|
-
- Each action is one patch, so one undo step in the host. A move of a slide is one patch over the span it crosses.
|
|
26
|
-
- After a saved patch the bridge updates its copy of the sources and shifts later line numbers, so the next edit is correct before the rebuilt page arrives.
|
|
27
|
-
|
|
28
|
-
## Alternatives considered
|
|
29
|
-
|
|
30
|
-
- **A generic WYSIWYG editor (Tiptap, Milkdown, Toast UI):** the round trip that broke Marp; it re-serializes the whole file.
|
|
31
|
-
- **Edit the slide AST and re-serialize with a formatter:** a canonical printer becomes the source of truth, and any concurrent text edit conflicts with it.
|
|
32
|
-
- **Port the build to the browser:** the build needs `fs`, image inlining, and headless Chrome; the local server costs nothing and serves exactly what `deck build` publishes.
|
|
33
|
-
- **Fetch source lines per edit:** latency, and a second view of the file that can drift from what was shown.
|
|
34
|
-
- **Always write to disk, even in a host:** races with the host's unsaved buffer and bypasses its undo.
|
|
35
|
-
- **A patch per keystroke:** floods the host's undo stack and the rebuilds.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-04
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# The preview swaps changed slides in place
|
|
7
|
-
|
|
8
|
-
See `plans/2026-10-04-hot-swap.md` and `plans/2026-10-04-vite-dev-server.md`.
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
Every save used to reload the whole preview: the page flashed, diagrams rendered again, and the editor lost its place. With saves every half second while typing, that is constant churn. The runtime and the editor hold references to each slide's `<section>` element.
|
|
13
|
-
|
|
14
|
-
## Decision
|
|
15
|
-
|
|
16
|
-
- The build keeps each slide's HTML separately. The server keeps the last few builds of each page (`main`, `present`) and answers `/__changes?page&build` with what changed since the build a page shows: a slide's new HTML, or, for a slide whose lines only moved, its new `data-src` values.
|
|
17
|
-
- The page patches each `<section>` in place (attributes and content, keeping the runtime's state classes) and re-runs per-slide setup: Mermaid, code fitting, `{fit}` zoom, table heads, notes.
|
|
18
|
-
- Anything outside the slides (theme, CSS, frontmatter settings shown outside them, runtime) and a change in the number of slides reload instead, keeping the slide, edit mode, and the caret.
|
|
19
|
-
- The bridge holds updates while a block is edited or a save is on its way, so a rebuild never replaces text being typed.
|
|
20
|
-
- `deck dev` runs Vite in middleware mode for file watching and the change channel (`deck:build` over its HMR WebSocket); the deck keeps its own build and endpoints.
|
|
21
|
-
|
|
22
|
-
## Consequences
|
|
23
|
-
|
|
24
|
-
- Saving doesn't flash or lose place; a line shift touches only attributes.
|
|
25
|
-
- Hosts see a repeated `ready`, exactly as after a reload, so they needed no change.
|
|
26
|
-
|
|
27
|
-
## Alternatives considered
|
|
28
|
-
|
|
29
|
-
- **Replace `<section>` elements:** every reference the runtime and bridge hold would point at detached nodes.
|
|
30
|
-
- **Diff on the client:** decks inline images, so sending every slide on each save could be megabytes.
|
|
31
|
-
- **Re-render slides after a line shift:** re-runs Mermaid and fitting for no visible change, and flashes diagrams.
|
|
32
|
-
- **morphdom-style diffing inside a slide:** fights the runtime's own mutations (Mermaid SVG, zoom, code sizes) and adds a dependency.
|
|
33
|
-
- **Our own file watcher and server-sent events:** replaced by Vite's watcher and HMR channel.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-04
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Theme colors derive from a few seeds, in CSS
|
|
7
|
-
|
|
8
|
-
See `plans/2026-10-04-theme-tokens.md`.
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
Themes had to set dozens of colors, twice (light and dark), and diagrams read them at build time. A new theme meant a long list of tokens; `accent:` had to recolor everything; and a slide can switch to dark mode on its own (`{mode=dark}`).
|
|
13
|
-
|
|
14
|
-
## Decision
|
|
15
|
-
|
|
16
|
-
- A theme sets a few seed colors on `.slide`: `--deck-bg`, `--deck-fg`, `--deck-accent`, and optionally `--deck-accent-2`, `--deck-warn`, `--deck-ok`.
|
|
17
|
-
- `runtime/base.css` derives every other color on `.slide` with `color-mix()` and relative `oklch(from …)` colors: muted text, lines, cards, the text on the accent, highlights, chips, chart series, code, and the Mermaid palette.
|
|
18
|
-
- Derived tokens are declared on `.slide`, because a `var()` resolves where it is declared and the seeds change per slide. A theme that pins one sets it on `.slide` too.
|
|
19
|
-
- Mermaid colors are written into the SVG as `var(--deck-diagram-…, rgb(…))`, so diagrams follow the tokens live.
|
|
20
|
-
- `deck theme check` verifies a theme against a specimen deck: required tokens, every class styled, and WCAG AA contrast measured on rendered pixels.
|
|
21
|
-
|
|
22
|
-
## Consequences
|
|
23
|
-
|
|
24
|
-
- A theme from `deck theme init` sets about six colors per mode; built-in themes still pin their brand palettes.
|
|
25
|
-
- Dark mode, per-slide modes, `accent:`, and a deck-local `theme.css` all follow without a build step; `d` switches light and dark live, diagrams included, with nothing re-rendered.
|
|
26
|
-
|
|
27
|
-
## Alternatives considered
|
|
28
|
-
|
|
29
|
-
- **Derive at build time in TypeScript:** needs a color library and can't follow per-slide modes or `theme.css`. Chrome is the only renderer, so CSS color functions are safe ([one renderer](2026-10-03-chrome-over-devtools.md)).
|
|
30
|
-
- **Contrast from computed colors only:** wrong for every built-in theme, which paint gradients, grain, and frosted cards. Pixel sampling costs a screenshot per specimen slide.
|
|
31
|
-
- **Check themes against the user's deck:** misses classes the deck doesn't use; `deck check` covers the deck.
|
|
32
|
-
- **Contrast failures as warnings only:** built-in themes could quietly ship unreadable text. Primary text is an error; the quiet tiers warn.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-05
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# The host owns undo
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
A deck in Treasure Work is open in the host's editor buffer, which already has an undo history; the visual editor's patches are applied to that buffer. Two undo histories over one file would disagree. Without a host (`deck editor`), there is no buffer, only the file.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- In a host's iframe, ⌘Z and ⇧⌘Z are passed to the host as `undo` / `redo` messages, and the editor keeps no history. Patches carry a `group` id so the host can undo one edit as one step.
|
|
15
|
-
- Without a host, the editor keeps the patches it saved, up to 200 steps, in `sessionStorage` (so they outlive a reload). A step is the patches one action submitted together; a pause in typing ends a step, and unsaved typing is saved first as a step of its own.
|
|
16
|
-
- An undo saves the inverses of a step's patches, last first; a redo saves them again. Each is a compare-and-swap patch ([line-range patches](2026-10-04-edits-are-line-range-patches.md)), so a change made since by someone else is never overwritten: that undo is refused, the history dropped, and the page reloads.
|
|
17
|
-
|
|
18
|
-
## Consequences
|
|
19
|
-
|
|
20
|
-
- One history per file in a host, shared with typing in its own editor.
|
|
21
|
-
- Undo works the same in both views, with the caret going back to the change.
|
|
22
|
-
|
|
23
|
-
## Alternatives considered
|
|
24
|
-
|
|
25
|
-
- **The editor's own history inside a host:** two histories over one buffer, each undoing the other's changes.
|
|
26
|
-
- **A host-side transaction protocol (begin/commit):** more protocol for what a `group` id on each patch already gives.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-07
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Built decks report anonymous access metrics to one Treasure Data table
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Once a deck is published (an Apps Script web app, a shared file, a Google Sites embed), nobody can tell whether it was opened or how far people read. Treasure Data already ingests browser events through the TD JS SDK, so no server of our own is needed.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
Every `deck build` output loads the TD JS SDK 4.4 from `cdn.treasuredata.com` and reports to `treasure_deck.views` on us01 with a write-only key that is part of treasure-deck. There is no setting and no opt-out.
|
|
15
|
-
|
|
16
|
-
- **Anonymous mode only.** No `td_client_id` cookie, no global ID, no server-side cookie.
|
|
17
|
-
- **Records:**
|
|
18
|
-
- an `open` row per page load
|
|
19
|
-
- a `slide` row per slide viewed, with `slide_title` and `dwell_ms`, sent when the viewer leaves the slide or the page is hidden (another tab, closed, a phone locked)
|
|
20
|
-
- an `action` row per feature used (full screen, presenter window, overview, share, print, …)
|
|
21
|
-
|
|
22
|
-
The presenter window sends nothing.
|
|
23
|
-
- **Grouping without identity.** `view_id` is random per page load and never stored, so one viewing's rows group together (completion, drop-off) without recognizing a returning viewer. `deck_id` is a hash of the deck file's path, so it doesn't change with the title and doesn't reveal the path. `host` (`apps_script`, `file`, or `web`) stands in for the URL, which in Apps Script is Google's sandbox URL.
|
|
24
|
-
- **Only `deck build` adds it**, after the diagrams are pre-rendered in headless Chrome, so neither that render nor `dev`, `editor`, `pdf`, or `check` sends events.
|
|
25
|
-
- **Our own loader line, always https**, because the SDK's stock loader picks `http:` on `file://` pages.
|
|
26
|
-
|
|
27
|
-
## Consequences
|
|
28
|
-
|
|
29
|
-
- The single-file deck now loads a second resource from a CDN (after Google Fonts). If the CDN is unreachable, the deck works and sends nothing.
|
|
30
|
-
- The write key is public in every deck and in this repository. It can't read data, but anyone can write rows with it. Queries should filter on the event shape, and the key can be rotated in a release.
|
|
31
|
-
- Counts are of page loads, not people: there is no identity to deduplicate on.
|
|
32
|
-
|
|
33
|
-
## Alternatives considered
|
|
34
|
-
|
|
35
|
-
- **Per-deck `analytics:` settings with the author's own database and key:** every author would need a TD account, and we'd get no single stream across decks.
|
|
36
|
-
- **An `analytics: false` opt-out:** rejected, the metrics are unconditional.
|
|
37
|
-
- **Inlining `td.min.js`:** adds tens of KB to every deck and freezes the SDK version. A deck that can't reach the CDN can't reach the ingestion endpoint either.
|
|
38
|
-
- **Signed mode or cookies:** would identify returning viewers, which is personal data the audience never agreed to share.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-14
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# `deck dev` links media by URL, not inlined
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
`deck build` inlines every local image and video as a `data:` URI, so a deck is one file ([ADR](2026-10-03-single-file-html.md), [ADR](2026-10-14-videos-are-inlined-images.md)). `deck dev` used the same build, and it rebuilds on every save, builds again for `/present` and for each theme preview, and swaps changed slides into open pages with their HTML. With a 200 MB video (the editor accepts uploads that large), each save read and base64-encoded about 270 MB, and the editor page was as large.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- The renderer takes a `mediaUrl` option: when set, a local image or video is checked as before (it exists, and its type is known) but linked by that URL instead of inlined. `deck build`, `deck pdf`, and `deck check` don't set it.
|
|
15
|
-
- `deck dev` links each file as `/__file?p=<path from the deck folder>&v=<mtime>` and serves it there, with its type and byte ranges. The server answers only for files the latest builds linked; `v=` makes a file replaced under the same name load again, and lets the browser keep files that haven't changed.
|
|
16
|
-
|
|
17
|
-
## Consequences
|
|
18
|
-
|
|
19
|
-
- A rebuild only stats media files, and pages and slide swaps stay small however large the videos are. Videos seek natively, without the runtime's Blob URL step.
|
|
20
|
-
- What `deck dev` shows is no longer byte-for-byte the built page: a problem only an inlined file would show (a huge page, a slow `data:` URI) is seen in `deck build` output, not in the preview.
|
|
21
|
-
|
|
22
|
-
## Alternatives considered
|
|
23
|
-
|
|
24
|
-
- **A cache of `data:` URIs keyed by path and mtime:** saves the reads and the encoding, but each rebuild still joins hundreds of MB into the page and each swapped slide resends its videos.
|
|
25
|
-
- **Vite's static serving (its root is the deck folder):** serves any file under the folder whether the deck uses it or not, and files outside it (`../shared/x.png`) only through `/@fs/`.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-14
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Pages past Apps Script's limit warn, and videos can leave the page
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
A deck builds to one page with its images and videos inlined ([ADR](2026-10-14-videos-are-inlined-images.md)), and Treasure Work publishes that page as an Apps Script web app, as the single `index` file of a project. Apps Script's limit wasn't documented, and Treasure Work's notes disagreed (about 10 MB per file, or 50 MB per project). Measured on 2026-10-14 through Treasure Work's publish flow: pages of 5, 7.5, and 9 MiB published; 10, 25, and 45 MiB failed with "The project is too large to save". A minute of screen recording is 10 to 40 MB before base64, so one clip can make a deck unpublishable, while `deck build` only warned past 20 MB per video or 50 MB in total.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- `deck build` warns when the page is over 9 MiB, the largest size measured to publish, naming the three largest inlined files (at their base64 size) and pointing to `--media-dir` when a video is among them. The per-video warning (20 MB, slow to open) stays; the 50 MB total goes, as the page warning covers it.
|
|
15
|
-
- `deck build --media-dir <dir>` copies each local video into `<dir>`, named `<name>-<hash>.<ext>` by its contents, and links it by a relative path. Images stay inlined.
|
|
16
|
-
- The runtime asks `window.__DECK_MEDIA__(path)`, when a host page defines it, for the URL of each video linked by a relative path (decoded), once per path, the first time its slide is shown; a presenter window the runtime writes itself asks its opener's hook. It is the step that already turns an inlined video into a Blob URL.
|
|
17
|
-
|
|
18
|
-
## Consequences
|
|
19
|
-
|
|
20
|
-
- A deck with a long clip can still be built and hosted: as a page plus a folder, or by a host that keeps the videos elsewhere. Treasure Work can publish one by uploading the folder to Drive and serving each file through `google.script.run` behind `__DECK_MEDIA__` (its own change).
|
|
21
|
-
- `deck pdf` and `deck check` still inline everything: they render one page in a temporary file.
|
|
22
|
-
- The 9 MiB threshold is a measurement, not a documented limit; if Apps Script changes, the constant in `src/media.ts` moves with it.
|
|
23
|
-
|
|
24
|
-
## Alternatives considered
|
|
25
|
-
|
|
26
|
-
- **Link videos to Drive by URL:** Drive doesn't serve video reliably to `<video>` (no ranges for large files, a virus-scan page past 100 MB, sign-in cookies a sandboxed iframe may not send).
|
|
27
|
-
- **Transcode videos smaller in the build:** needs ffmpeg or Chrome's encoder on every machine that builds, and it chooses the quality for the author.
|
|
28
|
-
- **Move images out too:** they rarely push a page past the limit, and inlined they keep PDF, `deck check`, and offline sharing simple.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-14
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Videos take image syntax and are inlined like images
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
Demo clips and screen recordings are often the clearest slide in a talk. A deck builds to one self-contained HTML file ([ADR](2026-10-03-single-file-html.md)), and every image path (Markdown, the editor's controls, PDF) already finds media by `{…}`. Videos are far larger than images: a one-minute screen recording is 10 to 40 MB, plus a third for base64.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- A video is written `{…}`, told apart by extension (`.mp4`, `.webm`, `.mov`, `.m4v`). It takes the image attributes plus `autoplay`, `loop`, and `nocontrols`; those flags fail on an image, and a video fails as `{bg}` or `{side}`.
|
|
15
|
-
- `deck build` inlines a local video as a `data:` URI, so the deck stays one file, and warns past 20 MB per video or 50 MB in total.
|
|
16
|
-
- The runtime plays a video from a Blob URL made when its slide is first shown (one per video), since seeking within a large `data:` URI is slow and some browsers won't play one.
|
|
17
|
-
- The runtime, not the browser, decides when a video plays: `{autoplay}` plays muted when its slide is shown (in the editor too) and pauses when it is left; the presenter window mutes its copies, and the overview and print never play.
|
|
18
|
-
|
|
19
|
-
## Consequences
|
|
20
|
-
|
|
21
|
-
- The editor's pick, resize, move, align, delete, and Markdown controls work on videos with no new patch logic; videos add only Autoplay, Loop, and Controls toggles.
|
|
22
|
-
- A deck with videos is as large as its videos. HtmlService's size limit is still unmeasured, so very large decks may not publish to Apps Script.
|
|
23
|
-
- `deck pdf` prints each video's first frame, stopped and without its play bar.
|
|
24
|
-
|
|
25
|
-
## Alternatives considered
|
|
26
|
-
|
|
27
|
-
- **A new syntax (a `::video` block, or `<video>` HTML):** its own finder and patcher in the editor and its own attribute rules, and HTML breaks "no markup".
|
|
28
|
-
- **Videos as files next to the HTML:** smaller pages and native seeking, but not one file, which breaks Apps Script publishing and sharing a single file. It can come later as a build option or as Drive-hosted media.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
status: accepted
|
|
3
|
-
date: 2026-10-15
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Released to public npm as a Treasure AI Labs offering, not as open source
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
|
|
10
|
-
The source repository, `treasure-data/treasure-deck`, is internal on GitHub. Most people who would write decks have no seat in the GitHub org: sales, marketing, support, and managers. So they couldn't install treasure-deck, read its docs, or report problems. Open-sourcing the repository would solve all three, but we don't usually take outside contributions, so it isn't the plan for now. It isn't ruled out either. `@treasuredata/tdx` already ships the same way: an internal repo published to public npm through trusted publishing on `v*` tags.
|
|
11
|
-
|
|
12
|
-
## Decision
|
|
13
|
-
|
|
14
|
-
- **Package:** `@treasure-ai/treasure-deck` on public npm. The CLI is still `deck`; unscoped `deck` is someone else's package. `.github/workflows/release.yml` releases it through npm trusted publishing (OIDC), with no npm token in the repository:
|
|
15
|
-
- **Versions** are CalVer, as in tdx, and come from the tag. `package.json` stays `0.0.0-dev`.
|
|
16
|
-
- **A `v*` tag** publishes the tarball that `scripts/smoke-pack.sh` installed and built a deck with. It goes out under npm's `next` tag, with a GitHub prerelease.
|
|
17
|
-
- **Running the workflow by hand** promotes a version to `latest` (stable).
|
|
18
|
-
- **`pnpm release`** pushes the next tag, and **`pnpm promote`** starts the promotion, as tdx's commands do.
|
|
19
|
-
|
|
20
|
-
Unlike tdx, there is no `release` branch or PR for promotion, since treasure-deck releases don't need an approval gate. Both steps are in one workflow file because npm trusts one workflow per package.
|
|
21
|
-
- **License:** `LICENSE.md` puts the package under the [Treasure AI Labs Terms of Use](https://www.treasure.ai/terms/labs-terms-of-use), with `"license": "SEE LICENSE IN LICENSE.md"`. It is not an open-source license.
|
|
22
|
-
- **Docs:** the user guides and these records ship in the package, without `docs/design.md` and `docs/development.md`. The README is the npm page, so it is for users only: development notes live in `docs/development.md`. The README links them through unpkg, which anyone can read without an account. `homepage` is the npm page, and `bugs` is `treasure-data/treasure-ai-labs`, the public issue-only repo for Labs products.
|
|
23
|
-
- **Access metrics:** unchanged ([ADR](2026-10-07-anonymous-access-metrics.md)). The README says what a built deck sends, and the Labs terms cover it as usage data.
|
|
24
|
-
|
|
25
|
-
## Consequences
|
|
26
|
-
|
|
27
|
-
- Anyone with npm can install it, including people outside the company. Their built decks report to the same table, under the Labs terms.
|
|
28
|
-
- npm attaches no provenance, because the repository isn't public.
|
|
29
|
-
- The first publish is by hand. npm can only register a trusted publisher on a package that already exists.
|
|
30
|
-
- Open-sourcing later means replacing `LICENSE.md` and one line in `package.json`. An `analytics: false` opt-out is the first change to reconsider then.
|
|
31
|
-
|
|
32
|
-
## Alternatives considered
|
|
33
|
-
|
|
34
|
-
- **Open-source now:** it commits us to triaging outside issues and PRs, and to taking a public position on the access metrics, before there's a reason to.
|
|
35
|
-
- **A private registry (GitHub Packages, Artifactory):** GitHub Packages needs the same org access these users lack. Any other private registry asks every user to set up auth before installing a slide tool.
|
|
36
|
-
- **Ship it only inside Treasure Work:** that would tie deck releases to app releases and leave out people who write decks elsewhere. Treasure Work can depend on the npm package instead.
|
|
37
|
-
- **No license, like tdx:** that leaves users guessing what they may do. The Labs terms already say it.
|