|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Vector is a PowerPoint add-in for inserting professional charts, inspired by Think-cell. It has two implementations: |
| 8 | +- **Web-based add-in** (primary): React + TypeScript + Office.js, deployed to GitHub Pages |
| 9 | +- **PPAM/VBA-based add-in** (legacy): Traditional PowerPoint ribbon with VBA macros |
| 10 | + |
| 11 | +## Build Commands |
| 12 | + |
| 13 | +```bash |
| 14 | +npm run build # Production build |
| 15 | +npm run dev # Development server with hot reload |
| 16 | +npm run start # Dev server with HTTPS (required for Office add-in testing) |
| 17 | +npm run lint # ESLint for .ts and .tsx files |
| 18 | +npm run sideload # Sideload add-in into PowerPoint for testing |
| 19 | +npm run validate # Validate manifest.xml |
| 20 | +npm run deploy # Build and deploy to GitHub Pages |
| 21 | +``` |
| 22 | + |
| 23 | +For the legacy VBA version: |
| 24 | +```bash |
| 25 | +python Scripts/build-ppam.py # Build PPAM file |
| 26 | +./Scripts/install.sh # Install on macOS |
| 27 | +``` |
| 28 | + |
| 29 | +## Architecture |
| 30 | + |
| 31 | +### Source Structure |
| 32 | +``` |
| 33 | +src/ |
| 34 | +├── taskpane/ |
| 35 | +│ ├── index.tsx # React entry point, Office.onReady handler |
| 36 | +│ ├── App.tsx # Main app component with chart type state |
| 37 | +│ └── taskpane.css # Tailwind imports + custom styles |
| 38 | +├── components/ |
| 39 | +│ ├── Header.tsx # Branding header |
| 40 | +│ └── ChartPanel.tsx # Chart type selection + insert button |
| 41 | +└── utils/ |
| 42 | + └── chartUtils.ts # Office.js integration for chart insertion |
| 43 | +``` |
| 44 | + |
| 45 | +### Key Technologies |
| 46 | +- React 18 with TypeScript |
| 47 | +- Fluent UI React Components (Microsoft design system) |
| 48 | +- Office.js for PowerPoint API |
| 49 | +- Tailwind CSS with custom Office-themed color palette |
| 50 | +- Webpack 5 with dev server on port 3000 (HTTPS) |
| 51 | + |
| 52 | +### Office.js Integration Pattern |
| 53 | +Charts are created using `PowerPoint.run()` context: |
| 54 | +```typescript |
| 55 | +await PowerPoint.run(async (context) => { |
| 56 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 57 | + // Add shapes and manipulate slides |
| 58 | + await context.sync(); |
| 59 | +}); |
| 60 | +``` |
| 61 | + |
| 62 | +### Manifests |
| 63 | +- `manifest.xml` - Development (localhost:3000) |
| 64 | +- `manifest-prod.xml` - Production (GitHub Pages) |
| 65 | + |
| 66 | +## Deployment |
| 67 | + |
| 68 | +GitHub Actions automatically deploys to GitHub Pages on push to main branch. The workflow: |
| 69 | +1. Runs `npm ci` and `npm run build` |
| 70 | +2. Copies `manifest-prod.xml` to dist/ |
| 71 | +3. Deploys to https://mortenator.github.io/vector/ |
| 72 | + |
| 73 | +## Development Notes |
| 74 | + |
| 75 | +- Tailwind config has custom `office` color palette (orange, dark, gray, light) |
| 76 | +- Path alias `@/*` maps to `src/*` in TypeScript |
| 77 | +- No test framework is currently configured |
0 commit comments