Skip to content

Playlist block updates#1

Merged
antpb merged 7 commits intoantpb:add/playlist-block-805from
joemcgill:add/playlist-block
Jun 16, 2018
Merged

Playlist block updates#1
antpb merged 7 commits intoantpb:add/playlist-block-805from
joemcgill:add/playlist-block

Conversation

@joemcgill
Copy link
Copy Markdown

Hey @antpb. I spent some time looking over this today and doing some cleanup. Most of this is simply code style fixes, not functional changes, but I did fix up some issues with display on the front end while I was at it.

With these changes, I think it's very close to being ready for a PR to the main Gutenberg repo. Let me know what you think.

This simply moves the playlist block in the list of blocks imported and registered in core-blocks/index.js.
This commit generally accomplishes a few thing:
- Removes any unused variables and functions
- Ensuring all used functions and variables are declared
- Simplifies some variable declarations
- Fixing spacing to conform to WP style
This fixes up code style issues, adds correct docblocks, and removes unneccessary script rendering which isn't necessary during server rendering.
This wraps the shortcode output in a `figure` element with a class of `wp-block-playlist` applied so we can style the block accordingly.
This adds an editor.scss file to the playlist block that removes margins from `.wp-playlist-block` elements, to avoid margins being added as a default style by browsers.
This adds an align attribute to the playlist block and adds the proper alignment class to the markup on the front end to support alignments. This also deletes the style.scss file, which now seems unnecessary.
@antpb
Copy link
Copy Markdown
Owner

antpb commented Jun 16, 2018

Thank you so so much @joemcgill ! This looks awesome. Learned a few bunch in the process of reviewing this. Woot!

@antpb antpb merged commit e74ab60 into antpb:add/playlist-block-805 Jun 16, 2018
antpb pushed a commit that referenced this pull request Feb 21, 2019
…rdPress#12312)

* Improve typing performance by splitting attributes in state tree.

Attributes have been moved to `attributesByClientId` in order to
reduce the impact of typing throughout the state tree.
See WordPress#11782.

Review fixes pass #1

Simplify block flattening code in reducers.

Remove alignment toolbar optimization; should be a different PR

Fix minor bug in test

Fix failing getBlockDependantsCacheBust test

Remove new `*WithoutAttributes` selectors.

We'll go with a different approach: use the existing selectors, but
keep the dependencies as they are. The attributes may get stale, but
it doesn't matter if they're not being used.

Change attributesById structure to not have an inner attributes

Simplifying some selector dependencies

Simplify withSaveReusableBlock a bit further and clarify its existence

Reuse constant instead of running omit again

Remove no longer needed mapClientIds

Simplifying reducers after review comments.

Further changes to selectors after review

Fix types in JSDoc

Renaming attributesByClientId to attributes

Further selector fixes after review

* Revert changes to getBlocks dependants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants