Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playlist block #50664

Open
wants to merge 94 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
8b44789
Basic playlist block
carolinan May 11, 2023
4198e21
try to make some accessibility improvements
carolinan May 12, 2023
ac17285
Park the PHP file until work can continue
carolinan May 12, 2023
1fcbf71
Update index.php
carolinan May 12, 2023
8aed3d3
Update index.php, try to solve merge conflicts
carolinan May 15, 2023
14e1fa5
Remove the style variation
carolinan May 15, 2023
92a3c65
Remove the unused save, add escaping, update css
carolinan May 16, 2023
59bb48f
Update edit.js
carolinan May 16, 2023
4ba31d9
Update edit.js
carolinan May 16, 2023
1e94427
Update edit.js
carolinan May 16, 2023
00d6970
Merge branch 'trunk' into try/playlist2
carolinan May 16, 2023
ca834be
fix CS issues
carolinan May 17, 2023
cce2cc5
Fix two issues with the upload option.
carolinan May 17, 2023
54cc037
Disable uploading and selecting multiple files in the replacement flow.
carolinan May 19, 2023
381650a
Update the placeholder instructions
carolinan May 19, 2023
ff810d2
Merge branch 'trunk' into try/playlist2
carolinan May 19, 2023
dab0e24
Correct a translators comment.
carolinan May 21, 2023
04a8368
Hide tracklist options if the tracklist itself is toggled off
carolinan May 21, 2023
19fc308
Merge branch 'trunk' into try/playlist2
carolinan Jul 11, 2023
7358614
Merge branch 'trunk' into try/playlist2
carolinan Jan 8, 2024
8bb139e
Merge branch 'trunk' into try/playlist2
carolinan Jan 25, 2024
38eaeed
Merge branch 'trunk' into try/playlist2
carolinan Feb 14, 2024
d9ff601
Merge branch 'trunk' into try/playlist2
carolinan Jul 23, 2024
b59aba1
Try to fix CS issues, update to apiVersion 3
carolinan Jul 23, 2024
86b992d
Add since
carolinan Jul 23, 2024
441a72d
Add color block supports
carolinan Jul 23, 2024
1181836
Merge branch 'trunk' into try/playlist2
carolinan Oct 22, 2024
3cf80ae
Add __next40pxDefaultSize and __nextHasNoMarginBottom to various cont…
carolinan Oct 22, 2024
862c4f1
Use the option for the experimental blocks.
carolinan Oct 22, 2024
880db38
WIP: Use the interactivity API.
carolinan Oct 23, 2024
69e1629
Build the core-blocks.md doc to update the block supports
carolinan Oct 24, 2024
9e60534
Merge branch 'trunk' into try/playlist2
carolinan Oct 24, 2024
8f9106e
Index.php: Re-add the conditions for the block options.
carolinan Oct 24, 2024
e0390ec
Index.php: update spacing
carolinan Oct 24, 2024
234738d
Playlist: Add caption
carolinan Oct 24, 2024
6d4a85f
Re-build docs
carolinan Oct 25, 2024
eea92d6
Merge branch 'trunk' into try/playlist2
carolinan Oct 25, 2024
95c425f
Re-add the autoplay of the next track when one track ends.
carolinan Oct 25, 2024
66f32d1
Remove the track title from the current track
carolinan Oct 25, 2024
70b1337
WIP: Update styles
carolinan Oct 25, 2024
e54fa51
Update style.scss
carolinan Oct 25, 2024
86592aa
Merge branch 'trunk' into try/playlist2
carolinan Oct 30, 2024
5999fec
Add placeholder artist and album, remove placeholder image
carolinan Oct 30, 2024
3fa03b8
Update colors to work better when the user selects text and backgroun…
carolinan Oct 30, 2024
e8cfd68
Merge branch 'trunk' into try/playlist2
carolinan Nov 9, 2024
244b979
Merge branch 'trunk' into try/playlist2
carolinan Nov 12, 2024
c4b50bd
Merge branch 'trunk' into try/playlist2
carolinan Nov 13, 2024
3b18ebc
WIP: Use inner blocks for the tracks
carolinan Nov 13, 2024
7ef20d0
Track: Use "Replace" instead of "Edit" in the toolbar
carolinan Nov 13, 2024
f84a718
Track: Set the text align on the button to left.
carolinan Nov 13, 2024
6ef1e5d
Track: Update block supports
carolinan Nov 13, 2024
7ad6159
Playlist: Try showing the inserter at the bottom of the block.
carolinan Nov 13, 2024
7a7b9ec
Adjust the track button CSS class and move the appender
carolinan Nov 14, 2024
01df824
Fix the invalid HTML of the list on the front
carolinan Nov 14, 2024
f8a7492
Track: update block supports
carolinan Nov 14, 2024
f1c7786
WIP: Prevent duplicate tracks
carolinan Nov 14, 2024
d75c10d
Move the tracklist inside `<Disabled>`
carolinan Nov 14, 2024
a86d15f
Playlist: Rename the images attribute to showImages
carolinan Nov 14, 2024
10b5551
Revert placing the tracklist within Disabled since it prevented addin…
carolinan Nov 14, 2024
bf141aa
Revert the prevention of duplicate tracks
carolinan Nov 14, 2024
5c2da88
Playlist: rename the tracklist block attribute to showTracklist
carolinan Nov 14, 2024
358ed29
Playlist: Update the tracks block attribute when the user changes pos…
carolinan Nov 14, 2024
2955deb
Playlist: Fix the display of the album image
carolinan Nov 14, 2024
a6226fc
Re-add the track title to the current track.
carolinan Nov 14, 2024
5f23da3
Try to fix a JS error when a track is re-positioned.
carolinan Nov 14, 2024
845e9ed
Playlist: Add the current title as a data-wp-text
carolinan Nov 14, 2024
2a0329e
Playlist: Correct the position of the artist and album for the curren…
carolinan Nov 14, 2024
5e50c96
Track: Try to improve responsiveness
carolinan Nov 14, 2024
389e86c
First iteration of adding the album cover image to the track
carolinan Nov 14, 2024
6d2cd60
Adjust the CSS
carolinan Nov 15, 2024
c467dbf
Update the monitoring of changes to inner blocks
carolinan Nov 15, 2024
3580672
Update how the current track is managed
carolinan Nov 15, 2024
2512870
Update the appender, prevent grouping inner blocks
carolinan Nov 15, 2024
6990862
Prevent PHP notices when the current track is the media placeholder
carolinan Nov 15, 2024
9ac5f28
Merge branch 'trunk' into try/playlist2
carolinan Nov 18, 2024
31ab787
Move the current track to a new constant
carolinan Nov 19, 2024
c28bc1e
Adjust the styling of the placeholder, removing the border
carolinan Nov 19, 2024
6228715
Display a placeholder for the current track
carolinan Nov 19, 2024
8f771f3
Update how the current track is handled
carolinan Nov 19, 2024
0093fe2
Remove a constant that was only used once
carolinan Nov 19, 2024
1f3bcf4
Add a comment about sanitizing HTML in data from the media library
carolinan Nov 19, 2024
27237cc
Add checks for the media_details attachment data
carolinan Nov 20, 2024
76a6444
Playlist track: Update the MediaReplaceFlow
carolinan Nov 20, 2024
377964d
Playlist: Update MediaReplaceFlow
carolinan Nov 20, 2024
dd11826
Merge branch 'trunk' into try/playlist2
carolinan Nov 21, 2024
b3c49bf
Playlist: Try to reduce the number of undo steps
carolinan Nov 21, 2024
0e472b8
Playlist MediaReplaceFlow: remove "value"
carolinan Nov 21, 2024
6d5d15d
Track: introduce blob management and clean up the MediaReplaceFlow
carolinan Nov 21, 2024
808cc8e
Playlist: Try to solve the duplcation of existing tracks on file uplo…
carolinan Nov 21, 2024
4249fa5
WIP: Make the block actually dynamic
carolinan Nov 25, 2024
122c6f8
WIP: Add the markup for the current track at the top of the playlist
carolinan Nov 25, 2024
deb34b6
Playlist track: Save changes to the title of the track using useEntit…
carolinan Nov 26, 2024
efb61b5
Remove imperative code and add server array
luisherranz Nov 28, 2024
45bc81f
Add missing derived state in the server
luisherranz Nov 28, 2024
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
22 changes: 22 additions & 0 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,28 @@ Show a block pattern. ([Source](https://github.com/WordPress/gutenberg/tree/trun
- **Supports:** interactivity (clientNavigation), ~~html~~, ~~inserter~~, ~~renaming~~
- **Attributes:** slug

## Playlist

Embed a simple playlist. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/playlist))

- **Name:** core/playlist
- **Experimental:** true
- **Category:** media
- **Allowed Blocks:** core/playlist-track
- **Supports:** align, anchor, color (background, gradients, link, text), interactivity, spacing (margin, padding)
- **Attributes:** caption, currentTrack, order, showArtists, showImages, showNumbers, showTracklist, tracks, type

## Playlist track

Playlist track. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/playlist-track))

- **Name:** core/playlist-track
- **Experimental:** true
- **Category:** media
- **Parent:** core/playlist
- **Supports:** interactivity (clientNavigation), ~~html~~, ~~reusable~~
- **Attributes:** blob, id, src

## Author

Display post author details such as name, avatar, and bio. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/post-author))
Expand Down
4 changes: 4 additions & 0 deletions lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function gutenberg_reregister_core_block_types() {
'more',
'nextpage',
'paragraph',
'playlist',
'playlist-track',
'preformatted',
'pullquote',
'quote',
Expand Down Expand Up @@ -88,6 +90,8 @@ function gutenberg_reregister_core_block_types() {
'post-author.php' => 'core/post-author',
'post-author-name.php' => 'core/post-author-name',
'post-author-biography.php' => 'core/post-author-biography',
'playlist.php' => 'core/playlist',
'playlist-track.php' => 'core/playlist-track',
'post-comment.php' => 'core/post-comment',
'post-comments-count.php' => 'core/post-comments-count',
'post-comments-form.php' => 'core/post-comments-form',
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"./file/view": "./build-module/file/view.js",
"./image/view": "./build-module/image/view.js",
"./navigation/view": "./build-module/navigation/view.js",
"./playlist/view": "./build-module/playlist/view.js",
"./query/view": "./build-module/query/view.js",
"./search/view": "./build-module/search/view.js"
},
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import "./nextpage/editor.scss";
@import "./page-list/editor.scss";
@import "./paragraph/editor.scss";
@import "./playlist/editor.scss";
@import "./post-author/editor.scss";
@import "./post-excerpt/editor.scss";
@import "./pullquote/editor.scss";
Expand Down
7 changes: 7 additions & 0 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ import * as pattern from './pattern';
import * as pageList from './page-list';
import * as pageListItem from './page-list-item';
import * as paragraph from './paragraph';
import * as playlist from './playlist';
import * as playlistTrack from './playlist-track';
import * as postAuthor from './post-author';
import * as postAuthorName from './post-author-name';
import * as postAuthorBiography from './post-author-biography';
Expand Down Expand Up @@ -239,6 +241,11 @@ const getAllBlocks = () => {
blocks.push( formSubmissionNotification );
}

if ( window?.__experimentalEnableBlockExperiments ) {
blocks.push( playlist );
blocks.push( playlistTrack );
}

// When in a WordPress context, conditionally
// add the classic block and TinyMCE editor
// under any of the following conditions:
Expand Down
34 changes: 34 additions & 0 deletions packages/block-library/src/playlist-track/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"__experimental": true,
"name": "core/playlist-track",
"title": "Playlist track",
"category": "media",
"parent": [ "core/playlist" ],
"description": "Playlist track.",
"keywords": [ "music", "sound" ],
"textdomain": "default",
"usesContext": [ "showArtists", "currentTrack" ],
"attributes": {
"blob": {
"type": "string",
"role": "local"
},
"id": {
"type": "number"
},
"src": {
"type": "string"
}
},
"supports": {
"html": false,
"interactivity": {
"clientNavigation": true
},
"reusable": false
},
"editorStyle": "wp-block-playlist-track-editor",
"style": "wp-block-playlist-track"
}
Loading
Loading