๐Ÿก index : quine-global/libreoffice-js.git

LibreOffice JS

A Tauri + React word processor modelled on LibreOffice Writer. The frontend is organised like LibreOffice's core repository โ€” the same module names (sw, sfx2, framework, vcl, svx, editeng, โ€ฆ) and, where it makes sense, the same file names โ€” so upstream code can be used as the map for porting features.

core/ is a checkout of LibreOffice/core kept for reference; it is not built. desktop/ is the app.

Quick start

# one-time: Node >= 24 (see .nvmrc), Rust
just run        # Tauri window with hot reload
just web        # frontend only, in a browser at http://localhost:1420
just test       # typecheck + unit tests + cargo check
just bundle     # packaged app under desktop/src-tauri/target/release/bundle/

No just? The recipes are one-liners in the Justfile.

What works (skeleton)

Commands that exist in Writer but aren't implemented yet (tables, images, comments, Character/Paragraph dialogs, โ€ฆ) appear disabled in the menus.

Repository layout

.
โ”œโ”€โ”€ core/                  # upstream LibreOffice checkout (reference, not built)
โ”œโ”€โ”€ desktop/               # the app
โ”‚   โ”œโ”€โ”€ src-tauri/         #   Rust: file I/O commands, dialogs, window lifecycle
โ”‚   โ”œโ”€โ”€ src/               #   React frontend, laid out like core/:
โ”‚   โ”‚   โ”œโ”€โ”€ desktop/       #     app start-up          (core/desktop)
โ”‚   โ”‚   โ”œโ”€โ”€ sw/            #     Writer                (core/sw)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ inc/       #       model types: SwDoc, SwTextNode, SwPaM
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ source/core/      document model, styles, undo, layout, text frames
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ source/filter/    ODF (xml), HTML, plain text filters
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ source/uibase/    SwView, SwEditWin, SwWrtShell, shells, doc shell
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ source/ui/        dialogs
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ uiconfig/  #       menubar/toolbar/popup XML (upstream format)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ qa/        #       unit tests
โ”‚   โ”‚   โ”œโ”€โ”€ sfx2/          #     dispatcher, sidebar, doc medium, app slots
โ”‚   โ”‚   โ”œโ”€โ”€ framework/     #     menu bar / toolbar managers
โ”‚   โ”‚   โ”œโ”€โ”€ vcl/           #     widgets: menus, toolbox, combobox, dialogs
โ”‚   โ”‚   โ”œโ”€โ”€ svx/           #     toolbar controllers, sidebar panels, find dialog
โ”‚   โ”‚   โ”œโ”€โ”€ svtools/       #     ruler
โ”‚   โ”‚   โ”œโ”€โ”€ editeng/       #     character / paragraph attribute items
โ”‚   โ”‚   โ”œโ”€โ”€ officecfg/     #     command labels and accelerators
โ”‚   โ”‚   โ”œโ”€โ”€ filter/        #     filter registry
โ”‚   โ”‚   โ”œโ”€โ”€ unotools/      #     font substitution
โ”‚   โ”‚   โ””โ”€โ”€ cui/           #     About dialog
โ”‚   โ””โ”€โ”€ scripts/build.sh   #   npm ci + tests + tauri build
โ””โ”€โ”€ Justfile

Architecture in one paragraph

SwDoc is an immutable value (paragraphs made of attribute runs), so undo is a snapshot. SwWrtShell is the editing API. SwEditWin renders pages into a contentEditable host whose DOM is owned by React: every native edit is cancelled in beforeinput and replayed on the model, while the browser still handles caret movement, selection, IME and spell checking. UI commands are .uno: strings routed by SfxDispatcher through a shell stack (text shell โ†’ view โ†’ document โ†’ application), exactly like upstream; menus and toolbars are built from the same XML format as core/sw/uiconfig.