@molecule/app-audio-player-solid 0.0.0-stage → 1.1.0

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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,142 @@
1
- # Temporary Holding Version
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-16T18:56:36.561Z
7
+ -->
2
8
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
9
+ # @molecule/app-audio-player-solid
10
+
11
+ Solid HTML5 audio player chrome — play/pause, scrub bar, elapsed/total time,
12
+ and a mute toggle, over a hidden `<audio>` element. Use for podcasts,
13
+ voice notes, music previews, narrated lessons.
14
+
15
+ Exports `<AudioPlayer>` — the Solid counterpart of
16
+ `@molecule/app-audio-player-react`: the same props (React names) and the
17
+ same DOM for the same input.
18
+
19
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
20
+ > It is written to be read by coding agents as much as by people, and is generated from this
21
+ > package's source — edit `src/index.ts` JSDoc, not this file.
22
+
23
+ ## Quick Start
24
+
25
+ ```tsx
26
+ import { AudioPlayer } from '@molecule/app-audio-player-solid'
27
+
28
+ export function Player() {
29
+ return (
30
+ <AudioPlayer
31
+ src="/audio/episode-42.mp3"
32
+ title="Episode 42: Getting Started"
33
+ subtitle="The Molecule Podcast"
34
+ onPlay={() => console.log('playing')}
35
+ onEnded={() => console.log('finished')}
36
+ />
37
+ )
38
+ }
39
+ ```
40
+
41
+ ## Type
42
+
43
+ `feature`
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ npm install @molecule/app-audio-player-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
49
+ ```
50
+
51
+ ## API
52
+
53
+ ### Interfaces
54
+
55
+ #### `AudioPlayerProps`
56
+
57
+ Props accepted by the {@link AudioPlayer} component.
58
+
59
+ ```typescript
60
+ interface AudioPlayerProps {
61
+ /** Audio source URL (a file, a stream or a data URI). */
62
+ src: string
63
+ /** Optional title / track name. */
64
+ title?: JSX.Element
65
+ /** Optional artist / source label. */
66
+ subtitle?: JSX.Element
67
+ /** Optional waveform / visualizer slot rendered above the controls. */
68
+ visualizer?: JSX.Element
69
+ /**
70
+ * WebVTT captions file URL. When set, the player loads it on the media
71
+ * element's captions `<track>` and shows the current caption under the
72
+ * controls, in a polite live region that screen readers announce. Without
73
+ * it the track is empty and no caption line is shown.
74
+ */
75
+ captions?: string
76
+ /** BCP 47 language of the captions (the track's `srclang`). */
77
+ captionsLang?: string
78
+ /**
79
+ * Human-readable name of the captions track. Defaults through i18n
80
+ * (`audio.captions`, English "Captions").
81
+ */
82
+ captionsLabel?: string
83
+ /** Initial muted state. */
84
+ defaultMuted?: boolean
85
+ /** Autoplay (browser may block). Passed to the `<audio>` element. */
86
+ autoPlay?: boolean
87
+ /** Called when the media starts playing. */
88
+ onPlay?: () => void
89
+ /** Called when the media is paused. */
90
+ onPause?: () => void
91
+ /** Called when the media reaches its end. */
92
+ onEnded?: () => void
93
+ /** Extra classes on the outer wrapper. */
94
+ className?: string
95
+ }
96
+ ```
97
+
98
+ ### Functions
99
+
100
+ #### `AudioPlayer(props)`
101
+
102
+ HTML5 audio player chrome — play/pause, scrub, time, mute, optional
103
+ visualizer slot. Use for podcasts, voice notes, music previews, narrated
104
+ lessons.
105
+
106
+ ```typescript
107
+ function AudioPlayer(props: AudioPlayerProps): JSX.Element
108
+ ```
109
+
110
+ - `props` — Component props (see {@link AudioPlayerProps}).
111
+
112
+ **Returns:** The rendered audio player.
113
+
114
+ ## Injection Notes
115
+
116
+ ### Requirements
117
+
118
+ Peer dependencies:
119
+
120
+ - `@molecule/app-solid` ^3.5.0
121
+ - `@molecule/app-ui` ^1.0.1
122
+ - `@molecule/app-ui-solid` ^1.1.0
123
+ - `solid-js` ^1.8.0
124
+
125
+ ### Runtime Dependencies
126
+
127
+ - `@molecule/app-solid`
128
+ - `@molecule/app-ui`
129
+ - `@molecule/app-ui-solid`
130
+ - `solid-js`
131
+
132
+ There is NO volume slider — only a mute toggle; and no playback-rate
133
+ or skip controls. The optional `visualizer` prop is a free-form node
134
+ slot rendered above the controls (bring your own waveform). `autoPlay` is
135
+ passed to the `<audio>` element and is routinely blocked by browsers until
136
+ user interaction — never rely on it. Duration renders `0:00` until
137
+ `loadedmetadata` fires (`preload="metadata"`). Translations come from the
138
+ companion `@molecule/app-locales-audio-player` locale bond.
139
+
140
+ ## Translations
141
+
142
+ Translation strings are provided by `@molecule/app-locales-audio-player`.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Solid HTML5 audio player: play/pause, scrub bar, elapsed/total time and a
3
+ * mute toggle, over a hidden `<audio>` element.
4
+ *
5
+ * Solid counterpart of `@molecule/app-audio-player-react`'s `AudioPlayer` —
6
+ * the same props (React names), the same DOM for the same input, and the same
7
+ * callbacks.
8
+ *
9
+ * @module
10
+ */
11
+ import { type Component } from 'solid-js';
12
+ import type { AudioPlayerProps } from './types.js';
13
+ /**
14
+ * HTML5 audio player chrome — play/pause, scrub, time, mute, optional
15
+ * visualizer slot. Use for podcasts, voice notes, music previews, narrated
16
+ * lessons.
17
+ *
18
+ * @param props - Component props (see {@link AudioPlayerProps}).
19
+ * @returns The rendered audio player.
20
+ */
21
+ export declare const AudioPlayer: Component<AudioPlayerProps>;
22
+ //# sourceMappingURL=AudioPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../src/AudioPlayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAwD,MAAM,UAAU,CAAA;AAM/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAelD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,gBAAgB,CA4LnD,CAAA"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Solid HTML5 audio player: play/pause, scrub bar, elapsed/total time and a
3
+ * mute toggle, over a hidden `<audio>` element.
4
+ *
5
+ * Solid counterpart of `@molecule/app-audio-player-react`'s `AudioPlayer` —
6
+ * the same props (React names), the same DOM for the same input, and the same
7
+ * callbacks.
8
+ *
9
+ * @module
10
+ */
11
+ import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';
12
+ import { useTranslation } from '@molecule/app-solid';
13
+ import { getClassMap } from '@molecule/app-ui';
14
+ import { Button } from '@molecule/app-ui-solid';
15
+ /**
16
+ * Formats a duration in seconds as M:SS (90 → `1:30`), React's `fmt`.
17
+ *
18
+ * @param s - The duration in seconds.
19
+ * @returns The formatted time.
20
+ */
21
+ function fmt(s) {
22
+ if (!isFinite(s))
23
+ return '0:00';
24
+ const m = Math.floor(s / 60);
25
+ const sec = Math.floor(s % 60);
26
+ return `${m}:${String(sec).padStart(2, '0')}`;
27
+ }
28
+ /**
29
+ * HTML5 audio player chrome — play/pause, scrub, time, mute, optional
30
+ * visualizer slot. Use for podcasts, voice notes, music previews, narrated
31
+ * lessons.
32
+ *
33
+ * @param props - Component props (see {@link AudioPlayerProps}).
34
+ * @returns The rendered audio player.
35
+ */
36
+ export const AudioPlayer = (props) => {
37
+ const cm = getClassMap();
38
+ const { t } = useTranslation();
39
+ let audio;
40
+ // React's `useState(!!autoPlay)` / `useState(!!defaultMuted)`: captured once,
41
+ // at mount — a later prop change does not reset them.
42
+ const [playing, setPlaying] = createSignal(!!props.autoPlay);
43
+ const [muted, setMuted] = createSignal(!!props.defaultMuted);
44
+ const [duration, setDuration] = createSignal(0);
45
+ const [current, setCurrent] = createSignal(0);
46
+ let trackElement;
47
+ const [caption, setCaption] = createSignal('');
48
+ // The <audio> element is hidden behind the custom controls, so the browser
49
+ // paints no captions: the track is set to `hidden` (it still fires
50
+ // `cuechange`) and the player shows the active cue text itself. The effect
51
+ // re-runs when `captions` changes; its cleanup removes the listener and
52
+ // clears the caption.
53
+ createEffect(() => {
54
+ const textTrack = trackElement?.track;
55
+ if (!props.captions || !textTrack) {
56
+ setCaption('');
57
+ return;
58
+ }
59
+ textTrack.mode = 'hidden';
60
+ const onCue = () => {
61
+ const cues = textTrack.activeCues ? Array.from(textTrack.activeCues) : [];
62
+ setCaption(cues.map((cue) => ('text' in cue ? String(cue.text) : '')).join('\n'));
63
+ };
64
+ textTrack.addEventListener('cuechange', onCue);
65
+ onCleanup(() => {
66
+ textTrack.removeEventListener('cuechange', onCue);
67
+ setCaption('');
68
+ });
69
+ });
70
+ /** Reads the position from the media element (React's `timeupdate`). */
71
+ const onTimeUpdate = () => {
72
+ if (audio)
73
+ setCurrent(audio.currentTime);
74
+ };
75
+ /** Reads the duration from the media element (React's `loadedmetadata`). */
76
+ const onLoadedMetadata = () => {
77
+ if (audio)
78
+ setDuration(audio.duration);
79
+ };
80
+ /** Marks the player as playing and calls `onPlay` (React's `play`). */
81
+ const onPlayEvent = () => {
82
+ setPlaying(true);
83
+ props.onPlay?.();
84
+ };
85
+ /** Marks the player as paused and calls `onPause` (React's `pause`). */
86
+ const onPauseEvent = () => {
87
+ setPlaying(false);
88
+ props.onPause?.();
89
+ };
90
+ /** Marks the player as paused and calls `onEnded` (React's `ended`). */
91
+ const onEndedEvent = () => {
92
+ setPlaying(false);
93
+ props.onEnded?.();
94
+ };
95
+ onMount(() => {
96
+ if (!audio)
97
+ return;
98
+ audio.addEventListener('timeupdate', onTimeUpdate);
99
+ audio.addEventListener('loadedmetadata', onLoadedMetadata);
100
+ audio.addEventListener('play', onPlayEvent);
101
+ audio.addEventListener('pause', onPauseEvent);
102
+ audio.addEventListener('ended', onEndedEvent);
103
+ });
104
+ onCleanup(() => {
105
+ if (!audio)
106
+ return;
107
+ audio.removeEventListener('timeupdate', onTimeUpdate);
108
+ audio.removeEventListener('loadedmetadata', onLoadedMetadata);
109
+ audio.removeEventListener('play', onPlayEvent);
110
+ audio.removeEventListener('pause', onPauseEvent);
111
+ audio.removeEventListener('ended', onEndedEvent);
112
+ });
113
+ /** Toggles play/pause on the audio element (React's `toggle`). */
114
+ const toggle = () => {
115
+ if (!audio)
116
+ return;
117
+ if (audio.paused)
118
+ void audio.play();
119
+ else
120
+ audio.pause();
121
+ };
122
+ /**
123
+ * Seeks the audio element to a position in seconds (React's `seek`). React
124
+ * restores a controlled input to the state value right after the change
125
+ * handler returns, so the range is written back too.
126
+ *
127
+ * @param event - The range input's native input event.
128
+ */
129
+ const onSeek = (event) => {
130
+ const element = event.currentTarget;
131
+ if (audio)
132
+ audio.currentTime = Number(element.value);
133
+ element.value = String(current());
134
+ };
135
+ /** Toggles the muted state on the media element and in the state (React's `toggleMute`). */
136
+ const toggleMute = () => {
137
+ if (!audio)
138
+ return;
139
+ audio.muted = !audio.muted;
140
+ setMuted(audio.muted);
141
+ };
142
+ return (<div class={cm.cn(cm.stack(2), cm.sp('p', 3), props.className)}>
143
+ <audio ref={(el) => (audio = el)} src={props.src} autoplay={props.autoPlay} muted={muted()} preload="metadata" style={{ display: 'none' }}>
144
+ <track ref={(el) => (trackElement = el)} kind="captions" src={props.captions} srclang={props.captionsLang} label={props.captionsLabel ?? t('audio.captions', {}, { defaultValue: 'Captions' })}/>
145
+ </audio>
146
+ <Show when={props.title || props.subtitle}>
147
+ <header class={cm.stack(0)}>
148
+ <Show when={props.title}>
149
+ <span class={cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))}>{props.title}</span>
150
+ </Show>
151
+ <Show when={props.subtitle}>
152
+ <span class={cm.textSize('xs')}>{props.subtitle}</span>
153
+ </Show>
154
+ </header>
155
+ </Show>
156
+ {props.visualizer}
157
+ <div class={cm.flex({ align: 'center', gap: 'sm' })}>
158
+ <Button variant="ghost" size="sm" onClick={toggle} data-mol-id="audio-player-toggle" aria-label={playing()
159
+ ? t('audio.pause', {}, { defaultValue: 'Pause' })
160
+ : t('audio.play', {}, { defaultValue: 'Play' })}>
161
+ <span aria-hidden="true">{playing() ? '⏸' : '▶'}</span>
162
+ </Button>
163
+ <span class={cm.textSize('xs')} style={{ 'min-width': '64px' }}>
164
+ {`${fmt(current())} / ${fmt(duration())}`}
165
+ </span>
166
+ <input type="range" min={0} max={duration() || 0} step={0.1} attr:value={current()} onInput={onSeek} aria-label={t('audio.seek', {}, { defaultValue: 'Seek' })} data-mol-id="audio-player-seek" class={cm.flex1}/>
167
+ <Button variant="ghost" size="sm" onClick={toggleMute} data-mol-id="audio-player-mute" aria-label={muted()
168
+ ? t('audio.unmute', {}, { defaultValue: 'Unmute' })
169
+ : t('audio.mute', {}, { defaultValue: 'Mute' })}>
170
+ <span aria-hidden="true">{muted() ? '🔇' : '🔊'}</span>
171
+ </Button>
172
+ </div>
173
+ {props.captions && (<p aria-live="polite" data-mol-id="audio-player-captions" class={cm.textSize('sm')} style={{ 'min-height': '1.5em', 'white-space': 'pre-line' }}>
174
+ {caption()}
175
+ </p>)}
176
+ </div>);
177
+ };
178
+ //# sourceMappingURL=AudioPlayer.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.jsx","sourceRoot":"","sources":["../src/AudioPlayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAI/C;;;;;GAKG;AACH,SAAS,GAAG,CAAC,CAAS;IACpB,IA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AC,EAElB;QAAA,CAAC,MAAM,CACL,OAAO,CAAC,OAAO,CACf,IAAI,CAAC,IAAI,CACT,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,WAAW,CAAC,mBAAmB,CAC/B,UAAU,CAAC,CACT,KAAK,EAAE;YACL,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;YACnD,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAClD,CAAC,CAED;UAAA,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CACxD;QAAA,EAAE,MAAM,CACV;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,KAAK,CAAC,QAAQ,IAAI,CACjB,CAAC,CAAC,CACA,SAAS,CAAC,QAAQ,CAClB,WAAW,CAAC,uBAAuB,CACnC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACzB,KAAK,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAE5D;UAAA,CAAC,OAAO,EAAE,CACZ;QAAA,EAAE,CAAC,CAAC,CACL,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Solid HTML5 audio player chrome — play/pause, scrub bar, elapsed/total time,
3
+ * and a mute toggle, over a hidden `<audio>` element. Use for podcasts,
4
+ * voice notes, music previews, narrated lessons.
5
+ *
6
+ * Exports `<AudioPlayer>` — the Solid counterpart of
7
+ * `@molecule/app-audio-player-react`: the same props (React names) and the
8
+ * same DOM for the same input.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { AudioPlayer } from '@molecule/app-audio-player-solid'
13
+ *
14
+ * export function Player() {
15
+ * return (
16
+ * <AudioPlayer
17
+ * src="/audio/episode-42.mp3"
18
+ * title="Episode 42: Getting Started"
19
+ * subtitle="The Molecule Podcast"
20
+ * onPlay={() => console.log('playing')}
21
+ * onEnded={() => console.log('finished')}
22
+ * />
23
+ * )
24
+ * }
25
+ * ```
26
+ *
27
+ * @remarks
28
+ * There is NO volume slider — only a mute toggle; and no playback-rate
29
+ * or skip controls. The optional `visualizer` prop is a free-form node
30
+ * slot rendered above the controls (bring your own waveform). `autoPlay` is
31
+ * passed to the `<audio>` element and is routinely blocked by browsers until
32
+ * user interaction — never rely on it. Duration renders `0:00` until
33
+ * `loadedmetadata` fires (`preload="metadata"`). Translations come from the
34
+ * companion `@molecule/app-locales-audio-player` locale bond.
35
+ *
36
+ * @module
37
+ */
38
+ export * from './AudioPlayer.jsx';
39
+ export * from './types.js';
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Solid HTML5 audio player chrome — play/pause, scrub bar, elapsed/total time,
3
+ * and a mute toggle, over a hidden `<audio>` element. Use for podcasts,
4
+ * voice notes, music previews, narrated lessons.
5
+ *
6
+ * Exports `<AudioPlayer>` — the Solid counterpart of
7
+ * `@molecule/app-audio-player-react`: the same props (React names) and the
8
+ * same DOM for the same input.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { AudioPlayer } from '@molecule/app-audio-player-solid'
13
+ *
14
+ * export function Player() {
15
+ * return (
16
+ * <AudioPlayer
17
+ * src="/audio/episode-42.mp3"
18
+ * title="Episode 42: Getting Started"
19
+ * subtitle="The Molecule Podcast"
20
+ * onPlay={() => console.log('playing')}
21
+ * onEnded={() => console.log('finished')}
22
+ * />
23
+ * )
24
+ * }
25
+ * ```
26
+ *
27
+ * @remarks
28
+ * There is NO volume slider — only a mute toggle; and no playback-rate
29
+ * or skip controls. The optional `visualizer` prop is a free-form node
30
+ * slot rendered above the controls (bring your own waveform). `autoPlay` is
31
+ * passed to the `<audio>` element and is routinely blocked by browsers until
32
+ * user interaction — never rely on it. Duration renders `0:00` until
33
+ * `loadedmetadata` fires (`preload="metadata"`). Translations come from the
34
+ * companion `@molecule/app-locales-audio-player` locale bond.
35
+ *
36
+ * @module
37
+ */
38
+ export * from './AudioPlayer.jsx';
39
+ export * from './types.js';
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Types for the Solid HTML5 audio player.
3
+ *
4
+ * @module
5
+ */
6
+ import type { JSX } from 'solid-js';
7
+ /** Props accepted by the {@link AudioPlayer} component. */
8
+ export interface AudioPlayerProps {
9
+ /** Audio source URL (a file, a stream or a data URI). */
10
+ src: string;
11
+ /** Optional title / track name. */
12
+ title?: JSX.Element;
13
+ /** Optional artist / source label. */
14
+ subtitle?: JSX.Element;
15
+ /** Optional waveform / visualizer slot rendered above the controls. */
16
+ visualizer?: JSX.Element;
17
+ /**
18
+ * WebVTT captions file URL. When set, the player loads it on the media
19
+ * element's captions `<track>` and shows the current caption under the
20
+ * controls, in a polite live region that screen readers announce. Without
21
+ * it the track is empty and no caption line is shown.
22
+ */
23
+ captions?: string;
24
+ /** BCP 47 language of the captions (the track's `srclang`). */
25
+ captionsLang?: string;
26
+ /**
27
+ * Human-readable name of the captions track. Defaults through i18n
28
+ * (`audio.captions`, English "Captions").
29
+ */
30
+ captionsLabel?: string;
31
+ /** Initial muted state. */
32
+ defaultMuted?: boolean;
33
+ /** Autoplay (browser may block). Passed to the `<audio>` element. */
34
+ autoPlay?: boolean;
35
+ /** Called when the media starts playing. */
36
+ onPlay?: () => void;
37
+ /** Called when the media is paused. */
38
+ onPause?: () => void;
39
+ /** Called when the media reaches its end. */
40
+ onEnded?: () => void;
41
+ /** Extra classes on the outer wrapper. */
42
+ className?: string;
43
+ }
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAA;IACX,mCAAmC;IACnC,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,uEAAuE;IACvE,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Types for the Solid HTML5 audio player.
3
+ *
4
+ * @module
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@molecule/app-audio-player-solid",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "HTML5 audio player chrome — play/pause, scrub, time, mute toggle, optional visualizer slot",
5
+ "homepage": "https://www.molecule.dev/packages/app-audio-player-solid",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "keywords": [
26
+ "molecule",
27
+ "audio-player",
28
+ "solid"
29
+ ],
30
+ "author": "Molecule Dev, Inc. (https://molecule.dev)",
31
+ "license": "Apache-2.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/molecule-dev/molecule.git",
35
+ "directory": "packages/app/features/audio-player-solid"
36
+ },
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "bugs": "https://github.com/molecule-dev/molecule/issues",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "peerDependencies": {
45
+ "@molecule/app-solid": "^3.5.0",
46
+ "@molecule/app-ui": "^1.0.1",
47
+ "@molecule/app-ui-solid": "^1.1.0",
48
+ "solid-js": "^1.8.0"
49
+ },
50
+ "devDependencies": {
51
+ "@molecule/app-framework-conformance": "0.0.0",
52
+ "@molecule/app-i18n": "1.2.2",
53
+ "@molecule/app-icons": "1.0.4",
54
+ "@molecule/app-solid": "3.7.2",
55
+ "@molecule/app-ui": "1.4.0",
56
+ "@molecule/app-ui-solid": "1.1.5",
57
+ "@types/node": "26.6.5",
58
+ "jsdom": "30.1.3",
59
+ "solid-js": "1.9.17",
60
+ "typescript": "6.0.3",
61
+ "vite-plugin-solid": "2.11.15",
62
+ "vitest": "4.1.12"
63
+ }
64
+ }