How accionlabs/mermaid-powerpoint-addin works
File Structure Highlights
• src/commands: Ribbon button definitions (commands.html & commands.ts)
• src/taskpane: React components (MermaidEditor, Settings), utility (powerPointUtils.ts), HTML/TSX entry points
• webpack.config.js & tsconfig.json: build configuration
• dist/: production build artifacts (HTML, JS bundles, manifest.xml)
• docs/: GitHub Pages preview of dist/
• manifest.xml / manifest-production.xml: Office Add-in manifest
Key Components
a. Client UI (Task Pane)
• MermaidEditor (React)
• Settings panel
• Build via Webpack → JS bundle served in the task pane iframe
b. Ribbon Commands
• commands.html loads command-specific scripts
c. Office.js API
• Runs in the task pane browser context
• Takes code → SVG/PNG → returns image data
e. Storage Layer
• Custom XML Parts inside PPTX file
f. Build & Deployment
• Webpack → dist
• GitHub Pages (docs/) for hosting static assets
• manifest-production.xml points to hosted URLs
Relationships and Data Flows
• User clicks a ribbon button → Office.js event triggers commands.ts → opens task pane
• Build process: Webpack bundles src into dist → dist deployed to GitHub Pages → manifest references these URLs
Architectural Patterns & Principles
• Modular separation: ribbon commands vs. task pane UI vs. storage utilities
• Single-page UI in an iframe (task pane)
• Client-only architecture—no server
• Build-time static hosting