How shahzad-35/openanydoc works
OpenAnyDoc is a browser-based document viewer and editor. A visitor chooses or drops a local file (with CSV text paste also supported); the app reads it in memory, selects a format viewer, and presents view/edit controls. CSV, JSON, and plain text have editing flows with in-memory undo and export; the viewer catalog also advertises Excel, Word, PDF, and PowerPoint, though the sampled registry indicates those are not implemented as working viewers yet. Relationships below rely on excerpts and SOURCE INDEX references; unsampled subsystems and their internal connections are not inferred.
Main entry points: CsvViewer.tsx CSV viewer · JsonViewer.tsx JSON viewer · registry.ts Format registry · jsonModel.ts JSON model and edits
Components 22
App and intake
- App and routing
src/App.tsx - Home and drop zone
src/pages/HomePage.tsx - File intake
src/useFileIntake.tsx - Drop panel
src/components/DropPanel.tsx - File view page
src/pages/FileViewPage.tsx
Format dispatch
- Viewer catalog
src/viewers.ts - Format registry
src/formats/registry.ts - Edit session
src/formats/useEditSession.ts
CSV workflow
- CSV viewer
src/formats/csv/CsvViewer.tsx - CSV parser
src/parseCsv.ts - CSV cell model
src/formats/csv/csvCells.ts - Shared data table
src/formats/DataTable.tsx - CSV editing tools
src/formats/csv/csvEditing.tsx
Text and JSON
- Text viewer
src/formats/text/TextViewer.tsx - Text editing
src/formats/text/textEditing.ts - JSON viewer
src/formats/json/JsonViewer.tsx - JSON model and edits
src/formats/json/jsonModel.ts - JSON parse worker
src/formats/json/jsonParse.worker.ts - JSON tree
src/formats/json/JsonTree.tsx - JSON table
src/formats/json/JsonTable.tsx - JSON details
src/formats/json/JsonDetails.tsx
Other components
- Visitor
Connections 33
- Visitor → Drop panel: drops or selects
src/components/DropPanel.tsx - Home and drop zone → File intake: uses intake
src/pages/HomePage.tsx - Home and drop zone → Drop panel: renders
src/pages/HomePage.tsx - Drop panel → File intake: uses intake
src/components/DropPanel.tsx - File intake → App and routing: reports loaded file
src/App.tsx - App and routing → Home and drop zone: renders
src/App.tsx - App and routing → File view page: renders
src/App.tsx - App and routing → Viewer catalog: resolves routes
src/App.tsx - File view page → Viewer catalog: selects viewer
src/pages/FileViewPage.tsx - File view page → Format registry: selects format
src/pages/FileViewPage.tsx - File view page → Edit session: creates session
src/pages/FileViewPage.tsx - Format registry → Viewer catalog: maps extensions
src/formats/registry.ts - Format registry → CSV viewer: loads viewer
src/formats/registry.ts - Format registry → Text viewer: loads viewer
src/formats/registry.ts - Format registry → JSON viewer: loads viewer
src/formats/registry.ts - CSV viewer → CSV parser: parses file
src/formats/csv/CsvViewer.tsx - CSV viewer → CSV cell model: reads cell model
src/formats/csv/CsvViewer.tsx - CSV viewer → Shared data table: renders table
src/formats/csv/CsvViewer.tsx - CSV viewer → Edit session: uses edit state
src/formats/csv/CsvViewer.tsx - CSV viewer → CSV editing tools: uses editing tools
src/formats/csv/CsvViewer.tsx - CSV editing tools → CSV cell model: reads cell values
src/formats/csv/csvEditing.tsx - CSV editing tools → Shared data table: uses cell input
src/formats/csv/csvEditing.tsx - Text viewer → Text editing: uses editing
src/formats/text/TextViewer.tsx - Text viewer → Edit session: uses edit state
src/formats/text/TextViewer.tsx - JSON viewer → JSON model and edits: uses document model
src/formats/json/JsonViewer.tsx - JSON viewer → Edit session: uses edit state
src/formats/json/JsonViewer.tsx - JSON viewer → JSON tree: renders tree
src/formats/json/JsonViewer.tsx - JSON viewer → JSON table: renders table
src/formats/json/JsonViewer.tsx - JSON viewer → JSON details: renders details
src/formats/json/JsonViewer.tsx - JSON model and edits → JSON parse worker: parses in worker
src/formats/json/jsonModel.ts - JSON tree → JSON model and edits: reads model
src/formats/json/JsonTree.tsx - JSON table → JSON model and edits: reads model
src/formats/json/JsonTable.tsx - JSON details → JSON model and edits: reads model
src/formats/json/JsonDetails.tsx