Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
spaces: reach the whole view block, and export what a board actually holds (#245)
nyblnet5daa2402154b
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.mdindex 04838815..510c8dc8 100644--- a/docs/DECISIONS.md+++ b/docs/DECISIONS.md@@ -1743,6 +1743,7 @@ in the ruling below. It is still unimplemented, and now it is not free: astored sort and a hand-dragged order contradict each other, and which one winsis a format decision, not a rendering detail. Whoever needs sort settles thatfirst. Until then a `sort` key round-trips untouched and is ignored.+*(SETTLED 2026-08-06 — see "A sorted board is a different question" below.)***Why the filter is two keys.** `is` (a field's values) and `open` (a phase).A filter language grows without limit and can never shrink — every operator is@@ -1765,6 +1766,53 @@ same picker the issue's own header strip opens, through the same writer(`editor.applyField` → `fields.propHtml`). There is exactly one place where`value` and `html` are written, and there must stay exactly one.+## 2026-08-06 — A sorted board is a different question, and it never eats the hand order++**Decision.** `sort?: ViewSort[]` on the `view` block ships, where+`ViewSort = { key, dir?: 'asc'|'desc' }`. Absent means the page order. The entry+above deferred this until somebody settled which of a stored sort and a+hand-dragged order wins; this is that settlement, and it also makes `layout` and+`groupBy` reachable, which they were not.++**A sort never overwrites the manual order — it OVERRIDES it, for as long as it+is there.** The two orders live in different places: the hand order is+`doc.pages`, the sort is a key on one block. Nothing about sorting a view+touches the page array, so clearing the sort returns the board to exactly the+arrangement it had, and a second view of the same issues sorted differently+takes nothing away from the first. That is the whole reason the contradiction+dissolves rather than needing a winner: they were never competing for the same+storage. "Manual order" is the first item in the Sort menu because it is the+absence of a sort, not a sort called manual.++**A sorted board stops offering positional drops.** With a sort in force the+order within a column is computed, so a drop position would write into+`doc.pages` an order the next paint discards — a gesture that appears to do+nothing and leaves an undo step behind. The column still highlights and still+accepts the card (the value change is real); only the insertion point stops+being offered. `dropIssue` takes a null aim for exactly this.++**Ordering rules, because each one is silently wrong the other way.** A select+sorts by its DECLARED position — "Backlog, Todo, In progress, Done" is a+direction, and alphabetising it throws away the only thing the list was saying.+An UNSET value sorts last in BOTH directions: it is not the smallest value, it+is the absence of one, and flipping the direction must not promote every blank+to the top. A value a NEWER build wrote has no declared seat and sorts after+everything this build knows, rather than leading a board with a status nobody+here can read. Ties keep the page order (a stable sort), so a hand-arranged+board still reads that way within each band. A sort key naming a field this+build has no schema for is skipped and the view SAYS SO — the same honesty rule+`unknownFilterKeys` already carries.++**An ARRAY holding one entry.** The editor only ever writes one key; the format+takes a list because that is the shape already published in the ruling below,+and because a second key can be added later without touching a file, where+widening a scalar afterwards could not be done at all.++**Storing a default is storing a lie.** Choosing Board, or grouping by `status`,+or Manual order DELETES the key rather than writing what absence already means,+so a view somebody switched to a list and back is byte-identical to one that was+never touched — the same rule the filter already followed.+## 2026-08-05 — An issue is a page: the tracker format for bento/spaces**Decision.** bento/spaces gains an opinionated, Linear-shaped issue tracker.diff --git a/scripts/size-budgets.json b/scripts/size-budgets.jsonindex 70685fa4..b437471c 100644--- a/scripts/size-budgets.json+++ b/scripts/size-budgets.json@@ -3,8 +3,8 @@"shells": {"spaces": {"path": "spaces/dist-single/Bento_Spaces.bento.html",- "max": 143360,- "//": "140 KiB. Raised from 132: magic notes cost ~4.6 KB compressed — a recursive-descent evaluator (no eval, ever: block html comes from a file somebody mailed you), a small unit table, date and clock arithmetic, the derived answer in the renderer and the typing preview. Headroom is deliberate: the shell is mostly a zlib block and zlib differs across node versions — one commit measured 130,095 B on node 26 locally and 131,246 B on CI node 24, so a tight ceiling fails in CI for no reason. CI is the number that counts."+ "max": 147456,+ "//": "144 KiB. Raised from 140: the view controls (layout, group-by, sort) and the board's Markdown export cost ~3.4 KB compressed — the sort engine, three popovers and 17 strings × 8 locales, which is most of it. Measured with magic notes, daily notes and the mobile fold already in: 142,674 B, which is 99.5% of the old ceiling and 686 B of headroom. That is not enough: the shell is mostly a zlib block and zlib differs across node versions — one commit measured 130,095 B on node 26 locally and 131,246 B on CI node 24, so this would have failed CI while passing here. CI is the number that counts."}}}diff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.tsindex 5f440dd4..bf9af559 100644--- a/scripts/test-spaces-model.ts+++ b/scripts/test-spaces-model.ts@@ -36,6 +36,7 @@ import {DEFAULT_FIELDS, fieldsOf, fieldByKey, optionOf, propHtml, propBlock,valuesOf, isIssue, issuesOf, headerLength, propBlockOf,passesFilter, filterCount, unknownFilterKeys, phaseField, isOpenPhase, reorderPages,+ sortRows, unknownSortKeys, type IssueRow,} from '../spaces/src/fields.ts'import { inlineHtml, parseNote, planImport } from '../spaces/src/markdown.ts'import { planUpdatePage } from '../spaces/src/agent.ts'@@ -547,7 +548,8 @@ for (const [label, input, err] of [{ const b: Block = { id: 'x', type: 'callout', tone: 'caution' }; spec.init!(b); ok(b.tone === 'caution', 'init never overwrites a tone that is already there') }const md = (b: Partial<Block>, text = 'x') =>- spec.toMd!({ id: 'c', type: 'callout', ...b } as Block, text, '', () => undefined).join('\n')+ spec.toMd!({ id: 'c', type: 'callout', ...b } as Block, text, '',+ { titleOf: () => undefined, rowsOf: () => [] }).join('\n')ok(md({ tone: 'warning' }) === '> [!WARNING]\n> x', 'a callout exports as a GitHub alert')ok(md({}) === '> [!NOTE]\n> x', 'an absent tone exports as NOTE')ok(md({ tone: 'success' }) === '> [!SUCCESS]\n> x',@@ -1372,8 +1374,111 @@ for (const [label, input, err] of ['the board refuses to wire itself in a locked space or in reading view')ok(/const own = opts\.editable && field && propBlockOf/.test(ren),'the renderer emits a card status BUTTON only for an editable document')- ok(/if \(opts\.editable\) \{\s*const on = /.test(ren),- '…and the view controls likewise, so a reader and a printout get neither')+ // …and EVERY view control likewise. Pinned as "each control name appears+ // between the editable guard and the head being mounted", rather than to one+ // line of the block — this assertion used to name the first statement inside+ // the guard, so adding a control above it broke the test without breaking+ // anything, and adding one BELOW the guard would have broken the app without+ // breaking the test.+ const guarded = ren.slice(ren.indexOf('if (opts.editable) {'), ren.indexOf('host.appendChild(head)'))+ const controls = ['viewLayout', 'viewGroup', 'viewSort', 'viewOpen', 'viewFilter']+ ok(guarded.length > 0 && controls.every((c) => guarded.includes(c)),+ `…and the view controls likewise, so a reader and a printout get neither (${+ controls.filter((c) => !guarded.includes(c)).join(', ') || 'all inside the guard'})`)+ // the whole point of the guard is that it is the ONLY place they are made+ ok(controls.every((c) => (ren.split(c).length - 1) === (guarded.split(c).length - 1)),+ 'no view control is created outside that guard')+}++// ---- a view's ORDER --------------------------------------------------------+// The properties that go wrong silently: a sort that reorders a board somebody+// arranged by hand, a blank promoted to the top when the direction flips, and a+// select sorted into alphabetical order, which throws away the one thing a+// status list was telling you.+{+ const doc = { fields: DEFAULT_FIELDS } as unknown as SpacesDoc+ const row = (id: string, v: Record<string, unknown>): IssueRow =>+ ({ page: { id, title: id, blocks: [] } as Page, values: new Map(Object.entries(v)) })++ const rows = [+ row('a', { status: 'done', estimate: 3 }),+ row('b', { status: 'backlog', estimate: 1 }),+ row('c', { status: 'doing' }),+ row('d', { status: 'todo', estimate: 2 }),+ ]+ const ids = (rs: IssueRow[]) => rs.map((r) => r.page.id).join('')++ ok(sortRows(doc, rows, undefined) === rows,+ 'no sort returns the SAME array — a view nobody sorted keeps the page order it had')+ ok(sortRows(doc, rows, []) === rows, 'and so does an empty one')+ ok(ids(sortRows(doc, rows, [{ key: 'status' }])) === 'bdca',+ 'a select sorts by its DECLARED order (backlog, todo, doing, done), never alphabetically')+ ok(ids(sortRows(doc, rows, [{ key: 'status', dir: 'desc' }])) === 'acdb',+ '…and reverses on request')+ ok(ids(sortRows(doc, rows, [{ key: 'estimate' }])) === 'bdac',+ 'a number sorts numerically, with the one that has none at the end')++ // the one that bites: absence is not a small value+ const asc = sortRows(doc, rows, [{ key: 'estimate' }])+ const desc = sortRows(doc, rows, [{ key: 'estimate', dir: 'desc' }])+ ok(asc[asc.length - 1].page.id === 'c' && desc[desc.length - 1].page.id === 'c',+ 'an UNSET value sorts last in BOTH directions — a blank estimate is not the cheapest issue')++ // ties keep the page order, so a hand-arranged board still reads that way+ // inside each band+ const tied = [row('x', { status: 'todo' }), row('y', { status: 'todo' }), row('z', { status: 'todo' })]+ ok(ids(sortRows(doc, tied, [{ key: 'status' }])) === 'xyz', 'ties are stable — page order survives')++ // additivity: a key from a newer build is skipped and SAID SO, never guessed+ ok(sortRows(doc, rows, [{ key: 'sprint' }]) === rows,+ 'a sort key this build has no field for changes nothing')+ ok(unknownSortKeys(doc, [{ key: 'sprint' }, { key: 'status' }]).join() === 'sprint',+ '…and is reported, so the view can say the order is not the one its author asked for')+ ok(unknownSortKeys(doc, undefined).length === 0 && unknownSortKeys(doc, 'nonsense').length === 0,+ 'a malformed sort reports nothing rather than throwing — it came out of a file someone sent you')++ // a value a newer build wrote has no declared seat: it goes last, not first+ const newer = [row('m', { status: 'todo' }), row('n', { status: 'blocked' })]+ ok(ids(sortRows(doc, newer, [{ key: 'status' }])) === 'mn',+ 'a status from a newer build sorts after every one this build knows')+}++// ---- what a board and a field EXPORT ---------------------------------------+// The readable `html` on a prop block is the whole reason the format degrades+// instead of vanishing. The exporter is its most important consumer and was the+// one place ignoring it.+{+ const propSpec = SPEC.get('prop')!+ const ctx = { titleOf: () => undefined, rowsOf: () => [] }+ const line = propSpec.toMd!(+ { id: 'b', type: 'prop', key: 'status', value: 'doing', html: 'Status: In progress' } as Block,+ 'Status: In progress', '', ctx)[0]+ ok(line === '**Status:** In progress',+ `a field exports the words a reader can use, not the option id (got ${line})`)+ ok(!line.includes('doing'), '…and the raw value does not appear at all')++ // a schema whose label holds a colon, and a prop whose html is not the+ // expected shape: emitted whole rather than split at a guess+ const odd = propSpec.toMd!({ id: 'b', type: 'prop', key: 'k', value: 'v', html: 'plain' } as Block,+ 'plain', '', ctx)[0]+ ok(odd === '**plain**', `an unexpected readable form is exported whole (got ${odd})`)++ const viewSpec = SPEC.get('view')!+ const md = viewSpec.toMd!({ id: 'v', type: 'view' } as Block, 'Issues', '', {+ titleOf: () => undefined,+ rowsOf: () => [+ { id: 'p1', title: 'First', group: 'Todo', fields: 'High' },+ { id: 'p2', title: 'Second', group: 'Todo', fields: '' },+ { id: 'p3', title: 'Third', group: 'Done', fields: '' },+ ],+ }).join('\n')+ ok(md.includes('[First](#p/p1)') && md.includes('[Third](#p/p3)'),+ 'a board exports its ISSUES, each one a link back to its page')+ ok(md.includes('**Todo**') && md.includes('**Done**'), '…grouped as the board groups them')+ ok(md.indexOf('**Todo**') < md.indexOf('**Done**'), '…in the board\'s column order')+ ok(md.includes('[First](#p/p1) — High'), '…carrying the same chips the card shows')+ ok(viewSpec.toMd!({ id: 'v', type: 'view' } as Block, 'Issues', '', ctx).join('\n').includes('_No issues._'),+ 'an empty board says so rather than exporting a bare heading')}// ---- ONE answer to "what is this nested under" ------------------------------diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex 412c4c20..a67a975e 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -89,6 +89,32 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.the API cannot put anything in a file that the app itself could not havewritten.+- **A board can be a list, grouped by any field, in any order.** The view's+ controls were two buttons; they are five. **Board ⇄ List** switches the shape —+ the list has always rendered, but nothing in the app could produce one, so a+ view could hold a layout you could not undo. **Group** picks the field the+ columns come from. **Sort** orders by any field, and clicking the field you+ are already sorted by reverses it; **Manual order** is always the first item,+ because a board somebody arranged by dragging must be one click from getting+ that order back. A select sorts by its declared order, never alphabetically —+ "Backlog, Todo, In progress, Done" is a direction — and an unset value sorts+ last in both directions, because a blank estimate is not the cheapest issue.+ A sorted board still accepts a dragged card; it just stops pretending you can+ choose where in the column it lands.++- **Fixed: a field exported as `status: doing`.** Every field block carries a+ readable form — "Status: In progress" — which is the whole reason the format+ degrades instead of vanishing for an older build, a thumbnailer or a grep. The+ Markdown export was the one consumer ignoring it, and published the internal+ option id to the audience with no schema to look it up in. It now exports+ **Status:** In progress.++- **Fixed: a board exported as the word "Issues".** Downloading a tracker as+ Markdown gave you the view's title in italics and nothing else. A board now+ exports its issues — grouped as the board groups them, in the board's column+ order, each one a link back to its page, carrying the same chips the card+ shows — with the same filter and sort the screen is using applied.+- **A new space opens with a tracker in it.** The starter space gains a**Tracker** page — a board, and five issues nested under it that explainthemselves: open a card and you are in an ordinary page with fields along thediff --git a/spaces/README.md b/spaces/README.mdindex 862c35fd..28830926 100644--- a/spaces/README.md+++ b/spaces/README.md@@ -141,5 +141,7 @@ pages are one document rather than one file each.and a token RGA over `html`, which is the same shape — but genericizing it isits own project, and PLATFORM §10 permits shipping without collab rather thanwith a half-secure version.-- **Tables, embeds, and databases.** Deliberate: the format is permanent, so a- block type ships when its model is right, not when its UI is ready.+- **Tables and embeds.** Deliberate: the format is permanent, so a block type+ ships when its model is right, not when its UI is ready. (Databases DID ship —+ as the tracker: `doc.fields` is the schema, a `prop` block is a value, and a+ `view` block is a board or a list of them. `src/fields.ts` is the core.)diff --git a/spaces/src/about.ts b/spaces/src/about.tsindex 3755d7a1..a488261c 100644--- a/spaces/src/about.ts+++ b/spaces/src/about.ts@@ -15,8 +15,12 @@ import {import { clearVersions, clearRecovery } from '../../kernel/src/autosave.ts'import { t, localeChoices, locale, setLocale } from './i18n'import { inertBody, esc } from './sanitize'-import { SPEC, mdLayout } from './blocks'+import { SPEC, mdLayout, type MdCtx } from './blocks'+import {+ issuesOf, passesFilter, sortRows, fieldByKey, optionOf, fieldsOf,+} from './fields'import type { Store } from './store'+import type { Block } from './model'export interface AboutHooks {store: Store@@ -233,6 +237,47 @@ export function openAbout({ store, onRepaint, onSaveCopy, onImport }: AboutHooks*/export function toMarkdown(store: Store): string {const out: string[] = []+ const ctx: MdCtx = {+ titleOf: (id) => store.index.page.get(id)?.title,+ // DERIVED THE SAME WAY THE SCREEN DERIVES IT — same filter, same sort, same+ // grouping — so the file you download is the board you were looking at. A+ // second traversal here is how an export starts quietly disagreeing with+ // the app.+ rowsOf: (b: Block) => {+ const doc = store.doc+ const groupKey = String((b as { groupBy?: unknown }).groupBy ?? 'status')+ const grouped = String((b as { layout?: unknown }).layout ?? 'board') !== 'list'+ const field = fieldByKey(doc, groupKey)+ const rows = sortRows(+ doc,+ issuesOf(doc).filter((r) => passesFilter(doc, r.values, (b as { filter?: unknown }).filter)),+ (b as { sort?: unknown }).sort)+ // the board's column order, so an export reads top-to-bottom the way the+ // board reads left-to-right+ const order = new Map((field?.options ?? []).map((o, i) => [o.id, i]))+ const seat = (r: (typeof rows)[number]) =>+ order.get(String(r.values.get(groupKey) ?? '')) ?? Number.MAX_SAFE_INTEGER+ const ordered = grouped+ ? rows.map((r, i) => ({ r, i })).sort((a, c) => (seat(a.r) - seat(c.r)) || (a.i - c.i)).map((x) => x.r)+ : rows+ return ordered.map((r) => ({+ id: r.page.id,+ title: r.page.title,+ group: grouped+ ? (optionOf(field, r.values.get(groupKey))?.label ?? t('Other'))+ : undefined,+ // the same chips the card shows, in the same words+ fields: fieldsOf(doc)+ .filter((f) => f.key !== groupKey)+ .map((f) => {+ const v = r.values.get(f.key)+ if (v === undefined || v === null || v === '') return ''+ return optionOf(f, v)?.label ?? (Array.isArray(v) ? v.join(', ') : String(v))+ })+ .filter(Boolean).join(' · '),+ }))+ },+ }// ONE traversal, store.tree() — not a second walk over index.children.// That second walk is how a page-tree CYCLE dropped pages out of the export// while they sat in the file: neither page is reachable from the root, so@@ -253,9 +298,7 @@ export function toMarkdown(store: Store): string {// it is declared. An UNKNOWN type — a file written by a newer build —// falls through to its text, which is the honest default.const spec = SPEC.get(b.type)- const lines = spec?.toMd- ? spec.toMd(b, text, indent, (id) => store.index.page.get(id)?.title)- : [text]+ const lines = spec?.toMd ? spec.toMd(b, text, indent, ctx) : [text]// PER LINE, not per returned element. A spec returns ELEMENTS, and an// element can hold newlines: a code block's body is one multi-line// string, and htmlToMd turns <br> into a newline in ordinary text. Anydiff --git a/spaces/src/blocks.ts b/spaces/src/blocks.tsindex 426605c9..7465a868 100644--- a/spaces/src/blocks.ts+++ b/spaces/src/blocks.ts@@ -87,7 +87,22 @@ export interface BlockSpec {* inline markdown; `indent` is set for a nested block. Absent = the text* alone, which is also what an UNKNOWN type gets.*/- toMd?: (b: Block, text: string, indent: string, titleOf: (id: string) => string | undefined) => string[]+ toMd?: (b: Block, text: string, indent: string, ctx: MdCtx) => string[]+}++/**+ * What the exporter can answer for a block that describes OTHER content.+ *+ * A pagelink needs one title; a view needs the issues it stands for. Both are+ * questions about the document, and a block cannot see the document — so they+ * arrive here rather than as a second export path that would drift from this+ * one. A context object rather than a growing parameter list, because the next+ * derived block type will want a third question.+ */+export interface MdCtx {+ titleOf: (id: string) => string | undefined+ /** the rows a `view` block stands for, already filtered and ordered */+ rowsOf: (b: Block) => Array<{ id: string; title: string; group?: string; fields: string }>}export const SPECS: BlockSpec[] = [@@ -193,7 +208,7 @@ export const SPECS: BlockSpec[] = [{type: 'pagelink', label: 'Link to page', hint: 'A card that opens a page', icon: 'link',tag: 'div', custom: true,- toMd: (b, _text, _indent, titleOf) => [`→ [[${titleOf(String(b.page)) ?? '?'}]]`],+ toMd: (b, _text, _indent, ctx) => [`→ [[${ctx.titleOf(String(b.page)) ?? '?'}]]`],},{// A FIELD VALUE on a page. Unlisted: fields are added from the issue header,@@ -204,7 +219,21 @@ export const SPECS: BlockSpec[] = [// is the whole reason values are blocks rather than page keys.type: 'prop', label: 'Field', hint: 'A typed value on this page', icon: 'tag',tag: 'div', custom: true, unlisted: true,- toMd: (b) => [`**${String((b as { key?: unknown }).key ?? 'field')}:** ${String((b as { value?: unknown }).value ?? '')}`],+ // FROM THE READABLE FORM, not from the raw value. `html` already says+ // "Status: In progress" — that string is the entire reason a prop block+ // degrades instead of vanishing, and exporting `**status:** doing` from+ // beside it published the option ID to the one audience that has no schema+ // to look it up in. `text` is that html, already converted.+ //+ // The label is bolded by splitting at the first ": " the readable form+ // itself uses; anything unexpected is emitted whole rather than guessed at.+ toMd: (b, text) => {+ const at = text.indexOf(': ')+ const raw = String((b as { value?: unknown }).value ?? '')+ if (at < 0) return [`**${text || String((b as { key?: unknown }).key ?? 'field')}**`]+ const shown = text.slice(at + 2)+ return [`**${text.slice(0, at)}:** ${shown || raw || '—'}`]+ },},{// A SAVED VIEW — a board or a list of the issues in this space. Also just a@@ -212,7 +241,28 @@ export const SPECS: BlockSpec[] = [// anything else, and an older build shows its description instead.type: 'view', label: 'Board or list', hint: 'Issues, grouped or listed', icon: 'board',tag: 'div', custom: true,- toMd: (b) => [`_${String(b.html ?? 'View')}_`],+ // THE ISSUES, not the word "Issues". A board exported as its own italic+ // title and nothing else — so a tracker downloaded as Markdown showed a+ // heading where the work was, and a reader had to reconstruct the board+ // from the pages that follow. The rows are derived (the export applies the+ // same filter and sort the screen does), which is why they arrive through+ // the context rather than off the block.+ toMd: (b, text, indent, ctx) => {+ const rows = ctx.rowsOf(b)+ const out = [`**${text || 'Issues'}**`, '']+ if (!rows.length) return [...out, `${indent}_No issues._`]+ let group: string | undefined+ for (const r of rows) {+ // grouped exactly as the board groups, and a flat list when it is one+ if (r.group !== undefined && r.group !== group) {+ group = r.group+ out.push('', `${indent}**${group}**`, '')+ }+ const meta = r.fields ? ` — ${r.fields}` : ''+ out.push(`${indent}- [${r.title}](#p/${r.id})${meta}`)+ }+ return out+ },},{type: 'image', label: 'Image', hint: 'Embedded in the file', icon: 'image',diff --git a/spaces/src/editor.ts b/spaces/src/editor.tsindex b71eecd0..349cf6bb 100644--- a/spaces/src/editor.ts+++ b/spaces/src/editor.ts@@ -16,7 +16,8 @@ import { canonicalize, escText, sanitizeInline, textOf } from './sanitize'import { MENU_SPECS, MD_SPECS, SPEC, CALLOUT_TONES } from './blocks'import {fieldByKey, fieldsOf, propHtml, propBlock, propBlockOf, isIssue, headerLength,- reorderPages, columnMoves, ISSUE_FIELDS, type DropAim, type FieldSpec, type ViewFilter,+ reorderPages, columnMoves, ISSUE_FIELDS,+ type DropAim, type FieldSpec, type ViewFilter, type ViewSort,} from './fields'import { planImport, type SourceFile } from './markdown'import { countOutsideTags, replaceOutsideTags } from './findreplace'@@ -213,10 +214,10 @@ export class Editor {if (this.isPhone()) {menu.append(this.menuItem('undo', t('Undo (⌘Z)'), '', () => {close(); this.store.undo(); this.repaint()- }, !this.store.canUndo))+ }, { off: !this.store.canUndo }))menu.append(this.menuItem('redo', t('Redo (⇧⌘Z)'), '', () => {close(); this.store.redo(); this.repaint()- }, !this.store.canRedo))+ }, { off: !this.store.canRedo }))}for (const a of secondary) {menu.append(this.menuItem(a.icon, a.label, a.hint, () => { close(); a.run() }))@@ -372,11 +373,29 @@ export class Editor {return wrap}- private menuItem(icon: IconName, label: string, hint: string, onClick: () => void, off = false): HTMLElement {+ /**+ * One row in a dropdown menu.+ *+ * `state` carries BOTH meanings the menus need, because they arrived from+ * two directions and mean different things: `off` is a command that exists+ * but cannot run right now (folded undo/redo on a phone — disabled, not+ * hidden, so the menu does not change shape as you edit), and `selected` is+ * the choice a view is currently on (layout, group-by, sort). A row can be+ * neither; nothing yet is both. They were separate 5th parameters on two+ * branches, which is exactly the collision an options object avoids.+ */+ private menuItem(+ icon: IconName,+ label: string,+ hint: string,+ onClick: () => void,+ state: { off?: boolean; selected?: boolean } = {},+ ): HTMLElement {const b = document.createElement('button')- b.className = 'sp-dditem' + (off ? ' sp-off' : '')+ b.className = 'sp-dditem' + (state.off ? ' sp-off' : '') + (state.selected ? ' sp-sel' : '')b.type = 'button'- if (off) b.setAttribute('aria-disabled', 'true')+ if (state.off) b.setAttribute('aria-disabled', 'true')+ if (state.selected) b.setAttribute('aria-current', 'true')b.setAttribute('role', 'menuitem')b.innerHTML = `<span class="sp-result-ico">${ICONS[icon]}</span>` +`<span class="sp-result-txt"><strong>${escapeHtml(label)}</strong>` +@@ -1031,6 +1050,20 @@ export class Editor {})const fb = v.querySelector<HTMLElement>('[data-view-filter]')fb?.addEventListener('click', () => this.openViewFilter(v.dataset.blockId!, fb))+ const lb = v.querySelector<HTMLElement>('[data-view-layout]')+ lb?.addEventListener('click', () => this.toggleViewLayout(v.dataset.blockId!))+ const gb = v.querySelector<HTMLElement>('[data-view-group]')+ gb?.addEventListener('click', () => this.openViewGroup(v.dataset.blockId!, gb))+ const sb = v.querySelector<HTMLElement>('[data-view-sort]')+ sb?.addEventListener('click', () => this.openViewSort(v.dataset.blockId!, sb))++ // A SORTED BOARD HAS NO HAND ORDER TO DROP INTO. The sort decides where a+ // card sits, so offering a drop position would write an order into+ // doc.pages that the very next paint discards — a gesture that appears to+ // do nothing, and a stray undo step. The column still accepts the card;+ // only the position within it stops being a question.+ const sorted = Array.isArray((vb as { sort?: unknown } | undefined)?.sort)+ && ((vb as { sort?: unknown[] }).sort!).length > 0for (const btn of v.querySelectorAll<HTMLElement>('[data-set-field]')) {btn.addEventListener('click', (e) => {@@ -1077,8 +1110,9 @@ export class Editor {col.addEventListener('dragover', (e) => {if (!e.dataTransfer?.types.includes('text/bento-issue')) returne.preventDefault()- const aim = this.aimAt(col, e.clientY)col.classList.add('sp-drop')+ if (sorted) return+ const aim = this.aimAt(col, e.clientY)if (aim.before) col.querySelector(`[data-issue="${CSS.escape(aim.before)}"]`)?.classList.add('sp-dropbefore')else col.classList.add('sp-dropend')})@@ -1086,7 +1120,7 @@ export class Editor {const moved = e.dataTransfer?.getData('text/bento-issue')if (!moved) returne.preventDefault()- const aim = this.aimAt(col, e.clientY)+ const aim = sorted ? null : this.aimAt(col, e.clientY)marks()this.dropIssue(moved, groupKey, col.dataset.group!, aim)})@@ -1111,7 +1145,7 @@ export class Editor {** Both halves are ONE commit, because one drag is one user action.*/- private dropIssue(pageId: string, key: string, optId: string, aim: DropAim): void {+ private dropIssue(pageId: string, key: string, optId: string, aim: DropAim | null): void {const s = this.storeconst page = s.index.page.get(pageId)const f = fieldByKey(s.doc, key)@@ -1121,10 +1155,13 @@ export class Editor {// The no-op test is about the COLUMN, not the page array — those are// different orders the moment a board has two columns, and judging by page// adjacency let a drop that visibly did nothing rewrite doc.pages.+ //+ // A null aim is a SORTED board: there is no position to land in, so the+ // drop is only ever the value change.const cards = [...document.querySelectorAll<HTMLElement>(`.sp-col[data-group="${CSS.escape(optId)}"] .sp-issue[data-issue]`)].map((c) => c.dataset.issue!)- const moves = columnMoves(cards, pageId, aim)- const order = moves ? reorderPages(s.doc.pages, pageId, aim) : null+ const moves = !!aim && columnMoves(cards, pageId, aim)+ const order = moves && aim ? reorderPages(s.doc.pages, pageId, aim) : nullif (!setting && !order) returns.commit(() => {@@ -1163,6 +1200,119 @@ export class Editor {this.paintPage()}+ /**+ * A small menu anchored to a button — a bottom sheet on a phone.+ *+ * Four of these had grown the same twelve lines of boilerplate (build, trap,+ * sheet-or-place, dismiss on a click away), which is three copies too many+ * for something whose dismissal behaviour has to be identical everywhere:+ * a menu that closes differently from the one beside it reads as a bug.+ */+ private popover(anchor: HTMLElement, build: (pop: HTMLElement) => void): void {+ this.closeOverlay()+ const pop = el('div', this.isDrawer() ? 'sp-pop sp-sheet' : 'sp-pop')+ pop.setAttribute('role', 'menu')+ this.trapAndClose(pop)+ build(pop)+ this.overlay = pop+ document.body.append(pop)+ if (this.isDrawer()) pop.classList.add('sp-sheet-in')+ else place(pop, anchor)+ const away = (ev: MouseEvent) => {+ if (!pop.contains(ev.target as Node)) { this.closeOverlay(); document.removeEventListener('mousedown', away) }+ }+ setTimeout(() => document.addEventListener('mousedown', away), 0)+ }++ /**+ * Edit a key on a `view` block — layout, groupBy, sort.+ *+ * The same discipline as editViewFilter: an edit that says "the default"+ * DELETES the key rather than storing it, so a view somebody switched to a+ * list and back is byte-identical to one that was never touched, and a file+ * written before this control existed stays that way.+ */+ private editView(blockId: string, key: 'layout' | 'groupBy' | 'sort', value: unknown): void {+ const s = this.store+ const b = s.block(blockId)+ if (!b || s.readOnly || this.reading) return+ s.commit(() => {+ const rec = b as unknown as Record<string, unknown>+ if (value === undefined || value === null) delete rec[key]+ else rec[key] = value+ }, { scope: 'page' })+ this.paintPage()+ }++ /** Board ⇄ list. `board` is the default, so it is stored as an ABSENT key. */+ private toggleViewLayout(blockId: string): void {+ const b = this.store.block(blockId)+ const now = String((b as { layout?: unknown } | undefined)?.layout ?? 'board')+ this.editView(blockId, 'layout', now === 'list' ? undefined : 'list')+ }++ /**+ * Which field the columns come from.+ *+ * Only fields with declared options are offered. A board's columns ARE the+ * option list — grouping by a free-text field would make one column per+ * distinct string, which is a pivot table wearing a board's clothes.+ */+ private openViewGroup(blockId: string, anchor: HTMLElement): void {+ const s = this.store+ const b = s.block(blockId)+ if (!b || s.readOnly || this.reading) return+ const now = String((b as { groupBy?: unknown }).groupBy ?? 'status')+ const groupable = fieldsOf(s.doc).filter((f) => f.options?.length)+ this.popover(anchor, (pop) => {+ for (const f of groupable) {+ pop.append(this.menuItem('board', f.label, '', () => {+ this.closeOverlay()+ // `status` is the default the renderer assumes, so choosing it clears+ // the key instead of writing what absence already means+ this.editView(blockId, 'groupBy', f.key === 'status' ? undefined : f.key)+ }, { selected: f.key === now }))+ }+ if (!groupable.length) pop.append(el('div', 'sp-fgroup', t('No field here has options to group by')))+ })+ }++ /**+ * The order. One key, though the format holds a list — see fields.ts.+ *+ * "Manual order" is the ABSENCE of a sort, not a sort called manual: it is+ * the page order, which is the order somebody arranged by dragging, and it+ * has to be reachable from here or a board is one click away from being+ * un-arrangeable forever.+ */+ private openViewSort(blockId: string, anchor: HTMLElement): void {+ const s = this.store+ const b = s.block(blockId)+ if (!b || s.readOnly || this.reading) return+ const cur = (Array.isArray((b as { sort?: unknown }).sort)+ ? ((b as { sort?: ViewSort[] }).sort ?? [])[0] : undefined) as ViewSort | undefined+ this.popover(anchor, (pop) => {+ pop.append(this.menuItem('grip', t('Manual order'), '', () => {+ this.closeOverlay()+ this.editView(blockId, 'sort', undefined)+ }, { selected: !cur }))+ pop.append(el('div', 'sp-fgroup', t('Sort')))+ for (const f of fieldsOf(s.doc)) {+ const mine = cur?.key === f.key+ // clicking the field you are already sorted by REVERSES it — the second+ // thing you want after "sort by priority" is "…the other way", and a+ // separate direction control for a one-key sort is a control nobody+ // finds+ const dir: 'asc' | 'desc' = mine && cur?.dir !== 'desc' ? 'desc' : 'asc'+ const hint = mine ? (cur?.dir === 'desc' ? t('Ascending') : t('Descending')) : ''+ pop.append(this.menuItem('arrowDown', f.label, hint, () => {+ this.closeOverlay()+ this.editView(blockId, 'sort', [dir === 'asc' ? { key: f.key } : { key: f.key, dir }])+ }, { selected: mine }))+ }+ })+ }+/** Toggle one value of one field in a view's filter. */private toggleViewValue(blockId: string, key: string, id: string): void {this.editViewFilter(blockId, (f) => {@@ -1189,12 +1339,8 @@ export class Editor {const s = this.storeconst b = s.block(blockId)if (!b || s.readOnly || this.reading) return- this.closeOverlay()- const pop = el('div', this.isDrawer() ? 'sp-pop sp-sheet' : 'sp-pop')- pop.setAttribute('role', 'menu')- this.trapAndClose(pop)const cur = ((b as { filter?: ViewFilter }).filter ?? {}) as ViewFilter-+ this.popover(anchor, (pop) => {for (const f of fieldsOf(s.doc)) {if (!f.options?.length) continuepop.append(el('div', 'sp-fgroup', f.label))@@ -1221,21 +1367,12 @@ export class Editor {pop.append(item)}}- const clear = this.menuItem('trash', t('Clear filter'), '', () => {+ pop.append(this.menuItem('trash', t('Clear filter'), '', () => {this.closeOverlay()// unknown keys survive: this clears what this build put therethis.editViewFilter(blockId, (f) => { delete f.is; delete f.open })+ }))})- pop.append(clear)-- this.overlay = pop- document.body.append(pop)- if (this.isDrawer()) pop.classList.add('sp-sheet-in')- else place(pop, anchor)- const away = (ev: MouseEvent) => {- if (!pop.contains(ev.target as Node)) { this.closeOverlay(); document.removeEventListener('mousedown', away) }- }- setTimeout(() => document.addEventListener('mousedown', away), 0)}/**diff --git a/spaces/src/fields.ts b/spaces/src/fields.tsindex 7f69f063..fd85918c 100644--- a/spaces/src/fields.ts+++ b/spaces/src/fields.ts@@ -269,6 +269,101 @@ export const filterCount = (filter: unknown): number => {return (f.open ? 1 : 0) + Object.keys(is).filter((k) => (is[k] ?? []).length).length}+/**+ * What ORDERS a view. Stored on the `view` block, so it is permanent.+ *+ * ABSENT MEANS MANUAL ORDER — the page order, which is the board's own order+ * and what every view written before this key carries. That is the+ * compatibility rule, not a preference: a stored sort must never appear on a+ * board somebody arranged by hand.+ *+ * AN ARRAY, though the editor only ever writes one entry. The shape was+ * published in the format sketch as a list, and a second key can be added later+ * without touching a file — where widening a scalar to an array afterwards+ * could not be done at all. One entry is what a board is actually asked for;+ * the array is what keeps the other answer available.+ */+export interface ViewSort {+ key: string+ /** absent = ascending, which is the direction a reader assumes */+ dir?: 'asc' | 'desc'+}++/** Sort keys this build can evaluate — a field the schema declares. */+export const unknownSortKeys = (doc: SpacesDoc, sort: unknown): string[] =>+ (Array.isArray(sort) ? sort : [])+ .map((s) => String((s as ViewSort)?.key ?? ''))+ .filter((k) => k && !fieldByKey(doc, k))++/**+ * One value's place in its field's order.+ *+ * A select sorts by its DECLARED position, never alphabetically: "Backlog,+ * Todo, In progress, Done" is a direction, and sorting it into "Backlog, Done,+ * In progress, Todo" throws away the one thing the list was telling you. A+ * number sorts numerically. Everything else compares as text.+ */+interface Rank { empty?: boolean; n?: number; s?: string }++function rank(f: FieldSpec | undefined, v: unknown): Rank {+ if (v === undefined || v === null || v === '' || (Array.isArray(v) && !v.length)) return { empty: true }+ if (f?.vt === 'select') {+ const at = f.options?.findIndex((o) => o.id === String(v)) ?? -1+ // a value from a NEWER build has no declared place. It sorts after+ // everything this build knows rather than at the top, because guessing it+ // belongs first is how a status nobody here can read ends up leading the+ // board.+ return { n: at < 0 ? Number.MAX_SAFE_INTEGER : at }+ }+ if (f?.vt === 'number') {+ const n = Number(v)+ return Number.isFinite(n) ? { n } : { s: String(v) }+ }+ return { s: Array.isArray(v) ? v.map(String).join(', ') : String(v) }+}++/**+ * Order rows by a view's `sort`. Returns the SAME array when there is nothing+ * to do, so an unsorted view keeps the page order it already had.+ *+ * AN UNSET VALUE IS ALWAYS LAST, in both directions. It is not the smallest+ * value, it is the absence of one — an issue with no estimate is not the+ * cheapest issue, and reversing the sort must not promote every blank to the+ * top of the board.+ */+export function sortRows(doc: SpacesDoc, rows: IssueRow[], sort: unknown): IssueRow[] {+ const keys: Array<{ f: FieldSpec; dir?: 'asc' | 'desc' }> = []+ for (const s of Array.isArray(sort) ? sort : []) {+ const f = fieldByKey(doc, String((s as ViewSort)?.key ?? ''))+ // a key this build does not know is skipped, never guessed at — the view+ // then shows the order it had, which is the honest fallback+ if (f) keys.push({ f, dir: (s as ViewSort)?.dir })+ }+ if (!keys.length) return rows++ // decorate-sort-undecorate: `rank` is called once per row per key rather than+ // once per comparison, which on a 500-issue board is the difference between+ // 500 lookups and ~4,500+ const decorated = rows.map((r, i) => ({ r, i, ranks: keys.map((k) => rank(k.f, r.values.get(k.f.key))) }))+ decorated.sort((a, bq) => {+ for (let j = 0; j < keys.length; j++) {+ const x = a.ranks[j], y = bq.ranks[j]+ if (x.empty || y.empty) {+ if (x.empty && y.empty) continue+ return x.empty ? 1 : -1+ }+ const d = x.n !== undefined && y.n !== undefined+ ? x.n - y.n+ : String(x.s ?? x.n).localeCompare(String(y.s ?? y.n), undefined, { numeric: true, sensitivity: 'base' })+ if (d) return keys[j].dir === 'desc' ? -d : d+ }+ // STABLE on ties: equal rows keep the page order, so a board sorted by+ // priority still reads in the order someone arranged it within each band.+ return a.i - bq.i+ })+ return decorated.map((d) => d.r)+}+export interface IssueRow {page: Pagevalues: Map<string, unknown>diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.tsindex 2c96e519..ffcb24f4 100644--- a/spaces/src/i18n/de.ts+++ b/spaces/src/i18n/de.ts@@ -16,13 +16,16 @@ export const de: Catalog = {"A page cannot contain itself": "Eine Seite kann sich nicht selbst enthalten","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "Ein Passwort verschlüsselt das Dokument in der Datei. Es gibt keine Wiederherstellung — verlierst du es, ist der Space weg.","A second file — the original is left alone": "Eine zweite Datei — das Original bleibt unberührt",+ "A sort here is newer than this build and was not applied.": "Eine Sortierung dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "Ein Space ist nie eine Sackgasse: Das ganze Dokument ist reines JSON in dieser Datei, und jede Seite lässt sich als Markdown exportieren.","A space needs at least one page": "Ein Space braucht mindestens eine Seite","About this space": "Über diesen Space","Add a block below": "Block darunter hinzufügen","Archive": "Archivieren","Archived ({n})": "Archiviert ({n})",+ "Ascending": "Aufsteigend","Block options": "Block-Optionen",+ "Board": "Board","Breadcrumb": "Pfadnavigation","Callout icon": "Symbol des Hinweisfelds","Caution": "Achtung",@@ -33,6 +36,8 @@ export const de: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "Die Prüfung ist manuell und verifiziert: Der Download ist signiert, und seine Signatur wird gegen einen Schlüssel in dieser Datei geprüft, bevor irgendetwas überschrieben wird.","Checking…": "Prüfe…","Choose a password. There is no way to recover it.": "Wähle ein Passwort. Es lässt sich nicht wiederherstellen.",+ "Choose the field the columns come from": "Feld wählen, aus dem die Spalten kommen",+ "Choose the order": "Reihenfolge wählen","Clear filter": "Filter zurücksetzen","Close": "Schließen","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Zugeklappte Toggle-Blöcke werden immer offen gedruckt. Im Druckdialog deines Browsers gibt es die Option „Als PDF speichern“.",@@ -46,6 +51,7 @@ export const de: Catalog = {"Create “{name}”": "„{name}“ erstellen","Delete “{name}”?": "„{name}“ löschen?","Delete…": "Löschen…",+ "Descending": "Absteigend","Discard": "Verwerfen","Downloaded. Open the new file — this one is unchanged.": "Heruntergeladen. Öffne die neue Datei — diese hier bleibt unverändert.","Drag to move, click for block options": "Ziehen zum Verschieben, klicken für Block-Optionen",@@ -62,6 +68,7 @@ export const de: Catalog = {"Find": "Suchen","Find in this space…": "In diesem Space suchen…","Find or create a page…": "Seite finden oder erstellen…",+ "Group": "Gruppieren","Icon": "Symbol","Image added ({size})": "Bild hinzugefügt ({size})","Image added, resized to fit ({from} → {to})": "Bild hinzugefügt, passend verkleinert ({from} → {to})",@@ -77,10 +84,13 @@ export const de: Catalog = {"Link to page": "Seite verlinken","Linked from": "Verlinkt von","Links to it become dead": "Links darauf laufen ins Leere",+ "List": "Liste",+ "Manual order": "Manuelle Reihenfolge","New page (⌘⌥N)": "Neue Seite (⌘⌥N)","New page inside": "Neue Unterseite","Next (⏎)": "Weiter (⏎)","No block matches": "Kein Block passt",+ "No field here has options to group by": "Kein Feld hier hat Optionen zum Gruppieren","No issues match this filter.": "Keine Issues entsprechen diesem Filter.","No pages yet": "Noch keine Seiten","Note": "Hinweis",@@ -130,6 +140,9 @@ export const de: Catalog = {"Search all pages…": "Alle Seiten durchsuchen…","Search this space": "Diesen Space durchsuchen","Set a password…": "Passwort festlegen…",+ "Show as a board": "Als Board anzeigen",+ "Show as a list": "Als Liste anzeigen",+ "Sort": "Sortieren","Space name": "Space-Name","Take it elsewhere": "Woanders weitermachen","That file could not be read as an image": "Diese Datei konnte nicht als Bild gelesen werden",diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.tsindex 181baa23..8de5d3a0 100644--- a/spaces/src/i18n/es.ts+++ b/spaces/src/i18n/es.ts@@ -16,13 +16,16 @@ export const es: Catalog = {"A page cannot contain itself": "Una página no puede contenerse a sí misma","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "Una contraseña cifra el documento dentro del archivo. No hay forma de recuperarla — si la pierdes, el espacio desaparece.","A second file — the original is left alone": "Un segundo archivo — el original queda intacto",+ "A sort here is newer than this build and was not applied.": "Un orden de esta vista es más reciente que esta versión y no se ha aplicado.","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "Un espacio nunca es un callejón sin salida: todo el documento es JSON plano dentro de este archivo, y cada página se exporta como Markdown.","A space needs at least one page": "Un espacio necesita al menos una página","About this space": "Acerca de este espacio","Add a block below": "Añadir un bloque debajo","Archive": "Archivar","Archived ({n})": "Archivadas ({n})",+ "Ascending": "Ascendente","Block options": "Opciones del bloque",+ "Board": "Tablero","Breadcrumb": "Ruta de navegación","Callout icon": "Icono del aviso","Caution": "Precaución",@@ -33,6 +36,8 @@ export const es: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "La comprobación es manual y verificada: la descarga va firmada y su firma se contrasta con una clave que está dentro de este archivo antes de reescribir nada.","Checking…": "Comprobando…","Choose a password. There is no way to recover it.": "Elige una contraseña. No hay forma de recuperarla.",+ "Choose the field the columns come from": "Elige el campo del que salen las columnas",+ "Choose the order": "Elige el orden","Clear filter": "Borrar el filtro","Close": "Cerrar","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Los desplegables plegados siempre se imprimen abiertos. El diálogo de impresión de tu navegador tiene la opción «Guardar como PDF».",@@ -46,6 +51,7 @@ export const es: Catalog = {"Create “{name}”": "Crear «{name}»","Delete “{name}”?": "¿Eliminar «{name}»?","Delete…": "Eliminar…",+ "Descending": "Descendente","Discard": "Descartar","Downloaded. Open the new file — this one is unchanged.": "Descargado. Abre el archivo nuevo — este no ha cambiado.","Drag to move, click for block options": "Arrastra para mover, haz clic para las opciones del bloque",@@ -62,6 +68,7 @@ export const es: Catalog = {"Find": "Buscar","Find in this space…": "Buscar en este espacio…","Find or create a page…": "Buscar o crear una página…",+ "Group": "Agrupar","Icon": "Icono","Image added ({size})": "Imagen añadida ({size})","Image added, resized to fit ({from} → {to})": "Imagen añadida, redimensionada para que quepa ({from} → {to})",@@ -77,10 +84,13 @@ export const es: Catalog = {"Link to page": "Enlazar a una página","Linked from": "Enlazado desde","Links to it become dead": "Los enlaces a ella dejan de funcionar",+ "List": "Lista",+ "Manual order": "Orden manual","New page (⌘⌥N)": "Nueva página (⌘⌥N)","New page inside": "Nueva página dentro","Next (⏎)": "Siguiente (⏎)","No block matches": "Ningún bloque coincide",+ "No field here has options to group by": "Ningún campo de aquí tiene opciones para agrupar","No issues match this filter.": "Ninguna incidencia coincide con este filtro.","No pages yet": "Aún no hay páginas","Note": "Nota",@@ -130,6 +140,9 @@ export const es: Catalog = {"Search all pages…": "Buscar en todas las páginas…","Search this space": "Buscar en este espacio","Set a password…": "Establecer una contraseña…",+ "Show as a board": "Mostrar como tablero",+ "Show as a list": "Mostrar como lista",+ "Sort": "Ordenar","Space name": "Nombre del espacio","Take it elsewhere": "Llévatelo a otra parte","That file could not be read as an image": "No se pudo leer ese archivo como imagen",diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.tsindex eb2fa4a6..07ab5d90 100644--- a/spaces/src/i18n/fr.ts+++ b/spaces/src/i18n/fr.ts@@ -16,13 +16,16 @@ export const fr: Catalog = {"A page cannot contain itself": "Une page ne peut pas se contenir elle-même","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "Un mot de passe chiffre le document à l’intérieur du fichier. Il n’y a aucune récupération — perdez-le et l’espace est perdu.","A second file — the original is left alone": "Un second fichier — l’original reste intact",+ "A sort here is newer than this build and was not applied.": "Un tri de cette vue est plus récent que cette version et n’a pas été appliqué.","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "Un espace n’est jamais une impasse : tout le document est du JSON brut dans ce fichier, et chaque page s’exporte en Markdown.","A space needs at least one page": "Un espace doit contenir au moins une page","About this space": "À propos de cet espace","Add a block below": "Ajouter un bloc en dessous","Archive": "Archiver","Archived ({n})": "Archivées ({n})",+ "Ascending": "Croissant","Block options": "Options du bloc",+ "Board": "Tableau","Breadcrumb": "Fil d’Ariane","Callout icon": "Icône de l'encadré","Caution": "Attention",@@ -33,6 +36,8 @@ export const fr: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "La vérification est manuelle et contrôlée : le téléchargement est signé, et sa signature est vérifiée avec une clé contenue dans ce fichier avant toute réécriture.","Checking…": "Vérification…","Choose a password. There is no way to recover it.": "Choisissez un mot de passe. Il est impossible de le récupérer.",+ "Choose the field the columns come from": "Choisir le champ dont viennent les colonnes",+ "Choose the order": "Choisir l’ordre","Clear filter": "Effacer le filtre","Close": "Fermer","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Les bascules repliées s’impriment toujours dépliées. La boîte d’impression de votre navigateur propose « Enregistrer au format PDF ».",@@ -46,6 +51,7 @@ export const fr: Catalog = {"Create “{name}”": "Créer « {name} »","Delete “{name}”?": "Supprimer « {name} » ?","Delete…": "Supprimer…",+ "Descending": "Décroissant","Discard": "Ignorer","Downloaded. Open the new file — this one is unchanged.": "Téléchargé. Ouvrez le nouveau fichier — celui-ci est inchangé.","Drag to move, click for block options": "Glissez pour déplacer, cliquez pour les options du bloc",@@ -62,6 +68,7 @@ export const fr: Catalog = {"Find": "Rechercher","Find in this space…": "Rechercher dans cet espace…","Find or create a page…": "Trouver ou créer une page…",+ "Group": "Grouper","Icon": "Icône","Image added ({size})": "Image ajoutée ({size})","Image added, resized to fit ({from} → {to})": "Image ajoutée, redimensionnée ({from} → {to})",@@ -77,10 +84,13 @@ export const fr: Catalog = {"Link to page": "Lier à une page","Linked from": "Liens entrants","Links to it become dead": "Les liens vers elle seront rompus",+ "List": "Liste",+ "Manual order": "Ordre manuel","New page (⌘⌥N)": "Nouvelle page (⌘⌥N)","New page inside": "Nouvelle page à l’intérieur","Next (⏎)": "Suivant (⏎)","No block matches": "Aucun bloc correspondant",+ "No field here has options to group by": "Aucun champ ici n’a d’options pour grouper","No issues match this filter.": "Aucun ticket ne correspond à ce filtre.","No pages yet": "Aucune page pour l’instant","Note": "Note",@@ -130,6 +140,9 @@ export const fr: Catalog = {"Search all pages…": "Rechercher dans toutes les pages…","Search this space": "Rechercher dans cet espace","Set a password…": "Définir un mot de passe…",+ "Show as a board": "Afficher en tableau",+ "Show as a list": "Afficher en liste",+ "Sort": "Trier","Space name": "Nom de l’espace","Take it elsewhere": "Emportez-le ailleurs","That file could not be read as an image": "Ce fichier n’a pas pu être lu comme une image",diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.tsindex 6b993904..128f3022 100644--- a/spaces/src/i18n/it.ts+++ b/spaces/src/i18n/it.ts@@ -16,13 +16,16 @@ export const it: Catalog = {"A page cannot contain itself": "Una pagina non può contenere sé stessa","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "Una password cifra il documento dentro il file. Non c’è modo di recuperarla — se la perdi, lo spazio è perso.","A second file — the original is left alone": "Un secondo file — l’originale resta intatto",+ "A sort here is newer than this build and was not applied.": "Un ordinamento di questa vista è più recente di questa versione e non è stato applicato.","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "Uno spazio non è mai un vicolo cieco: l’intero documento è JSON puro dentro questo file, e ogni pagina si esporta in Markdown.","A space needs at least one page": "Uno spazio deve avere almeno una pagina","About this space": "Informazioni su questo spazio","Add a block below": "Aggiungi un blocco sotto","Archive": "Archivia","Archived ({n})": "Archiviate ({n})",+ "Ascending": "Crescente","Block options": "Opzioni del blocco",+ "Board": "Bacheca","Breadcrumb": "Percorso di navigazione","Callout icon": "Icona del riquadro","Caution": "Attenzione",@@ -33,6 +36,8 @@ export const it: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "La verifica è manuale e controllata: il download è firmato e la sua firma viene confrontata con una chiave contenuta in questo file prima che qualcosa venga riscritto.","Checking…": "Verifica in corso…","Choose a password. There is no way to recover it.": "Scegli una password. Non c’è modo di recuperarla.",+ "Choose the field the columns come from": "Scegli il campo da cui nascono le colonne",+ "Choose the order": "Scegli l’ordine","Clear filter": "Azzera il filtro","Close": "Chiudi","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "I blocchi comprimibili chiusi vengono sempre stampati aperti. La finestra di stampa del browser offre l’opzione «Salva come PDF».",@@ -46,6 +51,7 @@ export const it: Catalog = {"Create “{name}”": "Crea «{name}»","Delete “{name}”?": "Eliminare «{name}»?","Delete…": "Elimina…",+ "Descending": "Decrescente","Discard": "Ignora","Downloaded. Open the new file — this one is unchanged.": "Scaricato. Apri il nuovo file — questo resta invariato.","Drag to move, click for block options": "Trascina per spostare, clicca per le opzioni del blocco",@@ -62,6 +68,7 @@ export const it: Catalog = {"Find": "Trova","Find in this space…": "Trova in questo spazio…","Find or create a page…": "Trova o crea una pagina…",+ "Group": "Raggruppa","Icon": "Icona","Image added ({size})": "Immagine aggiunta ({size})","Image added, resized to fit ({from} → {to})": "Immagine aggiunta, ridimensionata ({from} → {to})",@@ -77,10 +84,13 @@ export const it: Catalog = {"Link to page": "Collega a una pagina","Linked from": "Collegata da","Links to it become dead": "I collegamenti a questa pagina si interrompono",+ "List": "Elenco",+ "Manual order": "Ordine manuale","New page (⌘⌥N)": "Nuova pagina (⌘⌥N)","New page inside": "Nuova pagina interna","Next (⏎)": "Successivo (⏎)","No block matches": "Nessun blocco corrisponde",+ "No field here has options to group by": "Nessun campo qui ha opzioni per raggruppare","No issues match this filter.": "Nessuna issue corrisponde a questo filtro.","No pages yet": "Ancora nessuna pagina","Note": "Nota",@@ -130,6 +140,9 @@ export const it: Catalog = {"Search all pages…": "Cerca in tutte le pagine…","Search this space": "Cerca in questo spazio","Set a password…": "Imposta una password…",+ "Show as a board": "Mostra come bacheca",+ "Show as a list": "Mostra come elenco",+ "Sort": "Ordina","Space name": "Nome dello spazio","Take it elsewhere": "Portalo altrove","That file could not be read as an image": "Impossibile leggere quel file come immagine",diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.tsindex fa59b4d1..3f92d7ed 100644--- a/spaces/src/i18n/ja.ts+++ b/spaces/src/i18n/ja.ts@@ -16,13 +16,16 @@ export const ja: Catalog = {"A page cannot contain itself": "ページを自分自身に入れることはできません","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "パスワードはファイル内のドキュメントを暗号化します。復元手段はありません — 忘れたらこのスペースは失われます。","A second file — the original is left alone": "2 つ目のファイル — 元のファイルはそのまま",+ "A sort here is newer than this build and was not applied.": "このビューには、このバージョンより新しい並び順があり、適用されていません。","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "スペースは行き止まりになりません。ドキュメント全体はこのファイル内のプレーンな JSON で、どのページも Markdown に書き出せます。","A space needs at least one page": "スペースには少なくとも 1 ページが必要です","About this space": "このスペースについて","Add a block below": "下にブロックを追加","Archive": "アーカイブ","Archived ({n})": "アーカイブ済み({n})",+ "Ascending": "昇順","Block options": "ブロックのオプション",+ "Board": "ボード","Breadcrumb": "パンくずリスト","Callout icon": "囲みのアイコン","Caution": "注意",@@ -33,6 +36,8 @@ export const ja: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "確認は手動で、検証も行われます。ダウンロードには署名があり、何かを書き換える前にこのファイル内の鍵で署名を照合します。","Checking…": "確認中…","Choose a password. There is no way to recover it.": "パスワードを決めてください。復元する方法はありません。",+ "Choose the field the columns come from": "列のもとになるフィールドを選ぶ",+ "Choose the order": "並び順を選ぶ","Clear filter": "フィルターを解除","Close": "閉じる","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "折りたたんだトグルも印刷では必ず開いた状態になります。「PDF として保存」はブラウザの印刷ダイアログにあります。",@@ -46,6 +51,7 @@ export const ja: Catalog = {"Create “{name}”": "「{name}」を作成","Delete “{name}”?": "「{name}」を削除しますか?","Delete…": "削除…",+ "Descending": "降順","Discard": "破棄","Downloaded. Open the new file — this one is unchanged.": "ダウンロードしました。新しいファイルを開いてください — このファイルは変更されていません。","Drag to move, click for block options": "ドラッグで移動、クリックでブロックのオプション",@@ -62,6 +68,7 @@ export const ja: Catalog = {"Find": "検索","Find in this space…": "このスペース内を検索…","Find or create a page…": "ページを検索または作成…",+ "Group": "グループ","Icon": "アイコン","Image added ({size})": "画像を追加しました({size})","Image added, resized to fit ({from} → {to})": "画像を追加し、収まるように縮小しました({from} → {to})",@@ -77,10 +84,13 @@ export const ja: Catalog = {"Link to page": "ページにリンク","Linked from": "リンク元","Links to it become dead": "このページへのリンクが切れます",+ "List": "リスト",+ "Manual order": "手動の並び順","New page (⌘⌥N)": "新規ページ (⌘⌥N)","New page inside": "この中に新規ページ","Next (⏎)": "次へ (⏎)","No block matches": "一致するブロックがありません",+ "No field here has options to group by": "グループ化に使える選択肢を持つフィールドがありません","No issues match this filter.": "この条件に一致するイシューはありません。","No pages yet": "ページがまだありません","Note": "メモ",@@ -130,6 +140,9 @@ export const ja: Catalog = {"Search all pages…": "全ページを検索…","Search this space": "このスペースを検索","Set a password…": "パスワードを設定…",+ "Show as a board": "ボードで表示",+ "Show as a list": "リストで表示",+ "Sort": "並べ替え","Space name": "スペース名","Take it elsewhere": "外に持ち出す","That file could not be read as an image": "そのファイルは画像として読み込めませんでした",diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.tsindex 183d910c..17bf16e6 100644--- a/spaces/src/i18n/packed.ts+++ b/spaces/src/i18n/packed.ts@@ -18,6 +18,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"A page cannot contain itself": ["ページを自分自身に入れることはできません","页面不能包含自身","頁面不能包含自己","Una página no puede contenerse a sí misma","Une page ne peut pas se contenir elle-même","Eine Seite kann sich nicht selbst enthalten","Una pagina non può contenere sé stessa","Uma página não pode conter-se a si própria"],"A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": ["パスワードはファイル内のドキュメントを暗号化します。復元手段はありません — 忘れたらこのスペースは失われます。","密码会加密文件内的文档。没有任何找回方式 — 密码丢了,空间就没了。","密碼會加密檔案內的文件。沒有任何復原方式 — 密碼一旦遺失,這個空間就沒了。","Una contraseña cifra el documento dentro del archivo. No hay forma de recuperarla — si la pierdes, el espacio desaparece.","Un mot de passe chiffre le document à l’intérieur du fichier. Il n’y a aucune récupération — perdez-le et l’espace est perdu.","Ein Passwort verschlüsselt das Dokument in der Datei. Es gibt keine Wiederherstellung — verlierst du es, ist der Space weg.","Una password cifra il documento dentro il file. Non c’è modo di recuperarla — se la perdi, lo spazio è perso.","Uma palavra-passe encripta o documento dentro do ficheiro. Não há recuperação — se a perder, o espaço desaparece."],"A second file — the original is left alone": ["2 つ目のファイル — 元のファイルはそのまま","另存一个新文件 — 原文件不动","第二個檔案 — 原檔案不受影響","Un segundo archivo — el original queda intacto","Un second fichier — l’original reste intact","Eine zweite Datei — das Original bleibt unberührt","Un secondo file — l’originale resta intatto","Um segundo ficheiro — o original fica intacto"],+ "A sort here is newer than this build and was not applied.": ["このビューには、このバージョンより新しい並び順があり、適用されていません。","此视图中有比当前版本更新的排序方式,未被应用。","此檢視中有比目前版本更新的排序方式,未被套用。","Un orden de esta vista es más reciente que esta versión y no se ha aplicado.","Un tri de cette vue est plus récent que cette version et n’a pas été appliqué.","Eine Sortierung dieser Ansicht ist neuer als diese Version und wurde nicht angewendet.","Un ordinamento di questa vista è più recente di questa versione e non è stato applicato.","Uma ordenação desta vista é mais recente do que esta versão e não foi aplicada."],"A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": ["スペースは行き止まりになりません。ドキュメント全体はこのファイル内のプレーンな JSON で、どのページも Markdown に書き出せます。","空间绝不是死胡同:整个文档就是这个文件里的纯 JSON,每个页面都能导出为 Markdown。","空間永遠不會是死路:整份文件就是此檔案中的純 JSON,每個頁面也都能匯出成 Markdown。","Un espacio nunca es un callejón sin salida: todo el documento es JSON plano dentro de este archivo, y cada página se exporta como Markdown.","Un espace n’est jamais une impasse : tout le document est du JSON brut dans ce fichier, et chaque page s’exporte en Markdown.","Ein Space ist nie eine Sackgasse: Das ganze Dokument ist reines JSON in dieser Datei, und jede Seite lässt sich als Markdown exportieren.","Uno spazio non è mai un vicolo cieco: l’intero documento è JSON puro dentro questo file, e ogni pagina si esporta in Markdown.","Um espaço nunca é um beco sem saída: todo o documento é JSON simples dentro deste ficheiro e todas as páginas se exportam para Markdown."],"A space needs at least one page": ["スペースには少なくとも 1 ページが必要です","空间至少要有一个页面","空間至少要有一個頁面","Un espacio necesita al menos una página","Un espace doit contenir au moins une page","Ein Space braucht mindestens eine Seite","Uno spazio deve avere almeno una pagina","Um espaço precisa de pelo menos uma página"],"About bento/spaces — version, updates, language, password": ["bento/spaces について — バージョン・更新・言語・パスワード","关于 bento/spaces — 版本、更新、语言、密码","關於 bento/spaces — 版本、更新、語言、密碼","Acerca de bento/spaces: versión, actualizaciones, idioma, contraseña","À propos de bento/spaces — version, mises à jour, langue, mot de passe","Über bento/spaces — Version, Updates, Sprache, Passwort","Informazioni su bento/spaces — versione, aggiornamenti, lingua, password","Acerca do bento/spaces — versão, atualizações, idioma, palavra-passe"],@@ -28,7 +29,9 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Already an issue": ["すでにイシューです","已经是事项","已經是項目","Ya es una incidencia","Déjà un ticket","Ist bereits ein Issue","È già una issue","Já é uma tarefa"],"Archive": ["アーカイブ","归档","封存","Archivar","Archiver","Archivieren","Archivia","Arquivar"],"Archived ({n})": ["アーカイブ済み({n})","已归档 ({n})","已封存 ({n})","Archivadas ({n})","Archivées ({n})","Archiviert ({n})","Archiviate ({n})","Arquivadas ({n})"],+ "Ascending": ["昇順","升序","遞增","Ascendente","Croissant","Aufsteigend","Crescente","Crescente"],"Block options": ["ブロックのオプション","块选项","區塊選項","Opciones del bloque","Options du bloc","Block-Optionen","Opzioni del blocco","Opções do bloco"],+ "Board": ["ボード","看板","看板","Tablero","Tableau","Board","Bacheca","Quadro"],"Breadcrumb": ["パンくずリスト","面包屑导航","階層路徑","Ruta de navegación","Fil d’Ariane","Pfadnavigation","Percorso di navigazione","Trilho de navegação"],"Bring notes in": ["ノートを取り込む","把笔记带进来","把筆記帶進來","Traer notas","Faire entrer des notes","Notizen hereinholen","Portare dentro le note","Trazer notas para cá"],"Callout icon": ["囲みのアイコン","标注图标","標註圖示","Icono del aviso","Icône de l'encadré","Symbol des Hinweisfelds","Icona del riquadro","Ícone do destaque"],@@ -43,6 +46,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Choose .md files…": [".md ファイルを選ぶ…","选择 .md 文件…","選擇 .md 檔案…","Elegir archivos .md…","Choisir des fichiers .md…",".md-Dateien wählen…","Scegli file .md…","Escolher ficheiros .md…"],"Choose a folder…": ["フォルダーを選ぶ…","选择文件夹…","選擇資料夾…","Elegir una carpeta…","Choisir un dossier…","Ordner wählen…","Scegli una cartella…","Escolher uma pasta…"],"Choose a password. There is no way to recover it.": ["パスワードを決めてください。復元する方法はありません。","设置一个密码。它无法找回。","請設定密碼。沒有任何方法可以找回它。","Elige una contraseña. No hay forma de recuperarla.","Choisissez un mot de passe. Il est impossible de le récupérer.","Wähle ein Passwort. Es lässt sich nicht wiederherstellen.","Scegli una password. Non c’è modo di recuperarla.","Escolha uma palavra-passe. Não há forma de a recuperar."],+ "Choose the field the columns come from": ["列のもとになるフィールドを選ぶ","选择用作分栏的字段","選擇作為欄的欄位","Elige el campo del que salen las columnas","Choisir le champ dont viennent les colonnes","Feld wählen, aus dem die Spalten kommen","Scegli il campo da cui nascono le colonne","Escolha o campo de onde vêm as colunas"],+ "Choose the order": ["並び順を選ぶ","选择排序方式","選擇排序方式","Elige el orden","Choisir l’ordre","Reihenfolge wählen","Scegli l’ordine","Escolha a ordem"],"Clear filter": ["フィルターを解除","清除筛选","清除篩選","Borrar el filtro","Effacer le filtre","Filter zurücksetzen","Azzera il filtro","Limpar o filtro"],"Close": ["閉じる","关闭","關閉","Cerrar","Fermer","Schließen","Chiudi","Fechar"],"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": ["折りたたんだトグルも印刷では必ず開いた状態になります。「PDF として保存」はブラウザの印刷ダイアログにあります。","折叠起来的折叠块打印时一律展开。浏览器的打印对话框里有“存为 PDF”选项。","收合的摺疊區塊列印時一律展開。「另存為 PDF」的選項在瀏覽器的列印對話方塊中。","Los desplegables plegados siempre se imprimen abiertos. El diálogo de impresión de tu navegador tiene la opción «Guardar como PDF».","Les bascules repliées s’impriment toujours dépliées. La boîte d’impression de votre navigateur propose « Enregistrer au format PDF ».","Zugeklappte Toggle-Blöcke werden immer offen gedruckt. Im Druckdialog deines Browsers gibt es die Option „Als PDF speichern“.","I blocchi comprimibili chiusi vengono sempre stampati aperti. La finestra di stampa del browser offre l’opzione «Salva come PDF».","Os blocos recolhidos são sempre impressos abertos. A janela de impressão do navegador tem a opção \"Guardar como PDF\"."],@@ -57,6 +62,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Delete": ["削除","删除","刪除","Eliminar","Supprimer","Löschen","Elimina","Eliminar"],"Delete “{name}”?": ["「{name}」を削除しますか?","要删除“{name}”吗?","要刪除「{name}」嗎?","¿Eliminar «{name}»?","Supprimer « {name} » ?","„{name}“ löschen?","Eliminare «{name}»?","Eliminar “{name}”?"],"Delete…": ["削除…","删除…","刪除…","Eliminar…","Supprimer…","Löschen…","Elimina…","Eliminar…"],+ "Descending": ["降順","降序","遞減","Descendente","Décroissant","Absteigend","Decrescente","Decrescente"],"Discard": ["破棄","放弃","捨棄","Descartar","Ignorer","Verwerfen","Ignora","Descartar"],"Downloaded. Open the new file — this one is unchanged.": ["ダウンロードしました。新しいファイルを開いてください — このファイルは変更されていません。","已下载。请打开新文件 — 当前文件未改动。","已下載。請開啟新檔案 — 目前這個檔案未被更動。","Descargado. Abre el archivo nuevo — este no ha cambiado.","Téléchargé. Ouvrez le nouveau fichier — celui-ci est inchangé.","Heruntergeladen. Öffne die neue Datei — diese hier bleibt unverändert.","Scaricato. Apri il nuovo file — questo resta invariato.","Transferido. Abra o novo ficheiro — este fica inalterado."],"Drag to move, click for block options": ["ドラッグで移動、クリックでブロックのオプション","拖动可移动,点击打开块选项","拖曳可移動,點按開啟區塊選項","Arrastra para mover, haz clic para las opciones del bloque","Glissez pour déplacer, cliquez pour les options du bloc","Ziehen zum Verschieben, klicken für Block-Optionen","Trascina per spostare, clicca per le opzioni del blocco","Arraste para mover, clique para as opções do bloco"],@@ -77,6 +83,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Find": ["検索","查找","尋找","Buscar","Rechercher","Suchen","Trova","Localizar"],"Find in this space…": ["このスペース内を検索…","在此空间中查找…","在此空間尋找…","Buscar en este espacio…","Rechercher dans cet espace…","In diesem Space suchen…","Trova in questo spazio…","Localizar neste espaço…"],"Find or create a page…": ["ページを検索または作成…","查找或新建页面…","尋找或建立頁面…","Buscar o crear una página…","Trouver ou créer une page…","Seite finden oder erstellen…","Trova o crea una pagina…","Encontrar ou criar uma página…"],+ "Group": ["グループ","分组","分組","Agrupar","Grouper","Gruppieren","Raggruppa","Agrupar"],"Hide the page list ([)": ["ページ一覧を隠す([)","隐藏页面列表([)","隱藏頁面清單([)","Ocultar la lista de páginas ([)","Masquer la liste des pages ([)","Seitenliste ausblenden ([)","Nascondi l'elenco delle pagine ([)","Ocultar a lista de páginas ([)"],"Icon": ["アイコン","图标","圖示","Icono","Icône","Symbol","Icona","Ícone"],"Image added ({size})": ["画像を追加しました({size})","已添加图片 ({size})","已新增圖片 ({size})","Imagen añadida ({size})","Image ajoutée ({size})","Bild hinzugefügt ({size})","Immagine aggiunta ({size})","Imagem adicionada ({size})"],@@ -102,8 +109,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Link to page": ["ページにリンク","链接到页面","連結到頁面","Enlazar a una página","Lier à une page","Seite verlinken","Collega a una pagina","Ligar a uma página"],"Linked from": ["リンク元","链接来源","連結來源","Enlazado desde","Liens entrants","Verlinkt von","Collegata da","Ligado a partir de"],"Links to it become dead": ["このページへのリンクが切れます","指向它的链接会失效","指向它的連結會失效","Los enlaces a ella dejan de funcionar","Les liens vers elle seront rompus","Links darauf laufen ins Leere","I collegamenti a questa pagina si interrompono","As ligações para ela ficam quebradas"],+ "List": ["リスト","列表","清單","Lista","Liste","Liste","Elenco","Lista"],"Load this image": ["この画像を読み込む","加载此图片","載入此圖片","Cargar esta imagen","Charger cette image","Dieses Bild laden","Carica questa immagine","Carregar esta imagem"],"Make this page an issue": ["このページをイシューにする","将此页面变为事项","將此頁面變為項目","Convertir esta página en incidencia","Transformer cette page en ticket","Diese Seite zu einem Issue machen","Trasforma questa pagina in una issue","Transformar esta página numa tarefa"],+ "Manual order": ["手動の並び順","手动排序","手動排序","Orden manual","Ordre manuel","Manuelle Reihenfolge","Ordine manuale","Ordem manual"],"More": ["その他","更多","更多","Más","Plus","Mehr","Altro","Mais"],"Move down": ["下へ移動","下移","下移","Bajar","Descendre","Nach unten","Sposta giù","Mover para baixo"],"Move up": ["上へ移動","上移","上移","Subir","Monter","Nach oben","Sposta su","Mover para cima"],@@ -114,6 +123,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"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"],+ "No field here has options to group by": ["グループ化に使える選択肢を持つフィールドがありません","这里没有可用于分组的选项字段","這裡沒有可用於分組的選項欄位","Ningún campo de aquí tiene opciones para agrupar","Aucun champ ici n’a d’options pour grouper","Kein Feld hier hat Optionen zum Gruppieren","Nessun campo qui ha opzioni per raggruppare","Nenhum campo aqui tem opções para agrupar"],"No issues match this filter.": ["この条件に一致するイシューはありません。","没有符合此筛选条件的事项。","沒有符合此篩選條件的項目。","Ninguna incidencia coincide con este filtro.","Aucun ticket ne correspond à ce filtre.","Keine Issues entsprechen diesem Filter.","Nessuna issue corrisponde a questo filtro.","Nenhuma tarefa corresponde a este filtro."],"No issues yet. Add a status field to any page and it appears here.": ["まだイシューはありません。どれかのページにステータス項目を追加すると、ここに表示されます。","还没有事项。给任意页面添加状态字段,它就会出现在这里。","還沒有項目。為任一頁面新增狀態欄位,它就會出現在這裡。","Aún no hay incidencias. Añade un campo de estado a cualquier página y aparecerá aquí.","Aucun ticket pour l’instant. Ajoutez un champ statut à une page et elle apparaîtra ici.","Noch keine Issues. Gib einer Seite ein Status-Feld, dann erscheint sie hier.","Ancora nessuna issue. Aggiungi un campo stato a una pagina e comparirà qui.","Ainda não há tarefas. Adiciona um campo de estado a qualquer página e ela aparece aqui."],"No pages yet": ["ページがまだありません","还没有页面","尚無頁面","Aún no hay páginas","Aucune page pour l’instant","Noch keine Seiten","Ancora nessuna pagina","Ainda sem páginas"],@@ -167,7 +177,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Search all pages…": ["全ページを検索…","搜索所有页面…","搜尋所有頁面…","Buscar en todas las páginas…","Rechercher dans toutes les pages…","Alle Seiten durchsuchen…","Cerca in tutte le pagine…","Pesquisar em todas as páginas…"],"Search this space": ["このスペースを検索","搜索此空间","搜尋此空間","Buscar en este espacio","Rechercher dans cet espace","Diesen Space durchsuchen","Cerca in questo spazio","Pesquisar neste espaço"],"Set a password…": ["パスワードを設定…","设置密码…","設定密碼…","Establecer una contraseña…","Définir un mot de passe…","Passwort festlegen…","Imposta una password…","Definir uma palavra-passe…"],+ "Show as a board": ["ボードで表示","以看板显示","以看板顯示","Mostrar como tablero","Afficher en tableau","Als Board anzeigen","Mostra come bacheca","Mostrar como quadro"],+ "Show as a list": ["リストで表示","以列表显示","以清單顯示","Mostrar como lista","Afficher en liste","Als Liste anzeigen","Mostra come elenco","Mostrar como lista"],"Show the page list ([)": ["ページ一覧を表示([)","显示页面列表([)","顯示頁面清單([)","Mostrar la lista de páginas ([)","Afficher la liste des pages ([)","Seitenliste einblenden ([)","Mostra l'elenco delle pagine ([)","Mostrar a lista de páginas ([)"],+ "Sort": ["並べ替え","排序","排序","Ordenar","Trier","Sortieren","Ordina","Ordenar"],"Space name": ["スペース名","空间名称","空間名稱","Nombre del espacio","Nom de l’espace","Space-Name","Nome dello spazio","Nome do espaço"],"Take it elsewhere": ["外に持ち出す","把内容带走","把內容帶走","Llévatelo a otra parte","Emportez-le ailleurs","Woanders weitermachen","Portalo altrove","Levar para outro lado"],"That file could not be read as an image": ["そのファイルは画像として読み込めませんでした","无法将该文件作为图片读取","無法將該檔案讀取為圖片","No se pudo leer ese archivo como imagen","Ce fichier n’a pas pu être lu comme une image","Diese Datei konnte nicht als Bild gelesen werden","Impossibile leggere quel file come immagine","Não foi possível ler esse ficheiro como imagem"],diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.tsindex b79b2dab..70962bd1 100644--- a/spaces/src/i18n/pt.ts+++ b/spaces/src/i18n/pt.ts@@ -16,13 +16,16 @@ export const pt: Catalog = {"A page cannot contain itself": "Uma página não pode conter-se a si própria","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "Uma palavra-passe encripta o documento dentro do ficheiro. Não há recuperação — se a perder, o espaço desaparece.","A second file — the original is left alone": "Um segundo ficheiro — o original fica intacto",+ "A sort here is newer than this build and was not applied.": "Uma ordenação desta vista é mais recente do que esta versão e não foi aplicada.","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "Um espaço nunca é um beco sem saída: todo o documento é JSON simples dentro deste ficheiro e todas as páginas se exportam para Markdown.","A space needs at least one page": "Um espaço precisa de pelo menos uma página","About this space": "Sobre este espaço","Add a block below": "Adicionar um bloco abaixo","Archive": "Arquivar","Archived ({n})": "Arquivadas ({n})",+ "Ascending": "Crescente","Block options": "Opções do bloco",+ "Board": "Quadro","Breadcrumb": "Trilho de navegação","Callout icon": "Ícone do destaque","Caution": "Cuidado",@@ -33,6 +36,8 @@ export const pt: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "A verificação é manual e comprovada: a transferência é assinada e a sua assinatura é validada com uma chave dentro deste ficheiro antes de qualquer coisa ser reescrita.","Checking…": "A verificar…","Choose a password. There is no way to recover it.": "Escolha uma palavra-passe. Não há forma de a recuperar.",+ "Choose the field the columns come from": "Escolha o campo de onde vêm as colunas",+ "Choose the order": "Escolha a ordem","Clear filter": "Limpar o filtro","Close": "Fechar","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Os blocos recolhidos são sempre impressos abertos. A janela de impressão do navegador tem a opção \"Guardar como PDF\".",@@ -46,6 +51,7 @@ export const pt: Catalog = {"Create “{name}”": "Criar “{name}”","Delete “{name}”?": "Eliminar “{name}”?","Delete…": "Eliminar…",+ "Descending": "Decrescente","Discard": "Descartar","Downloaded. Open the new file — this one is unchanged.": "Transferido. Abra o novo ficheiro — este fica inalterado.","Drag to move, click for block options": "Arraste para mover, clique para as opções do bloco",@@ -62,6 +68,7 @@ export const pt: Catalog = {"Find": "Localizar","Find in this space…": "Localizar neste espaço…","Find or create a page…": "Encontrar ou criar uma página…",+ "Group": "Agrupar","Icon": "Ícone","Image added ({size})": "Imagem adicionada ({size})","Image added, resized to fit ({from} → {to})": "Imagem adicionada, redimensionada para caber ({from} → {to})",@@ -77,10 +84,13 @@ export const pt: Catalog = {"Link to page": "Ligar a uma página","Linked from": "Ligado a partir de","Links to it become dead": "As ligações para ela ficam quebradas",+ "List": "Lista",+ "Manual order": "Ordem manual","New page (⌘⌥N)": "Nova página (⌘⌥N)","New page inside": "Nova página dentro desta","Next (⏎)": "Seguinte (⏎)","No block matches": "Nenhum bloco corresponde",+ "No field here has options to group by": "Nenhum campo aqui tem opções para agrupar","No issues match this filter.": "Nenhuma tarefa corresponde a este filtro.","No pages yet": "Ainda sem páginas","Note": "Nota",@@ -130,6 +140,9 @@ export const pt: Catalog = {"Search all pages…": "Pesquisar em todas as páginas…","Search this space": "Pesquisar neste espaço","Set a password…": "Definir uma palavra-passe…",+ "Show as a board": "Mostrar como quadro",+ "Show as a list": "Mostrar como lista",+ "Sort": "Ordenar","Space name": "Nome do espaço","Take it elsewhere": "Levar para outro lado","That file could not be read as an image": "Não foi possível ler esse ficheiro como imagem",diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.tsindex 7e55d3e1..c0eb4e1e 100644--- a/spaces/src/i18n/zh-Hans.ts+++ b/spaces/src/i18n/zh-Hans.ts@@ -16,13 +16,16 @@ export const zh_Hans: Catalog = {"A page cannot contain itself": "页面不能包含自身","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "密码会加密文件内的文档。没有任何找回方式 — 密码丢了,空间就没了。","A second file — the original is left alone": "另存一个新文件 — 原文件不动",+ "A sort here is newer than this build and was not applied.": "此视图中有比当前版本更新的排序方式,未被应用。","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "空间绝不是死胡同:整个文档就是这个文件里的纯 JSON,每个页面都能导出为 Markdown。","A space needs at least one page": "空间至少要有一个页面","About this space": "关于此空间","Add a block below": "在下方添加块","Archive": "归档","Archived ({n})": "已归档 ({n})",+ "Ascending": "升序","Block options": "块选项",+ "Board": "看板","Breadcrumb": "面包屑导航","Callout icon": "标注图标","Caution": "当心",@@ -33,6 +36,8 @@ export const zh_Hans: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "检查更新完全由你手动发起,并且经过验证:下载内容带有签名,改写任何内容之前,都会先用此文件内的密钥校验签名。","Checking…": "检查中…","Choose a password. There is no way to recover it.": "设置一个密码。它无法找回。",+ "Choose the field the columns come from": "选择用作分栏的字段",+ "Choose the order": "选择排序方式","Clear filter": "清除筛选","Close": "关闭","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "折叠起来的折叠块打印时一律展开。浏览器的打印对话框里有“存为 PDF”选项。",@@ -46,6 +51,7 @@ export const zh_Hans: Catalog = {"Create “{name}”": "创建“{name}”","Delete “{name}”?": "要删除“{name}”吗?","Delete…": "删除…",+ "Descending": "降序","Discard": "放弃","Downloaded. Open the new file — this one is unchanged.": "已下载。请打开新文件 — 当前文件未改动。","Drag to move, click for block options": "拖动可移动,点击打开块选项",@@ -62,6 +68,7 @@ export const zh_Hans: Catalog = {"Find": "查找","Find in this space…": "在此空间中查找…","Find or create a page…": "查找或新建页面…",+ "Group": "分组","Icon": "图标","Image added ({size})": "已添加图片 ({size})","Image added, resized to fit ({from} → {to})": "已添加图片,已缩放以适配 ({from} → {to})",@@ -77,10 +84,13 @@ export const zh_Hans: Catalog = {"Link to page": "链接到页面","Linked from": "链接来源","Links to it become dead": "指向它的链接会失效",+ "List": "列表",+ "Manual order": "手动排序","New page (⌘⌥N)": "新建页面 (⌘⌥N)","New page inside": "在其中新建页面","Next (⏎)": "下一个 (⏎)","No block matches": "没有匹配的块",+ "No field here has options to group by": "这里没有可用于分组的选项字段","No issues match this filter.": "没有符合此筛选条件的事项。","No pages yet": "还没有页面","Note": "备注",@@ -130,6 +140,9 @@ export const zh_Hans: Catalog = {"Search all pages…": "搜索所有页面…","Search this space": "搜索此空间","Set a password…": "设置密码…",+ "Show as a board": "以看板显示",+ "Show as a list": "以列表显示",+ "Sort": "排序","Space name": "空间名称","Take it elsewhere": "把内容带走","That file could not be read as an image": "无法将该文件作为图片读取",diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.tsindex 61114e1e..17047235 100644--- a/spaces/src/i18n/zh-Hant.ts+++ b/spaces/src/i18n/zh-Hant.ts@@ -16,13 +16,16 @@ export const zh_Hant: Catalog = {"A page cannot contain itself": "頁面不能包含自己","A password encrypts the document inside the file. There is no recovery — lose it and the space is gone.": "密碼會加密檔案內的文件。沒有任何復原方式 — 密碼一旦遺失,這個空間就沒了。","A second file — the original is left alone": "第二個檔案 — 原檔案不受影響",+ "A sort here is newer than this build and was not applied.": "此檢視中有比目前版本更新的排序方式,未被套用。","A space is never a dead end: the whole document is plain JSON in this file, and every page exports as Markdown.": "空間永遠不會是死路:整份文件就是此檔案中的純 JSON,每個頁面也都能匯出成 Markdown。","A space needs at least one page": "空間至少要有一個頁面","About this space": "關於此空間","Add a block below": "在下方新增區塊","Archive": "封存","Archived ({n})": "已封存 ({n})",+ "Ascending": "遞增","Block options": "區塊選項",+ "Board": "看板","Breadcrumb": "階層路徑","Callout icon": "標註圖示","Caution": "當心",@@ -33,6 +36,8 @@ export const zh_Hant: Catalog = {"Checking is manual and verified: the download is signed, and its signature is checked against a key inside this file before anything is rewritten.": "檢查是手動且經過驗證的:下載的檔案帶有簽章,在改寫任何內容之前,都會用此檔案內的金鑰驗證該簽章。","Checking…": "檢查中…","Choose a password. There is no way to recover it.": "請設定密碼。沒有任何方法可以找回它。",+ "Choose the field the columns come from": "選擇作為欄的欄位",+ "Choose the order": "選擇排序方式","Clear filter": "清除篩選","Close": "關閉","Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "收合的摺疊區塊列印時一律展開。「另存為 PDF」的選項在瀏覽器的列印對話方塊中。",@@ -46,6 +51,7 @@ export const zh_Hant: Catalog = {"Create “{name}”": "建立「{name}」","Delete “{name}”?": "要刪除「{name}」嗎?","Delete…": "刪除…",+ "Descending": "遞減","Discard": "捨棄","Downloaded. Open the new file — this one is unchanged.": "已下載。請開啟新檔案 — 目前這個檔案未被更動。","Drag to move, click for block options": "拖曳可移動,點按開啟區塊選項",@@ -62,6 +68,7 @@ export const zh_Hant: Catalog = {"Find": "尋找","Find in this space…": "在此空間尋找…","Find or create a page…": "尋找或建立頁面…",+ "Group": "分組","Icon": "圖示","Image added ({size})": "已新增圖片 ({size})","Image added, resized to fit ({from} → {to})": "已新增圖片,已縮小尺寸 ({from} → {to})",@@ -77,10 +84,13 @@ export const zh_Hant: Catalog = {"Link to page": "連結到頁面","Linked from": "連結來源","Links to it become dead": "指向它的連結會失效",+ "List": "清單",+ "Manual order": "手動排序","New page (⌘⌥N)": "新增頁面 (⌘⌥N)","New page inside": "在其中新增頁面","Next (⏎)": "下一個 (⏎)","No block matches": "沒有符合的區塊",+ "No field here has options to group by": "這裡沒有可用於分組的選項欄位","No issues match this filter.": "沒有符合此篩選條件的項目。","No pages yet": "尚無頁面","Note": "備註",@@ -130,6 +140,9 @@ export const zh_Hant: Catalog = {"Search all pages…": "搜尋所有頁面…","Search this space": "搜尋此空間","Set a password…": "設定密碼…",+ "Show as a board": "以看板顯示",+ "Show as a list": "以清單顯示",+ "Sort": "排序","Space name": "空間名稱","Take it elsewhere": "把內容帶走","That file could not be read as an image": "無法將該檔案讀取為圖片",diff --git a/spaces/src/render.ts b/spaces/src/render.tsindex 4b9fec98..8428299f 100644--- a/spaces/src/render.ts+++ b/spaces/src/render.ts@@ -16,7 +16,8 @@ import { t, locale } from './i18n'import { TAG_OF, LIST_OF, SPEC, TONE } from './blocks'import {fieldByKey, optionOf, issuesOf, headerLength, propBlockOf,- passesFilter, filterCount, unknownFilterKeys, type FieldSpec,+ passesFilter, filterCount, unknownFilterKeys,+ sortRows, unknownSortKeys, type ViewSort, type FieldSpec,} from './fields'import { answer, feed, freshContext, type CalcCtx } from './calc.ts'import { ICONS, type IconName } from './icons'@@ -606,8 +607,9 @@ function renderView(host: HTMLElement, b: Block, doc: SpacesDoc, opts: RenderOptconst groupKey = String((b as { groupBy?: unknown }).groupBy ?? 'status')const field = fieldByKey(doc, groupKey)const filter = (b as { filter?: unknown }).filter+ const sort = (b as { sort?: unknown }).sortconst all = issuesOf(doc)- const rows = all.filter((r) => passesFilter(doc, r.values, filter))+ const rows = sortRows(doc, all.filter((r) => passesFilter(doc, r.values, filter)), sort)const head = document.createElement('div')head.className = 'sp-view-head'@@ -623,22 +625,48 @@ function renderView(host: HTMLElement, b: Block, doc: SpacesDoc, opts: RenderOpt// chip: a reader, a printout and a locked space get the view, not the buttons// that change what it holds.if (opts.editable) {+ const btn = (attr: string, label: string, title: string, on = false): HTMLButtonElement => {+ const el2 = document.createElement('button')+ el2.type = 'button'+ el2.className = 'sp-btn sp-view-btn' + (on ? ' sp-on' : '')+ el2.dataset[attr] = '1'+ el2.textContent = label+ el2.title = title+ el2.setAttribute('aria-label', title)+ return el2+ }++ // LAYOUT. Both shapes have always rendered; only the board was reachable,+ // so a view block could hold `layout:'list'` that nothing in the app could+ // produce or undo. One button, because there are two of them and a menu to+ // choose between two things is a menu too many.+ const asList = layout === 'list'+ const layoutB = btn('viewLayout', asList ? t('List') : t('Board'),+ asList ? t('Show as a board') : t('Show as a list'))++ // GROUP BY. Only fields with declared options: a board's columns ARE the+ // option list, so grouping by a free-text field would make one column per+ // distinct string and call it a board.+ const groupB = btn('viewGroup', field ? `${t('Group')} · ${field.label}` : t('Group'),+ t('Choose the field the columns come from'))++ const sortKey = (Array.isArray(sort) ? sort : [])[0] as ViewSort | undefined+ const sortField = sortKey && fieldByKey(doc, sortKey.key)+ const sortB = btn('viewSort',+ sortField ? `${t('Sort')} · ${sortField.label}` : t('Sort'),+ t('Choose the order'), !!sortField)+const on = !!(filter as { open?: unknown } | undefined)?.open- const openB = document.createElement('button')- openB.type = 'button'- openB.className = 'sp-btn sp-view-btn' + (on ? ' sp-on' : '')- openB.dataset.viewOpen = '1'- openB.textContent = t('Open only')+ const openB = btn('viewOpen', t('Open only'), t('Open only'), on)openB.setAttribute('aria-pressed', String(on))- const filterB = document.createElement('button')- filterB.type = 'button'- filterB.className = 'sp-btn sp-view-btn'- filterB.dataset.viewFilter = '1'const n = filterCount(filter)// the count rather than a list of chips: what matters is that the view is// narrowed at all, and the popover says by what- filterB.textContent = n ? `${t('Filter')} · ${n}` : t('Filter')- head.append(openB, filterB)+ const filterB = btn('viewFilter', n ? `${t('Filter')} · ${n}` : t('Filter'), t('Filter'), !!n)++ // a LIST has no columns, so the field the columns would come from is not a+ // question it can be asked+ head.append(layoutB, ...(asList ? [] : [groupB]), sortB, openB, filterB)}host.appendChild(head)@@ -651,6 +679,16 @@ function renderView(host: HTMLElement, b: Block, doc: SpacesDoc, opts: RenderOptnote.textContent = t('A filter here is newer than this build and was not applied.')host.appendChild(note)}+ // Same rule, same honesty: a sort key naming a field this build has no schema+ // for is skipped, and the order you are looking at is not the one the author+ // asked for. Silently showing a different order is the failure additivity+ // trades for.+ if (unknownSortKeys(doc, sort).length) {+ const note = document.createElement('p')+ note.className = 'sp-view-empty'+ note.textContent = t('A sort here is newer than this build and was not applied.')+ host.appendChild(note)+ }if (!rows.length) {const empty = document.createElement('p')