Skip to content

Commit 3b28ac0

Browse files
arraypressclaude
andcommitted
release: 0.6.0 (buttonRadius + artworkPosition props)
Exposes the two options added in @arraypress/waveform-player 1.22.0. The prop TYPES already derived from the core's WaveformPlayerOptions and flowed through on their own — but the option mapping is hand-written, so both props would have type-checked and then silently done nothing. Tests now pin the mapping; verified they fail when it's removed. Peer range stays ^1.20.0: the props only exist once the consumer's own core reaches 1.22.0, so an older core is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b6b57d7 commit 3b28ac0

5 files changed

Lines changed: 62 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.6.0] — 2026-07-17
11+
12+
### Added
13+
14+
- **`buttonRadius` and `artworkPosition` props.** Exposes the two options added
15+
in `@arraypress/waveform-player` 1.22.0: `buttonRadius` sets the play button's
16+
corner radius (`0` for square, or any CSS length), and `artworkPosition`
17+
(`'info'` | `'button'`) chooses whether the cover renders in the info row or
18+
becomes the play button itself.
19+
20+
Both prop *types* already flowed through automatically, since the props derive
21+
from the core's `WaveformPlayerOptions` — but the options bag is written by hand, so
22+
until now they would have type-checked and then silently done nothing. Tests
23+
now cover the mapping for exactly that reason.
24+
25+
The peer range stays `^1.20.0`: the props only appear once the consumer's own
26+
core is on 1.22.0, so nothing breaks on an older one.
27+
1028
## [0.5.0] — 2026-07-05
1129

1230
### Added

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@arraypress/waveform-player-react",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "React component wrapper for @arraypress/waveform-player — forwardRef-friendly, useEffect lifecycle, typed props for every library option.",
55
"type": "module",
66
"main": "./dist/index.cjs",
@@ -71,7 +71,7 @@
7171
"prepublishOnly": "npm run build"
7272
},
7373
"devDependencies": {
74-
"@arraypress/waveform-player": "^1.20.0",
74+
"@arraypress/waveform-player": "^1.22.0",
7575
"@testing-library/jest-dom": "^6.9.1",
7676
"@testing-library/react": "^16.3.2",
7777
"@types/react": "^19.2.17",

src/WaveformPlayer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ function buildLibraryOptions(props: WaveformPlayerProps): Record<string, unknown
112112
if (props.layout !== undefined) opts.layout = props.layout;
113113
if (props.buttonStyle !== undefined) opts.buttonStyle = props.buttonStyle;
114114
if (props.buttonSize !== undefined) opts.buttonSize = props.buttonSize;
115+
if (props.buttonRadius !== undefined) opts.buttonRadius = props.buttonRadius;
115116

116117
/* Accessibility */
117118
if (props.accessibleSeek !== undefined) opts.accessibleSeek = props.accessibleSeek;
@@ -132,6 +133,7 @@ function buildLibraryOptions(props: WaveformPlayerProps): Record<string, unknown
132133
if (props.artist !== undefined) opts.artist = props.artist;
133134
if (props.artwork !== undefined) opts.artwork = props.artwork;
134135
if (props.artworkAlt !== undefined) opts.artworkAlt = props.artworkAlt;
136+
if (props.artworkPosition !== undefined) opts.artworkPosition = props.artworkPosition;
135137
if (props.album !== undefined) opts.album = props.album;
136138
if (props.unknownTrackText !== undefined) opts.unknownTrackText = props.unknownTrackText;
137139

@@ -317,6 +319,7 @@ export const WaveformPlayer = forwardRef<WaveformPlayerHandle, WaveformPlayerPro
317319
props.showBPM,
318320
props.buttonAlign,
319321
props.buttonSize,
322+
props.buttonRadius,
320323
props.accessibleSeek,
321324
props.seekLabel,
322325
props.seekValueText,
@@ -329,6 +332,7 @@ export const WaveformPlayer = forwardRef<WaveformPlayerHandle, WaveformPlayerPro
329332
props.artist,
330333
props.artwork,
331334
props.artworkAlt,
335+
props.artworkPosition,
332336
props.album,
333337
props.unknownTrackText,
334338
props.autoplay,

test/WaveformPlayer.test.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,38 @@ describe('<WaveformPlayer> — mount', () => {
139139

140140
// ─── Option pass-through ─────────────────────────────────────────────────
141141

142+
describe('<WaveformPlayer> — button radius + artwork placement', () => {
143+
// These props type-check for free (WaveformPlayerProps derives from the
144+
// core's WaveformPlayerOptions), but the options bag is hand-built — so a
145+
// prop that isn't enumerated in buildLibraryOptions type-checks and then
146+
// silently does nothing. That failure is invisible without these.
147+
it('forwards buttonRadius, including 0', async () => {
148+
render(<WaveformPlayer url="/audio/a.mp3" buttonRadius={0} />);
149+
await waitForMount();
150+
expect(ctorCalls[0].opts.buttonRadius).toBe(0);
151+
});
152+
153+
it('forwards a buttonRadius unit string', async () => {
154+
render(<WaveformPlayer url="/audio/a.mp3" buttonRadius="0.5rem" />);
155+
await waitForMount();
156+
expect(ctorCalls[0].opts.buttonRadius).toBe('0.5rem');
157+
});
158+
159+
it('forwards artworkPosition', async () => {
160+
render(<WaveformPlayer url="/audio/a.mp3" artwork="/c.jpg" artworkPosition="button" />);
161+
await waitForMount();
162+
expect(ctorCalls[0].opts.artworkPosition).toBe('button');
163+
});
164+
165+
it('omits both when unset, so the core defaults apply', async () => {
166+
render(<WaveformPlayer url="/audio/a.mp3" />);
167+
await waitForMount();
168+
const { opts } = ctorCalls[0];
169+
expect('buttonRadius' in opts).toBe(false);
170+
expect('artworkPosition' in opts).toBe(false);
171+
});
172+
});
173+
142174
describe('<WaveformPlayer> — option pass-through', () => {
143175
it('forwards every primitive prop into the library options bag', async () => {
144176
render(

0 commit comments

Comments
 (0)