-
Notifications
You must be signed in to change notification settings - Fork 0
Project Structure
Jones edited this page Jun 24, 2026
·
1 revision
This document outlines the codebase organisation and directory structure of the Mango IIIF Viewer repository.
Mango/
├── apps/
│ └── demo/ # Local test playground (standalone HTML pages)
├── docs/ # Developer documentation and guides
├── scripts/ # Build-related automation scripts
└── src/
└── lib/ # Primary source code of the viewer
├── components/ # Svelte UI entry points (Viewer, ViewerElement)
├── config/ # Configuration parsing and normalisation
├── core/ # Shared types, event maps, i18n, and core model states
├── elements/ # Web Component registration entries
├── events/ # Event bus publishers
├── features/ # Feature UI panels and layouts
├── plugins/ # Plugin slots, registry, and first-party plugins
├── renderers/ # Media rendering components (OSD, PDF, 3D, Audio, Video)
├── state/ # State management and runes
└── story/ # Narration, timeline, and authoring logics
Contains several lightweight HTML pages (viewer.html, story-builder.html, annotation-editor.html, etc.) mapped to compiled script entries in src/dist. This is the sandbox used during local development (npm run dev).
Contains:
-
Viewer.svelte: The main Svelte component. It decides layout configuration, binds API methods, and passes down state. -
ViewerElement.svelte: The Web Component (Custom Element wrapper) that maps HTML properties to Svelte props and handles dynamic loading of plugins/feature modes.
Houses core system definitions:
-
src/lib/core/types: Strongly-typed schemas for configurations, events, plugins, and storytelling. -
src/lib/core/i18n.ts: Writable locale stores and key-lookup engines.
Contains component layouts for distinct workspaces:
-
viewer/ViewerLayout.svelte: Main interface rendering the left toolbar, sidebars, stages, and bottom controls. -
storytelling/: Narration panels and narration audio overlays.
Implements specific media engines corresponding to IIIF canvas types:
-
OSDViewer.svelte: Large image loading usingOpenSeadragon. -
PdfRenderer.svelte: Documents usingPDFJS. -
ModelRenderer.svelte: 3D models using@google/model-viewer. -
AudioRenderer.svelte&VideoRenderer.svelte: Media element streaming.
Contains layout registries and custom panel slots:
-
registry.ts: Register and manage active layout modifications. -
PluginPanel.svelte&PluginSlot.svelte: Bind DOM slots for first-party/third-party plugins.