-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ContentOnly Patterns experiment: Add content only inspector fields #71730
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
fab47d0
Boilerplate
talldan b9e18ae
v1
talldan de34b38
Fixes
talldan ad41662
Small improvements:
talldan 615f532
Add block icon
talldan 5cd8ebc
Refactor to a `controls` array in the block index
talldan bea3948
Stub out media and link controls
talldan 58592e0
Add first draft of media control
talldan 749e652
Move controls to separate files
talldan be3560c
Add styles for media control
talldan 590d0cf
Add caption and alt to image
talldan e9dea9e
Make toolspanel dropdown open to the side
talldan 4fad718
Add link control initial implementation
talldan da5a41f
Add image controls to cover
talldan d094b8e
Add social link, button support
talldan b349819
Improve thumbnail
talldan b455dc5
Add support to audio block
talldan 43bf8b7
Add support for code
talldan 805feaf
Add media-text support
talldan bd84bec
Add support for More and Preformatted
talldan 9a49fa7
Add support to pullquote
talldan c6bae84
Add support to search
talldan 76c0f8c
Add support for verse
talldan b7425ed
Better support for video in cover block
talldan 5e23b27
Show controls when for root block when it is a content block
talldan 5d62731
Switch to MediaReplaceFlow
talldan 59b21d2
Support featured image in cover block
talldan ed501df
Remove unset buttons
talldan 66b5ced
Semi functioning rich text control
talldan 41761c7
More rich text stuff
talldan 4057ba1
Improve richtext control styles (hacky)
talldan 1eb93d4
Kitchen sink to get formats working
talldan be274f6
Fix formats showing on toolbar twice
talldan 40b3d53
Fix tagName
talldan f0edd58
Match border color
talldan 4302be9
Add plain text control
talldan 8f831c6
Add tagName back again to fix formatting
talldan 37508b3
Remove old configuration
talldan d658f2f
Show media thumbnail and title when possible
talldan cfc0590
Fix component name
talldan 825b2f8
Use actual buttons
talldan 80bad4a
Improve fallback to URL
talldan a37780e
More button style iterations
talldan ab796a3
Nesting
talldan 63f4ae0
Improved styles
talldan 31b6f8d
Improved nesting
talldan b84a759
Add list item support
talldan 8956f28
Condense the tools panels
talldan 1290679
Avoid orphaned drilldowns
talldan b97c8db
Make navigator button font weights match tools panel headings (hacky)
talldan 7ce41bf
Support details
talldan 4ce6327
Update comments
talldan 61d47e6
Add file support
talldan 9853d8b
Add basic nav block support
talldan fcc7b60
Fix showing the editable fields in the content tab
talldan eaac840
Add explicit scss imports
talldan d1648d3
Rename `controls` to `fields`
talldan 2b7004d
Remove navigation duplicate content role
talldan e8400bf
Fix navigation screen padding
andrewserong 5cb023e
Ensure consistency with what this branch was previously doing for lin…
andrewserong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add link control initial implementation
- Loading branch information
commit 4fad718546dd40c9ed3f13751add9ae0a4e46696
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ages/block-editor/src/components/content-only-controls/use-inspector-popover-placement.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { useViewportMatch } from '@wordpress/compose'; | ||
|
|
||
| export function useInspectorPopoverPlacement( | ||
| { isControl } = { isControl: false } | ||
| ) { | ||
| const isMobile = useViewportMatch( 'medium', '<' ); | ||
| return ! isMobile | ||
| ? { | ||
| popoverProps: { | ||
| placement: 'left-start', | ||
| // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) | ||
| offset: isControl ? 35 : 259, | ||
| }, | ||
| } | ||
| : {}; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This whole content only controls feel like we're recreating DataForm, shouldn't we take the time to make sure DataForm works properly instead of reinventing the same thing?
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 agree, I'll get to it, I've been working on a few other things first so I haven't pushed to this for a while.
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.
Makes sense, but I'm wondering if it can be a follow up? To see if something works properly sounds like an investigation task, which I'd wager would create a list of compatibility sub tasks
Or if folks think it's required right now, let's make sure everyone is on board with the extra time required to investigate.
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 it could be worth a (time-boxed) bit of investigation, partly because this PR introduces a shape of an API for fields in block settings. Not necessarily a blocker as this PR is guarded behind an experiment, but it sounds like it'd be good for the fields set in a block to be effectively the same (or similar) API as DataForm fields?
Or another way to look at it, is that I think there's two things we might want to achieve:
So long as things are guarded behind an experiment, we can continue to iterate, but overall I like the idea of consolidating with DataForm and using the work here to help inform improvements to the DataForm and controls.