@ghchinoy/lit-audio-ui 0.4.5 → 0.4.6
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/dist/components/atoms/ui-audio-next-button.js +11 -11
- package/dist/components/atoms/ui-audio-play-button.js +12 -12
- package/dist/components/atoms/ui-audio-prev-button.js +11 -11
- package/dist/components/atoms/ui-audio-progress-slider.js +11 -11
- package/dist/components/atoms/ui-audio-time-display.js +13 -13
- package/dist/components/atoms/ui-audio-volume-slider.js +11 -11
- package/dist/components/atoms/ui-speech-cancel-button.js +12 -12
- package/dist/components/atoms/ui-speech-record-button.js +11 -11
- package/dist/components/molecules/ui-playlist.js +15 -15
- package/dist/components/molecules/ui-spectrum-visualizer.js +17 -17
- package/dist/components/molecules/ui-speech-preview.js +15 -15
- package/dist/components/providers/ui-audio-provider.js +9 -9
- package/dist/components/providers/ui-speech-provider.js +11 -11
- package/dist/scream-audio-ui.umd.js +31 -31
- package/dist/utils/audio-context.js +1 -1
- package/dist/utils/speech-context.js +1 -1
- package/package.json +7 -6
- package/dist/node_modules/@lit/context/lib/context-request-event.js +0 -14
- package/dist/node_modules/@lit/context/lib/controllers/context-consumer.js +0 -26
- package/dist/node_modules/@lit/context/lib/controllers/context-provider.js +0 -34
- package/dist/node_modules/@lit/context/lib/create-context.js +0 -9
- package/dist/node_modules/@lit/context/lib/decorators/consume.js +0 -27
- package/dist/node_modules/@lit/context/lib/decorators/provide.js +0 -54
- package/dist/node_modules/@lit/context/lib/value-notifier.js +0 -37
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a } from "lit/decorators.js";
|
|
6
|
+
import { consume as o } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/icon-button.js";
|
|
8
8
|
/**
|
|
9
9
|
* Copyright 2026 Google LLC
|
|
@@ -20,16 +20,16 @@ import "@material/web/iconbutton/icon-button.js";
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License.
|
|
22
22
|
*/
|
|
23
|
-
var s = class extends
|
|
23
|
+
var s = class extends n {
|
|
24
24
|
static {
|
|
25
|
-
this.styles =
|
|
25
|
+
this.styles = r`
|
|
26
26
|
:host {
|
|
27
27
|
display: inline-block;
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return
|
|
32
|
+
return i`
|
|
33
33
|
<md-icon-button
|
|
34
34
|
?disabled=${!(this.playerState && this.playerState.items.length > 0 && (this.playerState.currentIndex < this.playerState.items.length - 1 || this.playerState.autoAdvance))}
|
|
35
35
|
@click=${() => this.playerState?.next()}
|
|
@@ -39,8 +39,8 @@ var s = class extends r {
|
|
|
39
39
|
`;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
context:
|
|
42
|
+
t([o({
|
|
43
|
+
context: e,
|
|
44
44
|
subscribe: !0
|
|
45
|
-
})], s.prototype, "playerState", void 0), s =
|
|
45
|
+
})], s.prototype, "playerState", void 0), s = t([a("ui-audio-next-button")], s);
|
|
46
46
|
export { s as UiAudioNextButton };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { consume as s } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/filled-icon-button.js";
|
|
8
8
|
import "@material/web/progress/circular-progress.js";
|
|
9
|
-
var c = class extends
|
|
9
|
+
var c = class extends n {
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = r`
|
|
12
12
|
:host {
|
|
13
13
|
display: inline-flex;
|
|
14
14
|
position: relative;
|
|
@@ -62,7 +62,7 @@ var c = class extends r {
|
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
64
|
let e = this.playerState?.isPlaying ?? !1, t = this.playerState?.isBuffering ?? !1;
|
|
65
|
-
return
|
|
65
|
+
return i`
|
|
66
66
|
<md-filled-icon-button
|
|
67
67
|
part="button"
|
|
68
68
|
@click="${this._handleClick}"
|
|
@@ -70,15 +70,15 @@ var c = class extends r {
|
|
|
70
70
|
>
|
|
71
71
|
<md-icon>${e ? "pause" : "play_arrow"}</md-icon>
|
|
72
72
|
</md-filled-icon-button>
|
|
73
|
-
${t && e ?
|
|
73
|
+
${t && e ? i`<md-circular-progress indeterminate></md-circular-progress>` : ""}
|
|
74
74
|
`;
|
|
75
75
|
}
|
|
76
76
|
_handleClick() {
|
|
77
77
|
this.playerState && this.playerState.togglePlay();
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
context:
|
|
80
|
+
t([s({
|
|
81
|
+
context: e,
|
|
82
82
|
subscribe: !0
|
|
83
|
-
}),
|
|
83
|
+
}), o({ attribute: !1 })], c.prototype, "playerState", void 0), c = t([a("ui-audio-play-button")], c);
|
|
84
84
|
export { c as UiAudioPlayButton };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a } from "lit/decorators.js";
|
|
6
|
+
import { consume as o } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/icon-button.js";
|
|
8
8
|
/**
|
|
9
9
|
* Copyright 2026 Google LLC
|
|
@@ -20,16 +20,16 @@ import "@material/web/iconbutton/icon-button.js";
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License.
|
|
22
22
|
*/
|
|
23
|
-
var s = class extends
|
|
23
|
+
var s = class extends n {
|
|
24
24
|
static {
|
|
25
|
-
this.styles =
|
|
25
|
+
this.styles = r`
|
|
26
26
|
:host {
|
|
27
27
|
display: inline-block;
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return
|
|
32
|
+
return i`
|
|
33
33
|
<md-icon-button
|
|
34
34
|
?disabled=${!(this.playerState && this.playerState.items.length > 0 && (this.playerState.currentIndex > 0 || this.playerState.autoAdvance))}
|
|
35
35
|
@click=${() => this.playerState?.previous()}
|
|
@@ -39,8 +39,8 @@ var s = class extends r {
|
|
|
39
39
|
`;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
context:
|
|
42
|
+
t([o({
|
|
43
|
+
context: e,
|
|
44
44
|
subscribe: !0
|
|
45
|
-
})], s.prototype, "playerState", void 0), s =
|
|
45
|
+
})], s.prototype, "playerState", void 0), s = t([a("ui-audio-prev-button")], s);
|
|
46
46
|
export { s as UiAudioPrevButton };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
3
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
4
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
5
|
+
import { consume as s } from "@lit/context";
|
|
6
6
|
import "@material/web/slider/slider.js";
|
|
7
|
-
var c = class extends
|
|
7
|
+
var c = class extends n {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this._isDragging = !1, this._dragValue = 0;
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.styles =
|
|
12
|
+
this.styles = r`
|
|
13
13
|
:host {
|
|
14
14
|
display: flex;
|
|
15
15
|
width: 100%;
|
|
@@ -26,7 +26,7 @@ var c = class extends r {
|
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
28
|
let e = this.playerState?.duration || 0, t = e === 0 || !this.playerState?.src, n = this._isDragging ? this._dragValue : this.playerState?.currentTime || 0;
|
|
29
|
-
return
|
|
29
|
+
return i`
|
|
30
30
|
<md-slider
|
|
31
31
|
min="0"
|
|
32
32
|
max="${e || 100}"
|
|
@@ -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
|
+
t([s({
|
|
49
|
+
context: e,
|
|
50
50
|
subscribe: !0
|
|
51
|
-
}),
|
|
51
|
+
}), o({ attribute: !1 })], c.prototype, "playerState", void 0), c = t([a("ui-audio-progress-slider")], c);
|
|
52
52
|
export { c as UiAudioProgressSlider };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var c = class extends
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
3
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
4
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
5
|
+
import { consume as s } from "@lit/context";
|
|
6
|
+
var c = class extends n {
|
|
7
7
|
constructor(...e) {
|
|
8
8
|
super(...e), this.format = "combined", this.separator = " / ", this.compact = !1;
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = r`
|
|
12
12
|
:host {
|
|
13
13
|
display: inline-block;
|
|
14
14
|
font-variant-numeric: tabular-nums;
|
|
@@ -20,11 +20,11 @@ var c = class extends r {
|
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
let e = this.playerState?.currentTime || 0, t = this.playerState?.duration || 0;
|
|
23
|
-
if (this.format === "elapsed") return
|
|
23
|
+
if (this.format === "elapsed") return i`${this._formatTime(e)}`;
|
|
24
24
|
if (this.format === "remaining") {
|
|
25
25
|
let n = Math.max(0, t - e);
|
|
26
|
-
return
|
|
27
|
-
} else return
|
|
26
|
+
return i`-${this._formatTime(n)}`;
|
|
27
|
+
} else return i`${this._formatTime(e)}${this.separator}${t ? this._formatTime(t) : "--:--"}`;
|
|
28
28
|
}
|
|
29
29
|
_formatTime(e) {
|
|
30
30
|
if (!e || isNaN(e)) return this.compact, "0:00";
|
|
@@ -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
|
+
t([s({
|
|
36
|
+
context: e,
|
|
37
37
|
subscribe: !0
|
|
38
|
-
}),
|
|
38
|
+
}), o({ attribute: !1 })], c.prototype, "playerState", void 0), t([o({ type: String })], c.prototype, "format", void 0), t([o({ type: String })], c.prototype, "separator", void 0), t([o({ type: Boolean })], c.prototype, "compact", void 0), c = t([a("ui-audio-time-display")], c);
|
|
39
39
|
export { c as UiAudioTimeDisplay };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { consume as s } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/icon-button.js";
|
|
8
8
|
import "@material/web/slider/slider.js";
|
|
9
|
-
var c = class extends
|
|
9
|
+
var c = class extends n {
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = r`
|
|
12
12
|
:host {
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
@@ -34,7 +34,7 @@ var c = class extends r {
|
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
36
|
let e = this.playerState?.volume ?? 1, t = this.playerState?.muted ?? !1, n = "volume_up";
|
|
37
|
-
return t || e === 0 ? n = "volume_off" : e < .5 && (n = "volume_down"),
|
|
37
|
+
return t || e === 0 ? n = "volume_off" : e < .5 && (n = "volume_down"), i`
|
|
38
38
|
<md-icon-button @click="${this._toggleMute}" part="button">
|
|
39
39
|
<md-icon>${n}</md-icon>
|
|
40
40
|
</md-icon-button>
|
|
@@ -57,8 +57,8 @@ var c = class extends r {
|
|
|
57
57
|
this.playerState && this.playerState.toggleMute();
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
context:
|
|
60
|
+
t([s({
|
|
61
|
+
context: e,
|
|
62
62
|
subscribe: !0
|
|
63
|
-
}),
|
|
63
|
+
}), o({ attribute: !1 })], c.prototype, "playerState", void 0), c = t([a("ui-audio-volume-slider")], c);
|
|
64
64
|
export { c as UiAudioVolumeSlider };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { speechContext as n } from "../../utils/speech-context.js";
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
2
|
+
import { speechContext as t } from "../../utils/speech-context.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a } from "lit/decorators.js";
|
|
6
|
+
import { consume as o } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/icon-button.js";
|
|
8
|
-
var s = class extends
|
|
8
|
+
var s = class extends n {
|
|
9
9
|
static {
|
|
10
|
-
this.styles =
|
|
10
|
+
this.styles = r`
|
|
11
11
|
:host {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
opacity: 0;
|
|
@@ -30,18 +30,18 @@ var s = class extends r {
|
|
|
30
30
|
`;
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return this._context ? (this._context.state === "recording" || this._context.state === "processing" || this._context.state === "error" ? this.setAttribute("active", "") : this.removeAttribute("active"),
|
|
33
|
+
return this._context ? (this._context.state === "recording" || this._context.state === "processing" || this._context.state === "error" ? this.setAttribute("active", "") : this.removeAttribute("active"), i`
|
|
34
34
|
<md-icon-button @click=${this._handleClick}>
|
|
35
35
|
<md-icon>close</md-icon>
|
|
36
36
|
</md-icon-button>
|
|
37
|
-
`) :
|
|
37
|
+
`) : i``;
|
|
38
38
|
}
|
|
39
39
|
_handleClick() {
|
|
40
40
|
this._context?.cancel();
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
context:
|
|
43
|
+
e([o({
|
|
44
|
+
context: t,
|
|
45
45
|
subscribe: !0
|
|
46
|
-
})], s.prototype, "_context", void 0), s =
|
|
46
|
+
})], s.prototype, "_context", void 0), s = e([a("ui-speech-cancel-button")], s);
|
|
47
47
|
export { s as UiSpeechCancelButton };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { speechContext as n } from "../../utils/speech-context.js";
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
2
|
+
import { speechContext as t } from "../../utils/speech-context.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { consume as s } from "@lit/context";
|
|
7
7
|
import "@material/web/iconbutton/filled-icon-button.js";
|
|
8
|
-
var c = class extends
|
|
8
|
+
var c = class extends n {
|
|
9
9
|
constructor(...e) {
|
|
10
10
|
super(...e), this.size = "default";
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = r`
|
|
14
14
|
:host {
|
|
15
15
|
display: inline-block;
|
|
16
16
|
}
|
|
@@ -60,7 +60,7 @@ var c = class extends r {
|
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
62
|
let e = this._context?.state || "idle", t = e === "recording", n = e === "processing" || e === "connecting", r = "mic";
|
|
63
|
-
return t && (r = "stop"), n && (r = "hourglass_empty"), e === "success" && (r = "check"), e === "error" && (r = "error"),
|
|
63
|
+
return t && (r = "stop"), n && (r = "hourglass_empty"), e === "success" && (r = "check"), e === "error" && (r = "error"), i`
|
|
64
64
|
<md-filled-icon-button
|
|
65
65
|
class="${e}"
|
|
66
66
|
?disabled=${n || !this._context}
|
|
@@ -74,8 +74,8 @@ var c = class extends r {
|
|
|
74
74
|
this._context && (this._context.state === "idle" ? this._context.start() : this._context.state === "recording" && this._context.stop());
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
context:
|
|
77
|
+
e([s({
|
|
78
|
+
context: t,
|
|
79
79
|
subscribe: !0
|
|
80
|
-
})], c.prototype, "_context", void 0),
|
|
80
|
+
})], c.prototype, "_context", void 0), e([o({ type: String })], c.prototype, "size", void 0), c = e([a("ui-speech-record-button")], c);
|
|
81
81
|
export { c as UiSpeechRecordButton };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
4
3
|
import "@material/web/icon/icon.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { consume as s } from "@lit/context";
|
|
7
7
|
import "@material/web/list/list.js";
|
|
8
8
|
import "@material/web/list/list-item.js";
|
|
9
9
|
/**
|
|
@@ -21,12 +21,12 @@ import "@material/web/list/list-item.js";
|
|
|
21
21
|
* See the License for the specific language governing permissions and
|
|
22
22
|
* limitations under the License.
|
|
23
23
|
*/
|
|
24
|
-
var c = class extends
|
|
24
|
+
var c = class extends n {
|
|
25
25
|
constructor(...e) {
|
|
26
26
|
super(...e), this.header = "Queue", this.emptyText = "No tracks in queue";
|
|
27
27
|
}
|
|
28
28
|
static {
|
|
29
|
-
this.styles =
|
|
29
|
+
this.styles = r`
|
|
30
30
|
:host {
|
|
31
31
|
display: block;
|
|
32
32
|
background: var(--md-sys-color-surface-container-low, transparent);
|
|
@@ -80,21 +80,21 @@ var c = class extends r {
|
|
|
80
80
|
}
|
|
81
81
|
render() {
|
|
82
82
|
let e = this.playerState?.items || [], t = this.playerState?.currentIndex ?? -1;
|
|
83
|
-
return
|
|
83
|
+
return i`
|
|
84
84
|
<div class="playlist-header">${this.header}</div>
|
|
85
85
|
|
|
86
|
-
${e.length === 0 ?
|
|
86
|
+
${e.length === 0 ? i`<div class="empty-state">${this.emptyText}</div>` : i`
|
|
87
87
|
<md-list>
|
|
88
|
-
${e.map((e, n) =>
|
|
88
|
+
${e.map((e, n) => i`
|
|
89
89
|
<md-list-item
|
|
90
90
|
?selected=${n === t}
|
|
91
91
|
@click=${() => this.playerState?.select(n)}
|
|
92
92
|
>
|
|
93
93
|
<div slot="headline">${e.title || "Untitled Track"}</div>
|
|
94
94
|
<div slot="supporting-text">${e.artist || "Unknown Artist"}</div>
|
|
95
|
-
${n === t ?
|
|
95
|
+
${n === t ? i`<md-icon slot="start" class="now-playing-icon"
|
|
96
96
|
>${this.playerState?.isPlaying ? "graphic_eq" : "play_arrow"}</md-icon
|
|
97
|
-
>` :
|
|
97
|
+
>` : i`<md-icon slot="start">music_note</md-icon>`}
|
|
98
98
|
</md-list-item>
|
|
99
99
|
`)}
|
|
100
100
|
</md-list>
|
|
@@ -102,8 +102,8 @@ var c = class extends r {
|
|
|
102
102
|
`;
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
context:
|
|
105
|
+
t([s({
|
|
106
|
+
context: e,
|
|
107
107
|
subscribe: !0
|
|
108
|
-
})], c.prototype, "playerState", void 0),
|
|
108
|
+
})], c.prototype, "playerState", void 0), t([o({ type: String })], c.prototype, "header", void 0), t([o({ type: String })], c.prototype, "emptyText", void 0), c = t([a("ui-playlist")], c);
|
|
109
109
|
export { c as UiPlaylist };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
3
|
+
import { getNormalizedFrequencyData as n } from "../../utils/audio-utils.js";
|
|
4
|
+
import { LitElement as r, css as i, html as a } from "lit";
|
|
5
|
+
import { customElement as o, property as s, query as c } from "lit/decorators.js";
|
|
6
|
+
import { consume as l } from "@lit/context";
|
|
7
7
|
/**
|
|
8
8
|
* Copyright 2026 Google LLC
|
|
9
9
|
*
|
|
@@ -19,12 +19,12 @@ import { customElement as s, property as c, query as l } from "lit/decorators.js
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var u = class extends
|
|
22
|
+
var u = class extends r {
|
|
23
23
|
constructor(...e) {
|
|
24
24
|
super(...e), this.barWidth = 4, this.barGap = 2, this.height = 100, this._animationFrameId = 0;
|
|
25
25
|
}
|
|
26
26
|
static {
|
|
27
|
-
this.styles =
|
|
27
|
+
this.styles = i`
|
|
28
28
|
:host {
|
|
29
29
|
display: block;
|
|
30
30
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ var u = class extends i {
|
|
|
38
38
|
`;
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return
|
|
41
|
+
return a`<canvas style="height: ${this.height}px;"></canvas>`;
|
|
42
42
|
}
|
|
43
43
|
firstUpdated() {
|
|
44
44
|
this._startLoop();
|
|
@@ -58,18 +58,18 @@ var u = class extends i {
|
|
|
58
58
|
this._dataArray ||= new Uint8Array(e.frequencyBinCount);
|
|
59
59
|
let t = this._canvas.getContext("2d");
|
|
60
60
|
if (!t) return;
|
|
61
|
-
let
|
|
62
|
-
this._canvas.width !==
|
|
63
|
-
let a =
|
|
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, t.scale(i, i)), t.clearRect(0, 0, r.width, r.height);
|
|
63
|
+
let a = n(e, this._dataArray), o = this.barWidth + this.barGap, s = Math.floor(r.width / o), c = getComputedStyle(this), l = this.color;
|
|
64
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
|
-
t.fillRect(i, c, this.barWidth,
|
|
66
|
+
let n = (a[Math.floor(e / s * (a.length * .6))] || 0) * r.height, i = e * o, c = r.height - n;
|
|
67
|
+
t.fillRect(i, c, this.barWidth, n);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
context:
|
|
71
|
+
t([l({
|
|
72
|
+
context: e,
|
|
73
73
|
subscribe: !0
|
|
74
|
-
})], u.prototype, "playerState", void 0),
|
|
74
|
+
})], u.prototype, "playerState", void 0), t([s({ type: Number })], u.prototype, "barWidth", void 0), t([s({ type: Number })], u.prototype, "barGap", void 0), t([s({ type: Number })], u.prototype, "height", void 0), t([s({ type: String })], u.prototype, "color", void 0), t([c("canvas")], u.prototype, "_canvas", void 0), u = t([o("ui-spectrum-visualizer")], u);
|
|
75
75
|
export { u as UiSpectrumVisualizer };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { speechContext as n } from "../../utils/speech-context.js";
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
2
|
+
import { speechContext as t } from "../../utils/speech-context.js";
|
|
4
3
|
import "./ui-live-waveform.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { customElement as
|
|
7
|
-
|
|
4
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { consume as s } from "@lit/context";
|
|
7
|
+
var c = class extends n {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.placeholder = "Jot down some thoughts...";
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.styles =
|
|
12
|
+
this.styles = r`
|
|
13
13
|
:host {
|
|
14
14
|
display: inline-flex;
|
|
15
15
|
align-items: center;
|
|
@@ -53,15 +53,15 @@ var c = class extends r {
|
|
|
53
53
|
`;
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
let { state: e = "idle", transcript: t = "", partialTranscript: n = "", analyserNode: r = void 0 } = this._context || {},
|
|
57
|
-
return
|
|
58
|
-
${!
|
|
56
|
+
let { state: e = "idle", transcript: t = "", partialTranscript: n = "", analyserNode: r = void 0 } = this._context || {}, a = e === "recording", o = e === "processing" || e === "connecting";
|
|
57
|
+
return i`
|
|
58
|
+
${!a && !o && !(t || n) ? i`<span class="placeholder">${this.placeholder}</span>` : i`<span class="transcript">${n || t}</span>`}
|
|
59
59
|
|
|
60
60
|
<div
|
|
61
|
-
class="waveform-container ${
|
|
61
|
+
class="waveform-container ${a || o ? "" : "hidden"}"
|
|
62
62
|
>
|
|
63
63
|
<ui-live-waveform
|
|
64
|
-
.active=${
|
|
64
|
+
.active=${a}
|
|
65
65
|
.processing=${o}
|
|
66
66
|
.analyserNode=${r}
|
|
67
67
|
barWidth="2"
|
|
@@ -73,8 +73,8 @@ var c = class extends r {
|
|
|
73
73
|
`;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
77
|
-
context:
|
|
76
|
+
e([s({
|
|
77
|
+
context: t,
|
|
78
78
|
subscribe: !0
|
|
79
|
-
})], c.prototype, "_context", void 0),
|
|
79
|
+
})], c.prototype, "_context", void 0), e([o({ type: String })], c.prototype, "placeholder", void 0), c = e([a("ui-speech-preview")], c);
|
|
80
80
|
export { c as UiSpeechPreview };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { e } from "../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var u = class extends
|
|
1
|
+
import { audioPlayerContext as e } from "../../utils/audio-context.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
|
|
3
|
+
import { LitElement as n, css as r, html as i } from "lit";
|
|
4
|
+
import { customElement as a, property as o, query as s, state as c } from "lit/decorators.js";
|
|
5
|
+
import { provide as l } from "@lit/context";
|
|
6
|
+
var u = class extends n {
|
|
7
7
|
constructor(...e) {
|
|
8
8
|
super(...e), this.src = "", this.items = [], this.autoAdvance = !0, this._animationFrameId = 0, this.state = {
|
|
9
9
|
src: "",
|
|
@@ -29,7 +29,7 @@ var u = class extends r {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
static {
|
|
32
|
-
this.styles =
|
|
32
|
+
this.styles = r`
|
|
33
33
|
:host {
|
|
34
34
|
display: contents; /* We are completely invisible, just wrapping children */
|
|
35
35
|
}
|
|
@@ -39,7 +39,7 @@ var u = class extends r {
|
|
|
39
39
|
`;
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return
|
|
42
|
+
return i`
|
|
43
43
|
<audio
|
|
44
44
|
crossorigin="anonymous"
|
|
45
45
|
src="${this.src}"
|
|
@@ -162,5 +162,5 @@ var u = class extends r {
|
|
|
162
162
|
this._animationFrameId = requestAnimationFrame(e);
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
|
-
|
|
165
|
+
t([o({ type: String })], u.prototype, "src", void 0), t([o({ type: Array })], u.prototype, "items", void 0), t([o({ type: Boolean })], u.prototype, "autoAdvance", void 0), t([s("audio")], u.prototype, "_audioEl", void 0), t([l({ context: e }), c()], u.prototype, "state", void 0), u = t([a("ui-audio-provider")], u);
|
|
166
166
|
export { u as UiAudioProvider };
|