-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Move the reusable blocks buttons to the editor module #14387
Move the reusable blocks buttons to the editor module #14387
Conversation
f35ad70
to
e28c708
Compare
packages/editor/src/components/reusable-blocks-buttons/index.js
Outdated
Show resolved
Hide resolved
<_BlockSettingsMenuPluginsExtension.Slot fillProps={ { clientIds, onClose } } /> | ||
<div className="editor-block-settings-menu__separator block-editor-block-settings-menu__separator" /> | ||
{ count === 1 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @param {Object} state Editor state. | ||
* | ||
* @return {Array} Multi-selected block client IDs. | ||
*/ | ||
export const getMultiSelectedBlockClientIds = createSelector( | ||
export const getSelectedBlockClientIds = createSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do for some separate unit tests to distinguish the two functions.
Aside: This selector function confuses me as to what its doing with the slices and root traversal below.
Needs a rebase. Might be fair to add "Performance" label, if you think it qualifies to help for future filtering reference. |
d6bfd8c
to
1ffcefc
Compare
Related #14043
This PR moves the reusable blocks related components (buttons) to the editor module. It leverages the fact that we can extend the block settings menu using a slot.
It also includes a new selector
getSelectedBlockClientIds
which was needed in a few other places too (it fixes some rerenderings as we were regenerating a new array in several withSelect callbakcs)The main goal of this PR is to avoid relying on
core/editor
in the block editor module. We still have three remaining usage of this store there that should be handled in separate PRs.Testing instructions