Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
spaces: a graph view — the space as pages and the links between them (#393)
nyblnet38950d2a7e68
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.mdindex e069732f..9696947d 100644--- a/docs/DECISIONS.md+++ b/docs/DECISIONS.md@@ -5666,6 +5666,50 @@ raised from the bento/type branch during #384 and deliberately NOT decidedthere, which was the right call — a single app's feature branch is the wrongplace to set a cross-app default.+---++## 2026-08-28 — a graph view is a DRAWING, and derived state is never stored++Settled while building `spaces/src/graph.ts` (bento/spaces graph view). Written+down because the next app to want a picture of its own data will face the same+three forks, and because two of these are platform-shaped rather than+spaces-shaped.++**1. Derive at open; store nothing.** The graph is built from+`buildIndex().backlinks` and `Page.parent` when the overlay opens, and dropped+when it closes. There is deliberately no `doc.graph`, no saved node positions+and no second link scanner. A stored layout is meaningless to the next reader's+window size, and a second scanner is a second answer to "what links to this+page" — the one question the backlink index exists to answer. The precedent+cuts the same way as `SpaceIndex` itself: *derived, NEVER stored*.++**2. A viewer preference is read the same way in every app.** Reduced motion+here reads localStorage `bento-reduce-motion` first and the OS+`prefers-reduced-motion` second — character for character the rule+`slides/src/present.ts` set, and the rule the theme and the locale already+follow (PLATFORM §8). An app that invents its own motion preference makes the+suite two products.++**3. An animation needs a wall-clock settle guarantee, not just a rAF loop.**+`requestAnimationFrame` is throttled to ZERO in a hidden or occluded tab. The+graph's reveal interpolates from a spiral toward a settled layout while the+camera is framed against the FINAL positions, so a starved rAF does not merely+fail to animate — it leaves the picture frozen halfway and off-centre, which+reads as a broken feature. Measured in exactly that state, then fixed with a+`setTimeout` that lands the final frame regardless. slides carries the same+guarantee for entrance tweens, for the same reason, and any future app that+animates on open needs one too.++**A note on measuring this class of feature.** Nothing above was found by+looking at the screen. The overlay carries a small debug object (`__graph`:+node/edge counts, layout ms, `reduced`, `reveal`, `frames`) and the frozen-+reveal bug was identified by reading `frames: 0` beside a mid-flight `reveal` —+an instrument on the DECISION, not a sample of the result. The rig's graph+assertions were each made to fail on purpose before being trusted (twelve+deliberate mutations; two assertions were too weak and were tightened, one of+them a threshold that passed both with and without the behaviour it claimed to+test).+## 2026-08-28 — bento/spaces: a table column sorts, a title column does notThe Bases table became editable and sortable in place: a column header cyclesdiff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.tsindex ddace165..0a7f064a 100644--- a/scripts/test-spaces-model.ts+++ b/scripts/test-spaces-model.ts@@ -55,6 +55,9 @@ import {SPECS, SPEC, MENU_SPECS, MD_SPECS, TAG_OF, LIST_OF, CALLOUT_TONES, mdLayout, mediaPlayback,} from '../spaces/src/blocks.ts'import type { Block, Page } from '../spaces/src/model.ts'+import {+ buildGraph, layoutGraph, stepLayout, nodeRadius, graphBounds,+} from '../spaces/src/graph.ts'let failures = 0let checks = 0@@ -3116,5 +3119,159 @@ function fsTable(f: string): string {}+// ---- 8. the graph view -----------------------------------------------------+// The picture is drawn from `buildIndex().backlinks` and nothing else — there+// is no second link index (spaces/src/graph.ts). What is asserted here is the+// part a screenshot cannot show: that two references between the same pair are+// one edge and not two, that the layout is REPRODUCIBLE (the reveal animation+// interpolates toward a settled answer, so a layout that moved between runs+// would make the same space a different picture every time it is opened), and+// that the springs actually pull linked pages together rather than merely+// running without error.+{+ const link = (to: string) => `<a href="#p/${to}">x</a>`+ const space = (pages: Array<Partial<Page> & { id: string }>): SpacesDoc => ({+ format: FORMAT, version: 1, docId: 'g', title: 'g', theme: {},+ pages: pages.map((p) => ({ title: p.id, blocks: [], ...p })),+ }) as unknown as SpacesDoc+ const graphOf = (d: SpacesDoc) => buildGraph(d, buildIndex(d))++ {+ const d = space([+ { id: 'a', blocks: [{ id: 'b1', type: 'p', html: link('b') } as Block] },+ { id: 'b' },+ { id: 'z', archived: true, blocks: [{ id: 'b2', type: 'p', html: link('b') } as Block] },+ ])+ const g = graphOf(d)+ ok(g.nodes.length === 2 && !g.at.has('z'),+ 'graph: an archived page is not drawn — it is out of the way in the sidebar too')+ ok(g.edges.length === 1 && g.edges[0].links === 1,+ 'graph: one link between two pages is one edge')+ ok(g.nodes.every((n) => n.deg === 1),+ 'graph: …and both ends of it count as connected')+ }+ {+ // two references, one relationship — the defect this guards is an edge list+ // that grows with every mention and a hub that looks twice as busy as it is+ const d = space([+ { id: 'a', blocks: [+ { id: 'b1', type: 'p', html: link('b') } as Block,+ { id: 'b2', type: 'p', html: link('b') } as Block,+ ] },+ { id: 'b', blocks: [{ id: 'b3', type: 'p', html: link('a') } as Block] },+ ])+ const g = graphOf(d)+ ok(g.edges.length === 1, 'graph: three references between one pair are ONE undirected edge')+ ok(g.edges[0].links === 3, '…carrying the weight of all three')+ ok(g.nodes[0].deg === 1, '…and counting once toward how connected the page is')+ }+ {+ const d = space([{ id: 'a', blocks: [{ id: 'b1', type: 'p', html: link('a') } as Block] }])+ ok(graphOf(d).edges.length === 0, 'graph: a page that links to itself draws no edge')+ }+ {+ // the tree is a relationship too: a space where nobody has written a+ // wikilink yet must not draw as unconnected dust+ const d = space([{ id: 'a' }, { id: 'b', parent: 'a' }])+ const g = graphOf(d)+ ok(g.edges.length === 1 && g.edges[0].tree && g.edges[0].links === 0,+ 'graph: a child page is joined to its parent')+ const d2 = space([+ { id: 'a', blocks: [{ id: 'b1', type: 'p', html: link('b') } as Block] },+ { id: 'b', parent: 'a' },+ ])+ const g2 = graphOf(d2)+ ok(g2.edges.length === 1 && g2.edges[0].tree && g2.edges[0].links === 1,+ 'graph: a child that is ALSO linked is still one edge, not two on top of each other')+ }+ ok(nodeRadius(0) < nodeRadius(3) && nodeRadius(3) < nodeRadius(30) && nodeRadius(1e6) <= 20,+ 'graph: a better-connected page draws bigger, and no page draws unboundedly big')++ {+ // REPRODUCIBILITY. Seeds are a golden-angle spiral, not Math.random, and+ // every force is a pure function of the positions.+ const pages: Array<Partial<Page> & { id: string }> = []+ for (let i = 0; i < 40; i++) {+ pages.push({ id: `p${i}`, blocks: [+ { id: `x${i}`, type: 'p', html: link(`p${(i * 7 + 3) % 40}`) } as Block,+ ] })+ }+ const d = space(pages)+ const one = layoutGraph(graphOf(d))+ const two = layoutGraph(graphOf(d))+ const same = one.nodes.every((n, i) => n.x === two.nodes[i].x && n.y === two.nodes[i].y)+ ok(same, 'graph: the same space lays out identically twice — the picture is stable')++ // the RADIUS, not just the centre: the camera frames this box, so a box+ // that only contains the centres crops half of every node on the rim.+ // Checked with `x0 + 5` in the mutation pass and the centres-only version+ // of this assertion did not notice.+ const bounds = graphBounds(one)+ ok(one.nodes.every((n) => n.x - n.r >= bounds.x0 && n.x + n.r <= bounds.x1+ && n.y - n.r >= bounds.y0 && n.y + n.r <= bounds.y1),+ 'graph: the frame the camera is fitted to contains every node, edge to edge')+ ok(one.nodes.some((n) => Math.abs((n.x - n.r) - bounds.x0) < 1e-9),+ '…and is no larger than it has to be')++ const cx = one.nodes.reduce((s, n) => s + n.x, 0) / one.nodes.length+ ok(Math.abs(cx) < 1e-6, 'graph: the settled layout is centred, so the camera can frame it')++ // THE SPRINGS DO SOMETHING. Without this the layout could be a pure+ // repulsion cloud — evenly spread, reproducible, centred, and telling you+ // nothing about which pages are related.+ const dist = (i: number, j: number) =>+ Math.hypot(one.nodes[i].x - one.nodes[j].x, one.nodes[i].y - one.nodes[j].y)+ let linked = 0+ for (const e of one.edges) linked += dist(e.a, e.b)+ linked /= one.edges.length+ let all = 0+ let pairs = 0+ for (let i = 0; i < one.nodes.length; i++) {+ for (let j = i + 1; j < one.nodes.length; j++) { all += dist(i, j); pairs++ }+ }+ all /= pairs+ ok(linked < all * 0.6,+ 'graph: linked pages end up markedly closer than unlinked ones')++ // and the cloud has to GROW with the space, or a big space is a dot: see+ // gravityFor. 400 pages must not settle into the same disc as 40.+ const big: Array<Partial<Page> & { id: string }> = []+ for (let i = 0; i < 400; i++) {+ big.push({ id: `q${i}`, blocks: [+ { id: `y${i}`, type: 'p', html: link(`q${(i * 7 + 3) % 400}`) } as Block,+ ] })+ }+ const bg = layoutGraph(graphOf(space(big)))+ const radius = (g: ReturnType<typeof graphOf>) => {+ const b = graphBounds(g)+ return Math.max(b.x1 - b.x0, b.y1 - b.y0) / 2+ }+ // MEASURED, not guessed: ten times the pages settles 3.01x wider with+ // gravityFor and only 2.29x wider with a constant gravity (the radius goes+ // as n^(1/3) instead of sqrt(n)). 2.6 sits between the two — a threshold of+ // 2.2, tried first, passed on BOTH and proved nothing.+ ok(radius(bg) > radius(one) * 2.6,+ 'graph: ten times the pages is a bigger picture, not a denser one')+ }+ {+ // stepLayout must SETTLE, not oscillate: a layout that is still moving when+ // it is handed over is a layout the camera was fitted to by accident+ const pages: Array<Partial<Page> & { id: string }> = []+ for (let i = 0; i < 30; i++) {+ pages.push({ id: `s${i}`, blocks: [+ { id: `z${i}`, type: 'p', html: link(`s${(i + 1) % 30}`) } as Block,+ ] })+ }+ const g = graphOf(space(pages))+ layoutGraph(g)+ const before = g.nodes.map((n) => ({ x: n.x, y: n.y }))+ stepLayout(g, 0.01)+ const moved = Math.max(...g.nodes.map((n, i) =>+ Math.hypot(n.x - before[i].x, n.y - before[i].y)))+ ok(moved < 0.5, 'graph: one more tick on a settled layout barely moves anything')+ }+}++console.log(`\n${checks - failures}/${checks} checks passed`)if (failures) process.exit(1)diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex e4c7d1ab..75612e93 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -14,6 +14,44 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.## [Unreleased]+- **A graph view.** ⋯ → *Graph* draws the space as its pages and the links+ between them: every non-archived page is a node, sized by how connected it+ is, joined by an edge for every `[[wikilink]]` and for every parent/child+ pair in the page tree. Hovering a page lights it and its neighbours and dims+ the rest; clicking one opens it. Scroll to zoom, drag to pan, drag a page to+ move it, *Fit* to reframe.++ **It is a drawing, not a new index.** `buildIndex` has always computed+ `backlinks` — target page → the blocks pointing at it — and the page tree has+ always known its parents. Nothing here is stored in the document: no layout,+ no positions, no second answer to "what links to this page". The picture is+ derived when you open it and thrown away when you close it, so it can never+ go stale and never costs a saved byte.++ **No library.** The force simulation is about eighty lines, written out+ rather than imported: this app ships as one HTML file and every byte is paid+ on every open. The whole feature costs **7.2 KB** of compressed shell.++ **The layout is computed once and is reproducible.** Starting positions come+ from a golden-angle spiral rather than `Math.random`, so the same space draws+ the same picture every time you open it. The animation is an interpolation+ from that spiral toward the settled answer, which is why the camera never+ jitters — it is framed once, against final positions. Once the reveal has+ played there is no timer and no animation frame: a graph on screen costs+ nothing until you touch it.++ **Reduced motion is honoured**, by the rule bento/slides already set: the+ localStorage preference over the OS `prefers-reduced-motion`, never the+ document. With it on there is no reveal — the settled picture is simply+ drawn.++ **Measured, on a synthetic space of 213 pages and 328 links:** 28 ms to open+ (27 ms of it layout), and 0.35 ms to repaint a frame. At 513 pages and 739+ links: 182 ms to open, still under half a millisecond a frame. Labels are+ offered most-connected-first and placed only where they do not collide, so a+ small space labels every page and a large one labels its hubs, and zooming in+ reveals more.+- **A dark interface.** About → Appearance offers *Match my system*, *Light* or*Dark*, follows the OS by default, and tracks it live if the OS flips whilethe file is open.diff --git a/spaces/src/editor.ts b/spaces/src/editor.tsindex c01cd6f2..4907f4f1 100644--- a/spaces/src/editor.ts+++ b/spaces/src/editor.ts@@ -35,6 +35,7 @@ import { countOutsideTags, replaceOutsideTags } from './findreplace'import { asksForAnswer, evaluate, format, pageContext } from './calc'import { t, locale } from './i18n'import { openAbout } from './about'+import { openGraphView } from './graph.ts'import {todayISO, stepDay, journalLabel, journalShort, isJournal, planJournal,} from './journal'@@ -347,6 +348,8 @@ export class Editor {run: () => this.makeIssue() },{ icon: 'markdown', label: t('Import Markdown…'), hint: t('A folder of notes, or another space'),run: () => this.openImport() },+ { icon: 'graph', label: t('Graph'), hint: t('Every page, and what links to what'),+ run: () => this.openGraph() },{ icon: 'print', label: t('Print or save as PDF'), hint: '⌘P', run: () => this.openPrint() },{ icon: 'info', label: t('About this space'), hint: t('Version, language, password, exports'),run: () => this.openAbout() },@@ -3315,6 +3318,42 @@ export class Editor {* the dialog's scrim, escape handling and focus return rather than growing a* second set.*/+ /**+ * The space as a picture: pages, and the links between them.+ *+ * The DRAWING lives in graph.ts; what is here is only what an overlay is in+ * this editor — one at a time, and it owns the keyboard while it is open+ * (`this.overlay`). Teardown rides on `overlayReflow`, which is the hook+ * `closeOverlay` already calls before it removes the node: the graph has+ * observers and an animation frame to give back, and there is no second+ * teardown path to forget about.+ */+ openGraph(): void {+ this.closeOverlay()+ const returnFocus = document.activeElement as HTMLElement | null+ const view = openGraphView({+ doc: this.store.doc,+ index: this.store.index,+ currentId: this.store.pageId,+ open: (id) => { close(); this.store.goToPage(id); this.repaint() },+ close: () => close(),+ })+ const close = () => {+ this.closeOverlay()+ document.removeEventListener('keydown', onKey, true)+ returnFocus?.focus?.()+ }+ const onKey = (e: KeyboardEvent) => {+ if (e.key === 'Escape') { e.stopPropagation(); close() }+ }+ document.addEventListener('keydown', onKey, true)+ this.overlay = view.el+ this.overlayReflow = () => view.destroy()+ document.body.append(view.el)+ view.el.tabIndex = -1+ view.el.focus()+ }+openHelp(): void {this.closeOverlay()const returnFocus = document.activeElement as HTMLElement | nulldiff --git a/spaces/src/graph.ts b/spaces/src/graph.tsnew file mode 100644index 00000000..5bbe3349--- /dev/null+++ b/spaces/src/graph.ts@@ -0,0 +1,811 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+//+// THE GRAPH VIEW: a space drawn as its pages and the links between them.+//+// WHY THIS FILE EXISTS AT ALL, given that nothing here is new information.+// `buildIndex` (model.ts) already computes `backlinks` — target page id → every+// block that points at it — and the page tree already knows every parent. A+// space therefore HAS a graph from the moment it is loaded; it has simply never+// been drawn. So this is a rendering problem, and the one rule it follows is+// that it must not become a data problem: there is NO second link index here.+// Everything `buildGraph` returns is derived from `SpaceIndex.backlinks` and+// `Page.parent`, at open, and thrown away at close. A stored layout would be a+// document field that means nothing to the next reader's window size, and a+// second link scanner would be a second answer to "what links to this page".+//+// THREE DECISIONS WORTH THE INK:+//+// 1. NO LIBRARY, AND NO NETWORK. This app ships as one HTML file and every+// byte is paid on every open, by every reader, forever. d3-force is ~30KB+// for a hundred lines of arithmetic that is written out below instead.+//+// 2. THE LAYOUT IS COMPUTED ONCE, SYNCHRONOUSLY, AND IS DETERMINISTIC.+// Initial positions come from a golden-angle spiral, not `Math.random`, so+// the same space lays out the same way twice — which is what makes the+// layout testable at all (scripts/test-spaces-model.ts asserts on it) and+// what stops the picture jumping when you close and reopen it. The+// animation is then a pure INTERPOLATION from the spiral to that settled+// answer. That is not a shortcut: a live simulation has to re-fit the+// camera every frame as the cloud grows, which is the jitter that makes+// home-made force graphs look accidental. Here the camera is framed once,+// against final positions, and the nodes glide into it.+//+// 3. IDLE COSTS NOTHING. Once the reveal has played there is no timer and no+// rAF: a graph on screen is a still picture until you touch it. Obsidian's+// graph never stops simmering and it is the reason that tab warms a laptop.+//+// REDUCED MOTION is the viewer preference slides established (present.ts):+// localStorage 'bento-reduce-motion' over the OS `prefers-reduced-motion`, never+// the document. When it is on there is no reveal — the settled layout is drawn+// on the first frame, which is the same picture, immediately.++import type { SpacesDoc, SpaceIndex } from './model.ts'+import { ICONS } from './icons.ts'+import { t } from './i18n.ts'++// ————— the graph itself ————————————————————————————————————————————————————++export interface GraphNode {+ id: string+ title: string+ icon?: string+ /** how many distinct pages this one is connected to — what the size shows */+ deg: number+ /** every reference, so a page linked five times reads heavier than once */+ weight: number+ x: number+ y: number+ vx: number+ vy: number+ r: number+}++/**+ * One undirected edge.+ *+ * UNDIRECTED ON PURPOSE. A → B and B → A are one relationship on a picture of+ * a wiki; drawn as two lines they are two lines in exactly the same place, and+ * the only thing that changes is that the pair looks twice as connected as it+ * is. `links` counts the references behind it (so a heavily-cross-referenced+ * pair draws thicker) and `tree` says the two are also parent and child.+ */+export interface GraphEdge {+ a: number+ b: number+ /** number of `[[wikilink]]`/pagelink references between the two, either way */+ links: number+ /** true when one is the other's parent in the page tree */+ tree: boolean+}++export interface Graph {+ nodes: GraphNode[]+ edges: GraphEdge[]+ /** page id → node position in `nodes`; absent for archived pages */+ at: Map<string, number>+}++/**+ * Node radius from connectedness.+ *+ * sqrt, not linear: a page with 40 backlinks is not 40 times more interesting+ * than one with one, and a linear map makes the hub a disc that swallows its+ * own neighbourhood. Floor 4 so an orphan is still a thing you can click.+ */+export const nodeRadius = (deg: number): number => Math.min(4 + 3.1 * Math.sqrt(deg), 20)++/** Golden-angle spiral: even, deterministic, and not a grid. */+function seedPosition(i: number): { x: number; y: number } {+ const a = i * 2.399963229728653+ const r = 26 * Math.sqrt(i + 0.5)+ return { x: Math.cos(a) * r, y: Math.sin(a) * r }+}++/**+ * The pages and the links between them — ARCHIVED PAGES EXCLUDED.+ *+ * An archive is the author saying "out of the way"; a picture of the space+ * that puts them back in the middle of it is not the space they are looking at.+ * They stay searchable and linkable, exactly as the sidebar has them, and a+ * link INTO one simply has no edge to draw.+ */+export function buildGraph(doc: SpacesDoc, index: SpaceIndex): Graph {+ const nodes: GraphNode[] = []+ const at = new Map<string, number>()+ for (const p of doc.pages) {+ if (p.archived) continue+ at.set(p.id, nodes.length)+ const seed = seedPosition(nodes.length)+ nodes.push({+ id: p.id,+ title: p.title || t('Untitled'),+ // `Page.icon` is EITHER a name in the ICONS set (an svg, which a canvas+ // cannot paint without rasterising it first) OR an emoji, which is just+ // text. Keep the second kind and drop the first — before this test the+ // labels read "compass Welcome", the icon's NAME beside the title.+ icon: typeof p.icon === 'string' && !Object.hasOwn(ICONS, p.icon) ? p.icon : undefined,+ deg: 0,+ weight: 0,+ x: seed.x,+ y: seed.y,+ vx: 0,+ vy: 0,+ r: nodeRadius(0),+ })+ }++ const edges: GraphEdge[] = []+ const seen = new Map<number, number>() // packed pair key → edge position+ const key = (a: number, b: number) => (a < b ? a : b) * nodes.length + (a < b ? b : a)+ const edgeFor = (a: number, b: number): GraphEdge => {+ const k = key(a, b)+ const hit = seen.get(k)+ if (hit !== undefined) return edges[hit]+ const e: GraphEdge = { a: Math.min(a, b), b: Math.max(a, b), links: 0, tree: false }+ seen.set(k, edges.length)+ edges.push(e)+ return e+ }++ // THE ONE LINK INDEX. `backlinks` is target → sources, already built.+ for (const [target, sources] of index.backlinks) {+ const b = at.get(target)+ if (b === undefined) continue+ for (const s of sources) {+ const a = at.get(s.pageId)+ // a self-link is a real thing to write and a nothing to draw+ if (a === undefined || a === b) continue+ edgeFor(a, b).links+++ }+ }+ // …and the tree, which is a relationship the reader can see in the sidebar+ // and would otherwise be missing from the picture entirely: a space where+ // nobody has written a wikilink yet would draw as a field of dust.+ for (const p of doc.pages) {+ if (p.archived || !p.parent) continue+ const a = at.get(p.id)+ const b = at.get(p.parent)+ if (a === undefined || b === undefined || a === b) continue+ edgeFor(a, b).tree = true+ }++ for (const e of edges) {+ nodes[e.a].deg+++ nodes[e.b].deg+++ const w = e.links + (e.tree ? 1 : 0)+ nodes[e.a].weight += w+ nodes[e.b].weight += w+ }+ for (const n of nodes) n.r = nodeRadius(n.deg)+ return { nodes, edges, at }+}++// ————— the force simulation ————————————————————————————————————————————————++/** Everything the layout is tuned by, in one place so a tweak is one number. */+const REPULSION = 5200+/** past this the pairwise term is noise; gravity is what keeps the cloud one cloud */+const REPULSION_RANGE = 620+const SPRING = 0.022+const REST_LINK = 96+const REST_TREE = 78+const GRAVITY = 0.011+/**+ * Gravity has to WEAKEN as a space grows, or a big space is a dot.+ *+ * The cloud settles where the outward push of n nodes balances the inward+ * pull, which for a fixed gravity puts its radius at roughly (n·REPULSION/G)^⅓+ * — so the AREA per page falls as n^-⅓ and every page you write makes the+ * picture denser. Measured on a synthetic space: 400 pages settled only 2.29×+ * wider than 40, and at 213 pages the whole graph drew as a uniform ball about+ * 300px across in a 690px frame with its structure invisible inside it.+ * Scaling gravity by 1/√n makes the radius grow like √n instead — constant+ * area per page — and the same pair measures 3.01× apart. Normalised at 24, so+ * small spaces are unchanged.+ */+const gravityFor = (n: number): number => GRAVITY * Math.sqrt(24 / Math.max(n, 24))+const DAMPING = 0.74+const TICKS = 460++/**+ * One step. Exported so the rig can watch the energy fall rather than trust+ * that it does.+ *+ * O(n²) in the repulsion, deliberately: at 200 pages that is 20k pairs, and+ * measured at 500 pages the whole 460-tick layout runs in well under half a+ * second, once, on open. A quadtree would be another 80 lines of code that can+ * be subtly wrong in ways a picture does not reveal.+ */+export function stepLayout(g: Graph, alpha: number): void {+ const { nodes, edges } = g+ const n = nodes.length+ for (let i = 0; i < n; i++) {+ const a = nodes[i]+ for (let j = i + 1; j < n; j++) {+ const b = nodes[j]+ let dx = a.x - b.x+ let dy = a.y - b.y+ let d2 = dx * dx + dy * dy+ if (d2 > REPULSION_RANGE * REPULSION_RANGE) continue+ if (d2 < 0.25) {+ // two nodes exactly on top of each other have no direction to separate+ // along; give them one that depends only on their positions in the+ // array, so the layout stays reproducible+ dx = ((i * 7 + j) % 11) - 5+ dy = ((i * 5 + j * 3) % 11) - 5+ d2 = dx * dx + dy * dy || 1+ }+ const d = Math.sqrt(d2)+ const f = REPULSION / (d2 * d)+ const fx = dx * f+ const fy = dy * f+ a.vx += fx+ a.vy += fy+ b.vx -= fx+ b.vy -= fy+ }+ }+ for (const e of edges) {+ const a = nodes[e.a]+ const b = nodes[e.b]+ const dx = b.x - a.x+ const dy = b.y - a.y+ const d = Math.sqrt(dx * dx + dy * dy) || 0.01+ const rest = e.links > 0 ? REST_LINK : REST_TREE+ const f = (SPRING * (d - rest)) / d+ // A hub is pulled by everything it is connected to, so an equal share each+ // would make it the one node that never sits still. Inverse mass by degree+ // is what turns hubs into anchors and leaves into the things that arrange+ // themselves around them.+ const ma = 1 / (1 + 0.5 * Math.sqrt(a.deg))+ const mb = 1 / (1 + 0.5 * Math.sqrt(b.deg))+ a.vx += dx * f * ma+ a.vy += dy * f * ma+ b.vx -= dx * f * mb+ b.vy -= dy * f * mb+ }+ const grav = gravityFor(n)+ for (const p of nodes) {+ p.vx -= p.x * grav+ p.vy -= p.y * grav+ p.vx *= DAMPING+ p.vy *= DAMPING+ p.x += p.vx * alpha+ p.y += p.vy * alpha+ }+}++/**+ * Settle the whole thing and centre it on the origin.+ *+ * Returns the graph so a caller can chain; mutates in place because the nodes+ * are the things being laid out.+ */+export function layoutGraph(g: Graph, ticks = TICKS): Graph {+ let alpha = 1+ for (let i = 0; i < ticks; i++) {+ stepLayout(g, alpha)+ alpha *= 0.99+ }+ if (!g.nodes.length) return g+ let cx = 0+ let cy = 0+ for (const p of g.nodes) {+ cx += p.x+ cy += p.y+ }+ cx /= g.nodes.length+ cy /= g.nodes.length+ for (const p of g.nodes) {+ p.x -= cx+ p.y -= cy+ p.vx = 0+ p.vy = 0+ }+ return g+}++/** The box the settled graph occupies, node radii included. */+export function graphBounds(g: Graph): { x0: number; y0: number; x1: number; y1: number } {+ if (!g.nodes.length) return { x0: -1, y0: -1, x1: 1, y1: 1 }+ let x0 = Infinity+ let y0 = Infinity+ let x1 = -Infinity+ let y1 = -Infinity+ for (const p of g.nodes) {+ x0 = Math.min(x0, p.x - p.r)+ y0 = Math.min(y0, p.y - p.r)+ x1 = Math.max(x1, p.x + p.r)+ y1 = Math.max(y1, p.y + p.r)+ }+ return { x0, y0, x1, y1 }+}++// ————— the viewer preference ————————————————————————————————————————————————++/**+ * Reduced motion, by slides' rule (present.ts): an explicit localStorage+ * choice, else the OS. A VIEWER preference — it is never in the document.+ */+export function prefersReducedMotion(): boolean {+ let stored: string | null = null+ try {+ stored = localStorage.getItem('bento-reduce-motion')+ } catch { /* private mode: fall through to the OS */ }+ if (stored === 'on') return true+ if (stored === 'off') return false+ try {+ return matchMedia('(prefers-reduced-motion: reduce)').matches+ } catch { return false }+}++// ————— drawing ——————————————————————————————————————————————————————————————++/**+ * The overlay's own CSS, injected once.+ *+ * NOT in styles.css: three branches are editing that file in parallel and this+ * whole feature is otherwise one new file. Marked `data-bento-transient` so it+ * can never be serialized into a saved document — the rule the compressed+ * shell's inflated stylesheet taught (kernel/src/save.ts serializeBody).+ */+const CSS = `+.sp-overlay-graph { align-items: center; padding: 14px; padding-top: 14px; }+.sp-graph {+ width: min(1180px, calc(100vw - 28px));+ height: min(820px, calc(100vh - 28px));+ max-height: none; padding: 0; overflow: hidden;+ display: flex; flex-direction: column;+}+.sp-graph-head {+ display: flex; align-items: center; gap: 10px;+ padding: 10px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto;+}+.sp-graph-head .sp-card-h { margin: 0; }+.sp-graph-count { color: var(--muted); font-size: 12px; }+.sp-graph-spacer { flex: 1 1 auto; }+.sp-graph-btn {+ font: inherit; font-size: 12px; color: var(--muted); cursor: pointer;+ background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px;+}+.sp-graph-btn:hover { background: var(--chrome-2); color: var(--ink); }+.sp-graph-stage { position: relative; flex: 1 1 auto; min-height: 0; background: var(--bg); }+.sp-graph-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }+.sp-graph-empty {+ position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;+ color: var(--muted); font-size: 13px; text-align: center; padding: 0 24px;+}+.sp-graph-foot {+ flex: 0 0 auto; padding: 7px 12px; border-top: 1px solid var(--line);+ color: var(--muted); font-size: 11.5px;+}+`++function css(): void {+ if (document.getElementById('sp-graph-css')) return+ const s = document.createElement('style')+ s.id = 'sp-graph-css'+ s.setAttribute('data-bento-transient', '')+ s.textContent = CSS+ document.head.append(s)+}++const mk = <K extends keyof HTMLElementTagNameMap>(+ tag: K, cls: string, text?: string,+): HTMLElementTagNameMap[K] => {+ const e = document.createElement(tag)+ if (cls) e.className = cls+ if (text !== undefined) e.textContent = text+ return e+}++/**+ * The theme, read out of the CSS tokens.+ *+ * A canvas is outside CSS: `var(--ink)` means nothing to `ctx.fillStyle`, so+ * the tokens have to be resolved to strings and re-resolved whenever the theme+ * changes underneath. This is the whole reason a canvas graph looks broken in+ * dark mode — someone wrote `#fff` once.+ */+interface Palette {+ bg: string; ink: string; muted: string; line: string+ edge: string; accent: string; blue: string; surface: string+}+function palette(): Palette {+ const s = getComputedStyle(document.documentElement)+ const v = (name: string, fallback: string) => s.getPropertyValue(name).trim() || fallback+ return {+ bg: v('--bg', '#ffffff'),+ ink: v('--ink', '#1e2a3a'),+ muted: v('--muted', '#5b6472'),+ line: v('--line', '#e3e8ef'),+ edge: v('--edge', '#b9c3d2'),+ accent: v('--accent', '#f7a600'),+ blue: v('--blue', '#5b8def'),+ surface: v('--surface', '#ffffff'),+ }+}++export interface GraphViewOpts {+ doc: SpacesDoc+ index: SpaceIndex+ /** the page being read, ringed so you can find yourself */+ currentId: string+ /** clicking a node: the caller closes the overlay and goes there */+ open: (pageId: string) => void+ /** Close, Escape, or a click on the backdrop — the editor owns teardown */+ close: () => void+}++export interface GraphView {+ /** the overlay element, for the caller's `this.overlay` */+ el: HTMLElement+ /** unhook listeners; the caller removes `el` */+ destroy: () => void+ /** what was drawn, for the console and for measurement */+ graph: Graph+}++/**+ * Open the graph over the workspace.+ *+ * Returns the overlay rather than mounting policy: the editor owns what an+ * overlay IS (one at a time, `this.overlay` takes the keyboard), and this+ * module owns what it looks like.+ */+export function openGraphView(opts: GraphViewOpts): GraphView {+ css()+ const reduced = prefersReducedMotion()++ const g = buildGraph(opts.doc, opts.index)+ const t0 = performance.now()+ layoutGraph(g)+ const layoutMs = performance.now() - t0++ const back = mk('div', 'sp-overlay sp-overlay-graph')+ const card = mk('div', 'sp-card sp-graph')+ card.setAttribute('role', 'dialog')+ card.setAttribute('aria-modal', 'true')+ card.setAttribute('aria-label', t('Graph'))++ const head = mk('div', 'sp-graph-head')+ head.append(mk('h2', 'sp-card-h', t('Graph')))+ const linkCount = g.edges.reduce((s, e) => s + e.links, 0)+ head.append(mk('span', 'sp-graph-count',+ t('{pages} pages · {links} links', { pages: g.nodes.length, links: linkCount })))+ head.append(mk('div', 'sp-graph-spacer'))+ const fitBtn = mk('button', 'sp-graph-btn', t('Fit'))+ fitBtn.type = 'button'+ const closeBtn = mk('button', 'sp-graph-btn', t('Close'))+ closeBtn.type = 'button'+ head.append(fitBtn, closeBtn)++ const stage = mk('div', 'sp-graph-stage')+ const canvas = mk('canvas', '')+ stage.append(canvas)+ if (!g.nodes.length) {+ stage.append(mk('div', 'sp-graph-empty',+ t('Nothing to draw yet — link two pages with [[ and they will appear here.')))+ }++ const foot = mk('div', 'sp-graph-foot',+ t('Click a page to open it · drag to move · scroll to zoom'))++ card.append(head, stage, foot)+ back.append(card)++ // ——— camera ———+ let scale = 1+ let panX = 0+ let panY = 0+ let W = 0+ let H = 0+ let pal = palette()++ const fit = () => {+ const b = graphBounds(g)+ const bw = Math.max(b.x1 - b.x0, 1)+ const bh = Math.max(b.y1 - b.y0, 1)+ scale = Math.min((W - 80) / bw, (H - 80) / bh, 1.6)+ if (!isFinite(scale) || scale <= 0) scale = 1+ panX = W / 2 - ((b.x0 + b.x1) / 2) * scale+ panY = H / 2 - ((b.y0 + b.y1) / 2) * scale+ }++ const ctx = canvas.getContext('2d')++ // ——— the reveal ———+ // 0 → 1 over the reveal; each node interpolates from its spiral seed to its+ // settled place. With reduced motion this starts at 1 and never moves.+ let reveal = reduced ? 1 : 0+ const seeds = g.nodes.map((_, i) => seedPosition(i))+ let hover = -1+ const neighbours = new Set<number>()++ const resize = () => {+ const r = stage.getBoundingClientRect()+ const dpr = Math.min(window.devicePixelRatio || 1, 3)+ const w = Math.max(1, Math.round(r.width))+ const h = Math.max(1, Math.round(r.height))+ const first = W === 0+ W = w+ H = h+ canvas.width = Math.round(w * dpr)+ canvas.height = Math.round(h * dpr)+ if (ctx) ctx.setTransform(dpr, 0, 0, dpr, 0, 0)+ if (first) fit()+ draw()+ }++ const nx = (n: GraphNode, i: number) => (reveal >= 1 ? n.x : seeds[i].x + (n.x - seeds[i].x) * reveal)+ const ny = (n: GraphNode, i: number) => (reveal >= 1 ? n.y : seeds[i].y + (n.y - seeds[i].y) * reveal)+ const sx = (x: number) => x * scale + panX+ const sy = (y: number) => y * scale + panY++ function draw(): void {+ if (!ctx) return+ ctx.save()+ ctx.fillStyle = pal.bg+ ctx.fillRect(0, 0, W, H)++ const dim = hover >= 0+ // edges first, so a node always sits on top of what it is joined to+ ctx.lineCap = 'round'+ for (const e of g.edges) {+ const a = g.nodes[e.a]+ const b = g.nodes[e.b]+ const lit = dim && (hover === e.a || hover === e.b)+ const faded = dim && !lit+ ctx.globalAlpha = faded ? 0.08 : e.links > 0 ? 0.7 : 0.42+ ctx.strokeStyle = lit ? pal.accent : pal.edge+ ctx.lineWidth = Math.min(0.7 + 0.45 * (e.links || 1), 3) * Math.min(scale, 1.4)+ ctx.beginPath()+ ctx.moveTo(sx(nx(a, e.a)), sy(ny(a, e.a)))+ ctx.lineTo(sx(nx(b, e.b)), sy(ny(b, e.b)))+ ctx.stroke()+ }++ ctx.globalAlpha = 1+ const labels: Array<{ x: number; y: number; text: string; lit: boolean; deg: number }> = []+ for (let i = 0; i < g.nodes.length; i++) {+ const n = g.nodes[i]+ const X = sx(nx(n, i))+ const Y = sy(ny(n, i))+ const R = Math.max(2.2, n.r * Math.min(scale, 2))+ if (X < -60 || Y < -60 || X > W + 60 || Y > H + 60) continue+ const lit = i === hover || neighbours.has(i)+ ctx.globalAlpha = dim && !lit ? 0.22 : 1+ ctx.beginPath()+ ctx.arc(X, Y, R, 0, Math.PI * 2)+ // An orphan is a real state of a page and the picture should say so+ // rather than colour it like everything else.+ ctx.fillStyle = i === hover ? pal.accent : n.deg === 0 ? pal.muted : pal.blue+ ctx.fill()+ // a hairline in the ground colour, so touching nodes stay countable+ ctx.lineWidth = 1+ ctx.strokeStyle = pal.bg+ ctx.stroke()+ if (n.id === opts.currentId) {+ ctx.beginPath()+ ctx.arc(X, Y, R + 3.5, 0, Math.PI * 2)+ ctx.strokeStyle = pal.accent+ ctx.lineWidth = 2+ ctx.stroke()+ }+ labels.push({ x: X, y: Y + R + 11, text: n.icon ? `${n.icon} ${n.title}` : n.title, lit, deg: n.deg })+ }++ ctx.globalAlpha = 1+ ctx.textAlign = 'center'+ ctx.textBaseline = 'middle'+ ctx.font = '11.5px system-ui, -apple-system, "Segoe UI", sans-serif'+ ctx.lineJoin = 'round'++ // WHICH LABELS GET DRAWN. Every label, at 200 pages, is a grey smear —+ // and a threshold on node size (the first answer here) labelled five of+ // thirteen pages in a space with room for all thirteen. So: offer them all,+ // most-connected first, and take the ones that FIT. A label whose box+ // overlaps one already placed is dropped, which is a rule that needs no+ // tuning per space size: a sparse graph labels everything, a dense one+ // labels its hubs, and zooming in spreads the boxes apart so more of them+ // survive. Whatever you are pointing at, and what it touches, is placed+ // first and unconditionally — that is what hovering is FOR.+ const order = labels+ .map((l, i) => ({ l, i }))+ .sort((p, q) => (Number(q.l.lit) - Number(p.l.lit)) || (q.l.deg - p.l.deg) || (p.i - q.i))+ const placed: Array<[number, number, number, number]> = []+ for (const { l } of order) {+ const text = l.text.length > 34 ? `${l.text.slice(0, 33)}…` : l.text+ const w = ctx.measureText(text).width+ const box: [number, number, number, number] = [l.x - w / 2 - 2, l.y - 7, l.x + w / 2 + 2, l.y + 7]+ if (!l.lit) {+ let clash = false+ for (const b of placed) {+ if (box[0] < b[2] && box[2] > b[0] && box[1] < b[3] && box[3] > b[1]) { clash = true; break }+ }+ if (clash) continue+ }+ placed.push(box)+ ctx.globalAlpha = dim && !l.lit ? 0.25 : 1+ // a halo in the ground colour: the only thing that keeps a label legible+ // where it crosses an edge, in either theme+ ctx.lineWidth = 3+ ctx.strokeStyle = pal.bg+ ctx.strokeText(text, l.x, l.y)+ ctx.fillStyle = l.lit ? pal.ink : pal.muted+ ctx.fillText(text, l.x, l.y)+ }+ ctx.restore()+ }++ // ——— the reveal animation ———+ //+ // WITH A WALL-CLOCK SETTLE GUARANTEE, which is not belt-and-braces: rAF is+ // throttled to ZERO in a hidden or occluded tab, so a graph opened in a+ // background window would freeze halfway between the spiral and its answer+ // and STAY there — a picture that is wrong rather than merely unanimated,+ // because the camera was framed against the settled positions. Measured in+ // exactly that state before this existed, and measured again after: the+ // debug hook below reported `frames: 0` (rAF never ran once) with+ // `reveal: 1`. slides carries the same guarantee for entrance tweens+ // (present.ts) for the same reason.+ let raf = 0+ let settle = 0+ let frames = 0+ const DUR = 620+ const land = () => {+ if (reveal >= 1) return+ reveal = 1+ draw()+ }+ if (!reduced) {+ const start = performance.now()+ const tick = () => {+ const p = Math.min(1, (performance.now() - start) / DUR)+ // ease-out cubic: fast out of the spiral, gentle into place+ reveal = 1 - Math.pow(1 - p, 3)+ frames+++ draw()+ raf = p < 1 ? requestAnimationFrame(tick) : 0+ }+ raf = requestAnimationFrame(tick)+ settle = window.setTimeout(land, DUR + 260)+ }++ // ——— pointer ———+ const hitTest = (px: number, py: number): number => {+ let best = -1+ let bestD = Infinity+ for (let i = 0; i < g.nodes.length; i++) {+ const n = g.nodes[i]+ const dx = px - sx(nx(n, i))+ const dy = py - sy(ny(n, i))+ const R = Math.max(6, n.r * Math.min(scale, 2) + 3)+ const d = dx * dx + dy * dy+ if (d <= R * R && d < bestD) { best = i; bestD = d }+ }+ return best+ }++ const setHover = (i: number) => {+ if (i === hover) return+ hover = i+ neighbours.clear()+ if (i >= 0) {+ for (const e of g.edges) {+ if (e.a === i) neighbours.add(e.b)+ else if (e.b === i) neighbours.add(e.a)+ }+ }+ canvas.style.cursor = i >= 0 ? 'pointer' : 'default'+ draw()+ }++ let drag: { id: number; x: number; y: number; node: number; moved: boolean } | null = null++ const local = (e: PointerEvent) => {+ const r = canvas.getBoundingClientRect()+ return { x: e.clientX - r.left, y: e.clientY - r.top }+ }++ canvas.addEventListener('pointerdown', (e) => {+ const p = local(e)+ const node = hitTest(p.x, p.y)+ drag = { id: e.pointerId, x: p.x, y: p.y, node, moved: false }+ canvas.setPointerCapture(e.pointerId)+ })++ canvas.addEventListener('pointermove', (e) => {+ const p = local(e)+ if (!drag) { setHover(hitTest(p.x, p.y)); return }+ const dx = p.x - drag.x+ const dy = p.y - drag.y+ if (!drag.moved && Math.abs(dx) + Math.abs(dy) > 3) drag.moved = true+ if (!drag.moved) return+ if (drag.node >= 0) {+ // dragging a node moves that node — the layout is not re-run, because a+ // picture that rearranges itself while you are holding one piece of it is+ // a picture you cannot arrange+ const n = g.nodes[drag.node]+ n.x += dx / scale+ n.y += dy / scale+ seeds[drag.node] = { x: n.x, y: n.y }+ } else {+ panX += dx+ panY += dy+ }+ drag.x = p.x+ drag.y = p.y+ draw()+ })++ const endDrag = (e: PointerEvent) => {+ if (!drag) return+ const d = drag+ drag = null+ try { canvas.releasePointerCapture(e.pointerId) } catch { /* already gone */ }+ if (!d.moved && d.node >= 0) opts.open(g.nodes[d.node].id)+ }+ canvas.addEventListener('pointerup', endDrag)+ canvas.addEventListener('pointercancel', endDrag)+ canvas.addEventListener('pointerleave', () => { if (!drag) setHover(-1) })++ canvas.addEventListener('wheel', (e) => {+ e.preventDefault()+ const p = { x: e.clientX - canvas.getBoundingClientRect().left, y: e.clientY - canvas.getBoundingClientRect().top }+ const k = Math.exp(-e.deltaY * 0.0016)+ const next = Math.max(0.12, Math.min(5, scale * k))+ // zoom about the pointer, not the centre: the thing under the cursor is the+ // thing you are looking at+ panX = p.x - ((p.x - panX) / scale) * next+ panY = p.y - ((p.y - panY) / scale) * next+ scale = next+ draw()+ }, { passive: false })++ fitBtn.addEventListener('click', () => { fit(); draw() })+ closeBtn.addEventListener('click', () => opts.close())+ back.addEventListener('click', (e) => { if (e.target === back) opts.close() })++ // ——— theme + size, both of which move under us ———+ const ro = new ResizeObserver(() => resize())+ const mo = new MutationObserver(() => { pal = palette(); draw() })+ let scheme: MediaQueryList | null = null+ const onScheme = () => { pal = palette(); draw() }++ const mount = () => {+ ro.observe(stage)+ mo.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] })+ try {+ scheme = matchMedia('(prefers-color-scheme: dark)')+ scheme.addEventListener('change', onScheme)+ } catch { /* ancient browser: the explicit toggle still works */ }+ resize()+ }+ // the stage has no size until it is in the document+ queueMicrotask(mount)++ const destroy = () => {+ if (raf) cancelAnimationFrame(raf)+ if (settle) clearTimeout(settle)+ ro.disconnect()+ mo.disconnect()+ scheme?.removeEventListener('change', onScheme)+ }++ // MEASURABLE RATHER THAN CLAIMED. Three of the properties this file claims+ // about itself are invisible from outside — that the layout cost what it says,+ // that reduced motion really does skip the reveal instead of playing it fast,+ // and that the wall-clock guarantee lands the picture when rAF never runs.+ // Each was checked through these rather than by looking at the screen:+ // `frames: 0` beside `reveal: 1` is the proof that a graph opened in a+ // background tab still arrives. Six numbers on a node thrown away at close.+ ;(back as unknown as { __graph: unknown }).__graph = {+ nodes: g.nodes.length, edges: g.edges.length, layoutMs, reduced,+ get reveal() { return reveal },+ get frames() { return frames },+ }++ return { el: back, destroy, graph: g }+}diff --git a/spaces/src/i18n.ts b/spaces/src/i18n.tsindex 6eea220a..5398c359 100644--- a/spaces/src/i18n.ts+++ b/spaces/src/i18n.ts@@ -12,7 +12,7 @@import { registerI18n, locale } from '../../kernel/src/i18n.ts'import type { LocaleChoice } from '../../kernel/src/i18n.ts'-import { PACKED, PACKED_LOCALES } from './i18n/packed'+import { PACKED, PACKED_LOCALES } from './i18n/packed.ts'/** Offered in the About picker, each labelled in its own language. */const CHOICES: LocaleChoice[] = [diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.tsindex 4dc7b95e..7b2e5c4d 100644--- a/spaces/src/i18n/de.ts+++ b/spaces/src/i18n/de.ts@@ -95,6 +95,7 @@ export const de: Catalog = {"Choose the order": "Reihenfolge wählen","Clear filter": "Filter zurücksetzen","Clear formatting": "Formatierung entfernen",+ "Click a page to open it · drag to move · scroll to zoom": "Auf eine Seite klicken, um sie zu öffnen · ziehen zum Bewegen · scrollen zum Zoomen","Clip added ({size})": "Clip hinzugefügt ({size})","Close": "Schließen","Code": "Code",@@ -159,6 +160,7 @@ export const de: Catalog = {"Encrypt the document inside this file": "Das Dokument in dieser Datei verschlüsseln","Enter the password to open it.": "Gib das Passwort ein, um ihn zu öffnen.","Every page opens wide on this screen from now on": "Auf diesem Bildschirm öffnen ab jetzt alle Seiten breit",+ "Every page, and what links to what": "Alle Seiten, und was worauf verweist","Every page, as one .md file": "Jede Seite, in einer .md-Datei","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "Alles in diesem Space wird durch das ersetzt, was Sie einfügen. ⌘Z macht das rückgängig, aber nur solange dieses Fenster geöffnet bleibt.","Export": "Exportieren",@@ -175,8 +177,10 @@ export const de: Catalog = {"Find": "Suchen","Find in this space…": "In diesem Space suchen…","Find or create a page…": "Seite finden oder erstellen…",+ "Fit": "Einpassen","Following — view only": "Folgt mit — nur Ansicht","Full width": "Volle Breite",+ "Graph": "Graph","Gray": "Grau","Green": "Grün","Group": "Gruppieren",@@ -272,6 +276,7 @@ export const de: Catalog = {"Nothing found": "Nichts gefunden","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "Es wird nichts abgerufen. Die Karte zeigt, was Sie hier eintragen — das Öffnen dieses Space kontaktiert die Website nie.","Nothing leaves this file until you start a session.": "Nichts verlässt diese Datei, bis du eine Sitzung startest.",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "Noch nichts zu zeichnen — verknüpfe zwei Seiten mit [[ und sie erscheinen hier.","Now an issue": "Jetzt ein Issue","Numbered list": "Nummerierte Liste","Off by default — they were archived for a reason": "Standardmäßig aus — sie wurden aus einem Grund archiviert",@@ -556,6 +561,7 @@ export const de: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "{pages} Seite(n) und {blocks} Block/Blöcke aus diesem Space hinzugefügt.","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{pages} Seite(n) und {blocks} Block/Blöcke aus {files} Datei(en) hinzugefügt.","{pages} page(s) and {blocks} block(s) will travel.": "{pages} Seite(n) und {blocks} Block/Blöcke kommen mit.",+ "{pages} pages · {links} links": "{pages} Seiten · {links} Verknüpfungen","⌘Z removes the imported pages again.": "Mit ⌘Z verschwinden die importierten Seiten wieder.","History": "Verlauf","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "Versionen liegen nur in diesem Browser — nie in der Datei, nie online. Das Wiederherstellen lässt sich rückgängig machen.",diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.tsindex 78f4ed77..03b59e8b 100644--- a/spaces/src/i18n/es.ts+++ b/spaces/src/i18n/es.ts@@ -95,6 +95,7 @@ export const es: Catalog = {"Choose the order": "Elige el orden","Clear filter": "Borrar el filtro","Clear formatting": "Borrar formato",+ "Click a page to open it · drag to move · scroll to zoom": "Haz clic en una página para abrirla · arrastra para mover · desplázate para acercar","Clip added ({size})": "Clip añadido ({size})","Close": "Cerrar","Code": "Código",@@ -159,6 +160,7 @@ export const es: Catalog = {"Encrypt the document inside this file": "Cifrar el documento dentro de este archivo","Enter the password to open it.": "Introduce la contraseña para abrirlo.","Every page opens wide on this screen from now on": "A partir de ahora todas las páginas se abren anchas en esta pantalla",+ "Every page, and what links to what": "Todas las páginas, y qué enlaza con qué","Every page, as one .md file": "Todas las páginas, en un solo archivo .md","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "Todo lo que hay en este espacio se sustituye por lo que pegues. ⌘Z lo deshace, pero solo mientras esta ventana siga abierta.","Export": "Exportar",@@ -175,8 +177,10 @@ 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…",+ "Fit": "Ajustar","Following — view only": "Siguiendo — solo lectura","Full width": "Ancho completo",+ "Graph": "Grafo","Gray": "Gris","Green": "Verde","Group": "Agrupar",@@ -272,6 +276,7 @@ export const es: Catalog = {"Nothing found": "Sin resultados","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "No se descarga nada. La tarjeta muestra lo que escribas aquí: abrir este espacio nunca contacta con el sitio.","Nothing leaves this file until you start a session.": "Nada sale de este archivo hasta que inicies una sesión.",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "Todavía no hay nada que dibujar — enlaza dos páginas con [[ y aparecerán aquí.","Now an issue": "Ahora es una incidencia","Numbered list": "Lista numerada","Off by default — they were archived for a reason": "Desactivado por defecto — por algo se archivaron",@@ -556,6 +561,7 @@ export const es: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "Se añadieron {pages} página(s) y {blocks} bloque(s) desde ese espacio.","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{pages} página(s) y {blocks} bloque(s) añadidos desde {files} archivo(s).","{pages} page(s) and {blocks} block(s) will travel.": "Viajarán {pages} página(s) y {blocks} bloque(s).",+ "{pages} pages · {links} links": "{pages} páginas · {links} enlaces","⌘Z removes the imported pages again.": "⌘Z vuelve a quitar las páginas importadas.","History": "Historial","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "Las versiones se guardan solo en este navegador: nunca en el archivo ni en línea. Restaurar se puede deshacer.",diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.tsindex 632c312b..51545c22 100644--- a/spaces/src/i18n/fr.ts+++ b/spaces/src/i18n/fr.ts@@ -95,6 +95,7 @@ export const fr: Catalog = {"Choose the order": "Choisir l’ordre","Clear filter": "Effacer le filtre","Clear formatting": "Effacer la mise en forme",+ "Click a page to open it · drag to move · scroll to zoom": "Cliquez sur une page pour l’ouvrir · glissez pour déplacer · défilez pour zoomer","Clip added ({size})": "Clip ajouté ({size})","Close": "Fermer","Code": "Code",@@ -159,6 +160,7 @@ export const fr: Catalog = {"Encrypt the document inside this file": "Chiffrer le document à l’intérieur de ce fichier","Enter the password to open it.": "Saisissez le mot de passe pour l’ouvrir.","Every page opens wide on this screen from now on": "Désormais toutes les pages s’ouvrent en large sur cet écran",+ "Every page, and what links to what": "Toutes les pages, et ce qui pointe vers quoi","Every page, as one .md file": "Toutes les pages, en un seul fichier .md","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "Tout ce que contient cet espace est remplacé par ce que vous collez. ⌘Z annule l’opération, mais seulement tant que cette fenêtre reste ouverte.","Export": "Exporter",@@ -175,8 +177,10 @@ 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…",+ "Fit": "Ajuster","Following — view only": "Suivi en cours — lecture seule","Full width": "Pleine largeur",+ "Graph": "Graphe","Gray": "Gris","Green": "Vert","Group": "Grouper",@@ -272,6 +276,7 @@ export const fr: Catalog = {"Nothing found": "Aucun résultat","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "Rien n’est récupéré. La carte affiche ce que vous saisissez ici — ouvrir cet espace ne contacte jamais le site.","Nothing leaves this file until you start a session.": "Rien ne quitte ce fichier tant que vous n’avez pas démarré de session.",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "Rien à dessiner pour l’instant — reliez deux pages avec [[ et elles apparaîtront ici.","Now an issue": "C’est désormais un ticket","Numbered list": "Liste numérotée","Off by default — they were archived for a reason": "Désactivé par défaut — elles ont été archivées pour une raison",@@ -556,6 +561,7 @@ export const fr: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "{pages} page(s) et {blocks} bloc(s) ajoutés depuis cet espace.","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{pages} page(s) et {blocks} bloc(s) ajoutés depuis {files} fichier(s).","{pages} page(s) and {blocks} block(s) will travel.": "{pages} page(s) et {blocks} bloc(s) feront le voyage.",+ "{pages} pages · {links} links": "{pages} pages · {links} liens","⌘Z removes the imported pages again.": "⌘Z supprime à nouveau les pages importées.","History": "Historique","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "Les versions sont conservées uniquement dans ce navigateur — jamais dans le fichier, jamais en ligne. La restauration est annulable.",diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.tsindex a3b114e9..7061df41 100644--- a/spaces/src/i18n/it.ts+++ b/spaces/src/i18n/it.ts@@ -95,6 +95,7 @@ export const it: Catalog = {"Choose the order": "Scegli l’ordine","Clear filter": "Azzera il filtro","Clear formatting": "Cancella formattazione",+ "Click a page to open it · drag to move · scroll to zoom": "Fai clic su una pagina per aprirla · trascina per spostare · scorri per ingrandire","Clip added ({size})": "Clip aggiunta ({size})","Close": "Chiudi","Code": "Codice",@@ -159,6 +160,7 @@ export const it: Catalog = {"Encrypt the document inside this file": "Cifra il documento dentro questo file","Enter the password to open it.": "Inserisci la password per aprirlo.","Every page opens wide on this screen from now on": "Da ora tutte le pagine si aprono larghe su questo schermo",+ "Every page, and what links to what": "Tutte le pagine, e cosa collega a cosa","Every page, as one .md file": "Tutte le pagine, in un unico file .md","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "Tutto ciò che si trova in questo spazio viene sostituito da quello che incolli. ⌘Z annulla l’operazione, ma solo finché questa finestra resta aperta.","Export": "Esporta",@@ -175,8 +177,10 @@ export const it: Catalog = {"Find": "Trova","Find in this space…": "Trova in questo spazio…","Find or create a page…": "Trova o crea una pagina…",+ "Fit": "Adatta","Following — view only": "In ascolto — sola lettura","Full width": "Larghezza piena",+ "Graph": "Grafo","Gray": "Grigio","Green": "Verde","Group": "Raggruppa",@@ -272,6 +276,7 @@ export const it: Catalog = {"Nothing found": "Nessun risultato","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "Non viene scaricato nulla. La scheda mostra ciò che scrivi qui: aprire questo spazio non contatta mai il sito.","Nothing leaves this file until you start a session.": "Niente esce da questo file finché non avvii una sessione.",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "Non c’è ancora nulla da disegnare — collega due pagine con [[ e appariranno qui.","Now an issue": "Ora è una issue","Numbered list": "Elenco numerato","Off by default — they were archived for a reason": "Disattivo per impostazione predefinita — sono state archiviate per un motivo",@@ -556,6 +561,7 @@ export const it: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "Aggiunte {pages} pagina/e e {blocks} blocco/blocchi da quello spazio.","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{pages} pagine e {blocks} blocchi aggiunti da {files} file.","{pages} page(s) and {blocks} block(s) will travel.": "Viaggeranno {pages} pagina/e e {blocks} blocco/blocchi.",+ "{pages} pages · {links} links": "{pages} pagine · {links} collegamenti","⌘Z removes the imported pages again.": "⌘Z rimuove di nuovo le pagine importate.","History": "Cronologia","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "Le versioni restano solo in questo browser: mai nel file, mai online. Il ripristino si può annullare.",diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.tsindex dded55b2..33be08c0 100644--- a/spaces/src/i18n/ja.ts+++ b/spaces/src/i18n/ja.ts@@ -95,6 +95,7 @@ export const ja: Catalog = {"Choose the order": "並び順を選ぶ","Clear filter": "フィルターを解除","Clear formatting": "書式をクリア",+ "Click a page to open it · drag to move · scroll to zoom": "ページをクリックで開く · ドラッグで移動 · スクロールで拡大縮小","Clip added ({size})": "クリップを追加しました({size})","Close": "閉じる","Code": "コード",@@ -159,6 +160,7 @@ export const ja: Catalog = {"Encrypt the document inside this file": "このファイル内のドキュメントを暗号化","Enter the password to open it.": "開くにはパスワードを入力してください。","Every page opens wide on this screen from now on": "この画面では今後すべてのページを広く表示します",+ "Every page, and what links to what": "すべてのページと、そのつながり","Every page, as one .md file": "すべてのページを 1 つの .md ファイルに","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "このスペースの内容はすべて貼り付けた内容に置き換わります。⌘Z で元に戻せますが、それはこのウィンドウを開いている間だけです。","Export": "書き出す",@@ -175,8 +177,10 @@ export const ja: Catalog = {"Find": "検索","Find in this space…": "このスペース内を検索…","Find or create a page…": "ページを検索または作成…",+ "Fit": "全体表示","Following — view only": "追従中 — 閲覧のみ","Full width": "全幅",+ "Graph": "グラフ","Gray": "グレー","Green": "緑","Group": "グループ",@@ -272,6 +276,7 @@ export const ja: Catalog = {"Nothing found": "見つかりませんでした","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "何も取得しません。カードにはここで入力した内容が表示され、このスペースを開いてもサイトに接続することはありません。","Nothing leaves this file until you start a session.": "セッションを開始するまで、このファイルから外に出るものはありません。",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "まだ描くものがありません — [[ で 2 つのページをつなぐと、ここに現れます。","Now an issue": "イシューになりました","Numbered list": "番号付きリスト","Off by default — they were archived for a reason": "既定ではオフ — アーカイブしたのには理由があります",@@ -556,6 +561,7 @@ export const ja: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "そのスペースから {pages} ページ、{blocks} ブロックを追加しました。","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{files} 個のファイルから {pages} ページ・{blocks} ブロックを追加しました。","{pages} page(s) and {blocks} block(s) will travel.": "{pages} ページ、{blocks} ブロックが移動します。",+ "{pages} pages · {links} links": "{pages} ページ · {links} リンク","⌘Z removes the imported pages again.": "⌘Z で、読み込んだページを取り消せます。","History": "履歴","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "バージョンはこのブラウザーにのみ保存されます。ファイルにもオンラインにも残りません。復元は取り消せます。",diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.tsindex 31a19f90..e5ea57bd 100644--- a/spaces/src/i18n/packed.ts+++ b/spaces/src/i18n/packed.ts@@ -99,6 +99,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Choose which pages this view holds": ["このビューに入れるページを選ぶ","选择此视图包含哪些页面","選擇此檢視包含哪些頁面","Elige qué páginas contiene esta vista","Choisir les pages que contient cette vue","Wählen, welche Seiten diese Ansicht enthält","Scegli quali pagine contiene questa vista","Escolhe que páginas esta vista contém"],"Clear filter": ["フィルターを解除","清除筛选","清除篩選","Borrar el filtro","Effacer le filtre","Filter zurücksetzen","Azzera il filtro","Limpar o filtro"],"Clear formatting": ["書式をクリア","清除格式","清除格式","Borrar formato","Effacer la mise en forme","Formatierung entfernen","Cancella formattazione","Limpar formatação"],+ "Click a page to open it · drag to move · scroll to zoom": ["ページをクリックで開く · ドラッグで移動 · スクロールで拡大縮小","点击页面即可打开 · 拖动移动 · 滚动缩放","點擊頁面即可開啟 · 拖曳移動 · 捲動縮放","Haz clic en una página para abrirla · arrastra para mover · desplázate para acercar","Cliquez sur une page pour l’ouvrir · glissez pour déplacer · défilez pour zoomer","Auf eine Seite klicken, um sie zu öffnen · ziehen zum Bewegen · scrollen zum Zoomen","Fai clic su una pagina per aprirla · trascina per spostare · scorri per ingrandire","Clica numa página para a abrir · arrasta para mover · desloca para ampliar"],"Clip added ({size})": ["クリップを追加しました({size})","已添加片段 ({size})","已新增片段 ({size})","Clip añadido ({size})","Clip ajouté ({size})","Clip hinzugefügt ({size})","Clip aggiunta ({size})","Clipe adicionado ({size})"],"Close": ["閉じる","关闭","關閉","Cerrar","Fermer","Schließen","Chiudi","Fechar"],"Code": ["コード","代码","程式碼","Código","Code","Code","Codice","Código"],@@ -161,6 +162,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"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."],"Every page opens wide on this screen from now on": ["この画面では今後すべてのページを広く表示します","在此屏幕上,之后所有页面都会以加宽方式打开","在此螢幕上,之後所有頁面都會以加寬方式開啟","A partir de ahora todas las páginas se abren anchas en esta pantalla","Désormais toutes les pages s’ouvrent en large sur cet écran","Auf diesem Bildschirm öffnen ab jetzt alle Seiten breit","Da ora tutte le pagine si aprono larghe su questo schermo","A partir de agora todas as páginas abrem largas neste ecrã"],"Every page with a status": ["ステータスを持つすべてのページ","所有带状态的页面","所有帶狀態的頁面","Todas las páginas con estado","Toutes les pages ayant un statut","Jede Seite mit einem Status","Ogni pagina con uno stato","Todas as páginas com estado"],+ "Every page, and what links to what": ["すべてのページと、そのつながり","所有页面,以及它们之间的链接","所有頁面,以及它們之間的連結","Todas las páginas, y qué enlaza con qué","Toutes les pages, et ce qui pointe vers quoi","Alle Seiten, und was worauf verweist","Tutte le pagine, e cosa collega a cosa","Todas as páginas, e o que liga ao quê"],"Every page, as one .md file": ["すべてのページを 1 つの .md ファイルに","所有页面合并为一个 .md 文件","所有頁面合併為一個 .md 檔","Todas las páginas, en un solo archivo .md","Toutes les pages, en un seul fichier .md","Jede Seite, in einer .md-Datei","Tutte le pagine, in un unico file .md","Todas as páginas num único ficheiro .md"],"Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": ["このスペースの内容はすべて貼り付けた内容に置き換わります。⌘Z で元に戻せますが、それはこのウィンドウを開いている間だけです。","这个空间里的所有内容都会被你粘贴的内容替换。⌘Z 可以撤销,但仅限于这个窗口保持打开时。","這個空間裡的所有內容都會被你貼上的內容取代。⌘Z 可以復原,但僅限於這個視窗保持開啟時。","Todo lo que hay en este espacio se sustituye por lo que pegues. ⌘Z lo deshace, pero solo mientras esta ventana siga abierta.","Tout ce que contient cet espace est remplacé par ce que vous collez. ⌘Z annule l’opération, mais seulement tant que cette fenêtre reste ouverte.","Alles in diesem Space wird durch das ersetzt, was Sie einfügen. ⌘Z macht das rückgängig, aber nur solange dieses Fenster geöffnet bleibt.","Tutto ciò che si trova in questo spazio viene sostituito da quello che incolli. ⌘Z annulla l’operazione, ma solo finché questa finestra resta aperta.","Tudo o que está neste espaço é substituído pelo que colar. ⌘Z desfaz, mas só enquanto esta janela continuar aberta."],"Export": ["書き出す","导出","匯出","Exportar","Exporter","Exportieren","Esporta","Exportar"],@@ -178,10 +180,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Find and replace": ["検索と置換","查找和替换","尋找與取代","Buscar y reemplazar","Rechercher et remplacer","Suchen und ersetzen","Trova e sostituisci","Localizar e substituir"],"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…"],+ "Fit": ["全体表示","适应窗口","適應視窗","Ajustar","Ajuster","Einpassen","Adatta","Ajustar"],"Following — view only": ["追従中 — 閲覧のみ","跟随中 — 仅供查看","跟隨中 — 僅供檢視","Siguiendo — solo lectura","Suivi en cours — lecture seule","Folgt mit — nur Ansicht","In ascolto — sola lettura","Acompanhando — somente visualização"],"Formatting": ["書式","格式","格式","Formato","Mise en forme","Formatierung","Formattazione","Formatação"],"Full width": ["全幅","全宽","全寬","Ancho completo","Pleine largeur","Volle Breite","Larghezza piena","Largura total"],"Getting around": ["移動","导航","導覽","Moverse","Se déplacer","Navigieren","Spostarsi","Navegar"],+ "Graph": ["グラフ","关系图","關係圖","Grafo","Graphe","Graph","Grafo","Grafo"],"Gray": ["グレー","灰色","灰色","Gris","Gris","Grau","Grigio","Cinza"],"Green": ["緑","绿色","綠色","Verde","Vert","Grün","Verde","Verde"],"Group": ["グループ","分组","分組","Agrupar","Grouper","Gruppieren","Raggruppa","Agrupar"],@@ -283,6 +287,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Nothing found": ["見つかりませんでした","没有结果","找不到結果","Sin resultados","Aucun résultat","Nichts gefunden","Nessun risultato","Nada encontrado"],"Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": ["何も取得しません。カードにはここで入力した内容が表示され、このスペースを開いてもサイトに接続することはありません。","不会抓取任何内容。卡片显示的就是你在这里输入的内容——打开这个空间绝不会联系该网站。","不會抓取任何內容。卡片顯示的就是你在這裡輸入的內容——開啟這個空間絕不會連線到該網站。","No se descarga nada. La tarjeta muestra lo que escribas aquí: abrir este espacio nunca contacta con el sitio.","Rien n’est récupéré. La carte affiche ce que vous saisissez ici — ouvrir cet espace ne contacte jamais le site.","Es wird nichts abgerufen. Die Karte zeigt, was Sie hier eintragen — das Öffnen dieses Space kontaktiert die Website nie.","Non viene scaricato nulla. La scheda mostra ciò che scrivi qui: aprire questo spazio non contatta mai il sito.","Nada é obtido. O cartão mostra o que você escrever aqui — abrir este espaço nunca contacta o site."],"Nothing leaves this file until you start a session.": ["セッションを開始するまで、このファイルから外に出るものはありません。","在你开始会话之前,没有任何内容离开这个文件。","在你開始工作階段之前,沒有任何內容離開這個檔案。","Nada sale de este archivo hasta que inicies una sesión.","Rien ne quitte ce fichier tant que vous n’avez pas démarré de session.","Nichts verlässt diese Datei, bis du eine Sitzung startest.","Niente esce da questo file finché non avvii una sessione.","Nada sai deste ficheiro até iniciares uma sessão."],+ "Nothing to draw yet — link two pages with [[ and they will appear here.": ["まだ描くものがありません — [[ で 2 つのページをつなぐと、ここに現れます。","还没有可绘制的内容 — 用 [[ 链接两个页面,它们就会出现在这里。","還沒有可繪製的內容 — 用 [[ 連結兩個頁面,它們就會出現在這裡。","Todavía no hay nada que dibujar — enlaza dos páginas con [[ y aparecerán aquí.","Rien à dessiner pour l’instant — reliez deux pages avec [[ et elles apparaîtront ici.","Noch nichts zu zeichnen — verknüpfe zwei Seiten mit [[ und sie erscheinen hier.","Non c’è ancora nulla da disegnare — collega due pagine con [[ e appariranno qui.","Ainda não há nada para desenhar — liga duas páginas com [[ e aparecerão aqui."],"Now an issue": ["イシューになりました","现在是事项了","現在是項目了","Ahora es una incidencia","C’est désormais un ticket","Jetzt ein Issue","Ora è una issue","Agora é uma tarefa"],"Numbered list": ["番号付きリスト","编号列表","編號清單","Lista numerada","Liste numérotée","Nummerierte Liste","Elenco numerato","Lista numerada"],"Off by default — they were archived for a reason": ["既定ではオフ — アーカイブしたのには理由があります","默认关闭 — 当初归档总是有原因的","預設關閉 — 它們被封存是有原因的","Desactivado por defecto — por algo se archivaron","Désactivé par défaut — elles ont été archivées pour une raison","Standardmäßig aus — sie wurden aus einem Grund archiviert","Disattivo per impostazione predefinita — sono state archiviate per un motivo","Desativado por predefinição — foram arquivadas por alguma razão"],@@ -576,5 +581,6 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"{pages} page(s) and {blocks} block(s) added from that space.": ["そのスペースから {pages} ページ、{blocks} ブロックを追加しました。","已从该空间添加 {pages} 个页面、{blocks} 个块。","已從該空間加入 {pages} 個頁面、{blocks} 個區塊。","Se añadieron {pages} página(s) y {blocks} bloque(s) desde ese espacio.","{pages} page(s) et {blocks} bloc(s) ajoutés depuis cet espace.","{pages} Seite(n) und {blocks} Block/Blöcke aus diesem Space hinzugefügt.","Aggiunte {pages} pagina/e e {blocks} blocco/blocchi da quello spazio.","Adicionadas {pages} página(s) e {blocks} bloco(s) a partir desse espaço."],"{pages} page(s) and {blocks} block(s) added from {files} file(s).": ["{files} 個のファイルから {pages} ページ・{blocks} ブロックを追加しました。","从 {files} 个文件新增了 {pages} 个页面、{blocks} 个块。","從 {files} 個檔案新增了 {pages} 個頁面、{blocks} 個區塊。","{pages} página(s) y {blocks} bloque(s) añadidos desde {files} archivo(s).","{pages} page(s) et {blocks} bloc(s) ajoutés depuis {files} fichier(s).","{pages} Seite(n) und {blocks} Block/Blöcke aus {files} Datei(en) hinzugefügt.","{pages} pagine e {blocks} blocchi aggiunti da {files} file.","{pages} página(s) e {blocks} bloco(s) acrescentados a partir de {files} ficheiro(s)."],"{pages} page(s) and {blocks} block(s) will travel.": ["{pages} ページ、{blocks} ブロックが移動します。","将带走 {pages} 个页面、{blocks} 个块。","將帶走 {pages} 個頁面、{blocks} 個區塊。","Viajarán {pages} página(s) y {blocks} bloque(s).","{pages} page(s) et {blocks} bloc(s) feront le voyage.","{pages} Seite(n) und {blocks} Block/Blöcke kommen mit.","Viaggeranno {pages} pagina/e e {blocks} blocco/blocchi.","Vão viajar {pages} página(s) e {blocks} bloco(s)."],+ "{pages} pages · {links} links": ["{pages} ページ · {links} リンク","{pages} 个页面 · {links} 条链接","{pages} 個頁面 · {links} 條連結","{pages} páginas · {links} enlaces","{pages} pages · {links} liens","{pages} Seiten · {links} Verknüpfungen","{pages} pagine · {links} collegamenti","{pages} páginas · {links} ligações"],"⌘Z removes the imported pages again.": ["⌘Z で、読み込んだページを取り消せます。","按 ⌘Z 可以把导入的页面再撤销掉。","按 ⌘Z 可以把匯入的頁面再撤銷掉。","⌘Z vuelve a quitar las páginas importadas.","⌘Z supprime à nouveau les pages importées.","Mit ⌘Z verschwinden die importierten Seiten wieder.","⌘Z rimuove di nuovo le pagine importate.","⌘Z remove novamente as páginas importadas."],}diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.tsindex f37de9ae..97c473fd 100644--- a/spaces/src/i18n/pt.ts+++ b/spaces/src/i18n/pt.ts@@ -95,6 +95,7 @@ export const pt: Catalog = {"Choose the order": "Escolha a ordem","Clear filter": "Limpar o filtro","Clear formatting": "Limpar formatação",+ "Click a page to open it · drag to move · scroll to zoom": "Clica numa página para a abrir · arrasta para mover · desloca para ampliar","Clip added ({size})": "Clipe adicionado ({size})","Close": "Fechar","Code": "Código",@@ -159,6 +160,7 @@ export const pt: Catalog = {"Encrypt the document inside this file": "Encriptar o documento dentro deste ficheiro","Enter the password to open it.": "Introduza a palavra-passe para o abrir.","Every page opens wide on this screen from now on": "A partir de agora todas as páginas abrem largas neste ecrã",+ "Every page, and what links to what": "Todas as páginas, e o que liga ao quê","Every page, as one .md file": "Todas as páginas num único ficheiro .md","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "Tudo o que está neste espaço é substituído pelo que colar. ⌘Z desfaz, mas só enquanto esta janela continuar aberta.","Export": "Exportar",@@ -175,8 +177,10 @@ 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…",+ "Fit": "Ajustar","Following — view only": "Acompanhando — somente visualização","Full width": "Largura total",+ "Graph": "Grafo","Gray": "Cinza","Green": "Verde","Group": "Agrupar",@@ -272,6 +276,7 @@ export const pt: Catalog = {"Nothing found": "Nada encontrado","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "Nada é obtido. O cartão mostra o que você escrever aqui — abrir este espaço nunca contacta o site.","Nothing leaves this file until you start a session.": "Nada sai deste ficheiro até iniciares uma sessão.",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "Ainda não há nada para desenhar — liga duas páginas com [[ e aparecerão aqui.","Now an issue": "Agora é uma tarefa","Numbered list": "Lista numerada","Off by default — they were archived for a reason": "Desativado por predefinição — foram arquivadas por alguma razão",@@ -556,6 +561,7 @@ export const pt: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "Adicionadas {pages} página(s) e {blocks} bloco(s) a partir desse espaço.","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "{pages} página(s) e {blocks} bloco(s) acrescentados a partir de {files} ficheiro(s).","{pages} page(s) and {blocks} block(s) will travel.": "Vão viajar {pages} página(s) e {blocks} bloco(s).",+ "{pages} pages · {links} links": "{pages} páginas · {links} ligações","⌘Z removes the imported pages again.": "⌘Z remove novamente as páginas importadas.","History": "Histórico","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "As versões ficam apenas neste navegador — nunca no ficheiro, nunca online. Restaurar pode ser desfeito.",diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.tsindex c8ca3f3b..2a809194 100644--- a/spaces/src/i18n/zh-Hans.ts+++ b/spaces/src/i18n/zh-Hans.ts@@ -95,6 +95,7 @@ export const zh_Hans: Catalog = {"Choose the order": "选择排序方式","Clear filter": "清除筛选","Clear formatting": "清除格式",+ "Click a page to open it · drag to move · scroll to zoom": "点击页面即可打开 · 拖动移动 · 滚动缩放","Clip added ({size})": "已添加片段 ({size})","Close": "关闭","Code": "代码",@@ -159,6 +160,7 @@ export const zh_Hans: Catalog = {"Encrypt the document inside this file": "加密此文件内的文档","Enter the password to open it.": "输入密码以打开。","Every page opens wide on this screen from now on": "在此屏幕上,之后所有页面都会以加宽方式打开",+ "Every page, and what links to what": "所有页面,以及它们之间的链接","Every page, as one .md file": "所有页面合并为一个 .md 文件","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "这个空间里的所有内容都会被你粘贴的内容替换。⌘Z 可以撤销,但仅限于这个窗口保持打开时。","Export": "导出",@@ -175,8 +177,10 @@ export const zh_Hans: Catalog = {"Find": "查找","Find in this space…": "在此空间中查找…","Find or create a page…": "查找或新建页面…",+ "Fit": "适应窗口","Following — view only": "跟随中 — 仅供查看","Full width": "全宽",+ "Graph": "关系图","Gray": "灰色","Green": "绿色","Group": "分组",@@ -272,6 +276,7 @@ export const zh_Hans: Catalog = {"Nothing found": "没有结果","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "不会抓取任何内容。卡片显示的就是你在这里输入的内容——打开这个空间绝不会联系该网站。","Nothing leaves this file until you start a session.": "在你开始会话之前,没有任何内容离开这个文件。",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "还没有可绘制的内容 — 用 [[ 链接两个页面,它们就会出现在这里。","Now an issue": "现在是事项了","Numbered list": "编号列表","Off by default — they were archived for a reason": "默认关闭 — 当初归档总是有原因的",@@ -556,6 +561,7 @@ export const zh_Hans: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "已从该空间添加 {pages} 个页面、{blocks} 个块。","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "从 {files} 个文件新增了 {pages} 个页面、{blocks} 个块。","{pages} page(s) and {blocks} block(s) will travel.": "将带走 {pages} 个页面、{blocks} 个块。",+ "{pages} pages · {links} links": "{pages} 个页面 · {links} 条链接","⌘Z removes the imported pages again.": "按 ⌘Z 可以把导入的页面再撤销掉。","History": "历史记录","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "版本仅保存在此浏览器中,不会写入文件,也不会上传。恢复操作可以撤销。",diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.tsindex b51f3900..a60a07f5 100644--- a/spaces/src/i18n/zh-Hant.ts+++ b/spaces/src/i18n/zh-Hant.ts@@ -95,6 +95,7 @@ export const zh_Hant: Catalog = {"Choose the order": "選擇排序方式","Clear filter": "清除篩選","Clear formatting": "清除格式",+ "Click a page to open it · drag to move · scroll to zoom": "點擊頁面即可開啟 · 拖曳移動 · 捲動縮放","Clip added ({size})": "已新增片段 ({size})","Close": "關閉","Code": "程式碼",@@ -159,6 +160,7 @@ export const zh_Hant: Catalog = {"Encrypt the document inside this file": "加密此檔案內的文件","Enter the password to open it.": "請輸入密碼以開啟。","Every page opens wide on this screen from now on": "在此螢幕上,之後所有頁面都會以加寬方式開啟",+ "Every page, and what links to what": "所有頁面,以及它們之間的連結","Every page, as one .md file": "所有頁面合併為一個 .md 檔","Everything in this space is replaced by what you paste. ⌘Z undoes it, but only while this window stays open.": "這個空間裡的所有內容都會被你貼上的內容取代。⌘Z 可以復原,但僅限於這個視窗保持開啟時。","Export": "匯出",@@ -175,8 +177,10 @@ export const zh_Hant: Catalog = {"Find": "尋找","Find in this space…": "在此空間尋找…","Find or create a page…": "尋找或建立頁面…",+ "Fit": "適應視窗","Following — view only": "跟隨中 — 僅供檢視","Full width": "全寬",+ "Graph": "關係圖","Gray": "灰色","Green": "綠色","Group": "分組",@@ -272,6 +276,7 @@ export const zh_Hant: Catalog = {"Nothing found": "找不到結果","Nothing is fetched. A card shows what you type here — opening this space never contacts the site.": "不會抓取任何內容。卡片顯示的就是你在這裡輸入的內容——開啟這個空間絕不會連線到該網站。","Nothing leaves this file until you start a session.": "在你開始工作階段之前,沒有任何內容離開這個檔案。",+ "Nothing to draw yet — link two pages with [[ and they will appear here.": "還沒有可繪製的內容 — 用 [[ 連結兩個頁面,它們就會出現在這裡。","Now an issue": "現在是項目了","Numbered list": "編號清單","Off by default — they were archived for a reason": "預設關閉 — 它們被封存是有原因的",@@ -556,6 +561,7 @@ export const zh_Hant: Catalog = {"{pages} page(s) and {blocks} block(s) added from that space.": "已從該空間加入 {pages} 個頁面、{blocks} 個區塊。","{pages} page(s) and {blocks} block(s) added from {files} file(s).": "從 {files} 個檔案新增了 {pages} 個頁面、{blocks} 個區塊。","{pages} page(s) and {blocks} block(s) will travel.": "將帶走 {pages} 個頁面、{blocks} 個區塊。",+ "{pages} pages · {links} links": "{pages} 個頁面 · {links} 條連結","⌘Z removes the imported pages again.": "按 ⌘Z 可以把匯入的頁面再撤銷掉。","History": "歷史記錄","Versions are kept in this browser only — never in the file, never online. Restoring is undoable.": "版本僅保存在此瀏覽器中,不會寫入檔案,也不會上傳。還原操作可以復原。",diff --git a/spaces/src/icons.ts b/spaces/src/icons.tsindex a9579f02..96f91f14 100644--- a/spaces/src/icons.ts+++ b/spaces/src/icons.ts@@ -73,6 +73,7 @@ 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"/>'),+ 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/main.ts b/spaces/src/main.tsindex d9ab1a4a..ad480add 100644--- a/spaces/src/main.ts+++ b/spaces/src/main.ts@@ -413,6 +413,8 @@ function boot(doc: SpacesDoc, repaired: string[], frozen?: 'policy' | 'version')* exactly as written.*/i18n: i18nApi,+ /** open the graph view — the same thing the ⋯ menu opens */+ graph: () => { editor.openGraph() },/** every page, flat — the shape an agent wants before it reads anything */pages: () => store.doc.pages.map((p) => ({id: p.id, title: p.title, parent: p.parent, archived: !!p.archived, blocks: p.blocks.length,