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 be saved as a template, and the daily note can start from one (#427)
nyblnet7641c5465c23
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.mdindex 7ac67337..4c004986 100644--- a/docs/DECISIONS.md+++ b/docs/DECISIONS.md@@ -9053,6 +9053,60 @@ the caret's block and is undone in one step. It also checks that `/` agreeswith the bar, that the tiers drop the words and fold the group, and that everycommand is still reachable from its new home.+## 2026-09-09 — bento/spaces page templates live in `doc.templates`, not in flagged pages++A page template is a saved page shape that new pages start from, and there were+two honest places to put it. **A template could be a PAGE** carrying a flag and+hidden from the sidebar — no new format shape, and it is editable with the page+editor for free. **Or a SEPARATE COLLECTION**, `doc.templates`, which nothing+that walks pages can see. The second was chosen, and the reason is a count.++`doc.pages` is enumerated in roughly forty places in this app: search, the graph+(`graph.ts`), backlinks and the tree (`buildIndex`), `issuesOf` and every board,+table and gallery view in `fields.ts`, the Markdown export in `portable.ts`, the+About counts, the agent API's `pages`/`stats`/`outline`/`validate`, the archive+list, the print sheet, and the file-manager preview. A flagged page needs a gate+at every one of them — and, the part that decides it, at every surface added+AFTERWARDS by someone who has never heard of templates. This zone has already+shipped that exact class twice: an allow-list applied BEFORE an indirection+(`isRemote` on the string an author wrote rather than on the resolved asset,+2026-08-28), and a source-grep assertion that passed straight through a live+regression (#392). A separate collection cannot be forgotten by a surface that+does not know it exists.++**What the choice costs is real and is stated rather than hidden.** A template+is not a page, so it is not searched, not in the graph, not back-linked, not+printed, and not in the Markdown export — `extractSpace` walks pages. Grafting a+subtree from another space brings that subtree's pages and brings NO templates.+So `doc.templates` is document data that travels with the FILE and not with a+subtree. A page-flag design would have grafted; it would also have leaked into+all thirteen surfaces above, and one forgotten gate is a template appearing in a+reader's search results or, worse, in an export they hand to somebody else.++**Tokens expand ONCE, at instantiation, and the model stores the result.**+bento/slides resolves `{{page}}`/`{{date}}` at RENDER time because a footer must+re-number when slides move (`resolveFields`, v0.9.12). A template has no such+need: the moment the page is made is the moment its date is decided, and a live+field would mean a page whose text changed under its author overnight. So this+is a string substitution at creation and the new page is an ORDINARY page — an+older build reads it exactly as this one does, with no field system to+understand. `{{date}}`, `{{date:iso}}`, `{{date:short}}`, `{{date+1:iso}}`,+`{{time}}` and `{{title}}`; anything else stays literal, so a `{{mustache}}` in+somebody's prose survives.++**The date a journal template writes is the ENTRY'S date, never today's.**+Backfilling Tuesday's note on Thursday must write Tuesday, or the feature lies+on every entry except the one made on the day. `doc.journalTemplate` names the+template new daily notes start from; absent means a blank entry, which is what+every file written before this gets.++Two prototype guards, both because the ids come out of a file somebody mailed+you: `templateById` scans a list rather than indexing an object (so+`journalTemplate:"constructor"` resolves to nothing), and the date-format lookup+uses `Object.hasOwn` (so `{{date:constructor}}` is literal text rather than+`Object`'s constructor stringified into the reader's page). Both are pinned by+assertions in `scripts/test-spaces-model.ts` that were watched to fail under+deliberate sabotage.## 2026-09-26 — Mermaid flowcharts: our own parser and layout, and labels are inert textA diagram can carry Mermaid source, so a page round-trips through Markdowndiff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.tsindex 46587e76..2370c0ac 100644--- a/scripts/test-spaces-model.ts+++ b/scripts/test-spaces-model.ts@@ -69,6 +69,12 @@ import type { Block, Page } from '../spaces/src/model.ts'import {buildGraph, layoutGraph, stepLayout, nodeRadius, graphBounds,} from '../spaces/src/graph.ts'+import {+ type PageTemplate, applyTemplate, expandTokens, instantiateBlocks, journalTemplate,+ makeTemplate, putTemplate, removeTemplate, setJournalTemplate, templateById, templatesOf,+} from '../spaces/src/templates.ts'+import { planJournal, todayISO } from '../spaces/src/journal.ts'+import { newPage } from '../spaces/src/model.ts'import { proceduralCoverSvg, proceduralCoverFor, hueOf, CARD_HUES } from '../spaces/src/procedural.ts'let failures = 0@@ -4132,6 +4138,196 @@ function fsTable(f: string): string {ok(seen.get('table') === 1, 'exactly one table branch, so that header markup is reachable')}+// ---- page templates --------------------------------------------------------+// BEHAVIOURAL, every one of them: the functions are imported and run. This zone+// has measured twice that a source-grep assertion passes straight through a+// live regression (#392), so nothing here reads the source of anything.+{+ const mk = (over: Record<string, unknown> = {}): SpacesDoc =>+ (parseDoc(doc(over)) as { doc: SpacesDoc }).doc++ // TOLERANCE. `doc.templates` arrives out of a file somebody mailed you.+ ok(templatesOf(mk()).length === 0, 'a document with no templates has none')+ ok(templatesOf(mk({ templates: 7 })).length === 0, 'a non-array templates field yields none, not a throw')+ ok(templatesOf(mk({ templates: [null, 3, {}, { id: '' }, { id: 't1' }] })).length === 1,+ 'entries with no usable id are dropped and the good one survives')+ ok(templatesOf(mk({ templates: [{ id: 't1' }] }))[0].blocks.length === 0,+ 'a template with no blocks array reads as an empty one')+ ok(templatesOf(mk({ templates: [{ id: 't1' }] }))[0].name === 't1',+ 'a template with no name falls back to its id rather than to undefined')++ // THE INDIRECTION THIS APP HAS SHIPPED TWICE. An id out of the document must+ // never reach Object.prototype.+ const proto = mk({ templates: [{ id: 't1', name: 'A', blocks: [] }] })+ ok(templateById(proto, 'constructor') === undefined, '"constructor" is not a template')+ ok(templateById(proto, '__proto__') === undefined, '"__proto__" is not a template')+ ok(templateById(proto, 'toString') === undefined, '"toString" is not a template')+ ok(templateById(proto, 't1')?.name === 'A', 'a real id still resolves')+ ok(journalTemplate(mk({ journalTemplate: 'constructor' })) === undefined,+ 'a journal setting naming a prototype key resolves to nothing')++ // CAPTURE. What a template must NOT carry is the half worth asserting.+ const src: Page = {+ id: 'p9', title: 'Standup', icon: '📓', width: 'wide',+ parent: 'p1', journal: '2026-01-02', archived: true,+ comments: [{ id: 'c1', author: 'A', at: '2026-01-01', text: 'private' }],+ blocks: [+ { id: 'b1', type: 'h2', html: 'Notes' },+ { id: 'b2', type: 'todo', html: 'ship it', parent: 'b1' },+ ],+ }+ const tpl = makeTemplate(src, 'Standup')+ ok(tpl.name === 'Standup' && tpl.title === 'Standup', 'the name is taken, and the title with it')+ ok(tpl.icon === '📓' && tpl.width === 'wide', 'the icon and the width travel')+ ok(!('parent' in tpl) && !('journal' in tpl) && !('archived' in tpl) && !('comments' in tpl),+ 'the parent, the date, the archive flag and the review threads do NOT')+ src.blocks[0].html = 'edited afterwards'+ ok(tpl.blocks[0].html === 'Notes', 'the capture is a deep copy — editing the page cannot reach it')++ // INSTANTIATION. Fresh ids, remapped parents, and a block that can hold a caret.+ const made = instantiateBlocks(tpl)+ ok(made.length === 2, 'both blocks arrive')+ ok(made.every((b) => b.id !== 'b1' && b.id !== 'b2'), 'every block gets a FRESH id')+ ok(new Set(made.map((b) => b.id)).size === 2, 'and the fresh ids are distinct')+ ok(made[1].parent === made[0].id, 'a parent link is remapped to the new ids, not left pointing at the template')+ const orphan = instantiateBlocks({ id: 'x', name: 'x', blocks: [{ id: 'b1', type: 'p', html: 'a', parent: 'gone' }] })+ ok(orphan[0].parent === undefined, 'a parent naming a block outside the template is dropped, as parseDoc drops one')+ ok(instantiateBlocks({ id: 'x', name: 'x', blocks: [] }).length === 1,+ 'an empty template still yields one block — a page with none has nowhere to put the caret')++ // TOKENS. Expanded ONCE, here, and the model stores the result.+ const ctx = { date: '2026-03-14', locale: 'en-GB', title: 'Ledger' }+ ok(expandTokens('{{date:iso}}', ctx) === '2026-03-14', '{{date:iso}} is the ISO date')+ ok(expandTokens('{{date+1:iso}}', ctx) === '2026-03-15', '{{date+1:iso}} is the next calendar day')+ ok(expandTokens('{{date-14:iso}}', ctx) === '2026-02-28', '{{date-14:iso}} steps back across a month end')+ ok(expandTokens('{{title}}', ctx) === 'Ledger', '{{title}} is the page title')+ ok(expandTokens('{{date}}', ctx).includes('2026') && expandTokens('{{date}}', ctx) !== '2026-03-14',+ '{{date}} is the reader-facing long form, not the ISO string')+ ok(expandTokens('a {{ date : iso }} b', ctx) === 'a 2026-03-14 b', 'whitespace inside the braces is tolerated')+ ok(expandTokens('nothing here', ctx) === 'nothing here', 'a string with no tokens comes back identical')+ ok(expandTokens('{{author}}', ctx) === '{{author}}', 'a token this build does not know stays literal')+ // THE PROTOTYPE GUARD, on the format record. Without Object.hasOwn this+ // resolves to Object's constructor and stringifies a function into the page.+ ok(expandTokens('{{date:constructor}}', ctx) === '{{date:constructor}}',+ '{{date:constructor}} is literal text, not Object.prototype.constructor')+ ok(expandTokens('{{date:toString}}', ctx) === '{{date:toString}}', 'and neither is toString a date format')+ ok(expandTokens('{{title+1}}', ctx) === '{{title+1}}', 'an offset on a non-date token is not a token at all')+ ok(expandTokens('<b>{{title}}</b>', { title: '<script>' }, (s) => s.replace(/</g, '<')) === '<b><script></b>',+ 'the encoder is applied to the VALUE and not to the surrounding html')+ ok(expandTokens('{{date:iso}}', { date: '2026-13-99' }) === todayISO(),+ 'a nonsense date in the context falls back to today rather than to a rolled-over wrong day')++ // APPLYING. keepTitle is what the journal needs.+ const dated: PageTemplate = {+ id: 't2', name: 'Daily', title: '{{date:iso}} log',+ blocks: [{ id: 'b1', type: 'p', html: 'Written on {{date:iso}}' }],+ }+ const target: Page = { id: 'pz', title: 'Untitled', blocks: [{ id: 'old', type: 'p', html: 'gone' }] }+ applyTemplate(target, dated, { date: '2026-03-14' })+ ok(target.title === '2026-03-14 log', 'the template title is expanded onto the page')+ ok(target.blocks.length === 1 && target.blocks[0].html === 'Written on 2026-03-14',+ 'and the blocks REPLACE what was there')+ ok(target.blocks[0].id !== 'old' && target.blocks[0].id !== 'b1', 'with a fresh id')++ const kept: Page = { id: 'pk', title: '2026-03-14', journal: '2026-03-14', blocks: [] }+ applyTemplate(kept, dated, { date: '2026-03-14' }, true)+ ok(kept.title === '2026-03-14', 'keepTitle leaves a journal entry titled by its own date')+ ok(kept.blocks[0].html === 'Written on 2026-03-14', 'and still takes the blocks')++ // THE JOURNAL, END TO END. The entry's OWN date, never today's — a template+ // with {{date}} in it must be right on the day you backfill, too.+ const jdoc = mk({ templates: [dated], journalTemplate: 't2' })+ const plan = planJournal(jdoc, '2026-03-15')+ const jtpl = journalTemplate(jdoc)!+ applyTemplate(plan.page, jtpl, { date: String(plan.page.journal) }, true)+ ok(plan.page.blocks[0].html === 'Written on 2026-03-15',+ 'a journal entry made for the 15th says the 15th, whatever day it is made on')+ ok(plan.page.title === '2026-03-15', 'and keeps the ISO title the journal model depends on')++ // THE COLLECTION. A default is an ABSENT KEY, on the way back as well.+ const cdoc = mk()+ putTemplate(cdoc, { id: 't1', name: 'One', blocks: [] })+ putTemplate(cdoc, { id: 't2', name: 'Two', blocks: [] })+ ok(templatesOf(cdoc).length === 2, 'two templates go in')+ putTemplate(cdoc, { id: 't1', name: 'One again', blocks: [] })+ ok(templatesOf(cdoc).length === 2 && templateById(cdoc, 't1')?.name === 'One again',+ 'the same id REPLACES rather than duplicating')+ setJournalTemplate(cdoc, 't2')+ ok(cdoc.journalTemplate === 't2', 'the daily-note setting points at a real template')+ setJournalTemplate(cdoc, 'nope')+ ok(!('journalTemplate' in cdoc), 'an id that names nothing DELETES the key rather than storing a dangling one')+ setJournalTemplate(cdoc, 't2')+ removeTemplate(cdoc, 't2')+ ok(!('journalTemplate' in cdoc), 'removing the journal template takes the setting with it')+ removeTemplate(cdoc, 't1')+ ok(!('templates' in cdoc), 'removing the last template deletes the key — back to byte-identical with a file that never had one')++ // ADDITIVITY (PLATFORM §3). An older build must round-trip all of this.+ const round = mk({+ templates: [{ id: 't1', name: 'One', blocks: [{ id: 'b1', type: 'p', html: 'x' }], futureField: 9 }],+ journalTemplate: 't1',+ })+ const back = (parseDoc(JSON.stringify(round)) as { doc: SpacesDoc }).doc+ ok(JSON.stringify(back.templates) === JSON.stringify(round.templates),+ 'templates survive a parse → serialize → parse round trip byte-for-byte')+ ok(back.journalTemplate === 't1', 'and so does the daily-note setting')+ ok((templatesOf(back)[0] as Record<string, unknown>).futureField === 9,+ 'a field a LATER build put on a template is still there after this one has read it')++ // THEY ARE NOT PAGES, and that is the whole reason for the separate+ // collection: nothing that walks doc.pages can see them, including the two+ // surfaces that would have needed a gate first.+ const walled = mk({+ pages: [+ { id: 'p1', title: 'One', blocks: [{ id: 'b1', type: 'p', html: 'hi' }] },+ { id: 'p2', title: 'Two', blocks: [{ id: 'b2', type: 'p', html: 'hi' }] },+ ],+ templates: [{+ id: 't1', name: 'Linky',+ blocks: [{ id: 'tb1', type: 'p', html: 'see <a href="#p/p1">One</a>' }],+ }],+ })+ const widx = buildIndex(walled)+ ok(widx.page.size === 2, 'the page index counts the pages and not the template')+ ok((widx.backlinks.get('p1') ?? []).length === 0,+ 'a link inside a TEMPLATE creates no backlink — the graph, the sidebar and the export all walk pages')+ ok(widx.block.get('tb1') === undefined, 'a template block is not in the block index either')++ // …until it is instantiated, at which point it IS an ordinary page and every+ // one of those surfaces sees it. A feature that is invisible forever is not+ // a feature.+ //+ // Asserted on the INDEX rather than on the backlink, because sanitizeInline+ // has no DOM in node and its fallback strips every tag — including the <a>+ // this would need. The browser pass in the PR covers the link itself; what+ // node can prove is the part that matters here, that the instantiated page+ // is an ordinary indexed page and its blocks are ordinary indexed blocks.+ const born = newPage('From the template')+ applyTemplate(born, templatesOf(walled)[0])+ walled.pages.push(born)+ const bidx = buildIndex(walled)+ ok(bidx.page.size === 3, 'a page MADE from a template is in the page index, like any other page')+ ok(bidx.block.get(born.blocks[0].id)?.pageId === born.id,+ 'and its blocks are in the block index, under it')+ ok(born.blocks[0].html?.includes('One'), 'with the template\'s words intact')++ // docContentKey: saving a template is a real edit, so crash recovery sees it.+ const before = mk()+ const after = mk()+ putTemplate(after, { id: 't1', name: 'One', blocks: [] })+ ok(docContentKey(before) !== docContentKey(after), 'adding a template changes the content key')+ // …and footnotes STILL do. Templates and footnotes each added their field on+ // their own branch with their own `return`, and a merge that kept both left+ // the second return dead: footnote edits silently dropped out of recovery+ // while every test passed. Every content field is checked here, together.+ const noted = mk()+ ;(noted as { footnotes?: Record<string, string> }).footnotes = { a: 'a note' }+ ok(docContentKey(before) !== docContentKey(noted), 'adding a footnote still changes the content key')+ const journal = mk()+ ;(journal as { journalTemplate?: string }).journalTemplate = 't1'+ ok(docContentKey(before) !== docContentKey(journal), 'choosing a journal template changes the content key')+}+console.log(`\n${checks - failures}/${checks} checks passed`)if (failures) process.exit(1)diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex ac59eb6f..dae6dabc 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -896,6 +896,32 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.- The labels hide on a narrower window as slides' do. On a phone, thewhole group is in ⋯, under captions. The `/` menu lists the same familiesin the same order, with the same captions.+- **Page templates, and a template for the daily note.** Open a page you would+ like to reuse, and the page's ⋯ menu offers **Save as template**. From then on+ the + above the page list offers a blank page or any of your templates, and+ the new page arrives with the blocks, the icon and the width of the one you+ saved. With no templates saved the + makes a blank page exactly as it always+ did — the picker only appears once there is something in it.++ The one that earns the feature is **Use for daily notes**: pick a template in+ **Templates…**, in the ▾ beside that +, and every new journal entry starts+ with your structure instead of an empty page. It is the most-used workflow in Obsidian and Logseq and it+ was the only thing a daily note here could not do.++ Write `{{date}}` anywhere in a template and each new page gets its own date+ there — `{{date:iso}}` for `2026-03-14`, `{{date:short}}` for a tight space,+ `{{date+1:iso}}` for tomorrow, plus `{{time}}` and `{{title}}`. Expanded ONCE,+ when the page is made, so what lands in the file is ordinary text an older+ build reads the same way. A journal entry gets the date it is FOR: backfilling+ Tuesday's note on Thursday writes Tuesday.++ Templates live in the document (`doc.templates`) rather than as hidden pages,+ so they never appear in search, the graph, backlinks, the sidebar or the+ Markdown export — and the flip side, stated plainly: they travel with the FILE+ and not with a page you graft into another space. Additive as ever: a file+ written before this has no templates key and opens unchanged, and turning the+ daily-note setting off deletes the key rather than storing a default. Saving+ or deleting a template is one ⌘Z.- **A page can answer to more than one name.** "Also known as" in the pagepanel takes a comma-separated list — "NYC, the Big Apple" on a page titledNew York — and every one of those names reaches the page from adiff --git a/spaces/README.md b/spaces/README.mdindex 4517dc2f..2b0638bb 100644--- a/spaces/README.md+++ b/spaces/README.md@@ -73,6 +73,8 @@ load contract and format additivity.| `src/sanitize.ts` | the inline allowlist — the only thing between a file someone mailed you and script execution || `src/store.ts` | undo, and the **typing run** || `src/journal.ts` | daily notes — the date is `page.journal`, never the title |+| `src/templates.ts` | page templates — `doc.templates`, a collection and NOT flagged pages, and the one-time `{{date}}` expansion |+| `src/templateui.ts` | the three surfaces for them: save this page, pick one from the +, and the manager || `src/calc.ts` | magic notes — the evaluator behind a line ending in `=`. No eval, ever || `src/render.ts` | model → DOM, shared by the editor, reading view and print || `src/highlight.ts` | the code lexer — text → `{kind, a, b}` ranges, no DOM, no strings |diff --git a/spaces/src/editor.ts b/spaces/src/editor.tsindex f046d93c..33bc9a4e 100644--- a/spaces/src/editor.ts+++ b/spaces/src/editor.ts@@ -48,6 +48,10 @@ import { openGraphView } from './graph.ts'import {todayISO, stepDay, journalLabel, journalShort, isJournal, planJournal,} from './journal'+import { applyTemplate, journalTemplate } from './templates.ts'+import {+ type TemplateHost, openTemplates, openNewPagePicker, savePageAsTemplate,+} from './templateui.ts'import { canWriteInPlace, parseEnvelope } from '../../kernel/src/save.ts'import { offlineEnabled } from '../../kernel/src/net.ts'import { startSharing } from '../../kernel/src/sync/online.ts'@@ -886,7 +890,12 @@ export class Editor {// the foot of the bar's + Insert, among the blocks, where a page is not a// thing you insert into the page you are on.const split = el('div', 'sp-newsplit')- const plus = iconBtn('plus', t('New page (⌘⌥N)'), () => this.newPage())+ // Once the space HAS templates, + offers them; with none it makes a blank+ // page as it always did (openNewPagePicker returns false and the fallback+ // runs). The caret beside it holds the other ways a page arrives.+ const plus = iconBtn('plus', t('New page (⌘⌥N)'), () => {+ if (!openNewPagePicker(this.templateHost, plus, () => this.newPage())) this.newPage()+ })plus.classList.add('sp-newpage')this.newPageMenu?.destroy()this.newPageMenu = barMenu({@@ -1051,6 +1060,14 @@ export class Editor {if (s.readOnly) returnconst plan = planJournal(s.doc, iso)if (plan.add.length) {+ // THE ENTRY'S OWN DATE, not today's: stepping to tomorrow's note has to+ // write tomorrow's date into it, or a template with {{date}} in it lies+ // on every entry but the one made on the day. Inside the SAME commit as+ // the pages, so ⌘Z still takes back "I opened today's journal" in one+ // step. The Journal parent page, when it is new too, is never templated —+ // it is furniture, not an entry.+ const tpl = journalTemplate(s.doc)+ if (tpl) applyTemplate(plan.page, tpl, { date: iso, locale: locale() }, true)s.commit(() => {for (const { page, after } of plan.add) {const at = after ? s.doc.pages.findIndex((p) => p.id === after) : -1@@ -1070,6 +1087,34 @@ export class Editor {this.openJournal(stepDay(String(cur.journal), n))}+ /**+ * The narrow contract src/templateui.ts gets — the store operations it+ * needs, and nothing else. Rebuilt on every read so `page` is never a stale+ * reference to a page that has since been deleted.+ */+ private get templateHost(): TemplateHost {+ const s = this.store+ return {+ get doc() { return s.doc },+ get readOnly() { return s.readOnly },+ get page() { return s.page },+ commit: (fn: () => void) => { s.commit(fn) },+ goToPage: (id: string) => { s.goToPage(id) },+ status: (msg: string) => { this.status(msg) },+ afterCreate: () => {+ this.repaint()+ afterPaint(() => {+ const h = this.main.querySelector<HTMLElement>('[data-page-title]')+ h?.focus()+ if (h) selectAll(h)+ })+ },+ pageIcon: (icon: string | undefined) => pageIcon(icon),+ dialog: (title, build) => { this.openOverlay(title, build) },+ menu: (anchor, label, fill) => { this.menuAt(anchor, label, fill) },+ }+ }+newPage(parent?: string): void {const page = newPage(t('Untitled'))if (parent) page.parent = parent@@ -4537,6 +4582,11 @@ export class Editor {run: () => this.makeIssue(pageId) })}+ if (!s.readOnly) {+ row(m, { icon: ICONS.copy, label: t('Save as template'), hint: t('New pages can start as a copy of this one'),+ run: () => savePageAsTemplate(this.templateHost, page) })+ }+// A thread about the PAGE — the second and last anchor. It is offered// where the page's own actions are, and only for the page in view,// because a thread is written into the page you are looking at.@@ -5751,6 +5801,7 @@ export class Editor {row(m, { icon: ICONS.page, label: t('New page'), kbd: keys('alt', 'mod', 'N'), run: () => this.newPage() })row(m, { icon: ICONS.book, label: t("Today's journal"), kbd: keys('shift', 'mod', 'J'), run: () => this.openJournal() })row(m, { icon: ICONS.board, label: t('New issue'), kbd: keys('shift', 'mod', 'I'), run: () => this.newIssue() })+ row(m, { icon: ICONS.copy, label: t('Templates…'), run: () => openTemplates(this.templateHost) })}private updateVersion: string | null = nulldiff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.tsindex 3e3696bc..24624325 100644--- a/spaces/src/i18n/de.ts+++ b/spaces/src/i18n/de.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const de: Catalog = {"A card for an address you type": "Eine Karte für eine Adresse, die du eingibst","A card that opens a page": "Eine Karte, die eine Seite öffnet",+ "A daily entry can be saved as a template too — its date is not saved with it.": "Auch ein Tageseintrag lässt sich als Vorlage sichern — sein Datum wird dabei nicht mitgespeichert.","A filter here is newer than this build and was not applied.": "Ein Filter dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "Ein Ordner voller .md-Dateien wird zu Seiten — samt Ordnerbaum und den [[Wikilinks]] dazwischen.","A folder of notes, or another space": "Ein Ordner mit Notizen oder ein anderer Space",@@ -61,6 +62,7 @@ export const de: Catalog = {"Audio from {host}": "Audio von {host}","Back": "Zurück","Background": "Hintergrund",+ "Blank page": "Leere Seite","Block": "Block","Block options": "Block-Optionen","Blocks": "Blöcke",@@ -134,9 +136,11 @@ export const de: Catalog = {"Couldn’t reach the live session": "Live-Sitzung nicht erreichbar","Cover": "Titelbild","Create “{name}”": "„{name}“ erstellen",+ "Daily note ✓": "Tagesnotiz ✓","Dark": "Dunkel","Default": "Standard","Delete": "Löschen",+ "Delete the template “{name}”? Pages already made from it are not touched.": "Vorlage „{name}“ löschen? Bereits daraus erstellte Seiten bleiben unberührt.","Delete “{name}”?": "„{name}“ löschen?","Delete…": "Löschen…","Descending": "Absteigend",@@ -189,6 +193,7 @@ export const de: Catalog = {"Find or create a page…": "Seite finden oder erstellen…","Fit": "Einpassen","Following — view only": "Folgt mit — nur Ansicht",+ "From a template": "Aus einer Vorlage","Full width": "Volle Breite","Graph": "Graph","Gray": "Grau",@@ -277,6 +282,8 @@ export const de: Catalog = {"New page": "Neue Seite","New page (⌘⌥N)": "Neue Seite (⌘⌥N)","New page inside": "Neue Unterseite",+ "New pages can start as a copy of this one": "Neue Seiten können als Kopie dieser Seite beginnen",+ "New pages can start as a copy of this one. The page itself is not changed.": "Neue Seiten können als Kopie dieser Seite beginnen. Die Seite selbst bleibt unverändert.","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "Neu bei Bento? Vorlagen, die Galerie und den KI-Bearbeitungsleitfaden findest du auf {home} — oder gib ⭐ auf {gh}.","Next (⏎)": "Weiter (⏎)","No Markdown files in that selection": "Keine Markdown-Dateien in dieser Auswahl",@@ -285,6 +292,7 @@ export const de: Catalog = {"No issues match this filter.": "Keine Issues entsprechen diesem Filter.","No issues yet. Add a status field to any page and it appears here.": "Noch keine Issues. Gib einer Seite ein Status-Feld, dann erscheint sie hier.","No pages yet": "Noch keine Seiten",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "Noch keine Vorlagen. Öffne eine Seite, die du wiederverwenden möchtest, und wähle „Als Vorlage sichern“.","Nobody else is here yet": "Noch niemand sonst da","Not in this file: it needs the network, and the site is told when someone opens the page": "Nicht in dieser Datei: das Abspielen braucht das Netz, und die Website erfährt, dass jemand diese Seite geöffnet hat","Not live — turns on when you share": "Nicht live — startet beim Teilen",@@ -394,11 +402,16 @@ export const de: Catalog = {"Save (⌘S)": "Speichern (⌘S)","Save a copy…": "Kopie speichern…","Save an untouched copy…": "Unveränderte Kopie speichern…",+ "Save as template": "Als Vorlage sichern",+ "Save template": "Vorlage sichern",+ "Save this page as a template": "Diese Seite als Vorlage sichern","Saved": "Gespeichert","Saved a new copy": "Neue Kopie gespeichert","Save failed — see console": "Speichern fehlgeschlagen — siehe Konsole",+ "Saved as a template": "Als Vorlage gesichert","Saves a copy that joins this session": "Speichert eine Kopie, die dieser Sitzung beitritt","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "Speichert eine Kopie zum Versenden. Wer sie öffnet, bearbeitet diesen Space live mit dir (Ende-zu-Ende-verschlüsselt); du bleibst Eigentümer und kannst sie aus der Personenliste entfernen.",+ "Saving a page keeps its blocks, its icon and its width.": "Beim Sichern einer Seite bleiben ihre Blöcke, ihr Symbol und ihre Breite erhalten.","Saving…": "Speichere…","Search": "Suche","Search all pages (⌘K)": "Alle Seiten durchsuchen (⌘K)",@@ -428,6 +441,10 @@ export const de: Catalog = {"Take it elsewhere": "Woanders weitermachen","Taken from the address if blank": "Bleibt das Feld leer, wird er aus der Adresse übernommen","Tall": "Hoch",+ "Template": "Vorlage",+ "Template name": "Name der Vorlage",+ "Templates": "Vorlagen",+ "Templates…": "Vorlagen…","Text": "Text","Text and background color": "Text- und Hintergrundfarbe","Text formatting": "Textformatierung",@@ -440,6 +457,7 @@ export const de: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "Das sind {n} Dateien — der Import kann einen Moment dauern. Fortfahren?","That needs to be an http or https address": "Das muss eine http- oder https-Adresse sein","That space is password-protected. Open it, then export the pages you want.": "Dieser Space ist passwortgeschützt. Öffnen Sie ihn und exportieren Sie dort die gewünschten Seiten.",+ "That template is no longer in this space": "Diese Vorlage ist nicht mehr in diesem Space","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "Das Gegenstück zu „Dokument-JSON kopieren“: Bearbeiten Sie einen Space in einem anderen Werkzeug und bringen Sie ihn zurück.","The day after": "Der Tag danach","The day before": "Der Tag davor",@@ -511,6 +529,7 @@ export const de: Catalog = {"Updated to v{v} on disk.": "Auf v{v} auf der Festplatte aktualisiert.","Updates": "Updates","Use a link…": "Einen Link verwenden…",+ "Use for daily notes": "Für Tagesnotizen verwenden","Use this width for every page": "Diese Breite für alle Seiten verwenden","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifiziert und erstellt die neue Version mit diesem Dokument und fragt nach dem Speicherort — wählen Sie die geöffnete Datei, um sie zu aktualisieren.","Verifying…": "Verifiziere…",@@ -535,6 +554,7 @@ export const de: Catalog = {"Width in the text column": "Breite in der Textspalte","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "Fenster auf diesem Computer synchronisieren sich weiterhin; deaktiviere den Offline-Modus unter „Über“, um mit jemandem anderswo zu arbeiten.","Words": "Wörter",+ "Write {{date}} anywhere and each new page gets its own date there.": "Schreibe irgendwo {{date}}, und jede neue Seite setzt dort ihr eigenes Datum ein.","Wrong password — try again": "Falsches Passwort — bitte erneut versuchen","Yellow": "Gelb","You have the newest version ({v}).": "Du hast die neueste Version ({v}).",diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.tsindex bb4a921d..2e4e3514 100644--- a/spaces/src/i18n/es.ts+++ b/spaces/src/i18n/es.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const es: Catalog = {"A card for an address you type": "Una tarjeta para una dirección que escribas","A card that opens a page": "Una tarjeta que abre una página",+ "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.","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.","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "Una carpeta de archivos .md se convierte en páginas, con el árbol de carpetas y los [[wikilinks]] intactos.","A folder of notes, or another space": "Una carpeta de notas u otro espacio",@@ -61,6 +62,7 @@ export const es: Catalog = {"Audio from {host}": "Audio de {host}","Back": "Atrás","Background": "Fondo",+ "Blank page": "Página en blanco","Block": "Bloque","Block options": "Opciones del bloque","Blocks": "Bloques",@@ -134,9 +136,11 @@ export const es: Catalog = {"Couldn’t reach the live session": "No se pudo contactar la sesión en vivo","Cover": "Portada","Create “{name}”": "Crear «{name}»",+ "Daily note ✓": "Nota diaria ✓","Dark": "Oscuro","Default": "Predeterminado","Delete": "Eliminar",+ "Delete the template “{name}”? Pages already made from it are not touched.": "¿Eliminar la plantilla «{name}»? Las páginas ya creadas a partir de ella no se tocan.","Delete “{name}”?": "¿Eliminar «{name}»?","Delete…": "Eliminar…","Descending": "Descendente",@@ -189,6 +193,7 @@ export const es: Catalog = {"Find or create a page…": "Buscar o crear una página…","Fit": "Ajustar","Following — view only": "Siguiendo — solo lectura",+ "From a template": "A partir de una plantilla","Full width": "Ancho completo","Graph": "Grafo","Gray": "Gris",@@ -277,6 +282,8 @@ export const es: Catalog = {"New page": "Nueva página","New page (⌘⌥N)": "Nueva página (⌘⌥N)","New page inside": "Nueva página dentro",+ "New pages can start as a copy of this one": "Las páginas nuevas pueden empezar como una copia de esta",+ "New pages can start as a copy of this one. The page itself is not changed.": "Las páginas nuevas pueden empezar como una copia de esta. La página en sí no cambia.","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "¿Nuevo en Bento? Encuentra plantillas, la galería y la guía de edición con IA en {home} — o dale ⭐ en {gh}.","Next (⏎)": "Siguiente (⏎)","No Markdown files in that selection": "No hay archivos Markdown en esa selección",@@ -285,6 +292,7 @@ export const es: Catalog = {"No issues match this filter.": "Ninguna incidencia coincide con este filtro.","No issues yet. Add a status field to any page and it appears here.": "Aún no hay incidencias. Añade un campo de estado a cualquier página y aparecerá aquí.","No pages yet": "Aún no hay páginas",+ "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».","Nobody else is here yet": "Todavía no hay nadie más","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","Not live — turns on when you share": "Sin conexión — se activa al compartir",@@ -394,11 +402,16 @@ export const es: Catalog = {"Save (⌘S)": "Guardar (⌘S)","Save a copy…": "Guardar una copia…","Save an untouched copy…": "Guardar una copia intacta…",+ "Save as template": "Guardar como plantilla",+ "Save template": "Guardar plantilla",+ "Save this page as a template": "Guardar esta página como plantilla","Saved": "Guardado","Saved a new copy": "Se guardó una copia nueva","Save failed — see console": "Error al guardar — mira la consola",+ "Saved as a template": "Guardada como plantilla","Saves a copy that joins this session": "Guarda una copia que se une a esta sesión","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "Guarda una copia para enviar. Quien la abra editará este Space en vivo contigo (cifrado de extremo a extremo); tú sigues siendo el propietario y puedes quitarlos de la lista de Personas.",+ "Saving a page keeps its blocks, its icon and its width.": "Al guardar una página se conservan sus bloques, su icono y su ancho.","Saving…": "Guardando…","Search": "Buscar","Search all pages (⌘K)": "Buscar en todas las páginas (⌘K)",@@ -428,6 +441,10 @@ export const es: Catalog = {"Take it elsewhere": "Llévatelo a otra parte","Taken from the address if blank": "Si se deja vacío, se toma de la dirección","Tall": "Alto",+ "Template": "Plantilla",+ "Template name": "Nombre de la plantilla",+ "Templates": "Plantillas",+ "Templates…": "Plantillas…","Text": "Texto","Text and background color": "Color de texto y de fondo","Text formatting": "Formato de texto",@@ -440,6 +457,7 @@ export const es: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "Son {n} archivos: importarlos todos puede tardar un momento. ¿Continuar?","That needs to be an http or https address": "Tiene que ser una dirección http o https","That space is password-protected. Open it, then export the pages you want.": "Ese espacio está protegido con contraseña. Ábrelo y exporta desde allí las páginas que quieras.",+ "That template is no longer in this space": "Esa plantilla ya no está en este espacio","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "La contraparte de Copiar el JSON del documento: edita un espacio en otra herramienta y vuelve a traerlo.","The day after": "El día siguiente","The day before": "El día anterior",@@ -511,6 +529,7 @@ export const es: Catalog = {"Updated to v{v} on disk.": "Actualizado a v{v} en disco.","Updates": "Actualizaciones","Use a link…": "Usar un enlace…",+ "Use for daily notes": "Usar para las notas diarias","Use this width for every page": "Usar esta anchura en todas las páginas","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifica y construye la nueva versión con este documento dentro, y pregunta dónde guardarla — elige el archivo que tienes abierto para actualizarlo.","Verifying…": "Verificando…",@@ -535,6 +554,7 @@ export const es: Catalog = {"Width in the text column": "Ancho en la columna de texto","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "Las ventanas de este equipo siguen sincronizándose; desactiva el modo sin conexión en «Acerca de» para trabajar con alguien en otro lugar.","Words": "Palabras",+ "Write {{date}} anywhere and each new page gets its own date there.": "Escribe {{date}} en cualquier sitio y cada página nueva pondrá ahí su propia fecha.","Wrong password — try again": "Contraseña incorrecta: inténtalo de nuevo","Yellow": "Amarillo","You have the newest version ({v}).": "Tienes la versión más reciente ({v}).",diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.tsindex de9c7bae..aa08d485 100644--- a/spaces/src/i18n/fr.ts+++ b/spaces/src/i18n/fr.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const fr: Catalog = {"A card for an address you type": "Une carte pour une adresse que vous saisissez","A card that opens a page": "Une carte qui ouvre une page",+ "A daily entry can be saved as a template too — its date is not saved with it.": "Une entrée quotidienne peut aussi être enregistrée comme modèle : sa date n’est pas enregistrée avec elle.","A filter here is newer than this build and was not applied.": "Un filtre de cette vue est plus récent que cette version et n’a pas été appliqué.","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "Un dossier de fichiers .md devient des pages, avec l’arborescence et les [[wikilinks]] intacts.","A folder of notes, or another space": "Un dossier de notes, ou un autre espace",@@ -61,6 +62,7 @@ export const fr: Catalog = {"Audio from {host}": "Audio provenant de {host}","Back": "Retour","Background": "Arrière-plan",+ "Blank page": "Page vierge","Block": "Bloc","Block options": "Options du bloc","Blocks": "Blocs",@@ -134,9 +136,11 @@ export const fr: Catalog = {"Couldn’t reach the live session": "Impossible de joindre la session live","Cover": "Couverture","Create “{name}”": "Créer « {name} »",+ "Daily note ✓": "Note quotidienne ✓","Dark": "Sombre","Default": "Par défaut","Delete": "Supprimer",+ "Delete the template “{name}”? Pages already made from it are not touched.": "Supprimer le modèle « {name} » ? Les pages déjà créées à partir de lui ne sont pas touchées.","Delete “{name}”?": "Supprimer « {name} » ?","Delete…": "Supprimer…","Descending": "Décroissant",@@ -189,6 +193,7 @@ export const fr: Catalog = {"Find or create a page…": "Trouver ou créer une page…","Fit": "Ajuster","Following — view only": "Suivi en cours — lecture seule",+ "From a template": "À partir d’un modèle","Full width": "Pleine largeur","Graph": "Graphe","Gray": "Gris",@@ -277,6 +282,8 @@ export const fr: Catalog = {"New page": "Nouvelle page","New page (⌘⌥N)": "Nouvelle page (⌘⌥N)","New page inside": "Nouvelle page à l’intérieur",+ "New pages can start as a copy of this one": "Les nouvelles pages peuvent commencer comme une copie de celle-ci",+ "New pages can start as a copy of this one. The page itself is not changed.": "Les nouvelles pages peuvent commencer comme une copie de celle-ci. La page elle-même n’est pas modifiée.","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "Nouveau sur Bento ? Trouvez des modèles, la galerie et le guide d’édition par IA sur {home} — ou mettez une ⭐ sur {gh}.","Next (⏎)": "Suivant (⏎)","No Markdown files in that selection": "Aucun fichier Markdown dans cette sélection",@@ -285,6 +292,7 @@ export const fr: Catalog = {"No issues match this filter.": "Aucun ticket ne correspond à ce filtre.","No issues yet. Add a status field to any page and it appears here.": "Aucun ticket pour l’instant. Ajoutez un champ statut à une page et elle apparaîtra ici.","No pages yet": "Aucune page pour l’instant",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "Aucun modèle pour l’instant. Ouvrez une page que vous voulez réutiliser et choisissez « Enregistrer comme modèle ».","Nobody else is here yet": "Personne d’autre pour l’instant","Not in this file: it needs the network, and the site is told when someone opens the page": "N’est pas dans ce fichier : la lecture nécessite le réseau, et ce site saura que quelqu’un a ouvert cette page","Not live — turns on when you share": "Hors ligne — s’active quand vous partagez",@@ -394,11 +402,16 @@ export const fr: Catalog = {"Save (⌘S)": "Enregistrer (⌘S)","Save a copy…": "Enregistrer une copie…","Save an untouched copy…": "Enregistrer une copie sans toucher à l’original…",+ "Save as template": "Enregistrer comme modèle",+ "Save template": "Enregistrer le modèle",+ "Save this page as a template": "Enregistrer cette page comme modèle","Saved": "Enregistré","Saved a new copy": "Nouvelle copie enregistrée","Save failed — see console": "Échec de l’enregistrement — voir la console",+ "Saved as a template": "Enregistrée comme modèle","Saves a copy that joins this session": "Enregistre une copie qui rejoint cette session","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "Enregistre une copie à envoyer. Qui l’ouvre édite cet espace en direct avec vous (chiffré de bout en bout) ; vous restez propriétaire et pouvez les retirer de la liste Personnes.",+ "Saving a page keeps its blocks, its icon and its width.": "Enregistrer une page conserve ses blocs, son icône et sa largeur.","Saving…": "Enregistrement…","Search": "Rechercher","Search all pages (⌘K)": "Rechercher dans toutes les pages (⌘K)",@@ -428,6 +441,10 @@ export const fr: Catalog = {"Take it elsewhere": "Emportez-le ailleurs","Taken from the address if blank": "Si vide, repris de l’adresse","Tall": "Haut",+ "Template": "Modèle",+ "Template name": "Nom du modèle",+ "Templates": "Modèles",+ "Templates…": "Modèles…","Text": "Texte","Text and background color": "Couleur du texte et du fond","Text formatting": "Mise en forme du texte",@@ -440,6 +457,7 @@ export const fr: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "Cela fait {n} fichiers — tout importer peut prendre un moment. Continuer ?","That needs to be an http or https address": "Il faut une adresse http ou https","That space is password-protected. Open it, then export the pages you want.": "Cet espace est protégé par un mot de passe. Ouvrez-le, puis exportez-en les pages voulues.",+ "That template is no longer in this space": "Ce modèle n’est plus dans cet espace","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "Le pendant de Copier le JSON du document : modifiez un espace dans un autre outil, puis ramenez-le ici.","The day after": "Le lendemain","The day before": "La veille",@@ -511,6 +529,7 @@ export const fr: Catalog = {"Updated to v{v} on disk.": "Mis à jour en v{v} sur le disque.","Updates": "Mises à jour","Use a link…": "Utiliser un lien…",+ "Use for daily notes": "Utiliser pour les notes quotidiennes","Use this width for every page": "Utiliser cette largeur pour toutes les pages","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Vérifie et construit la nouvelle version avec ce document, puis demande où l'enregistrer — choisissez le fichier ouvert pour le mettre à jour.","Verifying…": "Vérification…",@@ -535,6 +554,7 @@ export const fr: Catalog = {"Width in the text column": "Largeur dans la colonne de texte","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "Les fenêtres de cet ordinateur restent synchronisées ; désactivez le mode hors ligne dans « À propos » pour travailler avec quelqu’un ailleurs.","Words": "Mots",+ "Write {{date}} anywhere and each new page gets its own date there.": "Écrivez {{date}} n’importe où et chaque nouvelle page y mettra sa propre date.","Wrong password — try again": "Mot de passe incorrect — réessayez","Yellow": "Jaune","You have the newest version ({v}).": "Vous avez la dernière version ({v}).",diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.tsindex 92c4f31d..d73773b9 100644--- a/spaces/src/i18n/it.ts+++ b/spaces/src/i18n/it.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const it: Catalog = {"A card for an address you type": "Una scheda per un indirizzo che digiti","A card that opens a page": "Una scheda che apre una pagina",+ "A daily entry can be saved as a template too — its date is not saved with it.": "Anche una voce giornaliera può essere salvata come modello: la sua data non viene salvata con essa.","A filter here is newer than this build and was not applied.": "Un filtro di questa vista è più recente di questa versione e non è stato applicato.","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "Una cartella di file .md diventa pagine, con l’albero delle cartelle e i [[wikilink]] intatti.","A folder of notes, or another space": "Una cartella di note o un altro spazio",@@ -61,6 +62,7 @@ export const it: Catalog = {"Audio from {host}": "Audio da {host}","Back": "Indietro","Background": "Sfondo",+ "Blank page": "Pagina vuota","Block": "Blocco","Block options": "Opzioni del blocco","Blocks": "Blocchi",@@ -134,9 +136,11 @@ export const it: Catalog = {"Couldn’t reach the live session": "Impossibile raggiungere la sessione live","Cover": "Copertina","Create “{name}”": "Crea «{name}»",+ "Daily note ✓": "Nota giornaliera ✓","Dark": "Scuro","Default": "Predefinito","Delete": "Elimina",+ "Delete the template “{name}”? Pages already made from it are not touched.": "Eliminare il modello «{name}»? Le pagine già create da esso non vengono toccate.","Delete “{name}”?": "Eliminare «{name}»?","Delete…": "Elimina…","Descending": "Decrescente",@@ -189,6 +193,7 @@ export const it: Catalog = {"Find or create a page…": "Trova o crea una pagina…","Fit": "Adatta","Following — view only": "In ascolto — sola lettura",+ "From a template": "Da un modello","Full width": "Larghezza piena","Graph": "Grafo","Gray": "Grigio",@@ -277,6 +282,8 @@ export const it: Catalog = {"New page": "Nuova pagina","New page (⌘⌥N)": "Nuova pagina (⌘⌥N)","New page inside": "Nuova pagina interna",+ "New pages can start as a copy of this one": "Le nuove pagine possono partire da una copia di questa",+ "New pages can start as a copy of this one. The page itself is not changed.": "Le nuove pagine possono partire da una copia di questa. La pagina stessa non viene modificata.","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "Nuovo su Bento? Trovi modelli, la galleria e la guida all’editing con IA su {home} — o metti una ⭐ su {gh}.","Next (⏎)": "Successivo (⏎)","No Markdown files in that selection": "Nessun file Markdown in questa selezione",@@ -285,6 +292,7 @@ export const it: Catalog = {"No issues match this filter.": "Nessuna issue corrisponde a questo filtro.","No issues yet. Add a status field to any page and it appears here.": "Ancora nessuna issue. Aggiungi un campo stato a una pagina e comparirà qui.","No pages yet": "Ancora nessuna pagina",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "Ancora nessun modello. Apri una pagina che vuoi riutilizzare e scegli «Salva come modello».","Nobody else is here yet": "Non c’è ancora nessun altro","Not in this file: it needs the network, and the site is told when someone opens the page": "Non è dentro questo file: per riprodurla serve la rete, e quel sito saprà che qualcuno ha aperto questa pagina","Not live — turns on when you share": "Non live — si attiva quando condividi",@@ -394,11 +402,16 @@ export const it: Catalog = {"Save (⌘S)": "Salva (⌘S)","Save a copy…": "Salva una copia…","Save an untouched copy…": "Salva una copia senza toccare l’originale…",+ "Save as template": "Salva come modello",+ "Save template": "Salva modello",+ "Save this page as a template": "Salva questa pagina come modello","Saved": "Salvato","Saved a new copy": "Salvata una nuova copia","Save failed — see console": "Salvataggio non riuscito — vedi console",+ "Saved as a template": "Salvata come modello","Saves a copy that joins this session": "Salva una copia che entra in questa sessione","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "Salva una copia da inviare. Chi la apre modifica questo Space live con te (crittografia end-to-end); resti il proprietario e puoi rimuoverli dall’elenco Persone.",+ "Saving a page keeps its blocks, its icon and its width.": "Salvando una pagina si conservano i suoi blocchi, la sua icona e la sua larghezza.","Saving…": "Salvataggio…","Search": "Cerca","Search all pages (⌘K)": "Cerca in tutte le pagine (⌘K)",@@ -428,6 +441,10 @@ export const it: Catalog = {"Take it elsewhere": "Portalo altrove","Taken from the address if blank": "Se vuoto, viene preso dall'indirizzo","Tall": "Alto",+ "Template": "Modello",+ "Template name": "Nome del modello",+ "Templates": "Modelli",+ "Templates…": "Modelli…","Text": "Testo","Text and background color": "Colore del testo e dello sfondo","Text formatting": "Formattazione del testo",@@ -440,6 +457,7 @@ export const it: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "Sono {n} file — importarli tutti può richiedere un momento. Continuare?","That needs to be an http or https address": "Serve un indirizzo http o https","That space is password-protected. Open it, then export the pages you want.": "Quello spazio è protetto da password. Aprilo e da lì esporta le pagine che vuoi.",+ "That template is no longer in this space": "Quel modello non è più in questo spazio","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "Il corrispettivo di Copia il JSON del documento: modifica uno spazio in un altro strumento e riportalo qui.","The day after": "Il giorno dopo","The day before": "Il giorno prima",@@ -511,6 +529,7 @@ export const it: Catalog = {"Updated to v{v} on disk.": "Aggiornato alla v{v} su disco.","Updates": "Aggiornamenti","Use a link…": "Usa un link…",+ "Use for daily notes": "Usa per le note giornaliere","Use this width for every page": "Usa questa larghezza per tutte le pagine","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifica e costruisce la nuova versione con questo documento, poi chiede dove salvarla — scegli il file aperto per aggiornarlo.","Verifying…": "Verifica…",@@ -535,6 +554,7 @@ export const it: Catalog = {"Width in the text column": "Larghezza nella colonna di testo","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "Le finestre su questo computer restano sincronizzate; disattiva la modalità offline in «Informazioni» per lavorare con qualcuno altrove.","Words": "Parole",+ "Write {{date}} anywhere and each new page gets its own date there.": "Scrivi {{date}} in un punto qualsiasi e ogni nuova pagina vi metterà la propria data.","Wrong password — try again": "Password errata — riprova","Yellow": "Giallo","You have the newest version ({v}).": "Hai la versione più recente ({v}).",diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.tsindex e769e952..6268acaa 100644--- a/spaces/src/i18n/ja.ts+++ b/spaces/src/i18n/ja.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const ja: Catalog = {"A card for an address you type": "入力したアドレスのカード","A card that opens a page": "ページを開くカード",+ "A daily entry can be saved as a template too — its date is not saved with it.": "日次のページもテンプレートとして保存できます。その日付は保存されません。","A filter here is newer than this build and was not applied.": "このビューには、このバージョンより新しいフィルターがあり、適用されていません。","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "「.md」ファイルのフォルダーがページになります。フォルダー階層も [[ウィキリンク]] もそのままです。","A folder of notes, or another space": "ノートのフォルダー、または別のスペース",@@ -61,6 +62,7 @@ export const ja: Catalog = {"Audio from {host}": "{host} の音声","Back": "戻る","Background": "背景",+ "Blank page": "空白のページ","Block": "ブロック","Block options": "ブロックのオプション","Blocks": "ブロック",@@ -134,9 +136,11 @@ export const ja: Catalog = {"Couldn’t reach the live session": "ライブセッションに接続できませんでした","Cover": "カバー","Create “{name}”": "「{name}」を作成",+ "Daily note ✓": "デイリーノート ✓","Dark": "ダーク","Default": "デフォルト","Delete": "削除",+ "Delete the template “{name}”? Pages already made from it are not touched.": "テンプレート「{name}」を削除しますか?すでに作成したページはそのままです。","Delete “{name}”?": "「{name}」を削除しますか?","Delete…": "削除…","Descending": "降順",@@ -189,6 +193,7 @@ export const ja: Catalog = {"Find or create a page…": "ページを検索または作成…","Fit": "全体表示","Following — view only": "追従中 — 閲覧のみ",+ "From a template": "テンプレートから","Full width": "全幅","Graph": "グラフ","Gray": "グレー",@@ -277,6 +282,8 @@ export const ja: Catalog = {"New page": "新規ページ","New page (⌘⌥N)": "新規ページ (⌘⌥N)","New page inside": "この中に新規ページ",+ "New pages can start as a copy of this one": "新しいページをこのページの複製から始められます",+ "New pages can start as a copy of this one. The page itself is not changed.": "新しいページをこのページの複製から始められます。このページ自体は変わりません。","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "Bento は初めてですか?テンプレート、ギャラリー、AI編集ガイドは {home} でどうぞ — {gh} で ⭐ もぜひ。","Next (⏎)": "次へ (⏎)","No Markdown files in that selection": "選択に Markdown ファイルがありません",@@ -285,6 +292,7 @@ export const ja: Catalog = {"No issues match this filter.": "この条件に一致するイシューはありません。","No issues yet. Add a status field to any page and it appears here.": "まだイシューはありません。どれかのページにステータス項目を追加すると、ここに表示されます。","No pages yet": "ページがまだありません",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "まだテンプレートはありません。再利用したいページを開いて「テンプレートとして保存」を選んでください。","Nobody else is here yet": "まだほかに誰もいません","Not in this file: it needs the network, and the site is told when someone opens the page": "このファイルの中にはありません。再生にはネットワークが必要で、誰かがこのページを開いたことがそのサイトに伝わります","Not live — turns on when you share": "未接続 — 共有すると自動的にライブになります",@@ -394,11 +402,16 @@ export const ja: Catalog = {"Save (⌘S)": "保存 (⌘S)","Save a copy…": "コピーを保存…","Save an untouched copy…": "元のままのコピーを保存…",+ "Save as template": "テンプレートとして保存",+ "Save template": "テンプレートを保存",+ "Save this page as a template": "このページをテンプレートとして保存","Saved": "保存しました","Saved a new copy": "新しいコピーを保存しました","Save failed — see console": "保存に失敗 — コンソールを確認",+ "Saved as a template": "テンプレートとして保存しました","Saves a copy that joins this session": "このセッションに参加するコピーを保存します","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "送るためのコピーを保存します。開いた人はこの Space をあなたと一緒にライブ編集できます(エンドツーエンド暗号化)。あなたはオーナーのままで、メンバーリストからいつでも削除できます。",+ "Saving a page keeps its blocks, its icon and its width.": "ページを保存すると、ブロック・アイコン・幅がそのまま残ります。","Saving…": "保存中…","Search": "検索","Search all pages (⌘K)": "全ページを検索 (⌘K)",@@ -428,6 +441,10 @@ export const ja: Catalog = {"Take it elsewhere": "外に持ち出す","Taken from the address if blank": "空欄ならアドレスから取り込みます","Tall": "縦長",+ "Template": "テンプレート",+ "Template name": "テンプレート名",+ "Templates": "テンプレート",+ "Templates…": "テンプレート…","Text": "テキスト","Text and background color": "文字色と背景色","Text formatting": "文字の書式",@@ -440,6 +457,7 @@ export const ja: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "{n} 個のファイルがあります。すべて読み込むには少し時間がかかります。続けますか?","That needs to be an http or https address": "http または https のアドレスを入力してください","That space is password-protected. Open it, then export the pages you want.": "そのスペースはパスワードで保護されています。開いてから、必要なページを書き出してください。",+ "That template is no longer in this space": "そのテンプレートはこのスペースにもうありません","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "「文書 JSON をコピー」の対になる機能です。別のツールでスペースを編集して、ここへ戻せます。","The day after": "翌日","The day before": "前日",@@ -511,6 +529,7 @@ export const ja: Catalog = {"Updated to v{v} on disk.": "ディスク上で v{v} に更新しました。","Updates": "更新","Use a link…": "リンクを使う…",+ "Use for daily notes": "デイリーノートに使う","Use this width for every page": "この幅をすべてのページに使う","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "このドキュメントを含む新バージョンを検証・生成し、保存先を尋ねます — 開いているファイルを選べば更新されます。","Verifying…": "検証中…",@@ -535,6 +554,7 @@ export const ja: Catalog = {"Width in the text column": "本文カラム内の幅","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "このコンピュータ上のウィンドウ同士は引き続き同期します。ほかの場所にいる人と作業するには「About」でオフラインモードを解除してください。","Words": "語数",+ "Write {{date}} anywhere and each new page gets its own date there.": "どこかに {{date}} と書いておくと、新しいページごとにその日の日付が入ります。","Wrong password — try again": "パスワードが違います — もう一度お試しください","Yellow": "黄","You have the newest version ({v}).": "最新バージョンです ({v})。",diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.tsindex 8ce74b5d..80fe059c 100644--- a/spaces/src/i18n/packed.ts+++ b/spaces/src/i18n/packed.ts@@ -15,6 +15,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"A block nests under the one above it — this one has nothing above it": ["ブロックは一つ上のブロックの中に入ります — このブロックより上には何もありません","块会嵌套在它上面的那个块里 — 这个块上面没有别的块","區塊會巢狀於它上面的那個區塊 — 這個區塊上面沒有別的區塊","Un bloque se anida bajo el que tiene encima — este no tiene ninguno encima","Un bloc s’imbrique sous celui qui le précède — celui-ci n’a rien au-dessus","Ein Block wird unter dem darüberliegenden verschachtelt — über diesem steht nichts","Un blocco si annida sotto quello che lo precede — sopra questo non c’è nulla","Um bloco aninha-se sob o que está acima — este não tem nada acima"],"A card for an address you type": ["入力したアドレスのカード","为你输入的网址生成的卡片","為你輸入的網址產生的卡片","Una tarjeta para una dirección que escribas","Une carte pour une adresse que vous saisissez","Eine Karte für eine Adresse, die du eingibst","Una scheda per un indirizzo che digiti","Um cartão para um endereço que escreves"],"A card that opens a page": ["ページを開くカード","打开某个页面的卡片","開啟某個頁面的卡片","Una tarjeta que abre una página","Une carte qui ouvre une page","Eine Karte, die eine Seite öffnet","Una scheda che apre una pagina","Um cartão que abre uma página"],+ "A daily entry can be saved as a template too — its date is not saved with it.": ["日次のページもテンプレートとして保存できます。その日付は保存されません。","每日条目也可以保存为模板——它的日期不会一起保存。","每日條目也可以儲存為範本——它的日期不會一起儲存。","Una entrada diaria también puede guardarse como plantilla: su fecha no se guarda con ella.","Une entrée quotidienne peut aussi être enregistrée comme modèle : sa date n’est pas enregistrée avec elle.","Auch ein Tageseintrag lässt sich als Vorlage sichern — sein Datum wird dabei nicht mitgespeichert.","Anche una voce giornaliera può essere salvata come modello: la sua data non viene salvata con essa.","Uma entrada diária também pode ser guardada como modelo — a sua data não é guardada com ela."],"A filter here is newer than this build and was not applied.": ["このビューには、このバージョンより新しいフィルターがあり、適用されていません。","此视图中有比当前版本更新的筛选条件,未被应用。","此檢視中有比目前版本更新的篩選條件,未被套用。","Un filtro de esta vista es más reciente que esta versión y no se ha aplicado.","Un filtre de cette vue est plus récent que cette version et n’a pas été appliqué.","Ein Filter dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","Un filtro di questa vista è più recente di questa versione e non è stato applicato.","Um filtro desta vista é mais recente do que esta versão e não foi aplicado."],"A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": ["「.md」ファイルのフォルダーがページになります。フォルダー階層も [[ウィキリンク]] もそのままです。","一个装满 .md 文件的文件夹会变成页面,文件夹层级和 [[wiki 链接]] 都保留下来。","一個裝滿 .md 檔案的資料夾會變成頁面,資料夾層級和 [[wiki 連結]] 都會保留。","Una carpeta de archivos .md se convierte en páginas, con el árbol de carpetas y los [[wikilinks]] intactos.","Un dossier de fichiers .md devient des pages, avec l’arborescence et les [[wikilinks]] intacts.","Ein Ordner voller .md-Dateien wird zu Seiten — samt Ordnerbaum und den [[Wikilinks]] dazwischen.","Una cartella di file .md diventa pagine, con l’albero delle cartelle e i [[wikilink]] intatti.","Uma pasta de ficheiros .md transforma-se em páginas, com a árvore de pastas e os [[wikilinks]] intactos."],"A link with nothing in it yet": ["まだ何も入っていないリンク","还没有内容的链接","還沒有內容的連結","Un enlace todavía sin nada","Un lien encore vide","Ein Link, in dem noch nichts steht","Un collegamento ancora vuoto","Um link ainda sem nada"],@@ -76,6 +77,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Back to the text": ["本文に戻る","返回正文","回到內文","Volver al texto","Revenir au texte","Zurück zum Text","Torna al testo","Voltar ao texto"],"Background": ["背景","背景","背景","Fondo","Arrière-plan","Hintergrund","Sfondo","Plano de fundo"],"Between blocks, and between the lines of one": ["ブロック間、および一つのブロック内の行間","在块之间移动,也在一个块的各行之间移动","在區塊之間移動,也在一個區塊的各行之間移動","Entre bloques, y entre las líneas de uno","Entre les blocs, et entre les lignes d’un bloc","Zwischen Blöcken, und zwischen den Zeilen eines Blocks","Tra i blocchi, e tra le righe di uno","Entre blocos, e entre as linhas de um"],+ "Blank page": ["空白のページ","空白页面","空白頁面","Página en blanco","Page vierge","Leere Seite","Pagina vuota","Página em branco"],"Block": ["ブロック","块","區塊","Bloque","Bloc","Block","Blocco","Bloco"],"Block format": ["ブロックの書式","块格式","區塊格式","Formato del bloque","Format du bloc","Blockformat","Formato del blocco","Formato do bloco"],"Block options": ["ブロックのオプション","块选项","區塊選項","Opciones del bloque","Options du bloc","Block-Optionen","Opzioni del blocco","Opções do bloco"],@@ -151,10 +153,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Couldn’t reach the live session": ["ライブセッションに接続できませんでした","无法连接实时会话","無法連線即時會話","No se pudo contactar la sesión en vivo","Impossible de joindre la session live","Live-Sitzung nicht erreichbar","Impossibile raggiungere la sessione live","Não foi possível alcançar a sessão ao vivo"],"Cover": ["カバー","封面","封面","Portada","Couverture","Titelbild","Copertina","Capa"],"Create “{name}”": ["「{name}」を作成","创建“{name}”","建立「{name}」","Crear «{name}»","Créer « {name} »","„{name}“ erstellen","Crea «{name}»","Criar “{name}”"],+ "Daily note ✓": ["デイリーノート ✓","每日笔记 ✓","每日筆記 ✓","Nota diaria ✓","Note quotidienne ✓","Tagesnotiz ✓","Nota giornaliera ✓","Nota diária ✓"],"Dark": ["ダーク","深色","深色","Oscuro","Sombre","Dunkel","Scuro","Escuro"],"Date": ["日付","日期","日期","Fecha","Date","Datum","Data","Data"],"Default": ["デフォルト","默认","預設","Predeterminado","Par défaut","Standard","Predefinito","Padrão"],"Delete": ["削除","删除","刪除","Eliminar","Supprimer","Löschen","Elimina","Eliminar"],+ "Delete the template “{name}”? Pages already made from it are not touched.": ["テンプレート「{name}」を削除しますか?すでに作成したページはそのままです。","删除模板“{name}”?已经用它创建的页面不受影响。","刪除範本「{name}」?已經用它建立的頁面不受影響。","¿Eliminar la plantilla «{name}»? Las páginas ya creadas a partir de ella no se tocan.","Supprimer le modèle « {name} » ? Les pages déjà créées à partir de lui ne sont pas touchées.","Vorlage „{name}“ löschen? Bereits daraus erstellte Seiten bleiben unberührt.","Eliminare il modello «{name}»? Le pagine già create da esso non vengono toccate.","Eliminar o modelo «{name}»? As páginas já criadas a partir dele não são tocadas."],"Delete “{name}”?": ["「{name}」を削除しますか?","要删除“{name}”吗?","要刪除「{name}」嗎?","¿Eliminar «{name}»?","Supprimer « {name} » ?","„{name}“ löschen?","Eliminare «{name}»?","Eliminar “{name}”?"],"Delete…": ["削除…","删除…","刪除…","Eliminar…","Supprimer…","Löschen…","Elimina…","Eliminar…"],"Descending": ["降順","降序","遞減","Descendente","Décroissant","Absteigend","Decrescente","Decrescente"],@@ -211,6 +215,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Following — view only": ["追従中 — 閲覧のみ","跟随中 — 仅供查看","跟隨中 — 僅供檢視","Siguiendo — solo lectura","Suivi en cours — lecture seule","Folgt mit — nur Ansicht","In ascolto — sola lettura","Acompanhando — somente visualização"],"Footnotes": ["脚注","脚注","註腳","Notas al pie","Notes de bas de page","Fußnoten","Note a piè di pagina","Notas de rodapé"],"Formatting": ["書式","格式","格式","Formato","Mise en forme","Formatierung","Formattazione","Formatação"],+ "From a template": ["テンプレートから","从模板创建","從範本建立","A partir de una plantilla","À partir d’un modèle","Aus einer Vorlage","Da un modello","A partir de um modelo"],"Full width": ["全幅","全宽","全寬","Ancho completo","Pleine largeur","Volle Breite","Larghezza piena","Largura total"],"Gallery": ["ギャラリー","图库","圖庫","Galería","Galerie","Galerie","Galleria","Galeria"],"Getting around": ["移動","导航","導覽","Moverse","Se déplacer","Navigieren","Spostarsi","Navegar"],@@ -312,6 +317,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"New page": ["新規ページ","新建页面","新增頁面","Nueva página","Nouvelle page","Neue Seite","Nuova pagina","Nova página"],"New page (⌘⌥N)": ["新規ページ (⌘⌥N)","新建页面 (⌘⌥N)","新增頁面 (⌘⌥N)","Nueva página (⌘⌥N)","Nouvelle page (⌘⌥N)","Neue Seite (⌘⌥N)","Nuova pagina (⌘⌥N)","Nova página (⌘⌥N)"],"New page inside": ["この中に新規ページ","在其中新建页面","在其中新增頁面","Nueva página dentro","Nouvelle page à l’intérieur","Neue Unterseite","Nuova pagina interna","Nova página dentro desta"],+ "New pages can start as a copy of this one": ["新しいページをこのページの複製から始められます","新页面可以从这一页的副本开始","新頁面可以從這一頁的副本開始","Las páginas nuevas pueden empezar como una copia de esta","Les nouvelles pages peuvent commencer comme une copie de celle-ci","Neue Seiten können als Kopie dieser Seite beginnen","Le nuove pagine possono partire da una copia di questa","As páginas novas podem começar como uma cópia desta"],+ "New pages can start as a copy of this one. The page itself is not changed.": ["新しいページをこのページの複製から始められます。このページ自体は変わりません。","新页面可以从这一页的副本开始。这一页本身不会被改动。","新頁面可以從這一頁的副本開始。這一頁本身不會被改動。","Las páginas nuevas pueden empezar como una copia de esta. La página en sí no cambia.","Les nouvelles pages peuvent commencer comme une copie de celle-ci. La page elle-même n’est pas modifiée.","Neue Seiten können als Kopie dieser Seite beginnen. Die Seite selbst bleibt unverändert.","Le nuove pagine possono partire da una copia di questa. La pagina stessa non viene modificata.","As páginas novas podem começar como uma cópia desta. A página em si não é alterada."],"New property": ["新しいプロパティ","新建属性","新增屬性","Nueva propiedad","Nouvelle propriété","Neue Eigenschaft","Nuova proprietà","Nova propriedade"],"New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": ["Bento は初めてですか?テンプレート、ギャラリー、AI編集ガイドは {home} でどうぞ — {gh} で ⭐ もぜひ。","第一次用 Bento?在 {home} 查看模板、图库和 AI 编辑指南 — 也欢迎到 {gh} 点 ⭐。","第一次用 Bento?在 {home} 查看範本、圖庫和 AI 編輯指南 — 也歡迎到 {gh} 按 ⭐。","¿Nuevo en Bento? Encuentra plantillas, la galería y la guía de edición con IA en {home} — o dale ⭐ en {gh}.","Nouveau sur Bento ? Trouvez des modèles, la galerie et le guide d’édition par IA sur {home} — ou mettez une ⭐ sur {gh}.","Neu bei Bento? Vorlagen, die Galerie und den KI-Bearbeitungsleitfaden findest du auf {home} — oder gib ⭐ auf {gh}.","Nuovo su Bento? Trovi modelli, la galleria e la guida all’editing con IA su {home} — o metti una ⭐ su {gh}.","Novo no Bento? Encontre modelos, a galeria e o guia de edição com IA em {home} — ou dê uma ⭐ no {gh}."],"New… — page, journal, issue": ["新規… — ページ・ジャーナル・イシュー","新建… — 页面、日志、事项","新增… — 頁面、日誌、項目","Nuevo… — página, diario, incidencia","Nouveau… — page, journal, ticket","Neu… — Seite, Journal, Issue","Nuovo… — pagina, diario, issue","Novo… — página, diário, tarefa"],@@ -323,6 +330,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"No issues yet. Add a status field to any page and it appears here.": ["まだイシューはありません。どれかのページにステータス項目を追加すると、ここに表示されます。","还没有事项。给任意页面添加状态字段,它就会出现在这里。","還沒有項目。為任一頁面新增狀態欄位,它就會出現在這裡。","Aún no hay incidencias. Añade un campo de estado a cualquier página y aparecerá aquí.","Aucun ticket pour l’instant. Ajoutez un champ statut à une page et elle apparaîtra ici.","Noch keine Issues. Gib einer Seite ein Status-Feld, dann erscheint sie hier.","Ancora nessuna issue. Aggiungi un campo stato a una pagina e comparirà qui.","Ainda não há tarefas. Adiciona um campo de estado a qualquer página e ela aparece aqui."],"No pages yet": ["ページがまだありません","还没有页面","尚無頁面","Aún no hay páginas","Aucune page pour l’instant","Noch keine Seiten","Ancora nessuna pagina","Ainda sem páginas"],"No recovery — lose the password and the space is gone": ["復元できません — パスワードを失うとスペースも失われます","无法找回 — 丢失密码,空间也就没了","無法找回 — 遺失密碼,空間也就沒了","Sin recuperación: si pierdes la contraseña, pierdes el espacio","Aucune récupération : perdez le mot de passe et l’espace est perdu","Keine Wiederherstellung — Passwort verloren, Space verloren","Nessun recupero: se perdi la password, perdi lo spazio","Sem recuperação — perca a senha e o espaço se perde"],+ "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."],"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"],@@ -436,11 +444,16 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Save (⌘S)": ["保存 (⌘S)","保存 (⌘S)","儲存 (⌘S)","Guardar (⌘S)","Enregistrer (⌘S)","Speichern (⌘S)","Salva (⌘S)","Guardar (⌘S)"],"Save a copy…": ["コピーを保存…","保存副本…","儲存副本…","Guardar una copia…","Enregistrer une copie…","Kopie speichern…","Salva una copia…","Guardar uma cópia…"],"Save an untouched copy…": ["元のままのコピーを保存…","另存副本,原文件不动…","儲存原封不動的副本…","Guardar una copia intacta…","Enregistrer une copie sans toucher à l’original…","Unveränderte Kopie speichern…","Salva una copia senza toccare l’originale…","Guardar uma cópia intacta…"],+ "Save as template": ["テンプレートとして保存","保存为模板","儲存為範本","Guardar como plantilla","Enregistrer comme modèle","Als Vorlage sichern","Salva come modello","Guardar como modelo"],"Save as… — copy, new space, password": ["別名で保存… — コピー・新しいスペース・パスワード","另存为… — 副本、新空间、密码","另存為… — 副本、新空間、密碼","Guardar como… — copia, espacio nuevo, contraseña","Enregistrer sous… — copie, nouvel espace, mot de passe","Speichern unter… — Kopie, neuer Space, Passwort","Salva come… — copia, nuovo spazio, password","Guardar como… — cópia, novo espaço, palavra-passe"],"Save failed — see console": ["保存に失敗 — コンソールを確認","保存失败 — 请查看控制台","儲存失敗 — 請查看主控台","Error al guardar — mira la consola","Échec de l’enregistrement — voir la console","Speichern fehlgeschlagen — siehe Konsole","Salvataggio non riuscito — vedi console","Falha ao guardar — vê a consola"],+ "Save template": ["テンプレートを保存","保存模板","儲存範本","Guardar plantilla","Enregistrer le modèle","Vorlage sichern","Salva modello","Guardar modelo"],+ "Save this page as a template": ["このページをテンプレートとして保存","把这一页保存为模板","把這一頁儲存為範本","Guardar esta página como plantilla","Enregistrer cette page comme modèle","Diese Seite als Vorlage sichern","Salva questa pagina come modello","Guardar esta página como modelo"],"Saved": ["保存しました","已保存","已儲存","Guardado","Enregistré","Gespeichert","Salvato","Guardado"],"Saved a new copy": ["新しいコピーを保存しました","已保存新副本","已儲存新副本","Se guardó una copia nueva","Nouvelle copie enregistrée","Neue Kopie gespeichert","Salvata una nuova copia","Nova cópia guardada"],+ "Saved as a template": ["テンプレートとして保存しました","已保存为模板","已儲存為範本","Guardada como plantilla","Enregistrée comme modèle","Als Vorlage gesichert","Salvata come modello","Guardada como modelo"],"Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": ["送るためのコピーを保存します。開いた人はこの Space をあなたと一緒にライブ編集できます(エンドツーエンド暗号化)。あなたはオーナーのままで、メンバーリストからいつでも削除できます。","保存一份用于发送的副本。打开的人可与你实时共同编辑此 Space(端到端加密);你仍是所有者,可随时从成员列表中移除他们。","儲存一份用於傳送的副本。開啟的人可與你即時共同編輯此 Space(端對端加密);你仍是擁有者,可隨時從成員列表中移除他們。","Guarda una copia para enviar. Quien la abra editará este Space en vivo contigo (cifrado de extremo a extremo); tú sigues siendo el propietario y puedes quitarlos de la lista de Personas.","Enregistre une copie à envoyer. Qui l’ouvre édite cet espace en direct avec vous (chiffré de bout en bout) ; vous restez propriétaire et pouvez les retirer de la liste Personnes.","Speichert eine Kopie zum Versenden. Wer sie öffnet, bearbeitet diesen Space live mit dir (Ende-zu-Ende-verschlüsselt); du bleibst Eigentümer und kannst sie aus der Personenliste entfernen.","Salva una copia da inviare. Chi la apre modifica questo Space live con te (crittografia end-to-end); resti il proprietario e puoi rimuoverli dall’elenco Persone.","Salva uma cópia para enviar. Quem a abrir edita este Space ao vivo com você (com criptografia de ponta a ponta); você continua sendo o dono e pode removê-la na lista de Pessoas."],+ "Saving a page keeps its blocks, its icon and its width.": ["ページを保存すると、ブロック・アイコン・幅がそのまま残ります。","保存页面会保留它的块、图标和宽度。","儲存頁面會保留它的區塊、圖示和寬度。","Al guardar una página se conservan sus bloques, su icono y su ancho.","Enregistrer une page conserve ses blocs, son icône et sa largeur.","Beim Sichern einer Seite bleiben ihre Blöcke, ihr Symbol und ihre Breite erhalten.","Salvando una pagina si conservano i suoi blocchi, la sua icona e la sua larghezza.","Guardar uma página mantém os seus blocos, o seu ícone e a sua largura."],"Saving…": ["保存中…","保存中…","儲存中…","Guardando…","Enregistrement…","Speichere…","Salvataggio…","A guardar…"],"Search all pages (⌘K)": ["全ページを検索 (⌘K)","搜索所有页面 (⌘K)","搜尋所有頁面 (⌘K)","Buscar en todas las páginas (⌘K)","Rechercher dans toutes les pages (⌘K)","Alle Seiten durchsuchen (⌘K)","Cerca in tutte le pagine (⌘K)","Pesquisar em todas as páginas (⌘K)"],"Search all pages, with nothing selected": ["何も選択せずに全ページを検索","未选中内容时,搜索所有页面","未選取內容時,搜尋所有頁面","Buscar en todas las páginas, sin nada seleccionado","Rechercher dans toutes les pages, sans sélection","Alle Seiten durchsuchen, wenn nichts markiert ist","Cerca in tutte le pagine, senza nulla selezionato","Pesquisar todas as páginas, sem nada selecionado"],@@ -479,6 +492,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Taken from the address if blank": ["空欄ならアドレスから取り込みます","留空则取自网址","留空則取自網址","Si se deja vacío, se toma de la dirección","Si vide, repris de l’adresse","Bleibt das Feld leer, wird er aus der Adresse übernommen","Se vuoto, viene preso dall'indirizzo","Se ficar vazio, é retirado do endereço"],"Takes effect on the next save": ["次の保存から有効になります","下次保存时生效","下次儲存時生效","Se aplica en el próximo guardado","Prend effet au prochain enregistrement","Gilt ab der nächsten Speicherung","Ha effetto dal prossimo salvataggio","Vale a partir do próximo salvamento"],"Tall": ["縦長","竖向","直式","Alto","Haut","Hoch","Alto","Alto"],+ "Template": ["テンプレート","模板","範本","Plantilla","Modèle","Vorlage","Modello","Modelo"],+ "Template name": ["テンプレート名","模板名称","範本名稱","Nombre de la plantilla","Nom du modèle","Name der Vorlage","Nome del modello","Nome do modelo"],+ "Templates": ["テンプレート","模板","範本","Plantillas","Modèles","Vorlagen","Modelli","Modelos"],+ "Templates…": ["テンプレート…","模板…","範本…","Plantillas…","Modèles…","Vorlagen…","Modelli…","Modelos…"],"Text": ["テキスト","文本","文字","Texto","Texte","Text","Testo","Texto"],"Text and background color": ["文字色と背景色","文字与背景颜色","文字與背景顏色","Color de texto y de fondo","Couleur du texte et du fond","Text- und Hintergrundfarbe","Colore del testo e dello sfondo","Cor do texto e do plano de fundo"],"Text formatting": ["文字の書式","文字格式","文字格式","Formato de texto","Mise en forme du texte","Textformatierung","Formattazione del testo","Formatação de texto"],@@ -491,6 +508,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"That is {n} files — importing them all may take a moment. Continue?": ["{n} 個のファイルがあります。すべて読み込むには少し時間がかかります。続けますか?","一共 {n} 个文件,全部导入需要一点时间。继续吗?","共 {n} 個檔案,全部匯入需要一點時間。要繼續嗎?","Son {n} archivos: importarlos todos puede tardar un momento. ¿Continuar?","Cela fait {n} fichiers — tout importer peut prendre un moment. Continuer ?","Das sind {n} Dateien — der Import kann einen Moment dauern. Fortfahren?","Sono {n} file — importarli tutti può richiedere un momento. Continuare?","São {n} ficheiros — importar todos pode demorar um momento. Continuar?"],"That needs to be an http or https address": ["http または https のアドレスを入力してください","这里需要填写 http 或 https 地址","這裡需要填 http 或 https 位址","Tiene que ser una dirección http o https","Il faut une adresse http ou https","Das muss eine http- oder https-Adresse sein","Serve un indirizzo http o https","Tem de ser um endereço http ou https"],"That space is password-protected. Open it, then export the pages you want.": ["そのスペースはパスワードで保護されています。開いてから、必要なページを書き出してください。","该空间受密码保护。请先打开它,再导出你需要的页面。","該空間受密碼保護。請先開啟它,再匯出你需要的頁面。","Ese espacio está protegido con contraseña. Ábrelo y exporta desde allí las páginas que quieras.","Cet espace est protégé par un mot de passe. Ouvrez-le, puis exportez-en les pages voulues.","Dieser Space ist passwortgeschützt. Öffnen Sie ihn und exportieren Sie dort die gewünschten Seiten.","Quello spazio è protetto da password. Aprilo e da lì esporta le pagine che vuoi.","Esse espaço está protegido por palavra-passe. Abra-o e exporte de lá as páginas que quiser."],+ "That template is no longer in this space": ["そのテンプレートはこのスペースにもうありません","该模板已不在这个空间里","該範本已不在這個空間裡","Esa plantilla ya no está en este espacio","Ce modèle n’est plus dans cet espace","Diese Vorlage ist nicht mehr in diesem Space","Quel modello non è più in questo spazio","Esse modelo já não está neste espaço"],"That text has changed — nothing was linked": ["その箇所は変更されています。リンクは作成されませんでした","该文字已更改,未创建链接","該文字已變更,未建立連結","Ese texto ha cambiado: no se enlazó nada","Ce texte a changé — rien n’a été lié","Dieser Text hat sich geändert – es wurde nichts verlinkt","Quel testo è cambiato: non è stato collegato nulla","Esse texto mudou — nada foi ligado"],"That version could not be read": ["そのバージョンを読み込めませんでした","无法读取该版本","無法讀取該版本","No se pudo leer esa versión","Cette version n’a pas pu être lue","Diese Version konnte nicht gelesen werden","Non è stato possibile leggere quella versione","Não foi possível ler essa versão"],"The block menu, on an empty line": ["空行でブロックメニュー","在空行上打开块菜单","在空行上開啟區塊選單","El menú de bloques, en una línea vacía","Le menu de blocs, sur une ligne vide","Das Blockmenü, in einer leeren Zeile","Il menu dei blocchi, su una riga vuota","O menu de blocos, numa linha vazia"],@@ -573,6 +591,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Updated to v{v} on disk.": ["ディスク上で v{v} に更新しました。","已在磁盘上更新到 v{v}。","已在磁碟上更新至 v{v}。","Actualizado a v{v} en disco.","Mis à jour en v{v} sur le disque.","Auf v{v} auf der Festplatte aktualisiert.","Aggiornato alla v{v} su disco.","Atualizado para a v{v} no disco."],"Updates": ["更新","更新","更新","Actualizaciones","Mises à jour","Updates","Aggiornamenti","Atualizações"],"Use a link…": ["リンクを使う…","使用链接…","使用連結…","Usar un enlace…","Utiliser un lien…","Einen Link verwenden…","Usa un link…","Usar uma ligação…"],+ "Use for daily notes": ["デイリーノートに使う","用于每日笔记","用於每日筆記","Usar para las notas diarias","Utiliser pour les notes quotidiennes","Für Tagesnotizen verwenden","Usa per le note giornaliere","Usar para as notas diárias"],"Use this width for every page": ["この幅をすべてのページに使う","将此宽度用于所有页面","將此寬度用於所有頁面","Usar esta anchura en todas las páginas","Utiliser cette largeur pour toutes les pages","Diese Breite für alle Seiten verwenden","Usa questa larghezza per tutte le pagine","Usar esta largura em todas as páginas"],"Value": ["値","值","值","Valor","Valeur","Wert","Valore","Valor"],"Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": ["このドキュメントを含む新バージョンを検証・生成し、保存先を尋ねます — 開いているファイルを選べば更新されます。","验证并生成包含此文档的新版本,然后询问保存位置 — 选择当前打开的文件即可更新。","驗證並建立包含此文件的新版本,然後詢問儲存位置 — 選擇目前開啟的檔案即可更新。","Verifica y construye la nueva versión con este documento dentro, y pregunta dónde guardarla — elige el archivo que tienes abierto para actualizarlo.","Vérifie et construit la nouvelle version avec ce document, puis demande où l'enregistrer — choisissez le fichier ouvert pour le mettre à jour.","Verifiziert und erstellt die neue Version mit diesem Dokument und fragt nach dem Speicherort — wählen Sie die geöffnete Datei, um sie zu aktualisieren.","Verifica e costruisce la nuova versione con questo documento, poi chiede dove salvarla — scegli il file aperto per aggiornarlo.","Verifica e monta a nova versão com este documento dentro e depois pergunta onde salvá-la — escolha o arquivo que você tem aberto para atualizá-lo."],@@ -605,6 +624,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Words": ["語数","字数","字數","Palabras","Mots","Wörter","Parole","Palavras"],"Workload": ["作業量","工作量","工作量","Carga de trabajo","Charge de travail","Auslastung","Carico di lavoro","Carga de trabalho"],"Write the note": ["脚注を入力","撰写脚注","撰寫註腳","Escribe la nota","Rédigez la note","Notiz schreiben","Scrivi la nota","Escreva a nota"],+ "Write {{date}} anywhere and each new page gets its own date there.": ["どこかに {{date}} と書いておくと、新しいページごとにその日の日付が入ります。","在任意位置写上 {{date}},每个新页面都会在那里填入自己的日期。","在任意位置寫上 {{date}},每個新頁面都會在那裡填入自己的日期。","Escribe {{date}} en cualquier sitio y cada página nueva pondrá ahí su propia fecha.","Écrivez {{date}} n’importe où et chaque nouvelle page y mettra sa propre date.","Schreibe irgendwo {{date}}, und jede neue Seite setzt dort ihr eigenes Datum ein.","Scrivi {{date}} in un punto qualsiasi e ogni nuova pagina vi metterà la propria data.","Escreve {{date}} em qualquer sítio e cada página nova coloca aí a sua própria data."],"Writing": ["書く","写作","書寫","Escribir","Écrire","Schreiben","Scrivere","Escrever"],"Wrong password — try again": ["パスワードが違います — もう一度お試しください","密码错误 — 请重试","密碼錯誤 — 請重試","Contraseña incorrecta: inténtalo de nuevo","Mot de passe incorrect — réessayez","Falsches Passwort — bitte erneut versuchen","Password errata — riprova","Palavra-passe incorreta — tente novamente"],"Yellow": ["黄","黄色","黃色","Amarillo","Jaune","Gelb","Giallo","Amarelo"],diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.tsindex 68345c44..0f072ed7 100644--- a/spaces/src/i18n/pt.ts+++ b/spaces/src/i18n/pt.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const pt: Catalog = {"A card for an address you type": "Um cartão para um endereço que escreves","A card that opens a page": "Um cartão que abre uma página",+ "A daily entry can be saved as a template too — its date is not saved with it.": "Uma entrada diária também pode ser guardada como modelo — a sua data não é guardada com ela.","A filter here is newer than this build and was not applied.": "Um filtro desta vista é mais recente do que esta versão e não foi aplicado.","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "Uma pasta de ficheiros .md transforma-se em páginas, com a árvore de pastas e os [[wikilinks]] intactos.","A folder of notes, or another space": "Uma pasta de notas, ou outro espaço",@@ -61,6 +62,7 @@ export const pt: Catalog = {"Audio from {host}": "Áudio de {host}","Back": "Voltar","Background": "Plano de fundo",+ "Blank page": "Página em branco","Block": "Bloco","Block options": "Opções do bloco","Blocks": "Blocos",@@ -134,9 +136,11 @@ export const pt: Catalog = {"Couldn’t reach the live session": "Não foi possível alcançar a sessão ao vivo","Cover": "Capa","Create “{name}”": "Criar “{name}”",+ "Daily note ✓": "Nota diária ✓","Dark": "Escuro","Default": "Padrão","Delete": "Eliminar",+ "Delete the template “{name}”? Pages already made from it are not touched.": "Eliminar o modelo «{name}»? As páginas já criadas a partir dele não são tocadas.","Delete “{name}”?": "Eliminar “{name}”?","Delete…": "Eliminar…","Descending": "Decrescente",@@ -189,6 +193,7 @@ export const pt: Catalog = {"Find or create a page…": "Encontrar ou criar uma página…","Fit": "Ajustar","Following — view only": "Acompanhando — somente visualização",+ "From a template": "A partir de um modelo","Full width": "Largura total","Graph": "Grafo","Gray": "Cinza",@@ -277,6 +282,8 @@ export const pt: Catalog = {"New page": "Nova página","New page (⌘⌥N)": "Nova página (⌘⌥N)","New page inside": "Nova página dentro desta",+ "New pages can start as a copy of this one": "As páginas novas podem começar como uma cópia desta",+ "New pages can start as a copy of this one. The page itself is not changed.": "As páginas novas podem começar como uma cópia desta. A página em si não é alterada.","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "Novo no Bento? Encontre modelos, a galeria e o guia de edição com IA em {home} — ou dê uma ⭐ no {gh}.","Next (⏎)": "Seguinte (⏎)","No Markdown files in that selection": "Não há ficheiros Markdown nessa seleção",@@ -285,6 +292,7 @@ export const pt: Catalog = {"No issues match this filter.": "Nenhuma tarefa corresponde a este filtro.","No issues yet. Add a status field to any page and it appears here.": "Ainda não há tarefas. Adiciona um campo de estado a qualquer página e ela aparece aqui.","No pages yet": "Ainda sem páginas",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "Ainda não há modelos. Abre uma página que queiras reutilizar e escolhe «Guardar como modelo».","Nobody else is here yet": "Ainda não há mais ninguém","Not in this file: it needs the network, and the site is told when someone opens the page": "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": "Fora do ar — ativa quando você compartilha",@@ -394,11 +402,16 @@ export const pt: Catalog = {"Save (⌘S)": "Guardar (⌘S)","Save a copy…": "Guardar uma cópia…","Save an untouched copy…": "Guardar uma cópia intacta…",+ "Save as template": "Guardar como modelo",+ "Save template": "Guardar modelo",+ "Save this page as a template": "Guardar esta página como modelo","Saved": "Guardado","Saved a new copy": "Nova cópia guardada","Save failed — see console": "Falha ao guardar — vê a consola",+ "Saved as a template": "Guardada como modelo","Saves a copy that joins this session": "Guarda uma cópia que entra nesta sessão","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "Salva uma cópia para enviar. Quem a abrir edita este Space ao vivo com você (com criptografia de ponta a ponta); você continua sendo o dono e pode removê-la na lista de Pessoas.",+ "Saving a page keeps its blocks, its icon and its width.": "Guardar uma página mantém os seus blocos, o seu ícone e a sua largura.","Saving…": "A guardar…","Search": "Pesquisar","Search all pages (⌘K)": "Pesquisar em todas as páginas (⌘K)",@@ -428,6 +441,10 @@ export const pt: Catalog = {"Take it elsewhere": "Levar para outro lado","Taken from the address if blank": "Se ficar vazio, é retirado do endereço","Tall": "Alto",+ "Template": "Modelo",+ "Template name": "Nome do modelo",+ "Templates": "Modelos",+ "Templates…": "Modelos…","Text": "Texto","Text and background color": "Cor do texto e do plano de fundo","Text formatting": "Formatação de texto",@@ -440,6 +457,7 @@ export const pt: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "São {n} ficheiros — importar todos pode demorar um momento. Continuar?","That needs to be an http or https address": "Tem de ser um endereço http ou https","That space is password-protected. Open it, then export the pages you want.": "Esse espaço está protegido por palavra-passe. Abra-o e exporte de lá as páginas que quiser.",+ "That template is no longer in this space": "Esse modelo já não está neste espaço","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "O par de Copiar o JSON do documento: edite um espaço noutra ferramenta e traga-o de volta.","The day after": "O dia seguinte","The day before": "O dia anterior",@@ -511,6 +529,7 @@ export const pt: Catalog = {"Updated to v{v} on disk.": "Atualizado para a v{v} no disco.","Updates": "Atualizações","Use a link…": "Usar uma ligação…",+ "Use for daily notes": "Usar para as notas diárias","Use this width for every page": "Usar esta largura em todas as páginas","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifica e monta a nova versão com este documento dentro e depois pergunta onde salvá-la — escolha o arquivo que você tem aberto para atualizá-lo.","Verifying…": "Verificando…",@@ -535,6 +554,7 @@ export const pt: Catalog = {"Width in the text column": "Largura na coluna de texto","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "As janelas neste computador continuam sincronizando; desative o modo offline em Sobre para trabalhar com alguém em outro lugar.","Words": "Palavras",+ "Write {{date}} anywhere and each new page gets its own date there.": "Escreve {{date}} em qualquer sítio e cada página nova coloca aí a sua própria data.","Wrong password — try again": "Palavra-passe incorreta — tente novamente","Yellow": "Amarelo","You have the newest version ({v}).": "Já tem a versão mais recente ({v}).",diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.tsindex ce2a4508..1cceb543 100644--- a/spaces/src/i18n/zh-Hans.ts+++ b/spaces/src/i18n/zh-Hans.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const zh_Hans: Catalog = {"A card for an address you type": "为你输入的网址生成的卡片","A card that opens a page": "打开某个页面的卡片",+ "A daily entry can be saved as a template too — its date is not saved with it.": "每日条目也可以保存为模板——它的日期不会一起保存。","A filter here is newer than this build and was not applied.": "此视图中有比当前版本更新的筛选条件,未被应用。","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "一个装满 .md 文件的文件夹会变成页面,文件夹层级和 [[wiki 链接]] 都保留下来。","A folder of notes, or another space": "一个笔记文件夹,或另一个空间",@@ -61,6 +62,7 @@ export const zh_Hans: Catalog = {"Audio from {host}": "来自 {host} 的音频","Back": "返回","Background": "背景",+ "Blank page": "空白页面","Block": "块","Block options": "块选项","Blocks": "块",@@ -134,9 +136,11 @@ export const zh_Hans: Catalog = {"Couldn’t reach the live session": "无法连接实时会话","Cover": "封面","Create “{name}”": "创建“{name}”",+ "Daily note ✓": "每日笔记 ✓","Dark": "深色","Default": "默认","Delete": "删除",+ "Delete the template “{name}”? Pages already made from it are not touched.": "删除模板“{name}”?已经用它创建的页面不受影响。","Delete “{name}”?": "要删除“{name}”吗?","Delete…": "删除…","Descending": "降序",@@ -189,6 +193,7 @@ export const zh_Hans: Catalog = {"Find or create a page…": "查找或新建页面…","Fit": "适应窗口","Following — view only": "跟随中 — 仅供查看",+ "From a template": "从模板创建","Full width": "全宽","Graph": "关系图","Gray": "灰色",@@ -277,6 +282,8 @@ export const zh_Hans: Catalog = {"New page": "新建页面","New page (⌘⌥N)": "新建页面 (⌘⌥N)","New page inside": "在其中新建页面",+ "New pages can start as a copy of this one": "新页面可以从这一页的副本开始",+ "New pages can start as a copy of this one. The page itself is not changed.": "新页面可以从这一页的副本开始。这一页本身不会被改动。","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "第一次用 Bento?在 {home} 查看模板、图库和 AI 编辑指南 — 也欢迎到 {gh} 点 ⭐。","Next (⏎)": "下一个 (⏎)","No Markdown files in that selection": "所选内容里没有 Markdown 文件",@@ -285,6 +292,7 @@ export const zh_Hans: Catalog = {"No issues match this filter.": "没有符合此筛选条件的事项。","No issues yet. Add a status field to any page and it appears here.": "还没有事项。给任意页面添加状态字段,它就会出现在这里。","No pages yet": "还没有页面",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "还没有模板。打开一个想重复使用的页面,选择“保存为模板”。","Nobody else is here yet": "还没有其他人","Not in this file: it needs the network, and the site is told when someone opens the page": "不在此文件内:播放需要联网,而且该网站会知道有人打开了这个页面","Not live — turns on when you share": "未上线 — 分享时自动开启",@@ -394,11 +402,16 @@ export const zh_Hans: Catalog = {"Save (⌘S)": "保存 (⌘S)","Save a copy…": "保存副本…","Save an untouched copy…": "另存副本,原文件不动…",+ "Save as template": "保存为模板",+ "Save template": "保存模板",+ "Save this page as a template": "把这一页保存为模板","Saved": "已保存","Saved a new copy": "已保存新副本","Save failed — see console": "保存失败 — 请查看控制台",+ "Saved as a template": "已保存为模板","Saves a copy that joins this session": "保存一个会加入此会话的副本","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "保存一份用于发送的副本。打开的人可与你实时共同编辑此 Space(端到端加密);你仍是所有者,可随时从成员列表中移除他们。",+ "Saving a page keeps its blocks, its icon and its width.": "保存页面会保留它的块、图标和宽度。","Saving…": "保存中…","Search": "搜索","Search all pages (⌘K)": "搜索所有页面 (⌘K)",@@ -428,6 +441,10 @@ export const zh_Hans: Catalog = {"Take it elsewhere": "把内容带走","Taken from the address if blank": "留空则取自网址","Tall": "竖向",+ "Template": "模板",+ "Template name": "模板名称",+ "Templates": "模板",+ "Templates…": "模板…","Text": "文本","Text and background color": "文字与背景颜色","Text formatting": "文字格式",@@ -440,6 +457,7 @@ export const zh_Hans: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "一共 {n} 个文件,全部导入需要一点时间。继续吗?","That needs to be an http or https address": "这里需要填写 http 或 https 地址","That space is password-protected. Open it, then export the pages you want.": "该空间受密码保护。请先打开它,再导出你需要的页面。",+ "That template is no longer in this space": "该模板已不在这个空间里","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "“复制文档 JSON”的对应功能:在别的工具里编辑一个空间,再把它带回来。","The day after": "后一天","The day before": "前一天",@@ -511,6 +529,7 @@ export const zh_Hans: Catalog = {"Updated to v{v} on disk.": "已在磁盘上更新到 v{v}。","Updates": "更新","Use a link…": "使用链接…",+ "Use for daily notes": "用于每日笔记","Use this width for every page": "将此宽度用于所有页面","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "验证并生成包含此文档的新版本,然后询问保存位置 — 选择当前打开的文件即可更新。","Verifying…": "验证中…",@@ -535,6 +554,7 @@ export const zh_Hans: Catalog = {"Width in the text column": "在正文栏中的宽度","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "本机的窗口仍会同步;要与其他地方的人协作,请在“关于”中关闭离线模式。","Words": "字数",+ "Write {{date}} anywhere and each new page gets its own date there.": "在任意位置写上 {{date}},每个新页面都会在那里填入自己的日期。","Wrong password — try again": "密码错误 — 请重试","Yellow": "黄色","You have the newest version ({v}).": "你已是最新版本 ({v})。",diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.tsindex 0419e73e..ffd891f8 100644--- a/spaces/src/i18n/zh-Hant.ts+++ b/spaces/src/i18n/zh-Hant.ts@@ -13,6 +13,7 @@ import type { Catalog } from '../i18n'export const zh_Hant: Catalog = {"A card for an address you type": "為你輸入的網址產生的卡片","A card that opens a page": "開啟某個頁面的卡片",+ "A daily entry can be saved as a template too — its date is not saved with it.": "每日條目也可以儲存為範本——它的日期不會一起儲存。","A filter here is newer than this build and was not applied.": "此檢視中有比目前版本更新的篩選條件,未被套用。","A folder of .md files becomes pages, with the folder tree and the [[wikilinks]] intact.": "一個裝滿 .md 檔案的資料夾會變成頁面,資料夾層級和 [[wiki 連結]] 都會保留。","A folder of notes, or another space": "一個筆記資料夾,或另一個空間",@@ -61,6 +62,7 @@ export const zh_Hant: Catalog = {"Audio from {host}": "來自 {host} 的音訊","Back": "返回","Background": "背景",+ "Blank page": "空白頁面","Block": "區塊","Block options": "區塊選項","Blocks": "區塊",@@ -134,9 +136,11 @@ export const zh_Hant: Catalog = {"Couldn’t reach the live session": "無法連線即時會話","Cover": "封面","Create “{name}”": "建立「{name}」",+ "Daily note ✓": "每日筆記 ✓","Dark": "深色","Default": "預設","Delete": "刪除",+ "Delete the template “{name}”? Pages already made from it are not touched.": "刪除範本「{name}」?已經用它建立的頁面不受影響。","Delete “{name}”?": "要刪除「{name}」嗎?","Delete…": "刪除…","Descending": "遞減",@@ -189,6 +193,7 @@ export const zh_Hant: Catalog = {"Find or create a page…": "尋找或建立頁面…","Fit": "適應視窗","Following — view only": "跟隨中 — 僅供檢視",+ "From a template": "從範本建立","Full width": "全寬","Graph": "關係圖","Gray": "灰色",@@ -277,6 +282,8 @@ export const zh_Hant: Catalog = {"New page": "新增頁面","New page (⌘⌥N)": "新增頁面 (⌘⌥N)","New page inside": "在其中新增頁面",+ "New pages can start as a copy of this one": "新頁面可以從這一頁的副本開始",+ "New pages can start as a copy of this one. The page itself is not changed.": "新頁面可以從這一頁的副本開始。這一頁本身不會被改動。","New to Bento? Find templates, the gallery and the AI editing guide at {home} — or ⭐ it on {gh}.": "第一次用 Bento?在 {home} 查看範本、圖庫和 AI 編輯指南 — 也歡迎到 {gh} 按 ⭐。","Next (⏎)": "下一個 (⏎)","No Markdown files in that selection": "所選項目中沒有 Markdown 檔案",@@ -285,6 +292,7 @@ export const zh_Hant: Catalog = {"No issues match this filter.": "沒有符合此篩選條件的項目。","No issues yet. Add a status field to any page and it appears here.": "還沒有項目。為任一頁面新增狀態欄位,它就會出現在這裡。","No pages yet": "尚無頁面",+ "No templates yet. Open a page you would like to reuse and choose “Save as template”.": "還沒有範本。開啟一個想重複使用的頁面,選擇「儲存為範本」。","Nobody else is here yet": "還沒有其他人","Not in this file: it needs the network, and the site is told when someone opens the page": "不在這個檔案裡:播放需要網路,而且該網站會知道有人開啟了這個頁面","Not live — turns on when you share": "未上線 — 分享時自動開啟",@@ -394,11 +402,16 @@ export const zh_Hant: Catalog = {"Save (⌘S)": "儲存 (⌘S)","Save a copy…": "儲存副本…","Save an untouched copy…": "儲存原封不動的副本…",+ "Save as template": "儲存為範本",+ "Save template": "儲存範本",+ "Save this page as a template": "把這一頁儲存為範本","Saved": "已儲存","Saved a new copy": "已儲存新副本","Save failed — see console": "儲存失敗 — 請查看主控台",+ "Saved as a template": "已儲存為範本","Saves a copy that joins this session": "儲存一份會加入此工作階段的副本","Saves a copy to send. Whoever opens it edits this space live with you (end-to-end encrypted); you stay the owner and can remove them from the People list.": "儲存一份用於傳送的副本。開啟的人可與你即時共同編輯此 Space(端對端加密);你仍是擁有者,可隨時從成員列表中移除他們。",+ "Saving a page keeps its blocks, its icon and its width.": "儲存頁面會保留它的區塊、圖示和寬度。","Saving…": "儲存中…","Search": "搜尋","Search all pages (⌘K)": "搜尋所有頁面 (⌘K)",@@ -428,6 +441,10 @@ export const zh_Hant: Catalog = {"Take it elsewhere": "把內容帶走","Taken from the address if blank": "留空則取自網址","Tall": "直式",+ "Template": "範本",+ "Template name": "範本名稱",+ "Templates": "範本",+ "Templates…": "範本…","Text": "文字","Text and background color": "文字與背景顏色","Text formatting": "文字格式",@@ -440,6 +457,7 @@ export const zh_Hant: Catalog = {"That is {n} files — importing them all may take a moment. Continue?": "共 {n} 個檔案,全部匯入需要一點時間。要繼續嗎?","That needs to be an http or https address": "這裡需要填 http 或 https 位址","That space is password-protected. Open it, then export the pages you want.": "該空間受密碼保護。請先開啟它,再匯出你需要的頁面。",+ "That template is no longer in this space": "該範本已不在這個空間裡","The counterpart of Copy document JSON: edit a space in another tool, then bring it back.": "「複製文件 JSON」的對應功能:在別的工具裡編輯一個空間,再把它帶回來。","The day after": "後一天","The day before": "前一天",@@ -511,6 +529,7 @@ export const zh_Hant: Catalog = {"Updated to v{v} on disk.": "已在磁碟上更新至 v{v}。","Updates": "更新","Use a link…": "使用連結…",+ "Use for daily notes": "用於每日筆記","Use this width for every page": "將此寬度用於所有頁面","Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "驗證並建立包含此文件的新版本,然後詢問儲存位置 — 選擇目前開啟的檔案即可更新。","Verifying…": "驗證中…",@@ -535,6 +554,7 @@ export const zh_Hant: Catalog = {"Width in the text column": "相對於文字欄的寬度","Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": "本機的視窗仍會同步;要與其他地方的人協作,請在「關於」中關閉離線模式。","Words": "字數",+ "Write {{date}} anywhere and each new page gets its own date there.": "在任意位置寫上 {{date}},每個新頁面都會在那裡填入自己的日期。","Wrong password — try again": "密碼錯誤 — 請重試","Yellow": "黃色","You have the newest version ({v}).": "你已是最新版本 ({v})。",diff --git a/spaces/src/model.ts b/spaces/src/model.tsindex a53a3a13..7599d547 100644--- a/spaces/src/model.ts+++ b/spaces/src/model.ts@@ -14,6 +14,8 @@// There is no server; a break here is permanent.import type { CollabCreds } from './sync/crdt.ts'+// Type-only, and therefore erased: no runtime dependency, no import cycle.+import type { PageTemplate } from './templates.ts'import { esc, externalHref } from './sanitize.ts'export const FORMAT = 'bento/spaces'@@ -398,7 +400,19 @@ export interface SpacesDoc {footnotes?: Record<string, string>fonts?: Array<{ family: string; asset: string; weight?: string; style?: string }>readonly?: boolean+ /** WHOLE-FILE share export: re-mints docId on open. Not a page template —+ * see `templates` below, and src/templates.ts for why the two are separate. */template?: boolean+ /**+ * Page templates: saved page shapes new pages can start from.+ *+ * A SEPARATE COLLECTION, not pages carrying a flag — the reasoning, and what+ * that costs, is in src/templates.ts. Additive: absent on every file written+ * before this, and an older build round-trips it untouched.+ */+ templates?: PageTemplate[]+ /** the template id new daily notes start from; absent ⇒ a blank entry */+ journalTemplate?: string/*** Collaboration credentials (PLATFORM §2).*@@ -596,9 +610,16 @@ export const newPage = (title = 'Untitled', extra: Partial<Page> = {}): Page =>export function docContentKey(doc: SpacesDoc): string {// `footnotes` is content: a note's text is somebody's writing and lives// nowhere else, so a recovery snapshot that ignored it would compare equal to- // a document whose notes had all been rewritten. Appended at the END so the- // key for a document with no footnotes changes shape once and never again.- return JSON.stringify([doc.title, doc.home, doc.pages, doc.footnotes])+ // a document whose notes had all been rewritten.+ //+ // Templates are content too: saving one is an edit worth recovering after a+ // crash, and without them here a session whose only change was "save this+ // page as a template" would compare equal and lose it.+ //+ // ONE return. Each field arrived on its own branch with its own `return`+ // line, and a merge that kept both left the second one dead — footnotes+ // silently dropped out of recovery. New content fields are APPENDED here.+ return JSON.stringify([doc.title, doc.home, doc.pages, doc.footnotes, doc.templates, doc.journalTemplate])}// ---- derived, NEVER stored -------------------------------------------------diff --git a/spaces/src/styles.css b/spaces/src/styles.cssindex 5a8a23f9..e1b83ffe 100644--- a/spaces/src/styles.css+++ b/spaces/src/styles.css@@ -2832,3 +2832,10 @@ body.sp-canvas-dragging { user-select: none; cursor: grabbing; }min-width: var(--tap); min-height: var(--tap); justify-content: center;}}++/* ————— page templates —————+ One row in the Templates dialog: the icon beside the name rather than above+ it. `.sp-result-ico` and `.sp-tree-ico` are both `display: flex` and expect a+ flex PARENT; dropped into a plain span each became a block of its own. */+.sp-tpl-name { display: flex; align-items: center; gap: 8px; min-width: 0; }+.sp-tpl-name svg { width: 15px; height: 15px; display: block; color: var(--muted); }diff --git a/spaces/src/templates.ts b/spaces/src/templates.tsnew file mode 100644index 00000000..b2148091--- /dev/null+++ b/spaces/src/templates.ts@@ -0,0 +1,321 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+// Page templates: a page you keep so that new pages can start as a copy of it.+//+// WHERE THEY LIVE, AND WHY NOT AS PAGES. The obvious design is a page carrying+// a `template: true` flag, hidden from the sidebar — it costs no new format+// shape and a template is then editable with the page editor for free. It was+// measured and rejected. `doc.pages` is enumerated in forty-odd places across+// this app: search, the graph, backlinks (`buildIndex`), `issuesOf` and every+// board/table view in fields.ts, the Markdown export in portable.ts, the About+// counts, the agent API's `pages`/`stats`/`outline`, the archive list, the+// print sheet, and the file-manager preview. Every one of them would need a+// gate, and — this is the part that decides it — every surface added AFTERWARDS+// would need to remember. This zone has already shipped that class of bug twice+// (an allow-list applied before an indirection; a source-grep assertion that+// passed through a live regression). A separate collection cannot be forgotten+// by a surface that does not know it exists.+//+// So: `doc.templates` is an array of template records, and `doc.journalTemplate`+// names the one new daily notes start from. Both are ADDITIVE (PLATFORM §3):+// absent on every file written before this, an older build round-trips them+// untouched, and clearing a setting DELETES the key rather than storing a+// default.+//+// WHAT THAT COSTS, stated rather than hidden. A template is not a page, so it+// is not searched, not in the graph, not back-linked, not printed, and not in+// the Markdown export — `extractSpace` walks pages. Grafting a subtree from+// another space (portable.ts) brings its pages and brings no templates. That is+// the honest trade: `doc.templates` is document data that travels with the FILE+// and not with a subtree. A page-flag design would have grafted, and would have+// leaked into all thirteen surfaces above.+//+// TOKENS EXPAND ONCE, AT INSTANTIATION. bento/slides resolves `{{date}}` at+// RENDER time because a slide's footer must re-number when slides move. A+// template has no such need: the moment you make the page is the moment the+// date is decided, and a live field would mean a page whose text changed under+// the author tomorrow. So this is a one-time string substitution and the model+// stores the RESULT — no field system, no render-time cost, and the new page is+// an ordinary page that an older build reads exactly as this one does.++import { type Block, type Page, type SpacesDoc, uid } from './model.ts'+import { sanitizeInline } from './sanitize.ts'+import { isISO, journalLabel, journalShort, stepDay, todayISO } from './journal.ts'++/**+ * A saved page shape.+ *+ * DELIBERATELY NOT A `Page`. A template has no `parent` (where a new page goes+ * is the caller's decision), no `journal` (the date is the entry's, never the+ * template's), no `archived`/`journalHome`, and above all no `comments` — a+ * review thread is about one page at one moment and copying it into every page+ * made from the template afterwards would be a small horror.+ *+ * `title` may carry tokens, which is the whole reason it is separate from+ * `name`: the name is what you pick it by in the menu, the title is what the+ * new page is called.+ */+export interface PageTemplate {+ id: string+ /** what it is called in the picker — never token-expanded */+ name: string+ /** the new page's title; may carry tokens. Absent ⇒ the name */+ title?: string+ icon?: string+ cover?: string+ width?: 'wide' | 'full'+ blocks: Block[]+ created?: string+ /** additivity: a field a later build adds survives a round trip */+ [extra: string]: unknown+}++const isObj = (v: unknown): v is Record<string, unknown> =>+ !!v && typeof v === 'object' && !Array.isArray(v)++/**+ * The templates in a document, tolerant of anything.+ *+ * `doc.templates` comes out of a file somebody mailed you: it may be absent, a+ * number, an array of nulls, or an array of records missing an id. Every one of+ * those must yield an empty list or a shorter one, never a throw at boot and+ * never an entry the rest of the app then has to defend against.+ */+export function templatesOf(doc: SpacesDoc): PageTemplate[] {+ const raw = (doc as { templates?: unknown }).templates+ if (!Array.isArray(raw)) return []+ const out: PageTemplate[] = []+ for (const t of raw) {+ if (!isObj(t)) continue+ if (typeof t.id !== 'string' || !t.id) continue+ out.push({+ ...t,+ id: t.id,+ name: typeof t.name === 'string' && t.name ? t.name : t.id,+ blocks: Array.isArray(t.blocks) ? (t.blocks.filter(isObj) as Block[]) : [],+ } as PageTemplate)+ }+ return out+}++/**+ * One template by id.+ *+ * A LIST SCAN, not a map lookup, and that is on purpose: the id comes out of+ * the document (`doc.journalTemplate`, or a menu built from a mailed file), and+ * an object keyed by document-supplied strings is how `constructor` and+ * `__proto__` become "yes, that template exists". This app has shipped that bug+ * twice. Where a record IS the right shape — the token formats below — the+ * lookup is guarded with `Object.hasOwn`.+ */+export function templateById(doc: SpacesDoc, id: string | undefined): PageTemplate | undefined {+ if (typeof id !== 'string' || !id) return undefined+ return templatesOf(doc).find((t) => t.id === id)+}++/** The template new daily notes start from, if the document names a real one. */+export function journalTemplate(doc: SpacesDoc): PageTemplate | undefined {+ return templateById(doc, (doc as { journalTemplate?: unknown }).journalTemplate as string | undefined)+}++/**+ * Capture a page as a template.+ *+ * Deep-copied through JSON so that editing the page afterwards cannot reach+ * back into the saved shape — a template that drifts with the page it came from+ * is not a template. Block ids are kept as they are and re-minted at+ * instantiation instead; a stored graph with consistent `parent` links is+ * easier to reason about than one with holes in it.+ */+export function makeTemplate(page: Page, name: string): PageTemplate {+ const blocks: Block[] = JSON.parse(JSON.stringify(page.blocks ?? [])) as Block[]+ return {+ id: uid('tpl'),+ name: name || page.title || 'Template',+ // The page's own title becomes the new page's title. Somebody who wants a+ // date in it edits the field; the common case is that the title IS the name.+ ...(page.title ? { title: page.title } : {}),+ ...(page.icon ? { icon: page.icon } : {}),+ ...(page.cover ? { cover: page.cover } : {}),+ ...(page.width === 'wide' || page.width === 'full' ? { width: page.width } : {}),+ blocks,+ created: new Date().toISOString(),+ }+}++// ---- tokens ----------------------------------------------------------------++export interface TokenCtx {+ /** the date the new page is FOR — a journal entry's own day, else today */+ date?: string+ /** the wall clock at instantiation */+ now?: Date+ /** the reader's locale, for the rendered forms */+ locale?: string+ /** what `{{title}}` resolves to */+ title?: string+}++/**+ * The named date shapes.+ *+ * A RECORD, so the `fmt` a mailed template names is looked up with+ * `Object.hasOwn` and never with `in`, truthiness or a bare index. `{{date:iso}}`+ * is a format; `{{date:constructor}}` is a string that stays literal. Without+ * that guard the second one resolves to `Object`'s constructor and stringifies+ * a function into the reader's page — the exact indirection bug this zone has+ * written down twice.+ */+const DATE_FMT: Record<string, (iso: string, locale?: string) => string> = {+ iso: (iso) => iso,+ long: (iso, locale) => journalLabel(iso, locale),+ short: (iso, locale) => journalShort(iso, locale),+}++/** `{{date}}`, `{{date:iso}}`, `{{date+1:short}}`, `{{time}}`, `{{title}}`. */+const TOKEN = /\{\{\s*(date|time|title)\s*([+-]\d{1,4})?\s*(?::\s*([A-Za-z]+)\s*)?\}\}/g++function clockLabel(now: Date, locale?: string): string {+ try {+ return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit' }).format(now)+ } catch {+ return `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`+ }+}++/**+ * Substitute the tokens in one string.+ *+ * `encode` is what makes this safe in both places it is used: a block's `html`+ * needs the value escaped (a template could be instantiated with a locale whose+ * date format contains nothing dangerous today, but the rule must not depend on+ * that), and a page title is plain text and must not be. An unrecognised token+ * never matches and is therefore left exactly as it was typed, which is the+ * behaviour a `{{mustache}}` in someone's prose needs.+ */+export function expandTokens(text: string, ctx: TokenCtx = {}, encode: (s: string) => string = (s) => s): string {+ if (!text || text.indexOf('{{') < 0) return text+ const now = ctx.now ?? new Date()+ const base = ctx.date && isISO(ctx.date) ? ctx.date : todayISO(now)+ return text.replace(TOKEN, (whole, name: string, offset: string | undefined, fmt: string | undefined) => {+ if (name === 'title') return offset || fmt ? whole : encode(ctx.title ?? '')+ if (name === 'time') return offset || fmt ? whole : encode(clockLabel(now, ctx.locale))+ const iso = offset ? stepDay(base, Number(offset)) : base+ const key = fmt ?? 'long'+ if (!Object.hasOwn(DATE_FMT, key)) return whole+ return encode(DATE_FMT[key](iso, ctx.locale))+ })+}++const escapeHtml = (s: string): string =>+ s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')++// ---- instantiation ---------------------------------------------------------++/**+ * The blocks a template produces: fresh ids, `parent` links remapped to match,+ * tokens expanded, and every `html` put back through the sanitizer.+ *+ * SANITIZED HERE even though render.ts sanitizes what it paints, for the reason+ * portable.ts sanitizes a graft: this writes into `doc.blocks`, which is what+ * the Markdown export, the agent API and the next save all read. Cleaning at+ * the door means the document never HOLDS the thing, rather than every reader+ * of it having to remember.+ *+ * FRESH IDS ARE NOT COSMETIC. Ids are what links, backlinks and the CRDT node+ * key are built on; two pages made from one template sharing block ids would+ * make `buildIndex` disagree with itself and give two collaborators one node+ * for two blocks.+ */+export function instantiateBlocks(tpl: PageTemplate, ctx: TokenCtx = {}): Block[] {+ const src = Array.isArray(tpl.blocks) ? tpl.blocks : []+ const idMap = new Map<string, string>()+ for (const b of src) if (typeof b?.id === 'string' && b.id) idMap.set(b.id, uid('b'))+ const out: Block[] = []+ for (const b of src) {+ if (!isObj(b)) continue+ const copy = JSON.parse(JSON.stringify(b)) as Block+ copy.id = (typeof b.id === 'string' && idMap.get(b.id)) || uid('b')+ // A parent naming a block that is not in this template is DROPPED, exactly+ // as parseDoc drops one: a block whose owner is absent never renders.+ if (typeof copy.parent === 'string') {+ const to = idMap.get(copy.parent)+ if (to) copy.parent = to+ else delete copy.parent+ }+ if (typeof copy.html === 'string') copy.html = sanitizeInline(expandTokens(copy.html, ctx, escapeHtml))+ if (typeof copy.caption === 'string') copy.caption = expandTokens(copy.caption, ctx, escapeHtml)+ if (Array.isArray(copy.rows)) {+ copy.rows = copy.rows.map((row) =>+ Array.isArray(row) ? row.map((c) => (typeof c === 'string' ? sanitizeInline(expandTokens(c, ctx, escapeHtml)) : c)) : row)+ }+ out.push(copy)+ }+ // A page with no blocks has nowhere to put the caret.+ if (!out.length) out.push({ id: uid('b'), type: 'p', html: '' })+ return out+}++/**+ * Apply a template to a page IN PLACE, replacing its blocks.+ *+ * In place, and mutating, because every caller is already inside a+ * `store.commit` — making the whole thing one undo step is the point. Passing a+ * page back would tempt a caller into a second commit and "new page from+ * template" would take two ⌘Z.+ *+ * `keepTitle` is what the journal needs: a daily entry's title is its ISO date+ * and the template must not overwrite it, while an ordinary new page takes the+ * template's title. Same code, one flag, rather than two near-identical paths.+ */+export function applyTemplate(page: Page, tpl: PageTemplate, ctx: TokenCtx = {}, keepTitle = false): void {+ const withTitle: TokenCtx = { ...ctx, title: ctx.title ?? page.title }+ if (!keepTitle && typeof tpl.title === 'string' && tpl.title) {+ page.title = expandTokens(tpl.title, withTitle, (s) => s)+ }+ if (typeof tpl.icon === 'string' && tpl.icon) page.icon = tpl.icon+ if (typeof tpl.cover === 'string' && tpl.cover) page.cover = tpl.cover+ if (tpl.width === 'wide' || tpl.width === 'full') page.width = tpl.width+ page.blocks = instantiateBlocks(tpl, { ...withTitle, title: page.title })+}++// ---- the collection --------------------------------------------------------+// All three mutate `doc` and none of them commits. The caller is the editor,+// inside one `store.commit`, so that saving or deleting a template is one undo+// step — and so this module needs no store and stays runnable in node.++/** Add a template, or replace the one with the same id. */+export function putTemplate(doc: SpacesDoc, tpl: PageTemplate): void {+ const list = templatesOf(doc)+ const at = list.findIndex((t) => t.id === tpl.id)+ if (at >= 0) list[at] = tpl+ else list.push(tpl)+ doc.templates = list+}++/**+ * Remove a template.+ *+ * If it was the journal's, the SETTING GOES TOO — deleting the key rather than+ * leaving it pointing at nothing. A dangling id is not dangerous (`templateById`+ * returns undefined and the journal falls back to a blank page), but a document+ * that carries a setting naming something that does not exist is a document+ * whose next reader has to work out whether it means anything.+ */+export function removeTemplate(doc: SpacesDoc, id: string): void {+ doc.templates = templatesOf(doc).filter((t) => t.id !== id)+ if (!doc.templates.length) delete doc.templates+ if ((doc as { journalTemplate?: unknown }).journalTemplate === id) delete doc.journalTemplate+}++/**+ * Point new daily notes at a template, or at nothing.+ *+ * DEFAULT IS AN ABSENT KEY. A document where the setting was turned on and off+ * again is byte-identical to one where it never was, and a file written before+ * this feature stays that way (PLATFORM §3).+ */+export function setJournalTemplate(doc: SpacesDoc, id: string | undefined): void {+ if (id && templateById(doc, id)) doc.journalTemplate = id+ else delete doc.journalTemplate+}diff --git a/spaces/src/templateui.ts b/spaces/src/templateui.tsnew file mode 100644index 00000000..c1a9214c--- /dev/null+++ b/spaces/src/templateui.ts@@ -0,0 +1,249 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+// The surfaces for page templates: save this page as one, start a page from+// one, and the small manager that lists them.+//+// SEPARATE FROM editor.ts on purpose. editor.ts is 5,500 lines and five+// branches are editing it at once; a feature that can live behind a narrow host+// interface should. `TemplateHost` is the whole contract — the store operations+// this needs and nothing else — so this file never sees the editor's internals+// and the editor's diff for the feature is a handful of lines.+//+// The dialogs and the menu are the editor's — the kernel dialog through+// `host.dialog` and the kernel menu through `host.menu` (menus.ts) — so they+// share its Escape, focus trap, focus return, press-away and the editor's+// one-overlay rule that keeps the block keymap quiet under a modal. No new CSS:+// every class used here already exists in styles.css.++import { type Page, type SpacesDoc, newPage } from './model.ts'+import { t, locale } from './i18n.ts'+import { isJournal } from './journal.ts'+import {+ type PageTemplate, applyTemplate, makeTemplate, putTemplate, removeTemplate,+ setJournalTemplate, templatesOf, templateById,+} from './templates.ts'+import { row as menuRow, caption, type Menu } from './menus.ts'++/**+ * What this module needs from the editor, and all it may have.+ *+ * `commit` is the important one: every mutation below goes through exactly one+ * of these, so saving a template, deleting one, or making a page from one is a+ * single ⌘Z each.+ */+export interface TemplateHost {+ readonly doc: SpacesDoc+ readonly readOnly: boolean+ readonly page: Page | undefined+ commit(mutate: () => void): void+ goToPage(id: string): void+ status(msg: string): void+ /** repaint, then put the caret in the new page's title */+ afterCreate(): void+ /**+ * A page icon as SVG markup.+ *+ * Supplied by the editor rather than imported, because `pageIcon` lives in+ * editor.ts and editor.ts imports this file — importing it back would close a+ * module cycle for one label. It also matters that this is not `icon ?? ''`:+ * a page icon here is usually a NAME from the stylised set ('compass'), not+ * an emoji, so pasting the raw field into a label reads "compass Daily log".+ * Measured in the built shell, which is how it was found.+ */+ pageIcon(icon: string | undefined): string+ /** A modal — the editor's kernel dialog. `title` is its visible heading. */+ dialog(title: string, build: (body: HTMLElement, close: () => void) => void): void+ /** A menu anchored on `anchor` — the editor's kernel menu. */+ menu(anchor: HTMLElement, label: string, fill: (m: Menu) => void): void+}++const escapeHtml = (s: string): string =>+ s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')++function el<K extends keyof HTMLElementTagNameMap>(tag: K, cls: string, text?: string): HTMLElementTagNameMap[K] {+ const n = document.createElement(tag)+ if (cls) n.className = cls+ if (text) n.textContent = text+ return n+}++function button(label: string, run: () => void, primary = false): HTMLButtonElement {+ const b = document.createElement('button')+ b.type = 'button'+ b.className = primary ? 'sp-btn sp-on' : 'sp-btn'+ b.textContent = label+ b.addEventListener('click', run)+ return b+}++// ---- save a page as a template ---------------------------------------------++/**+ * Capture the page in view.+ *+ * The name field starts as the page's title, because that is right nearly every+ * time and a dialog that makes you type what it already knows is a dialog+ * people stop using.+ */+export function savePageAsTemplate(host: TemplateHost, page: Page): void {+ if (host.readOnly) return+ host.dialog(t('Save as template'), (box, close) => {+ box.append(el('p', 'sp-note', t('New pages can start as a copy of this one. The page itself is not changed.')))++ const field = el('div', 'sp-field')+ const lbl = el('label', 'sp-field-lbl', t('Template name'))+ const input = document.createElement('input')+ input.type = 'text'+ input.value = page.title || ''+ input.id = 'sp-tpl-name'+ lbl.htmlFor = input.id+ field.append(lbl, input)+ box.append(field)++ box.append(el('p', 'sp-note', t('Write {{date}} anywhere and each new page gets its own date there.')))++ const save = () => {+ const name = input.value.trim() || page.title || t('Template')+ const tpl = makeTemplate(page, name)+ host.commit(() => { putTemplate(host.doc, tpl) })+ close()+ host.status(t('Saved as a template'))+ }+ input.addEventListener('keydown', (e) => {+ if (e.key === 'Enter') { e.preventDefault(); save() }+ })++ const row = el('div', 'sp-row')+ row.append(button(t('Cancel'), close), button(t('Save template'), save, true))+ box.append(row)+ // after the dialog's own first-focus, which would land on the field anyway+ // but would not select the title in it+ setTimeout(() => { input.focus(); input.select() }, 0)+ })+}++// ---- start a page from one -------------------------------------------------++/**+ * A new page built from a template, as ONE commit.+ *+ * The page is pushed at the end of `doc.pages` exactly as `newPage` does, so+ * nothing here has an opinion about ordering that the plain path does not.+ */+export function newPageFromTemplate(host: TemplateHost, tplId: string, parent?: string): void {+ if (host.readOnly) return+ const tpl = templateById(host.doc, tplId)+ if (!tpl) { host.status(t('That template is no longer in this space')); return }+ const page = newPage(t('Untitled'))+ if (parent) page.parent = parent+ applyTemplate(page, tpl, { locale: locale() })+ host.commit(() => { host.doc.pages.push(page) })+ host.goToPage(page.id)+ host.afterCreate()+}++// ---- the manager -----------------------------------------------------------++/**+ * Every template, with what you can do to each.+ *+ * "Use for daily notes" is a RADIO across the list rather than a per-row+ * toggle, because `doc.journalTemplate` holds one id: showing it as eight+ * independent switches would let the UI depict a state the document cannot+ * hold. Clicking the one that is on turns it off (back to a blank entry), which+ * is the only way to reach "none" without a ninth control.+ */+export function openTemplates(host: TemplateHost): void {+ host.dialog(t('Templates'), (box, close) => {+ const paint = () => {+ box.innerHTML = ''+ const list = templatesOf(host.doc)+ const journalId = typeof host.doc.journalTemplate === 'string' ? host.doc.journalTemplate : ''++ if (!list.length) {+ box.append(el('p', 'sp-note',+ t('No templates yet. Open a page you would like to reuse and choose “Save as template”.')))+ }++ for (const tpl of list) {+ const row = el('div', 'sp-row')+ // NOT `sp-result-ico`: that class is `display: flex`, so it is a block+ // inside a plain span and the name wrapped under its own icon. Measured+ // in the built shell. `sp-tpl-name` is the flex parent it needed.+ const name = el('span', 'sp-tpl-name')+ name.innerHTML = `<span>${host.pageIcon(tpl.icon)}</span><span>${escapeHtml(tpl.name)}</span>`+ const acts = el('span', '')+ // A READER sees the list and no controls. `store.commit` no-ops in a+ // read-only copy, so every one of these would have been a button that+ // silently did nothing — which is worse than not offering it, because the+ // reader concludes the file is broken rather than that it is read-only.+ const isJ = journalId === tpl.id+ if (!host.readOnly) {+ acts.append(button(t('New page'), () => { close(); newPageFromTemplate(host, tpl.id) }))+ acts.append(button(isJ ? t('Daily note ✓') : t('Use for daily notes'), () => {+ host.commit(() => { setJournalTemplate(host.doc, isJ ? undefined : tpl.id) })+ paint()+ }, isJ))+ acts.append(button(t('Delete'), () => {+ if (!confirm(t('Delete the template “{name}”? Pages already made from it are not touched.', { name: tpl.name }))) return+ host.commit(() => { removeTemplate(host.doc, tpl.id) })+ paint()+ }))+ }+ row.append(name, acts)+ box.append(row)+ }++ const cur = host.page+ if (cur && !host.readOnly) {+ box.append(el('p', 'sp-note', isJournal(cur)+ ? t('A daily entry can be saved as a template too — its date is not saved with it.')+ : t('Saving a page keeps its blocks, its icon and its width.')))+ const foot = el('div', 'sp-row')+ foot.append(button(t('Save this page as a template'), () => {+ close()+ savePageAsTemplate(host, cur)+ }, true), button(t('Close'), close))+ box.append(foot)+ } else {+ const foot = el('div', 'sp-row')+ foot.append(button(t('Close'), close))+ box.append(foot)+ }+ }+ paint()+ })+}++/** The templates a "new page" menu should offer, empty when there are none. */+export const pickable = (doc: SpacesDoc): PageTemplate[] => templatesOf(doc)++/**+ * The "+" in the page list, once templates exist.+ *+ * WITH NO TEMPLATES IT DOES NOT APPEAR — it returns false and the caller makes+ * a blank page exactly as it always did. A picker whose only entry is "Blank+ * page" adds a click to the most-used control in the app in exchange for+ * nothing, and every space starts with no templates, so that would be the+ * default experience of this feature for everyone who never uses it.+ *+ * The kernel menu, anchored (menus.ts anchoredMenu): placed by measurement,+ * flipped when the room below runs out, a bottom sheet on a phone. A popover+ * hanging off the bottom of a short window is a failure this app has already+ * written down twice.+ */+export function openNewPagePicker(+ host: TemplateHost, anchor: HTMLElement, blank: () => void, parent?: string,+): boolean {+ const list = templatesOf(host.doc)+ if (!list.length) return false++ host.menu(anchor, t('New page'), (m) => {+ menuRow(m, { icon: host.pageIcon('plus'), label: t('Blank page'), run: blank })+ caption(m, t('From a template'))+ for (const tpl of list) {+ menuRow(m, { icon: host.pageIcon(tpl.icon), label: tpl.name, run: () => newPageFromTemplate(host, tpl.id, parent) })+ }+ })+ return true+}