-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Improve Block Toolbar Semantics/Accessibility #54513
Commits on Oct 13, 2023
-
Move Selected Block Tools into the header toolbar in the DOM but pres…
…erve all visual interactions This is a big commit with a large potential for bugs. Think of this as a spike or POC for now. There'll be a lot to address. Some general TODOs: - [ ] Refactor shared code between empty-block-inserter and selected-block-tools - [ ] More explicitly pass the popover slot and content ref into the SelectedBlockTools - [ ] Shortcut/keystrokes for returning from the toolbar to where the cursor was before moving into the toolbar - [ ] Inline Tools either move to the top toolbar or get inserted into the main block toolbar (think image caption formatting tools) - [ ] Visual styles for the top toolbar
Configuration menu - View commit details
-
Copy full SHA for 8e521f7 - Browse repository at this point
Copy the full SHA 8e521f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for deacf25 - Browse repository at this point
Copy the full SHA deacf25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ede8a7 - Browse repository at this point
Copy the full SHA 4ede8a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45ebf2f - Browse repository at this point
Copy the full SHA 45ebf2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for fea3c9f - Browse repository at this point
Copy the full SHA fea3c9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed8541b - Browse repository at this point
Copy the full SHA ed8541bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7728101 - Browse repository at this point
Copy the full SHA 7728101View commit details -
Configuration menu - View commit details
-
Copy full SHA for 271b0eb - Browse repository at this point
Copy the full SHA 271b0ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 647ecf5 - Browse repository at this point
Copy the full SHA 647ecf5View commit details -
Add focusEditorOnEscape to NavigableToolbar to return focus to editor
If we remove the bubblesVirtually from the block-controls slot, then the event will bubble in the DOM as normal (instead of the React Tree only since bubblesVirtually uses createPortal for the fills). This means we could handle the event without any forwardRefs as we don't need to block the escape shortcut keypress event from the React Tree. However, we assume bubblesVirtually was made for a reason. So, we're unsure if something would break.
Configuration menu - View commit details
-
Copy full SHA for 0f34d47 - Browse repository at this point
Copy the full SHA 0f34d47View commit details -
Consolodate block tools into one fill component and conditionally ren…
…der into slot or within block editor
Configuration menu - View commit details
-
Copy full SHA for 55cbde4 - Browse repository at this point
Copy the full SHA 55cbde4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6162985 - Browse repository at this point
Copy the full SHA 6162985View commit details -
Configuration menu - View commit details
-
Copy full SHA for b749291 - Browse repository at this point
Copy the full SHA b749291View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1cdf89e - Browse repository at this point
Copy the full SHA 1cdf89eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c15c5b1 - Browse repository at this point
Copy the full SHA c15c5b1View commit details -
isBlockToolsCollapsed state and styles for edit site header
Move isCollapsed state from the block-contextual-toolbar into the site editor header, as it is only needed and related to the site editor header. This is not a state the block toolbar needs to know about. Co-authored-by: Andrei Draganescu <me@andreidraganescu.info>
Configuration menu - View commit details
-
Copy full SHA for 1e54077 - Browse repository at this point
Copy the full SHA 1e54077View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85ac216 - Browse repository at this point
Copy the full SHA 85ac216View commit details -
Only allow block tool collapse to impact large viewports
If the block toolbar was collapsed in the large viewport, then the viewport is resized to be small enough that the toolbar should move to underneath the header, the toolbar would be in the collapsed state so it would not show.
Configuration menu - View commit details
-
Copy full SHA for a6e542e - Browse repository at this point
Copy the full SHA a6e542eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 818bdf7 - Browse repository at this point
Copy the full SHA 818bdf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2364439 - Browse repository at this point
Copy the full SHA 2364439View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7551136 - Browse repository at this point
Copy the full SHA 7551136View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c3dcdf - Browse repository at this point
Copy the full SHA 6c3dcdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab1c29e - Browse repository at this point
Copy the full SHA ab1c29eView commit details -
Configuration menu - View commit details
-
Copy full SHA for accedb5 - Browse repository at this point
Copy the full SHA accedb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e24d203 - Browse repository at this point
Copy the full SHA e24d203View commit details -
Configuration menu - View commit details
-
Copy full SHA for da3a1ea - Browse repository at this point
Copy the full SHA da3a1eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 484f118 - Browse repository at this point
Copy the full SHA 484f118View commit details -
Pass keydown listener into navigable toolbar instead of removing bubb…
…lesVirtually from the toolbar group slot Removing bubblesVirtually from the toolbar group slot prevents any dynamically added toolbar buttons from firing their click event. This can be seen when cropping an image, you press Crop, then the Apply and Cancel buttons get added to the toolbar. Those button events don’t fire properly and is mentioned as an issue in the bubblesVirtually slot fill PR: #19242
Configuration menu - View commit details
-
Copy full SHA for 6addc4f - Browse repository at this point
Copy the full SHA 6addc4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cd01cf - Browse repository at this point
Copy the full SHA 9cd01cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c80738 - Browse repository at this point
Copy the full SHA 6c80738View commit details -
Resizeable box (for resizing cover block) should use after block popo…
…ver slot The block-popover slot is reserved for block-toolbar like popovers, such as the captions popover, and will appear in the header dom. Popovers that don't need to be in the head should use the __unstable-block-tools-after slot
Configuration menu - View commit details
-
Copy full SHA for 6bed696 - Browse repository at this point
Copy the full SHA 6bed696View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ddeb0b - Browse repository at this point
Copy the full SHA 5ddeb0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ebb4d9 - Browse repository at this point
Copy the full SHA 6ebb4d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc0b4dd - Browse repository at this point
Copy the full SHA cc0b4ddView commit details -
Clarify getLastFocus description
Co-authored-by: Andrei Draganescu <me@andreidraganescu.info>
Configuration menu - View commit details
-
Copy full SHA for bcfb65b - Browse repository at this point
Copy the full SHA bcfb65bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e96401d - Browse repository at this point
Copy the full SHA e96401dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1066c4 - Browse repository at this point
Copy the full SHA f1066c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92f95f1 - Browse repository at this point
Copy the full SHA 92f95f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e565a8a - Browse repository at this point
Copy the full SHA e565a8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b1da15c - Browse repository at this point
Copy the full SHA b1da15cView commit details -
Refactor to remove data from useSelectedBlockToolProps that were not …
…used by the empty block inserter
Configuration menu - View commit details
-
Copy full SHA for bf5e941 - Browse repository at this point
Copy the full SHA bf5e941View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8072e7a - Browse repository at this point
Copy the full SHA 8072e7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 267863a - Browse repository at this point
Copy the full SHA 267863aView commit details -
Hide block tools popover behind post header
This is a tricky one. To hide the popover behind the header when it's within the header DOM means we need to have something within the header with a higher z-index for the popover to hide behind. Everything else in the header needs a high z index to be be on top of the header.
Configuration menu - View commit details
-
Copy full SHA for ba354bd - Browse repository at this point
Copy the full SHA ba354bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2167e7 - Browse repository at this point
Copy the full SHA d2167e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d23a4cf - Browse repository at this point
Copy the full SHA d23a4cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 60a8d69 - Browse repository at this point
Copy the full SHA 60a8d69View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc03bd1 - Browse repository at this point
Copy the full SHA bc03bd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3788c00 - Browse repository at this point
Copy the full SHA 3788c00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07ac3b8 - Browse repository at this point
Copy the full SHA 07ac3b8View commit details -
Fixing more positioning hacks with flexbox
Adding position absolute to all instances of __background-style lets it be excluded from all flexbox calculations, which is what we want. If the div is empty, it still gets calculated and pushes elements around.
Configuration menu - View commit details
-
Copy full SHA for fa398e1 - Browse repository at this point
Copy the full SHA fa398e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c3b650c - Browse repository at this point
Copy the full SHA c3b650cView commit details -
This test was already covered well by 'ensures base block toolbars use roving tabindex'
Configuration menu - View commit details
-
Copy full SHA for 8d57813 - Browse repository at this point
Copy the full SHA 8d57813View commit details -
Handle escape on toolbar via toolbar event listener instead of children
This method requires forwarding a ref from the editor level down to the navigable toolbar so that the escape unselect shortcut can be blocked and the navigable toolbar event listener will still fire. Blocking the global escape event shouldn't be necessary, but we have a combination of a few things all combining to create a situation where: - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element. - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it. Also, this is better than attaching it to all of the children in the block toolbar because when new items are attached to the toolbar (such as via the bubblesVirtually slots or the apply/cancel buttons when cropping an image) we can still catch the events. Otherwise, those buttons are added after the mount, and the children don't receive the listener.
Configuration menu - View commit details
-
Copy full SHA for 4c662de - Browse repository at this point
Copy the full SHA 4c662deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c54480 - Browse repository at this point
Copy the full SHA 0c54480View commit details -
Configuration menu - View commit details
-
Copy full SHA for a291e1f - Browse repository at this point
Copy the full SHA a291e1fView commit details -
Switch to object notation to avoid bugs like I introduced where the o…
…rder of the params matters
Configuration menu - View commit details
-
Copy full SHA for c12381e - Browse repository at this point
Copy the full SHA c12381eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1449b4a - Browse repository at this point
Copy the full SHA 1449b4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cc91d9 - Browse repository at this point
Copy the full SHA 9cc91d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a96e02 - Browse repository at this point
Copy the full SHA 3a96e02View commit details