How stffnb/edentext works
EdenText is a local-first word processor delivered as a browser app, with an optional Electron desktop shell. The main workflow is to open or create a document, edit its structured content in the page-layout editor, keep it locally, and save or export it. Review, proofing, templates, and optional AI add distinct capabilities around that workflow. The README and sampled imports establish the broad architecture; several feature modules were not excerpted, so their internal connections are shown only where documented.
Main entry points: App.svelte App shell · Editor.svelte TipTap editor · extensions Document extensions · import ODT/DOCX import
Components 22
Application
- App shell
src/App.svelte - Desktop shell
desktop/main.mjs - Offline worker
public/sw.js - Localization
src/lib/i18n/i18n.svelte.ts
Editing and layout
- TipTap editor
src/lib/components/Editor.svelte - Document extensions
src/lib/editor/extensions - Styles and layout
src/lib/styles/styleSheet.ts - Style manager
src/lib/components/StyleManagerDialog.svelte
Document lifecycle
- ODT/DOCX import
src/lib/import - File export
src/lib/export - Browser file APIs
- Local document storage
src/lib/storage/docScope.ts - Protected documents
src/lib/crypto/protect.ts - Templates
src/lib/templates/registry.ts
Writing features
- Review tools
src/lib/editor/extensions/trackChanges.ts - Review interface
src/lib/components/ReviewMarginLayer.svelte - Proofing tools
src/lib/spell/controller.ts - Grammar checking
src/lib/spell/grammar.svelte.ts - AI assistant
src/lib/ai/client.ts
Other components
- Writer
- Browser runtime
- Chosen AI provider
Connections 24
- Writer → Browser runtime: opens app
README.md - Browser runtime → App shell: mounts
- Writer → Desktop shell: launches
- App shell → TipTap editor: composes
src/App.svelte - TipTap editor → Document extensions: edits with
README.md - Document extensions → Styles and layout: uses styles
src/lib/styles/styleSheet.ts - App shell → ODT/DOCX import: opens documents
src/App.svelte - ODT/DOCX import → TipTap editor: loads content
README.md - App shell → File export: exports documents
src/App.svelte - File export → Browser file APIs: writes files
README.md - App shell → Browser file APIs: opens and saves
README.md - TipTap editor → Local document storage: persists locally
README.md - App shell → Local document storage: manages document state
src/App.svelte - App shell → Protected documents: protects files
src/App.svelte - App shell → Templates: offers templates
README.md - Style manager → Styles and layout: updates styles
src/lib/components/StyleManagerDialog.svelte - TipTap editor → Review tools: records revisions
README.md - Review interface → Review tools: displays markup
src/lib/components/ReviewMarginLayer.svelte - TipTap editor → Proofing tools: checks spelling
README.md - TipTap editor → Grammar checking: checks grammar
README.md - App shell → AI assistant: offers assistant
- AI assistant → Chosen AI provider: sends requests
README.md - Browser runtime → Offline worker: registers worker
- App shell → Localization: localizes interface
src/lib/i18n/i18n.svelte.ts