diff --git a/docs/reference-guides/core-blocks/README.md b/docs/reference-guides/core-blocks/README.md index 4aceefa46e3177..bd40646f1d2a5b 100644 --- a/docs/reference-guides/core-blocks/README.md +++ b/docs/reference-guides/core-blocks/README.md @@ -633,7 +633,6 @@ Show a block pattern. Embed a simple playlist. - **Name:** [core/playlist](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/core-block-playlist/) -- **Experimental:** true - **Category:** [media](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/) - **Allowed Blocks:** core/playlist-track - **Supports:** align, anchor, color (background, gradients, link, text), interactivity, spacing (margin, padding), typography (fontSize) @@ -644,7 +643,6 @@ Embed a simple playlist. Playlist track. - **Name:** [core/playlist-track](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/core-block-playlist-track/) -- **Experimental:** true - **Category:** [media](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/) - **Parent:** core/playlist - **Supports:** interactivity (clientNavigation), ~~html~~, ~~reusable~~ diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index 2a2e8e7901a913..973447ae18cba0 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -4,6 +4,7 @@ ### Enhancements +- Make the Playlist and Playlist Track blocks stable ([#80203](https://github.com/WordPress/gutenberg/pull/80203)). - Use the emphasis font-weight token for UI emphasis ([#80093](https://github.com/WordPress/gutenberg/pull/80093)). - Widen React peer dependency ranges to `^18 || ^19` to support both React 18 and React 19 environments ([#80024](https://github.com/WordPress/gutenberg/pull/80024)). diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 75f8547a3fc1c7..f70a26050c5283 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -197,6 +197,8 @@ const getAllBlocks = () => { pageList, pageListItem, pattern, + playlist, + playlistTrack, preformatted, pullquote, reusableBlock, @@ -285,8 +287,6 @@ const getAllBlocks = () => { blocks.push( tabs ); blocks.push( tabPanel ); blocks.push( tabPanels ); - blocks.push( playlist ); - blocks.push( playlistTrack ); } blocks.push( classic ); diff --git a/packages/block-library/src/playlist-track/README.md b/packages/block-library/src/playlist-track/README.md index fd232da612a09a..f2e8ddd0746e67 100644 --- a/packages/block-library/src/playlist-track/README.md +++ b/packages/block-library/src/playlist-track/README.md @@ -1,8 +1,6 @@ # Playlist track -
This block is experimental and may change or be removed without notice.
- Playlist track. - **Name:** `core/playlist-track` @@ -58,7 +56,7 @@ This is a [**dynamic block**](https://developer.wordpress.org/block-editor/getti In post content, it is stored as a block comment: ```html - + ``` ## Source diff --git a/packages/block-library/src/playlist-track/block.json b/packages/block-library/src/playlist-track/block.json index 66ac6da3d90700..26451bbcda8efb 100644 --- a/packages/block-library/src/playlist-track/block.json +++ b/packages/block-library/src/playlist-track/block.json @@ -1,7 +1,6 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, - "__experimental": true, "name": "core/playlist-track", "title": "Playlist track", "category": "media", diff --git a/packages/block-library/src/playlist/README.md b/packages/block-library/src/playlist/README.md index af92e34906e8ae..75dd77fe9b9991 100644 --- a/packages/block-library/src/playlist/README.md +++ b/packages/block-library/src/playlist/README.md @@ -1,8 +1,6 @@ # Playlist -
This block is experimental and may change or be removed without notice.
- Embed a simple playlist. - **Name:** `core/playlist` @@ -63,9 +61,14 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre This is a [**hybrid block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). It saves static markup that the server may enhance during rendering. ```html - - - + +
+
    + +
+
Sample playlist
+
+ ``` ## Source diff --git a/packages/block-library/src/playlist/block.json b/packages/block-library/src/playlist/block.json index 9985bfd4bc2aa1..9f8ff2d5fe8ca2 100644 --- a/packages/block-library/src/playlist/block.json +++ b/packages/block-library/src/playlist/block.json @@ -1,7 +1,6 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, - "__experimental": true, "name": "core/playlist", "title": "Playlist", "category": "media", diff --git a/test/integration/fixtures/blocks/core__playlist-track.html b/test/integration/fixtures/blocks/core__playlist-track.html new file mode 100644 index 00000000000000..e892addb4c6726 --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist-track.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__playlist-track.json b/test/integration/fixtures/blocks/core__playlist-track.json new file mode 100644 index 00000000000000..23196f9001d94d --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist-track.json @@ -0,0 +1,18 @@ +[ + { + "name": "core/playlist-track", + "isValid": true, + "attributes": { + "id": 123, + "src": "https://example.com/audio.mp3", + "type": "audio", + "album": "Example album", + "artist": "Example creator", + "image": "https://example.com/track-image.jpg", + "imageAlt": "Track image", + "length": "3:21", + "title": "Sample track" + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__playlist-track.parsed.json b/test/integration/fixtures/blocks/core__playlist-track.parsed.json new file mode 100644 index 00000000000000..1cf9bf2ef61b2f --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist-track.parsed.json @@ -0,0 +1,18 @@ +[ + { + "blockName": "core/playlist-track", + "attrs": { + "id": 123, + "src": "https://example.com/audio.mp3", + "album": "Example album", + "artist": "Example creator", + "image": "https://example.com/track-image.jpg", + "imageAlt": "Track image", + "length": "3:21", + "title": "Sample track" + }, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + } +] diff --git a/test/integration/fixtures/blocks/core__playlist-track.serialized.html b/test/integration/fixtures/blocks/core__playlist-track.serialized.html new file mode 100644 index 00000000000000..41b342bfa60f20 --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist-track.serialized.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__playlist.html b/test/integration/fixtures/blocks/core__playlist.html new file mode 100644 index 00000000000000..51586550fbee2c --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist.html @@ -0,0 +1,8 @@ + +
+
    + +
+
Sample playlist
+
+ diff --git a/test/integration/fixtures/blocks/core__playlist.json b/test/integration/fixtures/blocks/core__playlist.json new file mode 100644 index 00000000000000..ba4e6e842b78d0 --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist.json @@ -0,0 +1,36 @@ +[ + { + "name": "core/playlist", + "isValid": true, + "attributes": { + "type": "audio", + "order": "asc", + "showTracklist": true, + "showImages": true, + "showPlayButtonArtwork": false, + "showArtists": true, + "showNumbers": true, + "showTrackLength": true, + "waveformStyle": "bars", + "caption": "Sample playlist" + }, + "innerBlocks": [ + { + "name": "core/playlist-track", + "isValid": true, + "attributes": { + "id": 123, + "src": "https://example.com/audio.mp3", + "type": "audio", + "album": "Example album", + "artist": "Example creator", + "image": "https://example.com/track-image.jpg", + "imageAlt": "Track image", + "length": "3:21", + "title": "Sample track" + }, + "innerBlocks": [] + } + ] + } +] diff --git a/test/integration/fixtures/blocks/core__playlist.parsed.json b/test/integration/fixtures/blocks/core__playlist.parsed.json new file mode 100644 index 00000000000000..4f23711d3dc45b --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist.parsed.json @@ -0,0 +1,32 @@ +[ + { + "blockName": "core/playlist", + "attrs": { + "caption": "Sample playlist" + }, + "innerBlocks": [ + { + "blockName": "core/playlist-track", + "attrs": { + "id": 123, + "src": "https://example.com/audio.mp3", + "album": "Example album", + "artist": "Example creator", + "image": "https://example.com/track-image.jpg", + "imageAlt": "Track image", + "length": "3:21", + "title": "Sample track" + }, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + } + ], + "innerHTML": "\n
\n\t
    \n\t\t\n\t
\n\t
Sample playlist
\n
\n", + "innerContent": [ + "\n
\n\t
    \n\t\t", + null, + "\n\t
\n\t
Sample playlist
\n
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__playlist.serialized.html b/test/integration/fixtures/blocks/core__playlist.serialized.html new file mode 100644 index 00000000000000..8f7acacffc5df9 --- /dev/null +++ b/test/integration/fixtures/blocks/core__playlist.serialized.html @@ -0,0 +1,3 @@ + +
Sample playlist
+