# Build & source — AIM Transparency

This plugin's PHP is plain, human-readable source (no build step). The **admin dashboard**
is a small React + TypeScript app; the only compiled artifacts in this package are
`dashboard/assets/app.js` and `dashboard/assets/app.css`. The complete source used to
produce them is **included in this package** at `dashboard/src/`.

## What is compiled
| Shipped file | Built from |
| --- | --- |
| `dashboard/assets/app.js` | the React/TypeScript source in `dashboard/src/src/` |
| `dashboard/assets/app.css` | `dashboard/src/src/styles.css` |

Nothing else is minified or generated. The front-end script (`assets/js/badge.js`),
the editor scripts (`assets/js/featured-*.js`), and all PHP are authored by hand and
ship as-is.

## Source location
`dashboard/src/` is a standalone Vite + React 18 + TypeScript project
(`package.json`, `package-lock.json`, `vite.config.ts`, `tsconfig.json`, `index.html`, `src/`).

Key files:
- `src/App.tsx` — the dashboard config (nav, branding)
- `src/pages.tsx` — the screens
- `src/ui/*` — shell, sidebar, topbar, theme, primitives
- `src/bridge.ts` — the bridge to WordPress (`window.AICL_DASH` + REST)
- `src/styles.css` — the design system

## Build steps (reproduce the shipped bundle)
```bash
cd dashboard/src
npm install
npm run build          # tsc -b && vite build  ->  dist/assets/app.js + app.css
cp dist/assets/app.js dist/assets/app.css ../assets/
```

## Toolchain & third-party code
- Node 18+ / npm
- Vite 5 (MIT), React 18 + ReactDOM (MIT, https://github.com/facebook/react),
  lucide-react icons (ISC, https://github.com/lucide-icons/lucide) — versions pinned
  in `dashboard/src/package.json` / `package-lock.json`.
- No network calls at build time beyond `npm install`; the bundle is fully self-contained.
- Fonts (Geist + Geist Mono, SIL OFL 1.1) are bundled locally in `dashboard/assets/fonts/`
  (license text included there) and enqueued from there — the plugin makes
  **no external font requests** at runtime.
- The badge artwork in `assets/eu-icons/` is the European Commission's official
  AI-content labelling icon set (© European Union, CC BY 4.0) — source, terms and
  modification notes in `assets/eu-icons/LICENSE.txt`.
- Note: `vite build` prints a warning that `/fonts/geist.css` does not exist at build
  time — expected; that link in `index.html` is dev-only, and the fonts are shipped at
  `dashboard/assets/fonts/` and enqueued by PHP (`dist/index.html` is not part of the plugin).
