-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add distraction free to site editor (#51173)
* adds preference setter in UI * Fix distraction free toolbar showing The store has the variable `distractionFree`, but `isDistractionFree` was incorrectly being used. * fix distraction free flag in site editor, revert change in block toolbar hook * basic distraction free enabled * hide header items in distraction free * fix the JS test for settings * fix the other test for editor settings * remove the rerendering of the site editor header to maintain focus on the writing options menu item * animated hader in edit mode for distraction free * fix sidebar header * move static objects out of components * Refactor distractionFree site editor animations All animations are now triggered by the edit-site-layout__header-container which has an animationState determined by the view and isDistractionFree mode. It also currently sets a isDistractionFreeHovering animation when hovering that element. This will likely need to change to be able to keep the distraction free header visible when one of the header popovers is open. * Remove invalid animation values for initial and exit * Fix bug where edit-mode__actions would get stuck in isDistractionFreeState The actions would get stuck in the isDistractionFree state when: - loading the page in the editor view with distraction free on - turn off distraction free - action stuck above the frame Why? Because the initial state of that component was -50px on page load, so that's what it would transition to when isDistractionFree was turned off. To fix this, we needed to either set an initial state of x: 0 so it can transition to that property, OR assign values for the other states like view or edit so it has a place to transition to. * Override animation with !important CSS when focus is within header on distraction-free mode * Adjust animation exit delay for header so the header remains visible longer when hovering out. * remove hardcoded z-index * turn off distraction free mode when opening the styles sidebar from site view * add distraction free mode to preferences panel in the site editor * Adds the distraction free mode keyboard shortcut --------- Co-authored-by: Alex Lende <[email protected]> Co-authored-by: Jerry Jones <[email protected]>
- Loading branch information
1 parent
4429f29
commit dc0cd5d
Showing
21 changed files
with
429 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
Oops, something went wrong.
dc0cd5d
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.
Flaky tests detected in dc0cd5d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5356895176
📝 Reported issues:
specs/editor/various/autosave.test.js