# Low-Memory Mix Exporter — Web Components API

This document is the source-reference companion to [`components.html`](./components.html). The live page imports the actual production components and has editable demonstrations. No `.stem` file or audio engine is needed to browse examples.

## Components

- `<stem-export-monitor>`

The host application owns file I/O, codec, playback, state persistence, and other operations unless explicitly noted. Components are native Custom Elements. CSS in component Shadow DOM resolves relative to the module file. The app owns any callback-supplied state.

Primary component source: [`components/export-monitor.js`](./components/export-monitor.js).

## Public methods and properties

- `setStatus(message)`: Sets export status text with aria-live feedback
- `setProgress(number)`: Updates progress 0–100; returns clamped value
- `setStage(stage)`: Updates stage; controls status styling
- `reset()`: Reset to idle state
- `progress`: Current numeric progress 0–100

## Events and callbacks

- `No internal exporter events`: Business logic owns cancellation, file operations, codec and output; this is a presentation component

## Example

```javascript
import './components/export-monitor.js';
const monitor = document.createElement('stem-export-monitor');
document.body.append(monitor);
monitor.setStage('render');
monitor.setStatus('Rendering effects…');
monitor.setProgress(40);
```

## Testing and limitations

- Catalog data and artworks are synthetic demonstration content; they are not loaded from audio files.
- Changing a property in the catalog reconfigures or remounts the real component so modes can be inspected.
- The catalog's events log is not a replacement for host-state management.
- For production integration, always copy the **entire relevant mini-app folder** with its sibling suite dependencies rather than a partial HTML patch.
