Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

spaces: Insert is slides' insert group; new pages move to the page list's + ▾ (replaces #576) (#655)

nyblnetba30ba7f609d
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index b12d3e7a..3dda6e08 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -8645,3 +8645,53 @@ structure and puts in its own nouns. These are new strings, translated here:
These are unchanged on purpose: "Remove password…" keeps its confirmation
dialog, and "Properties" stays.
+
+## 2026-09-26 — spaces' insert tools are slides' insert group
+
+**The maintainer:** "I think having one Insert menu is the wrong shape." The
+design he approved replaces spaces' single "+ Insert" menu with slides'
+shape. That menu had 21 rows mixing block insertion, new-page actions and a
+copy of `/`.
+
+- **One button per kind, a menu only where the kind has variants.** The kinds
+ are Text ▾, Image ▾, Table, Chart, View ▾, Code, Embed, then Comment, as
+ slides ends its group. Text holds the paragraph, headings, quote, callout,
+ toggle, the three lists and the divider. Image holds image, video, audio,
+ then a link card and a page card. View holds the layouts of a saved view,
+ then Canvas. Canvas is a surface you arrange by hand, not a view of the
+ issues, and it waits there for the diagram family.
+- **One table decides it: `spaces/src/inserts.ts`.** The bar group, the folded
+ ⋯ and the `/` menu all read it, so they cannot offer different families,
+ orders or names. A family whose block type the build lacks is left out, and
+ a family left with one member is a plain button. Chart and Embed therefore
+ appear on a build that has those blocks, and Code grows a menu the day maths
+ joins it, with no other change. The diagram block will be one entry.
+- **Where a new block goes is where you are working**, as slides places a new
+ element on the slide you are on. It goes after the block holding the caret
+ (or last clicked), as that block's sibling and after anything nested in it.
+ With no caret on the page it goes at the end. It is one commit, so one undo
+ takes it away, and the caret lands in it. A page card opens its picker
+ first, so Escape inserts nothing rather than a card pointing at no page.
+- **The bar's Comment** comments on the block holding the caret, or on the
+ page. Spaces has no free-position comments, so there is no armed mode as in
+ slides.
+- **Look and tiers are slides'.** The buttons are slides' `.ed-btn`: icon and
+ word, 30px, 6px apart. The menus are slides' Shape menu. Like every other
+ label, the words go at the compact tier. At the fold tier the whole group
+ moves into ⋯: each family with variants under its caption, a rule before a
+ run of one-member kinds, then Comment. Reading view hides the group.
+- **New pages leave Insert.** New page, Today's journal and New issue are on a
+ + ▾ split at the head of the page list, with their shortcuts. + alone is
+ still New page. A page is added to the space, not inserted into the page
+ you are on.
+- `/` and the gutter + are unchanged as paths. `/` lists the same families
+ in the same order under the same names, with the same captions.
+
+Spaces' bar now folds at a wider window than slides' does. This is measured,
+not chosen: the group adds five icons to a right group that was already longer
+than slides'. `scripts/test-spaces-chrome.ts` reads slides' `.ed-btn`,
+`.ed-group`, `.ed-menu` and icon size from slides' source. It holds the insert
+buttons and menus to those values, and checks that every member lands after
+the caret's block and is undone in one step. It also checks that `/` agrees
+with the bar, that the tiers drop the words and fold the group, and that every
+command is still reachable from its new home.
diff --git a/scripts/build-spaces-i18n.mjs b/scripts/build-spaces-i18n.mjs
index 795e5b79..7362d1cd 100644
--- a/scripts/build-spaces-i18n.mjs
+++ b/scripts/build-spaces-i18n.mjs
@@ -73,11 +73,17 @@ function sweepKeys() {
// `[]`, `>`, `---`, a code fence — is what you literally type, identical in
// every locale, and demanding eight translations of `-` would be noise in
// every catalog and a lie in each one.
- const specSrc = readFileSync(join(srcDir, 'blocks.ts'), 'utf8')
+ //
+ // inserts.ts is the same kind of table: the insert families (the bar's
+ // insert group and the `/` menu's sections) carry `label`, `hint` and the
+ // button's `tip`, and every one reaches t() through a variable.
const isSyntax = (v) => /^[#`\-\[\]>0-9.\s]+$/.test(v)
- for (const m of specSrc.matchAll(/\b(?:label|hint):\s*(['"])((?:\\.|(?!\1).)*)\1/g)) {
- const v = m[2].replace(/\\'/g, "'").replace(/\\"/g, '"')
- if (v.length > 1 && !isSyntax(v)) keys.add(v)
+ for (const file of ['blocks.ts', 'inserts.ts']) {
+ const specSrc = readFileSync(join(srcDir, file), 'utf8')
+ for (const m of specSrc.matchAll(/\b(?:label|hint|tip):\s*(['"])((?:\\.|(?!\1).)*)\1/g)) {
+ const v = m[2].replace(/\\'/g, "'").replace(/\\"/g, '"')
+ if (v.length > 1 && !isSyntax(v)) keys.add(v)
+ }
}
return [...keys].sort()
diff --git a/scripts/test-spaces-chrome.ts b/scripts/test-spaces-chrome.ts
index 5d3e62ad..88c75690 100644
--- a/scripts/test-spaces-chrome.ts
+++ b/scripts/test-spaces-chrome.ts
@@ -174,6 +174,38 @@ const got = wantOrder.map((l) => SAVE_ORDER.indexOf(l))
ok(got.every((i) => i >= 0) && got.every((i, k) => k === 0 || i > got[k - 1]),
`spaces' Save menu holds slides' document commands in slides' order (${wantOrder.join(' · ')} at ${got.join(',')})`)
+// THE INSERT GROUP IS SLIDES' INSERT GROUP (DECISIONS 2026-09-26): one
+// button per kind, a menu only where the kind has variants, and ONE table of
+// families (inserts.ts) that the bar and the `/` menu both read.
+const inserts = read('inserts.ts')
+ok(/for \(const f of insertFamilies\(\)\)/.test(editor) && /const sections = insertSections\(\)/.test(editor)
+ && !/MENU_SPECS/.test(editor) && !/SLASH_ITEMS/.test(editor),
+ 'the bar\'s insert group and the / menu both come from inserts.ts — neither keeps its own list')
+ok(/export function unplacedTypes\(\)/.test(inserts) && /MENU_SPECS/.test(inserts),
+ 'inserts.ts can say which listed block types no family places (the browser half holds it to none)')
+// The block registry's LISTED types, read from blocks.ts: each spec is a
+// `type: '…', label: '…'` entry, and `unlisted: true` before the next one
+// keeps it out of every menu.
+const blocksSrc = read('blocks.ts')
+const specAt = [...blocksSrc.matchAll(/\btype: '(\w+)', label: '/g)]
+const LISTED = specAt.filter((m, i) => !/unlisted: true/.test(blocksSrc.slice(m.index, specAt[i + 1]?.index ?? blocksSrc.length))).map((m) => m[1])
+ok(LISTED.length >= 15 && LISTED.includes('p') && !LISTED.includes('prop'), `the registry's listed block types can be read from blocks.ts (${LISTED.join(', ')})`)
+// what the group should show on THIS build: Chart and Embed where those
+// blocks exist, and a Code menu once maths joins it
+const has = (t: string) => LISTED.includes(t)
+const WANT_GROUP = ['Text ▾', 'Image ▾', 'Table', ...(has('chart') ? ['Chart'] : []), 'View ▾', has('math') ? 'Code ▾' : 'Code', ...(has('embed') ? ['Embed'] : []), 'Comment']
+// slides' numbers for its insert buttons and their group, read from its stylesheet
+const SLIDES_INS = {
+ groupGap: decl(block('.ed-group'), 'gap'),
+ font: decl(edBtn, 'font-size'), pad: decl(edBtn, 'padding'), gap: decl(edBtn, 'gap'),
+ radius: decl(edBtn, 'border-radius'),
+ hover: /var\((--[a-z0-9-]+)\)/.exec(/\n\.ed-btn:hover \{ background:\s*([^;]+);/.exec(slidesCss)?.[1] ?? '')?.[1],
+ menuMin: decl(edMenu, 'min-width'),
+ // the insert buttons' icon, from slides' icon factory
+ icon: /width="(\d+)" height="\1"/.exec(readFileSync(join(root, 'slides/src/icons.ts'), 'utf8'))?.[1],
+}
+ok(Object.values(SLIDES_INS).every(Boolean), `slides' insert-button values can be read from its source (${JSON.stringify(SLIDES_INS)})`)
+
// ————— browser half ————————————————————————————————————————————————————————
console.log('\nthe built shell, driven with trusted input\n')
const CHROME = [process.env.BENTO_CHROME, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
@@ -359,24 +391,147 @@ async function browser(chrome: string, html: string): Promise<void> {
// painted bigger than a pixel.
const drawn: string[] = []
const DRAWN = `(() => { const out = []; const scope = [...document.querySelectorAll('.bkm-open > .bkm-menu, .sp-pop')].filter(e => e.getBoundingClientRect().height > 0); for (const m of scope) { for (const h of m.querySelectorAll('.bkm-hint')) if (h.getBoundingClientRect().height > 1) out.push('hint: ' + h.textContent.slice(0, 30)); for (const r of m.querySelectorAll('[aria-describedby]')) { const d = document.getElementById(r.getAttribute('aria-describedby')); const b = d?.getBoundingClientRect(); if (b && (b.width > 1 || b.height > 1)) out.push('drawn: ' + d.textContent.slice(0, 30)) } } return out })()`
- for (const trig of ['Insert a block — text, headings, lists, code, images', 'Save as… — copy, new space, password', 'Language']) {
+ for (const trig of ['Add text — a heading, a list, a quote, a callout or a divider', 'Add an image, a video, audio or a card', 'Save as… — copy, new space, password', 'Language']) {
await tap(TRIG(trig)); drawn.push(...(await js<string[]>(DRAWN)).map((x) => `${trig.split(' ')[0]} ${x}`)); await key('Escape', 0, 'Escape')
}
await tap(`document.querySelector('.sp-bar .sp-live')`); drawn.push(...(await js<string[]>(DRAWN)).map((x) => `Share ${x}`)); await key('Escape', 0, 'Escape')
- ok(drawn.length === 0, `no surface opened from the bar draws a second-line description — Insert, Save, Language, Share (${drawn.join('; ') || 'none'})`)
+ ok(drawn.length === 0, `no surface opened from the bar draws a second-line description — Text, Image, Save, Language, Share (${drawn.join('; ') || 'none'})`)
await tap(SAVEM)
- await tap(`[...document.querySelectorAll('.sp-bar button')].find(b => (b.getAttribute('aria-label') || '').startsWith('Insert'))`)
+ await tap(`document.querySelector('.sp-group-insert .bkm-trigger')`)
const exclusive = await js<number>(`document.querySelectorAll('.bkm-open').length`)
- ok(exclusive === 1, `opening Insert shuts Save ▾ — one menu open at a time (${exclusive} open)`)
- const im = await js<any>(`(() => { const m = ${OPEN}; const row = [...m.querySelectorAll('.bkm-item')][0]; const kids = [...m.children]; const sep = kids.findIndex(c => c.classList.contains('bkm-sep')); return { font: getComputedStyle(row.querySelector('.bkm-text')).fontSize, h: Math.round(row.getBoundingClientRect().height), tail: kids.slice(sep + 1, sep + 4).map(r => r.querySelector('.bkm-text')?.textContent) } })()`)
- ok(im.font === SLIDES_MENU.rowFont && im.h === 30, `Insert's rows are slides' command rows, ${SLIDES_MENU.rowFont} and 30px (${im.font}, ${im.h}px)`)
- ok(JSON.stringify(im.tail) === JSON.stringify(['New page', "Today's journal", 'New issue']), `+ Insert ends, after a rule, on the pages you can add (${im.tail.join(' · ')})`)
- const ins = await js<any>(`(() => { const r = (${OPEN}).getBoundingClientRect(); return { bottom: Math.round(r.bottom), vh: innerHeight } })()`)
- ok(ins.bottom <= ins.vh, `the Insert menu fits a 1440×900 window (bottom ${ins.bottom} ≤ ${ins.vh}; it ran to 910 before)`)
+ ok(exclusive === 1, `opening Text ▾ shuts Save ▾ — one menu open at a time (${exclusive} open)`)
await click(900, 700)
ok(!(await js<boolean>(`!!(${OPEN})`)), 'a press outside closes the menu')
+ // ——— the insert group is slides' insert group ———
+ const GROUP = `document.querySelector('.sp-bar .sp-group-insert')`
+ // the group's buttons, in order: a direct button carries its item's key; a
+ // menu's trigger is named by its family
+ const gm = await js<any>(`(() => { const g = ${GROUP}; const bs = [...g.querySelectorAll(':scope > button, :scope > .bkm > .bkm-trigger')]
+ const c = (e) => getComputedStyle(e)
+ return { gap: c(g).columnGap, btns: bs.map(b => ({ name: (b.getAttribute('aria-label') || '').split(' — ')[0], label: b.querySelector('.sp-btnlabel')?.textContent, menu: b.classList.contains('bkm-trigger'),
+ font: c(b).fontSize, pad: c(b).padding, gap: c(b).columnGap, radius: c(b).borderTopLeftRadius, h: Math.round(b.getBoundingClientRect().height),
+ icon: Math.round(b.querySelector('svg')?.getBoundingClientRect().width ?? 0) })) } })()`)
+ const labels = gm.btns.map((b: any) => b.label)
+ void labels
+ ok(JSON.stringify(gm.btns.map((b: any) => b.label + (b.menu ? ' ▾' : ''))) === JSON.stringify(WANT_GROUP),
+ `the bar's insert group is one button per kind, a menu only where the kind has variants, Comment last (${gm.btns.map((b: any) => b.label + (b.menu ? ' ▾' : '')).join(' · ')})`)
+ const insOff = gm.btns.flatMap((b: any) => [
+ b.font !== SLIDES_INS.font && `${b.label} font ${b.font}`, b.pad !== SLIDES_INS.pad && `${b.label} padding ${b.pad}`,
+ b.gap !== SLIDES_INS.gap && `${b.label} gap ${b.gap}`, b.radius !== SLIDES_INS.radius && `${b.label} radius ${b.radius}`,
+ b.h !== 30 && `${b.label} ${b.h}px tall`, String(b.icon) !== SLIDES_INS.icon && `${b.label} icon ${b.icon}px`,
+ ]).filter(Boolean)
+ if (gm.gap !== SLIDES_INS.groupGap) insOff.push(`group gap ${gm.gap}`)
+ ok(insOff.length === 0, `every insert button is slides' .ed-btn — ${SLIDES_INS.font}, ${SLIDES_INS.pad}, gap ${SLIDES_INS.gap}, radius ${SLIDES_INS.radius}, 30px, a ${SLIDES_INS.icon}px icon — ${SLIDES_INS.groupGap} apart as .ed-group (${insOff.join('; ') || 'all match'})`)
+ // …and slides' hover: the fill is the same token slides' .ed-btn:hover names
+ const hp = await at(`${GROUP}.querySelector('button[data-insert="table"]')`)
+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: hp!.x, y: hp!.y })
+ await sleep(150)
+ const hov = await js<any>(`(() => { const b = ${GROUP}.querySelector('button[data-insert="table"]'); const probe = document.createElement('i'); probe.style.background = 'var(${SLIDES_INS.hover})'; document.body.append(probe); const want = getComputedStyle(probe).backgroundColor; probe.remove(); return { got: getComputedStyle(b).backgroundColor, want } })()`)
+ ok(hov.got === hov.want && hov.want !== 'rgba(0, 0, 0, 0)', `an insert button's hover fills with slides' ${SLIDES_INS.hover} (${hov.got}; want ${hov.want})`)
+ await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 900, y: 700 })
+
+ // Each menu is slides' Shape menu: 30px rows of 13px words, 4px inside, at
+ // least as wide as .ed-menu, and it fits the window.
+ const famRows: Record<string, string[]> = {}
+ const barCaps: string[] = []
+ const barSeq: string[] = []
+ const menuOff: string[] = []
+ for (const b of gm.btns) {
+ if (b.label === 'Comment') continue
+ if (!b.menu) { barSeq.push(await js<string>(`${GROUP}.querySelector('button[aria-label^=${JSON.stringify(b.name)}]').dataset.insert`)); continue }
+ await tap(`[...${GROUP}.querySelectorAll('.bkm-trigger')].find(t => t.getAttribute('aria-label').startsWith(${JSON.stringify(b.name)}))`)
+ const mm2 = await js<any>(`(() => { const m = ${OPEN}; const r = m.getBoundingClientRect(); const rows = [...m.querySelectorAll('.bkm-item')]; const c = getComputedStyle(m)
+ return { keys: rows.map(x => x.dataset.insert), names: rows.map(x => x.querySelector('.bkm-text').textContent), pad: c.padding, w: r.width, bottom: r.bottom, vh: innerHeight,
+ font: [...new Set(rows.map(x => getComputedStyle(x.querySelector('.bkm-text')).fontSize))], h: [...new Set(rows.map(x => Math.round(x.getBoundingClientRect().height)))] } })()`)
+ famRows[b.label] = mm2.names
+ barCaps.push(b.label)
+ barSeq.push(...mm2.keys)
+ if (mm2.pad !== SLIDES_MENU.pad || mm2.w < parseFloat(SLIDES_INS.menuMin!) || mm2.bottom > mm2.vh || mm2.font.join() !== SLIDES_INS.font || mm2.h.join() !== '30')
+ menuOff.push(`${b.label}: ${JSON.stringify({ pad: mm2.pad, w: mm2.w, bottom: mm2.bottom, font: mm2.font, h: mm2.h })}`)
+ await key('Escape', 0, 'Escape')
+ }
+ ok(menuOff.length === 0 && barCaps.length === WANT_GROUP.filter((g) => g.endsWith('▾')).length, `Text ▾, Image ▾ and View ▾ are slides' Shape menu: ${SLIDES_MENU.pad} inside, ≥ ${SLIDES_INS.menuMin} wide, 30px rows at ${SLIDES_INS.font}, inside the window (${menuOff.join('; ') || barCaps.join(', ')})`)
+ ok(JSON.stringify(famRows.Text) === JSON.stringify(['Text', 'Heading 1', 'Heading 2', 'Heading 3', 'Quote', 'Callout', 'Toggle', 'Bulleted list', 'Numbered list', 'To-do', 'Divider']) &&
+ JSON.stringify(famRows.Image) === JSON.stringify(['Image', 'Video', 'Audio', 'Link card', 'Link to page']) &&
+ JSON.stringify(famRows.View?.slice(0, 4)) === JSON.stringify(['Board', 'List', 'Table view', 'Gallery']) && famRows.View?.at(-1) === 'Canvas',
+ `the families hold the approved members, in order (Text: ${famRows.Text?.join(', ')} | Image: ${famRows.Image?.join(', ')} | View: ${famRows.View?.join(', ')})`)
+
+ // THE / MENU AGREES: same members, same order, same names, the same captions
+ const pageBlocks = `(() => { const id = document.querySelector('.sp-treelink.sp-here').getAttribute('href').split('/')[1]; return window.bento.getPage(id).blocks })()`
+ const firstP = await js<string>(`${pageBlocks}.find(b => b.type === 'p' && !b.parent).id`)
+ const pristine = await js<string>(`JSON.stringify(${pageBlocks}.map(b => b.id))`)
+ await js(`(() => { const h = document.querySelector('.sp-main [data-edit="${firstP}"]'); h.focus(); const r = document.createRange(); r.selectNodeContents(h); r.collapse(false); const s = getSelection(); s.removeAllRanges(); s.addRange(r) })()`)
+ await key('Enter', 0, 'Enter', 13)
+ await key('/', 0, 'Slash', 191)
+ await sleep(300)
+ const slash = await js<any>(`(() => { const p = [...document.querySelectorAll('.sp-pop')].find(x => x.getBoundingClientRect().height > 0); if (!p) return null
+ return { keys: [...p.querySelectorAll('.sp-result')].map(b => b.dataset.insert), names: Object.fromEntries([...p.querySelectorAll('.sp-result')].map(b => [b.dataset.insert, b.querySelector('strong').textContent])),
+ caps: [...p.querySelectorAll('.sp-results-cap')].map(c => c.textContent) } })()`)
+ await key('Escape', 0, 'Escape')
+ for (let i = 0; i < 6 && (await js<string>(`JSON.stringify(${pageBlocks}.map(b => b.id))`)) !== pristine; i++) await js(`window.bento.undo(); 1`)
+ const sameNames = Object.entries(famRows).every(([, names]) => names.every((n) => Object.values(slash?.names ?? {}).includes(n)))
+ ok(!!slash && JSON.stringify(slash.keys) === JSON.stringify(barSeq) && JSON.stringify(slash.caps) === JSON.stringify(barCaps) && sameNames,
+ `the / menu lists the bar's families: the same members in the same order under the same names, captioned where the bar has a menu (bar ${barSeq.join(',')} | / ${slash?.keys?.join(',')} | captions ${slash?.caps?.join(', ')})`)
+ const slashTypes = new Set((slash?.keys ?? []).map((k: string) => k.split(':')[0]))
+ const homeless = LISTED.filter((t) => !slashTypes.has(t))
+ ok(!!slash && homeless.length === 0 && slash.keys.length === new Set(slash.keys).size,
+ `every block type the registry lists has a place in a family, and no member is listed twice (${slash?.keys?.length} members; no place: ${homeless.join(', ') || 'none'})`)
+
+ // EVERY INSERT GOES AFTER THE BLOCK HOLDING THE CARET, AS ONE UNDO STEP,
+ // and the caret lands in it where it has somewhere to land.
+ const TEXTUAL = new Set(['p', 'h1', 'h2', 'h3', 'quote', 'callout', 'toggle', 'bullet', 'number', 'todo', 'code'])
+ const placed: string[] = []
+ for (const k of barSeq) {
+ const before = await js<any[]>(`${pageBlocks}.map(b => b.id)`)
+ await js(`(() => { const h = document.querySelector('.sp-main [data-edit="${firstP}"]'); h.focus(); return 1 })()`)
+ const direct = await js<boolean>(`!!${GROUP}.querySelector(':scope > button[data-insert="${k}"]')`)
+ if (direct) await tap(`${GROUP}.querySelector(':scope > button[data-insert="${k}"]')`)
+ else {
+ const fam = await js<string>(`(() => { for (const m of ${GROUP}.querySelectorAll('.bkm')) { m.querySelector('.bkm-trigger').click(); const hit = !!m.querySelector('.bkm-item[data-insert="${k}"]'); document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true })); if (hit) return m.querySelector('.bkm-trigger').getAttribute('aria-label') } return null })()`)
+ await tap(`[...${GROUP}.querySelectorAll('.bkm-trigger')].find(t => t.getAttribute('aria-label') === ${JSON.stringify(fam)})`)
+ await tap(`(${OPEN}).querySelector('.bkm-item[data-insert="${k}"]')`)
+ }
+ // a page card asks which page first: take the first one offered
+ if (k === 'pagelink' || k === 'embed') await tap(`[...document.querySelectorAll('[aria-modal="true"] .sp-result')][0]`)
+ await sleep(150)
+ const after = await js<any>(`(() => { const bs = ${pageBlocks}; const ae = document.activeElement?.closest?.('[data-block-id]')?.dataset.blockId; return { ids: bs.map(b => b.id), types: bs.map(b => b.type), layout: bs.map(b => b.layout ?? null), kind: bs.map(b => b.kind ?? null), ae } })()`)
+ const fresh = after.ids.filter((i: string) => !before.includes(i))
+ const at = after.ids.indexOf(fresh[0])
+ const type = after.types[at]
+ const wantType = k.split(':')[0]
+ const variant = k.split(':')[1]
+ const variantOk = !variant || (wantType === 'view' ? (variant === 'board' ? after.layout[at] === null : after.layout[at] === variant) : after.kind[at] === variant)
+ const focusOk = !TEXTUAL.has(type) || after.ae === fresh[0]
+ // Escape whatever it opened (the link card), then one undo
+ await key('Escape', 0, 'Escape')
+ await js(`document.querySelector('.sp-main').focus?.(); 1`)
+ await tap(`document.querySelector('.sp-bar button[aria-label^="Undo"]')`)
+ const undone = await js<any[]>(`${pageBlocks}.map(b => b.id)`)
+ const good = fresh.length === 1 && after.ids[at - 1] === firstP && type === wantType && variantOk && focusOk && JSON.stringify(undone) === JSON.stringify(before)
+ if (!good) placed.push(`${k}: ${JSON.stringify({ fresh: fresh.length, prev: after.ids[at - 1] === firstP, type, variantOk, focusOk, undone: JSON.stringify(undone) === JSON.stringify(before) })}`)
+ }
+ ok(placed.length === 0 && barSeq.length >= 20, `each of the ${barSeq.length} bar inserts lands right after the caret's block, is the member it names, takes the caret where it can, and one undo removes it (${placed.join('; ') || 'all'})`)
+ // …with no caret on the page, at the end
+ await js(`(() => { const m = document.querySelector('.sp-main'); m.dispatchEvent(new MouseEvent('mousedown', { bubbles: true })); document.activeElement?.blur?.(); return 1 })()`)
+ await tap(`${GROUP}.querySelector('button[data-insert="table"]')`)
+ const endIns = await js<any>(`(() => { const bs = ${pageBlocks}; return { lastType: bs.at(-1).type } })()`)
+ await key('Escape', 0, 'Escape')
+ await tap(`document.querySelector('.sp-bar button[aria-label^="Undo"]')`)
+ ok(endIns.lastType === 'table', `with no caret on the page a new block goes at the end (${endIns.lastType})`)
+
+ // New pages are on the page list's + ▾, with their shortcuts; + alone is New page
+ await tap(`document.querySelector('.sp-side .sp-newmenu > .bkm-trigger')`)
+ const np = await js<any>(`(() => { const m = ${OPEN}; if (!m) return null; return [...m.querySelectorAll('.bkm-item')].map(r => r.querySelector('.bkm-text').textContent + ' ' + (r.querySelector('.sp-mkbd')?.textContent ?? '')) })()`)
+ await key('Escape', 0, 'Escape')
+ const plusTip = await js<string>(`document.querySelector('.sp-side .sp-newpage').getAttribute('aria-label')`)
+ // (a build with templates adds Templates… after these three)
+ ok(JSON.stringify(np?.slice(0, 3)) === JSON.stringify(['New page ⌥⌘N', "Today's journal ⇧⌘J", 'New issue ⇧⌘I']) && (np?.slice(3) ?? []).every((r: string) => /^Templates/.test(r)) && /^New page/.test(plusTip),
+ `the page list's + ▾ holds the ways a page arrives, with their shortcuts, and + itself is New page (${JSON.stringify(np)}; + "${plusTip}")`)
+ const pagesInBar = await js<boolean>(`[...document.querySelectorAll('.sp-bar .bkm-item, .sp-bar button')].some(b => /New page|Today's journal|New issue/.test(b.textContent))`)
+ ok(!pagesInBar, 'no new-page command is left in the top bar')
+
// the leak, stated as the user met it
const grip = `(() => { const n = document.querySelectorAll('.sp-main [data-block-id]')[2]; return [...n.querySelectorAll('button')].find(b => b.getAttribute('aria-label') === 'Block options') })()`
for (let i = 0; i < 5; i++) {
@@ -561,8 +716,8 @@ async function browser(chrome: string, html: string): Promise<void> {
ok(langs && langs.n >= 8 && langs.names.includes('English') && langs.names.includes('Deutsch') && langs.on.length === 1 && langs.on[0] === 'English',
`the globe opens the language list, the one in force checked (${JSON.stringify(langs)})`)
await tap(`[...(${OPEN}).querySelectorAll('.bkm-item')].find(b => b.textContent.trim() === 'Deutsch')`)
- const de = await js<any>(`({ lang: document.documentElement.lang, insert: document.querySelector('.sp-bar .sp-group-insert .sp-btnlabel')?.textContent, share: !!document.querySelector('.sp-bar .sp-live') })`)
- ok(de.lang === 'de' && de.insert === 'Einfügen' && de.share,
+ const de = await js<any>(`({ lang: document.documentElement.lang, insert: document.querySelectorAll('.sp-bar .sp-group-insert .sp-btnlabel')[1]?.textContent, share: !!document.querySelector('.sp-bar .sp-live') })`)
+ ok(de.lang === 'de' && de.insert === 'Bild' && de.share,
`choosing Deutsch rebuilds the bar in German and keeps the Share control (${JSON.stringify(de)})`)
await tap(`document.querySelector('.sp-bar .sp-lang > button')`)
await tap(`[...(${OPEN}).querySelectorAll('.bkm-item')].find(b => b.textContent.trim() === 'English')`)
@@ -612,6 +767,36 @@ async function browser(chrome: string, html: string): Promise<void> {
if (w <= 700 && !r.fold) over.push(`${w}:unfolded`)
}
ok(over.length === 0 && foldAt > 0, `the fold tier engages before the bar overflows (first fold at ${foldAt}px; ${over.join(' ') || 'no overflow unfolded'})`)
+ // THE INSERT GROUP FOLLOWS THE TIERS AS SLIDES' DOES: its words go at the
+ // compact tier with every other label, and at the fold the whole group
+ // moves into ⋯, each family with variants under its caption.
+ const tierAt = async (w: number) => {
+ await send('Emulation.setDeviceMetricsOverride', { width: w, height: 900, deviceScaleFactor: 1, mobile: false })
+ await sleep(150)
+ return js<any>(`(() => { const b = ${BAR}; const g = b.querySelector('.sp-group-insert'); return { tier: [...b.classList].filter(c => /compact|tight|fold/.test(c)).join(' '),
+ shown: getComputedStyle(g).display !== 'none', words: [...g.querySelectorAll('.sp-btnlabel')].filter(l => l.getBoundingClientRect().width > 0).length,
+ icons: [...g.querySelectorAll('svg')].filter(i => i.getBoundingClientRect().width > 0).length } })()`)
+ }
+ let compactSeen: any = null, foldSeen: any = null, fullSeen: any = null
+ for (let w = 1440; w >= 720 && !(compactSeen && foldSeen); w -= 20) {
+ const r = await tierAt(w)
+ if (!r.tier) fullSeen ??= { w, ...r }
+ else if (/compact/.test(r.tier) && !/fold/.test(r.tier)) compactSeen ??= { w, ...r }
+ else if (/fold/.test(r.tier)) foldSeen ??= { w, ...r }
+ }
+ ok(!!fullSeen && fullSeen.words === 6 && !!compactSeen && compactSeen.words === 0 && compactSeen.icons === 6,
+ `the insert words go with every label at the compact tier, the icons stay (full ${JSON.stringify(fullSeen)}; compact ${JSON.stringify(compactSeen)})`)
+ ok(!!foldSeen && !foldSeen.shown, `at the fold tier the insert group leaves the bar (${JSON.stringify(foldSeen)})`)
+ await send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 2, mobile: true })
+ await sleep(250)
+ await tap(TRIG('More actions'))
+ const foldMenu = await js<any>(`(() => { const m = ${OPEN}; return { caps: [...m.querySelectorAll('.sp-menu-label')].map(c => c.textContent), keys: [...m.querySelectorAll('.bkm-item[data-insert]')].map(r => r.dataset.insert), comment: [...m.querySelectorAll('.bkm-item')].some(r => r.textContent.trim() === 'Comment') } })()`)
+ await key('Escape', 0, 'Escape')
+ ok(JSON.stringify(foldMenu.caps.slice(0, 3)) === JSON.stringify(barCaps) && JSON.stringify(foldMenu.keys) === JSON.stringify(barSeq) && foldMenu.comment,
+ `folded, ⋯ carries the whole insert group — the same members in order under the same captions, and Comment (${foldMenu.caps.join(', ')}; ${foldMenu.keys.length} members)`)
+ await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false })
+ await send('Emulation.setTouchEmulationEnabled', { enabled: false, maxTouchPoints: 1 })
+ await sleep(250)
// …and under browser zoom, where the viewport is wide but the bar is not: the
// phone rule cannot fire, so only MEASURING folds it (150%, 1440 → 720).
await js(`document.documentElement.style.zoom = '1.5'; 1`)
@@ -669,7 +854,10 @@ async function browser(chrome: string, html: string): Promise<void> {
const ALIAS: Record<string, string> = { 'Set a password…': 'Encrypt with password…', 'Export as Markdown': 'Export as Markdown…',
// slides' labels, adopted 2026-09-26 (the walk keeps a name up to its first " (" or " — ")
'About this space': 'About bento/spaces', 'Keyboard shortcuts': 'Shortcuts & tips', 'More': 'More actions',
- 'Other ways to save': 'Save as…', 'Print or save as PDF': 'Export PDF', 'Duplicate as a new space…': 'Duplicate as new space…' }
+ 'Other ways to save': 'Save as…', 'Print or save as PDF': 'Export PDF', 'Duplicate as a new space…': 'Duplicate as new space…',
+ // the one Insert menu became slides' insert group (2026-09-26): its
+ // trigger is a container, not a command, and its rows took family names
+ 'Insert a block': 'Text', 'Video or audio': 'Video', 'Link to the web': 'Link card', 'Board or list': 'Board' }
const WALK = `(async () => {
const sleep = (ms) => new Promise((r) => setTimeout(r, ms))
const vis = (e) => { const r = e.getBoundingClientRect(); if (r.width < 1 || r.height < 1) return false; for (let n = e; n; n = n.parentElement) { const c = getComputedStyle(n); if (c.display === 'none' || c.visibility === 'hidden') return false } return true }
@@ -678,7 +866,13 @@ async function browser(chrome: string, html: string): Promise<void> {
const out = {}
const add = (where, label) => { label = name(label); if (label && !out[label]) out[label] = where }
const bar = document.querySelector('.sp-bar')
- for (const b of bar.querySelectorAll('button')) if (vis(b) && !b.closest('.bkm-menu')) add('bar', b.getAttribute('aria-label') || b.title || b.textContent)
+ for (const b of bar.querySelectorAll('button')) if (vis(b) && !b.closest('.bkm-menu')) {
+ add('bar', b.getAttribute('aria-label') || b.title || b.textContent)
+ // an insert button is also known by its word ("Table" beside "Add a table — …")
+ const word = b.querySelector('.sp-btnlabel')?.textContent
+ // (the button is on the bar at every tier above the fold, its word or not)
+ if (word) add('bar', word)
+ }
for (const tr of [...bar.querySelectorAll('.bkm > .bkm-trigger')].filter(vis)) {
tr.click(); await sleep(60)
for (const r of tr.parentElement.querySelector(':scope > .bkm-menu').querySelectorAll('.bkm-item')) add('menu', r.querySelector('.bkm-text')?.textContent || '')
@@ -686,6 +880,11 @@ async function browser(chrome: string, html: string): Promise<void> {
}
const more = document.querySelector('.sp-treelink.sp-here .sp-rowmore')
if (more) { more.click(); await sleep(80); const m = [...document.querySelectorAll('.sp-mn-anchored .bkm-menu')].pop(); if (m) for (const r of m.querySelectorAll('.bkm-item')) add('page menu', r.querySelector('.bkm-text')?.textContent || ''); esc(); await sleep(60) }
+ // the page list's + ▾ (a drawer on a phone: open it from the bar first)
+ if (!vis(document.querySelector('.sp-side .sp-newmenu > .bkm-trigger') || document.body)) [...bar.querySelectorAll('button')].find(b => (b.getAttribute('aria-label') || '').startsWith('Pages'))?.click()
+ await sleep(250)
+ const nt = document.querySelector('.sp-side .sp-newmenu > .bkm-trigger')
+ if (nt && vis(nt)) { add('page list', nt.getAttribute('aria-label')); nt.click(); await sleep(80); for (const r of nt.parentElement.querySelectorAll(':scope > .bkm-menu .bkm-item')) add('page list menu', r.querySelector('.bkm-text')?.textContent || ''); esc(); await sleep(60) }
document.querySelector('.sp-mark').click(); await sleep(250)
const d = [...document.querySelectorAll('[aria-modal="true"]')].pop()
if (d) for (const b of d.querySelectorAll('button')) add('About', b.textContent)
@@ -696,6 +895,9 @@ async function browser(chrome: string, html: string): Promise<void> {
await open(w < 700)
const now = await js<Record<string, string>>(WALK)
const lost = BEFORE[w].filter((c) => !((ALIAS[c] ?? c) in now))
+ // …and the new homes are what reach them: the pages from the page list
+ for (const c of ['New page', "Today's journal", 'New issue']) if (!/^page list/.test(now[c] ?? '')) lost.push(`${c} (not on the page list's + ▾: ${now[c]})`)
+ for (const c of ['Audio', 'Gallery', 'List', 'Table view', 'Comment']) if (!(c in now)) lost.push(`${c} (new member unreachable)`)
ok(lost.length === 0, `at ${w}px every command reachable before is reachable now (${BEFORE[w].length} checked${lost.length ? '; LOST: ' + lost.join(', ') : ''})`)
}
ws.close()
diff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.ts
index df2955f5..2efd4c05 100644
--- a/scripts/test-spaces-model.ts
+++ b/scripts/test-spaces-model.ts
@@ -726,7 +726,9 @@ for (const [label, input, err] of [
// whatever the loop variable is called — spec, item, i. The BRACKET form
// is what stays flagged, because that is the shape that has actually
// shipped English three times.
- if (/\.(label|hint)$/.test(e)) continue
+ // inserts.ts is swept the same way (`label:`/`hint:`/`tip:`), and a
+ // section's caption IS its family's label
+ if (/\.(label|hint|tip|caption)$/.test(e)) continue
offenders.push(`${f}: t(${e.slice(0, 40)})`)
}
}
@@ -1007,7 +1009,10 @@ for (const [label, input, err] of [
ok(/import \{[^}]*\bTAG_OF\b[^}]*\bLIST_OF\b[^}]*\} from '\.\/blocks'/.test(ren) &&
!/const TAG_OF: Record/.test(ren) && !/const LIST_OF: Record/.test(ren),
'render.ts derives its tag and list maps rather than repeating them')
- ok(/const SLASH_ITEMS = MENU_SPECS/.test(ed), 'the / menu is the registry')
+ // the / menu is the registry, through the insert families (inserts.ts),
+ // which filter MENU_SPECS and are held to place every listed type
+ ok(/const sections = insertSections\(\)/.test(ed) && /import \{[^}]*\bMENU_SPECS\b[^}]*\} from '\.\/blocks\.ts'/.test(read('inserts.ts')),
+ 'the / menu is the registry, through inserts.ts')
ok(/const AUTOFORMAT = MD_SPECS/.test(ed), 'autoformat is the registry')
ok(/SPEC\.get\(b\.type\)/.test(ab) && !/case 'bullet': out\.push/.test(ab),
'markdown export is the registry, not a parallel switch')
@@ -3237,7 +3242,7 @@ function fsTable(f: string): string {
const sweep = fs.readFileSync(new URL('../scripts/build-spaces-i18n.mjs', import.meta.url), 'utf8')
const packed = fs.readFileSync(new URL('../spaces/src/i18n/packed.ts', import.meta.url), 'utf8')
- ok(/blocks\.ts'\)/.test(sweep) && /label\|hint/.test(sweep),
+ ok(/'blocks\.ts', 'inserts\.ts'/.test(sweep) && /label\|hint/.test(sweep),
'the key sweep reads block spec labels and hints, not only literal t() calls')
for (const label of ['Bulleted list', 'Callout', 'Board or list', 'Video or audio']) {
ok(packed.includes(JSON.stringify(label)),
diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.md
index 773802c1..4d73b6d1 100644
--- a/spaces/CHANGELOG.md
+++ b/spaces/CHANGELOG.md
@@ -671,6 +671,22 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.
"Duplicate as new space…". The translations are slides' own wherever slides
has the same string.
+- **Insert is slides' insert group.** The single + Insert menu is gone.
+ The bar now has one button per kind of thing: Text ▾, Image ▾, Table,
+ View ▾, Code and Comment. Chart and Embed appear on builds that have those
+ blocks. A kind with variants opens a small menu of them, for example
+ headings, lists, quote, callout, toggle and divider under Text, or Board,
+ List, Table view, Gallery and Canvas under View. Video and Audio are now
+ separate rows.
+ - **A new block goes after the one you are in**, not at the foot of the
+ page. The caret lands in it, and one undo removes it. With no caret it
+ goes at the end.
+ - **New page, Today's journal and New issue** moved to a + ▾ beside the page
+ list's +, with their shortcuts. + is still New page.
+ - The labels hide on a narrower window as slides' do. On a phone, the
+ whole group is in ⋯, under captions. The `/` menu lists the same families
+ in the same order, with the same captions.
+
## [0.1.0] — 2026-08-03
First release.
diff --git a/spaces/src/editor.ts b/spaces/src/editor.ts
index ec0158f9..8587319c 100644
--- a/spaces/src/editor.ts
+++ b/spaces/src/editor.ts
@@ -23,7 +23,8 @@ import { CODE_LANGS, langLabel, normLang } from './highlight'
import { canonicalize, escText, sanitizeInline, textOf } from './sanitize'
import { FormatBar } from './formatbar'
import type { MarkTag } from './marks'
-import { MENU_SPECS, MD_SPECS, SPEC, CALLOUT_TONES } from './blocks'
+import { MD_SPECS, SPEC, CALLOUT_TONES } from './blocks'
+import { insertFamilies, insertSections, type InsertItem } from './inserts.ts'
import {
fieldByKey, fieldsOf, propHtml, propBlock, propBlockOf, isIssue, headerLength,
reorderPages, columnMoves, ISSUE_FIELDS, withField, freeFieldKey, fieldTypeLabel, FIELD_TYPES,
@@ -64,7 +65,6 @@ const CTRL = navigator.platform.toLowerCase().includes('mac') ? 'metaKey' : 'ctr
// trigger that no menu mentions.
const AUTOFORMAT = MD_SPECS
-const SLASH_ITEMS = MENU_SPECS
/**
* Below this width both side panels are DRAWERS over the page, not columns.
* One number, handed to the kernel panel as `drawerBelow` (D6: the breakpoint
@@ -177,6 +177,8 @@ export class Editor {
private inspClosed = true
/** the block the panel is describing: the last one the caret or a click was in */
private inspOn: string | null = null
+ /** the page list's + ▾ menu, rebuilt with the list (destroy the last one) */
+ private newPageMenu: Menu | null = null
/** review threads — markers in the end margin, badges in the tree */
private comments: CommentsUi
private format!: FormatBar
@@ -316,44 +318,27 @@ export class Editor {
})
this.statusEl = el('span', 'sp-status')
- // insert — the block menu, reachable without knowing "/" exists
- // A COMMAND LIST, so one line a row (D2): the name says what it is. The
- // markdown trigger that makes the same block is its shortcut, shown where
- // shortcuts go (D8); a hint that is a description rather than a key is not
- // repeated here — it is still on the / menu, which is the place you learn.
- const insert = barMenu({
- icon: ICONS.plus, label: t('Insert'), tip: t('Insert a block — text, headings, lists, code, images'),
- scroll: true,
- fill: (m) => {
- for (const item of SLASH_ITEMS) {
- row(m, { icon: ICONS[item.icon], label: t(item.label), kbd: mdTrigger(item.hint), run: () => {
- const page = this.store.page
- if (!page) return
- const fresh = newBlock(item.type === 'pagelink' ? 'p' : item.type)
- SPEC.get(fresh.type)?.init?.(fresh)
- this.store.commit(() => { page.blocks.push(fresh) })
- this.paintPage()
- if (item.type === 'pagelink') this.insertPageCard(fresh.id)
- // the block is already a `link` — dismissing the dialog leaves an
- // empty card with its own way back in, never a half-made block
- else if (item.type === 'link') this.openLinkCard(fresh.id)
- else if (item.type === 'image') void this.pickImage(fresh.id)
- // a table has no block-level host to focus — the caret belongs in the
- // first cell, which is also where a person starts typing
- else if (item.type === 'table') this.focusCell(fresh.id, 0, 0)
- // straight to the picker, exactly like Image. Cancelling is not a
- // dead end: the block renders its own chooser (render.ts 'media'),
- // which is also the only route the / menu needs.
- else if (item.type === 'media') void this.pickMedia(fresh.id)
- else this.focusBlock(fresh.id)
- } })
+ // THE INSERT GROUP — slides' shape (DECISIONS 2026-09-26): one button per
+ // kind of thing, each opening a small menu only when the kind has variants,
+ // and Comment last, as slides ends its group. The families are inserts.ts,
+ // which the / menu reads too, so the two cannot offer different things.
+ // New pages are not inserted into a page: they are on the page list's + ▾.
+ const insertGroup = el('div', 'sp-group sp-group-insert')
+ for (const f of insertFamilies()) {
+ if (f.items.length === 1) {
+ const item = f.items[0]
+ const b = labelBtn(ICONS[f.icon], t(f.label), t(f.tip), () => this.insertItem(item))
+ b.dataset.insert = item.key
+ insertGroup.append(b)
+ continue
}
- // …and after a rule, the other thing you add: a PAGE. Slides' insert
- // group ends on Comment, the one tool that is not an element; these are
- // spaces' equivalents, with their shortcuts (D8).
- m.separator()
- this.pageRows(m)
- } }).root
+ insertGroup.append(barMenu({
+ icon: ICONS[f.icon], label: t(f.label), tip: t(f.tip), className: 'sp-insmenu',
+ fill: (m) => this.insertRows(m, f.items),
+ }).root)
+ }
+ insertGroup.append(labelBtn(ICONS.comment, t('Comment'), t('Comment — on the block with the caret, or on this page'),
+ () => this.commentHere()))
this.undoB = iconBtn('undo', t('Undo (⌘Z)'), () => { this.store.undo(); this.repaint() })
this.redoB = iconBtn('redo', t('Redo (⇧⌘Z)'), () => { this.store.redo(); this.repaint() })
@@ -367,7 +352,9 @@ export class Editor {
// · Save ▾ carries everything that acts on the FILE: copy, duplicate,
// export, password, then the timeline and the JSON round trip
// (doccmds.ts, in slides' order).
- // · + Insert carries what you add: blocks, and after a rule, pages.
+ // · The insert group carries what you add to a page, one button per
+ // kind, as slides' does (inserts.ts); new PAGES are on the page
+ // list's + ▾, because a page is added to the space, not to a page.
// · ⋯ exists only once the bar has FOLDED, as slides' does: the bar
// controls it had to give up, in slides' order, then the Save list.
// · About is reached from the wordmark, as in slides.
@@ -425,6 +412,18 @@ export class Editor {
run: () => { this.store.undo(); this.repaint() } })
row(m, { icon: ICONS.redo, label: t('Redo'), kbd: keys('shift', 'mod', 'Z'), off: !this.store.canRedo,
run: () => { this.store.redo(); this.repaint() } })
+ // …then the insert group, folded: each family with variants under its
+ // caption, the one-member kinds set apart by a rule (inserts.ts), and
+ // Comment last, as the group ends in the bar
+ if (this.canInsert()) {
+ for (const sec of insertSections()) {
+ if (sec.caption) caption(m, t(sec.caption))
+ else if (sec.rule) m.separator()
+ this.insertRows(m, sec.items)
+ }
+ row(m, { icon: ICONS.comment, label: t('Comment'), run: () => this.commentHere() })
+ m.separator()
+ }
row(m, { icon: ICONS.panelRight, label: t('Properties'), kbd: ']', run: () => this.toggleInsp() })
for (const a of barActions) row(m, { icon: ICONS[a.icon], label: a.label, kbd: a.kbd, run: a.run })
// The globe's list, one tap further: a menu cannot hold a menu, so
@@ -486,8 +485,6 @@ export class Editor {
// things with it, ending in the language globe and `?` as slides' does.
// ⋯ closes the row once the bar has folded — only then, as in slides — and
// last is where slides' folded bar puts it.
- const insertGroup = el('div', 'sp-group sp-group-insert')
- insertGroup.append(insert)
const right = el('div', 'sp-group sp-group-right')
right.append(search, ...inlineSecondary, inspB, this.liveSlot, saveGroup, lang, helpB, more)
@@ -841,7 +838,23 @@ export class Editor {
// with the other secondary actions instead, which puts it in the ⋯ menu on
// a phone from one list rather than two. Dropping a folder on the window
// still works and is how most people will actually find it.
- head.append(iconBtn('plus', t('New page (⌘⌥N)'), () => this.newPage()))
+ //
+ // NEW PAGES START HERE, on the list they join — a + ▾ split, as slides'
+ // Save is a split: the common action (New page), and its caret holding
+ // the other ways a page arrives, with their shortcuts. They used to sit at
+ // 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())
+ plus.classList.add('sp-newpage')
+ this.newPageMenu?.destroy()
+ this.newPageMenu = barMenu({
+ icon: '<span class="sp-caret-g" aria-hidden="true">▾</span>', label: '',
+ tip: t('New… — page, journal, issue'), end: true, className: 'sp-caret sp-newmenu',
+ fill: (m) => this.pageRows(m),
+ })
+ split.append(plus, this.newPageMenu.root)
+ head.append(split)
this.sidebar.append(head)
const list = el('ul', 'sp-tree')
@@ -1205,6 +1218,102 @@ export class Editor {
this.focusBlock(fresh.id)
}
+ /** Whether the page in view takes new blocks from the bar at all. */
+ private canInsert(): boolean {
+ return !!this.store.page && !this.store.readOnly && !this.reading
+ }
+
+ /**
+ * The block the caret (or the last click) is in, if it is on this page.
+ *
+ * `inspOn` is set on focusin and mousedown inside the page, and pressing a
+ * bar button changes neither, so it still names the block you were in when
+ * you reached for the bar. A click on the page's blank space clears it.
+ */
+ private caretBlock(): Block | undefined {
+ const id = this.inspOn
+ return id ? this.store.page?.blocks.find((b) => b.id === id) : undefined
+ }
+
+ /** Rows for one family's members, with the family's own rules. */
+ private insertRows(m: Menu, items: InsertItem[]): void {
+ for (const item of items) {
+ if (item.rule) m.separator()
+ const r = row(m, { icon: ICONS[item.icon], label: t(item.label), kbd: mdTrigger(item.hint), run: () => this.insertItem(item) })
+ // the item's key, so a rig can hold the bar and the / menu to one list
+ r.dataset.insert = item.key
+ }
+ }
+
+ /**
+ * INSERT ONE THING from the bar — where slides puts a new element: where you
+ * are working. It goes AFTER the block holding the caret, as that block's
+ * sibling and after anything nested in it; with no caret on the page it goes
+ * at the end. One commit, so one undo takes it away, and the caret lands in
+ * it — or the thing that fills it opens (the picker, the link card, the
+ * first cell).
+ */
+ insertItem(item: InsertItem): void {
+ const s = this.store
+ const page = s.page
+ if (!page || !this.canInsert()) return
+ const at = this.caretBlock()
+ const make = (): Block => {
+ const fresh = newBlock(item.type)
+ SPEC.get(item.type)?.init?.(fresh)
+ item.init?.(fresh)
+ if (at?.parent) fresh.parent = at.parent
+ // a block born inside a canvas is born somewhere ON it
+ placeNewCard(page, fresh)
+ return fresh
+ }
+ const put = (fresh: Block) => {
+ s.commit(() => {
+ if (!at) { page.blocks.push(fresh); return }
+ const i = page.blocks.findIndex((b) => b.id === at.id)
+ // past the anchor's whole subtree: its children follow it in the list
+ let end = i + 1
+ const inside = new Set([at.id])
+ while (end < page.blocks.length && page.blocks[end].parent && inside.has(page.blocks[end].parent!)) {
+ inside.add(page.blocks[end].id)
+ end++
+ }
+ page.blocks.splice(end, 0, fresh)
+ })
+ this.paintPage()
+ }
+ // A page card is made whole or not at all: the picker comes FIRST, so the
+ // one commit writes a card that points somewhere, and Escape inserts
+ // nothing — never a card pointing at no page.
+ if (item.type === 'pagelink') {
+ this.openPagePicker(at?.id ?? page.id, null, (pageId) => {
+ const fresh = make()
+ fresh.page = pageId
+ fresh.html = ''
+ put(fresh)
+ })
+ return
+ }
+ const fresh = make()
+ put(fresh)
+ // the block is already a `link`: dismissing the dialog leaves an empty
+ // card with its own way back in, never a half-made block
+ if (item.type === 'link') this.openLinkCard(fresh.id)
+ else if (item.type === 'image') void this.pickImage(fresh.id)
+ // a table's text is in its cells: the caret belongs in the first one
+ else if (item.type === 'table') this.focusCell(fresh.id, 0, 0)
+ // straight to the picker, like Image; cancelling leaves the block's own
+ // chooser (render.ts 'media')
+ else if (item.type === 'media') void this.pickMedia(fresh.id)
+ else this.focusBlock(fresh.id)
+ }
+
+ /** The bar's Comment: on the block holding the caret, or on the page. */
+ private commentHere(): void {
+ if (!this.canInsert()) return
+ this.comments.openNew(this.caretBlock()?.id)
+ }
+
/** Move a block (and anything nested under it) to sit after another. */
/**
* What you can do to a block, declared ONCE.
@@ -3097,7 +3206,7 @@ export class Editor {
this.focusBlock(id)
}
- setType(id: string, type: string): void {
+ setType(id: string, type: string, variant?: (b: Block) => void): void {
this.store.commit(() => {
const b = this.store.block(id)
if (!b) return
@@ -3106,6 +3215,8 @@ export class Editor {
// block type does not need a line here as well — this was the fifth place
// a type had to be added, and the one that was easiest to forget
SPEC.get(type)?.init?.(b)
+ // …and the / row's variant (a view's layout, a clip's kind; inserts.ts)
+ variant?.(b)
})
this.paintPage()
// a table's text is in its cells, so there is no block host to put the
@@ -3501,25 +3612,39 @@ export class Editor {
const list = el('ul', 'sp-results')
pop.append(find, list)
- let items = SLASH_ITEMS
+ // The bar's insert families, in the bar's order and under its names
+ // (inserts.ts): a family with variants under its caption, the one-member
+ // kinds set apart by a rule. Filtering drops the captions — a match list
+ // is one run.
+ const sections = insertSections()
+ const all = sections.flatMap((x) => x.items)
+ let items = all
let sel = 0
- const commit = (item: typeof SLASH_ITEMS[number]) => {
+ const commit = (item: InsertItem) => {
this.closeOverlay()
const blk = this.store.block(blockId)
// the "/" that opened the menu is a command, not content
if (blk && (blk.html ?? '').trim() === '/') blk.html = ''
if (item.type === 'pagelink') this.insertPageCard(blockId)
else if (item.type === 'link') { this.setType(blockId, 'link'); this.openLinkCard(blockId) }
- else this.setType(blockId, item.type)
+ else this.setType(blockId, item.type, item.init)
}
const paint = () => {
list.innerHTML = ''
+ const filtered = items !== all
items.forEach((item, i) => {
+ if (!filtered) {
+ const sec = sections.find((x) => x.items[0] === item)
+ // not options: the listbox's arrows walk `items`, never these
+ const deco = sec?.caption ? el('li', 'sp-results-cap', t(sec.caption)) : sec?.rule ? el('li', 'sp-results-rule') : null
+ if (deco) { deco.setAttribute('role', 'presentation'); list.append(deco) }
+ }
const li = document.createElement('li')
const b = document.createElement('button')
b.className = 'sp-result' + (i === sel ? ' sp-sel' : '')
b.type = 'button'
b.setAttribute('role', 'option')
+ b.dataset.insert = item.key
b.innerHTML =
`<span class="sp-result-ico">${ICONS[item.icon]}</span>` +
`<span class="sp-result-txt"><strong>${escapeHtml(t(item.label))}</strong>` +
@@ -3532,7 +3657,7 @@ export class Editor {
}
find.addEventListener('input', () => {
const q = find.value.trim().toLowerCase()
- items = SLASH_ITEMS.filter((i) => t(i.label).toLowerCase().includes(q) || i.type.includes(q))
+ items = q ? all.filter((i) => t(i.label).toLowerCase().includes(q) || i.type.includes(q)) : all
sel = 0
paint()
})
@@ -5055,7 +5180,7 @@ export class Editor {
}
}
- /** The pages you can add — the foot of + Insert, in shortcut order. */
+ /** The pages you can add — the page list's + ▾, in shortcut order. */
private pageRows(m: Menu): void {
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() })
@@ -5157,6 +5282,26 @@ function isTyping(): boolean {
return a.isContentEditable || a.tagName === 'INPUT' || a.tagName === 'TEXTAREA' || a.tagName === 'SELECT'
}
+/**
+ * A bar button with its word — slides' `btn(icon, label, run, title)`: the
+ * label is a span the compact tier hides, the tooltip is the name a screen
+ * reader hears once it has.
+ */
+function labelBtn(icon: string, label: string, tip: string, onClick: () => void): HTMLButtonElement {
+ const b = document.createElement('button')
+ b.className = 'sp-btn'
+ b.type = 'button'
+ b.innerHTML = icon
+ const l = document.createElement('span')
+ l.className = 'sp-btnlabel'
+ l.textContent = label
+ b.append(l)
+ b.title = tip
+ b.setAttribute('aria-label', tip)
+ b.addEventListener('click', onClick)
+ return b
+}
+
function iconBtn(name: IconName, label: string, onClick: () => void): HTMLButtonElement {
const b = document.createElement('button')
b.className = 'sp-btn'
diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.ts
index ee996128..5de3ea8c 100644
--- a/spaces/src/i18n/de.ts
+++ b/spaces/src/i18n/de.ts
@@ -653,4 +653,27 @@ export const de: Catalog = {
"Export PDF (print)": "PDF exportieren (Drucken)",
"Save as… — copy, new space, password": "Speichern unter… — Kopie, neuer Space, Passwort",
"About bento/spaces — version, updates, licenses": "Über bento/spaces — Version, Updates, Lizenzen",
+ "Add text — a heading, a list, a quote, a callout or a divider": "Text hinzufügen — eine Überschrift, eine Liste, ein Zitat, ein Hinweis oder eine Trennlinie",
+ "Add an image, a video, audio or a card": "Ein Bild, ein Video, Audio oder eine Karte hinzufügen",
+ "Add a table — edit the cells in place": "Eine Tabelle hinzufügen — Zellen direkt bearbeiten",
+ "Add a chart of the issues in this space": "Ein Diagramm der Issues in diesem Space hinzufügen",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "Eine Ansicht der Issues in diesem Space hinzufügen — Board, Liste, Tabelle oder Galerie",
+ "Add a code block": "Einen Codeblock hinzufügen",
+ "Add another page’s content, kept in step with it": "Den Inhalt einer anderen Seite hinzufügen, mit ihr synchron gehalten",
+ "Calendar": "Kalender",
+ "Timeline": "Zeitleiste",
+ "Workload": "Auslastung",
+ "Chart": "Diagramm",
+ "Embed": "Einbettung",
+ "View": "Ansicht",
+ "Table view": "Tabellenansicht",
+ "Comment — on the block with the caret, or on this page": "Kommentieren — den Block mit dem Cursor oder diese Seite",
+ "New… — page, journal, issue": "Neu… — Seite, Journal, Issue",
+ "Issues in columns": "Issues in Spalten",
+ "Issues, one to a line": "Issues, eines pro Zeile",
+ "Issues in rows and columns": "Issues in Zeilen und Spalten",
+ "Issues as cards": "Issues als Karten",
+ "Issues on their dates": "Issues an ihren Terminen",
+ "Issues across time": "Issues über die Zeit",
+ "Issues by person": "Issues nach Person",
}
diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.ts
index 3d53bb39..9250d77b 100644
--- a/spaces/src/i18n/es.ts
+++ b/spaces/src/i18n/es.ts
@@ -653,4 +653,27 @@ export const es: Catalog = {
"Export PDF (print)": "Exportar PDF (imprimir)",
"Save as… — copy, new space, password": "Guardar como… — copia, espacio nuevo, contraseña",
"About bento/spaces — version, updates, licenses": "Acerca de bento/spaces — versión, actualizaciones, licencias",
+ "Add text — a heading, a list, a quote, a callout or a divider": "Añadir texto — un encabezado, una lista, una cita, un destacado o un separador",
+ "Add an image, a video, audio or a card": "Añadir una imagen, un vídeo, audio o una tarjeta",
+ "Add a table — edit the cells in place": "Añadir una tabla — edita las celdas en su sitio",
+ "Add a chart of the issues in this space": "Añadir un gráfico de las incidencias de este espacio",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "Añadir una vista de las incidencias de este espacio — un tablero, una lista, una tabla o una galería",
+ "Add a code block": "Añadir un bloque de código",
+ "Add another page’s content, kept in step with it": "Añadir el contenido de otra página, sincronizado con ella",
+ "Calendar": "Calendario",
+ "Timeline": "Línea de tiempo",
+ "Workload": "Carga de trabajo",
+ "Chart": "Gráfico",
+ "Embed": "Incrustación",
+ "View": "Vista",
+ "Table view": "Vista de tabla",
+ "Comment — on the block with the caret, or on this page": "Comentar — en el bloque donde está el cursor, o en esta página",
+ "New… — page, journal, issue": "Nuevo… — página, diario, incidencia",
+ "Issues in columns": "Incidencias en columnas",
+ "Issues, one to a line": "Incidencias, una por línea",
+ "Issues in rows and columns": "Incidencias en filas y columnas",
+ "Issues as cards": "Incidencias como tarjetas",
+ "Issues on their dates": "Incidencias en sus fechas",
+ "Issues across time": "Incidencias a lo largo del tiempo",
+ "Issues by person": "Incidencias por persona",
}
diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.ts
index d1d1b190..c71a728c 100644
--- a/spaces/src/i18n/fr.ts
+++ b/spaces/src/i18n/fr.ts
@@ -653,4 +653,27 @@ export const fr: Catalog = {
"Export PDF (print)": "Exporter en PDF (imprimer)",
"Save as… — copy, new space, password": "Enregistrer sous… — copie, nouvel espace, mot de passe",
"About bento/spaces — version, updates, licenses": "À propos de bento/spaces — version, mises à jour, licences",
+ "Add text — a heading, a list, a quote, a callout or a divider": "Ajouter du texte — un titre, une liste, une citation, un encadré ou un séparateur",
+ "Add an image, a video, audio or a card": "Ajouter une image, une vidéo, de l’audio ou une carte",
+ "Add a table — edit the cells in place": "Ajouter un tableau — modifiez les cellules sur place",
+ "Add a chart of the issues in this space": "Ajouter un graphique des tickets de cet espace",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "Ajouter une vue des tickets de cet espace — un tableau, une liste, une table ou une galerie",
+ "Add a code block": "Ajouter un bloc de code",
+ "Add another page’s content, kept in step with it": "Ajouter le contenu d’une autre page, tenu à jour avec elle",
+ "Calendar": "Calendrier",
+ "Timeline": "Chronologie",
+ "Workload": "Charge de travail",
+ "Chart": "Graphique",
+ "Embed": "Intégration",
+ "View": "Vue",
+ "Table view": "Vue tableau",
+ "Comment — on the block with the caret, or on this page": "Commenter — le bloc où se trouve le curseur, ou cette page",
+ "New… — page, journal, issue": "Nouveau… — page, journal, ticket",
+ "Issues in columns": "Tickets en colonnes",
+ "Issues, one to a line": "Tickets, un par ligne",
+ "Issues in rows and columns": "Tickets en lignes et colonnes",
+ "Issues as cards": "Tickets en cartes",
+ "Issues on their dates": "Tickets à leurs dates",
+ "Issues across time": "Tickets dans le temps",
+ "Issues by person": "Tickets par personne",
}
diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.ts
index a5c9e748..fc519d2c 100644
--- a/spaces/src/i18n/it.ts
+++ b/spaces/src/i18n/it.ts
@@ -653,4 +653,27 @@ export const it: Catalog = {
"Export PDF (print)": "Esporta PDF (stampa)",
"Save as… — copy, new space, password": "Salva come… — copia, nuovo spazio, password",
"About bento/spaces — version, updates, licenses": "Informazioni su bento/spaces — versione, aggiornamenti, licenze",
+ "Add text — a heading, a list, a quote, a callout or a divider": "Aggiungi testo — un titolo, un elenco, una citazione, un riquadro o un divisore",
+ "Add an image, a video, audio or a card": "Aggiungi un’immagine, un video, un audio o una scheda",
+ "Add a table — edit the cells in place": "Aggiungi una tabella — modifica le celle sul posto",
+ "Add a chart of the issues in this space": "Aggiungi un grafico delle issue di questo spazio",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "Aggiungi una vista delle issue di questo spazio — bacheca, elenco, tabella o galleria",
+ "Add a code block": "Aggiungi un blocco di codice",
+ "Add another page’s content, kept in step with it": "Aggiungi il contenuto di un’altra pagina, sempre allineato",
+ "Calendar": "Calendario",
+ "Timeline": "Timeline",
+ "Workload": "Carico di lavoro",
+ "Chart": "Grafico",
+ "Embed": "Incorporamento",
+ "View": "Vista",
+ "Table view": "Vista tabella",
+ "Comment — on the block with the caret, or on this page": "Commenta — il blocco con il cursore, o questa pagina",
+ "New… — page, journal, issue": "Nuovo… — pagina, diario, issue",
+ "Issues in columns": "Issue in colonne",
+ "Issues, one to a line": "Issue, una per riga",
+ "Issues in rows and columns": "Issue in righe e colonne",
+ "Issues as cards": "Issue come schede",
+ "Issues on their dates": "Issue alle loro date",
+ "Issues across time": "Issue nel tempo",
+ "Issues by person": "Issue per persona",
}
diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.ts
index fe5b359d..3cce2e1b 100644
--- a/spaces/src/i18n/ja.ts
+++ b/spaces/src/i18n/ja.ts
@@ -653,4 +653,27 @@ export const ja: Catalog = {
"Export PDF (print)": "PDF 書き出し(印刷)",
"Save as… — copy, new space, password": "別名で保存… — コピー・新しいスペース・パスワード",
"About bento/spaces — version, updates, licenses": "bento/spaces について — バージョン・更新・ライセンス",
+ "Add text — a heading, a list, a quote, a callout or a divider": "テキストを追加 — 見出し・リスト・引用・コールアウト・区切り線",
+ "Add an image, a video, audio or a card": "画像・動画・音声・カードを追加",
+ "Add a table — edit the cells in place": "表を追加 — セルはその場で編集",
+ "Add a chart of the issues in this space": "この Space のイシューのグラフを追加",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "この Space のイシューのビューを追加 — ボード・リスト・表・ギャラリー",
+ "Add a code block": "コードブロックを追加",
+ "Add another page’s content, kept in step with it": "別のページの内容を追加 — 元のページと連動します",
+ "Calendar": "カレンダー",
+ "Timeline": "タイムライン",
+ "Workload": "作業量",
+ "Chart": "グラフ",
+ "Embed": "埋め込み",
+ "View": "ビュー",
+ "Table view": "表ビュー",
+ "Comment — on the block with the caret, or on this page": "コメント — カーソルのあるブロック、またはこのページに",
+ "New… — page, journal, issue": "新規… — ページ・ジャーナル・イシュー",
+ "Issues in columns": "列に並んだイシュー",
+ "Issues, one to a line": "1 行に 1 件のイシュー",
+ "Issues in rows and columns": "行と列のイシュー",
+ "Issues as cards": "カードとしてのイシュー",
+ "Issues on their dates": "日付ごとのイシュー",
+ "Issues across time": "時間軸上のイシュー",
+ "Issues by person": "担当者ごとのイシュー",
}
diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.ts
index 3aa796fe..9ababa1e 100644
--- a/spaces/src/i18n/packed.ts
+++ b/spaces/src/i18n/packed.ts
@@ -35,15 +35,22 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Add a block below": ["下にブロックを追加","在下方添加块","在下方新增區塊","Añadir un bloque debajo","Ajouter un bloc en dessous","Block darunter hinzufügen","Aggiungi un blocco sotto","Adicionar um bloco abaixo"],
"Add a card": ["カードを追加","添加卡片","新增卡片","Añadir una tarjeta","Ajouter une carte","Karte hinzufügen","Aggiungi una scheda","Adicionar um cartão"],
"Add a card that opens a page": ["ページを開くカードを追加","添加一张打开页面的卡片","新增可開啟頁面的卡片","Añadir una tarjeta que abre una página","Ajouter une carte qui ouvre une page","Karte hinzufügen, die eine Seite öffnet","Aggiungi una scheda che apre una pagina","Adicionar um cartão que abre uma página"],
+ "Add a chart of the issues in this space": ["この Space のイシューのグラフを追加","添加此空间中事项的图表","新增此空間中項目的圖表","Añadir un gráfico de las incidencias de este espacio","Ajouter un graphique des tickets de cet espace","Ein Diagramm der Issues in diesem Space hinzufügen","Aggiungi un grafico delle issue di questo spazio","Adicionar um gráfico das tarefas deste espaço"],
+ "Add a code block": ["コードブロックを追加","添加代码块","新增程式碼區塊","Añadir un bloque de código","Ajouter un bloc de code","Einen Codeblock hinzufügen","Aggiungi un blocco di codice","Adicionar um bloco de código"],
"Add a column after": ["右に列を追加","在右侧添加一列","在右側新增一欄","Añadir una columna después","Ajouter une colonne après","Spalte danach einfügen","Aggiungi una colonna dopo","Adicionar uma coluna depois"],
"Add a link": ["リンクを追加","添加链接","新增連結","Añadir un enlace","Ajouter un lien","Link hinzufügen","Aggiungi un collegamento","Adicionar um link"],
"Add a page": ["ページを追加","添加页面","新增頁面","Añadir una página","Ajouter une page","Seite hinzufügen","Aggiungi una pagina","Adicionar uma página"],
"Add a picture": ["画像を追加","添加图片","新增圖片","Añadir una imagen","Ajouter une image","Bild hinzufügen","Aggiungi un'immagine","Adicionar uma imagem"],
"Add a property": ["プロパティを追加","添加属性","新增屬性","Añadir una propiedad","Ajouter une propriété","Eine Eigenschaft hinzufügen","Aggiungi una proprietà","Adicionar uma propriedade"],
"Add a row below": ["下に行を追加","在下方添加一行","在下方新增一列","Añadir una fila debajo","Ajouter une ligne en dessous","Zeile darunter einfügen","Aggiungi una riga sotto","Adicionar uma linha abaixo"],
+ "Add a table — edit the cells in place": ["表を追加 — セルはその場で編集","添加表格 — 直接编辑单元格","新增表格 — 直接編輯儲存格","Añadir una tabla — edita las celdas en su sitio","Ajouter un tableau — modifiez les cellules sur place","Eine Tabelle hinzufügen — Zellen direkt bearbeiten","Aggiungi una tabella — modifica le celle sul posto","Adicionar uma tabela — edite as células no próprio lugar"],
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": ["この Space のイシューのビューを追加 — ボード・リスト・表・ギャラリー","添加此空间中事项的视图 — 看板、列表、表格或图库","新增此空間中項目的檢視 — 看板、清單、表格或圖庫","Añadir una vista de las incidencias de este espacio — un tablero, una lista, una tabla o una galería","Ajouter une vue des tickets de cet espace — un tableau, une liste, une table ou une galerie","Eine Ansicht der Issues in diesem Space hinzufügen — Board, Liste, Tabelle oder Galerie","Aggiungi una vista delle issue di questo spazio — bacheca, elenco, tabella o galleria","Adicionar uma vista das tarefas deste espaço — um quadro, uma lista, uma tabela ou uma galeria"],
+ "Add an image, a video, audio or a card": ["画像・動画・音声・カードを追加","添加图片、视频、音频或卡片","新增圖片、影片、音訊或卡片","Añadir una imagen, un vídeo, audio o una tarjeta","Ajouter une image, une vidéo, de l’audio ou une carte","Ein Bild, ein Video, Audio oder eine Karte hinzufügen","Aggiungi un’immagine, un video, un audio o una scheda","Adicionar uma imagem, um vídeo, áudio ou um cartão"],
+ "Add another page’s content, kept in step with it": ["別のページの内容を追加 — 元のページと連動します","添加另一个页面的内容,并与其保持同步","新增另一個頁面的內容,並與其保持同步","Añadir el contenido de otra página, sincronizado con ella","Ajouter le contenu d’une autre page, tenu à jour avec elle","Den Inhalt einer anderen Seite hinzufügen, mit ihr synchron gehalten","Aggiungi il contenuto di un’altra pagina, sempre allineato","Adicionar o conteúdo de outra página, sempre em sincronia com ela"],
"Add below": ["下に追加","在下方添加","在下方新增","Añadir debajo","Ajouter en dessous","Darunter einfügen","Aggiungi sotto","Adicionar abaixo"],
"Add pages under": ["ページを追加する場所","将页面添加到","將頁面加入到","Añadir las páginas debajo de","Ajouter les pages sous","Seiten einfügen unter","Aggiungi le pagine sotto","Adicionar as páginas por baixo de"],
"Add property…": ["プロパティを追加…","添加属性…","新增屬性…","Añadir propiedad…","Ajouter une propriété…","Eigenschaft hinzufügen…","Aggiungi proprietà…","Adicionar propriedade…"],
+ "Add text — a heading, a list, a quote, a callout or a divider": ["テキストを追加 — 見出し・リスト・引用・コールアウト・区切り線","添加文本 — 标题、列表、引用、标注或分隔线","新增文字 — 標題、清單、引言、標註或分隔線","Añadir texto — un encabezado, una lista, una cita, un destacado o un separador","Ajouter du texte — un titre, une liste, une citation, un encadré ou un séparateur","Text hinzufügen — eine Überschrift, eine Liste, ein Zitat, ein Hinweis oder eine Trennlinie","Aggiungi testo — un titolo, un elenco, una citazione, un riquadro o un divisore","Adicionar texto — um título, uma lista, uma citação, um destaque ou um divisor"],
"Added {name}": ["{name} を追加しました","已添加{name}","已新增{name}","Se añadió {name}","{name} ajoutée","{name} hinzugefügt","{name} aggiunta","{name} adicionada"],
"Address of a video or audio file": ["動画または音声ファイルのアドレス","视频或音频文件的地址","影片或音訊檔案的位址","Dirección de un archivo de vídeo o audio","Adresse d’un fichier vidéo ou audio","Adresse einer Video- oder Audiodatei","Indirizzo di un file video o audio","Endereço de um ficheiro de vídeo ou áudio"],
"Adds status, priority, assignee, estimate": ["ステータス・優先度・担当者・見積もりを追加します","添加状态、优先级、负责人和估算","新增狀態、優先順序、負責人與估算","Añade estado, prioridad, responsable y estimación","Ajoute statut, priorité, responsable et estimation","Fügt Status, Priorität, Bearbeiter:in und Schätzung hinzu","Aggiunge stato, priorità, assegnatario e stima","Adiciona estado, prioridade, responsável e estimativa"],
@@ -75,6 +82,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Bring notes in": ["ノートを取り込む","把笔记带进来","把筆記帶進來","Traer notas","Faire entrer des notes","Notizen hereinholen","Portare dentro le note","Trazer notas para cá"],
"Brown": ["茶","棕色","棕色","Marrón","Marron","Braun","Marrone","Marrom"],
"Bulleted list": ["箇条書き","项目符号列表","項目符號清單","Lista con viñetas","Liste à puces","Aufzählung","Elenco puntato","Lista com marcadores"],
+ "Calendar": ["カレンダー","日历","日曆","Calendario","Calendrier","Kalender","Calendario","Calendário"],
"Callout": ["コールアウト","标注","標註","Aviso","Encadré","Hinweisblock","Riquadro","Destaque"],
"Callout icon": ["囲みのアイコン","标注图标","標註圖示","Icono del aviso","Icône de l'encadré","Symbol des Hinweisfelds","Icona del riquadro","Ícone do destaque"],
"Cancel": ["キャンセル","取消","取消","Cancelar","Annuler","Abbrechen","Annulla","Cancelar"],
@@ -87,6 +95,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Change the shape of this canvas": ["このキャンバスの形を変更","更改此画布的形状","變更此畫布的形狀","Cambiar la forma de este lienzo","Changer la forme de ce canevas","Form dieser Leinwand ändern","Cambia la forma di questa tela","Alterar o formato desta tela"],
"Change this page's icon": ["このページのアイコンを変更","更改此页面的图标","變更此頁面的圖示","Cambiar el icono de esta página","Changer l’icône de cette page","Symbol dieser Seite ändern","Cambia l’icona di questa pagina","Mudar o ícone desta página"],
"Change {field}": ["{field}を変更","更改{field}","變更{field}","Cambiar {field}","Modifier {field}","{field} ändern","Cambia {field}","Alterar {field}"],
+ "Chart": ["グラフ","图表","圖表","Gráfico","Graphique","Diagramm","Grafico","Gráfico"],
"Check for updates": ["更新を確認","检查更新","檢查更新","Buscar actualizaciones","Rechercher des mises à jour","Nach Updates suchen","Cerca aggiornamenti","Verificar atualizações"],
"Check for updates automatically at launch": ["起動時に自動で更新を確認","启动时自动检查更新","啟動時自動檢查更新","Buscar actualizaciones automáticamente al iniciar","Rechercher automatiquement les mises à jour au démarrage","Beim Start automatisch nach Updates suchen","Cerca aggiornamenti automaticamente all'avvio","Verificar atualizações automaticamente ao abrir"],
"Checked automatically at launch — you're on the latest version (v{v}).": ["起動時に自動確認済み — 最新バージョンです (v{v})。","已在启动时自动检查 — 您已是最新版本 (v{v})。","已於啟動時自動檢查 — 您已是最新版本 (v{v})。","Comprobado automáticamente al iniciar — tienes la última versión (v{v}).","Vérifié automatiquement au démarrage — vous avez la dernière version (v{v}).","Beim Start automatisch geprüft — Sie haben die neueste Version (v{v}).","Verificato automaticamente all'avvio — hai l'ultima versione (v{v}).","Verificado automaticamente ao abrir — você está na versão mais recente (v{v})."],
@@ -116,6 +125,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Comment on this page": ["このページにコメント","评论此页面","為這個頁面加註解","Comentar esta página","Commenter cette page","Diese Seite kommentieren","Commenta questa pagina","Comentar esta página"],
"Comment · block": ["コメント · ブロック","评论 · 块","註解 · 區塊","Comentario · bloque","Commentaire · bloc","Kommentar · Block","Commento · blocco","Comentário · bloco"],
"Comment · page": ["コメント · ページ","评论 · 页面","註解 · 頁面","Comentario · página","Commentaire · page","Kommentar · Seite","Commento · pagina","Comentário · página"],
+ "Comment — on the block with the caret, or on this page": ["コメント — カーソルのあるブロック、またはこのページに","评论 — 针对光标所在的块,或此页面","註解 — 針對游標所在的區塊,或此頁面","Comentar — en el bloque donde está el cursor, o en esta página","Commenter — le bloc où se trouve le curseur, ou cette page","Kommentieren — den Block mit dem Cursor oder diese Seite","Commenta — il blocco con il cursore, o questa pagina","Comentar — o bloco onde está o cursor, ou esta página"],
"Comment:": ["コメント:","评论:","註解:","Comentario:","Commentaire :","Kommentar:","Commento:","Comentário:"],
"Confirm password": ["パスワードを確認","确认密码","確認密碼","Confirmar contraseña","Confirmer le mot de passe","Passwort bestätigen","Conferma password","Confirmar senha"],
"Connect to the live session without saving a new copy — copies you sent earlier will meet you there.": ["新しいコピーを保存せずにライブセッションへ接続します — 以前送ったコピーがここで合流します。","无需保存新副本即可连接实时会话 — 之前发送的副本会在这里与你会合。","無需儲存新副本即可連線即時會話 — 之前傳送的副本會在這裡與你會合。","Conéctate a la sesión en vivo sin guardar una copia nueva — las copias ya enviadas se unirán aquí.","Connectez-vous à la session live sans enregistrer de copie — les copies déjà envoyées vous y rejoindront.","Mit der Live-Sitzung verbinden, ohne eine neue Kopie zu speichern — bereits gesendete Kopien treffen dich hier.","Connettiti alla sessione live senza salvare una nuova copia — le copie già inviate ti raggiungeranno qui.","Conecte-se à sessão ao vivo sem salvar uma nova cópia — as cópias que você enviou antes encontrarão você lá."],
@@ -164,6 +174,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Editing": ["編集中","编辑中","編輯中","Edición","Édition","Bearbeiten","In modifica","Edição"],
"Editor": ["編集者","编辑者","編輯者","Editor","Éditeur","Bearbeiter","Editor","Editor"],
"Editor copy saved — recipients join live with edit access": ["編集者コピーを保存しました — 受け取った人は編集権限つきでライブに参加します","编辑者副本已保存 — 收到的人可带编辑权限加入实时会话","編輯者副本已儲存 — 收到的人可帶編輯權限加入即時會話","Copia de editor guardada — quien la reciba se une en vivo con acceso de edición","Copie éditeur enregistrée — les destinataires rejoignent la session en direct avec accès en écriture","Bearbeiter-Kopie gespeichert — Empfänger treten live mit Schreibzugriff bei","Copia editor salvata — chi la riceve entra live con accesso in modifica","Cópia de editor salva — quem receber entra ao vivo com acesso de edição"],
+ "Embed": ["埋め込み","嵌入","嵌入","Incrustación","Intégration","Einbettung","Incorporamento","Incorporação"],
"Embedded in the file": ["ファイルに埋め込み済み","已嵌入文件","已嵌入檔案","Incrustado en el archivo","Intégré au fichier","In der Datei eingebettet","Incorporato nel file","Embutido no arquivo"],
"Encrypt with password…": ["パスワードで暗号化…","使用密码加密…","以密碼加密…","Cifrar con contraseña…","Chiffrer avec un mot de passe…","Mit Passwort verschlüsseln…","Cifra con password…","Criptografar com senha…"],
"Enter the password to open it.": ["開くにはパスワードを入力してください。","输入密码以打开。","請輸入密碼以開啟。","Introduce la contraseña para abrirlo.","Saisissez le mot de passe pour l’ouvrir.","Gib das Passwort ein, um ihn zu öffnen.","Inserisci la password per aprirlo.","Introduza a palavra-passe para o abrir."],
@@ -222,13 +233,18 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Include the pages nested under it": ["その下にあるページも含める","包含其下级页面","包含其下層頁面","Incluir las páginas anidadas debajo","Inclure les pages imbriquées en dessous","Die darunter verschachtelten Seiten einschließen","Includi le pagine annidate sotto di essa","Incluir as páginas aninhadas por baixo"],
"Indent, or move back out": ["字下げ、または戻す","缩进,或退回一级","縮排,或退回一層","Sangrar, o volver a salir","Indenter, ou revenir en arrière","Einrücken, oder wieder heraus","Rientra, o torna indietro","Avançar, ou recuar de novo"],
"Inline code — ⌘E": ["インラインコード — ⌘E","行内代码 — ⌘E","行內程式碼 — ⌘E","Código en línea — ⌘E","Code en ligne — ⌘E","Inline-Code — ⌘E","Codice in linea — ⌘E","Código em linha — ⌘E"],
- "Insert": ["挿入","插入","插入","Insertar","Insérer","Einfügen","Inserisci","Inserir"],
- "Insert a block — text, headings, lists, code, images": ["ブロックを挿入 — テキスト、見出し、リスト、コード、画像","插入块 — 文本、标题、列表、代码、图片","插入區塊 — 文字、標題、清單、程式碼、圖片","Insertar un bloque — texto, encabezados, listas, código, imágenes","Insérer un bloc — texte, titres, listes, code, images","Block einfügen — Text, Überschriften, Listen, Code, Bilder","Inserisci un blocco — testo, titoli, elenchi, codice, immagini","Inserir um bloco — texto, títulos, listas, código, imagens"],
"Interface language": ["表示言語","界面语言","介面語言","Idioma de la interfaz","Langue de l’interface","Sprache der Oberfläche","Lingua dell’interfaccia","Idioma da interface"],
"Interface theme": ["表示テーマ","界面主题","介面主題","Tema de la interfaz","Thème de l’interface","Design der Oberfläche","Tema dell’interfaccia","Tema da interface"],
"Invite to edit…": ["編集に招待…","邀请编辑…","邀請編輯…","Invitar a editar…","Inviter à éditer…","Zum Bearbeiten einladen…","Invita a modificare…","Convidar para editar…"],
"Issues": ["イシュー","事项","項目","Incidencias","Tickets","Issues","Issue","Tarefas"],
+ "Issues across time": ["時間軸上のイシュー","按时间铺开的事项","依時間展開的項目","Incidencias a lo largo del tiempo","Tickets dans le temps","Issues über die Zeit","Issue nel tempo","Tarefas ao longo do tempo"],
+ "Issues as cards": ["カードとしてのイシュー","以卡片显示的事项","以卡片顯示的項目","Incidencias como tarjetas","Tickets en cartes","Issues als Karten","Issue come schede","Tarefas como cartões"],
+ "Issues by person": ["担当者ごとのイシュー","按人员排列的事项","依人員排列的項目","Incidencias por persona","Tickets par personne","Issues nach Person","Issue per persona","Tarefas por pessoa"],
+ "Issues in columns": ["列に並んだイシュー","按列排列的事项","依欄排列的項目","Incidencias en columnas","Tickets en colonnes","Issues in Spalten","Issue in colonne","Tarefas em colunas"],
+ "Issues in rows and columns": ["行と列のイシュー","按行和列排列的事项","依列與欄排列的項目","Incidencias en filas y columnas","Tickets en lignes et colonnes","Issues in Zeilen und Spalten","Issue in righe e colonne","Tarefas em linhas e colunas"],
+ "Issues on their dates": ["日付ごとのイシュー","按日期排列的事项","依日期排列的項目","Incidencias en sus fechas","Tickets à leurs dates","Issues an ihren Terminen","Issue alle loro date","Tarefas nas suas datas"],
"Issues, grouped or listed": ["課題をグループまたは一覧で","分组或列出的事项","分組或列出的項目","Incidencias, agrupadas o en lista","Tickets, groupés ou en liste","Vorgänge, gruppiert oder als Liste","Attività, raggruppate o in elenco","Questões, agrupadas ou em lista"],
+ "Issues, one to a line": ["1 行に 1 件のイシュー","事项,每行一个","項目,每行一個","Incidencias, una por línea","Tickets, un par ligne","Issues, eines pro Zeile","Issue, una per riga","Tarefas, uma por linha"],
"Italic": ["イタリック","斜体","斜體","Cursiva","Italique","Kursiv","Corsivo","Itálico"],
"Italic — ⌘I": ["イタリック — ⌘I","斜体 — ⌘I","斜體 — ⌘I","Cursiva — ⌘I","Italique — ⌘I","Kursiv — ⌘I","Corsivo — ⌘I","Itálico — ⌘I"],
"Journal date": ["ジャーナルの日付","日志日期","日誌日期","Fecha del diario","Date du journal","Journaldatum","Data del diario","Data do diário"],
@@ -279,6 +295,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"New page inside": ["この中に新規ページ","在其中新建页面","在其中新增頁面","Nueva página dentro","Nouvelle page à l’intérieur","Neue Unterseite","Nuova pagina interna","Nova página dentro desta"],
"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"],
"Next (⏎)": ["次へ (⏎)","下一个 (⏎)","下一個 (⏎)","Siguiente (⏎)","Suivant (⏎)","Weiter (⏎)","Successivo (⏎)","Seguinte (⏎)"],
"No Markdown files in that selection": ["選択に Markdown ファイルがありません","所选内容里没有 Markdown 文件","所選項目中沒有 Markdown 檔案","No hay archivos Markdown en esa selección","Aucun fichier Markdown dans cette sélection","Keine Markdown-Dateien in dieser Auswahl","Nessun file Markdown in questa selezione","Não há ficheiros Markdown nessa seleção"],
"No block matches": ["一致するブロックがありません","没有匹配的块","沒有符合的區塊","Ningún bloque coincide","Aucun bloc correspondant","Kein Block passt","Nessun blocco corrisponde","Nenhum bloco corresponde"],
@@ -437,6 +454,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Strikethrough": ["取り消し線","删除线","刪除線","Tachado","Barré","Durchgestrichen","Barrato","Tachado"],
"Strikethrough — ⇧⌘S": ["取り消し線 — ⇧⌘S","删除线 — ⇧⌘S","刪除線 — ⇧⌘S","Tachado — ⇧⌘S","Barré — ⇧⌘S","Durchgestrichen — ⇧⌘S","Barrato — ⇧⌘S","Tachado — ⇧⌘S"],
"Table": ["表","表格","表格","Tabla","Tableau","Tabelle","Tabella","Tabela"],
+ "Table view": ["表ビュー","表格视图","表格檢視","Vista de tabla","Vue tableau","Tabellenansicht","Vista tabella","Vista de tabela"],
"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"],
@@ -497,6 +515,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": ["このウィンドウはまだ v{v} で動作中。開いているファイルを上書きした場合は再読込を。別に保存した場合はそのファイルを開いてください。","此窗口仍在运行 v{v}。若覆盖了当前打开的文件请重新加载;否则请打开您保存的文件。","此視窗仍在執行 v{v}。若已覆寫目前開啟的檔案請重新載入;否則請開啟您儲存的檔案。","Esta ventana sigue en v{v}. Si sobrescribiste el archivo abierto aquí, recarga; si no, abre el archivo que guardaste.","Cette fenêtre tourne encore en v{v}. Si vous avez écrasé le fichier ouvert ici, rechargez ; sinon ouvrez le fichier enregistré.","Dieses Fenster läuft noch mit v{v}. Wenn Sie die geöffnete Datei überschrieben haben, neu laden; andernfalls die gespeicherte Datei öffnen.","Questa finestra esegue ancora la v{v}. Se hai sovrascritto il file aperto qui, ricarica; altrimenti apri il file salvato.","Esta janela ainda está executando a v{v}. Se você sobrescreveu o arquivo aberto aqui, recarregue; caso contrário, abra o arquivo que salvou."],
"This window keeps running v{v} until you open the downloaded file.": ["ダウンロードしたファイルを開くまで、このウィンドウは v{v} のままです。","在打开下载的文件之前,此窗口将继续运行 v{v}。","在開啟下載的檔案之前,此視窗會維持在 v{v}。","Esta ventana seguirá en v{v} hasta que abras el archivo descargado.","Cette fenêtre reste en v{v} jusqu'à l'ouverture du fichier téléchargé.","Dieses Fenster bleibt bei v{v}, bis Sie die heruntergeladene Datei öffnen.","Questa finestra resta alla v{v} finché non apri il file scaricato.","Esta janela continua executando a v{v} até você abrir o arquivo baixado."],
"Those files could not be read": ["それらのファイルは読み込めませんでした","这些文件无法读取","這些檔案無法讀取","No se pudieron leer esos archivos","Ces fichiers n’ont pas pu être lus","Diese Dateien konnten nicht gelesen werden","Non è stato possibile leggere quei file","Não foi possível ler esses ficheiros"],
+ "Timeline": ["タイムライン","时间线","時間軸","Línea de tiempo","Chronologie","Zeitleiste","Timeline","Linha do tempo"],
"Tip": ["ヒント","提示","提示","Consejo","Astuce","Tipp","Suggerimento","Dica"],
"Title": ["タイトル","标题","標題","Título","Titre","Titel","Titolo","Título"],
"To-do": ["チェックリスト","待办事项","待辦事項","Tarea","Tâche","Aufgabe","Attività","Tarefa"],
@@ -538,6 +557,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Video": ["動画","视频","影片","Vídeo","Vidéo","Video","Video","Vídeo"],
"Video from {host}": ["{host} の動画","来自 {host} 的视频","來自 {host} 的影片","Vídeo de {host}","Vidéo provenant de {host}","Video von {host}","Video da {host}","Vídeo de {host}"],
"Video or audio": ["動画または音声","视频或音频","影片或音訊","Vídeo o audio","Vidéo ou audio","Video oder Audio","Video o audio","Vídeo ou áudio"],
+ "View": ["ビュー","视图","檢視","Vista","Vue","Ansicht","Vista","Vista"],
"View-only copy — it follows the live session but can’t change this space.": ["閲覧専用コピー — ライブセッションに追従しますが、この Space は変更できません。","只读副本 — 会跟随实时会话,但无法修改此 Space。","唯讀副本 — 會跟隨即時會話,但無法修改此 Space。","Copia de solo lectura — sigue la sesión en vivo pero no puede modificar este Space.","Copie en lecture seule — elle suit la session live mais ne peut pas modifier cet espace.","Nur-Lesen-Kopie — sie folgt der Live-Sitzung, kann diesen Space aber nicht ändern.","Copia di sola lettura — segue la sessione live ma non può modificare questo Space.","Cópia somente para visualização — ela acompanha a sessão ao vivo, mas não pode alterar este Space."],
"View-only copy — it holds no signing key.": ["閲覧専用コピー — 署名鍵を保持していません。","只读副本 — 不持有签名密钥。","唯讀副本 — 不持有簽署金鑰。","Copia de solo lectura — no contiene clave de firma.","Copie en lecture seule — elle ne détient aucune clé de signature.","Nur-Lesen-Kopie — enthält keinen Signaturschlüssel.","Copia di sola lettura — non contiene chiavi di firma.","Cópia somente para visualização — ela não contém chave de assinatura."],
"View-only copy…": ["閲覧専用コピー…","只读副本…","唯讀副本…","Copia de solo lectura…","Copie en lecture seule…","Nur-Lesen-Kopie…","Copia di sola lettura…","Cópia somente para visualização…"],
@@ -555,6 +575,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Width in the text column": ["本文カラム内の幅","在正文栏中的宽度","相對於文字欄的寬度","Ancho en la columna de texto","Largeur dans la colonne de texte","Breite in der Textspalte","Larghezza nella colonna di testo","Largura na coluna de texto"],
"Windows on this computer still sync; turn offline mode off in About to work with someone elsewhere.": ["このコンピュータ上のウィンドウ同士は引き続き同期します。ほかの場所にいる人と作業するには「About」でオフラインモードを解除してください。","本机的窗口仍会同步;要与其他地方的人协作,请在“关于”中关闭离线模式。","本機的視窗仍會同步;要與其他地方的人協作,請在「關於」中關閉離線模式。","Las ventanas de este equipo siguen sincronizándose; desactiva el modo sin conexión en «Acerca de» para trabajar con alguien en otro lugar.","Les fenêtres de cet ordinateur restent synchronisées ; désactivez le mode hors ligne dans « À propos » pour travailler avec quelqu’un ailleurs.","Fenster auf diesem Computer synchronisieren sich weiterhin; deaktiviere den Offline-Modus unter „Über“, um mit jemandem anderswo zu arbeiten.","Le finestre su questo computer restano sincronizzate; disattiva la modalità offline in «Informazioni» per lavorare con qualcuno altrove.","As janelas neste computador continuam sincronizando; desative o modo offline em Sobre para trabalhar com alguém em outro lugar."],
"Words": ["語数","字数","字數","Palabras","Mots","Wörter","Parole","Palavras"],
+ "Workload": ["作業量","工作量","工作量","Carga de trabajo","Charge de travail","Auslastung","Carico di lavoro","Carga de trabalho"],
"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.ts
index a3131a8c..d14b8155 100644
--- a/spaces/src/i18n/pt.ts
+++ b/spaces/src/i18n/pt.ts
@@ -653,4 +653,27 @@ export const pt: Catalog = {
"Export PDF (print)": "Exportar PDF (imprimir)",
"Save as… — copy, new space, password": "Guardar como… — cópia, novo espaço, palavra-passe",
"About bento/spaces — version, updates, licenses": "Acerca do bento/spaces — versão, atualizações, licenças",
+ "Add text — a heading, a list, a quote, a callout or a divider": "Adicionar texto — um título, uma lista, uma citação, um destaque ou um divisor",
+ "Add an image, a video, audio or a card": "Adicionar uma imagem, um vídeo, áudio ou um cartão",
+ "Add a table — edit the cells in place": "Adicionar uma tabela — edite as células no próprio lugar",
+ "Add a chart of the issues in this space": "Adicionar um gráfico das tarefas deste espaço",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "Adicionar uma vista das tarefas deste espaço — um quadro, uma lista, uma tabela ou uma galeria",
+ "Add a code block": "Adicionar um bloco de código",
+ "Add another page’s content, kept in step with it": "Adicionar o conteúdo de outra página, sempre em sincronia com ela",
+ "Calendar": "Calendário",
+ "Timeline": "Linha do tempo",
+ "Workload": "Carga de trabalho",
+ "Chart": "Gráfico",
+ "Embed": "Incorporação",
+ "View": "Vista",
+ "Table view": "Vista de tabela",
+ "Comment — on the block with the caret, or on this page": "Comentar — o bloco onde está o cursor, ou esta página",
+ "New… — page, journal, issue": "Novo… — página, diário, tarefa",
+ "Issues in columns": "Tarefas em colunas",
+ "Issues, one to a line": "Tarefas, uma por linha",
+ "Issues in rows and columns": "Tarefas em linhas e colunas",
+ "Issues as cards": "Tarefas como cartões",
+ "Issues on their dates": "Tarefas nas suas datas",
+ "Issues across time": "Tarefas ao longo do tempo",
+ "Issues by person": "Tarefas por pessoa",
}
diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.ts
index 0929e3c9..5abead29 100644
--- a/spaces/src/i18n/zh-Hans.ts
+++ b/spaces/src/i18n/zh-Hans.ts
@@ -653,4 +653,27 @@ export const zh_Hans: Catalog = {
"Export PDF (print)": "导出 PDF(打印)",
"Save as… — copy, new space, password": "另存为… — 副本、新空间、密码",
"About bento/spaces — version, updates, licenses": "关于 bento/spaces — 版本、更新、许可证",
+ "Add text — a heading, a list, a quote, a callout or a divider": "添加文本 — 标题、列表、引用、标注或分隔线",
+ "Add an image, a video, audio or a card": "添加图片、视频、音频或卡片",
+ "Add a table — edit the cells in place": "添加表格 — 直接编辑单元格",
+ "Add a chart of the issues in this space": "添加此空间中事项的图表",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "添加此空间中事项的视图 — 看板、列表、表格或图库",
+ "Add a code block": "添加代码块",
+ "Add another page’s content, kept in step with it": "添加另一个页面的内容,并与其保持同步",
+ "Calendar": "日历",
+ "Timeline": "时间线",
+ "Workload": "工作量",
+ "Chart": "图表",
+ "Embed": "嵌入",
+ "View": "视图",
+ "Table view": "表格视图",
+ "Comment — on the block with the caret, or on this page": "评论 — 针对光标所在的块,或此页面",
+ "New… — page, journal, issue": "新建… — 页面、日志、事项",
+ "Issues in columns": "按列排列的事项",
+ "Issues, one to a line": "事项,每行一个",
+ "Issues in rows and columns": "按行和列排列的事项",
+ "Issues as cards": "以卡片显示的事项",
+ "Issues on their dates": "按日期排列的事项",
+ "Issues across time": "按时间铺开的事项",
+ "Issues by person": "按人员排列的事项",
}
diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.ts
index a9545315..afab8dec 100644
--- a/spaces/src/i18n/zh-Hant.ts
+++ b/spaces/src/i18n/zh-Hant.ts
@@ -653,4 +653,27 @@ export const zh_Hant: Catalog = {
"Export PDF (print)": "匯出 PDF(列印)",
"Save as… — copy, new space, password": "另存為… — 副本、新空間、密碼",
"About bento/spaces — version, updates, licenses": "關於 bento/spaces — 版本、更新、授權",
+ "Add text — a heading, a list, a quote, a callout or a divider": "新增文字 — 標題、清單、引言、標註或分隔線",
+ "Add an image, a video, audio or a card": "新增圖片、影片、音訊或卡片",
+ "Add a table — edit the cells in place": "新增表格 — 直接編輯儲存格",
+ "Add a chart of the issues in this space": "新增此空間中項目的圖表",
+ "Add a view of the issues in this space — a board, a list, a table or a gallery": "新增此空間中項目的檢視 — 看板、清單、表格或圖庫",
+ "Add a code block": "新增程式碼區塊",
+ "Add another page’s content, kept in step with it": "新增另一個頁面的內容,並與其保持同步",
+ "Calendar": "日曆",
+ "Timeline": "時間軸",
+ "Workload": "工作量",
+ "Chart": "圖表",
+ "Embed": "嵌入",
+ "View": "檢視",
+ "Table view": "表格檢視",
+ "Comment — on the block with the caret, or on this page": "註解 — 針對游標所在的區塊,或此頁面",
+ "New… — page, journal, issue": "新增… — 頁面、日誌、項目",
+ "Issues in columns": "依欄排列的項目",
+ "Issues, one to a line": "項目,每行一個",
+ "Issues in rows and columns": "依列與欄排列的項目",
+ "Issues as cards": "以卡片顯示的項目",
+ "Issues on their dates": "依日期排列的項目",
+ "Issues across time": "依時間展開的項目",
+ "Issues by person": "依人員排列的項目",
}
diff --git a/spaces/src/icons.ts b/spaces/src/icons.ts
index d54720bd..b0f10b0f 100644
--- a/spaces/src/icons.ts
+++ b/spaces/src/icons.ts
@@ -79,6 +79,9 @@ export const ICONS = {
tag: svg('<path d="M20.59 13.41 12 22l-9-9V3h10l7.59 7.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/>'),
scale: svg('<path d="M12 3v18"/><path d="M5 7h14"/><path d="M5 7 2 14h6z"/><path d="M19 7l-3 7h6z"/><path d="M8 21h8"/>'),
pen: svg('<path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><line x1="2" y1="2" x2="9.5" y2="9.5"/>'),
+ // slides' chart glyph (bars on an axis): the Chart insert. Not `graph`,
+ // which is the Graph view's network of pages, beside it in the bar.
+ chart: svg('<path d="M3 3v16a2 2 0 0 0 2 2h16"/><path d="M18 17V9"/><path d="M13 17V5"/><path d="M8 17v-3"/>'),
graph: svg('<circle cx="5" cy="18" r="2.5"/><circle cx="12" cy="5.5" r="2.5"/><circle cx="19" cy="16" r="2.5"/><line x1="6.6" y1="16.1" x2="10.4" y2="7.4"/><line x1="14.2" y1="7.3" x2="17.6" y2="13.6"/><line x1="7.5" y1="17.6" x2="16.5" y2="16.3"/>'),
compass: svg('<circle cx="12" cy="12" r="10"/><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88"/>'),
hash: svg('<line x1="4" y1="9" x2="20" y2="9"/><line x1="4" y1="15" x2="20" y2="15"/><line x1="10" y1="3" x2="8" y2="21"/><line x1="16" y1="3" x2="14" y2="21"/>'),
diff --git a/spaces/src/inserts.ts b/spaces/src/inserts.ts
new file mode 100644
index 00000000..29db9fe8
--- /dev/null
+++ b/spaces/src/inserts.ts
@@ -0,0 +1,176 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+/**
+ * WHAT YOU CAN ADD TO A PAGE, declared once: the families the top bar's insert
+ * group shows, and the order the `/` menu lists.
+ *
+ * Slides' insert group is one button per KIND of thing (Text, Shape, Image,
+ * Media, Table, Chart, Code, then Comment). A kind with variants opens a small
+ * menu of them, and a kind with one member inserts it directly. Spaces takes
+ * that shape: Text ▾, Image ▾, Table, Chart, View ▾, Code, Embed, then Comment.
+ * The bar group and `/` both read this table, so the two can never offer
+ * different families, orders or names.
+ *
+ * A family whose block type this build does not have is left out, and so is
+ * any member whose type is missing. A family left with ONE member becomes a
+ * plain button. So when Chart or Embed exists on a build, it appears in its
+ * place, and when maths joins Code, Code grows a menu, without any change
+ * here. The diagram block will be ONE more entry, between View and Code.
+ *
+ * Labels are ENGLISH, the catalog keys: callers t() them at render time, never
+ * here (a module-level t() freezes the string before the locale is known).
+ */
+import type { Block } from './model'
+import type { IconName } from './icons'
+import { SPEC, MENU_SPECS } from './blocks.ts'
+import { VIEW_LAYOUTS } from './fields.ts'
+
+export interface InsertItem {
+ /** unique within the table: the type, or `type:variant` */
+ key: string
+ type: string
+ label: string
+ hint: string
+ icon: IconName
+ /** after the type's own init: the variant (a view's layout, a clip's kind) */
+ init?: (b: Block) => void
+ /** a rule before this member in the family's menu */
+ rule?: boolean
+}
+
+export interface InsertFamily {
+ id: string
+ /** the button's label (English) */
+ label: string
+ icon: IconName
+ /** the button's tooltip and accessible name (English) */
+ tip: string
+ items: InsertItem[]
+}
+
+type Entry = string | (Partial<InsertItem> & { type: string; when?: () => boolean })
+
+/**
+ * A saved view of the issues, in one layout. `board` is the absent key.
+ * Written `label:`/`hint:` so build-spaces-i18n.mjs sweeps them for the catalogs.
+ */
+const view = ({ layout, label, hint }: { layout: string; label: string; hint: string }): Entry => ({
+ type: 'view', key: `view:${layout}`, label, hint,
+ init: (b) => {
+ if (layout === 'board') delete (b as { layout?: unknown }).layout
+ else (b as { layout?: unknown }).layout = layout
+ },
+ when: () => (VIEW_LAYOUTS as readonly string[]).includes(layout),
+})
+
+const TABLE: Array<Omit<InsertFamily, 'items'> & { items: Entry[] }> = [
+ {
+ id: 'text', label: 'Text', icon: 'text',
+ tip: 'Add text — a heading, a list, a quote, a callout or a divider',
+ items: ['p', 'h1', 'h2', 'h3', 'quote', 'callout', 'toggle', 'bullet', 'number', 'todo', 'divider'],
+ },
+ {
+ id: 'image', label: 'Image', icon: 'image',
+ tip: 'Add an image, a video, audio or a card',
+ items: [
+ 'image',
+ { type: 'media', key: 'media:video', label: 'Video', hint: 'Plays in the page', init: (b) => { b.kind = 'video' } },
+ { type: 'media', key: 'media:audio', label: 'Audio', hint: 'Plays in the page', init: (b) => { b.kind = 'audio' } },
+ // what the dialog that fills it is called, and what it is
+ { type: 'link', label: 'Link card', rule: true },
+ 'pagelink',
+ ],
+ },
+ {
+ id: 'table', label: 'Table', icon: 'table',
+ tip: 'Add a table — edit the cells in place',
+ items: ['table'],
+ },
+ {
+ id: 'chart', label: 'Chart', icon: 'chart',
+ tip: 'Add a chart of the issues in this space',
+ items: ['chart'],
+ },
+ {
+ id: 'view', label: 'View', icon: 'board',
+ tip: 'Add a view of the issues in this space — a board, a list, a table or a gallery',
+ items: [
+ view({ layout: 'board', label: 'Board', hint: 'Issues in columns' }),
+ view({ layout: 'list', label: 'List', hint: 'Issues, one to a line' }),
+ view({ layout: 'table', label: 'Table view', hint: 'Issues in rows and columns' }),
+ view({ layout: 'gallery', label: 'Gallery', hint: 'Issues as cards' }),
+ view({ layout: 'calendar', label: 'Calendar', hint: 'Issues on their dates' }),
+ view({ layout: 'gantt', label: 'Timeline', hint: 'Issues across time' }),
+ view({ layout: 'workload', label: 'Workload', hint: 'Issues by person' }),
+ // not a view of the issues but a surface you arrange by hand — the
+ // diagram family will be its home when it exists
+ { type: 'canvas', rule: true },
+ ],
+ },
+ // THE DIAGRAM BLOCK goes here, as one entry — a family with id 'diagram',
+ // its label, icon and tip, and items: ['diagram'].
+ {
+ id: 'code', label: 'Code', icon: 'code',
+ tip: 'Add a code block',
+ items: ['code', 'math'],
+ },
+ {
+ id: 'embed', label: 'Embed', icon: 'page',
+ tip: 'Add another page’s content, kept in step with it',
+ items: ['embed'],
+ },
+]
+
+/** The families this build can offer, each with the members it has. */
+export function insertFamilies(): InsertFamily[] {
+ const out: InsertFamily[] = []
+ for (const f of TABLE) {
+ const items: InsertItem[] = []
+ for (const e of f.items) {
+ const x = typeof e === 'string' ? { type: e } : e
+ const spec = SPEC.get(x.type)
+ if (!spec || spec.unlisted) continue
+ if ('when' in x && x.when && !x.when()) continue
+ items.push({
+ key: x.key ?? x.type, type: x.type,
+ label: x.label ?? spec.label, hint: x.hint ?? spec.hint, icon: x.icon ?? spec.icon,
+ init: x.init, rule: x.rule && items.length > 0,
+ })
+ }
+ if (items.length) out.push({ id: f.id, label: f.label, icon: f.icon, tip: f.tip, items })
+ }
+ return out
+}
+
+/** Every member in family order — the `/` menu's list. */
+export function insertItems(): InsertItem[] {
+ return insertFamilies().flatMap((f) => f.items)
+}
+
+/**
+ * How a LIST of the families is sectioned (the `/` menu, the folded ⋯): a
+ * family with variants under its own caption, and a run of one-member families
+ * set apart by a rule — a caption reading "Table" over a row reading "Table"
+ * says nothing twice.
+ */
+export interface InsertSection { caption?: string; rule?: boolean; items: InsertItem[] }
+export function insertSections(): InsertSection[] {
+ const out: InsertSection[] = []
+ let run: InsertSection | null = null
+ for (const f of insertFamilies()) {
+ if (f.items.length > 1) {
+ run = null
+ out.push({ caption: f.label, items: f.items })
+ } else {
+ if (!run) { run = { rule: out.length > 0, items: [] }; out.push(run) }
+ run.items.push(...f.items)
+ }
+ }
+ return out
+}
+
+/** Listed block types no family places: the rig holds this to empty. */
+export function unplacedTypes(): string[] {
+ const placed = new Set(insertItems().map((i) => i.type))
+ return MENU_SPECS.map((s) => s.type).filter((t) => !placed.has(t))
+}
diff --git a/spaces/src/styles.css b/spaces/src/styles.css
index 2f59ef37..0c4849eb 100644
--- a/spaces/src/styles.css
+++ b/spaces/src/styles.css
@@ -2654,3 +2654,35 @@ body.sp-canvas-dragging { user-select: none; cursor: grabbing; }
outline: 2px solid var(--accent-ink); outline-offset: -2px;
}
+
+/* ————— the insert group (inserts.ts) —————
+ Slides' insert group: one button per kind, icon + word, on the bar's 30px
+ grid (.sp-btn is slides' .ed-btn), 6px apart inside the group. The words go
+ at the compact tier with every other label (.sp-btnlabel); at the fold the
+ whole group moves into ⋯, under its captions. Reading view has nothing to
+ insert into, so the group leaves the bar there. */
+.sp-bar-fold .sp-group-insert { display: none; }
+.sp-app.sp-reading .sp-group-insert { display: none; }
+/* the / menu's sections: the families' captions, and a rule before a run of
+ one-member kinds — the menus' caption, in the popover's list */
+.sp-results-cap {
+ font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
+ color: var(--muted); padding: 10px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line);
+}
+.sp-results-cap:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
+.sp-results-rule { height: 1px; background: var(--line); margin: 4px 2px; }
+
+/* the page list's + ▾: New page, and the caret for the other ways a page
+ arrives. Two ghost halves that touch, like the Save split's two halves. */
+.sp-newsplit { display: inline-flex; align-items: stretch; }
+.sp-newsplit > .sp-newpage { border-start-end-radius: 0; border-end-end-radius: 0; padding-inline: 7px 5px; }
+.sp-newsplit .sp-newmenu { display: flex; align-items: stretch; }
+.sp-newsplit .sp-newmenu > .sp-btn {
+ border-start-start-radius: 0; border-end-start-radius: 0;
+ padding-inline: 4px 6px; color: var(--muted);
+}
+@media (pointer: coarse), (max-width: 700px) {
+ .sp-newsplit > .sp-newpage, .sp-newsplit .sp-newmenu > .sp-btn {
+ min-width: var(--tap); min-height: var(--tap); justify-content: center;
+ }
+}