forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (WordPress#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
6b923a3
commit 2183b1a
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.