@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.
- package/AGENT_SKILL.md +50 -0
- package/dist/components/{ui-audio-next-button.js → atoms/ui-audio-next-button.js} +6 -6
- package/dist/components/{ui-audio-play-button.js → atoms/ui-audio-play-button.js} +6 -6
- package/dist/components/{ui-audio-prev-button.js → atoms/ui-audio-prev-button.js} +6 -6
- package/dist/components/{ui-audio-progress-slider.js → atoms/ui-audio-progress-slider.js} +6 -6
- package/dist/components/{ui-audio-time-display.js → atoms/ui-audio-time-display.js} +6 -6
- package/dist/components/{ui-audio-volume-slider.js → atoms/ui-audio-volume-slider.js} +7 -7
- package/dist/components/{ui-shimmering-text.js → atoms/ui-shimmering-text.js} +1 -1
- package/dist/components/{ui-speech-cancel-button.js → atoms/ui-speech-cancel-button.js} +5 -5
- package/dist/components/{ui-speech-record-button.js → atoms/ui-speech-record-button.js} +5 -5
- package/dist/components/{scream-voice-button.js → molecules/scream-voice-button.js} +1 -1
- package/dist/components/{ui-3d-flip.js → molecules/ui-3d-flip.js} +1 -1
- package/dist/components/{ui-live-waveform.js → molecules/ui-live-waveform.js} +2 -2
- package/dist/components/{ui-mic-selector.js → molecules/ui-mic-selector.js} +1 -1
- package/dist/components/{ui-orb.js → molecules/ui-orb.js} +1 -1
- package/dist/components/{ui-playlist.js → molecules/ui-playlist.js} +11 -8
- package/dist/components/{ui-scrolling-waveform.js → molecules/ui-scrolling-waveform.js} +2 -2
- package/dist/components/{ui-showcase-card.js → molecules/ui-showcase-card.js} +1 -1
- package/dist/components/{ui-spectrum-visualizer.js → molecules/ui-spectrum-visualizer.js} +15 -15
- package/dist/components/{ui-speech-preview.js → molecules/ui-speech-preview.js} +5 -5
- package/dist/components/{ui-voice-button.js → molecules/ui-voice-button.js} +3 -3
- package/dist/components/{ui-voice-picker.js → molecules/ui-voice-picker.js} +2 -2
- package/dist/components/{ui-waveform.js → molecules/ui-waveform.js} +2 -2
- package/dist/components/{ui-audio-player.js → organisms/ui-audio-player.js} +5 -5
- package/dist/components/{ui-audio-provider.js → providers/ui-audio-provider.js} +4 -4
- package/dist/components/{ui-speech-provider.js → providers/ui-speech-provider.js} +6 -6
- package/dist/index.js +29 -29
- package/dist/scream-audio-ui.umd.js +876 -873
- 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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
43
|
-
context:
|
|
42
|
+
n([e({
|
|
43
|
+
context: t,
|
|
44
44
|
subscribe: !0
|
|
45
|
-
})], s.prototype, "playerState", void 0), 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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
81
|
-
context:
|
|
80
|
+
n([e({
|
|
81
|
+
context: t,
|
|
82
82
|
subscribe: !0
|
|
83
|
-
}), s({ attribute: !1 })], c.prototype, "playerState", void 0), 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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
43
|
-
context:
|
|
42
|
+
n([e({
|
|
43
|
+
context: t,
|
|
44
44
|
subscribe: !0
|
|
45
|
-
})], s.prototype, "playerState", void 0), 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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
49
|
-
context:
|
|
48
|
+
n([e({
|
|
49
|
+
context: t,
|
|
50
50
|
subscribe: !0
|
|
51
|
-
}), s({ attribute: !1 })], c.prototype, "playerState", void 0), 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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
36
|
-
context:
|
|
35
|
+
n([e({
|
|
36
|
+
context: t,
|
|
37
37
|
subscribe: !0
|
|
38
|
-
}), s({ attribute: !1 })], c.prototype, "playerState", void 0),
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
61
|
-
context:
|
|
60
|
+
n([e({
|
|
61
|
+
context: t,
|
|
62
62
|
subscribe: !0
|
|
63
|
-
}), s({ attribute: !1 })], c.prototype, "playerState", void 0), 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 "
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { speechContext as n } from "
|
|
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
|
-
|
|
43
|
+
t([e({
|
|
44
44
|
context: n,
|
|
45
45
|
subscribe: !0
|
|
46
|
-
})], s.prototype, "_context", void 0), 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 {
|
|
2
|
-
import {
|
|
3
|
-
import { speechContext as n } from "
|
|
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
|
-
|
|
78
|
+
t([e({
|
|
79
79
|
context: n,
|
|
80
80
|
subscribe: !0
|
|
81
|
-
})], c.prototype, "_context", void 0),
|
|
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 "
|
|
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 "
|
|
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 "
|
|
2
|
-
import { applyCanvasEdgeFade as t, getNormalizedFrequencyData as n } from "
|
|
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 "
|
|
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 "
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
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
|
-
|
|
103
|
-
context:
|
|
105
|
+
n([e({
|
|
106
|
+
context: t,
|
|
104
107
|
subscribe: !0
|
|
105
|
-
})], c.prototype, "playerState", void 0),
|
|
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 "
|
|
2
|
-
import { applyCanvasEdgeFade as t } from "
|
|
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 "
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
60
|
-
if (!
|
|
61
|
-
let
|
|
62
|
-
this._canvas.width !==
|
|
63
|
-
let a =
|
|
64
|
-
l ||= c.getPropertyValue("--md-sys-color-primary").trim() || "#0066cc",
|
|
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
|
|
67
|
-
|
|
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
|
-
|
|
72
|
-
context:
|
|
71
|
+
n([e({
|
|
72
|
+
context: t,
|
|
73
73
|
subscribe: !0
|
|
74
|
-
})], u.prototype, "playerState", void 0),
|
|
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 {
|
|
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
|
-
|
|
77
|
+
t([e({
|
|
78
78
|
context: n,
|
|
79
79
|
subscribe: !0
|
|
80
|
-
})], c.prototype, "_context", void 0),
|
|
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 "
|
|
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 "
|
|
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 "
|
|
2
|
-
import { applyCanvasEdgeFade as t } from "
|
|
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 "
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 =
|
|
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
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { UiScrollingWaveform as v } from "./components/ui-scrolling-waveform.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
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 {
|
|
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 };
|