@ghchinoy/lit-audio-ui 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/AGENT_SKILL.md +50 -0
  2. package/dist/components/{ui-audio-next-button.js → atoms/ui-audio-next-button.js} +6 -6
  3. package/dist/components/{ui-audio-play-button.js → atoms/ui-audio-play-button.js} +6 -6
  4. package/dist/components/{ui-audio-prev-button.js → atoms/ui-audio-prev-button.js} +6 -6
  5. package/dist/components/{ui-audio-progress-slider.js → atoms/ui-audio-progress-slider.js} +6 -6
  6. package/dist/components/{ui-audio-time-display.js → atoms/ui-audio-time-display.js} +6 -6
  7. package/dist/components/{ui-audio-volume-slider.js → atoms/ui-audio-volume-slider.js} +7 -7
  8. package/dist/components/{ui-shimmering-text.js → atoms/ui-shimmering-text.js} +1 -1
  9. package/dist/components/{ui-speech-cancel-button.js → atoms/ui-speech-cancel-button.js} +5 -5
  10. package/dist/components/{ui-speech-record-button.js → atoms/ui-speech-record-button.js} +5 -5
  11. package/dist/components/{scream-voice-button.js → molecules/scream-voice-button.js} +1 -1
  12. package/dist/components/{ui-3d-flip.js → molecules/ui-3d-flip.js} +1 -1
  13. package/dist/components/{ui-live-waveform.js → molecules/ui-live-waveform.js} +2 -2
  14. package/dist/components/{ui-mic-selector.js → molecules/ui-mic-selector.js} +1 -1
  15. package/dist/components/{ui-orb.js → molecules/ui-orb.js} +1 -1
  16. package/dist/components/{ui-playlist.js → molecules/ui-playlist.js} +11 -8
  17. package/dist/components/{ui-scrolling-waveform.js → molecules/ui-scrolling-waveform.js} +2 -2
  18. package/dist/components/{ui-showcase-card.js → molecules/ui-showcase-card.js} +1 -1
  19. package/dist/components/{ui-spectrum-visualizer.js → molecules/ui-spectrum-visualizer.js} +15 -15
  20. package/dist/components/{ui-speech-preview.js → molecules/ui-speech-preview.js} +5 -5
  21. package/dist/components/{ui-voice-button.js → molecules/ui-voice-button.js} +3 -3
  22. package/dist/components/{ui-voice-picker.js → molecules/ui-voice-picker.js} +2 -2
  23. package/dist/components/{ui-waveform.js → molecules/ui-waveform.js} +2 -2
  24. package/dist/components/{ui-audio-player.js → organisms/ui-audio-player.js} +5 -5
  25. package/dist/components/{ui-audio-provider.js → providers/ui-audio-provider.js} +4 -4
  26. package/dist/components/{ui-speech-provider.js → providers/ui-speech-provider.js} +6 -6
  27. package/dist/index.js +29 -29
  28. package/dist/scream-audio-ui.umd.js +876 -873
  29. package/package.json +7 -3
package/AGENT_SKILL.md ADDED
@@ -0,0 +1,50 @@
1
+ # Agent Skill: Lit Audio UI Integration
2
+
3
+ A specialized skill for AI agents to autonomously implement high-performance audio visualizations and controls using the `@ghchinoy/lit-audio-ui` library.
4
+
5
+ ## Capabilities
6
+ - Orchestrate complex audio playback using a headless provider.
7
+ - Implement real-time 2D and 3D audio visualizations (Orb, Waveforms, Spectrum).
8
+ - Construct accessible, theme-aware audio interfaces.
9
+ - Manage multi-track playlists with automatic state synchronization.
10
+
11
+ ## Protocol: The "Lit Way"
12
+
13
+ ### 1. Bootstrapping the Provider
14
+ Always wrap atomic components in a `<ui-audio-provider>` (for playback) or `<ui-speech-provider>` (for recording). These components manage the state machine and shared context.
15
+
16
+ ### 2. Playlist & State Synchronization
17
+ When using `<ui-audio-provider>` with the `items` property:
18
+ - Listen to the `@state-change` event on the provider.
19
+ - Use `e.detail.currentIndex` to synchronize your parent component's metadata (e.g., Title, Artist, Album Art).
20
+ - The provider handles internal track advancing automatically when `autoAdvance` is true.
21
+
22
+ ### 3. Visualizer "Bridge" Logic
23
+ Most visual components (`ui-orb`, `ui-spectrum-visualizer`, `ui-live-waveform`) require an `analyserNode`.
24
+ - They attempt to consume this from context automatically.
25
+ - **Tip:** Ensure the provider has finished initializing its AudioContext (triggered by the first user interaction) before expecting visualizations to appear.
26
+
27
+ ### 4. Theming & Branding (Zero-JS)
28
+ The library uses Material Design 3 tokens with semantic overrides. Use these for dark-theme consistency:
29
+ - `--md-sys-color-primary`: Main theme color (e.g., `#d0bcff`).
30
+ - `--md-sys-color-surface-container-low`: Primary background for pickers and lists.
31
+ - `--ui-speech-wave-color`: Custom color for waveforms inside buttons (prevents 'black-on-black' issues).
32
+ - `--md-list-item-label-text-color`: high-contrast text color for playlists.
33
+
34
+ ### 5. Layout & 3D Environments
35
+ If a component is inside a 3D transformed container (perspective/translateZ):
36
+ - Ensure `md-menu` (inside pickers) uses `positioning="popover"`.
37
+ - Use the `<ui-3d-flip>` utility for compact "back-of-card" tracklists.
38
+ - Apply `font-family: inherit` to library components to avoid default serif fonts.
39
+
40
+ ### 6. Component Utility Registry
41
+ - `<ui-audio-time-display>`: Defaults to `full` mode (`current / total`). Use `format="elapsed"` or `format="remaining"` for single values.
42
+ - `<ui-spectrum-visualizer>`: Requires a `.height` property for reliable rendering.
43
+
44
+ ## Simulation Mode
45
+ For development without microphone access, enable the `simulation` property on `<ui-speech-provider>`. This generates procedural audio data and mock transcription events.
46
+
47
+ ## Quality Gates
48
+ - Ensure `crossorigin="anonymous"` is set on audio/video tags to allow analysis.
49
+ - Use `color-scheme: light dark;` on host elements to support native dark-mode sensitivity.
50
+ - Verify that `manual` mode handlers clear intervals/timeouts during state transitions.
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o } from "lit/decorators.js";
@@ -39,8 +39,8 @@ var s = class extends r {
39
39
  `;
40
40
  }
41
41
  };
42
- e([t({
43
- context: n,
42
+ n([e({
43
+ context: t,
44
44
  subscribe: !0
45
- })], s.prototype, "playerState", void 0), s = e([o("ui-audio-next-button")], s);
45
+ })], s.prototype, "playerState", void 0), s = n([o("ui-audio-next-button")], s);
46
46
  export { s as UiAudioNextButton };
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o, property as s } from "lit/decorators.js";
@@ -77,8 +77,8 @@ var c = class extends r {
77
77
  this.playerState && this.playerState.togglePlay();
78
78
  }
79
79
  };
80
- e([t({
81
- context: n,
80
+ n([e({
81
+ context: t,
82
82
  subscribe: !0
83
- }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = e([o("ui-audio-play-button")], c);
83
+ }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = n([o("ui-audio-play-button")], c);
84
84
  export { c as UiAudioPlayButton };
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o } from "lit/decorators.js";
@@ -39,8 +39,8 @@ var s = class extends r {
39
39
  `;
40
40
  }
41
41
  };
42
- e([t({
43
- context: n,
42
+ n([e({
43
+ context: t,
44
44
  subscribe: !0
45
- })], s.prototype, "playerState", void 0), s = e([o("ui-audio-prev-button")], s);
45
+ })], s.prototype, "playerState", void 0), s = n([o("ui-audio-prev-button")], s);
46
46
  export { s as UiAudioPrevButton };
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import { LitElement as r, css as i, html as a } from "lit";
5
5
  import { customElement as o, property as s } from "lit/decorators.js";
6
6
  import "@material/web/slider/slider.js";
@@ -45,8 +45,8 @@ var c = class extends r {
45
45
  this._dragValue = e.target.value, this.playerState && this.playerState.seek(this._dragValue), this._isDragging = !1;
46
46
  }
47
47
  };
48
- e([t({
49
- context: n,
48
+ n([e({
49
+ context: t,
50
50
  subscribe: !0
51
- }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = e([o("ui-audio-progress-slider")], c);
51
+ }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = n([o("ui-audio-progress-slider")], c);
52
52
  export { c as UiAudioProgressSlider };
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import { LitElement as r, css as i, html as a } from "lit";
5
5
  import { customElement as o, property as s } from "lit/decorators.js";
6
6
  var c = class extends r {
@@ -32,8 +32,8 @@ var c = class extends r {
32
32
  return t > 0 ? i += "" + t + ":" + (n < 10 ? "0" : "") : this.compact, i += "" + n + ":" + (r < 10 ? "0" : ""), i += "" + r, i;
33
33
  }
34
34
  };
35
- e([t({
36
- context: n,
35
+ n([e({
36
+ context: t,
37
37
  subscribe: !0
38
- }), s({ attribute: !1 })], c.prototype, "playerState", void 0), e([s({ type: String })], c.prototype, "format", void 0), e([s({ type: String })], c.prototype, "separator", void 0), e([s({ type: Boolean })], c.prototype, "compact", void 0), c = e([o("ui-audio-time-display")], c);
38
+ }), s({ attribute: !1 })], c.prototype, "playerState", void 0), n([s({ type: String })], c.prototype, "format", void 0), n([s({ type: String })], c.prototype, "separator", void 0), n([s({ type: Boolean })], c.prototype, "compact", void 0), c = n([o("ui-audio-time-display")], c);
39
39
  export { c as UiAudioTimeDisplay };
@@ -1,11 +1,11 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o, property as s } from "lit/decorators.js";
7
- import "@material/web/slider/slider.js";
8
7
  import "@material/web/iconbutton/icon-button.js";
8
+ import "@material/web/slider/slider.js";
9
9
  var c = class extends r {
10
10
  static {
11
11
  this.styles = i`
@@ -57,8 +57,8 @@ var c = class extends r {
57
57
  this.playerState && this.playerState.toggleMute();
58
58
  }
59
59
  };
60
- e([t({
61
- context: n,
60
+ n([e({
61
+ context: t,
62
62
  subscribe: !0
63
- }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = e([o("ui-audio-volume-slider")], c);
63
+ }), s({ attribute: !1 })], c.prototype, "playerState", void 0), c = n([o("ui-audio-volume-slider")], c);
64
64
  export { c as UiAudioVolumeSlider };
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import { LitElement as t, css as n, html as r } from "lit";
3
3
  import { customElement as i, property as a, state as o } from "lit/decorators.js";
4
4
  var s = class extends t {
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { speechContext as n } from "../utils/speech-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { speechContext as n } from "../../utils/speech-context.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o } from "lit/decorators.js";
@@ -40,8 +40,8 @@ var s = class extends r {
40
40
  this._context?.cancel();
41
41
  }
42
42
  };
43
- e([t({
43
+ t([e({
44
44
  context: n,
45
45
  subscribe: !0
46
- })], s.prototype, "_context", void 0), s = e([o("ui-speech-cancel-button")], s);
46
+ })], s.prototype, "_context", void 0), s = t([o("ui-speech-cancel-button")], s);
47
47
  export { s as UiSpeechCancelButton };
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { speechContext as n } from "../utils/speech-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { speechContext as n } from "../../utils/speech-context.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o, property as s } from "lit/decorators.js";
@@ -75,8 +75,8 @@ var c = class extends r {
75
75
  this._context && (this._context.state === "idle" ? this._context.start() : this._context.state === "recording" && this._context.stop());
76
76
  }
77
77
  };
78
- e([t({
78
+ t([e({
79
79
  context: n,
80
80
  subscribe: !0
81
- })], c.prototype, "_context", void 0), e([s({ type: String })], c.prototype, "size", void 0), c = e([o("ui-speech-record-button")], c);
81
+ })], c.prototype, "_context", void 0), t([s({ type: String })], c.prototype, "size", void 0), c = t([o("ui-speech-record-button")], c);
82
82
  export { c as UiSpeechRecordButton };
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import "@material/web/icon/icon.js";
3
3
  import { LitElement as t, css as n, html as r } from "lit";
4
4
  import { customElement as i, property as a } from "lit/decorators.js";
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import "@material/web/icon/icon.js";
3
3
  import { LitElement as t, css as n, html as r } from "lit";
4
4
  import { customElement as i, property as a } from "lit/decorators.js";
@@ -1,5 +1,5 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { applyCanvasEdgeFade as t, getNormalizedFrequencyData as n } from "../utils/audio-utils.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
+ import { applyCanvasEdgeFade as t, getNormalizedFrequencyData as n } from "../../utils/audio-utils.js";
3
3
  import { LitElement as r, css as i, html as a } from "lit";
4
4
  import { customElement as o, property as s, query as c } from "lit/decorators.js";
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import "./ui-live-waveform.js";
3
3
  import "@material/web/icon/icon.js";
4
4
  import { LitElement as t, css as n, html as r } from "lit";
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import { LitElement as t, css as n, html as r } from "lit";
3
3
  import { customElement as i, property as a, query as o } from "lit/decorators.js";
4
4
  import * as s from "three";
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o, property as s } from "lit/decorators.js";
@@ -42,7 +42,8 @@ var c = class extends r {
42
42
  font-weight: 700;
43
43
  text-transform: uppercase;
44
44
  letter-spacing: 0.05em;
45
- color: var(--md-sys-color-primary);
45
+ color: var(--md-sys-color-primary, #0066cc);
46
+ background: var(--md-sys-color-surface-container-low);
46
47
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
47
48
  }
48
49
 
@@ -54,12 +55,14 @@ var c = class extends r {
54
55
  md-list-item {
55
56
  --md-list-item-label-text-font: inherit;
56
57
  --md-list-item-supporting-text-font: inherit;
58
+ --md-list-item-label-text-color: var(--md-sys-color-on-surface);
59
+ --md-list-item-supporting-text-color: var(--md-sys-color-on-surface-variant);
57
60
  cursor: pointer;
58
61
  }
59
62
 
60
63
  md-list-item[selected] {
61
64
  --md-list-item-label-text-color: var(--md-sys-color-primary);
62
- background: var(--md-sys-color-primary-container, rgba(0, 102, 204, 0.1));
65
+ background: var(--md-sys-color-primary-container);
63
66
  }
64
67
 
65
68
  .now-playing-icon {
@@ -99,8 +102,8 @@ var c = class extends r {
99
102
  `;
100
103
  }
101
104
  };
102
- e([t({
103
- context: n,
105
+ n([e({
106
+ context: t,
104
107
  subscribe: !0
105
- })], c.prototype, "playerState", void 0), e([s({ type: String })], c.prototype, "header", void 0), e([s({ type: String })], c.prototype, "emptyText", void 0), c = e([o("ui-playlist")], c);
108
+ })], c.prototype, "playerState", void 0), n([s({ type: String })], c.prototype, "header", void 0), n([s({ type: String })], c.prototype, "emptyText", void 0), c = n([o("ui-playlist")], c);
106
109
  export { c as UiPlaylist };
@@ -1,5 +1,5 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { applyCanvasEdgeFade as t } from "../utils/audio-utils.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
+ import { applyCanvasEdgeFade as t } from "../../utils/audio-utils.js";
3
3
  import { LitElement as n, css as r, html as i } from "lit";
4
4
  import { customElement as a, property as o, query as s } from "lit/decorators.js";
5
5
  var c = class extends n {
@@ -1,4 +1,4 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import { LitElement as t, css as n, html as r } from "lit";
3
3
  import { customElement as i, property as a } from "lit/decorators.js";
4
4
  import "@material/web/button/text-button.js";
@@ -1,7 +1,7 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { getNormalizedFrequencyData as t } from "../utils/audio-utils.js";
3
- import { c as n } from "../node_modules/@lit/context/lib/decorators/consume.js";
4
- import { audioPlayerContext as r } from "../utils/audio-context.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
+ import { getNormalizedFrequencyData as r } from "../../utils/audio-utils.js";
5
5
  import { LitElement as i, css as a, html as o } from "lit";
6
6
  import { customElement as s, property as c, query as l } from "lit/decorators.js";
7
7
  /**
@@ -56,20 +56,20 @@ var u = class extends i {
56
56
  if (!this._canvas || !this.playerState?.analyserNode) return;
57
57
  let e = this.playerState.analyserNode;
58
58
  this._dataArray ||= new Uint8Array(e.frequencyBinCount);
59
- let n = this._canvas.getContext("2d");
60
- if (!n) return;
61
- let r = this._canvas.getBoundingClientRect(), i = window.devicePixelRatio || 1;
62
- this._canvas.width !== r.width * i && (this._canvas.width = r.width * i, this._canvas.height = r.height * i, n.scale(i, i)), n.clearRect(0, 0, r.width, r.height);
63
- let a = t(e, this._dataArray), o = this.barWidth + this.barGap, s = Math.floor(r.width / o), c = getComputedStyle(this), l = this.color;
64
- l ||= c.getPropertyValue("--md-sys-color-primary").trim() || "#0066cc", n.fillStyle = l;
59
+ let t = this._canvas.getContext("2d");
60
+ if (!t) return;
61
+ let n = this._canvas.getBoundingClientRect(), i = window.devicePixelRatio || 1;
62
+ this._canvas.width !== n.width * i && (this._canvas.width = n.width * i, this._canvas.height = n.height * i, t.scale(i, i)), t.clearRect(0, 0, n.width, n.height);
63
+ let a = r(e, this._dataArray), o = this.barWidth + this.barGap, s = Math.floor(n.width / o), c = getComputedStyle(this), l = this.color;
64
+ l ||= c.getPropertyValue("--md-sys-color-primary").trim() || "#0066cc", t.fillStyle = l;
65
65
  for (let e = 0; e < s; e++) {
66
- let t = (a[Math.floor(e / s * (a.length * .6))] || 0) * r.height, i = e * o, c = r.height - t;
67
- n.fillRect(i, c, this.barWidth, t);
66
+ let r = (a[Math.floor(e / s * (a.length * .6))] || 0) * n.height, i = e * o, c = n.height - r;
67
+ t.fillRect(i, c, this.barWidth, r);
68
68
  }
69
69
  }
70
70
  };
71
- e([n({
72
- context: r,
71
+ n([e({
72
+ context: t,
73
73
  subscribe: !0
74
- })], u.prototype, "playerState", void 0), e([c({ type: Number })], u.prototype, "barWidth", void 0), e([c({ type: Number })], u.prototype, "barGap", void 0), e([c({ type: Number })], u.prototype, "height", void 0), e([c({ type: String })], u.prototype, "color", void 0), e([l("canvas")], u.prototype, "_canvas", void 0), u = e([s("ui-spectrum-visualizer")], u);
74
+ })], u.prototype, "playerState", void 0), n([c({ type: Number })], u.prototype, "barWidth", void 0), n([c({ type: Number })], u.prototype, "barGap", void 0), n([c({ type: Number })], u.prototype, "height", void 0), n([c({ type: String })], u.prototype, "color", void 0), n([l("canvas")], u.prototype, "_canvas", void 0), u = n([s("ui-spectrum-visualizer")], u);
75
75
  export { u as UiSpectrumVisualizer };
@@ -1,7 +1,7 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { c as e } from "../../node_modules/@lit/context/lib/decorators/consume.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { speechContext as n } from "../../utils/speech-context.js";
2
4
  import "./ui-live-waveform.js";
3
- import { c as t } from "../node_modules/@lit/context/lib/decorators/consume.js";
4
- import { speechContext as n } from "../utils/speech-context.js";
5
5
  import { LitElement as r, css as i, html as a } from "lit";
6
6
  import { customElement as o, property as s } from "lit/decorators.js";
7
7
  var c = class extends r {
@@ -74,8 +74,8 @@ var c = class extends r {
74
74
  `;
75
75
  }
76
76
  };
77
- e([t({
77
+ t([e({
78
78
  context: n,
79
79
  subscribe: !0
80
- })], c.prototype, "_context", void 0), e([s({ type: String })], c.prototype, "placeholder", void 0), c = e([o("ui-speech-preview")], c);
80
+ })], c.prototype, "_context", void 0), t([s({ type: String })], c.prototype, "placeholder", void 0), c = t([o("ui-speech-preview")], c);
81
81
  export { c as UiSpeechPreview };
@@ -1,11 +1,11 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import "./ui-live-waveform.js";
3
3
  import "@material/web/icon/icon.js";
4
4
  import { LitElement as t, css as n, html as r } from "lit";
5
5
  import { customElement as i, property as a, state as o } from "lit/decorators.js";
6
- import "@material/web/button/filled-button.js";
7
- import { classMap as s } from "lit/directives/class-map.js";
8
6
  import "@material/web/button/outlined-button.js";
7
+ import { classMap as s } from "lit/directives/class-map.js";
8
+ import "@material/web/button/filled-button.js";
9
9
  /**
10
10
  * Copyright 2026 Google LLC
11
11
  *
@@ -1,11 +1,11 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
2
  import "./ui-live-waveform.js";
3
3
  import "@material/web/icon/icon.js";
4
4
  import { LitElement as t, css as n, html as r } from "lit";
5
5
  import { customElement as i, property as a, query as o, state as s } from "lit/decorators.js";
6
- import "@material/web/button/outlined-button.js";
7
6
  import "@material/web/menu/menu.js";
8
7
  import "@material/web/menu/menu-item.js";
8
+ import "@material/web/button/outlined-button.js";
9
9
  import "@material/web/textfield/outlined-text-field.js";
10
10
  /**
11
11
  * Copyright 2026 Google LLC
@@ -1,5 +1,5 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { applyCanvasEdgeFade as t } from "../utils/audio-utils.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
+ import { applyCanvasEdgeFade as t } from "../../utils/audio-utils.js";
3
3
  import { LitElement as n, css as r, html as i } from "lit";
4
4
  import { customElement as a, property as o, query as s } from "lit/decorators.js";
5
5
  /**
@@ -1,8 +1,8 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import "./ui-audio-provider.js";
3
- import "./ui-audio-play-button.js";
4
- import "./ui-audio-progress-slider.js";
5
- import "./ui-audio-time-display.js";
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
+ import "../atoms/ui-audio-play-button.js";
3
+ import "../atoms/ui-audio-progress-slider.js";
4
+ import "../atoms/ui-audio-time-display.js";
5
+ import "../providers/ui-audio-provider.js";
6
6
  import { LitElement as t, css as n, html as r } from "lit";
7
7
  import { customElement as i, property as a } from "lit/decorators.js";
8
8
  var o = class extends t {
@@ -1,6 +1,6 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { e as t } from "../node_modules/@lit/context/lib/decorators/provide.js";
3
- import { audioPlayerContext as n } from "../utils/audio-context.js";
1
+ import { e } from "../../node_modules/@lit/context/lib/decorators/provide.js";
2
+ import { audioPlayerContext as t } from "../../utils/audio-context.js";
3
+ import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
4
4
  import { LitElement as r, css as i, html as a } from "lit";
5
5
  import { customElement as o, property as s, query as c, state as l } from "lit/decorators.js";
6
6
  var u = class extends r {
@@ -162,5 +162,5 @@ var u = class extends r {
162
162
  this._animationFrameId = requestAnimationFrame(e);
163
163
  }
164
164
  };
165
- e([s({ type: String })], u.prototype, "src", void 0), e([s({ type: Array })], u.prototype, "items", void 0), e([s({ type: Boolean })], u.prototype, "autoAdvance", void 0), e([c("audio")], u.prototype, "_audioEl", void 0), e([t({ context: n }), l()], u.prototype, "state", void 0), u = e([o("ui-audio-provider")], u);
165
+ n([s({ type: String })], u.prototype, "src", void 0), n([s({ type: Array })], u.prototype, "items", void 0), n([s({ type: Boolean })], u.prototype, "autoAdvance", void 0), n([c("audio")], u.prototype, "_audioEl", void 0), n([e({ context: t }), l()], u.prototype, "state", void 0), u = n([o("ui-audio-provider")], u);
166
166
  export { u as UiAudioProvider };
@@ -1,7 +1,7 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
- import { createMockAnalyser as t } from "../utils/audio-utils.js";
3
- import { e as n } from "../node_modules/@lit/context/lib/decorators/provide.js";
4
- import { speechContext as r } from "../utils/speech-context.js";
1
+ import { e } from "../../node_modules/@lit/context/lib/decorators/provide.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { speechContext as n } from "../../utils/speech-context.js";
4
+ import { createMockAnalyser as r } from "../../utils/audio-utils.js";
5
5
  import { LitElement as i, css as a, html as o } from "lit";
6
6
  import { customElement as s, property as c, state as l } from "lit/decorators.js";
7
7
  var u = class extends i {
@@ -45,7 +45,7 @@ var u = class extends i {
45
45
  return;
46
46
  }
47
47
  try {
48
- if (this._updateContext({ state: "connecting" }), this.simulation) this._analyser = t();
48
+ if (this._updateContext({ state: "connecting" }), this.simulation) this._analyser = r();
49
49
  else {
50
50
  this._stream = await navigator.mediaDevices.getUserMedia({ audio: !0 }), this._audioCtx ||= new (window.AudioContext || window.webkitAudioContext)();
51
51
  let e = this._audioCtx.createMediaStreamSource(this._stream);
@@ -128,5 +128,5 @@ var u = class extends i {
128
128
  return o`<slot></slot>`;
129
129
  }
130
130
  };
131
- e([n({ context: r }), l()], u.prototype, "_context", void 0), e([c({ type: String })], u.prototype, "state", void 0), e([c({ type: Boolean })], u.prototype, "simulation", void 0), e([c({ type: Boolean })], u.prototype, "manual", void 0), e([c({ type: String })], u.prototype, "transcript", void 0), e([c({ type: String })], u.prototype, "partialTranscript", void 0), u = e([s("ui-speech-provider")], u);
131
+ t([e({ context: n }), l()], u.prototype, "_context", void 0), t([c({ type: String })], u.prototype, "state", void 0), t([c({ type: Boolean })], u.prototype, "simulation", void 0), t([c({ type: Boolean })], u.prototype, "manual", void 0), t([c({ type: String })], u.prototype, "transcript", void 0), t([c({ type: String })], u.prototype, "partialTranscript", void 0), u = t([s("ui-speech-provider")], u);
132
132
  export { u as UiSpeechProvider };
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import { ScreamVoiceButton as e } from "./components/scream-voice-button.js";
2
- import { applyCanvasEdgeFade as t, createAudioAnalyser as n, createMockAnalyser as r, generateRandomAudioData as i, getNormalizedFrequencyData as a } from "./utils/audio-utils.js";
3
- import { UiLiveWaveform as o } from "./components/ui-live-waveform.js";
4
- import { UiVoiceButton as s } from "./components/ui-voice-button.js";
5
- import { UiWaveform as c } from "./components/ui-waveform.js";
6
- import { audioPlayerContext as l } from "./utils/audio-context.js";
7
- import { UiSpectrumVisualizer as u } from "./components/ui-spectrum-visualizer.js";
8
- import { UiAudioProvider as d } from "./components/ui-audio-provider.js";
9
- import { UiAudioPlayButton as f } from "./components/ui-audio-play-button.js";
10
- import { UiAudioProgressSlider as p } from "./components/ui-audio-progress-slider.js";
11
- import { UiAudioTimeDisplay as m } from "./components/ui-audio-time-display.js";
12
- import { UiAudioPlayer as h } from "./components/ui-audio-player.js";
13
- import { UiMicSelector as g } from "./components/ui-mic-selector.js";
14
- import { UiVoicePicker as _ } from "./components/ui-voice-picker.js";
15
- import { UiScrollingWaveform as v } from "./components/ui-scrolling-waveform.js";
16
- import { UiShowcaseCard as y } from "./components/ui-showcase-card.js";
17
- import { UiShimmeringText as b } from "./components/ui-shimmering-text.js";
18
- import { Ui3dFlip as x } from "./components/ui-3d-flip.js";
19
- import { UiPlaylist as S } from "./components/ui-playlist.js";
20
- import { UiAudioNextButton as C } from "./components/ui-audio-next-button.js";
21
- import { UiAudioPrevButton as w } from "./components/ui-audio-prev-button.js";
22
- import { speechContext as T } from "./utils/speech-context.js";
23
- import { UiSpeechProvider as E } from "./components/ui-speech-provider.js";
24
- import { UiSpeechRecordButton as D } from "./components/ui-speech-record-button.js";
25
- import { UiSpeechCancelButton as O } from "./components/ui-speech-cancel-button.js";
26
- import { UiSpeechPreview as k } from "./components/ui-speech-preview.js";
27
- import { UiAudioVolumeSlider as A } from "./components/ui-audio-volume-slider.js";
28
- import { UiOrb as j } from "./components/ui-orb.js";
1
+ import { audioPlayerContext as e } from "./utils/audio-context.js";
2
+ import { UiAudioPlayButton as t } from "./components/atoms/ui-audio-play-button.js";
3
+ import { UiAudioNextButton as n } from "./components/atoms/ui-audio-next-button.js";
4
+ import { UiAudioPrevButton as r } from "./components/atoms/ui-audio-prev-button.js";
5
+ import { UiAudioProgressSlider as i } from "./components/atoms/ui-audio-progress-slider.js";
6
+ import { UiAudioTimeDisplay as a } from "./components/atoms/ui-audio-time-display.js";
7
+ import { UiAudioVolumeSlider as o } from "./components/atoms/ui-audio-volume-slider.js";
8
+ import { speechContext as s } from "./utils/speech-context.js";
9
+ import { UiSpeechRecordButton as c } from "./components/atoms/ui-speech-record-button.js";
10
+ import { UiSpeechCancelButton as l } from "./components/atoms/ui-speech-cancel-button.js";
11
+ import { UiShimmeringText as u } from "./components/atoms/ui-shimmering-text.js";
12
+ import { applyCanvasEdgeFade as d, createAudioAnalyser as f, createMockAnalyser as p, generateRandomAudioData as m, getNormalizedFrequencyData as h } from "./utils/audio-utils.js";
13
+ import { UiWaveform as g } from "./components/molecules/ui-waveform.js";
14
+ import { UiLiveWaveform as _ } from "./components/molecules/ui-live-waveform.js";
15
+ import { UiScrollingWaveform as v } from "./components/molecules/ui-scrolling-waveform.js";
16
+ import { UiSpectrumVisualizer as y } from "./components/molecules/ui-spectrum-visualizer.js";
17
+ import { UiMicSelector as b } from "./components/molecules/ui-mic-selector.js";
18
+ import { UiVoicePicker as x } from "./components/molecules/ui-voice-picker.js";
19
+ import { UiSpeechPreview as S } from "./components/molecules/ui-speech-preview.js";
20
+ import { UiOrb as C } from "./components/molecules/ui-orb.js";
21
+ import { Ui3dFlip as w } from "./components/molecules/ui-3d-flip.js";
22
+ import { UiPlaylist as T } from "./components/molecules/ui-playlist.js";
23
+ import { UiShowcaseCard as E } from "./components/molecules/ui-showcase-card.js";
24
+ import { UiVoiceButton as D } from "./components/molecules/ui-voice-button.js";
25
+ import { ScreamVoiceButton as O } from "./components/molecules/scream-voice-button.js";
26
+ import { UiAudioProvider as k } from "./components/providers/ui-audio-provider.js";
27
+ import { UiAudioPlayer as A } from "./components/organisms/ui-audio-player.js";
28
+ import { UiSpeechProvider as j } from "./components/providers/ui-speech-provider.js";
29
29
  import "@material/web/icon/icon.js";
30
- export { e as ScreamVoiceButton, x as Ui3dFlip, C as UiAudioNextButton, f as UiAudioPlayButton, h as UiAudioPlayer, w as UiAudioPrevButton, p as UiAudioProgressSlider, d as UiAudioProvider, m as UiAudioTimeDisplay, A as UiAudioVolumeSlider, o as UiLiveWaveform, g as UiMicSelector, j as UiOrb, S as UiPlaylist, v as UiScrollingWaveform, b as UiShimmeringText, y as UiShowcaseCard, u as UiSpectrumVisualizer, O as UiSpeechCancelButton, k as UiSpeechPreview, E as UiSpeechProvider, D as UiSpeechRecordButton, s as UiVoiceButton, _ as UiVoicePicker, c as UiWaveform, t as applyCanvasEdgeFade, l as audioPlayerContext, n as createAudioAnalyser, r as createMockAnalyser, i as generateRandomAudioData, a as getNormalizedFrequencyData, T as speechContext };
30
+ export { O as ScreamVoiceButton, w as Ui3dFlip, n as UiAudioNextButton, t as UiAudioPlayButton, A as UiAudioPlayer, r as UiAudioPrevButton, i as UiAudioProgressSlider, k as UiAudioProvider, a as UiAudioTimeDisplay, o as UiAudioVolumeSlider, _ as UiLiveWaveform, b as UiMicSelector, C as UiOrb, T as UiPlaylist, v as UiScrollingWaveform, u as UiShimmeringText, E as UiShowcaseCard, y as UiSpectrumVisualizer, l as UiSpeechCancelButton, S as UiSpeechPreview, j as UiSpeechProvider, c as UiSpeechRecordButton, D as UiVoiceButton, x as UiVoicePicker, g as UiWaveform, d as applyCanvasEdgeFade, e as audioPlayerContext, f as createAudioAnalyser, p as createMockAnalyser, m as generateRandomAudioData, h as getNormalizedFrequencyData, s as speechContext };