Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/block-library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

- Footnotes: Treat unreadable `footnotes` post meta as no footnotes instead of throwing, so the block shows its placeholder rather than the block crash warning ([#81201](https://github.com/WordPress/gutenberg/pull/81201)).
- Playlist: Improve handling of declarative waveform player configuration ([#81342](https://github.com/WordPress/gutenberg/pull/81342)).
- Playlist: Update `@arraypress/waveform-player` to `^1.26.0`, disable automatic initialization, and prevent custom SVG icons from being configured through HTML data attributes.
- Cover: Pass `'full'` instead of `null` as the featured image size for parallax and repeated backgrounds, so a null array offset is no longer reached on PHP 8.5 ([#81444](https://github.com/WordPress/gutenberg/pull/81444)).

### Internal
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"build-module/*/init.mjs"
],
"dependencies": {
"@arraypress/waveform-player": "^1.23.0",
"@arraypress/waveform-player": "^1.26.0",
"@wordpress/a11y": "file:../a11y",
"@wordpress/api-fetch": "file:../api-fetch",
"@wordpress/autop": "file:../autop",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import '@testing-library/jest-dom';

const DEFAULT_PLAYBACK_RATES = [
'0.5x',
'0.75x',
'1x',
'1.25x',
'1.5x',
'1.75x',
'2x',
];
const FIXTURE_ATTRIBUTE = 'data-player-fixture';

function createDeclarativePlayer( attributes = {} ) {
Expand All @@ -33,10 +24,6 @@ function loadWaveformPlayer() {
return WaveformPlayer;
}

function getFragmentedAttributeValue( prefix = '' ) {
return `${ prefix }" ${ FIXTURE_ATTRIBUTE }="sample`;
}

describe( 'Waveform Player dependency', () => {
let WaveformPlayer;
let originalReadyState;
Expand Down Expand Up @@ -102,43 +89,6 @@ describe( 'Waveform Player dependency', () => {
).not.toBeNull();
} );

it( 'uses the default alignment when a declarative alignment value is unsupported', () => {
const element = createDeclarativePlayer( {
'data-button-align': getFragmentedAttributeValue( 'center' ),
} );

WaveformPlayer = loadWaveformPlayer();
WaveformPlayer.init();

const track = element.querySelector( '.waveform-track' );
expect( track ).toHaveClass( 'waveform-align-center' );
expect( track ).not.toHaveAttribute( FIXTURE_ATTRIBUTE );
} );

it( 'uses the default playback rates when a declarative rate list is unsupported', () => {
const element = createDeclarativePlayer( {
'data-show-playback-speed': 'true',
'data-playback-rates': JSON.stringify( [
1,
getFragmentedAttributeValue( '1' ),
1.5,
] ),
} );

WaveformPlayer = loadWaveformPlayer();
WaveformPlayer.init();

const options = [ ...element.querySelectorAll( '.speed-option' ) ];
expect( options.map( ( option ) => option.textContent ) ).toEqual(
DEFAULT_PLAYBACK_RATES
);
expect(
options.some( ( option ) =>
option.hasAttribute( FIXTURE_ATTRIBUTE )
)
).toBe( false );
} );

it( 'supports custom control icons passed to the constructor', () => {
const element = document.createElement( 'div' );
const icon = document.createElementNS(
Expand All @@ -158,30 +108,6 @@ describe( 'Waveform Player dependency', () => {
).not.toBeNull();
} );

it( 'skips programmatic players during explicit declarative scans', () => {
const element = createDeclarativePlayer();
const icon = document.createElementNS(
'http://www.w3.org/2000/svg',
'svg'
);
icon.setAttribute( FIXTURE_ATTRIBUTE, 'constructor-scan' );

WaveformPlayer = loadWaveformPlayer();
const player = new WaveformPlayer( element, {
playIcon: icon.outerHTML,
} );

WaveformPlayer.init();

expect( WaveformPlayer.getAllInstances() ).toHaveLength( 1 );
expect( WaveformPlayer.getInstance( element ) ).toBe( player );
expect(
element.querySelector(
`[${ FIXTURE_ATTRIBUTE }="constructor-scan"]`
)
).not.toBeNull();
} );

it( 'initializes declarative players only after an explicit request', () => {
const element = createDeclarativePlayer();

Expand Down
109 changes: 0 additions & 109 deletions patches/@arraypress+waveform-player+1.23.0.patch

This file was deleted.

54 changes: 54 additions & 0 deletions patches/@arraypress+waveform-player+1.26.0.patch

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ Existing patches should be described and justified here.

## Patches

### `patches/@arraypress+waveform-player+1.23.0.patch`
### `patches/@arraypress+waveform-player+1.26.0.patch`

This patch limits declarative configuration to supported option values and
requires initialization to be requested explicitly. Programmatic configuration
used by the Playlist block remains unchanged.
This patch requires initialization to be requested explicitly and removes passing custom SVG icons
through HTML data attributes.

### `patches/react-autosize-textarea+7.1.0.patch`

Expand Down
Loading