Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
spaces: a page becomes a bento/slides deck (#434)
nyblnetc488d4239e34
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.mdindex 4c004986..d3e2fcfb 100644--- a/docs/DECISIONS.md+++ b/docs/DECISIONS.md@@ -6697,6 +6697,74 @@ mapped, 1 correctly absent, run by bento-team-slides.## 2026-09-10 — spaces view filters: a FLAT condition list, and unknown operators show MORE+## 2026-09-09 — PAGE → DECK emits a DOCUMENT, not a file, and says what it dropped++`bento/spaces` can turn a page into a `bento/slides` presentation+(`spaces/src/todeck.ts`, Save → Export page as slides…). Three things about it+are settled and should not be relitigated without new facts.++**It emits the deck's document JSON, not a `.bento.html` deck.** The stronger+product moment is obviously the file, and it is not reachable from inside+`spaces/`. A self-contained deck is a document spliced into a slides SHELL, and+this app has exactly three ways to obtain one: bundle it (about half a megabyte+of another app inside every space, forever, for a feature most spaces never+use), fetch it (PLATFORM §1 — opening a document must not touch the network,+and a build-time fetch would still need the release channel and its signature),+or have the two apps produce a joint shell, which is a change in two zones this+one may not edit. So the hand-off is the interchange path bento/slides already+documents and already supports: "Replace from JSON…" in its About dialog, and+`window.bento.loadDoc()` for a script. The Markdown exporter is the precedent —+it writes another format faithfully and hands it over. **If a joint shell ever+exists, this is the decision to revisit; nothing else about the exporter+changes, because the document it produces is already the whole payload.**++**A page has no speaker notes, and none are invented.** The tempting mapping is+review comments → `slide.notes`: both are authored, both travel in the file,+neither is shown to a reader. It was rejected. A comment is workspace, it is+addressed to a named person, and a deck's notes travel in every copy of the+deck — so the mapping would quietly disclose a remark its author never put in+the document. What the notes carry instead is the export's own account of what+did not survive the crossing, per slide. That is deliberate: the dialog's list+is gone the moment it closes, and the presenter who opens the deck next week is+the person who needs to know that the page had a video on it.++**Loss is reported by CODE, translated at the call site.** `todeck.ts` returns+`DeckNote {code, n, where}` and never an English sentence; `editor.ts` turns+each code into its own literal `t()` call. This is the `LAYOUT_WORD` lesson+applied before the fact — the i18n extractor sweeps `t()` calls with a literal+argument, so `t(TEXT[code])` compiles, runs, reports 100% coverage and ships+English in all eight locales. The copy written INTO the document stays English+on purpose: a saved artefact's words are its author's, not its next reader's+browser's.++### The cross-zone coupling, and what actually guards it++`spaces/` writes `bento/slides`' format while being forbidden to edit+`slides/`. Two guards, and it is worth being precise about which failures each+one catches, because the gap between them is real:++- **A TYPE-ONLY import of `slides/src/model.ts`.** Erased at build time, so it+ costs the spaces shell nothing, and a field renamed or narrowed over there is+ a compile error here. It caught a missing required `modified` on the first+ run.+- **A rig that runs the emitted document through slides' OWN `parseDoc`, and+ checks every key it writes against `slides/src/modelkeys.generated.ts`.** In+ `scripts/test-spaces-model.ts`, importing from `slides/` to READ. Loadability+ and unknown-key drift both go red here instead of in a browser.++**Neither guard covers BEHAVIOUR**, and there is nothing on the slides side that+knows this exporter exists. A renderer that stopped honouring `valign`, or a+table that started sizing its rows differently, would pass both. That was+accepted knowingly rather than solved, and it is written down so the next+session does not discover it as a surprise. The measurement that does cover+behaviour is manual: load the emitted deck into a built slides shell over+`http://127.0.0.1` and run its `validate()`, which measures with the real+renderer. Doing that found three defects the node rig could not: every element+past slides' 96px margin convention, two text boxes overflowing by 10px and+15px because the no-DOM width estimate was too generous for lists, and a table+CLIPPED to three of its five rows because the element box was sized at 36px a+row when a row draws at about 45. Only the third of those has a rig assertion+now, and it is a derived bound rather than a measurement.**Decision.** `bento/spaces` `ViewFilter` gains two keys and no more: `where`, aFLAT array of `{key, op, v?}` clauses, and `any`, a boolean that ORs theminstead of ANDing them. Eleven operators — `eq` `ne` `gt` `gte` `lt` `lte`diff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.tsindex 2370c0ac..2a283a1b 100644--- a/scripts/test-spaces-model.ts+++ b/scripts/test-spaces-model.ts@@ -55,6 +55,11 @@ import {CLASS_OK, keepClasses,} from '../spaces/src/marks.ts'import { extractSpace, planGraft, subtreeIds } from '../spaces/src/portable.ts'+import { pageToDeck } from '../spaces/src/todeck.ts'+// CROSS-ZONE READ-ONLY: bento/slides' own load gate and its generated key list.+// Nothing under slides/ is written by this rig or by the feature it covers.+import { parseDoc as slidesParseDoc } from '../slides/src/model.ts'+import { MODEL_KEYS } from '../slides/src/modelkeys.generated.ts'import { planUpdatePage } from '../spaces/src/agent.ts'import { tokenize, normLang, langLabel, CODE_LANGS } from '../spaces/src/highlight.ts'import { escText, externalHref } from '../spaces/src/sanitize.ts'@@ -3882,6 +3887,395 @@ function fsTable(f: string): string {}++// ---------------------------------------------------------------------------+// PAGE → DECK (spaces/src/todeck.ts)+//+// CROSS-ZONE, AND SAID OUT LOUD. This block imports `slides/src/model.ts` and+// `slides/src/modelkeys.generated.ts` to READ — nothing under `slides/` is+// edited by the branch that added this. That is the only guard there is on the+// other side: bento/slides has no rig that knows this exporter exists, so the+// two things below are what stand between us and silent drift.+//+// · `parseDoc` is slides' OWN load gate. If the emitted document stops being+// loadable — the format string, the version, an empty slides array — this+// fails here rather than in somebody's browser.+// · MODEL_KEYS is generated FROM slides' model. Asserting that every key this+// exporter writes is in it turns "slides renamed a field" into a red rig+// instead of a property the renderer silently ignores.+//+// Everything here is BEHAVIOURAL: build a page, run the exporter, assert on the+// document that comes out. Source greps pass straight through live regressions+// in this zone — measured twice on #392.+{+ const deckDoc = (pages: unknown[], over: Record<string, unknown> = {}): SpacesDoc => ({+ format: FORMAT, version: 1, docId: 'd1', title: 'Space',+ theme: { background: '#FFFFFF', color: '#1E2A3A', accent: '#F7A600', fontFamily: 'Georgia' },+ pages, ...over,+ } as unknown as SpacesDoc)++ const PNG = 'data:image/png;base64,iVBORw0KGgo='++ const page = (blocks: unknown[], over: Record<string, unknown> = {}) =>+ ({ id: 'p1', title: 'Launch plan', blocks, ...over })++ // --- 1. it LOADS. slides' own gate, not ours.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'Why now' },+ { id: 'b2', type: 'p', html: 'Because.' },+ ])]), 'p1', { docId: 'deck', now: '' })+ const loaded = slidesParseDoc(JSON.stringify(out.doc))+ ok(!!loaded, 'the emitted document loads through bento/slides own parseDoc')+ ok(!!loaded && loaded.slides.length === out.slides,+ `parseDoc keeps every slide the exporter counted (${out.slides})`)+ ok(out.doc.title === 'Launch plan', 'the deck is titled after the page, not the space')+ ok(out.doc.theme.fontFamily === 'Georgia' && out.doc.theme.accent === '#F7A600',+ 'the space theme carries across to the deck theme')+ }++ // --- 2. every key is a key bento/slides has. THE drift detector.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'H' },+ { id: 'b2', type: 'p', html: 'p' },+ { id: 'b3', type: 'table', rows: [['a', 'b'], ['1', '2']], cols: [1, 1], colAlign: ['', 'right'] },+ { id: 'b4', type: 'image', src: 'asset:k' },+ { id: 'b5', type: 'media', src: 'asset:k', kind: 'video' },+ ], { icon: '🚀', cover: 'asset:k' })], { assets: { k: PNG } }), 'p1', { docId: 'd', now: '' })++ // quiet: one line per element type would drown the rig's output+ const seenTypes = new Set<string>()+ const ok2 = (cond: boolean, msg: string): void => {+ if (cond && seenTypes.has(msg)) return+ seenTypes.add(msg)+ ok(cond, msg)+ }+ const docKeys = MODEL_KEYS.doc as string[]+ const slideKeys = MODEL_KEYS.slide as string[]+ const bad: string[] = []+ for (const k of Object.keys(out.doc)) if (!docKeys.includes(k)) bad.push(`doc.${k}`)+ for (const s of out.doc.slides) {+ for (const k of Object.keys(s)) if (!slideKeys.includes(k)) bad.push(`slide.${k}`)+ const byType = MODEL_KEYS.element as unknown as Record<string, string[]>+ for (const e of s.elements) {+ const allowed = Object.hasOwn(byType, e.type) ? byType[e.type] : []+ ok2(allowed.length > 0, `bento/slides knows an element type called ${e.type}`)+ for (const k of Object.keys(e)) if (!allowed.includes(k)) bad.push(`${e.type}.${k}`)+ // a table's nested shapes are their own key lists over there+ if (e.type === 'table') {+ const tbl = e as unknown as { style: object; rows: Array<{ cells: object[] }> }+ const styleKeys = (MODEL_KEYS as unknown as Record<string, string[]>).tableStyle+ const cellKeys = (MODEL_KEYS as unknown as Record<string, string[]>).tableCell+ for (const k of Object.keys(tbl.style)) if (!styleKeys.includes(k)) bad.push(`tableStyle.${k}`)+ for (const r of tbl.rows) for (const c of r.cells) {+ for (const k of Object.keys(c)) if (!cellKeys.includes(k)) bad.push(`tableCell.${k}`)+ }+ }+ }+ }+ ok(bad.length === 0, `every key the exporter writes exists in bento/slides model (${bad.join(', ') || 'none unknown'})`)+ }++ // --- 3. what starts a slide, and what does not.+ {+ const titles = (blocks: unknown[]): string[] =>+ pageToDeck(deckDoc([page(blocks)]), 'p1', { docId: 'd', now: '' })+ .doc.slides.slice(1) // [0] is the title slide+ .map((s) => {+ const el = s.elements.find((e) => e.type === 'text' && (e as { role?: string }).role === 'title')+ return el ? (el as { html: string }).html : ''+ })++ ok(titles([+ { id: '1', type: 'h1', html: 'One' },+ { id: '2', type: 'p', html: 'a' },+ { id: '3', type: 'h2', html: 'Two' },+ { id: '4', type: 'p', html: 'b' },+ ]).join('|') === 'One|Two', 'h1 and h2 each start a slide and become its title')++ ok(titles([+ { id: '1', type: 'h1', html: 'One' },+ { id: '2', type: 'p', html: 'a' },+ { id: '3', type: 'h3', html: 'Sub' },+ { id: '4', type: 'p', html: 'b' },+ ]).join('|') === 'One', 'h3 does NOT start a slide — a deck of sub-sub-headings is a deck nobody wrote')++ ok(titles([+ { id: '1', type: 'p', html: 'a' },+ { id: '2', type: 'divider' },+ { id: '3', type: 'p', html: 'b' },+ ]).length === 2, 'a divider starts a second, untitled slide')+ }++ // --- 4. NO NETWORK (PLATFORM §1). Nothing the deck carries may be fetchable.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'Pictures' },+ { id: 'b2', type: 'image', src: 'http://tracker.example/p.png', alt: 'remote' },+ { id: 'b3', type: 'image', src: 'asset:evil' },+ { id: 'b4', type: 'image', src: 'asset:good' },+ { id: 'b5', type: 'media', src: 'https://cdn.example/v.mp4', kind: 'video' },+ ], { cover: 'https://cdn.example/c.jpg' })], {+ // THE INDIRECTION BUG THIS ZONE SHIPPED ONCE: `asset:evil` is local by+ // inspection and remote after the table has had its say. The question has+ // to be asked about the RESOLVED value.+ assets: { evil: 'http://tracker.example/hidden.png', good: PNG },+ }), 'p1', { docId: 'd', now: '' })++ const srcs: string[] = []+ for (const s of out.doc.slides) {+ for (const e of s.elements) {+ for (const k of ['src', 'poster']) {+ const v = (e as unknown as Record<string, unknown>)[k]+ if (typeof v === 'string' && v) srcs.push(v)+ }+ }+ }+ const table = out.doc.assets ?? {}+ const values = Object.keys(table).map((k) => String(table[k]))+ // AFTER THE TABLE HAS HAD ITS SAY. The first draft of this asked about the+ // string on the element, which is the exact hole #396 closed on the reading+ // side: `asset:k` is local by inspection and `assets.k` is whatever the+ // document says. Sabotaging the exporter's gate left every element src+ // reading `asset:…` and the bytes behind one of them still an http url, and+ // this assertion passed. It resolves now.+ const resolved = (v: string): string =>+ v.startsWith('asset:')+ ? (Object.hasOwn(out.doc.assets ?? {}, v.slice(6)) ? String((out.doc.assets ?? {})[v.slice(6)]) : '')+ : v+ ok(srcs.map(resolved).every((v) => v.startsWith('data:')),+ `no element src reaches the network once the deck's own asset table has had its say (${srcs.length} checked)`)+ ok(srcs.filter((v) => v.startsWith('asset:'))+ .every((v) => Object.hasOwn(table, v.slice(6))),+ 'every asset: ref the deck carries resolves in the DECK’s own table — no dangling ref to the space it came from')+ ok(values.length > 0 && values.every((v) => v.startsWith('data:')),+ `every asset the deck carries is embedded bytes (${values.length})`)+ ok(out.notes.filter((n) => n.code === 'image-remote').reduce((a, n) => a + n.n, 0) === 3,+ 'all three would-be-fetched pictures (a cover, a plain url, one behind an asset key) are reported')+ ok(out.notes.some((n) => n.code === 'media-remote'), 'a remote clip is reported too')+ // and the good one really did travel+ ok(values.includes(PNG), 'the local picture travelled as its bytes')+ }++ // --- 5. untrusted markup never reaches the deck.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: '<img src=x onerror="alert(1)">Head' },+ { id: 'b2', type: 'p', html: 'a <a href="javascript:alert(1)">link</a> b' },+ { id: 'b3', type: 'p', html: '<script>alert(1)</script><b>bold</b>' },+ // THE CASE THAT MAKES ESCAPING LOAD-BEARING. A raw `<script>` is already+ // gone by the time marks.ts has parsed the runs — so a rig that only+ // tests that one passes with the escaping REMOVED (measured). An+ // entity-encoded tag survives parsing as TEXT and becomes live markup the+ // moment it is written back out unescaped.+ { id: 'b5', type: 'p', html: '<img src=x onerror=alert(1)> and <script>bad()</script>' },+ { id: 'b4', type: 'table', rows: [['<img onerror=alert(1)>', 'ok']], cols: [1, 1] },+ ])]), 'p1', { docId: 'd', now: '' })+ // ABOUT THE TAGS, not about substrings of the JSON. The escaped form of an+ // attack is TEXT that legitimately contains the word "onerror", so a+ // substring test on the serialized document is both a false alarm there and+ // (measured) no alarm at all where it matters.+ const htmls: string[] = []+ for (const sl of out.doc.slides) {+ for (const e of sl.elements) {+ const h = (e as unknown as { html?: unknown }).html+ if (typeof h === 'string') htmls.push(h)+ const rows = (e as unknown as { rows?: Array<{ cells: Array<{ html: string }> }> }).rows+ if (rows) for (const r of rows) for (const c of r.cells) htmls.push(c.html)+ }+ }+ const OKTAG = /^<\/?(strong|em|u|s|code|br|ul|ol|li)>$/+ const tags = htmls.flatMap((h) => h.match(/<[^>]*>/g) ?? [])+ const rogue = tags.filter((tg) => !OKTAG.test(tg))+ ok(rogue.length === 0,+ `every tag in the deck's html is one bento/slides renders, attribute-free (${rogue.slice(0, 3).join(' ') || `${tags.length} tags, all clean`})`)+ ok(!htmls.some((h) => /javascript:/i.test(h)), 'no javascript: url survives into the deck')+ ok(!tags.some((tg) => /^<a\b/i.test(tg)), 'no <a> survives — bento/slides unwraps it anyway, so the words are what is kept')+ ok(htmls.some((h) => h.includes('<strong>bold</strong>')),+ 'the marks that DO survive are still there — the guard is not "strip everything"')+ ok(htmls.some((h) => h.includes('<img')),+ 'an entity-encoded tag stays encoded — it is text, and it goes on being text')+ ok(out.notes.some((n) => n.code === 'link-flattened'), 'the lost address is reported, not silent')+ }++ // --- 6. a prototype key in the asset table is a lookup, never a function.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'image', src: 'asset:toString' },+ { id: 'b2', type: 'image', src: 'asset:constructor' },+ ])], { assets: {} }), 'p1', { docId: 'd', now: '' })+ const all = JSON.stringify(out.doc)+ ok(!all.includes('native code') && !all.includes('function '),+ 'asset:toString resolves to nothing, never to a stringified native function')+ }++ // --- 7. tables: shape, alignment, header, and the split that is reported.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'Numbers' },+ {+ id: 'b2', type: 'table', header: true,+ rows: [['Q', 'Rev'], ['Q1', '<b>10</b>'], ['Q2', '20']],+ cols: [2, 1], colAlign: ['', 'right'],+ },+ ])]), 'p1', { docId: 'd', now: '' })+ const tbl = out.doc.slides.flatMap((s) => s.elements).find((e) => e.type === 'table') as+ undefined | { columns: Array<{ w: number }>; rows: Array<{ cells: Array<{ html: string; align?: string }> }>; header: boolean }+ ok(!!tbl, 'a spaces table becomes a bento/slides table element')+ ok(!!tbl && tbl.header === true && tbl.rows.length === 3, 'header flag and row count carry')+ ok(!!tbl && tbl.columns.map((c) => c.w).join(',') === '2,1', 'fractional column weights carry')+ ok(!!tbl && tbl.rows[1].cells[1].align === 'right' && tbl.rows[0].cells[1].align === 'right',+ 'per-COLUMN alignment becomes per-cell alignment on every row, header included')+ ok(!!tbl && /<strong>10<\/strong>/.test(tbl.rows[1].cells[1].html),+ 'a cell keeps the marks it had')++ // THE BOX MUST BE TALL ENOUGH FOR ITS OWN ROWS. A bento/slides table draws+ // into a fixed-height element, so a box shorter than its content CLIPS —+ // the first end-to-end render showed three of five rows and the fourth cut+ // through the middle, and nothing in this rig or in slides' validate()+ // said a word. The bound is derived from the style the exporter itself+ // writes, so it moves with a font-size change instead of pinning a+ // constant: one line of text, plus the cell padding, plus the rule.+ {+ const t2 = tbl as unknown as {+ h: number; rows: unknown[]+ style: { fontSize: number; cellPadY: number; borderWidth: number }+ }+ const minRow = t2.style.fontSize * 1.2 + t2.style.cellPadY * 2 + t2.style.borderWidth+ ok(t2.h >= t2.rows.length * minRow,+ `the table box is tall enough for every row it holds (${t2.h}px for ${t2.rows.length} rows, ${Math.ceil(minRow)}px each)`)+ }++ const tall = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'Long' },+ { id: 'b2', type: 'table', header: true, rows: [['name', 'n'], ...Array.from({ length: 60 }, (_, i) => [`r${i}`, `${i}`])], cols: [1, 1] },+ ])]), 'p1', { docId: 'd', now: '' })+ const tables = tall.doc.slides.flatMap((s) => s.elements).filter((e) => e.type === 'table')+ ok(tables.length > 1, `a table too tall for one slide continues on the next (${tables.length} parts)`)+ ok(tall.notes.some((n) => n.code === 'table-split'), '…and says so')+ const carried = tables.reduce((a, e) => a + ((e as { rows: unknown[] }).rows.length - 1), 0)+ ok(carried === 60, `every body row travels across the split (${carried}/60) — a silent truncation is the failure mode here`)+ }++ // --- 8. lists become real <ul>/<ol>, with nesting and to-do state.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'bullet', html: 'One' },+ { id: 'b2', type: 'bullet', html: 'Nested', parent: 'b1' },+ { id: 'b3', type: 'bullet', html: 'Two' },+ ])]), 'p1', { docId: 'd', now: '' })+ const html = out.doc.slides.flatMap((s) => s.elements)+ .filter((e) => e.type === 'text').map((e) => (e as { html: string }).html).join('')+ ok(/<ul>.*<li>One<\/li>.*<ul>.*<li>Nested<\/li>.*<\/ul>.*<li>Two<\/li>/s.test(html),+ 'a bullet run becomes one nested <ul>, in document order')++ const todo = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'todo', html: 'Done', done: true },+ { id: 'b2', type: 'todo', html: 'Not', done: false },+ ])]), 'p1', { docId: 'd', now: '' })+ const th = todo.doc.slides.flatMap((s) => s.elements)+ .filter((e) => e.type === 'text').map((e) => (e as { html: string }).html).join('')+ ok(th.includes('☑ Done') && th.includes('☐ Not'), 'a to-do carries whether it is ticked')+ }++ // --- 9. a canvas keeps the arrangement the author made.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'canvas', html: 'Roadmap' },+ { id: 'b2', type: 'p', html: 'Left', parent: 'b1', x: 0, y: 0 },+ { id: 'b3', type: 'p', html: 'Right', parent: 'b1', x: 90, y: 80 },+ ])]), 'p1', { docId: 'd', now: '' })+ const texts = out.doc.slides.flatMap((s) => s.elements)+ .filter((e) => e.type === 'text') as Array<{ html: string; x: number; y: number; w: number; h: number }>+ const left = texts.find((e) => e.html.includes('Left'))+ const right = texts.find((e) => e.html.includes('Right'))+ ok(!!left && !!right && right.x > left.x && right.y > left.y,+ 'a card further right and further down on the canvas is further right and down on the slide')+ ok(out.notes.some((n) => n.code === 'canvas-flattened'), 'and the invented card size is reported')+ }++ // --- 10. a board exports the ROWS it stands for, not the word "Issues".+ {+ const spaceDoc = deckDoc([+ page([{ id: 'v1', type: 'view', html: 'Backlog' }]),+ { id: 'i1', title: 'Fix the thing', blocks: [{ id: 'x1', type: 'prop', key: 'status', value: 'todo', html: 'Status: To do' }] },+ { id: 'i2', title: 'Ship the other', blocks: [{ id: 'x2', type: 'prop', key: 'status', value: 'doing', html: 'Status: In progress' }] },+ ])+ const out = pageToDeck(spaceDoc, 'p1', { docId: 'd', now: '' })+ const tbl = out.doc.slides.flatMap((s) => s.elements).find((e) => e.type === 'table') as+ undefined | { rows: Array<{ cells: Array<{ html: string }> }> }+ const cells = tbl ? tbl.rows.flatMap((r) => r.cells.map((c) => c.html)).join('|') : ''+ ok(cells.includes('Fix the thing') && cells.includes('Ship the other'),+ 'a view block exports the issues it stands for, by name')+ ok(out.notes.some((n) => n.code === 'view-derived'), 'and says what it did')+ }++ // --- 11. nothing lands off the canvas.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'A page with a lot on it' },+ ...Array.from({ length: 40 }, (_, i) => ({ id: `p${i}`, type: 'p', html: `Paragraph number ${i} with a reasonable amount of prose in it.` })),+ { id: 'c1', type: 'canvas', html: 'Board' },+ { id: 'c2', type: 'p', html: 'Far corner', parent: 'c1', x: 100, y: 100 },+ ])]), 'p1', { docId: 'd', now: '' })+ const off: string[] = []+ for (const s of out.doc.slides) {+ for (const e of s.elements) {+ const b = e as unknown as { x: number; y: number; w: number; h: number; type: string }+ if (b.x < 0 || b.y < 0 || b.x + b.w > 1280 || b.y + b.h > 720) off.push(`${b.type}@${b.x},${b.y} ${b.w}x${b.h}`)+ }+ }+ ok(off.length === 0, `no element sits off the 1280x720 canvas (${off.slice(0, 3).join('; ') || 'all inside'})`)+ ok(out.doc.slides.length > 2, `a long page spills onto continuation slides (${out.doc.slides.length})`)+ }++ // --- 12. loss reaches the FILE, not only the dialog.+ {+ const out = pageToDeck(deckDoc([page([+ { id: 'b1', type: 'h1', html: 'Risks' },+ { id: 'b2', type: 'toggle', html: 'Hidden detail', open: false },+ { id: 'b3', type: 'p', html: 'Inside the fold', parent: 'b2' },+ ])]), 'p1', { docId: 'd', now: '' })+ const notes = out.doc.slides.map((s) => s.notes).join('\n')+ ok(out.notes.some((n) => n.code === 'toggle-open'), 'a fold shown open is reported')+ ok(notes.trim().length > 0, 'the report is written into the deck’s own speaker notes, so it survives the hand-off')+ const body = out.doc.slides.flatMap((s) => s.elements)+ .filter((e) => e.type === 'text').map((e) => (e as { html: string }).html).join('')+ ok(body.includes('Inside the fold'),+ 'a closed fold’s content is CARRIED, not hidden — a slide cannot fold, and dropping it would be data loss')+ }++ // --- 12b. a page icon is only sometimes an emoji.+ //+ // `Page.icon` is documented as one emoji, and the app also accepts a name from+ // its own icon set — the starter space's pages use those. Written onto a slide+ // as text it reads as the word "image" above the title, which is exactly what+ // the first end-to-end render into a built bento/slides shell showed.+ {+ const emoji = pageToDeck(deckDoc([page([{ id: 'b', type: 'p', html: 'x' }], { icon: '🚀' })]), 'p1', { docId: 'd', now: '' })+ const named = pageToDeck(deckDoc([page([{ id: 'b', type: 'p', html: 'x' }], { icon: 'image' })]), 'p1', { docId: 'd', now: '' })+ const htmlOf = (r: ReturnType<typeof pageToDeck>): string =>+ r.doc.slides[0].elements.filter((e) => e.type === 'text').map((e) => (e as { html: string }).html).join('|')+ ok(htmlOf(emoji).includes('🚀'), 'an emoji page icon travels onto the title slide')+ ok(!htmlOf(named).includes('image'), 'a NAMED icon does not — it would read as the word "image" above the title')+ ok(named.notes.some((n) => n.code === 'icon-glyph'), '…and it is reported rather than dropped in silence')+ ok(!emoji.notes.some((n) => n.code === 'icon-glyph'), 'an emoji is not reported as a loss')+ }++ // --- 13. the degenerate inputs still produce something that loads.+ {+ for (const [what, out] of [+ ['an empty page', pageToDeck(deckDoc([page([])]), 'p1', { docId: 'd', now: '' })],+ ['a page id that is not there', pageToDeck(deckDoc([page([])]), 'nope', { docId: 'd', now: '' })],+ ['a document with no theme', pageToDeck({ format: FORMAT, version: 1, docId: 'd', title: 'T', pages: [page([{ id: 'b', type: 'p', html: 'x' }])] } as unknown as SpacesDoc, 'p1', { docId: 'd', now: '' })],+ ] as Array<[string, ReturnType<typeof pageToDeck>]>) {+ ok(out.doc.slides.length > 0 && !!slidesParseDoc(JSON.stringify(out.doc)),+ `${what} still produces a deck that loads`)+ }+ }+}+// ---- 9. FOOTNOTES ----------------------------------------------------------//// The anchor is a TEXT TOKEN (`[^1]`) in a block's html and the number isdiff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex dae6dabc..a62fae2d 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -486,6 +486,31 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.2026, from the same file. `bento.journal()` opens today's for an agent, and`bento.journal('2026-08-06')` any day's.+- **A page becomes a deck.** Save → **Export page as slides…** turns one page+ into a `bento/slides` presentation: headings start slides, lists stay lists,+ a table stays a table, a board becomes a table of the rows it stands for, and+ a canvas becomes a slide with every card where you put it. The page's title,+ icon and cover make the title slide; the space's theme becomes the deck's.+ No hosted notes app can hand you a presentation you own outright, and this+ one can, because both apps are the same repository.++ **What it hands over is the deck's document JSON**, which you paste into+ Bento Slides through its own "Replace from JSON…" — not a finished+ `.bento.html`. A self-contained deck is a document spliced into a slides+ SHELL, and the only ways for this app to have one are bundling half a+ megabyte of another app into every space or fetching it, which is the one+ thing opening a document must never do. The Markdown export sets the+ precedent: write the other format faithfully and hand it over.++ **Nothing is fetched, and nothing is dropped in silence.** Every picture+ travels as its bytes, re-interned in the deck's own asset table; anything+ that would still reach the network — including bytes hidden one `asset:`+ indirection away, the hole closed on the reading side in 0.1.x — is left out+ and said out loud. The dialog lists what did not come across before you+ download anything, and the same list is written into the deck's speaker+ notes, so a presenter opening it next week is told too. Speaker notes are+ otherwise NOT invented: mapping review comments onto them would move a remark+ addressed to a person into a file people present from.- **A view's filter can ask a real question.** It had two things to say — "showme what is open" and "show me these values" — under five layouts that exist tohold books, tasks and dates. "Published after 2020", "due this week", "notdiff --git a/spaces/README.md b/spaces/README.mdindex 2b0638bb..0477c674 100644--- a/spaces/README.md+++ b/spaces/README.md@@ -88,6 +88,7 @@ load contract and format additivity.| `src/assets.ts` | content-addressed images and clips, and the image downscale || `src/assets.ts` | content-addressed images and the downscale || `src/portable.ts` | the two exits: a page out as its own space, another space in under a page |+| `src/todeck.ts` | a page out as a **`bento/slides` document** — the mapping, and what it says it dropped. Pure and DOM-free || `src/about.ts` | updates, language, password, exports || `src/i18n/` | per-locale catalogs; `packed.ts` is generated and is what ships |@@ -150,6 +151,54 @@ read from an inert `DOMParser` document, `parseDoc` decides whether it is aspace (refusing rather than degrading), and `sanitizeInline` runs over everyarriving block before any of it reaches the document.+### A page as a deck++**Save → Export page as slides…** turns one page into a `bento/slides`+DOCUMENT, which you paste into Bento Slides through its own "Replace from+JSON…" (or `window.bento.loadDoc()`). It is not a `.bento.html` deck: a+self-contained deck is a document spliced into a slides SHELL, this app has no+shell but its own, and the two ways to get one are bundling half a megabyte of+another app into every space or fetching it — which PLATFORM §1 forbids. So the+hand-off is the interchange path slides already documents, exactly as the+Markdown exporter hands over Markdown.++`src/todeck.ts` is the whole of it, pure and DOM-free so the mapping is asserted+in node. What it does:++| in a page | on a slide |+|---|---|+| `h1`, `h2` | start a new slide, and become its title |+| `divider` | starts a new slide with no title |+| `h3` | a bold lead-in inside the body |+| `p`, `quote`, `prop` | a text box; a quote gets an accent rule |+| `bullet`, `number`, `todo` | one text box holding a real `<ul>`/`<ol>`, nesting kept, `☐`/`☑` for a to-do |+| `code` | monospace text on a tinted panel (no highlighting — the grammar lives in assets a deck has none of) |+| `callout`, `toggle` | a tinted panel; a callout keeps its tone as a label, a toggle is shown open |+| `table` | a real slides table — column weights, per-column alignment, header — continued on further slides when it is too tall |+| `view` (board or list) | a table of the rows it stands for, same source, filter, sort and grouping as the screen |+| `canvas` | its own slide, each card placed where the author put it (percentages in, percentages out) |+| `image`, `media` | its own slide, bytes embedded |+| `link`, `pagelink` | the words, and the address as a second line — a slide has no inline link |+| the page's title, icon, cover | the title slide; a cover becomes a full-bleed background under a scrim |+| the theme | the deck's background, ink, accent and faces |++**Nothing is fetched and nothing dangles.** Every picture is resolved through+the asset table to its bytes and re-interned in the DECK's own `assets`;+anything that would still reach the network — including bytes hidden one+`asset:` indirection away — is left out. **Speaker notes are not invented**: a+page has no such concept, and mapping review comments onto them would move a+remark addressed to a person into a file people present from. What the notes+carry instead is the export's own account of what did not come across, the same+list the dialog shows before you download anything.++The deck is `bento/slides`, which is another app's format and another zone's+file. Nothing under `slides/` is edited for this; what holds the two together is+a TYPE-ONLY import of `slides/src/model.ts` (so a renamed field is a compile+error here) and a rig that runs the emitted document through slides' own+`parseDoc` and checks every key it writes against slides' generated key list.+Behaviour is not covered by anything on the slides side. That is a real cost and+it is written down rather than papered over.+### Links are fragments`#p/<id>`, and navigation is `history.pushState(null, '', '#p/id')`. Measured:diff --git a/spaces/src/editor.ts b/spaces/src/editor.tsindex 33bc9a4e..a6c9a7a2 100644--- a/spaces/src/editor.ts+++ b/spaces/src/editor.ts@@ -45,6 +45,7 @@ import { t, locale, localeChoices, setLocale, applyDirection } from './i18n'import { openAbout } from './about'import { saveRows, type DocHost } from './doccmds.ts'import { openGraphView } from './graph.ts'+import { pageToDeck, type DeckNote, type DeckNoteCode } from './todeck.ts'import {todayISO, stepDay, journalLabel, journalShort, isJournal, planJournal,} from './journal'@@ -54,6 +55,7 @@ import {} from './templateui.ts'import { canWriteInPlace, parseEnvelope } from '../../kernel/src/save.ts'import { offlineEnabled } from '../../kernel/src/net.ts'+import { withoutCaps } from '../../kernel/src/docfields.ts'import { startSharing } from '../../kernel/src/sync/online.ts'import * as shareModule from './share.ts'import { ICONS, type IconName } from './icons'@@ -86,6 +88,14 @@ const AUTOFORMAT = MD_SPECS/** The four keys caret.ts answers for. A Set so the keymap's hot path is one lookup. */const ARROWS = new Set(['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'])+/**+ * A page made into a slides deck, as it leaves the app (copied or downloaded).+ * pageToDeck builds a FRESH deck that carries no capability block today, but+ * a hand-out goes through the same stripper as every other one, so a deck+ * that ever grew a `collab` could not take it onto the clipboard+ * (scripts/test-export-secrets.ts: "a clipboard copy goes through a stripper").+ */+const deckForExport = <T extends object>(deck: T): T => withoutCaps(deck)/*** Below this width both side panels are DRAWERS over the page, not columns.* One number, handed to the kernel panel as `drawerBelow` (D6: the breakpoint@@ -5245,6 +5255,95 @@ export class Editor {})}+ /**+ * PAGE → DECK.+ *+ * What this hands over is the deck's DOCUMENT JSON, not a `.bento.html`+ * deck — src/todeck.ts explains why that is the honest scope from inside+ * this app. So the dialog's job is to say what the artefact IS and what to+ * do with it, and then to say, before anything is downloaded, exactly what+ * of this page did not survive the crossing. A silent lossy export is the+ * failure mode here; the summary is the feature.+ */+ openExportDeck(): void {+ const s = this.store+ this.openOverlay(t('Export a page as slides'), (card, close) => {+ card.append(el('h2', 'sp-card-h', t('Export a page as slides')))++ const what = document.createElement('p')+ what.className = 'sp-note'+ what.textContent = t('The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.')+ card.append(what)++ const pick = document.createElement('select')+ pick.className = 'sp-select'+ for (const { page, depth } of s.tree()) {+ const o = document.createElement('option')+ o.value = page.id+ o.textContent = `${'· '.repeat(depth)}${page.title || t('Untitled')}`+ if (page.id === s.pageId) o.selected = true+ pick.append(o)+ }+ const pageRow = el('div', 'sp-row')+ pageRow.append(el('span', '', t('Page')), pick)+ card.append(pageRow)++ const summary = document.createElement('p')+ summary.className = 'sp-note'+ const losses = document.createElement('ul')+ losses.className = 'sp-note'+ card.append(summary, losses)++ // Built from the REAL export, not described in the abstract — the same+ // choice openExportSpace makes, and for the same reason: the counts have+ // to move as the choice does or they are decoration.+ let out = pageToDeck(s.doc, pick.value)+ const recount = (): void => {+ out = pageToDeck(s.doc, pick.value)+ summary.textContent = t('{n} slide(s).', { n: out.slides })+ losses.textContent = ''+ if (!out.notes.length) return+ const head = document.createElement('li')+ head.textContent = t('What did not come across as it stands:')+ losses.append(head)+ for (const n of out.notes) {+ const li = document.createElement('li')+ li.textContent = n.n > 1 ? `${deckNoteText(n)} (×${n.n})` : deckNoteText(n)+ losses.append(li)+ }+ }+ pick.addEventListener('change', recount)+ recount()++ const name = (): string =>+ `${(s.doc.pages.find((p) => p.id === pick.value)?.title || 'deck').replace(/[^\w.-]+/g, '-')}.bento-slides.json`++ const copyB = plainBtn(t('Copy the deck JSON'), () => {+ navigator.clipboard?.writeText(JSON.stringify(deckForExport(out.doc), null, 2))+ .then(() => { copyB.textContent = t('Copied') })+ .catch(() => { copyB.textContent = t('Could not copy') })+ .finally(() => { setTimeout(() => { copyB.textContent = t('Copy the deck JSON') }, 1800) })+ })++ const acts = el('div', 'sp-actions')+ acts.append(+ plainBtn(t('Download the deck JSON'), () => {+ const blob = new Blob([JSON.stringify(deckForExport(out.doc), null, 2)], { type: 'application/json' })+ const a = document.createElement('a')+ a.href = URL.createObjectURL(blob)+ a.download = name()+ a.click()+ URL.revokeObjectURL(a.href)+ close()+ this.status(t('Exported {n} slide(s) as a deck', { n: out.slides }))+ }, true),+ copyB,+ plainBtn(t('Close'), close),+ )+ card.append(acts)+ })+ }+/*** Import, in ONE undoable step.*@@ -5793,6 +5892,10 @@ export class Editor {// handle, which is what leaves you editing this space afterwards.writeCopy: (out) => this.onExportSpace?.(out) ?? Promise.resolve(false),importMarkdown: () => this.openImport(),+ moreExports: (m) => {+ row(m, { icon: ICONS.canvas, label: t('Export page as slides…'),+ desc: t('The page as a bento/slides deck, ready to paste into Bento Slides'), run: () => this.openExportDeck() })+ },}}@@ -5957,6 +6060,38 @@ function plainBtn(label: string, onClick: () => void, primary = false): HTMLButtreturn b}+/**+ * One `DeckNote` in the reader's own language.+ *+ * A SWITCH OF LITERALS, deliberately, and not `t(TEXT[code])`. The i18n+ * extractor sweeps `t()` calls whose argument is a LITERAL STRING out of the+ * source; a lookup table would compile, run, report 100% coverage in the+ * packer, and ship English in all eight locales — which has already happened+ * once in this app, to the block menu labels. The document's own copy of these+ * sentences lives in todeck.ts and is deliberately English: a saved artefact's+ * words are its author's, not its next reader's browser's.+ */+function deckNoteText(n: DeckNote): string {+ const code: DeckNoteCode = n.code+ switch (code) {+ case 'image-remote': return t('A picture that lives on the web was left out — a deck never fetches.')+ case 'media-remote': return t('A clip that lives on the web was left out — a deck never fetches.')+ case 'media-embedded': return t('A clip travelled as embedded bytes, so the deck is large.')+ case 'link-flattened': return t('A link kept its words; a slide has nowhere to put the address.')+ case 'pagelink': return t('A card that opened another page became its title.')+ case 'toggle-open': return t('A fold is shown open — a slide cannot fold.')+ case 'callout-plain': return t('A callout kept its words and its kind, in a plain panel.')+ case 'canvas-flattened': return t('A canvas became a slide; the card sizes were chosen here.')+ case 'table-split': return t('A table was too tall for one slide and continues on the next.')+ case 'view-derived': return t('A board became a table of the rows it stood for.')+ case 'unknown-block': return t('A block this build does not know became its text.')+ case 'empty-block': return t('A block with nothing in it was left out.')+ case 'rtl': return t('This space reads right-to-left; a deck has no such setting.')+ case 'comments': return t('Review comments stayed behind, on purpose.')+ case 'icon-glyph': return t('The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.')+ }+}+// ---- dropped files ----------------------------------------------------------const normPath = (p: string): string =>diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.tsindex 24624325..3e6a6a8c 100644--- a/spaces/src/i18n/de.ts+++ b/spaces/src/i18n/de.ts@@ -656,6 +656,32 @@ export const de: Catalog = {"Date": "Datum","Person": "Person","Labels": "Labels",+ "Export page as slides…": "Seite als Folien exportieren…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "Die Seite als bento/slides-Präsentation, bereit zum Einfügen in Bento Slides",+ "Export a page as slides": "Eine Seite als Folien exportieren",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "Die Seite wird zum Dokument einer Präsentation. Öffnen Sie Bento Slides und verwenden Sie „Aus JSON ersetzen…“ im Info-Dialog – oder window.bento.loadDoc() aus einem Skript.",+ "{n} slide(s).": "{n} Folie(n).",+ "What did not come across as it stands:": "Was nicht unverändert mitgekommen ist:",+ "Copy the deck JSON": "Präsentations-JSON kopieren",+ "Could not copy": "Kopieren nicht möglich",+ "Download the deck JSON": "Präsentations-JSON herunterladen",+ "Exported {n} slide(s) as a deck": "Als Präsentation mit {n} Folie(n) exportiert",+ "A picture that lives on the web was left out — a deck never fetches.": "Ein Bild aus dem Web wurde weggelassen – eine Präsentation lädt nie etwas nach.",+ "A clip that lives on the web was left out — a deck never fetches.": "Ein Clip aus dem Web wurde weggelassen – eine Präsentation lädt nie etwas nach.",+ "A clip travelled as embedded bytes, so the deck is large.": "Ein Clip reiste als eingebettete Bytes mit, deshalb ist die Präsentation groß.",+ "A link kept its words; a slide has nowhere to put the address.": "Ein Link behielt seine Wörter; eine Folie hat keinen Platz für die Adresse.",+ "A card that opened another page became its title.": "Eine Karte, die eine andere Seite öffnete, wurde zu deren Titel.",+ "A fold is shown open — a slide cannot fold.": "Ein Aufklapper wird offen gezeigt – eine Folie kann nicht einklappen.",+ "A callout kept its words and its kind, in a plain panel.": "Ein Hinweis behielt seine Wörter und seine Art, in einer schlichten Fläche.",+ "A canvas became a slide; the card sizes were chosen here.": "Eine Leinwand wurde zu einer Folie; die Kartengrößen wurden hier gewählt.",+ "A table was too tall for one slide and continues on the next.": "Eine Tabelle war zu hoch für eine Folie und läuft auf der nächsten weiter.",+ "A board became a table of the rows it stood for.": "Ein Board wurde zu einer Tabelle der Zeilen, für die es stand.",+ "A block this build does not know became its text.": "Ein Block, den dieser Build nicht kennt, wurde zu seinem Text.",+ "A block with nothing in it was left out.": "Ein Block ohne Inhalt wurde weggelassen.",+ "This space reads right-to-left; a deck has no such setting.": "Dieser Raum wird von rechts nach links gelesen; eine Präsentation hat diese Einstellung nicht.",+ "Review comments stayed behind, on purpose.": "Review-Kommentare sind absichtlich zurückgeblieben.",+ "Copied": "Kopiert",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "Das Symbol der Seite ist eine der eigenen Glyphen dieser App, kein Emoji, und ist nicht mitgereist.",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.tsindex 2e4e3514..276ec9e4 100644--- a/spaces/src/i18n/es.ts+++ b/spaces/src/i18n/es.ts@@ -656,6 +656,32 @@ export const es: Catalog = {"Date": "Fecha","Person": "Persona","Labels": "Etiquetas",+ "Export page as slides…": "Exportar la página como diapositivas…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "La página como una presentación bento/slides, lista para pegar en Bento Slides",+ "Export a page as slides": "Exportar una página como diapositivas",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "La página se convierte en el documento de una presentación. Abre Bento Slides y usa «Reemplazar desde JSON…» en su diálogo Acerca de, o window.bento.loadDoc() desde un script.",+ "{n} slide(s).": "{n} diapositiva(s).",+ "What did not come across as it stands:": "Lo que no pasó tal cual:",+ "Copy the deck JSON": "Copiar el JSON de la presentación",+ "Could not copy": "No se pudo copiar",+ "Download the deck JSON": "Descargar el JSON de la presentación",+ "Exported {n} slide(s) as a deck": "Exportada como una presentación de {n} diapositiva(s)",+ "A picture that lives on the web was left out — a deck never fetches.": "Se dejó fuera una imagen alojada en la web: una presentación nunca descarga nada.",+ "A clip that lives on the web was left out — a deck never fetches.": "Se dejó fuera un clip alojado en la web: una presentación nunca descarga nada.",+ "A clip travelled as embedded bytes, so the deck is large.": "Un clip viajó como bytes incrustados, así que la presentación es grande.",+ "A link kept its words; a slide has nowhere to put the address.": "Un enlace conservó sus palabras; una diapositiva no tiene dónde poner la dirección.",+ "A card that opened another page became its title.": "Una tarjeta que abría otra página quedó como su título.",+ "A fold is shown open — a slide cannot fold.": "Un plegado se muestra abierto: una diapositiva no puede plegarse.",+ "A callout kept its words and its kind, in a plain panel.": "Un aviso conservó sus palabras y su tipo, en un panel sencillo.",+ "A canvas became a slide; the card sizes were chosen here.": "Un lienzo se convirtió en una diapositiva; el tamaño de las tarjetas se eligió aquí.",+ "A table was too tall for one slide and continues on the next.": "Una tabla no cabía en una diapositiva y continúa en la siguiente.",+ "A board became a table of the rows it stood for.": "Un tablero se convirtió en una tabla con las filas que representaba.",+ "A block this build does not know became its text.": "Un bloque que esta versión no conoce quedó como su texto.",+ "A block with nothing in it was left out.": "Se dejó fuera un bloque sin nada dentro.",+ "This space reads right-to-left; a deck has no such setting.": "Este espacio se lee de derecha a izquierda; una presentación no tiene ese ajuste.",+ "Review comments stayed behind, on purpose.": "Los comentarios de revisión se quedaron atrás, a propósito.",+ "Copied": "Copiado",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "El icono de la página es uno de los glifos propios de esta aplicación, no un emoji, y no viajó.",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.tsindex aa08d485..ce81b76b 100644--- a/spaces/src/i18n/fr.ts+++ b/spaces/src/i18n/fr.ts@@ -656,6 +656,32 @@ export const fr: Catalog = {"Date": "Date","Person": "Personne","Labels": "Étiquettes",+ "Export page as slides…": "Exporter la page en diapositives…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "La page sous forme de présentation bento/slides, prête à coller dans Bento Slides",+ "Export a page as slides": "Exporter une page en diapositives",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "La page devient le document d’une présentation. Ouvrez Bento Slides et utilisez « Remplacer depuis JSON… » dans sa boîte À propos, ou window.bento.loadDoc() depuis un script.",+ "{n} slide(s).": "{n} diapositive(s).",+ "What did not come across as it stands:": "Ce qui n’est pas passé tel quel :",+ "Copy the deck JSON": "Copier le JSON de la présentation",+ "Could not copy": "Copie impossible",+ "Download the deck JSON": "Télécharger le JSON de la présentation",+ "Exported {n} slide(s) as a deck": "Exportée en une présentation de {n} diapositive(s)",+ "A picture that lives on the web was left out — a deck never fetches.": "Une image hébergée sur le web a été laissée de côté — une présentation ne télécharge jamais rien.",+ "A clip that lives on the web was left out — a deck never fetches.": "Un clip hébergé sur le web a été laissé de côté — une présentation ne télécharge jamais rien.",+ "A clip travelled as embedded bytes, so the deck is large.": "Un clip a voyagé sous forme d’octets intégrés : la présentation est donc volumineuse.",+ "A link kept its words; a slide has nowhere to put the address.": "Un lien a gardé ses mots ; une diapositive n’a nulle part où mettre l’adresse.",+ "A card that opened another page became its title.": "Une carte qui ouvrait une autre page est devenue son titre.",+ "A fold is shown open — a slide cannot fold.": "Un repli est affiché ouvert — une diapositive ne se replie pas.",+ "A callout kept its words and its kind, in a plain panel.": "Un encadré a gardé ses mots et son type, dans un panneau simple.",+ "A canvas became a slide; the card sizes were chosen here.": "Un canevas est devenu une diapositive ; la taille des cartes a été choisie ici.",+ "A table was too tall for one slide and continues on the next.": "Un tableau était trop haut pour une diapositive et se poursuit sur la suivante.",+ "A board became a table of the rows it stood for.": "Un tableau de bord est devenu un tableau des lignes qu’il représentait.",+ "A block this build does not know became its text.": "Un bloc que cette version ne connaît pas est devenu son texte.",+ "A block with nothing in it was left out.": "Un bloc sans rien dedans a été laissé de côté.",+ "This space reads right-to-left; a deck has no such setting.": "Cet espace se lit de droite à gauche ; une présentation n’a pas ce réglage.",+ "Review comments stayed behind, on purpose.": "Les commentaires de relecture sont restés en arrière, volontairement.",+ "Copied": "Copié",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "L’icône de la page est l’un des glyphes propres à cette application, pas un émoji, et n’a pas voyagé.",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.tsindex d73773b9..321fde47 100644--- a/spaces/src/i18n/it.ts+++ b/spaces/src/i18n/it.ts@@ -656,6 +656,32 @@ export const it: Catalog = {"Date": "Data","Person": "Persona","Labels": "Etichette",+ "Export page as slides…": "Esporta la pagina come diapositive…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "La pagina come presentazione bento/slides, pronta da incollare in Bento Slides",+ "Export a page as slides": "Esporta una pagina come diapositive",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "La pagina diventa il documento di una presentazione. Apri Bento Slides e usa «Sostituisci da JSON…» nella finestra Informazioni, oppure window.bento.loadDoc() da uno script.",+ "{n} slide(s).": "{n} diapositiva/e.",+ "What did not come across as it stands:": "Ciò che non è passato così com’era:",+ "Copy the deck JSON": "Copia il JSON della presentazione",+ "Could not copy": "Copia non riuscita",+ "Download the deck JSON": "Scarica il JSON della presentazione",+ "Exported {n} slide(s) as a deck": "Esportata come presentazione di {n} diapositiva/e",+ "A picture that lives on the web was left out — a deck never fetches.": "Un’immagine che vive sul web è stata esclusa: una presentazione non scarica mai nulla.",+ "A clip that lives on the web was left out — a deck never fetches.": "Una clip che vive sul web è stata esclusa: una presentazione non scarica mai nulla.",+ "A clip travelled as embedded bytes, so the deck is large.": "Una clip ha viaggiato come byte incorporati, perciò la presentazione è grande.",+ "A link kept its words; a slide has nowhere to put the address.": "Un collegamento ha mantenuto le parole; una diapositiva non ha dove mettere l’indirizzo.",+ "A card that opened another page became its title.": "Una scheda che apriva un’altra pagina è diventata il suo titolo.",+ "A fold is shown open — a slide cannot fold.": "Una piega è mostrata aperta: una diapositiva non può piegarsi.",+ "A callout kept its words and its kind, in a plain panel.": "Un riquadro ha mantenuto le parole e il suo tipo, in un pannello semplice.",+ "A canvas became a slide; the card sizes were chosen here.": "Una tela è diventata una diapositiva; le dimensioni delle schede sono state scelte qui.",+ "A table was too tall for one slide and continues on the next.": "Una tabella era troppo alta per una diapositiva e prosegue in quella successiva.",+ "A board became a table of the rows it stood for.": "Una bacheca è diventata una tabella delle righe che rappresentava.",+ "A block this build does not know became its text.": "Un blocco che questa versione non conosce è diventato il suo testo.",+ "A block with nothing in it was left out.": "Un blocco senza nulla dentro è stato escluso.",+ "This space reads right-to-left; a deck has no such setting.": "Questo spazio si legge da destra a sinistra; una presentazione non ha questa impostazione.",+ "Review comments stayed behind, on purpose.": "I commenti di revisione sono rimasti indietro, di proposito.",+ "Copied": "Copiato",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "L’icona della pagina è uno dei glifi propri di questa app, non un’emoji, e non ha viaggiato.",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.tsindex 6268acaa..8eabe509 100644--- a/spaces/src/i18n/ja.ts+++ b/spaces/src/i18n/ja.ts@@ -656,6 +656,32 @@ export const ja: Catalog = {"Date": "日付","Person": "担当者","Labels": "ラベル",+ "Export page as slides…": "ページをスライドとして書き出す…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "ページを bento/slides のデッキにして、Bento Slides に貼り付けられる形にします",+ "Export a page as slides": "ページをスライドとして書き出す",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "ページがデッキのドキュメントになります。Bento Slides を開き、情報ダイアログの「JSON から置き換え…」を使ってください。スクリプトからは window.bento.loadDoc() です。",+ "{n} slide(s).": "スライド {n} 枚。",+ "What did not come across as it stands:": "そのままの形では移らなかったもの:",+ "Copy the deck JSON": "デッキの JSON をコピー",+ "Could not copy": "コピーできませんでした",+ "Download the deck JSON": "デッキの JSON をダウンロード",+ "Exported {n} slide(s) as a deck": "スライド {n} 枚のデッキとして書き出しました",+ "A picture that lives on the web was left out — a deck never fetches.": "ウェブ上にある画像は除きました — デッキは決して取得しません。",+ "A clip that lives on the web was left out — a deck never fetches.": "ウェブ上にあるクリップは除きました — デッキは決して取得しません。",+ "A clip travelled as embedded bytes, so the deck is large.": "クリップはバイト列として埋め込まれたため、デッキは大きくなっています。",+ "A link kept its words; a slide has nowhere to put the address.": "リンクは文字だけ残りました。スライドにはアドレスを置く場所がありません。",+ "A card that opened another page became its title.": "別のページを開くカードは、その見出しになりました。",+ "A fold is shown open — a slide cannot fold.": "折りたたみは開いた状態です — スライドは折りたためません。",+ "A callout kept its words and its kind, in a plain panel.": "コールアウトは文字と種類を保ち、装飾のないパネルになりました。",+ "A canvas became a slide; the card sizes were chosen here.": "キャンバスはスライドになりました。カードの大きさはこちらで決めています。",+ "A table was too tall for one slide and continues on the next.": "表が 1 枚に収まらず、次のスライドへ続いています。",+ "A board became a table of the rows it stood for.": "ボードは、それが表していた行の表になりました。",+ "A block this build does not know became its text.": "このビルドが知らないブロックは、その文字になりました。",+ "A block with nothing in it was left out.": "中身のないブロックは除きました。",+ "This space reads right-to-left; a deck has no such setting.": "このスペースは右から左へ読みます。デッキにはその設定がありません。",+ "Review comments stayed behind, on purpose.": "レビューのコメントは、意図的に持ち出していません。",+ "Copied": "コピーしました",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "このページのアイコンは絵文字ではなく本アプリ独自のグリフのため、持ち出せませんでした。",// view conditions (query.ts)"{field} {op} {value}": "{field} が {value} {op}",diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.tsindex 80fe059c..265acd93 100644--- a/spaces/src/i18n/packed.ts+++ b/spaces/src/i18n/packed.ts@@ -13,11 +13,21 @@ export const PACKED_LOCALES = ["ja","zh-Hans","zh-Hant","es","fr","de","it","pt"export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"A block nests under the one above it — this one has nothing above it": ["ブロックは一つ上のブロックの中に入ります — このブロックより上には何もありません","块会嵌套在它上面的那个块里 — 这个块上面没有别的块","區塊會巢狀於它上面的那個區塊 — 這個區塊上面沒有別的區塊","Un bloque se anida bajo el que tiene encima — este no tiene ninguno encima","Un bloc s’imbrique sous celui qui le précède — celui-ci n’a rien au-dessus","Ein Block wird unter dem darüberliegenden verschachtelt — über diesem steht nichts","Un blocco si annida sotto quello che lo precede — sopra questo non c’è nulla","Um bloco aninha-se sob o que está acima — este não tem nada acima"],+ "A block this build does not know became its text.": ["このビルドが知らないブロックは、その文字になりました。","此版本不认识的块变成了它的文字。","此版本不認識的區塊變成了它的文字。","Un bloque que esta versión no conoce quedó como su texto.","Un bloc que cette version ne connaît pas est devenu son texte.","Ein Block, den dieser Build nicht kennt, wurde zu seinem Text.","Un blocco che questa versione non conosce è diventato il suo testo.","Um bloco que esta versão não conhece passou a ser o seu texto."],+ "A block with nothing in it was left out.": ["中身のないブロックは除きました。","空无内容的块被略去了。","空無內容的區塊被略過了。","Se dejó fuera un bloque sin nada dentro.","Un bloc sans rien dedans a été laissé de côté.","Ein Block ohne Inhalt wurde weggelassen.","Un blocco senza nulla dentro è stato escluso.","Um bloco sem nada dentro ficou de fora."],+ "A board became a table of the rows it stood for.": ["ボードは、それが表していた行の表になりました。","看板变成了它所代表的那些行的表格。","看板變成了它所代表的那些列的表格。","Un tablero se convirtió en una tabla con las filas que representaba.","Un tableau de bord est devenu un tableau des lignes qu’il représentait.","Ein Board wurde zu einer Tabelle der Zeilen, für die es stand.","Una bacheca è diventata una tabella delle righe che rappresentava.","Um quadro passou a ser uma tabela das linhas que representava."],+ "A callout kept its words and its kind, in a plain panel.": ["コールアウトは文字と種類を保ち、装飾のないパネルになりました。","标注保留了文字和类型,放在一个朴素的面板里。","標註保留了文字和類型,放在一個樸素的面板裡。","Un aviso conservó sus palabras y su tipo, en un panel sencillo.","Un encadré a gardé ses mots et son type, dans un panneau simple.","Ein Hinweis behielt seine Wörter und seine Art, in einer schlichten Fläche.","Un riquadro ha mantenuto le parole e il suo tipo, in un pannello semplice.","Um destaque manteve as palavras e o seu tipo, num painel simples."],+ "A canvas became a slide; the card sizes were chosen here.": ["キャンバスはスライドになりました。カードの大きさはこちらで決めています。","画布变成了一张幻灯片;卡片大小由这里决定。","畫布變成了一張投影片;卡片大小由這裡決定。","Un lienzo se convirtió en una diapositiva; el tamaño de las tarjetas se eligió aquí.","Un canevas est devenu une diapositive ; la taille des cartes a été choisie ici.","Eine Leinwand wurde zu einer Folie; die Kartengrößen wurden hier gewählt.","Una tela è diventata una diapositiva; le dimensioni delle schede sono state scelte qui.","Uma tela passou a ser um slide; os tamanhos dos cartões foram escolhidos aqui."],"A card for an address you type": ["入力したアドレスのカード","为你输入的网址生成的卡片","為你輸入的網址產生的卡片","Una tarjeta para una dirección que escribas","Une carte pour une adresse que vous saisissez","Eine Karte für eine Adresse, die du eingibst","Una scheda per un indirizzo che digiti","Um cartão para um endereço que escreves"],+ "A card that opened another page became its title.": ["別のページを開くカードは、その見出しになりました。","打开另一个页面的卡片变成了它的标题。","開啟另一個頁面的卡片變成了它的標題。","Una tarjeta que abría otra página quedó como su título.","Une carte qui ouvrait une autre page est devenue son titre.","Eine Karte, die eine andere Seite öffnete, wurde zu deren Titel.","Una scheda che apriva un’altra pagina è diventata il suo titolo.","Um cartão que abria outra página passou a ser o título dela."],"A card that opens a page": ["ページを開くカード","打开某个页面的卡片","開啟某個頁面的卡片","Una tarjeta que abre una página","Une carte qui ouvre une page","Eine Karte, die eine Seite öffnet","Una scheda che apre una pagina","Um cartão que abre uma página"],+ "A clip that lives on the web was left out — a deck never fetches.": ["ウェブ上にあるクリップは除きました — デッキは決して取得しません。","一段存放在网上的音视频被略去了——演示文稿从不联网获取。","一段放在網路上的影音被略過了——簡報從不連網取得。","Se dejó fuera un clip alojado en la web: una presentación nunca descarga nada.","Un clip hébergé sur le web a été laissé de côté — une présentation ne télécharge jamais rien.","Ein Clip aus dem Web wurde weggelassen – eine Präsentation lädt nie etwas nach.","Una clip che vive sul web è stata esclusa: una presentazione non scarica mai nulla.","Um clipe que vive na web ficou de fora — uma apresentação nunca vai buscar nada."],+ "A clip travelled as embedded bytes, so the deck is large.": ["クリップはバイト列として埋め込まれたため、デッキは大きくなっています。","音视频以内嵌字节随行,因此这份演示文稿很大。","影音以內嵌位元組隨行,因此這份簡報很大。","Un clip viajó como bytes incrustados, así que la presentación es grande.","Un clip a voyagé sous forme d’octets intégrés : la présentation est donc volumineuse.","Ein Clip reiste als eingebettete Bytes mit, deshalb ist die Präsentation groß.","Una clip ha viaggiato come byte incorporati, perciò la presentazione è grande.","Um clipe viajou como bytes incorporados, por isso a apresentação é grande."],"A daily entry can be saved as a template too — its date is not saved with it.": ["日次のページもテンプレートとして保存できます。その日付は保存されません。","每日条目也可以保存为模板——它的日期不会一起保存。","每日條目也可以儲存為範本——它的日期不會一起儲存。","Una entrada diaria también puede guardarse como plantilla: su fecha no se guarda con ella.","Une entrée quotidienne peut aussi être enregistrée comme modèle : sa date n’est pas enregistrée avec elle.","Auch ein Tageseintrag lässt sich als Vorlage sichern — sein Datum wird dabei nicht mitgespeichert.","Anche una voce giornaliera può essere salvata come modello: la sua data non viene salvata con essa.","Uma entrada diária também pode ser guardada como modelo — a sua data não é guardada com ela."],"A filter here is newer than this build and was not applied.": ["このビューには、このバージョンより新しいフィルターがあり、適用されていません。","此视图中有比当前版本更新的筛选条件,未被应用。","此檢視中有比目前版本更新的篩選條件,未被套用。","Un filtro de esta vista es más reciente que esta versión y no se ha aplicado.","Un filtre de cette vue est plus récent que cette version et n’a pas été appliqué.","Ein Filter dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","Un filtro di questa vista è più recente di questa versione e non è stato applicato.","Um filtro desta vista é mais recente do que esta versão e não foi aplicado."],+ "A fold is shown open — a slide cannot fold.": ["折りたたみは開いた状態です — スライドは折りたためません。","折叠内容以展开状态显示——幻灯片无法折叠。","折疊內容以展開狀態顯示——投影片無法折疊。","Un plegado se muestra abierto: una diapositiva no puede plegarse.","Un repli est affiché ouvert — une diapositive ne se replie pas.","Ein Aufklapper wird offen gezeigt – eine Folie kann nicht einklappen.","Una piega è mostrata aperta: una diapositiva non può piegarsi.","Uma dobra é mostrada aberta — um slide não dobra."],"A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": ["「.md」ファイルのフォルダーがページになります。フォルダー階層も [[ウィキリンク]] もそのままです。","一个装满 .md 文件的文件夹会变成页面,文件夹层级和 [[wiki 链接]] 都保留下来。","一個裝滿 .md 檔案的資料夾會變成頁面,資料夾層級和 [[wiki 連結]] 都會保留。","Una carpeta de archivos .md se convierte en páginas, con el árbol de carpetas y los [[wikilinks]] intactos.","Un dossier de fichiers .md devient des pages, avec l’arborescence et les [[wikilinks]] intacts.","Ein Ordner voller .md-Dateien wird zu Seiten — samt Ordnerbaum und den [[Wikilinks]] dazwischen.","Una cartella di file .md diventa pagine, con l’albero delle cartelle e i [[wikilink]] intatti.","Uma pasta de ficheiros .md transforma-se em páginas, com a árvore de pastas e os [[wikilinks]] intactos."],+ "A link kept its words; a slide has nowhere to put the address.": ["リンクは文字だけ残りました。スライドにはアドレスを置く場所がありません。","链接只保留了文字;幻灯片没有地方放地址。","連結只保留了文字;投影片沒有地方放網址。","Un enlace conservó sus palabras; una diapositiva no tiene dónde poner la dirección.","Un lien a gardé ses mots ; une diapositive n’a nulle part où mettre l’adresse.","Ein Link behielt seine Wörter; eine Folie hat keinen Platz für die Adresse.","Un collegamento ha mantenuto le parole; una diapositiva non ha dove mettere l’indirizzo.","Uma ligação manteve as palavras; um slide não tem onde pôr o endereço."],"A link with nothing in it yet": ["まだ何も入っていないリンク","还没有内容的链接","還沒有內容的連結","Un enlace todavía sin nada","Un lien encore vide","Ein Link, in dem noch nichts steht","Un collegamento ancora vuoto","Um link ainda sem nada"],"A list of every page, in order": ["すべてのページを順番に並べた一覧","按顺序列出的所有页面","依順序列出每一個頁面","Una lista de todas las páginas, en orden","La liste de toutes les pages, dans l’ordre","Eine Liste aller Seiten, der Reihe nach","Un elenco di tutte le pagine, in ordine","Uma lista de todas as páginas, por ordem"],"A live viewer: follows every edit as it happens but can never change this space — the relay enforces it.": ["ライブビューア:編集をリアルタイムで追いますが、この Space を変更することはできません — リレーが強制します。","实时查看副本:实时跟随每次编辑,但永远无法修改此 Space — 由中继强制执行。","即時檢視副本:即時跟隨每次編輯,但永遠無法修改此 Space — 由中繼強制執行。","Un visor en vivo: sigue cada edición al instante pero nunca puede modificar este Space — el relé lo garantiza.","Un visualiseur en direct : suit chaque modification mais ne peut jamais changer cet espace — le relais l’applique.","Ein Live-Viewer: folgt jeder Änderung, kann diesen Space aber nie verändern — vom Relay erzwungen.","Un visualizzatore live: segue ogni modifica ma non può mai cambiare questo Space — imposto dal relay.","Um visualizador ao vivo: acompanha cada edição conforme acontece, mas nunca pode alterar este Space — o retransmissor garante isso."],@@ -25,10 +35,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"A note, tip or warning": ["メモ・ヒント・注意","注释、提示或警告","註記、提示或警告","Una nota, un consejo o una advertencia","Une note, un conseil ou un avertissement","Eine Notiz, ein Tipp oder eine Warnung","Una nota, un consiglio o un avviso","Uma nota, dica ou aviso"],"A page cannot contain itself": ["ページを自分自身に入れることはできません","页面不能包含自身","頁面不能包含自己","Una página no puede contenerse a sí misma","Une page ne peut pas se contenir elle-même","Eine Seite kann sich nicht selbst enthalten","Una pagina non può contenere sé stessa","Uma página não pode conter-se a si própria"],"A picture across the top of this page": ["このページ上部に表示する画像","显示在此页面顶部的图片","顯示在此頁面頂部的圖片","Una imagen en la parte superior de esta página","Une image en haut de cette page","Ein Bild am oberen Rand dieser Seite","Un'immagine in cima a questa pagina","Uma imagem no topo desta página"],+ "A picture that lives on the web was left out — a deck never fetches.": ["ウェブ上にある画像は除きました — デッキは決して取得しません。","一张存放在网上的图片被略去了——演示文稿从不联网获取。","一張放在網路上的圖片被略過了——簡報從不連網取得。","Se dejó fuera una imagen alojada en la web: una presentación nunca descarga nada.","Une image hébergée sur le web a été laissée de côté — une présentation ne télécharge jamais rien.","Ein Bild aus dem Web wurde weggelassen – eine Präsentation lädt nie etwas nach.","Un’immagine che vive sul web è stata esclusa: una presentazione non scarica mai nulla.","Uma imagem que vive na web ficou de fora — uma apresentação nunca vai buscar nada."],"A second file — the original is left alone": ["2 つ目のファイル — 元のファイルはそのまま","另存一个新文件 — 原文件不动","第二個檔案 — 原檔案不受影響","Un segundo archivo — el original queda intacto","Un second fichier — l’original reste intact","Eine zweite Datei — das Original bleibt unberührt","Un secondo file — l’originale resta intatto","Um segundo ficheiro — o original fica intacto"],"A sort here is newer than this build and was not applied.": ["このビューには、このバージョンより新しい並び順があり、適用されていません。","此视图中有比当前版本更新的排序方式,未被应用。","此檢視中有比目前版本更新的排序方式,未被套用。","Un orden de esta vista es más reciente que esta versión y no se ha aplicado.","Un tri de cette vue est plus récent que cette version et n’a pas été appliqué.","Eine Sortierung dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","Un ordinamento di questa vista è più recente di questa versione e non è stato applicato.","Uma ordenação desta vista é mais recente do que esta versão e não foi aplicada."],"A space needs at least one page": ["スペースには少なくとも 1 ページが必要です","空间至少要有一个页面","空間至少要有一個頁面","Un espacio necesita al menos una página","Un espace doit contenir au moins une page","Ein Space braucht mindestens eine Seite","Uno spazio deve avere almeno una pagina","Um espaço precisa de pelo menos uma página"],"A still frame, shown before play — and what a printout or a file preview shows": ["再生前に表示される静止画 — 印刷やファイルのプレビューで表示されるのもこれです","播放前显示的静帧 — 打印和文件预览中显示的也是它","播放前顯示的靜態畫面 — 列印和檔案預覽顯示的也是它","Un fotograma fijo, que se muestra antes de reproducir — y es lo que aparece al imprimir o en la vista previa del archivo","Une image fixe, affichée avant la lecture — et c’est elle qui apparaît à l’impression et dans l’aperçu du fichier","Ein Standbild, das vor dem Abspielen zu sehen ist — und das, was im Ausdruck und in der Dateivorschau erscheint","Un fotogramma fisso, mostrato prima della riproduzione — ed è quello che compare in stampa e nell’anteprima del file","Uma imagem fixa, mostrada antes da reprodução — e é o que aparece na impressão e na pré-visualização do ficheiro"],+ "A table was too tall for one slide and continues on the next.": ["表が 1 枚に収まらず、次のスライドへ続いています。","表格一张幻灯片放不下,接续到了下一张。","表格一張投影片放不下,接續到了下一張。","Una tabla no cabía en una diapositiva y continúa en la siguiente.","Un tableau était trop haut pour une diapositive et se poursuit sur la suivante.","Eine Tabelle war zu hoch für eine Folie und läuft auf der nächsten weiter.","Una tabella era troppo alta per una diapositiva e prosegue in quella successiva.","Uma tabela era alta demais para um slide e continua no seguinte."],"A typed value on this page": ["このページの型付きの値","此页面上的类型化值","此頁面上的型別值","Un valor con tipo en esta página","Une valeur typée sur cette page","Ein typisierter Wert auf dieser Seite","Un valore tipizzato su questa pagina","Um valor tipado nesta página"],"About bento/spaces — version, updates, licenses": ["bento/spaces について — バージョン・更新・ライセンス","关于 bento/spaces — 版本、更新、许可证","關於 bento/spaces — 版本、更新、授權","Acerca de bento/spaces — versión, actualizaciones, licencias","À propos de bento/spaces — version, mises à jour, licences","Über bento/spaces — Version, Updates, Lizenzen","Informazioni su bento/spaces — versione, aggiornamenti, licenze","Acerca do bento/spaces — versão, atualizações, licenças"],"About this space": ["このスペースについて","关于此空间","關於此空間","Acerca de este espacio","À propos de cet espace","Über diesen Space","Informazioni su questo spazio","Sobre este espaço"],@@ -145,9 +157,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Contents": ["目次","目录","目錄","Índice","Sommaire","Inhalt","Indice","Índice"],"Contents page": ["目次ページ","目录页","目錄頁","Página de índice","Page de sommaire","Inhaltsverzeichnis","Pagina indice","Página de índice"],"Controls": ["コントロール","控件","控制項","Controles","Contrôles","Steuerelemente","Controlli","Controlos"],+ "Copied": ["コピーしました","已复制","已複製","Copiado","Copié","Kopiert","Copiato","Copiado"],"Copy document JSON": ["ドキュメント JSON をコピー","复制文档 JSON","複製文件 JSON","Copiar JSON del documento","Copier le JSON du document","Dokument-JSON kopieren","Copia JSON del documento","Copiar JSON do documento"],"Copy saved — you are still editing the original": ["コピーを保存しました — 編集中なのは引き続き元のファイルです","副本已保存 — 你仍在编辑原文件","副本已儲存 — 你仍在編輯原始檔案","Copia guardada: sigues editando el original","Copie enregistrée — vous modifiez toujours l'original","Kopie gespeichert — du bearbeitest weiterhin das Original","Copia salvata: stai ancora modificando l'originale","Cópia guardada — continuas a editar o original"],+ "Copy the deck JSON": ["デッキの JSON をコピー","复制演示文稿 JSON","複製簡報 JSON","Copiar el JSON de la presentación","Copier le JSON de la présentation","Präsentations-JSON kopieren","Copia il JSON della presentazione","Copiar o JSON da apresentação"],"Copy the document JSON": ["ドキュメント JSON をコピー","复制此文档的 JSON","複製文件 JSON","Copiar el JSON del documento","Copier le JSON du document","Dokument-JSON kopieren","Copia il JSON del documento","Copiar o JSON do documento"],+ "Could not copy": ["コピーできませんでした","无法复制","無法複製","No se pudo copiar","Copie impossible","Kopieren nicht möglich","Copia non riuscita","Não foi possível copiar"],"Could not reach the update channel.": ["更新チャンネルに接続できませんでした。","无法连接更新通道。","無法連線到更新來源。","No se pudo contactar con el canal de actualizaciones.","Impossible de joindre le canal de mise à jour.","Der Update-Kanal war nicht erreichbar.","Impossibile raggiungere il canale degli aggiornamenti.","Não foi possível contactar o canal de atualizações."],"Couldn’t access the clipboard": ["クリップボードにアクセスできませんでした","无法访问剪贴板","無法存取剪貼簿","No se pudo acceder al portapapeles","Impossible d'accéder au presse-papiers","Zugriff auf die Zwischenablage nicht möglich","Impossibile accedere agli appunti","Não foi possível acessar a área de transferência"],"Couldn’t reach the live session": ["ライブセッションに接続できませんでした","无法连接实时会话","無法連線即時會話","No se pudo contactar la sesión en vivo","Impossible de joindre la session live","Live-Sitzung nicht erreichbar","Impossibile raggiungere la sessione live","Não foi possível alcançar a sessão ao vivo"],@@ -171,6 +186,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Document id": ["文書 ID","文档 ID","文件 ID","ID del documento","Identifiant du document","Dokument-ID","ID del documento","ID do documento"],"Document properties": ["ドキュメントのプロパティ","文档属性","文件屬性","Propiedades del documento","Propriétés du document","Dokumenteigenschaften","Proprietà del documento","Propriedades do documento"],"Document replaced — ⌘Z undoes": ["ドキュメントを置き換えました — ⌘Z で元に戻せます","文档已替换 — ⌘Z 可撤销","文件已取代 — ⌘Z 可還原","Documento reemplazado — ⌘Z deshace","Document remplacé — ⌘Z annule","Dokument ersetzt — ⌘Z macht rückgängig","Documento sostituito — ⌘Z annulla","Documento substituído — ⌘Z desfaz"],+ "Download the deck JSON": ["デッキの JSON をダウンロード","下载演示文稿 JSON","下載簡報 JSON","Descargar el JSON de la presentación","Télécharger le JSON de la présentation","Präsentations-JSON herunterladen","Scarica il JSON della presentazione","Descarregar o JSON da apresentação"],"Download updated copy": ["更新版をダウンロード","下载更新副本","下載更新副本","Descargar copia actualizada","Télécharger la copie à jour","Aktualisierte Kopie herunterladen","Scarica copia aggiornata","Baixar cópia atualizada"],"Downloaded ✓": ["ダウンロード完了 ✓","已下载 ✓","已下載 ✓","Descargado ✓","Téléchargé ✓","Heruntergeladen ✓","Scaricato ✓","Baixado ✓"],"Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": ["現在のバージョンのバックアップをダウンロードしてから、このファイルを新バージョンに書き換えます — ドキュメントはそのまま。","先下载当前版本的备份,然后将此文件改写为新版本 — 文档内容不变。","先下載目前版本的備份,再將此檔案改寫為新版本 — 文件內容不變。","Descarga una copia de seguridad de la versión actual y reescribe este archivo con la nueva versión — el documento no cambia.","Télécharge une sauvegarde de la version actuelle, puis réécrit ce fichier avec la nouvelle version — document intact.","Lädt ein Backup der aktuellen Version herunter und schreibt diese Datei dann als neue Version — das Dokument bleibt unverändert.","Scarica un backup della versione attuale, poi riscrive questo file come nuova versione — documento intatto.","Baixa um backup da versão atual e depois regrava este arquivo no disco como a nova versão — o documento não é alterado."],@@ -199,9 +215,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Export": ["書き出す","导出","匯出","Exportar","Exporter","Exportieren","Esporta","Exportar"],"Export PDF (print)": ["PDF 書き出し(印刷)","导出 PDF(打印)","匯出 PDF(列印)","Exportar PDF (imprimir)","Exporter en PDF (imprimer)","PDF exportieren (Drucken)","Esporta PDF (stampa)","Exportar PDF (imprimir)"],"Export a page as a space": ["ページをスペースとして書き出す","将页面导出为空间","將頁面匯出為空間","Exportar una página como espacio","Exporter une page comme espace","Eine Seite als Space exportieren","Esportare una pagina come spazio","Exportar uma página como espaço"],+ "Export a page as slides": ["ページをスライドとして書き出す","将页面导出为幻灯片","將頁面匯出為投影片","Exportar una página como diapositivas","Exporter une page en diapositives","Eine Seite als Folien exportieren","Esporta una pagina come diapositive","Exportar uma página como slides"],"Export as Markdown…": ["Markdown で書き出す…","导出为 Markdown…","匯出為 Markdown…","Exportar como Markdown…","Exporter en Markdown…","Als Markdown exportieren…","Esporta come Markdown…","Exportar como Markdown…"],"Export page as a space…": ["ページをスペースとして書き出す…","将页面导出为空间…","將頁面匯出為空間…","Exportar la página como espacio…","Exporter la page comme espace…","Seite als Space exportieren…","Esporta la pagina come spazio…","Exportar a página como espaço…"],+ "Export page as slides…": ["ページをスライドとして書き出す…","将页面导出为幻灯片…","將頁面匯出為投影片…","Exportar la página como diapositivas…","Exporter la page en diapositives…","Seite als Folien exportieren…","Esporta la pagina come diapositive…","Exportar a página como slides…"],"Exported {n} page(s) as a new space": ["{n} ページを新しいスペースとして書き出しました","已将 {n} 个页面导出为新的空间","已將 {n} 個頁面匯出為新的空間","Se exportaron {n} página(s) como un espacio nuevo","{n} page(s) exportée(s) comme nouvel espace","{n} Seite(n) als neuen Space exportiert","{n} pagina/e esportata/e come nuovo spazio","{n} página(s) exportada(s) como um novo espaço"],+ "Exported {n} slide(s) as a deck": ["スライド {n} 枚のデッキとして書き出しました","已导出为 {n} 张幻灯片的演示文稿","已匯出為 {n} 張投影片的簡報","Exportada como una presentación de {n} diapositiva(s)","Exportée en une présentation de {n} diapositive(s)","Als Präsentation mit {n} Folie(n) exportiert","Esportata come presentazione di {n} diapositiva/e","Exportada como uma apresentação de {n} slide(s)"],"Field": ["フィールド","字段","欄位","Campo","Champ","Feld","Campo","Campo"],"File": ["ファイル","文件","檔案","Archivo","Fichier","Datei","File","Ficheiro"],"Fills the window": ["ウィンドウいっぱいに広げます","铺满整个窗口","鋪滿整個視窗","Ocupa toda la ventana","Occupe toute la fenêtre","Füllt das Fenster","Riempie la finestra","Preenche a janela"],@@ -436,6 +455,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Restore": ["復元","恢复","還原","Restaurar","Restaurer","Wiederherstellen","Ripristina","Restaurar"],"Restore to the page list": ["ページ一覧に戻す","恢复到页面列表","還原到頁面清單","Restaurar a la lista de páginas","Restaurer dans la liste des pages","Zurück in die Seitenliste","Ripristina nell’elenco delle pagine","Restaurar para a lista de páginas"],"Restored the version from {when} — ⌘Z undoes it": ["{when} のバージョンを復元しました。⌘Z で取り消せます。","已恢复 {when} 的版本,按 ⌘Z 可撤销。","已還原 {when} 的版本,按 ⌘Z 可復原。","Se restauró la versión del {when}: ⌘Z lo deshace.","Version du {when} restaurée — ⌘Z annule.","Version vom {when} wiederhergestellt — ⌘Z macht das rückgängig.","Ripristinata la versione del {when} — ⌘Z annulla.","Versão de {when} restaurada — ⌘Z desfaz."],+ "Review comments stayed behind, on purpose.": ["レビューのコメントは、意図的に持ち出していません。","审阅评论有意留在了原处。","審閱註解刻意留在了原處。","Los comentarios de revisión se quedaron atrás, a propósito.","Les commentaires de relecture sont restés en arrière, volontairement.","Review-Kommentare sind absichtlich zurückgeblieben.","I commenti di revisione sono rimasti indietro, di proposito.","Os comentários de revisão ficaram para trás, de propósito."],"Room for a board or a table": ["ボードや表にちょうどよい幅","给看板或表格留出空间","給看板或表格留出空間","Espacio para un tablero o una tabla","De la place pour un tableau","Platz für ein Board oder eine Tabelle","Spazio per una bacheca o una tabella","Espaço para um quadro ou uma tabela"],"Rows": ["行","行","列","Filas","Lignes","Zeilen","Righe","Linhas"],"Rows and columns": ["行と列","行和列","列與欄","Filas y columnas","Lignes et colonnes","Zeilen und Spalten","Righe e colonne","Linhas e colunas"],@@ -521,7 +541,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"The live session couldn’t store that change. It’s saved in your copy, but collaborators won’t see it.": ["ライブセッションがこの変更を保存できませんでした。自分のコピーには保存されますが、共同編集者には表示されません。","实时会话无法保存该更改。它已保存在你的副本中,但协作者不会看到。","即時工作階段無法儲存此變更。它已儲存在你的副本中,但協作者不會看到。","La sesión en vivo no pudo guardar ese cambio. Se guarda en tu copia, pero los colaboradores no lo verán.","La session en direct n’a pas pu enregistrer cette modification. Elle est enregistrée dans votre copie, mais les collaborateurs ne la verront pas.","Die Live-Sitzung konnte diese Änderung nicht speichern. Sie ist in deiner Kopie gespeichert, aber Mitarbeitende sehen sie nicht.","La sessione dal vivo non è riuscita a salvare questa modifica. È salvata nella tua copia, ma i collaboratori non la vedranno.","A sessão ao vivo não conseguiu armazenar essa alteração. Ela fica salva na sua cópia, mas os colaboradores não a verão."],"The next save writes plain, readable JSON": ["次の保存では、誰でも読めるプレーンな JSON で書き出します","下次保存将写入可直接阅读的纯 JSON","下次儲存將寫入可直接閱讀的純 JSON","El próximo guardado escribe JSON plano y legible","Le prochain enregistrement écrit du JSON en clair, lisible","Die nächste Speicherung schreibt einfaches, lesbares JSON","Il prossimo salvataggio scrive JSON in chiaro, leggibile","O próximo salvamento grava JSON simples e legível"],"The next save writes this space as plain, readable JSON — anybody who opens the file can read every page.": ["次の保存で、このスペースはそのまま読める JSON として書き出されます。ファイルを開いた人は誰でも全ページを読めます。","下一次保存会把这个空间写成可直接阅读的 JSON——任何打开这个文件的人都能读到每一页。","下一次儲存會把這個空間寫成可直接閱讀的 JSON——任何開啟這個檔案的人都能讀到每一頁。","El próximo guardado escribe este espacio como JSON legible: cualquiera que abra el archivo podrá leer todas las páginas.","Le prochain enregistrement écrira cet espace en JSON lisible : quiconque ouvre le fichier pourra lire toutes les pages.","Beim nächsten Speichern wird dieser Space als lesbares JSON geschrieben — wer die Datei öffnet, kann jede Seite lesen.","Il prossimo salvataggio scrive questo spazio come JSON leggibile: chiunque apra il file potrà leggere ogni pagina.","A próxima gravação escreve este espaço como JSON legível — quem abrir o ficheiro consegue ler todas as páginas."],+ "The page as a bento/slides deck, ready to paste into Bento Slides": ["ページを bento/slides のデッキにして、Bento Slides に貼り付けられる形にします","把页面做成 bento/slides 演示文稿,可直接粘贴进 Bento Slides","把頁面做成 bento/slides 簡報,可直接貼進 Bento Slides","La página como una presentación bento/slides, lista para pegar en Bento Slides","La page sous forme de présentation bento/slides, prête à coller dans Bento Slides","Die Seite als bento/slides-Präsentation, bereit zum Einfügen in Bento Slides","La pagina come presentazione bento/slides, pronta da incollare in Bento Slides","A página como uma apresentação bento/slides, pronta para colar no Bento Slides"],+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": ["ページがデッキのドキュメントになります。Bento Slides を開き、情報ダイアログの「JSON から置き換え…」を使ってください。スクリプトからは window.bento.loadDoc() です。","页面会变成一份演示文稿文档。打开 Bento Slides,在“关于”对话框中使用“从 JSON 替换…”,脚本中则用 window.bento.loadDoc()。","頁面會變成一份簡報文件。開啟 Bento Slides,在「關於」對話方塊中使用「從 JSON 取代…」,指令碼中則用 window.bento.loadDoc()。","La página se convierte en el documento de una presentación. Abre Bento Slides y usa «Reemplazar desde JSON…» en su diálogo Acerca de, o window.bento.loadDoc() desde un script.","La page devient le document d’une présentation. Ouvrez Bento Slides et utilisez « Remplacer depuis JSON… » dans sa boîte À propos, ou window.bento.loadDoc() depuis un script.","Die Seite wird zum Dokument einer Präsentation. Öffnen Sie Bento Slides und verwenden Sie „Aus JSON ersetzen…“ im Info-Dialog – oder window.bento.loadDoc() aus einem Skript.","La pagina diventa il documento di una presentazione. Apri Bento Slides e usa «Sostituisci da JSON…» nella finestra Informazioni, oppure window.bento.loadDoc() da uno script.","A página vira o documento de uma apresentação. Abra o Bento Slides e use «Substituir a partir de JSON…» na caixa Sobre — ou window.bento.loadDoc() a partir de um script."],"The page becomes a new file of its own: a whole space, with a new document id and none of this one’s sharing keys.": ["そのページが独立した新しいファイルになります。ひとつの完全なスペースで、新しいドキュメント ID を持ち、このスペースの共有キーは一切引き継ぎません。","该页面会成为一个独立的新文件:一个完整的空间,拥有新的文档 ID,且不带本空间的任何共享密钥。","該頁面會成為獨立的新檔案:一個完整的空間,擁有新的文件 ID,且不帶本空間的任何共用金鑰。","La página se convierte en un archivo propio: un espacio completo, con un nuevo id de documento y sin ninguna de las claves de uso compartido de este.","La page devient un fichier à part entière : un espace complet, avec un nouvel identifiant de document et aucune des clés de partage de celui-ci.","Die Seite wird zu einer eigenen Datei: ein vollständiger Space mit einer neuen Dokument-ID und ohne die Freigabeschlüssel dieses Space.","La pagina diventa un file a sé: uno spazio completo, con un nuovo id di documento e senza nessuna delle chiavi di condivisione di questo.","A página passa a ser um ficheiro próprio: um espaço completo, com um novo id de documento e sem nenhuma das chaves de partilha deste."],+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": ["このページのアイコンは絵文字ではなく本アプリ独自のグリフのため、持ち出せませんでした。","该页面的图标是本应用自带的图形而不是表情符号,因此没有带过来。","該頁面的圖示是本應用自帶的圖形而不是表情符號,因此沒有帶過來。","El icono de la página es uno de los glifos propios de esta aplicación, no un emoji, y no viajó.","L’icône de la page est l’un des glyphes propres à cette application, pas un émoji, et n’a pas voyagé.","Das Symbol der Seite ist eine der eigenen Glyphen dieser App, kein Emoji, und ist nicht mitgereist.","L’icona della pagina è uno dei glifi propri di questa app, non un’emoji, e non ha viaggiato.","O ícone da página é um dos glifos da própria aplicação, não um emoji, e não viajou."],"The password cannot be recovered — if it is lost, the file is lost.": ["パスワードは復元できません — 紛失するとファイルも失われます。","密码无法找回 — 密码丢失即文件丢失。","密碼無法復原 — 密碼遺失即檔案遺失。","La contraseña no se puede recuperar: si se pierde, el archivo se pierde.","Le mot de passe ne peut pas être récupéré — s'il est perdu, le fichier l'est aussi.","Das Passwort kann nicht wiederhergestellt werden — geht es verloren, ist die Datei verloren.","La password non può essere recuperata — se la perdi, perdi il file.","A senha não pode ser recuperada — se ela for perdida, o arquivo é perdido."],"The rest name notes that were not in the selection, and are left as text.": ["残りは選択に含まれていないノートを指しており、テキストのまま残ります。","其余指向不在所选范围内的笔记,保留为文字。","其餘指向不在所選範圍內的筆記,保留為文字。","El resto nombra notas que no estaban en la selección y se dejan como texto.","Les autres désignent des notes absentes de la sélection et restent en texte.","Der Rest nennt Notizen, die nicht in der Auswahl waren, und bleibt als Text stehen.","Gli altri nominano note che non erano nella selezione e restano come testo.","Os restantes nomeiam notas que não estavam na seleção e ficam como texto."],"The theme follows whoever opens the file. It is never written into the document.": ["テーマはファイルを開いた人に従います。ドキュメントには書き込まれません。","主题跟随打开文件的人,绝不会写入文档。","主題取決於開啟檔案的人,永遠不會寫入文件中。","El tema sigue a quien abre el archivo. Nunca se escribe en el documento.","Le thème suit la personne qui ouvre le fichier. Il n’est jamais écrit dans le document.","Das Design richtet sich danach, wer die Datei öffnet. Es wird nie ins Dokument geschrieben.","Il tema segue chi apre il file. Non viene mai scritto nel documento.","O tema segue quem abre o ficheiro. Nunca é escrito no documento."],@@ -552,6 +575,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"This space has no pages.": ["このスペースにはページがありません。","此空间没有页面。","此空間沒有任何頁面。","Este espacio no tiene páginas.","Cet espace n’a aucune page.","Dieser Space hat keine Seiten.","Questo spazio non ha pagine.","Este espaço não tem páginas."],"This space is encrypted, so no versions are kept.": ["このスペースは暗号化されているため、バージョンは保存されません。","此空间已加密,因此不保存任何版本。","此空間已加密,因此不保存任何版本。","Este espacio está cifrado, así que no se guarda ninguna versión.","Cet espace est chiffré : aucune version n’est conservée.","Dieser Space ist verschlüsselt, deshalb werden keine Versionen aufbewahrt.","Questo spazio è cifrato, quindi non viene conservata alcuna versione.","Este espaço está cifrado, por isso não são guardadas versões."],"This space is locked": ["このスペースはロックされています","此空间已锁定","此空間已鎖定","Este espacio está bloqueado","Cet espace est verrouillé","Dieser Space ist gesperrt","Questo spazio è bloccato","Este espaço está bloqueado"],+ "This space reads right-to-left; a deck has no such setting.": ["このスペースは右から左へ読みます。デッキにはその設定がありません。","这个空间从右向左阅读;演示文稿没有这项设置。","這個空間由右至左閱讀;簡報沒有這項設定。","Este espacio se lee de derecha a izquierda; una presentación no tiene ese ajuste.","Cet espace se lit de droite à gauche ; une présentation n’a pas ce réglage.","Dieser Raum wird von rechts nach links gelesen; eine Präsentation hat diese Einstellung nicht.","Questo spazio si legge da destra a sinistra; una presentazione non ha questa impostazione.","Este espaço lê-se da direita para a esquerda; uma apresentação não tem essa definição."],"This week": ["今週","本周","本週","Esta semana","Cette semaine","Diese Woche","Questa settimana","Esta semana"],"This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": ["このウィンドウはまだ v{v} で動作中 — 再読込で完了します。v{v} のバックアップをダウンロード済み。","此窗口仍在运行 v{v} — 重新加载以完成。已下载 v{v} 备份。","此視窗仍在執行 v{v} — 重新載入以完成。已下載 v{v} 備份。","Esta ventana sigue en v{v} — recarga para terminar. Se descargó una copia de seguridad v{v}.","Cette fenêtre tourne encore en v{v} — rechargez pour terminer. Une sauvegarde v{v} a été téléchargée.","Dieses Fenster läuft noch mit v{v} — zum Abschließen neu laden. Ein v{v}-Backup wurde heruntergeladen.","Questa finestra esegue ancora la v{v} — ricarica per completare. È stato scaricato un backup v{v}.","Esta janela ainda está executando a v{v} — recarregue para concluir. Um backup da v{v} foi baixado."],"This window is still running v{v} — reload to finish. A v{v} backup was saved beside this file.": ["このウィンドウはまだ v{v} で動作中 — 再読込で完了します。v{v} のバックアップをこのファイルの隣に保存しました。","此窗口仍在运行 v{v} — 重新加载以完成。已在此文件旁保存 v{v} 备份。","此視窗仍在執行 v{v} — 重新載入以完成。已在此檔案旁儲存 v{v} 備份。","Esta ventana sigue en v{v} — recarga para terminar. Se guardó una copia de seguridad v{v} junto a este archivo.","Cette fenêtre tourne encore en v{v} — rechargez pour terminer. Une sauvegarde v{v} a été enregistrée à côté de ce fichier.","Dieses Fenster läuft noch mit v{v} — zum Abschließen neu laden. Ein v{v}-Backup wurde neben dieser Datei gespeichert.","Questa finestra esegue ancora la v{v} — ricarica per completare. Un backup v{v} è stato salvato accanto a questo file.","Esta janela ainda está executando a v{v} — recarregue para concluir. Um backup da v{v} foi salvo ao lado deste arquivo."],@@ -612,6 +636,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Visit bento.page (opens in a new tab)": ["bento.page を開く(新しいタブ)","访问 bento.page(在新标签页打开)","造訪 bento.page(在新分頁開啟)","Visitar bento.page (se abre en una pestaña nueva)","Aller sur bento.page (nouvel onglet)","bento.page besuchen (öffnet in neuem Tab)","Vai su bento.page (si apre in una nuova scheda)","Visitar bento.page (abre num novo separador)"],"Warning": ["警告","警告","警告","Advertencia","Avertissement","Warnung","Avviso","Aviso"],"Web address": ["ウェブアドレス","网址","網址","Dirección web","Adresse web","Webadresse","Indirizzo web","Endereço web"],+ "What did not come across as it stands:": ["そのままの形では移らなかったもの:","以下内容未能原样带过来:","以下內容未能原樣帶過來:","Lo que no pasó tal cual:","Ce qui n’est pas passé tel quel :","Was nicht unverändert mitgekommen ist:","Ciò che non è passato così com’era:","O que não passou tal como estava:"],"What is in the picture": ["画像に写っているもの","图片里是什么","圖片裡是什麼","Qué hay en la imagen","Ce que montre l’image","Was auf dem Bild zu sehen ist","Che cosa mostra l’immagine","O que está na imagem"],"What this is": ["これが何か","这是什么","這是什麼","Qué es esto","Ce que c’est","Worum es sich handelt","Di che cosa si tratta","O que é isto"],"What’s new →": ["新着情報 →","更新内容 →","更新內容 →","Novedades →","Nouveautés →","Neuerungen →","Novità →","Novidades →"],@@ -687,6 +712,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"{n} page(s) had frontmatter, kept verbatim in a folded block.": ["{n} ページにフロントマターがありました。折りたたみブロックにそのまま保存しています。","{n} 个页面带有 frontmatter,已原样保存在折叠块里。","{n} 個頁面帶有 frontmatter,已原樣保存在摺疊區塊裡。","{n} página(s) tenían frontmatter, conservado tal cual en un bloque plegado.","{n} page(s) avaient un frontmatter, conservé tel quel dans un bloc replié.","{n} Seite(n) hatten Frontmatter — wortgetreu in einem zugeklappten Block erhalten.","{n} pagine avevano un frontmatter, conservato alla lettera in un blocco richiuso.","{n} página(s) tinham frontmatter, guardado tal e qual num bloco fechado."],"{n} page(s) inside it move up a level.": ["中にある {n} ページが 1 つ上の階層に移動します。","其中的 {n} 个页面会上移一级。","其中的 {n} 個頁面會往上移一層。","{n} página(s) que contiene suben un nivel.","{n} page(s) qu’elle contient remonteront d’un niveau.","{n} Unterseiten rücken eine Ebene nach oben.","{n} pagine contenute salgono di un livello.","{n} página(s) dentro dela sobem um nível."],"{n} pages, in sidebar order, with a contents page": ["{n} ページをサイドバー順に、目次ページ付きで","{n} 个页面,按侧边栏顺序,并附一个目录页","{n} 個頁面,依側邊欄順序排列,並附目錄頁","{n} páginas, en el orden de la barra lateral, con una página de índice","{n} pages, dans l’ordre de la barre latérale, avec une page de sommaire","{n} Seiten, in der Reihenfolge der Seitenleiste, mit Inhaltsverzeichnis","{n} pagine, nell’ordine della barra laterale, con una pagina indice","{n} páginas, pela ordem da barra lateral, com uma página de índice"],+ "{n} slide(s).": ["スライド {n} 枚。","{n} 张幻灯片。","{n} 張投影片。","{n} diapositiva(s).","{n} diapositive(s).","{n} Folie(n).","{n} diapositiva/e.","{n} slide(s)."],"{n} table(s) imported, with their column alignment.": ["{n} 個の表を取り込みました(列の配置も含みます)。","已导入 {n} 个表格,并保留列对齐方式。","已匯入 {n} 個表格,並保留欄位對齊方式。","{n} tabla(s) importada(s), con la alineación de sus columnas.","{n} tableau(x) importé(s), avec l’alignement de leurs colonnes.","{n} Tabelle(n) importiert, samt Spaltenausrichtung.","{n} tabella/e importata/e, con l’allineamento delle colonne.","{n} tabela(s) importada(s), com o alinhamento das colunas."],"{n} unresolved comment(s)": ["未解決のコメント {n} 件","{n} 条未解决的评论","{n} 則未解決的註解","{n} comentario(s) sin resolver","{n} commentaire(s) non résolu(s)","{n} offene(r) Kommentar(e)","{n} commento/i non risolto/i","{n} comentário(s) não resolvido(s)"],"{n} word": ["{n} 語","{n} 个词","{n} 個詞","{n} palabra","{n} mot","{n} Wort","{n} parola","{n} palavra"],diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.tsindex 0f072ed7..367ddd0e 100644--- a/spaces/src/i18n/pt.ts+++ b/spaces/src/i18n/pt.ts@@ -656,6 +656,32 @@ export const pt: Catalog = {"Date": "Data","Person": "Pessoa","Labels": "Etiquetas",+ "Export page as slides…": "Exportar a página como slides…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "A página como uma apresentação bento/slides, pronta para colar no Bento Slides",+ "Export a page as slides": "Exportar uma página como slides",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "A página vira o documento de uma apresentação. Abra o Bento Slides e use «Substituir a partir de JSON…» na caixa Sobre — ou window.bento.loadDoc() a partir de um script.",+ "{n} slide(s).": "{n} slide(s).",+ "What did not come across as it stands:": "O que não passou tal como estava:",+ "Copy the deck JSON": "Copiar o JSON da apresentação",+ "Could not copy": "Não foi possível copiar",+ "Download the deck JSON": "Descarregar o JSON da apresentação",+ "Exported {n} slide(s) as a deck": "Exportada como uma apresentação de {n} slide(s)",+ "A picture that lives on the web was left out — a deck never fetches.": "Uma imagem que vive na web ficou de fora — uma apresentação nunca vai buscar nada.",+ "A clip that lives on the web was left out — a deck never fetches.": "Um clipe que vive na web ficou de fora — uma apresentação nunca vai buscar nada.",+ "A clip travelled as embedded bytes, so the deck is large.": "Um clipe viajou como bytes incorporados, por isso a apresentação é grande.",+ "A link kept its words; a slide has nowhere to put the address.": "Uma ligação manteve as palavras; um slide não tem onde pôr o endereço.",+ "A card that opened another page became its title.": "Um cartão que abria outra página passou a ser o título dela.",+ "A fold is shown open — a slide cannot fold.": "Uma dobra é mostrada aberta — um slide não dobra.",+ "A callout kept its words and its kind, in a plain panel.": "Um destaque manteve as palavras e o seu tipo, num painel simples.",+ "A canvas became a slide; the card sizes were chosen here.": "Uma tela passou a ser um slide; os tamanhos dos cartões foram escolhidos aqui.",+ "A table was too tall for one slide and continues on the next.": "Uma tabela era alta demais para um slide e continua no seguinte.",+ "A board became a table of the rows it stood for.": "Um quadro passou a ser uma tabela das linhas que representava.",+ "A block this build does not know became its text.": "Um bloco que esta versão não conhece passou a ser o seu texto.",+ "A block with nothing in it was left out.": "Um bloco sem nada dentro ficou de fora.",+ "This space reads right-to-left; a deck has no such setting.": "Este espaço lê-se da direita para a esquerda; uma apresentação não tem essa definição.",+ "Review comments stayed behind, on purpose.": "Os comentários de revisão ficaram para trás, de propósito.",+ "Copied": "Copiado",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "O ícone da página é um dos glifos da própria aplicação, não um emoji, e não viajou.",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.tsindex 1cceb543..269c7b55 100644--- a/spaces/src/i18n/zh-Hans.ts+++ b/spaces/src/i18n/zh-Hans.ts@@ -656,6 +656,32 @@ export const zh_Hans: Catalog = {"Date": "日期","Person": "人员","Labels": "标签",+ "Export page as slides…": "将页面导出为幻灯片…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "把页面做成 bento/slides 演示文稿,可直接粘贴进 Bento Slides",+ "Export a page as slides": "将页面导出为幻灯片",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "页面会变成一份演示文稿文档。打开 Bento Slides,在“关于”对话框中使用“从 JSON 替换…”,脚本中则用 window.bento.loadDoc()。",+ "{n} slide(s).": "{n} 张幻灯片。",+ "What did not come across as it stands:": "以下内容未能原样带过来:",+ "Copy the deck JSON": "复制演示文稿 JSON",+ "Could not copy": "无法复制",+ "Download the deck JSON": "下载演示文稿 JSON",+ "Exported {n} slide(s) as a deck": "已导出为 {n} 张幻灯片的演示文稿",+ "A picture that lives on the web was left out — a deck never fetches.": "一张存放在网上的图片被略去了——演示文稿从不联网获取。",+ "A clip that lives on the web was left out — a deck never fetches.": "一段存放在网上的音视频被略去了——演示文稿从不联网获取。",+ "A clip travelled as embedded bytes, so the deck is large.": "音视频以内嵌字节随行,因此这份演示文稿很大。",+ "A link kept its words; a slide has nowhere to put the address.": "链接只保留了文字;幻灯片没有地方放地址。",+ "A card that opened another page became its title.": "打开另一个页面的卡片变成了它的标题。",+ "A fold is shown open — a slide cannot fold.": "折叠内容以展开状态显示——幻灯片无法折叠。",+ "A callout kept its words and its kind, in a plain panel.": "标注保留了文字和类型,放在一个朴素的面板里。",+ "A canvas became a slide; the card sizes were chosen here.": "画布变成了一张幻灯片;卡片大小由这里决定。",+ "A table was too tall for one slide and continues on the next.": "表格一张幻灯片放不下,接续到了下一张。",+ "A board became a table of the rows it stood for.": "看板变成了它所代表的那些行的表格。",+ "A block this build does not know became its text.": "此版本不认识的块变成了它的文字。",+ "A block with nothing in it was left out.": "空无内容的块被略去了。",+ "This space reads right-to-left; a deck has no such setting.": "这个空间从右向左阅读;演示文稿没有这项设置。",+ "Review comments stayed behind, on purpose.": "审阅评论有意留在了原处。",+ "Copied": "已复制",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "该页面的图标是本应用自带的图形而不是表情符号,因此没有带过来。",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.tsindex ffd891f8..a8be0ff9 100644--- a/spaces/src/i18n/zh-Hant.ts+++ b/spaces/src/i18n/zh-Hant.ts@@ -656,6 +656,32 @@ export const zh_Hant: Catalog = {"Date": "日期","Person": "人員","Labels": "標籤",+ "Export page as slides…": "將頁面匯出為投影片…",+ "The page as a bento/slides deck, ready to paste into Bento Slides": "把頁面做成 bento/slides 簡報,可直接貼進 Bento Slides",+ "Export a page as slides": "將頁面匯出為投影片",+ "The page becomes a deck’s document. Open Bento Slides and use “Replace from JSON…” in its About dialog — or window.bento.loadDoc() from a script.": "頁面會變成一份簡報文件。開啟 Bento Slides,在「關於」對話方塊中使用「從 JSON 取代…」,指令碼中則用 window.bento.loadDoc()。",+ "{n} slide(s).": "{n} 張投影片。",+ "What did not come across as it stands:": "以下內容未能原樣帶過來:",+ "Copy the deck JSON": "複製簡報 JSON",+ "Could not copy": "無法複製",+ "Download the deck JSON": "下載簡報 JSON",+ "Exported {n} slide(s) as a deck": "已匯出為 {n} 張投影片的簡報",+ "A picture that lives on the web was left out — a deck never fetches.": "一張放在網路上的圖片被略過了——簡報從不連網取得。",+ "A clip that lives on the web was left out — a deck never fetches.": "一段放在網路上的影音被略過了——簡報從不連網取得。",+ "A clip travelled as embedded bytes, so the deck is large.": "影音以內嵌位元組隨行,因此這份簡報很大。",+ "A link kept its words; a slide has nowhere to put the address.": "連結只保留了文字;投影片沒有地方放網址。",+ "A card that opened another page became its title.": "開啟另一個頁面的卡片變成了它的標題。",+ "A fold is shown open — a slide cannot fold.": "折疊內容以展開狀態顯示——投影片無法折疊。",+ "A callout kept its words and its kind, in a plain panel.": "標註保留了文字和類型,放在一個樸素的面板裡。",+ "A canvas became a slide; the card sizes were chosen here.": "畫布變成了一張投影片;卡片大小由這裡決定。",+ "A table was too tall for one slide and continues on the next.": "表格一張投影片放不下,接續到了下一張。",+ "A board became a table of the rows it stood for.": "看板變成了它所代表的那些列的表格。",+ "A block this build does not know became its text.": "此版本不認識的區塊變成了它的文字。",+ "A block with nothing in it was left out.": "空無內容的區塊被略過了。",+ "This space reads right-to-left; a deck has no such setting.": "這個空間由右至左閱讀;簡報沒有這項設定。",+ "Review comments stayed behind, on purpose.": "審閱註解刻意留在了原處。",+ "Copied": "已複製",+ "The page’s icon is one of this app’s own glyphs, not an emoji, and did not travel.": "該頁面的圖示是本應用自帶的圖形而不是表情符號,因此沒有帶過來。",// view conditions (query.ts)"{field} {op} {value}": "{field} {op} {value}",diff --git a/spaces/src/todeck.ts b/spaces/src/todeck.tsnew file mode 100644index 00000000..c52201a5--- /dev/null+++ b/spaces/src/todeck.ts@@ -0,0 +1,1140 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+//+// PAGE → DECK: one `bento/spaces` page as a `bento/slides` DOCUMENT.+//+// ————— WHAT THIS EMITS, AND WHAT IT DELIBERATELY DOES NOT ——————————————————+//+// This produces the deck's DOCUMENT JSON — the thing that goes inside a slides+// file's `#bento-doc` block — and nothing else. It does NOT produce a+// `.bento.html` deck, and that is a scope decision rather than an omission:+// a self-contained deck is a document spliced into a slides SHELL, spaces has+// no shell but its own, and there are only three ways to get one. Bundling it+// would put ~560KB of another app inside every space; fetching it breaks+// PLATFORM §1 (opening a document touches nothing); asking the maintainer to+// build a joint shell is a change in two zones this one may not edit. So the+// hand-off is the interchange path slides already documents and already+// supports — "Replace from JSON…" in its About dialog, or+// `window.bento.loadDoc(json)` for a script. The Markdown exporter is the+// precedent: it writes another format faithfully and hands it over.+//+// ————— THE COUPLING, SAID OUT LOUD ————————————————————————————————————————+//+// `bento/slides` is ANOTHER ZONE's format and this file is not allowed to+// change it. What guards against drift is the type import below: `BentoDoc`,+// `Slide` and `SlideElement` come from `slides/src/model.ts`, so a field+// renamed or narrowed over there is a compile error HERE. The types are erased+// at build time, so this costs the spaces shell nothing. What it does NOT+// guard is behaviour — a renderer that stops honouring `valign`, say — and+// there is no rig on the slides side that knows this exporter exists. That is+// a real, accepted cost, not a solved problem.+//+// ————— WHAT MUST NEVER LEAK OUT OF HERE ———————————————————————————————————+//+// · NO NETWORK (PLATFORM §1). A deck that references `asset:` keys of the+// SPACE it came from would arrive with holes, and a deck carrying an+// `http:` image would fetch on open. So every picture is resolved through+// `assetValue` to its bytes and embedded as a data: URI; anything that+// would still reach the network is DROPPED and reported.+// · NO UNTRUSTED MARKUP. A page's `html` came out of a file somebody mailed+// you. It is re-serialized from the parsed RUN LIST (marks.ts), never+// passed through, and every text run is escaped — so the deck's html is+// built by this file out of an allowlist of tags, not filtered out of the+// input.+// · NO PROTOTYPE LOOKUPS. Anything keyed by a string from the document goes+// through `Object.hasOwn` or a `Map`, never a bare index.+//+// ————— LOSS IS REPORTED, NEVER SILENT ————————————————————————————————————+//+// A page is prose and a deck is slides; some of a page has no slide shape at+// all. Every such block produces a `DeckNote`, which the editor shows before+// the download and which is also written into the affected slide's SPEAKER+// NOTES, so the honesty survives the hand-off. Notes carry a machine `code`+// and never an English sentence: the UI turns a code into a literal `t()`+// call, because the i18n sweep only ever sees literals.+//+// SPEAKER NOTES: a page has no speaker-notes concept, and nothing here invents+// one. Mapping review comments onto them was considered and rejected — a+// comment is workspace, it is addressed to a named person, and quietly moving+// it into a file people present from is a disclosure the author never made.+// So the notes channel carries the export's own account of what did not come+// across, which is the one thing a presenter genuinely needs to know.++import type { SpacesDoc, Page, Block } from './model.ts'+import {+ effectiveParents, tableOf, linkCard, assetValue, loadsRemotely, coverSrc, isRemote,+} from './model.ts'+import { parseRuns } from './marks.ts'+import type { Run } from './marks.ts'+import { SPEC } from './blocks.ts'+import { cardPos } from './canvas.ts'+import {+ viewRows, sortRows, passesFilter, fieldsOf, fieldByKey, optionOf,+} from './fields.ts'+import { esc } from './sanitize.ts'+// TYPE-ONLY, and that is the whole cross-zone contract — see the header.+import type {+ BentoDoc, Slide, SlideElement, TextElement, ShapeElement, ImageElement,+ MediaElement, TableElement, TableRow, TableCell,+} from '../../slides/src/model.ts'++// --- the deck's coordinate space --------------------------------------------+// slides' own canonical 16:9 (its model default). Everything below is in these+// pixels, because the format is absolute px and a deck with a different size+// would need every number here recomputed.+const W = 1280+const H = 720+/**+ * Side margin.+ *+ * 96, because that is what bento/slides' own starter deck uses AND what its+ * `validate()` measures against — at 72 every body element on every slide came+ * back as a `past-margin` finding when the emitted deck was loaded into a real+ * built slides shell. Twenty-four pixels of prose room is not worth a deck that+ * reports twenty-five notes the moment its owner validates it.+ */+const M = 96+const BODY_W = W - M * 2++const TITLE_Y = 52+const TITLE_H = 92+const TITLE_FS = 42++const BODY_TOP = 168+const BODY_BOTTOM = H - 56+const BODY_H = BODY_BOTTOM - BODY_TOP++const BODY_FS = 24+const LH = 1.35+/** space between two chunks on a slide */+const GAP = 18+/** width a list loses to its indent, its markers and its monospace runs */+const LIST_INSET = 140++/**+ * How tall a run of text will be, WITHOUT a DOM.+ *+ * A guess, and it is only ever used to decide where to break a slide — never+ * written into the document as a promise. slides' own `validate()` reports+ * real overflow once the deck is open there, which is the measurement; this is+ * the estimate that keeps a page of prose from landing as one 3000px box.+ *+ * 0.58em per character, TUNED AGAINST THE REAL THING: the emitted decks were+ * loaded into a built bento/slides shell and put through its `validate()`,+ * which measures with the actual renderer. At 0.52 two boxes on the starter+ * space's home page came back overflowing by 10px and 15px — six lines of text+ * in a box sized for five. 0.58 is the first value at which all four sample+ * pages report zero overflow. It is still an estimate and always will be;+ * `validate()` in slides remains the measurement. CJK is roughly twice that, so full-width characters count+ * double — otherwise a Japanese page under-estimates by half and every slide+ * overflows.+ */+const WIDE = /[ᄀ-ᅟ⺀-가-힣豈-︰-﹏-⦆¢-₩]/+function widthUnits(s: string): number {+ let n = 0+ for (const ch of s) n += WIDE.test(ch) ? 2 : 1+ return n+}+function linesFor(text: string, w: number, fs: number): number {+ const per = Math.max(6, Math.floor(w / (fs * 0.58)))+ let lines = 0+ for (const para of text.split('\n')) lines += Math.max(1, Math.ceil(widthUnits(para) / per))+ return lines+}+const textHeight = (text: string, w: number, fs: number): number =>+ Math.ceil(linesFor(text, w, fs) * fs * LH)++// --- what did not come across ------------------------------------------------++/**+ * A machine code for one kind of loss. NEVER an English sentence: the i18n+ * extractor sweeps `t()` calls with a LITERAL argument out of the source, so a+ * message living in a data table here would ship English in all eight locales.+ * `editor.ts` turns each of these into its own literal `t()` call.+ */+export type DeckNoteCode =+ | 'image-remote' // a picture that would have to be fetched+ | 'media-remote' // a clip that would have to be fetched+ | 'media-embedded' // a clip carried as bytes (big — worth saying)+ | 'link-flattened' // an inline link kept its words, lost its address+ | 'pagelink' // a card that opened another page; the deck has no page+ | 'toggle-open' // a fold cannot fold on a slide+ | 'callout-plain' // a callout kept its words and tone label, lost its box+ | 'canvas-flattened' // a canvas became a slide of placed cards, sized by us+ | 'table-split' // a table too tall for one slide, continued on the next+ | 'view-derived' // a board became a table of the rows it stood for+ | 'unknown-block' // a type this build has never heard of+ | 'empty-block' // a block with nothing in it to carry+ | 'rtl' // the space is right-to-left; a deck has no such switch+ | 'comments' // review threads stay behind+ | 'icon-glyph' // a page icon from the app's own set, not an emoji++export interface DeckNote {+ code: DeckNoteCode+ /** how many blocks this note is about */+ n: number+ /** the slide title it happened under, for the report ('' = the title slide) */+ where: string+}++export interface DeckResult {+ /** the `bento/slides` document — this is what gets handed to slides */+ doc: BentoDoc+ /** one line per kind of loss, aggregated */+ notes: DeckNote[]+ /** slides emitted, including the title slide */+ slides: number+}++// --- inline html: spaces' runs → the subset slides renders -------------------++/**+ * slides' render-time allowlist is `B I U BR SPAN DIV P STRONG EM S CODE UL OL+ * LI H1 H2` and it strips EVERY attribute. So the honest conversion of a+ * spaces mark is: keep the ones that survive, unwrap the ones that do not, and+ * report the one whose meaning is lost.+ *+ * `a` is the case that matters. slides has no inline link — its `link` field+ * jumps to a slide — so an `<a>` is unwrapped by slides' own sanitizer. Keeping+ * the words and saying the address is gone is the only truthful option.+ * `mark` and `span` carry their colour in a `class`, which is stripped, so they+ * unwrap silently; no meaning is lost, only decoration.+ */+const KEEP: Record<string, string> = {+ strong: 'strong', em: 'em', u: 'u', s: 's', code: 'code',+}++interface Inline { html: string; text: string; links: number }++export function inlineForDeck(html: string | undefined): Inline {+ const runs: Run[] = parseRuns(String(html ?? ''))+ let out = ''+ let plain = ''+ let links = 0+ let open: string[] = []+ const close = (): void => { while (open.length) out += `</${open.pop()!}>` }+ for (const run of runs) {+ if (run.br) { close(); out += '<br>'; plain += '\n'; continue }+ const want: string[] = []+ for (const m of run.marks) {+ if (m.tag === 'a') links+++ // hasOwn, never a bare index: `marks` comes out of a document and+ // `KEEP['constructor']` is a function, which is truthy.+ if (Object.hasOwn(KEEP, m.tag)) want.push(KEEP[m.tag])+ }+ // reopen only what changed, so `<strong>a b</strong>` stays one element+ let same = 0+ while (same < open.length && same < want.length && open[same] === want[same]) same+++ while (open.length > same) out += `</${open.pop()!}>`+ for (let i = same; i < want.length; i++) { out += `<${want[i]}>`; open.push(want[i]) }+ out += esc(run.text)+ plain += run.text+ }+ close()+ return { html: out, text: plain, links }+}++/** Wrap already-inline html so a whole chunk reads as one emphasised line. */+const bold = (h: string): string => `<strong>${h}</strong>`++// --- element factories -------------------------------------------------------+// Written out rather than imported from slides/src/model.ts on purpose: the+// TYPES are the contract (a renamed field is a compile error), and building the+// objects here keeps another app's runtime out of the spaces shell.++/** Set once per export, so every element factory below can reach the deck's+ * body face without threading it through every call. */+let DECK_FAMILY = ''++let seq = 0+/** Deterministic within one export, so two runs over one page differ only in+ * the doc id — which makes the rig's job possible and a diff readable. */+const eid = (p: string): string => `sp-${p}-${++seq}`++function text(partial: Partial<TextElement> & Pick<TextElement, 'x' | 'y' | 'w' | 'h' | 'html'>): TextElement {+ return {+ id: eid('t'), type: 'text',+ rotation: 0, opacity: 1,+ fontSize: BODY_FS,+ fontFamily: DECK_FAMILY,+ fontWeight: 400,+ color: '#1E2A3A',+ align: 'left', valign: 'top',+ lineHeight: LH,+ ...partial,+ }+}++function rect(partial: Partial<ShapeElement> & Pick<ShapeElement, 'x' | 'y' | 'w' | 'h' | 'fill'>): ShapeElement {+ return {+ id: eid('s'), type: 'shape', shape: 'rect',+ rotation: 0, opacity: 1,+ stroke: 'transparent', strokeWidth: 0, radius: 0,+ ...partial,+ }+}++// --- colour helpers ----------------------------------------------------------++/** Is this background light? Same luminance test slides uses for readable ink. */+function isLight(bg: string): boolean {+ const m = /^#?([0-9a-f]{6})$/i.exec(String(bg).trim().replace(/^#/, '#'))+ if (!m) return true+ const n = parseInt(m[1], 16)+ const r = (n >> 16) & 255, g = (n >> 8) & 255, b = n & 255+ return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255 > 0.55+}++/** `#rrggbb` → `rgba(r,g,b,a)`. Anything else is returned as a safe fallback,+ * because the colour came out of a document. */+function tint(hex: string, a: number, fallback: string): string {+ const m = /^#([0-9a-f]{6})$/i.exec(String(hex).trim())+ if (!m) return fallback+ const n = parseInt(m[1], 16)+ return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${a})`+}++/** Only a value slides' colour policy will accept — a document can say anything. */+const safeColor = (v: unknown, fallback: string): string =>+ typeof v === 'string' && /^#[0-9a-fA-F]{3,8}$/.test(v.trim()) ? v.trim() : fallback++/** A font family from a document reaches a CSS declaration, so it is capped and+ * stripped of everything a font list never contains. */+const safeFamily = (v: unknown): string =>+ typeof v === 'string' ? v.replace(/[^\w\s,'"-]/g, '').slice(0, 200) : ''++// --- the chunk model ---------------------------------------------------------+// A chunk is a measured piece of body content that knows how to place itself at+// a given y. Packing is then one greedy pass with a single rule.++interface Chunk {+ h: number+ make: (y: number, ink: string, accent: string) => SlideElement[]+}++interface Ctx {+ doc: SpacesDoc+ page: Page+ note: (code: DeckNoteCode, where: string) => void+ where: () => string+}++// --- lists -------------------------------------------------------------------++const LIST_TYPES = new Set(['bullet', 'number', 'todo'])++/** `☐`/`☑` for a to-do; slides renders a `ul` marker for the rest. */+function listItemHtml(b: Block, inline: Inline): string {+ if (b.type === 'todo') return `${b.done === true ? '☑' : '☐'} ${inline.html}`+ return inline.html+}++// --- the exporter ------------------------------------------------------------++export interface DeckOpts {+ /** the deck's docId. Passed in so a rig can pin the output; the editor mints. */+ docId?: string+ /** the deck's `modified` stamp. Passed in so a rig's output is byte-stable. */+ now?: string+}++/**+ * One page → one deck.+ *+ * SLIDE BREAKS, and why these three:+ * · `h1` and `h2` each start a slide and become its title. That is the+ * convention every markdown-to-slides tool has converged on, and it is the+ * one an author can already see in the outline they wrote.+ * · a `divider` starts a slide with no title — the explicit break, for a page+ * that has no headings or wants two slides under one.+ * · `h3` stays in the body as a bold lead-in, because a deck whose every+ * sub-sub-heading is a slide is a deck nobody wrote.+ * Anything too tall for the slide it is on continues on the next one, with the+ * same title. Silence there is the failure mode: the text would be in the file,+ * off the bottom of the canvas, and the JSON would look perfect.+ */+export function pageToDeck(doc: SpacesDoc, pageId: string, opts: DeckOpts = {}): DeckResult {+ seq = 0+ const page = doc.pages.find((p) => p.id === pageId)+ const theme = doc.theme ?? {}+ const bg = safeColor(theme.background, '#FFFFFF')+ const ink = safeColor(theme.color, isLight(bg) ? '#1E2A3A' : '#F5F7FA')+ const accent = safeColor(theme.accent, '#F7A600')+ // slides' own FONT_STACK, written out rather than imported: importing it+ // would pull that app's runtime into this shell for one string. A space with+ // no family (a hand-written file) must still produce a deck with a real one —+ // an empty `fontFamily` reaches a CSS declaration as nothing at all.+ const family = safeFamily(theme.fontFamily)+ || "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"+ const headFamily = safeFamily(theme.headingFamily) || family+ DECK_FAMILY = family++ const tally = new Map<string, DeckNote>()+ const note = (code: DeckNoteCode, where: string): void => {+ const key = `${code}${where}`+ const had = tally.get(key)+ if (had) had.n+++ else tally.set(key, { code, n: 1, where })+ }++ const slides: Slide[] = []+ const deck: BentoDoc = {+ format: 'bento/slides',+ version: 1,+ docId: opts.docId ?? mintId(),+ title: (page?.title || doc.title || 'Untitled').slice(0, 300),+ modified: opts.now ?? new Date().toISOString(),+ size: { width: W, height: H },+ theme: {+ background: bg,+ color: ink,+ accent,+ fontFamily: family,+ ...(headFamily && headFamily !== family ? { headingFamily: headFamily } : {}),+ },+ slides,+ assets: {},+ }++ if (!page) {+ // Not an error the caller can act on differently, and an empty deck would+ // not LOAD (slides' parseDoc requires a non-empty slides array), so the+ // deck says so on its one slide.+ slides.push(titleSlide(deck, 'Untitled', '', '', ink, accent, headFamily))+ return { doc: deck, notes: [], slides: 1 }+ }++ if (theme.dir === 'rtl') note('rtl', '')++ // --- the title slide+ // THE RAW FIELD is what decides whether there was a cover at all, and+ // `coverSrc` is what decides whether it may be shown. Asking only the second+ // question loses the report entirely: `coverSrc` already returns '' for a+ // remote cover, so `if (cover && …)` could never fire and a page whose cover+ // lived on the web exported with no cover and NOTHING SAID. Caught by the+ // rig's count, which is why it counts rather than asserting "some".+ const rawCover = typeof page.cover === 'string' ? page.cover : ''+ const cover = coverSrc(page)+ const coverData = cover ? assetValue(cover, doc) : ''+ const coverOk = !!coverData && !isRemote(coverData)+ if (rawCover && !coverOk) note('image-remote', '')+ // A PAGE ICON IS NOT ALWAYS AN EMOJI. `Page.icon` is documented as one, and+ // the app ALSO accepts a name from its own icon set (render.ts pageIconInto)+ // — the starter space's own pages use those. Written onto a slide as text, a+ // named icon reads as the word "image" above the title, which is what the+ // first end-to-end render showed. Only a glyph travels; a name is reported.+ const rawIcon = typeof page.icon === 'string' ? page.icon.slice(0, 8) : ''+ const icon = rawIcon && !/[A-Za-z0-9]/.test(rawIcon) ? rawIcon : ''+ if (rawIcon && !icon) note('icon-glyph', '')+ slides.push(titleSlide(+ deck,+ page.title || doc.title || 'Untitled',+ icon,+ coverOk ? coverData : '',+ ink, accent, headFamily,+ ))++ // --- walk the page+ const ctx: Ctx = { doc, page, note, where: () => current.title }+ const eff = effectiveParents(page)+ const byId = new Map(page.blocks.map((b) => [b.id, b]))+ /** the nearest ancestor that OWNS its descendants (callout, toggle, canvas) */+ const containerOf = (b: Block): Block | undefined => {+ for (let id = eff.get(b.id); id; id = eff.get(id)) {+ const owner = byId.get(id)+ if (!owner) break+ if (SPEC.get(owner.type)?.container) return owner+ }+ return undefined+ }+ /** list nesting depth, counting only list ancestors */+ const listDepth = (b: Block): number => {+ let d = 0+ for (let id = eff.get(b.id); id; id = eff.get(id)) {+ const owner = byId.get(id)+ if (!owner) break+ if (LIST_TYPES.has(owner.type)) d+++ }+ return Math.min(d, 4)+ }++ let current = { title: '', chunks: [] as Chunk[], own: [] as Slide[] }+ const flush = (): void => {+ if (!current.chunks.length) return+ pack(deck, slides, current.title, current.chunks, ink, accent, headFamily)+ current.chunks = []+ }+ const start = (title: string): void => { flush(); current.title = title }++ // Blocks a container owns are drawn by the container, and a nested list item+ // is drawn by the list run it belongs to.+ const top = page.blocks.filter((b) => {+ if (containerOf(b)) return false+ const parent = b.parent ? byId.get(eff.get(b.id) ?? '') : undefined+ if (parent && LIST_TYPES.has(parent.type) && LIST_TYPES.has(b.type)) return false+ return true+ })++ for (let i = 0; i < top.length; i++) {+ const b = top[i]+ const inline = inlineForDeck(b.html)+ if (inline.links) note('link-flattened', current.title)++ if (b.type === 'h1' || b.type === 'h2') { start(inline.text.trim() || 'Untitled'); continue }+ if (b.type === 'divider') { start(''); continue }++ // whole-slide blocks: they get the current title and the body continues+ // under the same title on the slide after.+ if (b.type === 'table') { flush(); tableSlides(deck, slides, current.title, b, ctx, ink, accent, headFamily); continue }+ if (b.type === 'view') { flush(); viewSlides(deck, slides, current.title, b, ctx, ink, accent, headFamily); continue }+ if (b.type === 'image') { flush(); imageSlide(deck, slides, current.title, b, ctx, ink, accent, headFamily); continue }+ if (b.type === 'media') { flush(); mediaSlide(deck, slides, current.title, b, ctx, ink, accent, headFamily); continue }+ if (b.type === 'canvas') { flush(); canvasSlide(deck, slides, current.title, b, page, eff, byId, ctx, ink, accent, headFamily); continue }++ // a run of adjacent list items becomes ONE text element with real <ul>/<ol>+ if (LIST_TYPES.has(b.type)) {+ const run: Block[] = []+ const ordered = b.type === 'number'+ while (i < top.length && LIST_TYPES.has(top[i].type) && (top[i].type === 'number') === ordered) {+ run.push(top[i])+ i+++ }+ i--+ current.chunks.push(listChunk(run, ordered, listDepth, page, eff, byId, ctx))+ continue+ }++ const chunk = blockChunk(b, inline, ctx)+ if (chunk) current.chunks.push(chunk)+ }+ flush()++ // Nothing but a title? The title slide already carries it; do not emit an+ // empty second slide.+ if (slides.length === 0) slides.push(titleSlide(deck, deck.title, '', '', ink, accent, headFamily))++ // review threads never travel — say so once+ const threads = page.blocks.reduce((n, b) => n + (Array.isArray(b.comments) ? b.comments.length : 0), 0)+ + (Array.isArray(page.comments) ? page.comments.length : 0)+ if (threads) note('comments', '')++ const notes = [...tally.values()]+ writeSlideNotes(slides, notes)+ return { doc: deck, notes, slides: slides.length }+}++function mintId(): string {+ const r = globalThis.crypto?.randomUUID?.()+ return r ?? `deck-${Math.random().toString(36).slice(2, 10)}`+}++// --- slides ------------------------------------------------------------------++function titleSlide(+ deck: BentoDoc, title: string, icon: string, coverData: string,+ ink: string, accent: string, headFamily: string,+): Slide {+ const els: SlideElement[] = []+ let color = ink+ if (coverData) {+ const key = intern(deck, coverData)+ const img: ImageElement = {+ id: eid('i'), type: 'image', x: 0, y: 0, w: W, h: H,+ rotation: 0, opacity: 1, src: key, fit: 'cover', radius: 0,+ }+ els.push(img)+ // A scrim, so the title is legible over a photograph nobody chose for its+ // contrast. Not a backdrop filter: print and PDF drop those.+ els.push(rect({ x: 0, y: 0, w: W, h: H, fill: 'rgba(12,16,22,0.52)' }))+ color = '#FFFFFF'+ }+ if (icon) {+ els.push(text({+ x: M, y: 232, w: BODY_W, h: 92, html: esc(icon),+ fontSize: 64, align: 'left', valign: 'middle', color,+ }))+ }+ els.push(text({+ x: M, y: icon ? 322 : 268, w: BODY_W, h: 200,+ html: esc(title),+ fontSize: 60, fontWeight: 700, fontFamily: headFamily,+ color, align: 'left', valign: 'top', role: 'title',+ }))+ els.push(rect({ x: M, y: icon ? 300 : 246, w: 96, h: 5, fill: accent, radius: 3 }))+ return {+ id: eid('slide'), background: deck.theme.background, transition: 'fade',+ elements: els, notes: '',+ }+}++/** A body slide's chrome: the title and its accent rule, plus the first free y. */+function chrome(title: string, ink: string, accent: string, headFamily: string): { els: SlideElement[]; top: number } {+ if (!title) return { els: [], top: BODY_TOP - 56 }+ return {+ els: [+ text({+ x: M, y: TITLE_Y, w: BODY_W, h: TITLE_H, html: esc(title),+ fontSize: TITLE_FS, fontWeight: 700, fontFamily: headFamily,+ color: ink, valign: 'top', role: 'title',+ }),+ rect({ x: M, y: TITLE_Y + TITLE_H + 4, w: 64, h: 4, fill: accent, radius: 2 }),+ ],+ top: BODY_TOP,+ }+}++const newSlide = (deck: BentoDoc, els: SlideElement[]): Slide => ({+ id: eid('slide'), background: deck.theme.background, transition: 'fade',+ elements: els, notes: '',+})++/** Greedy pack: fill a slide, then continue under the same title. */+function pack(+ deck: BentoDoc, out: Slide[], title: string, chunks: Chunk[],+ ink: string, accent: string, headFamily: string,+): void {+ let open = chrome(title, ink, accent, headFamily)+ let y = open.top+ // COUNTED, not inferred from `els.length`: a titled slide's chrome is already+ // two elements, so "has anything landed here" cannot be read off the array.+ // Inferring it emitted an empty titled slide after every break.+ let placed = 0+ const close = (): void => {+ if (placed) out.push(newSlide(deck, open.els))+ open = chrome(title, ink, accent, headFamily)+ y = open.top+ placed = 0+ }+ for (const c of chunks) {+ // a chunk taller than a whole slide still has to go somewhere: it goes on+ // its own slide and slides' validate() reports the overflow honestly+ if (placed && y + c.h > BODY_BOTTOM) close()+ open.els.push(...c.make(y, ink, accent))+ y += c.h + GAP+ placed+++ }+ if (placed) out.push(newSlide(deck, open.els))+}++// --- chunks ------------------------------------------------------------------++function blockChunk(b: Block, inline: Inline, ctx: Ctx): Chunk | null {+ const spec = SPEC.get(b.type)++ if (b.type === 'h3') {+ const h = textHeight(inline.text, BODY_W, 30)+ return { h, make: (y, ink) => [text({ x: M, y, w: BODY_W, h, html: bold(inline.html), fontSize: 30, color: ink })] }+ }++ if (b.type === 'quote') {+ const h = Math.max(40, textHeight(inline.text, BODY_W - 28, BODY_FS))+ return {+ h,+ make: (y, ink, accent) => [+ rect({ x: M, y, w: 4, h, fill: accent, radius: 2 }),+ text({ x: M + 24, y, w: BODY_W - 24, h, html: `<em>${inline.html}</em>`, color: ink }),+ ],+ }+ }++ if (b.type === 'code') {+ const body = inline.text || ''+ const fs = 20+ const h = Math.max(48, textHeight(body, BODY_W - 40, fs) + 28)+ // A `text` element with the monospace stack rather than slides' `code`+ // element: a CodeElement's highlighting hangs off `grammarAssetId` /+ // `themeAssetId`, which are keys into the DECK's assets and which this+ // exporter has no grammar to put there. Plain monospace on a panel renders+ // identically everywhere and loses nothing but colour.+ const html = esc(body).replace(/\n/g, '<br>')+ return {+ h,+ make: (y, ink) => [+ rect({ x: M, y, w: BODY_W, h, fill: tint(ink, 0.06, 'rgba(30,42,58,0.06)'), radius: 8 }),+ text({+ x: M + 20, y: y + 14, w: BODY_W - 40, h: h - 28, html,+ fontSize: fs, color: ink,+ fontFamily: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace",+ }),+ ],+ }+ }++ if (b.type === 'callout' || b.type === 'toggle') {+ if (b.type === 'toggle') ctx.note('toggle-open', ctx.where())+ else ctx.note('callout-plain', ctx.where())+ const kids = childLines(b, ctx)+ const label = b.type === 'callout'+ ? String(b.tone ?? 'note').replace(/[^A-Za-z0-9_-]/g, '').slice(0, 24).toUpperCase() || 'NOTE'+ : ''+ const head = label ? `${bold(esc(label))}<br>${inline.html}` : bold(inline.html)+ const bodyHtml = [head, ...kids.map((k) => k.html)].join('<br>')+ const plain = [label, inline.text, ...kids.map((k) => k.text)].filter(Boolean).join('\n')+ const h = Math.max(56, textHeight(plain, BODY_W - 48, BODY_FS) + 32)+ return {+ h,+ make: (y, ink, accent) => [+ rect({ x: M, y, w: BODY_W, h, fill: tint(accent, 0.12, 'rgba(247,166,0,0.12)'), radius: 10 }),+ rect({ x: M, y, w: 4, h, fill: accent, radius: 2 }),+ text({ x: M + 24, y: y + 16, w: BODY_W - 48, h: h - 32, html: bodyHtml, color: ink }),+ ],+ }+ }++ if (b.type === 'pagelink') {+ ctx.note('pagelink', ctx.where())+ const target = ctx.doc.pages.find((p) => p.id === String(b.page ?? ''))+ const label = `→ ${target?.title ?? '?'}`+ const h = textHeight(label, BODY_W, BODY_FS)+ return { h, make: (y, ink) => [text({ x: M, y, w: BODY_W, h, html: bold(esc(label)), color: ink })] }+ }++ if (b.type === 'link') {+ const card = linkCard(b)+ if (!card.url) ctx.note('empty-block', ctx.where())+ const line = [card.title, card.desc].filter(Boolean).join(' — ')+ const plain = card.url ? `${line}\n${card.url}` : line+ const h = Math.max(40, textHeight(plain, BODY_W, BODY_FS))+ const html = card.url+ ? `${bold(esc(line))}<br><span>${esc(card.url)}</span>`+ : bold(esc(line))+ return { h, make: (y, ink) => [text({ x: M, y, w: BODY_W, h, html, color: ink })] }+ }++ if (!inline.text.trim() && !inline.html) {+ // Nothing to carry. A block that is deliberately empty (a spacer paragraph)+ // is the common case, so it is only reported for a type that should have+ // had content.+ if (b.type !== 'p') ctx.note('empty-block', ctx.where())+ return null+ }++ if (!spec) ctx.note('unknown-block', ctx.where())++ const h = textHeight(inline.text, BODY_W, BODY_FS)+ return { h, make: (y, ink) => [text({ x: M, y, w: BODY_W, h, html: inline.html, color: ink })] }+}++/** A container's descendants, flattened to lines in document order. */+function childLines(owner: Block, ctx: Ctx): Array<{ html: string; text: string }> {+ const eff = effectiveParents(ctx.page)+ const out: Array<{ html: string; text: string }> = []+ for (const b of ctx.page.blocks) {+ let inside = false+ for (let id = eff.get(b.id); id; id = eff.get(id)) if (id === owner.id) { inside = true; break }+ if (!inside) continue+ const inline = inlineForDeck(b.html)+ if (!inline.text.trim()) continue+ const bullet = LIST_TYPES.has(b.type) ? '• ' : ''+ const tick = b.type === 'todo' ? (b.done === true ? '☑ ' : '☐ ') : ''+ out.push({ html: `${esc(bullet + tick)}${inline.html}`, text: bullet + tick + inline.text })+ }+ return out+}++function listChunk(+ run: Block[], ordered: boolean, depthOf: (b: Block) => number,+ page: Page, eff: Map<string, string | undefined>, byId: Map<string, Block>,+ ctx: Ctx,+): Chunk {+ // nested items are drawn by their run, so collect the whole subtree in order+ const all: Block[] = []+ const ids = new Set(run.map((b) => b.id))+ for (const b of page.blocks) {+ if (ids.has(b.id)) { all.push(b); continue }+ if (!LIST_TYPES.has(b.type)) continue+ for (let id = eff.get(b.id); id; id = eff.get(id)) {+ if (ids.has(id)) { all.push(b); break }+ if (!byId.get(id) || !LIST_TYPES.has(byId.get(id)!.type)) break+ }+ }+ const base = Math.min(...all.map(depthOf))+ const tag = ordered ? 'ol' : 'ul'+ let html = ''+ let plain = ''+ let depth = -1+ for (const b of all) {+ const inline = inlineForDeck(b.html)+ if (inline.links) ctx.note('link-flattened', ctx.where())+ const d = depthOf(b) - base+ while (depth < d) { html += `<${tag}>`; depth++ }+ while (depth > d) { html += `</${tag}>`; depth-- }+ html += `<li>${listItemHtml(b, inline)}</li>`+ plain += `${' '.repeat(d)}• ${inline.text}\n`+ }+ while (depth >= 0) { html += `</${tag}>`; depth-- }+ // A LIST IS NARROWER THAN ITS BOX. The `<ul>` indents, the marker takes room,+ // and `<code>` runs inside an item are monospace and wider than the average+ // this estimate is built on. Measured in a built bento/slides shell: at a+ // 40px allowance two of the starter space's lists overflowed their boxes by+ // 10px and 15px; 140 is what makes every sample list fit. Still an estimate.+ const h = textHeight(plain.trimEnd(), BODY_W - LIST_INSET, BODY_FS) + 8+ return { h, make: (y, ink) => [text({ x: M, y, w: BODY_W, h, html, color: ink })] }+}++// --- whole-slide blocks ------------------------------------------------------++/**+ * A table row's height, measured rather than guessed.+ *+ * The first end-to-end render into a built bento/slides shell showed the table+ * CLIPPED — three of five rows and the fourth cut through the middle — because+ * the element box is a fixed height and 36px was smaller than a row actually+ * draws. With `fontSize: 18`, `cellPadY: 9` and a 1px rule, one line of cell+ * text occupies about 45px, so the base is 46 and a wrapping cell adds a line.+ * Erring high costs white space; erring low hides rows.+ */+const ROW_H = 46+const CELL_FS = 18++/** How tall this row draws, allowing for cells whose text wraps. */+function rowHeight(cells: string[], columns: Array<{ w: number }>): number {+ const total = columns.reduce((a, c) => a + c.w, 0) || 1+ let lines = 1+ cells.forEach((html, i) => {+ const w = ((columns[i]?.w ?? 1) / total) * BODY_W - 28+ lines = Math.max(lines, linesFor(inlineForDeck(html).text, Math.max(40, w), CELL_FS))+ })+ return ROW_H + (lines - 1) * Math.ceil(CELL_FS * LH)+}++function deckTableStyle(ink: string, accent: string): TableElement['style'] {+ return {+ headerBg: accent,+ headerColor: isLight(accent) ? '#1E2A3A' : '#FFFFFF',+ zebra: tint(ink, 0.05, 'rgba(30,42,58,0.05)'),+ borderColor: tint(ink, 0.16, 'rgba(30,42,58,0.16)'),+ borderWidth: 1,+ cellPadX: 14, cellPadY: 9,+ fontSize: CELL_FS,+ color: ink,+ radius: 8,+ }+}++function tableEl(+ rows: TableRow[], columns: Array<{ w: number }>, header: boolean,+ y: number, h: number, ink: string, accent: string,+): TableElement {+ return {+ id: eid('tbl'), type: 'table', x: M, y, w: BODY_W, h,+ rotation: 0, opacity: 1,+ columns, rows, header,+ style: deckTableStyle(ink, accent),+ }+}++const cell = (html: string, align?: TableCell['align']): TableCell =>+ align ? { html, align } : { html }++function tableSlides(+ deck: BentoDoc, out: Slide[], title: string, b: Block, ctx: Ctx,+ ink: string, accent: string, headFamily: string,+): void {+ const t = tableOf(b)+ const align = (i: number): TableCell['align'] | undefined => {+ const a = t.colAlign[i]+ return a === 'left' || a === 'center' || a === 'right' ? a : undefined+ }+ const toRow = (r: string[]): TableRow => ({ cells: r.map((c, i) => cell(inlineForDeck(c).html, align(i))) })+ const columns = t.cols.map((w) => ({ w }))+ const head = t.header ? t.rows[0] : null+ const body = t.header ? t.rows.slice(1) : t.rows+ // HEIGHT-DRIVEN, not row-count-driven: one row of long prose is two rows of+ // labels, and a fixed rows-per-slide either clips the first or wastes the+ // second.+ const headH = head ? rowHeight(head, columns) : 0+ const parts: string[][][] = []+ let part: string[][] = []+ let used = headH+ for (const r of body) {+ const rh = rowHeight(r, columns)+ if (part.length && used + rh > BODY_H) { parts.push(part); part = []; used = headH }+ part.push(r)+ used += rh+ }+ if (part.length || !parts.length) parts.push(part)+ if (parts.length > 1) ctx.note('table-split', title)+ for (const chunk of parts) {+ const rows = [...(head ? [toRow(head)] : []), ...chunk.map(toRow)]+ const h = headH + chunk.reduce((a, r) => a + rowHeight(r, columns), 0)+ const c = chrome(title, ink, accent, headFamily)+ c.els.push(tableEl(rows, columns, !!head, c.top, Math.min(h, BODY_H), ink, accent))+ out.push(newSlide(deck, c.els))+ }+}++/**+ * A board or list becomes a TABLE of the rows it stands for.+ *+ * The rows are DERIVED — same source, same filter, same sort, same grouping as+ * the screen — so the deck agrees with the board it came from. Exporting the+ * word "Issues" and nothing else was the Markdown exporter's original bug and+ * is not worth repeating.+ */+function viewSlides(+ deck: BentoDoc, out: Slide[], title: string, b: Block, ctx: Ctx,+ ink: string, accent: string, headFamily: string,+): void {+ ctx.note('view-derived', title)+ const doc = ctx.doc+ const groupKey = String((b as { groupBy?: unknown }).groupBy ?? 'status')+ const grouped = String((b as { layout?: unknown }).layout ?? 'board') !== 'list'+ const field = fieldByKey(doc, groupKey)+ const rows = sortRows(+ doc,+ viewRows(doc, (b as { source?: unknown }).source)+ .filter((r) => passesFilter(doc, r.values, (b as { filter?: unknown }).filter)),+ (b as { sort?: unknown }).sort)+ const order = new Map((field?.options ?? []).map((o, i) => [o.id, i]))+ const seat = (r: (typeof rows)[number]): number =>+ order.get(String(r.values.get(groupKey) ?? '')) ?? Number.MAX_SAFE_INTEGER+ const ordered = grouped+ ? rows.map((r, i) => ({ r, i })).sort((a, c) => (seat(a.r) - seat(c.r)) || (a.i - c.i)).map((x) => x.r)+ : rows+ const others = fieldsOf(doc).filter((f) => f.key !== groupKey)+ const lines = ordered.map((r) => ({+ title: r.page.title,+ group: grouped ? (optionOf(field, r.values.get(groupKey))?.label ?? '—') : '',+ fields: others.map((f) => {+ const v = r.values.get(f.key)+ if (v === undefined || v === null || v === '') return ''+ return optionOf(f, v)?.label ?? (Array.isArray(v) ? v.join(', ') : String(v))+ }).filter(Boolean).join(' · '),+ }))+ const heading = title || inlineForDeck(b.html).text.trim()+ const columns = grouped ? [{ w: 1.5 }, { w: 1 }, { w: 1.6 }] : [{ w: 1.7 }, { w: 2 }]+ const header: TableRow = {+ cells: grouped+ ? [cell('<strong>Page</strong>'), cell(`<strong>${esc(field?.label ?? groupKey)}</strong>`), cell('<strong>Fields</strong>')]+ : [cell('<strong>Page</strong>'), cell('<strong>Fields</strong>')],+ }+ const body = lines.map((l): TableRow => ({+ cells: grouped+ ? [cell(esc(l.title)), cell(esc(l.group)), cell(esc(l.fields))]+ : [cell(esc(l.title)), cell(esc(l.fields))],+ }))+ const perSlide = Math.max(1, Math.floor((BODY_H - ROW_H) / ROW_H))+ if (!body.length) {+ const c = chrome(heading, ink, accent, headFamily)+ c.els.push(text({ x: M, y: c.top, w: BODY_W, h: 60, html: '<em>—</em>', color: ink }))+ out.push(newSlide(deck, c.els))+ return+ }+ if (body.length > perSlide) ctx.note('table-split', heading)+ for (let i = 0; i < body.length; i += perSlide) {+ const rows2 = [header, ...body.slice(i, i + perSlide)]+ const c = chrome(heading, ink, accent, headFamily)+ c.els.push(tableEl(rows2, columns, true, c.top, rows2.length * ROW_H, ink, accent))+ out.push(newSlide(deck, c.els))+ }+}++function imageSlide(+ deck: BentoDoc, out: Slide[], title: string, b: Block, ctx: Ctx,+ ink: string, accent: string, headFamily: string,+): void {+ const src = String(b.src ?? '')+ const c = chrome(title, ink, accent, headFamily)+ const capText = inlineForDeck(typeof b.caption === 'string' ? b.caption : '').text.trim()+ const capH = capText ? textHeight(capText, BODY_W, 18) + 8 : 0+ if (!src || loadsRemotely(src, ctx.doc)) {+ // THE RULE: no network, ever. A deck that referenced this would either+ // fetch on open or arrive with a hole; both are worse than saying so.+ ctx.note(src ? 'image-remote' : 'empty-block', title)+ const label = String(b.alt ?? '') || capText+ c.els.push(text({+ x: M, y: c.top, w: BODY_W, h: 80,+ html: `<em>${esc(label || '—')}</em>`, color: ink,+ }))+ out.push(newSlide(deck, c.els))+ return+ }+ const data = assetValue(src, ctx.doc)+ const key = intern(deck, data)+ const h = BODY_BOTTOM - c.top - capH+ const img: ImageElement = {+ id: eid('i'), type: 'image', x: M, y: c.top, w: BODY_W, h,+ rotation: 0, opacity: 1, src: key, fit: 'contain', radius: 6,+ }+ c.els.push(img)+ if (capText) {+ c.els.push(text({+ x: M, y: c.top + h + 8, w: BODY_W, h: capH, html: `<em>${inlineForDeck(b.caption as string).html}</em>`,+ fontSize: 18, align: 'center', color: ink,+ }))+ }+ out.push(newSlide(deck, c.els))+}++function mediaSlide(+ deck: BentoDoc, out: Slide[], title: string, b: Block, ctx: Ctx,+ ink: string, accent: string, headFamily: string,+): void {+ const src = String(b.src ?? '')+ const c = chrome(title, ink, accent, headFamily)+ if (!src || loadsRemotely(src, ctx.doc)) {+ ctx.note(src ? 'media-remote' : 'empty-block', title)+ c.els.push(text({+ x: M, y: c.top, w: BODY_W, h: 80,+ html: `<em>${esc(String(b.alt ?? '') || '—')}</em>`, color: ink,+ }))+ out.push(newSlide(deck, c.els))+ return+ }+ ctx.note('media-embedded', title)+ const data = assetValue(src, ctx.doc)+ const poster = typeof b.poster === 'string' && b.poster && !loadsRemotely(b.poster, ctx.doc)+ ? assetValue(b.poster, ctx.doc) : ''+ const el: MediaElement = {+ id: eid('m'), type: 'media',+ kind: String(b.kind ?? 'video') === 'audio' ? 'audio' : 'video',+ x: M, y: c.top, w: BODY_W, h: BODY_BOTTOM - c.top,+ rotation: 0, opacity: 1,+ src: intern(deck, data),+ ...(poster ? { poster: intern(deck, poster) } : {}),+ fit: 'contain', radius: 6,+ controls: b.controls !== false,+ loop: b.loop === true,+ muted: b.muted === true,+ // NEVER autoplay. blocks.ts mediaPlayback() states the rule for a space;+ // an export must not hand a surface a flag the source refused to honour.+ autoplay: false,+ }+ c.els.push(el)+ out.push(newSlide(deck, c.els))+}++/**+ * A canvas becomes a SLIDE, which is the one mapping in here that gains+ * something: a spaces canvas stores each card as a percentage across and down+ * a surface of a known aspect ratio, and a slide is a surface of a known aspect+ * ratio. So the arrangement the author made survives, scaled — the only thing+ * invented is the card WIDTH, which the format does not carry yet (canvas.ts+ * reserves `cw`/`ch` for it).+ */+function canvasSlide(+ deck: BentoDoc, out: Slide[], title: string, b: Block, page: Page,+ eff: Map<string, string | undefined>, byId: Map<string, Block>, ctx: Ctx,+ ink: string, accent: string, headFamily: string,+): void {+ ctx.note('canvas-flattened', title)+ const name = inlineForDeck(b.html).text.trim()+ const c = chrome(title || name, ink, accent, headFamily)+ const cards = page.blocks.filter((x) => {+ for (let id = eff.get(x.id); id; id = eff.get(id)) {+ if (id === b.id) return true+ if (!byId.has(id)) break+ }+ return false+ })+ const top = c.top+ const h = BODY_BOTTOM - top+ // CARD_W in canvas.ts is 22% of the surface; the same fraction of the slide+ // keeps a storyboard reading as a storyboard.+ const cw = Math.round(BODY_W * 0.22)+ cards.forEach((card, i) => {+ const p = cardPos(card, i)+ const inline = inlineForDeck(card.html)+ const x = M + Math.round((p.x / 100) * BODY_W)+ const y = top + Math.round((p.y / 100) * h)+ const boxH = Math.max(56, textHeight(inline.text, cw - 24, 17) + 24)+ c.els.push(rect({+ x: Math.min(x, W - M - cw), y: Math.min(y, BODY_BOTTOM - boxH),+ w: cw, h: boxH, fill: tint(ink, 0.07, 'rgba(30,42,58,0.07)'), radius: 8,+ }))+ c.els.push(text({+ x: Math.min(x, W - M - cw) + 12, y: Math.min(y, BODY_BOTTOM - boxH) + 12,+ w: cw - 24, h: boxH - 24,+ html: inline.html || esc('—'), fontSize: 17, color: ink,+ }))+ })+ if (!cards.length) {+ c.els.push(text({ x: M, y: top, w: BODY_W, h: 60, html: `<em>${esc(name || '—')}</em>`, color: ink }))+ }+ out.push(newSlide(deck, c.els))+}++// --- assets ------------------------------------------------------------------++/**+ * Park a data: URI in the DECK's own asset table and return an `asset:` ref.+ *+ * Identical bytes reuse one key, exactly as slides' own `internAsset` does, so+ * a logo on six slides travels once. The key is derived from the bytes so two+ * exports of one page produce the same table.+ */+function intern(deck: BentoDoc, dataUri: string): string {+ const table = (deck.assets ??= {})+ let h = 0x811c9dc5+ for (let i = 0; i < dataUri.length; i++) {+ h ^= dataUri.charCodeAt(i)+ h = Math.imul(h, 0x01000193) >>> 0+ }+ let key = `a${h.toString(36)}`+ // A collision would silently show the wrong picture, so walk until the slot+ // is free or already holds these exact bytes.+ let salt = 0+ while (Object.hasOwn(table, key) && table[key] !== dataUri) key = `a${h.toString(36)}-${++salt}`+ table[key] = dataUri+ return `asset:${key}`+}++// --- honesty, in the file ----------------------------------------------------++/**+ * The drop report, written into the deck's own speaker notes.+ *+ * The editor shows the same list before the download, and a toast is gone in+ * four seconds. A presenter opening this deck a week later has no other way to+ * learn that the page it came from had a video on it.+ */+function writeSlideNotes(slides: Slide[], notes: DeckNote[]): void {+ if (!notes.length || !slides.length) return+ const byTitle = new Map<string, DeckNote[]>()+ for (const n of notes) {+ const list = byTitle.get(n.where)+ if (list) list.push(n)+ else byTitle.set(n.where, [n])+ }+ const line = (n: DeckNote): string => `${NOTE_TEXT[n.code]}${n.n > 1 ? ` (×${n.n})` : ''}`+ // Deck-wide notes ('' where) go on the title slide; the rest go on the first+ // slide carrying that title.+ for (const [where, list] of byTitle) {+ const target = where+ ? slides.find((s) => s.elements.some((e) => e.type === 'text' && e.role === 'title' && e.html === esc(where)))+ : slides[0]+ const slide = target ?? slides[0]+ const head = 'From the page this deck came from:'+ slide.notes = [slide.notes, slide.notes ? '' : '', head, ...list.map(line)]+ .filter((s, i) => s !== '' || i > 0).join('\n').trim()+ }+}++/**+ * ENGLISH, DELIBERATELY, and only here.+ *+ * These strings go into the DOCUMENT, not into the UI: they are written once,+ * into a file that then travels to readers whose locale nobody knows. The UI's+ * copy of the same list is eight translated `t()` calls in editor.ts. A+ * document is not localized by the reader's browser — its words are the words+ * its author saved — so a viewer-locale string in a saved artefact would be a+ * lie the first time the file changed hands.+ */+const NOTE_TEXT: Record<DeckNoteCode, string> = {+ 'image-remote': 'a picture that lives on the web was left out (a deck never fetches)',+ 'media-remote': 'a clip that lives on the web was left out (a deck never fetches)',+ 'media-embedded': 'a clip travelled as embedded bytes — this deck is large',+ 'link-flattened': 'a link kept its words; a slide has nowhere to put the address',+ 'pagelink': 'a card that opened another page became its title',+ 'toggle-open': 'a fold is shown open — a slide cannot fold',+ 'callout-plain': 'a callout kept its words and its kind, in a plain panel',+ 'canvas-flattened': 'a canvas became a slide; card sizes were chosen here',+ 'table-split': 'a table was too tall for one slide and continues on the next',+ 'view-derived': 'a board became a table of the rows it stood for',+ 'unknown-block': 'a block this build does not know became its text',+ 'empty-block': 'a block with nothing in it was left out',+ rtl: 'this space reads right-to-left; a deck has no such setting',+ comments: 'review comments stayed behind, on purpose',+ 'icon-glyph': 'the page’s icon is one of this app’s own glyphs and did not travel',+}