Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
spaces: a page can set its own design, and a section passes it down (#664)
nyblnetd234a7770850
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.mdindex b54ed939..b3be1601 100644--- a/docs/DECISIONS.md+++ b/docs/DECISIONS.md@@ -9625,3 +9625,141 @@ the tone roles.**Cost.** Shell 271,810 → 300,835 B (+29,025, 10.7%); about 12 KB of it is 115new UI strings in nine languages.++### Addendum, same day — a page can set its own design++**The maintainer's ask ("go"): designs per page as well as per space.** The+claim above — "the resolver takes a name… so a later `Page.design` resolves+through the same function" — held for the LOOKUP and nothing else, and two traps+were waiting. `resolveDesign(doc, name = doc.design)` reads the SPACE's design+when handed `undefined`, so "this page names nothing" silently meant "the+space's" wherever a caller passed an absent key straight through; the page+resolver passes `null`. And designs.css matches by ANCESTOR attribute at equal+specificity, so two design roots NESTED with different designs do not resolve+to the nearer one: source order decides, and a switch only one of them sets+leaks into the other. #559 put the space's design on the print root and every+page inside it; with per-page designs that is a nesting. Measured (sabotage+below): with the print root carrying the space's Almanac, Almanac's drop cap+appeared on the Studio and Ledger pages in print.++**Format (additive).** `page.design`: the same kind of value as `doc.design`+(a built-in or a key of `doc.designs`). ABSENT = inherit; choosing "Same as+parent" DELETES the key (`designs.ts setPageDesign`). Older builds ignore it and+show the space's design; parseDoc keeps it like any unknown page field.++**Precedence, nearest first: the page's own, the nearest ancestor's, the+space's, today's look** (`designs.ts designSource` / `resolvePageDesign`, the+one place a page's look is decided — the surface, the page root, print and the+thumbnail all ask it). So a design on a section restyles its subtree. **The+nearest KEY decides, even an unknown one:** a page naming a design this build+does not know renders the DEFAULT look — it does not fall through to its+parent's — and so do the pages under it. Falling through would make a typo, or+a newer build's built-in, look like a deliberate choice of the section's.+validate() names it as `unknown-design` with the page's id. There is no+"Default" choice for a page: the format's value is a name, and the default has+none.++**No two design roots nest with different designs — the invariant that replaces+scoping.** Rather than rewrite designs.css into `@scope (…) to (…)` blocks (the+only CSS that gives nearest-root isolation; newest in Firefox, and a browser+without it would drop every design rule), the structure guarantees it:++- `renderPage` stamps its page ROOT (`article.sp-page`) with that page's+ resolved design, and it is the only place in render.ts that stamps one.+- The editor puts the SAME resolved design on `.sp-main` and on the page root+ inside it (`editor.syncDesign`), preview included, so the one nesting that+ exists is always identical.+- The print root carries NONE; each page root carries its own, and the contents+ list the space's.+- Everything rendered inside a page — gallery cards, view rows, page cards, and+ a transclusion embed (#428: `renderEmbed` draws the other page's blocks+ through renderBlocks, never renderPage) — is built under the host's root and+ so wears the HOST's design: the design is the page you are ON, not the page a+ card or an embed points at.++The model rig asserts each of those in source; the browser checks measure them.++**Picker.** The page ⋯ menu gains **Design** (its hint says what the page wears+now, "Inherited · Almanac" or its own), and the properties panel a Design row;+both open one KERNEL menu (`editor.openPageDesign` → `menuAt`, filled by+`designpanel.ts fillPageDesignMenu`). The hover preview ends in that menu's+`onClose` (menus.ts anchoredMenu), the one callback that fires however the+menu goes — a row, Escape, a press outside, another menu opening — so a preview+can never outlive its menu. First row: "Same as+parent" ("Same as space" at the top level) with what it resolves to. Hover+previews exactly — `DesignPreview` tries a name at one page or at the space and+resolves the page in view through the same precedence, so hovering a SPACE+design over a page with its own design correctly changes nothing. The preview+starts on a pointer MOVE, not mouseenter: the menu opens where the page menu+was and a row lands under a still pointer, which the browser reports as an+enter (measured: the page flipped to Riso the instant the menu opened).+Choosing is one undo step. **Customise…** forks into `doc.designs` and assigns+the fork to THIS page only — including when the page merely inherits a custom+design, which is copied, so customising one page never restyles its section.+Removing a custom design sends every reference to it (the space's and each+page's) back to its base, or deletes the key.++**Export page as a space** pins a design a page inherited from an ancestor that+does not travel onto the extracted page whose parent was cut, so the extract+looks as it did.++**Markdown — one file exports, a note imports.** The export is ONE file+("Every page, as one .md file"), and it imports as ONE page: its headings come+back as blocks, not pages — true before this and unchanged. So per-page designs+round-trip through the note-per-page unit: **Export page as Markdown…** (new,+under Save ▾ — one line, its description the tooltip, as slides' Save rows —+the maintainer's ruling, since Save is where every export lives; it exports the+page in view, footnote definitions included) writes `design:` only when that page sets one ITSELF (an inherited+design is not written — the note would pin a look the page never chose), plus+the one `designs:` entry it names. The whole-space file writes the space's+`design:` and a `designs:` line carrying every custom design the space OR ANY+PAGE names. On import, a note's `design:` lands on THAT note's page, the carried+entries join the registry (never over a name in use), and **the space's own+design is no longer adopted** — reversing #559's "an import adopts the design+into a space that has none": an import adds pages; it restyles only them.+Front-matter handling only; no Markdown body parsing changed.++**Collab.** `page.design` is an ordinary page-property register in the kernel+engine, like `width` or `cover`; inherit travels as a deletion. Guarded in+`scripts/test-sync-spaces.ts`.++**Static preview** wears the HOME page's resolved design (its own, its+section's, then the space's), still as inline styles through the CSSOM.++**The popover click-away fix this was first written with is gone.** On its+original base every popover's mousedown-away listener outlived its popover, so+opening Design from the page menu was dismissed by its first click. By the+time this landed, main had moved every menu and popover onto the kernel menu+and `float()` (one delegated listener pair, every listener taken back on close),+which fixes the same bug at its root; there was nothing left to patch.++**Guarded, each sabotaged and seen to fail.** Model rig (per-page section): the+ancestor walk cut (9 assertions fail), the space consulted before the page (12),+inherit writing `''` instead of deleting (1), an unknown name falling through+to the parent (3), the print root stamped with the space's design (1), a gallery+card stamped with its own page's design (1). Roundtrip rig: the importer not+setting `page.design` (4), a page note writing its INHERITED design (4). In the+browser (headless Chrome over 127.0.0.1, uniquely named builds): on a Studio+page, a gallery of Ledger pages measured Studio (radius 14px, cell+rgb(94,118,153), Avenir) and the only design root inside `.sp-main` was its own+page root; with the card sabotage it measured Ledger (radius 0, rgb(39,67,214))+with five nested roots. In print media each page root carried its own design+(Studio Avenir, Ledger Helvetica Neue, Almanac Iowan; the Studio callout the+print hairline), no drop cap outside Almanac; with the root stamped, the drop+cap leaked onto Studio and Ledger.++**Ported onto main after the kernel menus, transclusion and footnotes+landed.** The picker became a kernel menu (above), the Markdown note moved to+Save ▾, and the host-design rule now has a real embed to hold: the model rig+asserts `renderEmbed` reaches the other page only through renderBlocks, and in+the browser (headless Chrome over 127.0.0.1, a uniquely named build) a Studio+page embedding a Riso page had exactly two design roots inside `.sp-main`, both+Studio, none inside the embed, and the embedded paragraph computed Studio's+Avenir Next. The preview's close paths were measured with a sabotage: with the+menu's `onClose` removed, Escape left the page in the hovered Riso and a press+outside left it in the keyboard-focused Ledger; with it, both returned to the+page's own design. A single page's note carries that page's footnote+definitions (and no other page's), held by the roundtrip rig.++**Cost.** Shell 364,703 → 368,299 B (+3,596), ten new strings in nine languages+(one retired: the import no longer adopts a space-level design).diff --git a/docs/spaces-agents.md b/docs/spaces-agents.mdindex c83afdbf..f0808c4c 100644--- a/docs/spaces-agents.md+++ b/docs/spaces-agents.md@@ -84,9 +84,26 @@ callout tones must stay distinct — `design-contrast` if they collapse). A valu`design-contrast`. There is no free CSS anywhere in a design. A name that isalso a built-in's is never used (`design-shadows-builtin`).-The Markdown export opens with the design as front matter —-`design: harbour` plus a one-line `designs: {…}` JSON for a carried design —-and importing that file into a space with no design adopts it.+**A page can name its own design** with the same kind of value:+`{ "id": "p-…", "title": "Q3 figures", "design": "ledger", … }`. Absent means+inherit: a page wears its own design, else its nearest ancestor's, else the+space's `design`, else the default look — so a design on a section restyles+its whole subtree. Leave the key out to inherit (never `""` or `null`). An+unknown name renders the DEFAULT look on that page (it does not fall through+to the parent's), is kept, and `validate()` reports `unknown-design` with that+page's id. Custom designs a page uses live in the space's `"designs"` like any+other. Embedded content — a gallery card, a view's rows, a page card, an+`embed` block showing another page — wears the design of the page it is shown+ON, not the page it points at.++The Markdown export opens with the design as front matter. The whole-space+file says `design: <space's design>` plus a one-line `designs: {…}` JSON+carrying every custom design the space or any page names; a single page's note+("Export page as Markdown…") says `design:` only when that page sets one+itself — an inherited design is not written. Import reads `design:` back onto+EACH note's own page and adds the carried `designs:` entries to the space's+registry (never over a name the space already uses); it does not change the+space's own `design`.**Both arrays are flat and in pre-order; nesting is a `parent` field.** A childalways follows its parent, which is what lets one forward pass rebuild thediff --git a/scripts/test-spaces-chrome.ts b/scripts/test-spaces-chrome.tsindex 17476c5c..ec0e7e46 100644--- a/scripts/test-spaces-chrome.ts+++ b/scripts/test-spaces-chrome.ts@@ -927,6 +927,9 @@ async function browser(chrome: string, html: string): Promise<void> {// …and the new homes are what reach them: the pages from the page listfor (const c of ['New page', "Today's journal", 'New issue']) if (!/^page list/.test(now[c] ?? '')) lost.push(`${c} (not on the page list's + ▾: ${now[c]})`)for (const c of ['Audio', 'Gallery', 'List', 'Table view', 'Comment']) if (!(c in now)) lost.push(`${c} (new member unreachable)`)+ // per-page designs: the page's Design row, and its note under Save ▾+ if (!('Design' in now)) lost.push('Design (new member unreachable)')+ if (!('Export page as Markdown…' in now)) lost.push('Export page as Markdown… (new member unreachable)')ok(lost.length === 0, `at ${w}px every command reachable before is reachable now (${BEFORE[w].length} checked${lost.length ? '; LOST: ' + lost.join(', ') : ''})`)}diff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.tsindex afd28900..79d0e1ea 100644--- a/scripts/test-spaces-model.ts+++ b/scripts/test-spaces-model.ts@@ -5814,6 +5814,122 @@ function fsTable(f: string): string {ok(docContentKey(before) !== docContentKey(journal), 'choosing a journal template changes the content key')}+// ---- per-page designs (DECISIONS 2026-09-26, per-page addendum) -------------+// `page.design` is the same kind of value as `doc.design`. Precedence, nearest+// first: the page's own, the nearest ancestor's, the space's, today's look.+// The NEAREST KEY DECIDES even when it names nothing this build knows.+{+ const D = await import('../spaces/src/designs.ts')+ const { validateDoc } = await import('../spaces/src/agent.ts')+ const rdm = (f: string) => nodeFs.readFileSync(new URL(`../spaces/src/${f}`, import.meta.url), 'utf8')+ const tree = (): SpacesDoc => {+ const r = parseDoc(JSON.stringify({ format: FORMAT, version: 1, docId: 'pd-doc', title: 'T', design: 'almanac', pages: [+ { id: 'home', title: 'Home', blocks: [{ id: 'b0', type: 'p', html: 'x' }] },+ { id: 'sec', title: 'Section', parent: 'home', blocks: [{ id: 'b1', type: 'p', html: 'x' }] },+ { id: 'kid', title: 'Kid', parent: 'sec', blocks: [{ id: 'b2', type: 'p', html: 'x' }] },+ { id: 'leaf', title: 'Leaf', parent: 'kid', blocks: [{ id: 'b3', type: 'p', html: 'x' }] },+ ] }))+ if (!r.ok) throw new Error('fixture')+ return r.doc+ }+ const pg = (d: SpacesDoc, id: string) => d.pages.find((p) => p.id === id)!+ const at = (d: SpacesDoc, id: string) => D.resolvePageDesign(d, id)?.name ?? null++ // INHERITANCE ORDER+ const d = tree()+ ok(at(d, 'leaf') === 'almanac' && D.designSource(d, 'leaf').from === 'space', 'no page names a design: every page wears the space\'s')+ D.setPageDesign(pg(d, 'sec'), 'ledger')+ ok(at(d, 'sec') === 'ledger' && at(d, 'kid') === 'ledger' && at(d, 'leaf') === 'ledger' && at(d, 'home') === 'almanac',+ 'a design on a section restyles its whole subtree, and nothing above it')+ ok(D.designSource(d, 'leaf').from === 'ancestor' && D.designSource(d, 'leaf').pageId === 'sec', 'the subtree takes it from the NEAREST ancestor that names one')+ D.setPageDesign(pg(d, 'kid'), 'studio')+ ok(at(d, 'kid') === 'studio' && at(d, 'leaf') === 'studio' && at(d, 'sec') === 'ledger',+ 'a nearer ancestor beats a farther one, and the page\'s own beats both')+ D.setPageDesign(pg(d, 'leaf'), 'riso')+ ok(at(d, 'leaf') === 'riso', 'a page\'s own design wins over every ancestor and the space')+ ok(D.resolvePageDesign(d, 'leaf', undefined, true)?.name === 'studio', '"Same as parent" resolves to what the page would inherit (its parent\'s, studio)')+ const nod = tree()+ D.setDesign(nod, null)+ ok(at(nod, 'leaf') === null && D.designSource(nod, 'leaf').from === 'none', 'no design anywhere: today\'s look')++ // RETURNING TO INHERIT DELETES THE KEY+ const del = tree()+ const before = JSON.stringify(del)+ D.setPageDesign(pg(del, 'kid'), 'broadsheet')+ D.setPageDesign(pg(del, 'kid'), null)+ ok(!Object.hasOwn(pg(del, 'kid'), 'design') && JSON.stringify(del) === before,+ 'choosing "Same as parent" DELETES page.design — byte-identical to never having chosen')+ ok(/setPageDesign\(q, name\)/.test(rdm('designpanel.ts')) && /store\.commit\(\(\) => \{\s*const q = store\.index\.page\.get\(pageId\)\s*if \(q\) setPageDesign\(q, name\)/.test(rdm('designpanel.ts')),+ 'the page picker writes through setPageDesign inside ONE store.commit (one undo step)')++ // AN UNKNOWN NAME FALLS BACK TO THE DEFAULT, ROUND-TRIPS, AND IS NAMED+ const unk = tree()+ D.setPageDesign(pg(unk, 'sec'), 'ledger')+ ;(pg(unk, 'kid') as { design?: string }).design = 'from-a-newer-build'+ ok(at(unk, 'kid') === null, 'an unknown page design renders the DEFAULT look — it does not fall through to the section\'s ledger')+ ok(at(unk, 'leaf') === null, '…and the pages under it inherit that default, not the section\'s design')+ const back = parseDoc(JSON.stringify(unk))+ ok(back.ok && (back.doc.pages.find((p) => p.id === 'kid') as { design?: string }).design === 'from-a-newer-build',+ 'an unknown page design survives a load/save round trip untouched')+ const vf = validateDoc(unk).findings+ ok(vf.some((f) => f.code === 'unknown-design' && f.page === 'kid' && f.path === 'design'), 'validate() names the unknown design, on that page')+ ok(!vf.some((f) => f.code === 'unknown-design' && f.page === 'sec'), 'validate() says nothing about a page whose design resolves')+ ;(pg(unk, 'leaf') as { design?: unknown }).design = 7+ ok(at(unk, 'leaf') === null && validateDoc(unk).findings.some((f) => f.code === 'bad-design' && f.page === 'leaf'),+ 'a non-string page design renders the default and is named as bad-design')++ // PREVIEW: never data, and exact+ const pv = tree()+ D.setPageDesign(pg(pv, 'sec'), 'ledger')+ const snap = JSON.stringify(pv)+ ok(D.resolvePageDesign(pv, 'leaf', { page: 'sec', name: 'studio' })?.name === 'studio', 'hovering a choice on a section previews it on a page inside that section')+ ok(D.resolvePageDesign(pv, 'leaf', { page: 'sec', name: null })?.name === 'almanac', 'hovering "Same as parent" on the section previews the space\'s design below it')+ ok(D.resolvePageDesign(pv, 'leaf', { name: 'riso' })?.name === 'ledger', 'hovering a SPACE design leaves a page under a designed section as it is — as choosing it would')+ ok(JSON.stringify(pv) === snap, 'a preview writes nothing to the document')++ // THE REGISTRY is the space's, and every page draws on it+ const reg = tree()+ ;(reg as { designs?: unknown }).designs = { harbour: { base: 'almanac', light: { accent: '#0f6e63' } } }+ D.setPageDesign(pg(reg, 'kid'), 'harbour')+ ok(D.resolvePageDesign(reg, 'leaf')?.custom === true && D.resolvePageDesign(reg, 'leaf')?.name === 'harbour', 'a page can wear a custom design from the space\'s registry, and its subtree inherits it')+ ok(JSON.stringify(D.namedDesigns(reg).sort()) === JSON.stringify(['almanac', 'harbour']), 'namedDesigns lists the space\'s and every page\'s design')++ // OLDER BUILDS: page.design is an unknown page field to them; parseDoc keeps it+ ok(docContentKey(reg) !== docContentKey(tree()), 'a page design is content: choosing one offers crash recovery')++ // EMBEDDED CONTENT WEARS THE HOST'S DESIGN: only renderPage stamps a design,+ // and only on the page ROOT; renderBlocks (every card, row and embed) never+ const rsrc = rdm('render.ts')+ const fnBody = (src: string, name: string) => { const i = src.indexOf(`export function ${name}(`); return src.slice(i, src.indexOf('\nexport function', i + 10)) }+ ok((rsrc.match(/applyDesign\(/g) ?? []).length === 1 && /applyDesign\(art, doc,/.test(fnBody(rsrc, 'renderPage')),+ 'render.ts stamps a design in ONE place: the page root renderPage builds')+ ok(!/applyDesign|data-sp-design/.test(fnBody(rsrc, 'renderBlocks')) && !/applyDesign|data-sp-design/.test(fnBody(rsrc, 'renderBlock')),+ 'renderBlocks/renderBlock never stamp a design, so embedded content can only wear its host\'s')+ // A TRANSCLUSION EMBED (#428) is the case that most looks like a page: it+ // draws another page's blocks. It must draw them through renderBlocks under+ // the host's root — never renderPage, which would nest a second design root+ // carrying the EMBEDDED page's design inside the host's.+ const embedFn = (() => { const i = rsrc.indexOf('function renderEmbed('); return rsrc.slice(i, rsrc.indexOf('\n}\n', i)) })()+ ok(embedFn.length > 100 && /renderBlocks\(/.test(embedFn) && !/renderPage\(|applyDesign|data-sp-design|resolvePageDesign/.test(embedFn),+ 'a transclusion embed renders the other page through renderBlocks, so it wears the HOST page\'s design, not its own')+ const esrc = rdm('editor.ts')+ ok(/applyDesign\(host, s\.doc, null\)/.test(esrc), 'the print root carries NO design, so it cannot reach a page that has none of its own')++ // "Export page as a space" keeps the look: a design inherited from a page+ // that does not travel is pinned on the page that wore it+ const ex = tree()+ D.setPageDesign(pg(ex, 'sec'), 'ledger')+ const cutx = extractSpace(ex, 'kid', { docId: 'doc-pd', now: '2026-09-26T00:00:00.000Z' })+ const xk = cutx.doc.pages.find((p) => p.id === 'kid')!+ const xl = cutx.doc.pages.find((p) => p.id === 'leaf')!+ ok(xk.design === 'ledger' && xl.design === undefined && D.resolvePageDesign(cutx.doc, 'leaf')?.name === 'ledger',+ 'an extracted page keeps the design its (untravelled) section gave it; its own children still just inherit')+ const ex2 = tree()+ const cut2 = extractSpace(ex2, 'kid', { docId: 'doc-pd2', now: '2026-09-26T00:00:00.000Z' })+ ok(cut2.doc.pages.every((p) => p.design === undefined) && D.resolvePageDesign(cut2.doc, 'kid')?.name === 'almanac',+ 'a design that came from the SPACE travels as the space\'s, and pins nothing')+}+console.log(`\n${checks - failures}/${checks} checks passed`)if (failures) process.exit(1)diff --git a/scripts/test-spaces-restore-gate.ts b/scripts/test-spaces-restore-gate.tsindex d48bea71..6160f559 100644--- a/scripts/test-spaces-restore-gate.ts+++ b/scripts/test-spaces-restore-gate.ts@@ -251,6 +251,13 @@ console.log('\na design is content, not identity\n')designedLive.design = 'ledger'const g2 = gateRestored(JSON.stringify(clone(live)), designedLive)ok(g2.ok && !Object.hasOwn(g2.doc, 'design'), 'restoring a snapshot with no design does not keep the live design (it is content, not identity)')+ // A PAGE's design (per-page designs) is content too: it lives in `pages`,+ // which the gate passes through and the content key already covers+ const paged = clone(live) as SpacesDoc+ ;(paged.pages[0] as { design?: string }).design = 'studio'+ const g3 = gateRestored(JSON.stringify(paged), live)+ ok(g3.ok && (g3.doc.pages[0] as { design?: string }).design === 'studio', 'the gate passes a page\'s own design through from the snapshot')+ ok(recoveryOffered(JSON.stringify(paged), live), 'a snapshot that differs only by one page\'s design is offered for recovery')}console.log(`\n${checks - failures}/${checks} checks passed`)diff --git a/scripts/test-spaces-roundtrip.ts b/scripts/test-spaces-roundtrip.tsindex 0ff09a6e..d4aebc43 100644--- a/scripts/test-spaces-roundtrip.ts+++ b/scripts/test-spaces-roundtrip.ts@@ -192,9 +192,12 @@ ok(/!\[[^\]]+\]\([^)]+\)/.test(md), 'an image exports with its alt text and refe'a design the space carries round-trips through Markdown value for value (and only the one in use travels)')const plan = planImport([{ path: 'space.md', text: mdC }], { rootTitle: 'Imported' })const into = starterDoc() as unknown as Record<string, unknown>- const adopted = adoptDesign(into as never, plan.design, plan.designs)- ok(adopted === 'harbour' && into.design === 'harbour' && JSON.stringify((into.designs as Record<string, unknown>).harbour) === JSON.stringify(harbour),- 'importing that Markdown into a space with no design adopts the design it carried')+ // the editor's call since per-page designs: registry only, never the space's+ const adopted = adoptDesign(into as never, undefined, plan.designs)+ ok(adopted === null && into.design === undefined && JSON.stringify((into.designs as Record<string, unknown>).harbour) === JSON.stringify(harbour),+ 'importing that Markdown adds the design it carried to the registry, and leaves the space\'s own design alone')+ ok(plan.pages.length === 1 && plan.pages[0].design === 'harbour',+ 'the note\'s `design:` lands on the page the note became, so it looks as it left')const already = starterDoc() as unknown as Record<string, unknown>already.design = 'ledger'ok(adoptDesign(already as never, plan.design, plan.designs) === null && already.design === 'ledger',@@ -208,5 +211,87 @@ ok(/!\[[^\]]+\]\([^)]+\)/.test(md), 'an image exports with its alt text and refeok(obsidian.design === 'ledger' && obsidian.frontmatter === 'tags: [a]\ndesign: ledger', 'front matter with other keys is still kept verbatim')}+// ---- per-page designs through Markdown -------------------------------------+// The export is one file today ("Every page, as one .md file"), and it imports+// as ONE note: its headings come back as blocks, not pages. So the round trip+// that carries PER-PAGE designs is the note-per-page one — "Export page as+// Markdown…", and a folder of notes on import — and the whole-space file is+// held to carrying the space's design and the registry every page draws on.+{+ type P = { id: string; parent?: string; title: string; design?: string }+ const space = starterDoc() as unknown as { design?: string; designs?: Record<string, unknown>; pages: P[] }+ space.design = 'almanac'+ const tide = { label: 'Tide', base: 'studio', light: { accent: '#0f6e63' } }+ space.designs = { tide, spare: { base: 'riso' } }+ const [home, sec] = [space.pages[0], space.pages.find((p) => p.parent === space.pages[0].id) ?? space.pages[1]]+ const kid: P = { id: 'p-kid-rt', title: 'Kid note', parent: sec.id, blocks: [{ id: 'b-kid-rt', type: 'p', html: 'kid' }] } as never+ space.pages.push(kid)+ sec.design = 'ledger'+ const st = new Store(space as never)+ const one = (id: string) => toMarkdown(st as never, { page: id })++ // a footnote on the section and another on the home page: a page's note+ // must carry ITS definitions (markdown scopes a definition to its file) and+ // only its own+ ;(sec as unknown as { blocks: unknown[] }).blocks.push({ id: 'b-sec-fn', type: 'p', html: 'claim[^sec-n]' })+ ;(home as unknown as { blocks: unknown[] }).blocks.push({ id: 'b-home-fn', type: 'p', html: 'other[^home-n]' })+ ;(space as unknown as { footnotes: Record<string, string> }).footnotes = { 'sec-n': 'the section source', 'home-n': 'the home source' }++ const mdSec = one(sec.id)+ ok(mdSec.startsWith('---\ndesign: ledger\n---\n\n# '),'a page that sets its own design exports `design:` in its note\'s front matter')+ ok(/^\[\^sec-n\]: the section source$/m.test(mdSec) && !mdSec.includes('home-n'),+ 'a page\'s note carries the definitions of ITS footnotes, and no other page\'s')+ const backFn = planImport([{ path: 'notes/Section.md', text: mdSec }], { rootTitle: 'x' })+ ok(backFn.footnotes['sec-n'] === 'the section source', '…and they come back as footnotes on import')+ const mdKid = one(kid.id)+ ok(mdKid.startsWith('# ') && !/^design:/m.test(mdKid), 'a page that only INHERITS its design (here, its section\'s ledger) writes no front matter')+ const mdHome = one(home.id)+ ok(mdHome.startsWith('# '), 'a page wearing the space\'s design writes none either — the space\'s design is the space file\'s to say')+ kid.design = 'tide'+ const mdTide = one(kid.id)+ ok(mdTide.startsWith('---\ndesign: tide\ndesigns: {"tide":') && !mdTide.includes('spare'),+ 'a page on a custom design carries that one registry entry, and only it')++ // import each note as its own page, as a folder of notes+ const plan = planImport([+ { path: 'notes/Section.md', text: mdSec },+ { path: 'notes/Kid note.md', text: mdTide },+ { path: 'notes/Home.md', text: mdHome },+ ], { rootTitle: 'Imported' })+ const byTitle = (t: string) => plan.pages.find((p) => p.title === t)+ ok(byTitle(sec.title)?.design === 'ledger' && byTitle('Kid note')?.design === 'tide' && byTitle(home.title)?.design === undefined,+ 'import reads each note\'s `design:` back onto ITS page, and a note without one stays inheriting')+ ok(!plan.pages.some((p) => (p.blocks ?? []).some((b) => (b as { frontmatter?: unknown }).frontmatter)),+ 'design-only front matter is consumed on every note, never kept as a folded yaml block')+ const target = starterDoc() as unknown as Record<string, unknown>+ adoptDesign(target as never, undefined, plan.designs)+ ok(target.design === undefined && JSON.stringify((target.designs as Record<string, unknown>).tide) === JSON.stringify(tide),+ 'the custom design a page carried joins the target space\'s registry, and the space\'s own design is untouched')++ // unknown names survive per page+ kid.design = 'from-a-newer-build'+ const planU = planImport([{ path: 'k.md', text: one(kid.id) }], { rootTitle: 'x' })+ ok(planU.pages[0].design === 'from-a-newer-build', 'a page design this build does not know round-trips through its note')++ // the whole-space file: the space's design + every custom one a page names+ kid.design = 'tide'+ const whole = toMarkdown(st as never)+ ok(whole.startsWith('---\ndesign: almanac\ndesigns: {"tide":') && !whole.includes('"spare"'),+ 'the whole-space export names the space\'s design and carries every custom design a page uses (not unused ones)')+ const planW = planImport([{ path: 'space.md', text: whole }], { rootTitle: 'x' })+ ok(planW.pages.length === 1 && planW.pages[0].design === 'almanac' && JSON.stringify(planW.designs?.tide) === JSON.stringify(tide),+ 'importing the whole-space file gives ONE page (as before) wearing the space\'s design, and brings the registry')++ // one undo step, and inherit deletes the key — through the real store+ const s2 = new Store(starterDoc() as never)+ const p2 = (s2 as unknown as { doc: { pages: P[] } }).doc.pages[1]+ const key0 = JSON.stringify((s2 as unknown as { doc: unknown }).doc)+ s2.commit(() => { p2.design = 'riso' }, { structure: false })+ s2.commit(() => { delete p2.design }, { structure: false })+ ok(JSON.stringify((s2 as unknown as { doc: unknown }).doc) === key0, 'set then "Same as parent" leaves the document byte-identical')+ s2.undo()+ ok(((s2 as unknown as { doc: { pages: P[] } }).doc.pages[1]).design === 'riso', 'each design choice is exactly ONE undo step')+}+console.log(`\n${checks - failures}/${checks} checks passed`)process.exit(failures ? 1 : 0)diff --git a/scripts/test-sync-spaces.ts b/scripts/test-sync-spaces.tsindex 971ae2d2..63d13d7b 100644--- a/scripts/test-sync-spaces.ts+++ b/scripts/test-sync-spaces.ts@@ -282,6 +282,34 @@ console.log('')// chosen. STRICT=1 turns them into assertions — flip it in CI the moment the// decisions land, and this rig becomes their enforcement.// ---------------------------------------------------------------------------+// ---------------------------------------------------------------------------+// page.design is a page property REGISTER, like width or cover: it travels,+// concurrent choices converge on one, and "Same as parent" (the key DELETED)+// travels as a deletion — never as a stored empty value.+// ---------------------------------------------------------------------------+{+ const pd = (d: Doc, id: string) => (d.pages.find((p) => p.id === id) as { design?: unknown } | undefined)?.design+ const a = new Replica('pd-a', baseDoc())+ const b = new Replica('pd-b', clone(a.doc))+ const setOn = (r: Replica, v: string | null) => r.mutate((d) => {+ const p = d.pages.find((x) => x.id === 'p2') as { design?: unknown }+ if (v === null) delete p.design+ else p.design = v+ })+ b.receive(setOn(a, 'ledger'))+ ok(pd(b.doc, 'p2') === 'ledger', 'a page design chosen on one replica arrives on the other')+ const opsA = setOn(a, 'studio')+ const opsB = setOn(b, 'riso')+ a.receive(opsB)+ b.receive(opsA)+ ok(pd(a.doc, 'p2') === pd(b.doc, 'p2') && ['studio', 'riso'].includes(String(pd(a.doc, 'p2'))),+ `two concurrent page-design choices converge on one of them (${String(pd(a.doc, 'p2'))})`)+ b.receive(setOn(a, null))+ ok(!Object.hasOwn(b.doc.pages.find((p) => p.id === 'p2')!, 'design') && pd(a.doc, 'p2') === undefined,+ '"Same as parent" (the key deleted) arrives as a deletion — no key is left behind')+ ok(JSON.stringify(a.doc) === JSON.stringify(b.doc), 'both replicas end byte-identical')+}+const STRICT = process.env.STRICT === '1'if (STRICT) {ok(worst.dupBlockId === 0, `no merge produced the same block id on two pages (worst ${worst.dupBlockId})`)diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex ec091868..b46ed8d7 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -1197,6 +1197,25 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.300,835 B (+29,025; roughly 12 KB of that is the picker and panel's 115new strings in nine languages).+- **A page can have its own design, and a section passes its design down.**+ Each page's ⋯ menu — and the properties panel — has **Design**: "Same as+ parent" (or "Same as space" at the top), showing what that comes to, then+ every design. Hover one to see it on the page; choosing is one undo step,+ and going back to "Same as parent" leaves the file exactly as it was. Set+ one on a section and every page inside it takes it, unless a page sets its+ own. **Customise…** from there makes a design of that page's own, kept in+ the space, without touching the section or the rest of the space.+ Everything shown inside a page — gallery cards, boards, page cards, another+ page embedded in it — takes the design of the page you are on, not the page+ it points at. Printing the whole space prints each page in its own design;+ the file's thumbnail shows the home page's. **Save ▾ → Export page as+ Markdown…** writes the page you are on as one note, with its footnotes and+ with `design:` in its front matter when the page chose one itself, and+ importing notes puts each note's design back on its own page — an import no+ longer changes the space's own design. Format: an optional `design` on a+ page; an older build shows the space's design and keeps it. Shell 364,703 →+ 368,299 B (+3,596).+## [0.1.0] — 2026-08-03First release.diff --git a/spaces/src/about.ts b/spaces/src/about.tsindex 781dc39c..b7a2662b 100644--- a/spaces/src/about.ts+++ b/spaces/src/about.ts@@ -40,7 +40,7 @@ import '../../kernel/src/ui/dialog.css'import { t, localeChoices, locale, setLocale } from './i18n'import { appearanceSection } from './appearance'import { designSection } from './designpanel'-import { designFrontMatter, type Resolved } from './designs.ts'+import { designFrontMatter, type DesignPreview } from './designs.ts'import { esc, textOf } from './sanitize'import { htmlToMd } from './marks.ts'import { definitionLines } from './footnotes.ts'@@ -76,7 +76,7 @@ export interface AboutHooks {*/onBeforeWrite?: () => void/** paint a design on the page without writing it (the picker's hover) */- previewDesign?: (r: Resolved | null | undefined) => void+ previewDesign?: (pv: DesignPreview | undefined) => void/** the non-modal customise panel, opened over the page */openDesignPanel?: () => void}@@ -572,7 +572,7 @@ function shortStamp(iso: string): string {* The renderer already emits semantic tags, so the mapping is direct — which* is the payoff for having refused divs-with-classes in the first place.*/-export function toMarkdown(store: Store): string {+export function toMarkdown(store: Store, opts: { page?: string } = {}): string {const out: string[] = []const ctx: MdCtx = {titleOf: (id) => store.index.page.get(id)?.title,@@ -645,8 +645,11 @@ export function toMarkdown(store: Store): string {for (const b of page.blocks) if (Array.isArray(b.comments) && b.comments.length) anchored.add(b.id)}for (const m of JSON.stringify(store.doc.pages).matchAll(/#p\/[^"\\/]+\/([A-Za-z][A-Za-z0-9_-]{0,63})/g)) anchored.add(m[1])+ // ONE PAGE is a note: that page alone, as a top-level heading, which is the+ // unit the importer reads back as one page (markdown.ts parseNote).+ const one = opts.page !== undefined ? store.index.page.get(opts.page) : undefinedconst walk = () => {- for (const { page, depth } of store.tree()) {+ for (const { page, depth } of one ? [{ page: one, depth: 0 }] : store.tree()) {out.push(`${'#'.repeat(Math.min(depth + 1, 6))} ${page.title}`, '')// Indent, blockquote markers and what separates one block from the next// are properties of the TREE, not of a block, so they come from the@@ -691,7 +694,9 @@ export function toMarkdown(store: Store): string {walk()// The design leads, as front matter, so the Markdown carries the look with// it (designs.ts designFrontMatter). Nothing is written when there is none.- return [...designFrontMatter(store.doc), ...out].join('\n').replace(/\n{3,}/g, '\n\n')+ // A page's note names only a design that page sets ITSELF; the whole-space+ // file names the space's and carries the registry every page draws on.+ return [...designFrontMatter(store.doc, one?.id), ...out].join('\n').replace(/\n{3,}/g, '\n\n')}/**@@ -706,11 +711,12 @@ export function toMarkdown(store: Store): string {* cannot spell is now a rig failure.*/-export function downloadMarkdown(store: Store): void {- const blob = new Blob([toMarkdown(store)], { type: 'text/markdown' })+export function downloadMarkdown(store: Store, pageId?: string): void {+ const page = pageId !== undefined ? store.index.page.get(pageId) : undefined+ const blob = new Blob([toMarkdown(store, { page: page?.id })], { type: 'text/markdown' })const a = document.createElement('a')a.href = URL.createObjectURL(blob)- a.download = `${(store.doc.title || 'space').replace(/[^\w.-]+/g, '-')}.md`+ a.download = `${((page ? page.title : store.doc.title) || (page ? 'page' : 'space')).replace(/[^\w.-]+/g, '-')}.md`a.click()URL.revokeObjectURL(a.href)}diff --git a/spaces/src/agent.ts b/spaces/src/agent.tsindex 3a8d3fe4..20cf606c 100644--- a/spaces/src/agent.ts+++ b/spaces/src/agent.ts@@ -595,10 +595,12 @@ export function validateDoc(doc: SpacesDoc): ValidateResult {// design's value. The document still opens and still looks designed — so// this is the only place an author finds out a colour was not used.for (const pr of designProblems(doc)) {- add({ code: pr.code, path: pr.path, message: pr.message,+ add({ ...(pr.page ? { page: pr.page } : {}), code: pr.code, path: pr.path, message: pr.message,severity: pr.code === 'unknown-design-key' ? 'info' : 'warning',fix: pr.code === 'unknown-design'- ? `Set design to one of ${BUILT_IN_NAMES.join(', ')}, define it under designs, or delete the key for the default look.`+ ? (pr.page+ ? `Set this page's design to one of ${BUILT_IN_NAMES.join(', ')} or a name under designs, or delete the key so the page inherits its parent's.`+ : `Set design to one of ${BUILT_IN_NAMES.join(', ')}, define it under designs, or delete the key for the default look.`): pr.code === 'design-shadows-builtin' || pr.code === 'bad-design-name'? 'Rename the entry (lowercase letters, digits, hyphens; not a built-in name) and point design at the new name.': 'Write a value the rule accepts (see docs/spaces-agents.md, Designs), or delete the key to take the base design\'s.' })diff --git a/spaces/src/designpanel.ts b/spaces/src/designpanel.tsindex fa4e2667..0660c169 100644--- a/spaces/src/designpanel.ts+++ b/spaces/src/designpanel.ts@@ -21,11 +21,13 @@ import { t } from './i18n'import type { Store } from './store'import type { SpacesDoc } from './model'import { internAsset, blobToDataUri, humanBytes } from './assets'+import { row, caption, type Menu } from './menus.ts'+import { ICONS } from './icons'import {BUILT_INS, BUILT_IN_NAMES, PLAIN, PALETTE_KEYS, FONT_ROLES, FONT_STACKS, PROPS, PROP_KEYS,resolveDesign, resolveData, localDesigns, localLabel, freshDesignName, setDesign, isBuiltIn,- fontAssetUri, parseColour,- type Resolved, type DesignData, type PaletteKey, type FontRole, type PropKey, type Design,+ fontAssetUri, parseColour, resolvePageDesign, setPageDesign,+ type DesignData, type DesignPreview, type PaletteKey, type FontRole, type PropKey, type Design,} from './designs.ts'/** A design's name as the picker shows it. Literals, so the i18n sweep sees them. */@@ -193,7 +195,7 @@ function swatch(d: Design): HTMLElement {export interface DesignHooks {store: Store/** paint a design on the page without writing it; undefined ends the preview */- preview: (r: Resolved | null | undefined) => void+ preview: (pv: DesignPreview | undefined) => void/** the About dialog closes itself before the panel opens over the page */openPanel: () => void}@@ -231,8 +233,10 @@ export function designSection(h: DesignHooks): HTMLElement[] {const span = document.createElement('span')span.textContent = designHint(name)b.append(strong, span)- // PREVIEW ON HOVER AND ON FOCUS — a keyboard reader gets it too- const show = () => h.preview(r)+ // PREVIEW ON HOVER AND ON FOCUS — a keyboard reader gets it too. What is+ // previewed is the NAME tried at the space, so a page with a design of its+ // own keeps it, exactly as it would if this were chosen.+ const show = () => h.preview({ name })const hide = () => h.preview(undefined)b.addEventListener('mouseenter', show)b.addEventListener('focus', show)@@ -282,29 +286,142 @@ export function designSection(h: DesignHooks): HTMLElement[] {const note = document.createElement('p')note.className = 'sp-note'note.textContent = t('The design travels with the file. Each reader’s light or dark setting picks between its two palettes.')- return [grid, acts, note]+ // this is the SPACE's design; a page or a section can override it+ const per = document.createElement('p')+ per.className = 'sp-note'+ per.textContent = t('A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.')+ return [grid, acts, note, per]+}++export interface PageDesignHooks {+ store: Store+ pageId: string+ /** paint a design without writing it; undefined ends the preview */+ preview: (pv: DesignPreview | undefined) => void+ /** open the customise panel on THIS page's own design */+ openPanel: (pageId: string) => void}/**- * Make the current design one this document owns, as ONE undo step.+ * One page's design choices, as the rows of a kernel menu: the page ⋯ menu and+ * the properties panel both open these (editor.openPageDesign, through+ * menuAt). The menu closes itself on a row, Escape or a press outside; the+ * caller ends the preview in the menu's `onClose`, which fires on all of them.*- * A doc-local design is edited in place; anything else — a built-in, or the- * default — is FORKED: a new entry naming it as its base, with no overrides- * yet, so the page does not change until a value does.+ * THE FIRST ROW IS INHERIT, and it says what inheriting resolves to — "Same as+ * parent · Ledger" — because an absent key is otherwise invisible and the+ * question a reader is really asking is "what will this page look like".+ * Choosing it DELETES the key (setPageDesign). Every other row names a design;+ * each previews on hover and focus, and a click is ONE undo step.+ *+ * There is no "Default" row for a page: the format's value is a NAME, and the+ * default look has none. A page shows the default when nothing above it names+ * a design — or when it names one this build does not know.*/-function forkIfNeeded(store: Store): string {- const cur = resolveDesign(store.doc)- if (cur?.custom) return cur.name- const name = freshDesignName(store.doc)- const base = cur && isBuiltIn(cur.name) ? cur.name : undefined- const data: DesignData = {- label: base ? t('{name}, customised', { name: designLabel(store.doc, base) }) : t('Custom'),- ...(base ? { base } : {}),+export function fillPageDesignMenu(m: Menu, h: PageDesignHooks): void {+ const { store, pageId } = h+ const doc = store.doc+ const page = store.index.page.get(pageId)+ if (!page) return+ const own = page.design+ const topLevel = !page.parent || !store.index.page.has(page.parent)+ const inherited = resolvePageDesign(doc, pageId, undefined, true)+ const locals = Object.keys(localDesigns(doc)).filter((n) => !isBuiltIn(n) && resolveDesign(doc, n))+ const names: Array<string | null> = [null, ...BUILT_IN_NAMES, ...locals]+ // a name this build does not know is still the page's choice: show it, so+ // the reader can see why the page looks plain, and can move off it+ if (typeof own === 'string' && own && !names.includes(own)) names.push(own)+ m.menu.classList.add('sp-dsg-menu')+ caption(m, t('Design'))+ let showing: HTMLElement | null = null+ for (const name of names) {+ const r = name === null ? inherited : resolveDesign(doc, name)+ const on = name === null ? own === undefined : own === name+ // Two LITERAL calls for inherit, so the extractor sees both keys+ const label = name === null ? (topLevel ? t('Same as space') : t('Same as parent'))+ : r ? designLabel(doc, name) : name+ const hint = name === null ? designLabel(doc, inherited?.name ?? null)+ : r ? designHint(r.custom ? 'custom' : name)+ : t('Not a design this build knows — shown in the default look')+ const b = row(m, {+ icon: '', label, hint, selected: on, off: store.readOnly,+ run: () => {+ h.preview(undefined)+ const p = store.index.page.get(pageId)+ // read LIVE: an undo while the menu is open changes the answer+ if (!p || store.readOnly || (p.design ?? null) === name) return+ // ONE undo step; inherit DELETES the key+ store.commit(() => {+ const q = store.index.page.get(pageId)+ if (q) setPageDesign(q, name)+ }, { structure: false })+ },+ })+ b.classList.add('sp-dsg-item')+ b.dataset.design = name ?? ''+ b.setAttribute('role', 'menuitemradio')+ b.setAttribute('aria-checked', String(on))+ // the swatch sits where a row's icon does+ const ico = b.querySelector('.bkm-ico') ?? b.insertBefore(document.createElement('span'), b.firstChild)+ ico.className = 'bkm-ico'+ ico.replaceChildren(swatch(r?.design ?? PLAIN))+ // PREVIEW ON A REAL MOVE, not on mouseenter: the menu opens where the page+ // menu was, so a row lands under a pointer that has not moved, and the+ // browser reports that as an enter — measured, the page flipped to Riso+ // the instant the menu opened. A move is a person pointing at a row.+ const show = () => { if (showing !== b) { showing = b; h.preview({ page: pageId, name }) } }+ b.addEventListener('mousemove', show)+ b.addEventListener('focus', show)+ b.addEventListener('mouseleave', () => { showing = null; h.preview(undefined) })+ }+ m.separator()+ const custom = row(m, {+ icon: ICONS.pen, label: t('Customise…'), hint: t('A design of this page’s own, kept in this space'), off: store.readOnly,+ run: () => {+ h.preview(undefined)+ if (store.readOnly) return+ forkIfNeeded(store, pageId)+ h.openPanel(pageId)+ },+ })+ custom.classList.add('sp-dsg-item')+ custom.addEventListener('mousemove', () => { if (showing) { showing = null; h.preview(undefined) } })+}++/**+ * Make the design at one scope — the space, or ONE page — a design this+ * document owns, as ONE undo step, and return its name.+ *+ * A doc-local design that scope names ITSELF is edited in place. Anything+ * else is FORKED into `doc.designs` and assigned to that scope: a built-in or+ * the default becomes a new entry naming it as its base with no overrides+ * yet, and a doc-local design the page only INHERITS is copied — customising+ * one page must never restyle the section or space it inherits from.+ */+function forkIfNeeded(store: Store, pageId?: string): string {+ const doc = store.doc+ const page = pageId !== undefined ? store.index.page.get(pageId) : undefined+ const ownName = page ? page.design : (doc as { design?: unknown }).design+ const own = typeof ownName === 'string' ? resolveDesign(doc, ownName) : null+ if (own?.custom) return own.name+ const cur = page ? resolvePageDesign(doc, page.id) : resolveDesign(doc)+ const name = freshDesignName(doc)+ let data: DesignData+ if (cur?.custom) {+ data = { ...clone(localDesigns(doc)[cur.name] as DesignData), label: t('{name}, customised', { name: designLabel(doc, cur.name) }) }+ } else {+ const base = cur && isBuiltIn(cur.name) ? cur.name : undefined+ data = {+ label: base ? t('{name}, customised', { name: designLabel(doc, base) }) : t('Custom'),+ ...(base ? { base } : {}),+ }}store.commit(() => {const d = store.doc as { designs?: Record<string, unknown> }d.designs = { ...(d.designs && typeof d.designs === 'object' ? d.designs : {}), [name]: data }- setDesign(store.doc, name)+ const p = pageId !== undefined ? store.index.page.get(pageId) : undefined+ if (p) setPageDesign(p, name)+ else setDesign(store.doc, name)}, { structure: false })return name}@@ -318,7 +435,7 @@ let openPanelEl: HTMLElement | null = null* The customise panel: non-modal, over the inspector's side of the window,* so the page it is changing stays in view.*/-export function openDesignPanel(store: Store, preview: (r: Resolved | null | undefined) => void): void {+export function openDesignPanel(store: Store, preview: (pv: DesignPreview | undefined) => void, pageId?: string): void {openPanelEl?.remove()const panel = document.createElement('aside')panel.className = 'sp-dsg-panel'@@ -327,7 +444,13 @@ export function openDesignPanel(store: Store, preview: (r: Resolved | null | unddocument.body.append(panel)openPanelEl = panel- const name = () => resolveDesign(store.doc)?.custom ? resolveDesign(store.doc)!.name : null+ // THE DESIGN THIS SCOPE NAMES ITSELF — the space's, or one page's — when it+ // is one this document carries. Read live: an undo can take it away.+ const name = (): string | null => {+ const raw = pageId !== undefined ? store.index.page.get(pageId)?.design : (store.doc as { design?: unknown }).design+ const r = typeof raw === 'string' ? resolveDesign(store.doc, raw) : null+ return r?.custom ? r.name : null+ }let draft: DesignData = {}const stored = () => {const n = name()@@ -349,7 +472,9 @@ export function openDesignPanel(store: Store, preview: (r: Resolved | null | und/** Live: paint the draft without writing it. */const live = () => {const n = name()- if (n) preview({ name: n, design: resolveData(store.doc, n, draft), custom: true })+ // the DRAFT stands in wherever this name resolves — this page, and every+ // page that shares the design+ if (n) preview({ draft: { name: n, design: resolveData(store.doc, n, draft), custom: true } })}/** Commit the draft as ONE undo step, keeping only what differs from the base. */const commit = () => {@@ -397,7 +522,7 @@ export function openDesignPanel(store: Store, preview: (r: Resolved | null | undif (!n) {const p = document.createElement('p')p.className = 'sp-note'- p.textContent = t('This space no longer uses a design of its own.')+ p.textContent = pageId !== undefined ? t('This page no longer uses a design of its own.') : t('This space no longer uses a design of its own.')panel.append(p)return}@@ -521,8 +646,12 @@ export function openDesignPanel(store: Store, preview: (r: Resolved | null | unddelete d.designs[n]if (!Object.keys(d.designs).length) delete d.designs}- // back to what it was forked from — or the default, which deletes `design`- setDesign(store.doc, base)+ // EVERY reference goes back to what it was forked from — the space's+ // and each page's — or, with no base, loses the key: the space to the+ // default look, a page to inheriting. A reference left pointing at a+ // deleted entry would render the default and read as a fault.+ if ((store.doc as { design?: unknown }).design === n) setDesign(store.doc, base)+ for (const p of store.doc.pages) if (p.design === n) setPageDesign(p, base)}, { structure: false })close()})diff --git a/spaces/src/designs.ts b/spaces/src/designs.tsindex c3942aee..56d1681c 100644--- a/spaces/src/designs.ts+++ b/spaces/src/designs.ts@@ -403,6 +403,8 @@ export interface DesignProblem {code: stringpath: stringmessage: string+ /** the page whose `design` this is about; absent = the space */+ page?: string}const isObj = (v: unknown): v is Record<string, unknown> =>@@ -637,9 +639,121 @@ export function resolveDesign(doc: SpacesDoc, name: unknown = (doc as { design?:return { name, design: resolveData(doc, name, local[name]), custom: true }}+// ---- per page ----------------------------------------------------------------+//+// A PAGE MAY NAME ITS OWN DESIGN (DECISIONS 2026-09-26, per-page addendum).+// `page.design` is the same kind of value as `doc.design` — a built-in name or+// a key of `doc.designs` — and it is ADDITIVE: absent means inherit, and an+// older build that has never heard of it renders the space's design and+// round-trips the key untouched.+//+// PRECEDENCE, nearest first: the page's own key, then the nearest ancestor+// that has one, then `doc.design`, then today's look. THE NEAREST KEY DECIDES,+// even when it names nothing this build knows: an unknown name renders the+// default look (exactly as an unknown `doc.design` does) rather than silently+// falling through to a design further up, which would make a typo look like a+// deliberate choice of the parent's.++/**+ * A look at a design that is not written down: the picker's hover, and the+ * customise panel's unsaved draft. NEVER document data.+ *+ * `page` + `name` tries a name at one page (null = the key removed, i.e.+ * inherit); `name` alone tries it at the space. `draft` stands in for a+ * doc-local design wherever that name resolves.+ */+export interface DesignPreview {+ page?: string+ name?: string | null+ draft?: Resolved+}++/** Where a page's design comes from, before it is resolved. */+export interface DesignSource {+ /** the raw value that decides (undefined = nobody set one) */+ name: unknown+ from: 'page' | 'ancestor' | 'space' | 'none'+ /** the page whose key decided, for 'page' and 'ancestor' */+ pageId?: string+}++type PageRec = { id: string; parent?: unknown; design?: unknown }++/**+ * Where `pageId`'s design comes from. `skipSelf` answers "what would this page+ * inherit" — the picker's "Same as parent" row.+ *+ * Cycle-guarded, and a parent that does not resolve ends the walk at the+ * space, the same way the tree shows such a page at the root.+ */+export function designSource(doc: SpacesDoc, pageId: string | null | undefined, opts: { skipSelf?: boolean; preview?: DesignPreview } = {}): DesignSource {+ const pv = opts.preview+ const pages = (doc.pages ?? []) as PageRec[]+ const byId = new Map(pages.map((p) => [p.id, p]))+ const seen = new Set<string>()+ let p = pageId ? byId.get(pageId) : undefined+ let first = true+ while (p && !seen.has(p.id)) {+ seen.add(p.id)+ if (!(first && opts.skipSelf)) {+ const v = pv && pv.page === p.id && pv.name !== undefined ? (pv.name ?? undefined) : p.design+ if (v !== undefined) return { name: v, from: first ? 'page' : 'ancestor', pageId: p.id }+ }+ first = false+ p = typeof p.parent === 'string' ? byId.get(p.parent) : undefined+ }+ const d = pv && pv.page === undefined && pv.name !== undefined ? (pv.name ?? undefined) : (doc as { design?: unknown }).design+ return d !== undefined ? { name: d, from: 'space' } : { name: undefined, from: 'none' }+}++/**+ * The design a page renders in, or null for the default look.+ *+ * THIS IS THE ONE PLACE A PAGE'S LOOK IS DECIDED. The editor's surface, the+ * page root renderPage builds, print and the static preview all ask it, so+ * none of them can disagree about which design a page wears.+ */+export function resolvePageDesign(doc: SpacesDoc, pageId: string | null | undefined, preview?: DesignPreview, skipSelf = false): Resolved | null {+ const src = designSource(doc, pageId, { skipSelf, preview })+ // null, never undefined: resolveDesign's default parameter reads doc.design+ const r = resolveDesign(doc, src.name === undefined ? null : src.name)+ if (r && preview?.draft && preview.draft.name === r.name) return preview.draft+ return r+}++/**+ * Set or clear ONE PAGE's design. Returning to inherit DELETES the key, so a+ * page that tried a design and went back is byte-identical to one that never+ * did — the same rule `setDesign` keeps for the space.+ */+export function setPageDesign(page: { design?: unknown }, name: string | null): void {+ if (name) page.design = name+ else delete page.design+}++/** Every design name the space or any page names explicitly. */+export function namedDesigns(doc: SpacesDoc): string[] {+ const out = new Set<string>()+ const d = (doc as { design?: unknown }).design+ if (typeof d === 'string' && d) out.add(d)+ for (const p of (doc.pages ?? []) as PageRec[]) if (typeof p.design === 'string' && p.design) out.add(p.design)+ return [...out]+}+/** Everything validate() should say about `design` and `designs`. */export function designProblems(doc: SpacesDoc): DesignProblem[] {const out: DesignProblem[] = []+ // A PAGE's design is named the same way the space's is, on that page+ for (const p of (doc.pages ?? []) as PageRec[]) {+ if (p.design === undefined) continue+ if (typeof p.design !== 'string' || !p.design) {+ out.push({ code: 'bad-design', path: 'design', page: p.id,+ message: `design = ${JSON.stringify(p.design)} is not a design name, so this page shows the default look. The value is kept.` })+ } else if (!resolveDesign(doc, p.design)) {+ out.push({ code: 'unknown-design', path: 'design', page: p.id,+ message: `design "${p.design}" is neither a built-in (${BUILT_IN_NAMES.join(', ')}) nor defined in designs, so this page shows the default look (it does not fall through to its parent's). The value is kept.` })+ }+ }const raw = doc as { design?: unknown; designs?: unknown }if (raw.designs !== undefined && !isObj(raw.designs)) {out.push({ code: 'bad-design', path: 'designs', message: 'designs is not an object of named designs; it is kept in the file and ignored.' })@@ -716,22 +830,38 @@ export function setDesign(doc: SpacesDoc, name: string | null): void {// ---- Markdown front matter -----------------------------------------------------/**- * The front matter an export opens with, or [] when there is no design.+ * The front matter an export opens with, or [] when there is nothing to say.*- * THE SMALLEST CORRECT FRONT MATTER: `design:` names it, and when the design- * is one this document carries, `designs:` holds that one entry as a single- * line of JSON — which is YAML flow syntax, so any YAML reader accepts it and- * no YAML parser is needed to read it back. A space with no design exports- * with no front matter at all, exactly as before.+ * THE SMALLEST CORRECT FRONT MATTER: `design:` names it, and when a design is+ * one this document carries, `designs:` holds its entry as a single line of+ * JSON — which is YAML flow syntax, so any YAML reader accepts it and no YAML+ * parser is needed to read it back. A space with no design exports with no+ * front matter at all, exactly as before.+ *+ * TWO SCOPES. With no `pageId` this is the WHOLE-SPACE export's header:+ * `design:` is the space's, and `designs:` carries every doc-local design the+ * space or any page names, so the registry travels whole. With a `pageId` it+ * is ONE PAGE's note: `design:` only when that page sets one EXPLICITLY — an+ * inherited design is not written, because the note would then pin a look the+ * page never chose — and `designs:` only the entry that page names.*/-export function designFrontMatter(doc: SpacesDoc): string[] {- const name = (doc as { design?: unknown }).design- if (typeof name !== 'string' || !name) return []- const lines = ['---', `design: ${/^[A-Za-z0-9_-]+$/.test(name) ? name : JSON.stringify(name)}`]+export function designFrontMatter(doc: SpacesDoc, pageId?: string): string[] {const local = localDesigns(doc)- if (!isBuiltIn(name) && Object.hasOwn(local, name)) {- lines.push(`designs: ${JSON.stringify({ [name]: local[name] })}`)+ let name: unknown+ let carried: string[]+ if (pageId === undefined) {+ name = (doc as { design?: unknown }).design+ carried = namedDesigns(doc)+ } else {+ name = ((doc.pages ?? []) as PageRec[]).find((p) => p.id === pageId)?.design+ carried = typeof name === 'string' && name ? [name] : []}+ carried = carried.filter((n) => !isBuiltIn(n) && Object.hasOwn(local, n))+ const named = typeof name === 'string' && name ? name : ''+ if (!named && !carried.length) return []+ const lines = ['---']+ if (named) lines.push(`design: ${/^[A-Za-z0-9_-]+$/.test(named) ? named : JSON.stringify(named)}`)+ if (carried.length) lines.push(`designs: ${JSON.stringify(Object.fromEntries(carried.map((n) => [n, local[n]])))}`)lines.push('---', '')return lines}@@ -770,13 +900,17 @@ export function readDesignFrontMatter(yaml: string): FrontMatterDesign {}/**- * Adopt a design that arrived with imported notes. Mutates `doc`; call it- * inside the import's one commit.+ * Adopt what arrived with imported notes. Mutates `doc`; call it inside the+ * import's one commit.** CONSERVATIVE BY DESIGN: a doc-local entry is added only under a name this* space does not already use, and `design` is set only when the space has- * none and the name resolves — an import adds pages, it does not restyle a- * space somebody already designed. Returns the name adopted, if any.+ * none and the name resolves.+ *+ * PER PAGE NOW (2026-09-26 addendum): planImport sets a note's `design:` on+ * THAT note's page, so the editor passes no `design` here and an import never+ * restyles the rest of the space — it only brings the REGISTRY entries the+ * notes carried. Returns the space-level name adopted, if any.*/export function adoptDesign(doc: SpacesDoc, design: string | undefined, designs: Record<string, unknown> | undefined): string | null {const d = doc as { design?: unknown; designs?: Record<string, unknown> }diff --git a/spaces/src/doccmds.ts b/spaces/src/doccmds.tsindex 197b1a0d..2a3b64e3 100644--- a/spaces/src/doccmds.ts+++ b/spaces/src/doccmds.ts@@ -81,7 +81,7 @@ export function saveRows(m: Menu, h: DocHost): void {/** The labels, in order — what the chrome rig holds the menu to. */export const SAVE_ORDER = [- 'Save a copy…', 'Duplicate as new space…', 'Export as Markdown…', 'Export page as a space…',+ 'Save a copy…', 'Duplicate as new space…', 'Export as Markdown…', 'Export page as a space…', 'Export page as Markdown…','Encrypt with password…', 'Version history…', 'Copy document JSON', 'Replace from JSON…', 'Import Markdown…',]diff --git a/spaces/src/editor.ts b/spaces/src/editor.tsindex eb2600d5..4bb62f4b 100644--- a/spaces/src/editor.ts+++ b/spaces/src/editor.ts@@ -44,9 +44,9 @@ import { headingsOf } from './embed.ts'import { countOutsideTags, replaceOutsideTags } from './findreplace'import { asksForAnswer, evaluate, format, pageContext } from './calc'import { t, locale, localeChoices, setLocale, applyDirection } from './i18n'-import { openAbout } from './about'-import { applyDesign, adoptDesign, type Resolved } from './designs.ts'-import { openDesignPanel } from './designpanel'+import { openAbout, downloadMarkdown } from './about'+import { applyDesign, adoptDesign, resolveDesign, resolvePageDesign, type Resolved, type DesignPreview } from './designs.ts'+import { openDesignPanel, fillPageDesignMenu, designLabel } from './designpanel'import { saveRows, type DocHost } from './doccmds.ts'import { openGraphView } from './graph.ts'import { pageToDeck, type DeckNote, type DeckNoteCode } from './todeck.ts'@@ -301,6 +301,7 @@ export class Editor {pickMedia: (id) => void this.pickMedia(id),openIconPicker: (pageId, anchor) => this.openIconPicker(pageId, anchor),openAddProperty: (pageId, anchor) => this.openAddProperty(pageId, anchor),+ openPageDesign: (pageId, anchor) => this.openPageDesign(pageId, anchor),pageIcon: (icon) => pageIcon(icon),openLinkCard: (id) => this.openLinkCard(id),addTableRow: (id, at) => this.addTableRow(id, at),@@ -1173,27 +1174,60 @@ export class Editor {* The design the picker is showing on hover, or undefined for none.* A preview is never document data: it is painted, never committed.*/- private designPreview: Resolved | null | undefined = undefined+ private designPreview: DesignPreview | undefined = undefined+ /** the page root renderPage built for the page in view */+ private pageRoot: HTMLElement | null = null/**- * Put the document's design (or the one being previewed) on the reading- * surface. The surface is `.sp-main` and nothing else — the bar, both panels- * and every popover stay the reader's (DECISIONS, 2026-09-26).+ * Put THE PAGE IN VIEW's design (or the one being previewed) on the reading+ * surface. The surface is `.sp-main` and the page root inside it, and+ * nothing else — the bar, both panels and every popover stay the reader's+ * (DECISIONS, 2026-09-26). Both get the SAME resolved design, so the two+ * nested roots can never disagree (designs.css matches by ancestor).*/- syncDesign(): void {- applyDesign(this.main, this.store.doc, this.designPreview)+ syncDesign(): Resolved | null {+ const s = this.store+ const r = resolvePageDesign(s.doc, s.page?.id, this.designPreview)+ applyDesign(this.main, s.doc, r)+ if (this.pageRoot?.isConnected) applyDesign(this.pageRoot, s.doc, r)+ return r}/** Show a design on the page without writing it; `undefined` ends the preview. */- previewDesign(r: Resolved | null | undefined): void {- this.designPreview = r+ previewDesign(pv: DesignPreview | undefined): void {+ this.designPreview = pvthis.syncDesign()}+ /**+ * One page's design choices, as a menu — from the page ⋯ menu and from the+ * properties panel's Design row (designpanel.ts fillPageDesignMenu). A+ * kernel menu through menuAt, so Escape, a press outside and the arrow keys+ * are the primitive's.+ *+ * THE PREVIEW ENDS WITH THE MENU, however the menu goes: a row, Escape, a+ * press outside, another menu opening. `onClose` is the one callback that+ * hears all of them (menus.ts anchoredMenu) — a hover preview that outlives+ * its menu is a design on screen that is not in the file.+ */+ openPageDesign(pageId: string, anchor: HTMLElement): void {+ const s = this.store+ if (!s.index.page.get(pageId)) return+ const end = () => this.previewDesign(undefined)+ const m = this.menuAt(anchor, t('Design'), (mm) => fillPageDesignMenu(mm, {+ store: s,+ pageId,+ preview: (pv) => this.previewDesign(pv),+ openPanel: (id) => openDesignPanel(s, (pv) => this.previewDesign(pv), id),+ }), { onClose: end })+ // leaving the whole menu ends any preview, whichever row the pointer left from+ m.menu.addEventListener('mouseleave', end)+ }+private paintPage(): void {const s = this.storeconst page = s.page- this.syncDesign()+ const design = this.syncDesign()// the baseline `syncFootnotes` compares against — set here so switching// pages can never leave the previous page's signature behindthis.fnSig = page ? notesOnPage(s.doc, page).order.join('\u001F') : ''@@ -1216,7 +1250,10 @@ export class Editor {titleOf: (id) => s.index.page.get(id)?.title,allowRemote: (src) => this.allowedRemote.has(src),readerWidth: readerWidth(),+ // the same resolution the surface just took, preview included+ design,})+ this.pageRoot = view// the icon lives beside the title, where changing it is discoverableconst inner = view.querySelector('.sp-page-inner')if (inner && !s.readOnly && !this.reading) {@@ -4968,6 +5005,19 @@ export class Editor {run: () => applyAll(pref ? undefined : (current === 'full' ? 'full' : 'wide')),})+ // THIS PAGE'S DESIGN — the author's choice, per page, beside the width+ // (the other thing about how a page is set). The hint says what the page+ // wears NOW, inherited or its own, so the row answers before it opens.+ // Its choices open as their own menu, anchored where this one was.+ {+ const r = resolvePageDesign(s.doc, pageId)+ const wears = designLabel(s.doc, r?.name ?? null)+ const item = row(m, { icon: ICONS.palette, label: t('Design'),+ hint: page.design !== undefined ? wears : t('Inherited · {name}', { name: wears }),+ run: () => this.openPageDesign(pageId, anchor) })+ item.setAttribute('aria-haspopup', 'menu')+ }+m.separator()row(m, { icon: ICONS.trash, label: t('Delete…'), hint: t('Links to it become dead'),run: () => this.deletePage(pageId) })@@ -5774,8 +5824,11 @@ export class Editor {for (const page of plan.pages) if (!page.parent || !arrived.has(page.parent)) page.parent = under}- // ONE commit, so ⌘Z takes the pages, their footnotes AND any design they brought- let adopted: string | null = null+ // ONE commit, so ⌘Z takes the pages, their footnotes AND any design they+ // brought. A note's `design:` is already on ITS page (planImport); the+ // space's own design is never touched by an import — only the registry+ // entries the notes carried join it (designs.ts adoptDesign, called with no+ // space-level name).s.commit(() => {s.doc.pages.push(...plan.pages)// `plan.footnotes` STARTED from this document's own table and had the@@ -5784,8 +5837,9 @@ export class Editor {// when nothing has footnotes, so importing plain notes does not add an// empty key to the file.if (Object.keys(plan.footnotes).length) s.doc.footnotes = plan.footnotes- adopted = adoptDesign(s.doc, plan.design, plan.designs)+ adoptDesign(s.doc, undefined, plan.designs)})+ const designed = plan.pages.filter((p) => p.design !== undefined).lengthif (plan.pages[0]) s.goToPage(plan.pages[0].id)this.repaint()this.status(t('Imported'))@@ -5808,7 +5862,7 @@ export class Editor {lines.push(t('{n} note name(s) appear more than once, so links naming them all went to the first.',{ n: plan.stats.duplicateNames }))}- if (adopted) lines.push(t('The notes named a design, so this space now uses it.'))+ if (designed) lines.push(t('{n} page(s) arrived with a design of their own.', { n: designed }))if (plan.stats.frontmatter) {lines.push(t('{n} page(s) had frontmatter, kept verbatim in a folded block.', { n: plan.stats.frontmatter }))}@@ -6078,9 +6132,13 @@ export class Editor {const s = this.storeconst host = el('div', 'sp-printroot')host.style.direction = 'ltr'- // the document's design, in its LIGHT palette: the dark mapping is- // @media screen, so paper never matches it- applyDesign(host, s.doc)+ // EACH PAGE PRINTS IN ITS OWN DESIGN, in its LIGHT palette (the dark+ // mapping is @media screen, so paper never matches it). The ROOT carries+ // NONE: renderPage stamps every page root with its own resolved design,+ // and a design on the root would reach any page that has none of its own+ // (designs.css matches by ancestor). The contents list is the space's, so+ // it wears the space's design.+ applyDesign(host, s.doc, null)const pages = opts.whole? s.tree().map((n) => n.page).filter((p) => opts.archived || !p.archived)@@ -6098,6 +6156,7 @@ export class Editor {ul.append(li)}toc.append(ul)+ applyDesign(toc, s.doc, resolveDesign(s.doc))host.append(toc)}@@ -6190,8 +6249,8 @@ export class Editor {onUpdateInPlace: (rel) => this.onUpdateInPlace?.(rel) ?? Promise.resolve(null),// both self-update writes carry this space's CRDT state, as ⌘S doesonBeforeWrite: () => shareModule.stampSync(this.store, this.session),- previewDesign: (r) => this.previewDesign(r),- openDesignPanel: () => openDesignPanel(this.store, (r) => this.previewDesign(r)),+ previewDesign: (pv) => this.previewDesign(pv),+ openDesignPanel: () => openDesignPanel(this.store, (pv) => this.previewDesign(pv)),})}@@ -6211,6 +6270,11 @@ export class Editor {writeCopy: (out) => this.onExportSpace?.(out) ?? Promise.resolve(false),importMarkdown: () => this.openImport(),moreExports: (m) => {+ // THE PAGE IN VIEW as one note — the unit the importer reads back as+ // one page, so a page's own design (`design:`) round-trips with it+ const pageId = this.store.page?.id+ row(m, { icon: ICONS.markdown, label: t('Export page as Markdown…'), desc: t('This page as one .md note'),+ off: !pageId, run: () => { if (pageId) downloadMarkdown(this.store, pageId) } })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() })},diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.tsindex defc2774..e54de13a 100644--- a/spaces/src/i18n/de.ts+++ b/spaces/src/i18n/de.ts@@ -785,7 +785,6 @@ export const de: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "Die Bento-Kachel: Fächer in Marine, Schiefer, Koralle und Creme.","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "Die Gestaltung reist mit der Datei. Die Hell- oder Dunkel-Einstellung jeder lesenden Person wählt zwischen ihren zwei Paletten.","The look every space starts with.": "Das Aussehen, mit dem jeder Space beginnt.",- "The notes named a design, so this space now uses it.": "Die Notizen nannten eine Gestaltung, deshalb verwendet dieser Space sie jetzt.","This font is {size}, and it travels inside the file. Embed it anyway?": "Diese Schrift ist {size} groß und reist in der Datei mit. Trotzdem einbetten?","This space no longer uses a design of its own.": "Dieser Space verwendet keine eigene Gestaltung mehr.","Tile": "Kachel",@@ -916,4 +915,14 @@ export const de: Catalog = {"Issues on their dates": "Issues an ihren Terminen","Issues across time": "Issues über die Zeit","Issues by person": "Issues nach Person",+ "Inherited · {name}": "Geerbt · {name}",+ "Export page as Markdown…": "Seite als Markdown exportieren…",+ "This page as one .md note": "Diese Seite als eine .md-Notiz",+ "Same as space": "Wie der Space",+ "Same as parent": "Wie die übergeordnete Seite",+ "Not a design this build knows — shown in the default look": "Eine Gestaltung, die diese Version nicht kennt — im Standard-Aussehen angezeigt",+ "A design of this page’s own, kept in this space": "Eine eigene Gestaltung für diese Seite, in diesem Space gespeichert",+ "This page no longer uses a design of its own.": "Diese Seite verwendet keine eigene Gestaltung mehr.",+ "{n} page(s) arrived with a design of their own.": "{n} Seite(n) kamen mit einer eigenen Gestaltung.",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "Eine Seite kann eine eigene Gestaltung tragen, und die eines Abschnitts gilt für die Seiten darin: Wähle sie im ⋯-Menü der Seite.",}diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.tsindex c38da350..214cf596 100644--- a/spaces/src/i18n/es.ts+++ b/spaces/src/i18n/es.ts@@ -785,7 +785,6 @@ export const es: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "El mosaico Bento: compartimentos azul marino, pizarra, coral y crema.","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "El diseño viaja con el archivo. El ajuste claro u oscuro de cada lector elige entre sus dos paletas.","The look every space starts with.": "El aspecto con el que empieza todo espacio.",- "The notes named a design, so this space now uses it.": "Las notas indicaban un diseño, así que este espacio ahora lo usa.","This font is {size}, and it travels inside the file. Embed it anyway?": "Esta fuente ocupa {size} y viaja dentro del archivo. ¿Incrustarla de todos modos?","This space no longer uses a design of its own.": "Este espacio ya no usa un diseño propio.","Tile": "Mosaico",@@ -916,4 +915,14 @@ export const es: Catalog = {"Issues on their dates": "Incidencias en sus fechas","Issues across time": "Incidencias a lo largo del tiempo","Issues by person": "Incidencias por persona",+ "Inherited · {name}": "Heredado · {name}",+ "Export page as Markdown…": "Exportar página como Markdown…",+ "This page as one .md note": "Esta página, como una nota .md",+ "Same as space": "Igual que el espacio",+ "Same as parent": "Igual que la página superior",+ "Not a design this build knows — shown in the default look": "Un diseño que esta versión no conoce: se muestra con el aspecto predeterminado",+ "A design of this page’s own, kept in this space": "Un diseño propio de esta página, guardado en este espacio",+ "This page no longer uses a design of its own.": "Esta página ya no usa un diseño propio.",+ "{n} page(s) arrived with a design of their own.": "{n} página(s) llegaron con un diseño propio.",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "Una página puede tener un diseño propio, y el de una sección pasa a las páginas que contiene: elígelo en el menú ⋯ de la página.",}diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.tsindex 6401e6f9..efd78161 100644--- a/spaces/src/i18n/fr.ts+++ b/spaces/src/i18n/fr.ts@@ -785,7 +785,6 @@ export const fr: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "La tuile Bento : des compartiments marine, ardoise, corail et crème.","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "Le design voyage avec le fichier. Le réglage clair ou sombre de chaque lecteur choisit entre ses deux palettes.","The look every space starts with.": "L’apparence de départ de tout espace.",- "The notes named a design, so this space now uses it.": "Les notes nommaient un design : cet espace l’utilise désormais.","This font is {size}, and it travels inside the file. Embed it anyway?": "Cette police pèse {size} et voyage dans le fichier. L’intégrer quand même ?","This space no longer uses a design of its own.": "Cet espace n’utilise plus de design qui lui soit propre.","Tile": "Tuile",@@ -916,4 +915,14 @@ export const fr: Catalog = {"Issues on their dates": "Tickets à leurs dates","Issues across time": "Tickets dans le temps","Issues by person": "Tickets par personne",+ "Inherited · {name}": "Hérité · {name}",+ "Export page as Markdown…": "Exporter la page en Markdown…",+ "This page as one .md note": "Cette page, en une note .md",+ "Same as space": "Comme l’espace",+ "Same as parent": "Comme la page parente",+ "Not a design this build knows — shown in the default look": "Un design que cette version ne connaît pas — affiché avec l’apparence par défaut",+ "A design of this page’s own, kept in this space": "Un design propre à cette page, conservé dans cet espace",+ "This page no longer uses a design of its own.": "Cette page n’utilise plus de design qui lui soit propre.",+ "{n} page(s) arrived with a design of their own.": "{n} page(s) sont arrivées avec un design qui leur est propre.",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "Une page peut avoir son propre design, et celui d’une section passe aux pages qu’elle contient : choisissez-le dans le menu ⋯ de la page.",}diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.tsindex e7065c54..f458313e 100644--- a/spaces/src/i18n/it.ts+++ b/spaces/src/i18n/it.ts@@ -785,7 +785,6 @@ export const it: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "La tessera Bento: scomparti blu notte, ardesia, corallo e crema.","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "Il design viaggia con il file. L’impostazione chiara o scura di ogni lettore sceglie tra le sue due tavolozze.","The look every space starts with.": "L’aspetto con cui parte ogni spazio.",- "The notes named a design, so this space now uses it.": "Le note indicavano un design, quindi ora questo spazio lo usa.","This font is {size}, and it travels inside the file. Embed it anyway?": "Questo font pesa {size} e viaggia dentro il file. Incorporarlo comunque?","This space no longer uses a design of its own.": "Questo spazio non usa più un design proprio.","Tile": "Tessera",@@ -916,4 +915,14 @@ export const it: Catalog = {"Issues on their dates": "Issue alle loro date","Issues across time": "Issue nel tempo","Issues by person": "Issue per persona",+ "Inherited · {name}": "Ereditato · {name}",+ "Export page as Markdown…": "Esporta la pagina come Markdown…",+ "This page as one .md note": "Questa pagina, come una nota .md",+ "Same as space": "Come lo spazio",+ "Same as parent": "Come la pagina superiore",+ "Not a design this build knows — shown in the default look": "Un design che questa versione non conosce — mostrato con l’aspetto predefinito",+ "A design of this page’s own, kept in this space": "Un design proprio di questa pagina, conservato in questo spazio",+ "This page no longer uses a design of its own.": "Questa pagina non usa più un design proprio.",+ "{n} page(s) arrived with a design of their own.": "{n} pagina/e sono arrivate con un design proprio.",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "Una pagina può avere un design proprio, e quello di una sezione passa alle pagine che contiene: sceglilo dal menu ⋯ della pagina.",}diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.tsindex 956941cb..7fc57f2d 100644--- a/spaces/src/i18n/ja.ts+++ b/spaces/src/i18n/ja.ts@@ -785,7 +785,6 @@ export const ja: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "Bento のタイル:紺、スレート、コーラル、クリームの仕切り。","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "デザインはファイルと一緒に届きます。読む人のライト/ダーク設定が、2つのパレットのどちらを使うかを選びます。","The look every space starts with.": "すべてのスペースの最初の見た目。",- "The notes named a design, so this space now uses it.": "ノートがデザインを指定していたため、このスペースはそのデザインを使います。","This font is {size}, and it travels inside the file. Embed it anyway?": "このフォントは {size} あり、ファイルの中に入って届きます。それでも埋め込みますか?","This space no longer uses a design of its own.": "このスペースは独自のデザインを使わなくなりました。","Tile": "タイル",@@ -916,4 +915,14 @@ export const ja: Catalog = {"Issues on their dates": "日付ごとのイシュー","Issues across time": "時間軸上のイシュー","Issues by person": "担当者ごとのイシュー",+ "Inherited · {name}": "継承 · {name}",+ "Export page as Markdown…": "ページを Markdown で書き出す…",+ "This page as one .md note": "このページを 1 つの .md ノートに",+ "Same as space": "スペースと同じ",+ "Same as parent": "親ページと同じ",+ "Not a design this build knows — shown in the default look": "このバージョンが知らないデザイン — デフォルトの見た目で表示",+ "A design of this page’s own, kept in this space": "このページ独自のデザイン(このスペースに保存)",+ "This page no longer uses a design of its own.": "このページは独自のデザインを使わなくなりました。",+ "{n} page(s) arrived with a design of their own.": "{n} 件のページが独自のデザイン付きで取り込まれました。",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "ページは独自のデザインを持てます。セクションのデザインはその中のページに引き継がれます。ページの ⋯ メニューから選んでください。",}diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.tsindex c20c61c7..81d36d10 100644--- a/spaces/src/i18n/packed.ts+++ b/spaces/src/i18n/packed.ts@@ -24,6 +24,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"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 design of this page’s own, kept in this space": ["このページ独自のデザイン(このスペースに保存)","此页面自己的设计,保存在此空间中","此頁面自己的設計,保存在此空間中","Un diseño propio de esta página, guardado en este espacio","Un design propre à cette page, conservé dans cet espace","Eine eigene Gestaltung für diese Seite, in diesem Space gespeichert","Un design proprio di questa pagina, conservato in questo spazio","Um design próprio desta página, guardado neste espaço"],"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."],@@ -35,6 +36,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"A new block": ["新しいブロック","新建一个块","新增一個區塊","Un bloque nuevo","Un nouveau bloc","Ein neuer Block","Un nuovo blocco","Um bloco novo"],"A news serif under double rules, justified, with pull quotes.": ["二重罫線の下にニュース用セリフ体、両端揃え、プルクオート付き。","双线下的新闻衬线体,两端对齐,带引文摘录。","雙線下的新聞襯線體,左右對齊,附引文摘錄。","Una serifa de periódico bajo filetes dobles, justificada y con citas destacadas.","Un caractère de journal sous des filets doubles, justifié, avec des citations en exergue.","Eine Zeitungs-Serifenschrift unter Doppellinien, im Blocksatz, mit herausgestellten Zitaten.","Un graziato da quotidiano sotto filetti doppi, giustificato, con citazioni in evidenza.","Uma serifa de jornal sob fios duplos, justificada, com citações em destaque."],"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 can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": ["ページは独自のデザインを持てます。セクションのデザインはその中のページに引き継がれます。ページの ⋯ メニューから選んでください。","页面可以使用自己的设计,分区的设计会传给其中的页面:在页面的 ⋯ 菜单中选择。","頁面可以使用自己的設計,分區的設計會傳給其中的頁面:在頁面的 ⋯ 選單中選擇。","Una página puede tener un diseño propio, y el de una sección pasa a las páginas que contiene: elígelo en el menú ⋯ de la página.","Une page peut avoir son propre design, et celui d’une section passe aux pages qu’elle contient : choisissez-le dans le menu ⋯ de la page.","Eine Seite kann eine eigene Gestaltung tragen, und die eines Abschnitts gilt für die Seiten darin: Wähle sie im ⋯-Menü der Seite.","Una pagina può avere un design proprio, e quello di una sezione passa alle pagine che contiene: sceglilo dal menu ⋯ della pagina.","Uma página pode ter um design próprio, e o de uma secção passa às páginas dentro dela: escolha-o no menu ⋯ da página."],"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."],@@ -262,6 +264,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"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 Markdown…": ["ページを Markdown で書き出す…","将页面导出为 Markdown…","將頁面匯出為 Markdown…","Exportar página como Markdown…","Exporter la page en Markdown…","Seite als Markdown exportieren…","Esporta la pagina come Markdown…","Exportar página 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"],@@ -329,6 +332,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Indent": ["字下げ","缩进","縮排","Sangrar","Indenter","Einrücken","Rientra","Avançar"],"Indent, or move back out": ["字下げ、または戻す","缩进,或退回一级","縮排,或退回一層","Sangrar, o volver a salir","Indenter, ou revenir en arrière","Einrücken, oder wieder heraus","Rientra, o torna indietro","Avançar, ou recuar de novo"],"Indented": ["字下げ","缩进","縮排","Sangrado","En retrait","Eingerückt","Rientrato","Recuado"],+ "Inherited · {name}": ["継承 · {name}","继承 · {name}","繼承 · {name}","Heredado · {name}","Hérité · {name}","Geerbt · {name}","Ereditato · {name}","Herdado · {name}"],"Inline code — ⌘E": ["インラインコード — ⌘E","行内代码 — ⌘E","行內程式碼 — ⌘E","Código en línea — ⌘E","Code en ligne — ⌘E","Inline-Code — ⌘E","Codice in linea — ⌘E","Código em linha — ⌘E"],"Interface language": ["表示言語","界面语言","介面語言","Idioma de la interfaz","Langue de l’interface","Sprache der Oberfläche","Lingua dell’interfaccia","Idioma da interface"],"Interface theme": ["表示テーマ","界面主题","介面主題","Tema de la interfaz","Thème de l’interface","Design der Oberfläche","Tema dell’interfaccia","Tema da interface"],@@ -425,6 +429,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"No templates yet. Open a page you would like to reuse and choose “Save as template”.": ["まだテンプレートはありません。再利用したいページを開いて「テンプレートとして保存」を選んでください。","还没有模板。打开一个想重复使用的页面,选择“保存为模板”。","還沒有範本。開啟一個想重複使用的頁面,選擇「儲存為範本」。","Todavía no hay plantillas. Abre una página que quieras reutilizar y elige «Guardar como plantilla».","Aucun modèle pour l’instant. Ouvrez une page que vous voulez réutiliser et choisissez « Enregistrer comme modèle ».","Noch keine Vorlagen. Öffne eine Seite, die du wiederverwenden möchtest, und wähle „Als Vorlage sichern“.","Ancora nessun modello. Apri una pagina che vuoi riutilizzare e scegli «Salva come modello».","Ainda não há modelos. Abre uma página que queiras reutilizar e escolhe «Guardar como modelo»."],"No versions yet — they build up as you write and save.": ["まだバージョンはありません。書いて保存するたびに増えていきます。","暂无版本。随着你的书写和保存,版本会逐渐累积。","尚無版本。隨著你的書寫與儲存,版本會逐漸累積。","Aún no hay versiones: se acumulan a medida que escribes y guardas.","Pas encore de versions — elles s’accumulent à mesure que vous écrivez et enregistrez.","Noch keine Versionen — sie sammeln sich beim Schreiben und Speichern an.","Ancora nessuna versione: si accumulano mentre scrivi e salvi.","Ainda sem versões — vão-se acumulando à medida que escreves e guardas."],"None": ["なし","无","無","Ninguno","Aucun","Keine","Nessuno","Nenhum"],+ "Not a design this build knows — shown in the default look": ["このバージョンが知らないデザイン — デフォルトの見た目で表示","当前版本不认识此设计 — 以默认外观显示","目前版本不認得此設計 — 以預設外觀顯示","Un diseño que esta versión no conoce: se muestra con el aspecto predeterminado","Un design que cette version ne connaît pas — affiché avec l’apparence par défaut","Eine Gestaltung, die diese Version nicht kennt — im Standard-Aussehen angezeigt","Un design che questa versione non conosce — mostrato con l’aspetto predefinito","Um design que esta versão não conhece — mostrado com o aspeto padrão"],"Not in this file: it needs the network, and the site is told when someone opens the page": ["このファイルの中にはありません。再生にはネットワークが必要で、誰かがこのページを開いたことがそのサイトに伝わります","不在此文件内:播放需要联网,而且该网站会知道有人打开了这个页面","不在這個檔案裡:播放需要網路,而且該網站會知道有人開啟了這個頁面","No está en este archivo: necesita la red, y ese sitio sabrá que alguien ha abierto esta página","N’est pas dans ce fichier : la lecture nécessite le réseau, et ce site saura que quelqu’un a ouvert cette page","Nicht in dieser Datei: das Abspielen braucht das Netz, und die Website erfährt, dass jemand diese Seite geöffnet hat","Non è dentro questo file: per riprodurla serve la rete, e quel sito saprà che qualcuno ha aperto questa pagina","Não está neste ficheiro: precisa da rede, e esse site fica a saber que alguém abriu esta página"],"Not live — turns on when you share": ["未接続 — 共有すると自動的にライブになります","未上线 — 分享时自动开启","未上線 — 分享時自動開啟","Sin conexión — se activa al compartir","Hors ligne — s’active quand vous partagez","Nicht live — startet beim Teilen","Non live — si attiva quando condividi","Fora do ar — ativa quando você compartilha"],"Not loaded — opening it would tell that site you opened this space.": ["未読み込み — 読み込むと、このスペースを開いたことがそのサイトに伝わります。","未加载 — 加载会让该网站知道你打开了这个空间。","未載入 — 載入會讓該網站知道你開啟了這個空間。","No cargada: al cargarla, ese sitio sabría que has abierto este espacio.","Non chargée : la charger indiquerait à ce site que vous avez ouvert cet espace.","Nicht geladen — beim Laden erfährt diese Website, dass du diesen Space geöffnet hast.","Non caricata: caricarla direbbe a quel sito che hai aperto questo spazio.","Não carregada — carregá-la diria a esse site que você abriu este espaço."],@@ -553,6 +558,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Rule weight": ["線の太さ","线条粗细","線條粗細","Grosor de los filetes","Épaisseur des filets","Linienstärke","Spessore dei filetti","Espessura dos fios"],"Rules": ["罫線","分隔线","分隔線","Filetes","Filets","Linien","Filetti","Fios"],"Rules above and below": ["上下に線","上下分隔线","上下分隔線","Filetes arriba y abajo","Filets dessus et dessous","Linien oben und unten","Filetti sopra e sotto","Fios em cima e em baixo"],+ "Same as parent": ["親ページと同じ","与上级页面相同","與上層頁面相同","Igual que la página superior","Comme la page parente","Wie die übergeordnete Seite","Come la pagina superiore","Igual à página superior"],+ "Same as space": ["スペースと同じ","与空间相同","與空間相同","Igual que el espacio","Comme l’espace","Wie der Space","Come lo spazio","Igual ao espaço"],"Same pages, new identity — it never syncs with this one": ["同じページ、新しい ID — このスペースとは同期しません","页面相同,身份全新 — 永不与此空间同步","頁面相同,身分全新 — 永不與此空間同步","Las mismas páginas, una identidad nueva — nunca se sincroniza con este","Les mêmes pages, une nouvelle identité — il ne se synchronise jamais avec celui-ci","Dieselben Seiten, neue Identität — synchronisiert nie mit diesem Space","Le stesse pagine, una nuova identità — non si sincronizza mai con questo","As mesmas páginas, uma nova identidade — nunca sincroniza com este"],"Save": ["保存","保存","儲存","Guardar","Enregistrer","Speichern","Salva","Guardar"],"Save (⌘S)": ["保存 (⌘S)","保存 (⌘S)","儲存 (⌘S)","Guardar (⌘S)","Enregistrer (⌘S)","Speichern (⌘S)","Salva (⌘S)","Guardar (⌘S)"],@@ -658,7 +665,6 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"The look every space starts with.": ["すべてのスペースの最初の見た目。","每个空间一开始的样子。","每個空間一開始的樣子。","El aspecto con el que empieza todo espacio.","L’apparence de départ de tout espace.","Das Aussehen, mit dem jeder Space beginnt.","L’aspetto con cui parte ogni spazio.","O aspeto com que todos os espaços começam."],"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 notes named a design, so this space now uses it.": ["ノートがデザインを指定していたため、このスペースはそのデザインを使います。","这些笔记指定了一个设计,所以此空间现在使用它。","這些筆記指定了一個設計,所以此空間現在使用它。","Las notas indicaban un diseño, así que este espacio ahora lo usa.","Les notes nommaient un design : cet espace l’utilise désormais.","Die Notizen nannten eine Gestaltung, deshalb verwendet dieser Space sie jetzt.","Le note indicavano un design, quindi ora questo spazio lo usa.","As notas indicavam um design, por isso este espaço passa a usá-lo."],"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."],@@ -692,6 +698,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"This list": ["この一覧","本列表","本清單","Esta lista","Cette liste","Diese Liste","Questo elenco","Esta lista"],"This live session has run out of room. Your change is saved in your copy, but collaborators won’t see it.": ["このライブセッションの容量がいっぱいです。変更は自分のコピーに保存されますが、共同編集者には表示されません。","此实时会话空间已满。你的更改已保存在你的副本中,但协作者不会看到。","此即時工作階段空間已滿。你的變更已儲存在你的副本中,但協作者不會看到。","Esta sesión en vivo se ha quedado sin espacio. Tu cambio se guarda en tu copia, pero los colaboradores no lo verán.","Cette session en direct n’a plus de place. Votre modification est enregistrée dans votre copie, mais les collaborateurs ne la verront pas.","Diese Live-Sitzung hat keinen Platz mehr. Deine Änderung ist in deiner Kopie gespeichert, aber Mitarbeitende sehen sie nicht.","Questa sessione dal vivo ha esaurito lo spazio. La tua modifica è salvata nella tua copia, ma i collaboratori non la vedranno.","Esta sessão ao vivo ficou sem espaço. Sua alteração fica salva na sua cópia, mas os colaboradores não a verão."],"This month": ["今月","本月","本月","Este mes","Ce mois-ci","Dieser Monat","Questo mese","Este mês"],+ "This page as one .md note": ["このページを 1 つの .md ノートに","此页面导出为一个 .md 笔记","此頁面匯出為一個 .md 筆記","Esta página, como una nota .md","Cette page, en une note .md","Diese Seite als eine .md-Notiz","Questa pagina, come una nota .md","Esta página, como uma nota .md"],+ "This page no longer uses a design of its own.": ["このページは独自のデザインを使わなくなりました。","此页面不再使用自己的设计。","此頁面不再使用自己的設計。","Esta página ya no usa un diseño propio.","Cette page n’utilise plus de design qui lui soit propre.","Diese Seite verwendet keine eigene Gestaltung mehr.","Questa pagina non usa più un design proprio.","Esta página já não usa um design próprio."],"This page only": ["このページだけ","仅此页面","僅此頁面","Solo esta página","Cette page seulement","Nur diese Seite","Solo questa pagina","Apenas esta página"],"This space has no live session to follow": ["この Space には追従できるライブセッションがありません","此 Space 没有可跟随的实时会话","此 Space 沒有可跟隨的即時會話","Este Space no tiene sesión en vivo que seguir","Cet espace n’a pas de session live à suivre","Dieser Space hat keine Live-Sitzung zum Folgen","Questo Space non ha una sessione live da seguire","Este Space não tem sessão ao vivo para acompanhar"],"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."],@@ -847,6 +855,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"{n} links to this page": ["このページへのリンク {n} 件","{n} 个链接指向此页","{n} 個連結指向此頁","{n} enlaces a esta página","{n} liens vers cette page","{n} Links auf diese Seite","{n} link a questa pagina","{n} ligações para esta página"],"{n} note name(s) appear more than once, so links naming them all went to the first.": ["{n} 件のノート名が重複しているため、その名前のリンクはすべて最初のノートに向いています。","有 {n} 个笔记名称重复,因此指向该名称的链接都指向了第一个。","有 {n} 個筆記名稱重複,因此指向該名稱的連結都指向了第一個。","{n} nombre(s) de nota se repiten, así que los enlaces con ese nombre fueron todos al primero.","{n} nom(s) de note apparaissent plusieurs fois : les liens portant ce nom pointent tous vers le premier.","{n} Notiznamen kommen mehrfach vor — Links mit diesem Namen führen alle zur ersten.","{n} nome/i di nota compaiono più volte, quindi i link con quel nome puntano tutti al primo.","{n} nome(s) de nota aparecem mais de uma vez, por isso as ligações com esse nome foram todas para a primeira."],"{n} of {total} wikilink(s) resolved.": ["{total} 個のウィキリンクのうち {n} 個を解決しました。","{total} 个 wiki 链接中解析了 {n} 个。","{total} 個 wiki 連結中解析了 {n} 個。","{n} de {total} wikilink(s) resueltos.","{n} wikilien(s) sur {total} résolus.","{n} von {total} Wikilink(s) aufgelöst.","{n} wikilink su {total} risolti.","{n} de {total} wikilink(s) resolvidos."],+ "{n} page(s) arrived with a design of their own.": ["{n} 件のページが独自のデザイン付きで取り込まれました。","{n} 个页面带着自己的设计导入。","{n} 個頁面帶著自己的設計匯入。","{n} página(s) llegaron con un diseño propio.","{n} page(s) sont arrivées avec un design qui leur est propre.","{n} Seite(n) kamen mit einer eigenen Gestaltung.","{n} pagina/e sono arrivate con un design proprio.","{n} página(s) chegaram com um design próprio."],"{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": ["{n} 件のページ","{n} 个页面","{n} 個頁面","{n} páginas","{n} pages","{n} Seiten","{n} pagine","{n} páginas"],diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.tsindex d55ac05a..dc849ad0 100644--- a/spaces/src/i18n/pt.ts+++ b/spaces/src/i18n/pt.ts@@ -785,7 +785,6 @@ export const pt: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "O mosaico Bento: compartimentos azul-marinho, ardósia, coral e creme.","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "O design viaja com o ficheiro. A definição clara ou escura de cada leitor escolhe entre as suas duas paletas.","The look every space starts with.": "O aspeto com que todos os espaços começam.",- "The notes named a design, so this space now uses it.": "As notas indicavam um design, por isso este espaço passa a usá-lo.","This font is {size}, and it travels inside the file. Embed it anyway?": "Este tipo de letra tem {size} e viaja dentro do ficheiro. Incorporá-lo mesmo assim?","This space no longer uses a design of its own.": "Este espaço já não usa um design próprio.","Tile": "Mosaico",@@ -916,4 +915,14 @@ export const pt: Catalog = {"Issues on their dates": "Tarefas nas suas datas","Issues across time": "Tarefas ao longo do tempo","Issues by person": "Tarefas por pessoa",+ "Inherited · {name}": "Herdado · {name}",+ "Export page as Markdown…": "Exportar página como Markdown…",+ "This page as one .md note": "Esta página, como uma nota .md",+ "Same as space": "Igual ao espaço",+ "Same as parent": "Igual à página superior",+ "Not a design this build knows — shown in the default look": "Um design que esta versão não conhece — mostrado com o aspeto padrão",+ "A design of this page’s own, kept in this space": "Um design próprio desta página, guardado neste espaço",+ "This page no longer uses a design of its own.": "Esta página já não usa um design próprio.",+ "{n} page(s) arrived with a design of their own.": "{n} página(s) chegaram com um design próprio.",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "Uma página pode ter um design próprio, e o de uma secção passa às páginas dentro dela: escolha-o no menu ⋯ da página.",}diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.tsindex 62672b1a..399b00c0 100644--- a/spaces/src/i18n/zh-Hans.ts+++ b/spaces/src/i18n/zh-Hans.ts@@ -785,7 +785,6 @@ export const zh_Hans: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "Bento 方块:藏青、石板蓝、珊瑚色与奶油色的隔格。","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "设计随文件一起传递。每位读者的浅色或深色设置会在它的两套配色中选择一套。","The look every space starts with.": "每个空间一开始的样子。",- "The notes named a design, so this space now uses it.": "这些笔记指定了一个设计,所以此空间现在使用它。","This font is {size}, and it travels inside the file. Embed it anyway?": "此字体大小为 {size},会随文件一起携带。仍要嵌入吗?","This space no longer uses a design of its own.": "此空间不再使用自己的设计。","Tile": "方块",@@ -916,4 +915,14 @@ export const zh_Hans: Catalog = {"Issues on their dates": "按日期排列的事项","Issues across time": "按时间铺开的事项","Issues by person": "按人员排列的事项",+ "Inherited · {name}": "继承 · {name}",+ "Export page as Markdown…": "将页面导出为 Markdown…",+ "This page as one .md note": "此页面导出为一个 .md 笔记",+ "Same as space": "与空间相同",+ "Same as parent": "与上级页面相同",+ "Not a design this build knows — shown in the default look": "当前版本不认识此设计 — 以默认外观显示",+ "A design of this page’s own, kept in this space": "此页面自己的设计,保存在此空间中",+ "This page no longer uses a design of its own.": "此页面不再使用自己的设计。",+ "{n} page(s) arrived with a design of their own.": "{n} 个页面带着自己的设计导入。",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "页面可以使用自己的设计,分区的设计会传给其中的页面:在页面的 ⋯ 菜单中选择。",}diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.tsindex aa1b5268..43623917 100644--- a/spaces/src/i18n/zh-Hant.ts+++ b/spaces/src/i18n/zh-Hant.ts@@ -785,7 +785,6 @@ export const zh_Hant: Catalog = {"The Bento tile: navy, slate, coral and cream compartments.": "Bento 方塊:藏青、石板藍、珊瑚色與奶油色的隔格。","The design travels with the file. Each reader’s light or dark setting picks between its two palettes.": "設計隨檔案一起傳遞。每位讀者的淺色或深色設定會在它的兩套配色中選擇一套。","The look every space starts with.": "每個空間一開始的樣子。",- "The notes named a design, so this space now uses it.": "這些筆記指定了一個設計,所以此空間現在使用它。","This font is {size}, and it travels inside the file. Embed it anyway?": "此字型大小為 {size},會隨檔案一起攜帶。仍要嵌入嗎?","This space no longer uses a design of its own.": "此空間不再使用自己的設計。","Tile": "方塊",@@ -916,4 +915,14 @@ export const zh_Hant: Catalog = {"Issues on their dates": "依日期排列的項目","Issues across time": "依時間展開的項目","Issues by person": "依人員排列的項目",+ "Inherited · {name}": "繼承 · {name}",+ "Export page as Markdown…": "將頁面匯出為 Markdown…",+ "This page as one .md note": "此頁面匯出為一個 .md 筆記",+ "Same as space": "與空間相同",+ "Same as parent": "與上層頁面相同",+ "Not a design this build knows — shown in the default look": "目前版本不認得此設計 — 以預設外觀顯示",+ "A design of this page’s own, kept in this space": "此頁面自己的設計,保存在此空間中",+ "This page no longer uses a design of its own.": "此頁面不再使用自己的設計。",+ "{n} page(s) arrived with a design of their own.": "{n} 個頁面帶著自己的設計匯入。",+ "A page can wear a design of its own, and a section’s passes to the pages inside it: choose it from the page’s ⋯ menu.": "頁面可以使用自己的設計,分區的設計會傳給其中的頁面:在頁面的 ⋯ 選單中選擇。",}diff --git a/spaces/src/icons.ts b/spaces/src/icons.tsindex d5130254..f5f9e61f 100644--- a/spaces/src/icons.ts+++ b/spaces/src/icons.ts@@ -78,6 +78,7 @@ export const ICONS = {folder: svg('<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>'),tag: svg('<path d="M20.59 13.41 12 22l-9-9V3h10l7.59 7.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/>'),scale: svg('<path d="M12 3v18"/><path d="M5 7h14"/><path d="M5 7 2 14h6z"/><path d="M19 7l-3 7h6z"/><path d="M8 21h8"/>'),+ palette: svg('<path d="M12 22a10 10 0 1 1 10-10c0 2.8-2.2 4-4.5 4H15a2 2 0 0 0-1.4 3.4A1.9 1.9 0 0 1 12 22z"/><circle cx="7.5" cy="10.5" r="1.3" fill="currentColor"/><circle cx="12" cy="7" r="1.3" fill="currentColor"/><circle cx="16.5" cy="10.5" r="1.3" fill="currentColor"/>'),pen: svg('<path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><line x1="2" y1="2" x2="9.5" y2="9.5"/>'),// slides' chart glyph (bars on an axis): the Chart insert. Not `graph`,// which is the Graph view's network of pages, beside it in the bar.diff --git a/spaces/src/markdown.ts b/spaces/src/markdown.tsindex ab6098c1..74263de6 100644--- a/spaces/src/markdown.ts+++ b/spaces/src/markdown.ts@@ -1054,7 +1054,9 @@ export interface ImportStats {export interface ImportPlan {pages: Page[]- /** the first design a note named in its front matter (path order) */+ /** the first design a note named in its front matter (path order). Each+ * note's own is ALSO on its page as `page.design`, which is what the+ * editor uses; this stays for callers that want one space-level name. */design?: string/** designs the notes carried, first writer wins per name */designs?: Record<string, unknown>@@ -1213,6 +1215,10 @@ export function planImport(}page.blocks.push(...note.blocks)if (note.design !== undefined && design === undefined) design = note.design+ // A NOTE'S `design:` IS ITS PAGE'S (per-page designs): set on this page+ // exactly as written, even a name this build does not know — it renders+ // the default look, round-trips, and validate() names it.+ if (note.design !== undefined) page.design = note.designfor (const [k, v] of Object.entries(note.designs ?? {})) if (!Object.hasOwn(designs, k)) designs[k] = vif (note.footnotes) {// PER FILE, while it is still known which blocks are this file's — afterdiff --git a/spaces/src/model.ts b/spaces/src/model.tsindex 08e54739..34e5588e 100644--- a/spaces/src/model.ts+++ b/spaces/src/model.ts@@ -357,6 +357,17 @@ export interface Page {* see `alias-collision` in agent.ts.*/aliases?: string[]+ /**+ * This page's own design (DECISIONS 2026-09-26, per-page addendum): a+ * built-in name or a key of `doc.designs`, exactly as `doc.design` is.+ *+ * ABSENT = INHERIT: the nearest ancestor's, then the space's, then today's+ * look — so setting one on a section restyles its whole subtree. Returning+ * to inherit DELETES the key. An unknown name renders the DEFAULT look (it+ * does not fall through to the parent's), round-trips untouched, and is+ * named by validate(). Older builds ignore it and show the space's design.+ */+ design?: string/** the one page daily entries hang from, so the sidebar stays a tree */journalHome?: boolean/** out of the sidebar, still searchable and linkable, and ENUMERATED at@@ -399,8 +410,8 @@ export interface SpacesDoc {* The page design the AUTHOR chose (DECISIONS 2026-09-26): a built-in name* (designs.ts BUILT_INS) or a key of `designs`. ABSENT = the default look,* and returning to the default DELETES the key. An unknown name renders the- * default and round-trips untouched. Document-wide today; a per-page- * `Page.design` would resolve through the same function and override it.+ * default and round-trips untouched. A page's own `Page.design` (or its+ * nearest ancestor's) overrides this — designs.ts resolvePageDesign.*/design?: string/**diff --git a/spaces/src/portable.ts b/spaces/src/portable.tsindex ed5e3cd9..79529c14 100644--- a/spaces/src/portable.ts+++ b/spaces/src/portable.ts@@ -18,7 +18,7 @@// `.ts` extensions ON PURPOSE: node resolves this module directly for the rig.import { type SpacesDoc, type Page, type Block, repairId, pageAssetKeys } from './model.ts'-import { designAssetKeys } from './designs.ts'+import { designAssetKeys, designSource } from './designs.ts'import { esc } from './sanitize.ts'import { isPageRef } from './embed.ts'import { allNotes, mergeNotes, renameRefs } from './footnotes.ts'@@ -176,6 +176,17 @@ export function extractSpace(inSet.has(id) ? { id } : { text: titleOf.get(id) ?? id }for (const p of pages) {+ // A DESIGN INHERITED FROM A PAGE THAT DOES NOT TRAVEL is pinned on the page+ // that wore it, BEFORE its parent is cut: a Ledger section's child exported+ // on its own must still look like Ledger, and the section is not in the+ // file to inherit from. A design the page sets itself, or takes from the+ // space (whose `design` travels in the clone below), needs nothing.+ // Only a page whose PARENT is cut: one inside the extract inherits from a+ // page that did travel, pinned or not.+ if (p.design === undefined && (p.id === rootId || !p.parent || !inSet.has(p.parent))) {+ const src = designSource(doc, p.id)+ if (src.from === 'ancestor' && src.pageId && !inSet.has(src.pageId) && typeof src.name === 'string') p.design = src.name+ }// the root becomes the home page of its own document, so it has no parent;// a child whose parent did not travel is re-homed onto the root rather than// left dangling (parseDoc drops such a parent anyway — doing it here keepsdiff --git a/spaces/src/preview.ts b/spaces/src/preview.tsindex 86ef3743..e97fa1fc 100644--- a/spaces/src/preview.ts+++ b/spaces/src/preview.ts@@ -50,11 +50,15 @@// because there is still no reader to ask. designs.ts `previewRules` supplies// it as flat values — no custom properties, no color-mix() — and they go on as// INLINE styles through the CSSOM, never into the <style> block below.+//+// WHICH design: the HOME page's, resolved (designs.ts resolvePageDesign) — the+// still IS the home page, so it wears what that page wears on screen, its own+// design or its section's before the space's.import type { SpacesDoc, Page } from './model'import { renderPage } from './render'import { homePage } from './model'-import { resolveDesign, previewRules, applyPreviewRules } from './designs.ts'+import { resolvePageDesign, previewRules, applyPreviewRules } from './designs.ts'/** Above this the preview is trimmed, then dropped to a title card. A preview* is a courtesy; it must never be why a file is large. */@@ -212,7 +216,7 @@ function titleCard(doc: SpacesDoc): HTMLElement {return col}-function wrap(inner: HTMLElement, doc: SpacesDoc): HTMLElement {+function wrap(inner: HTMLElement, doc: SpacesDoc, page: Page): HTMLElement {const box = document.createElement('div')// z-index above the splash (9999) and the loader's failure card (99999)box.className = 'bp'@@ -223,7 +227,7 @@ function wrap(inner: HTMLElement, doc: SpacesDoc): HTMLElement {// THE DESIGN GOES ON AS INLINE STYLES, NEVER INTO THE <style> ABOVE: this// node is written into the saved shell, and author-chosen values must not// become raw text inside a style element there (designs.ts previewRules).- const design = resolveDesign(doc)+ const design = resolvePageDesign(doc, page.id)if (design) applyPreviewRules(box, previewRules(design))return box}@@ -249,13 +253,15 @@ export function buildSpacePreview(doc: SpacesDoc): HTMLElement | null {forceOpen: true,printing: true,titleOf: (id) => doc.pages.find((p) => p.id === id)?.title,+ // no design on the root: the still is styled by wrap(), inline+ design: null,})const col = document.createElement('div')col.className = 'bp-col'while (rendered.firstChild) col.appendChild(rendered.firstChild)staticize(col, keepImages, doc)- const built = wrap(col, doc)+ const built = wrap(col, doc, page)if (byteLength(built) <= PREVIEW_BUDGET) return built}- return wrap(titleCard(doc), doc)+ return wrap(titleCard(doc), doc, page)}diff --git a/spaces/src/props.ts b/spaces/src/props.tsindex 7f01c582..e6a83b6a 100644--- a/spaces/src/props.ts+++ b/spaces/src/props.ts@@ -30,6 +30,8 @@ import { toneLabel } from './render'import { CODE_LANGS, normLang } from './highlight'import { aliasesOf } from './mentions.ts'import { t } from './i18n'+import { resolvePageDesign } from './designs.ts'+import { designLabel } from './designpanel'/*** What the panel needs from the editor.@@ -54,6 +56,8 @@ export interface PropsHost {openIconPicker(pageId: string, anchor: HTMLElement): void/** the editor owns popovers; the panel only says which page wants one */openAddProperty(pageId: string, anchor: HTMLElement): void+ /** this page's design choices — the same menu the page ⋯ menu opens */+ openPageDesign(pageId: string, anchor: HTMLElement): void/** the editor owns the icon set and the emoji fallback */pageIcon(icon: string | undefined): stringopenLinkCard(id: string): void@@ -341,6 +345,21 @@ export class PropsPanel {this.app.repaint()}))+ // THIS PAGE'S DESIGN — a button that opens the page menu's own choices,+ // not a <select>: an option in a native dropdown cannot be hovered for a+ // preview, and the preview is the point. It reads what the page wears+ // NOW, inherited or its own.+ {+ const r = resolvePageDesign(s.doc, page.id)+ const wears = designLabel(s.doc, r?.name ?? null)+ const b = mk('button', 'sp-btn sp-insp-dsg',+ page.design !== undefined ? wears : t('Inherited · {name}', { name: wears }))+ b.type = 'button'+ b.setAttribute('aria-haspopup', 'menu')+ b.addEventListener('click', (e) => { e.preventDefault(); this.app.openPageDesign(page.id, b) })+ this.row(t('Design'), b)+ }+this.row(t('Archived'), this.toggle(page.archived === true, (v) => {if (s.readOnly) returns.commit(() => {diff --git a/spaces/src/render.ts b/spaces/src/render.tsindex 8f55dce2..a3cc009c 100644--- a/spaces/src/render.ts+++ b/spaces/src/render.ts@@ -26,6 +26,7 @@ import { renderCalendar, spanOf, nextSpan } from './calendar.ts'import { unknownFilterOps } from './query.ts'import { answer, feed, freshContext, type CalcCtx } from './calc.ts'import { ICONS, type IconName } from './icons'+import { applyDesign, resolvePageDesign, type Resolved } from './designs.ts'import { renderCanvasHead, placeCard } from './canvas.ts'import { viewEmbed, anchorOf } from './embed.ts'import { markRefs, notesOnPage, noteOf, noteId, refId, type PageNotes } from './footnotes.ts'@@ -79,6 +80,17 @@ export interface RenderOpts {/** the page whose numbering `footnotes` is — DOM ids are document-global and* print draws every page at once, so a label's ids are scoped by page */footnoteScope?: string+ /**+ * The design the PAGE ROOT carries (renderPage only). Absent = this page's+ * own resolved design (designs.ts resolvePageDesign); `null` = none, for a+ * caller that styles the result itself (the static preview's inline rules).+ *+ * Only a page ROOT ever carries one. Everything rendered INSIDE a page — a+ * gallery card, a view's rows, a page card, a transclusion embed — is built+ * by renderBlocks under the host's root and so wears the HOST's design: the+ * design is the page you are on, not the page a card points at.+ */+ design?: Resolved | null}// The tag and list maps come from the block registry (blocks.ts), so a new@@ -1050,6 +1062,13 @@ export function renderPage(page: Page, doc: SpacesDoc, opts: RenderOpts = {}): Hconst art = document.createElement('article')art.className = 'sp-page'art.style.direction = 'ltr'+ // EACH PAGE ROOT CARRIES ITS OWN RESOLVED DESIGN. Print puts every page of a+ // space side by side under one root that carries none, so each keeps its+ // own; the editor's surface carries the SAME resolved design as the page it+ // shows, so the two can never disagree. designs.css matches ancestors by+ // attribute, so two roots with DIFFERENT designs must never nest — which is+ // why nothing inside a page is ever rendered through here.+ applyDesign(art, doc, opts.design !== undefined ? opts.design : resolvePageDesign(doc, page.id))const inner = document.createElement('div')inner.className = 'sp-page-inner'diff --git a/spaces/src/styles.css b/spaces/src/styles.cssindex b989da3b..ac04862a 100644--- a/spaces/src/styles.css+++ b/spaces/src/styles.css@@ -2974,6 +2974,12 @@ body.sp-canvas-dragging { user-select: none; cursor: grabbing; }.sp-dsg-cols { display: grid; grid-template-columns: 1fr 48px 48px; gap: 4px 8px; align-items: center; font-size: 13px; }.sp-dsg-cols > span { color: var(--ink-2); }.sp-dsg-cols > span:nth-child(2), .sp-dsg-cols > span:nth-child(3) { font-size: 11.5px; color: var(--muted); text-align: center; }+/* one page's design choices (page ⋯ menu, properties panel): the swatch sits+ where a menu item's icon does, so the rows read as the page menu's own */+.bkm-menu.sp-dsg-menu { min-width: 250px; }+.sp-dsg-item .bkm-ico { align-items: center; }+.sp-dsg-item .sp-dsg-sw b { height: 16px; }+.sp-insp-dsg { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.sp-dsg-cols input[type='color'] { width: 44px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }@media (max-width: 720px) { .sp-dsg-panel { top: auto; height: 62vh; inset-inline: 8px; width: auto; } }@media print { .sp-dsg-panel { display: none !important; } }