Files
edentext/src/lib/storage/CLAUDE.md
T
Steffen Becker ea39dde58b feat: a tab lands on the file's own grid, and can draw its leader
The default tab interval was fixed at 1.25cm, so a file's own
w:defaultTabStop / style:tab-stop-distance was ignored and the DOCX
export wrote 1.25 back over Word's 1.27. It is a document setting now.

A stop can also carry the character it repeats across its gap. odf-kit
has no leader option and mints one automatic style per option set, so
the leader rides style:type behind a sentinel — matching on position
and alignment alone gave every stop at 6cm the same leader, which
LibreOffice drew back plain as day.
2026-08-08 14:40:26 +00:00

2.0 KiB
Raw Blame History

src/lib/storage/

Page layout settings

  • pageMargins.ts — PageMargins in cm (default { top: 2, bottom: 2, left: 2, right: 2 } — LibreOffice's; clamped 0–10). applyMarginVars sets --user-margin-* (px) on :root; PX_PER_CM = 96/2.54.
  • tabInterval.ts — the document's default tab interval in cm (DEFAULT_TAB_INTERVAL_CM = 1.25, LibreOffice's; Word's is 1.27; clamped 0.05–10). applyTabIntervalVar sets --tab-interval, which is .tiptap's tab-size.
  • pageOrientation.ts — 'portrait' | 'landscape'. applyOrientationVars sets --user-page-{width,height}; landscape swaps the A4 dimensions (matching odf-kit's automatic swap).

Both margins and orientation are passed into the ODT export so the exported document's geometry/line-wrapping matches the on-screen preview.

localStorage keys

  • Document: odf-editor-doc — TipTap JSON, debounced 1 s on every onUpdate (autosave.ts).
  • Theme: odf-editor-theme — 'light' | 'dark' | 'allBlack' | 'auto'.
  • Toolbar expanded: odf-editor-toolbar-expanded — boolean string.
  • Formatting marks: odf-editor-formatting-marks — boolean string.
  • Ruler: odf-editor-ruler — boolean string; absent = on.
  • Zoom: odf-editor-zoom — integer percent.
  • Page margins: odf-editor-page-margins — JSON cm values.
  • Page orientation: odf-editor-page-orientation — 'portrait' | 'landscape'.
  • Tab interval: odf-editor-tab-interval — cm as a decimal string.
  • Recent fonts: odf-editor-recent-fonts — JSON string array (ToolbarExpanded).
  • Header/footer: odf-editor-header / -footer (HfDoc), odf-editor-hf-distances.
  • Styles: odf-editor-styles — the style registry (styles/sheet.svelte.ts).

Themes (theme.ts, styles/global.css)

Four modes: light, dark, allBlack (forces font colors white), auto (follows prefers-color-scheme). Applied by setting data-theme on <html>; CSS variables for each theme live in global.css.