-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Omit "design" controls from Image block toolbar while in write mode #66880
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
<ImageURLInputUI | ||
url={ href || '' } | ||
onChangeUrl={ onSetHref } | ||
linkDestination={ linkDestination } | ||
mediaUrl={ | ||
( image && image.source_url ) || url | ||
} | ||
mediaLink={ image && image.link } | ||
linkTarget={ linkTarget } | ||
linkClass={ linkClass } | ||
rel={ rel } | ||
showLightboxSetting={ showLightboxSetting } | ||
lightboxEnabled={ lightboxChecked } | ||
onSetLightbox={ onSetLightbox } | ||
resetLightbox={ resetLightbox } | ||
/> |
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.
I think the option to link an image should still be present in Write (or content only) mode.
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.
@talldan address your feedback.
Similar to the other PR. Is there a way to solve this without having the knowledge of the block editing mode within the block itself? (See question here #65699 (comment) and reply) |
So rather passed to the block somehow? Block editing mode has been used in the image block since its creation, and in the meantime is used in more places than just navigation and image:
And there are three states: 'disabled', 'contentOnly', and 'default' so blocks might need to behave differently according to the value. What if it were passed down through diff --git a/packages/block-editor/src/components/block-list/use-block-props/index.js b/packages/block-editor/src/components/block-list/use-block-props/index.js
index 25b9a21f0d..b30d9889e5 100644
--- a/packages/block-editor/src/components/block-list/use-block-props/index.js
+++ b/packages/block-editor/src/components/block-list/use-block-props/index.js
@@ -161,6 +161,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
'data-block': clientId,
'data-type': name,
'data-title': blockTitle,
+ 'data-editing-mode': blockEditingMode,
inert: isSubtreeDisabled ? 'true' : undefined,
className: clsx(
'block-editor-block-list__block',
It's a good discussion to have! Is it a blocker for this PR though? If a better way to communicate block editing mode to blocks comes along, migrating affected blocks in the block library will have to be done anyway. |
You're right, it doesn't seem like a blocker for the current PR. |
Co-authored-by: t-hamano <[email protected]>
@t-hamano addressed your feedback, please check now. |
What?
Based on editor mode updating image block toolbar controls.
Why?
closes #66875
How?
Testing Instructions
Screenshots or screencast
Screen.Recording.2024-11-08.at.22.59.27.mov