-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce distraction free mode (#41740)
* enhances the effect of the reduceUI preference - hide all the chrome of the editor, including the block toolbar, top bar, most top bar buttons, insertion point and closes any sidebars Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> Co-authored-by: James Koster <846565+jameskoster@users.noreply.github.com> * snapshot update * remove useless prop * Adds framer motion animation to header elements in distraction free mode. Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> Co-authored-by: James Koster <846565+jameskoster@users.noreply.github.com> * Adjusts the bottom distance of snackbars for distraction free mode. Co-authored-by: Javier Arce <4933+javierarce@users.noreply.github.com> * Deals with editor notices: - moves them to the header of the interface skeleton - moves them on top of the interface header to make them dismissable Co-authored-by: Javier Arce <4933+javierarce@users.noreply.github.com> Co-authored-by: Joen A. <1204802+jasmussen@users.noreply.github.com> * Limits notices in interface header only when distraction free mode is on. Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> * Handles toolbar focus in distraction free mode: - Shift+Tab shows the top toolbar and allos reverse tabbing - Alt+F10 is disabled like in other situations when focusin the toolbar not possible Co-authored-by: Alex Stine <13755480+alexstine@users.noreply.github.com> * Removes wrong visual margin artefact for notifications in DFM Co-authored-by: Javier Arce <4933+javierarce@users.noreply.github.com> * refactores reducedUI to distractionFree and hasReducedUI to isDistractionFree * Fixes the page jump in distraction free mode. Part of this bug but with a different cause exists in trunk as well. Co-authored-by: Ella van Durpe <4710635+ellatrix@users.noreply.github.com> * Bulk adds the same distraction free mode toggle effects to: - toggle in the writing menu - the keyboard shortcut - the preference toggle Adds a new action to set a feature to a desired value. Some duplication, not sure how to DRY. * Removes "reduce UI" from the prefferences modal. Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> * adds back slash to allowed chars in shortcuts visual expression * fix snapshot and pref modal test * fix pref modal bug introduced by prev commit * use only one useSelect for easier mock implementation * adds correct order of mocked return values for useSelect * fix order of flags in the prefferences modal * Moves focus on distraction free toggle to first block via block selection. Unclear what to do when there is not a post edited by a block editor, but one where the flow of the block list is not linear. Co-authored-by: Alex Stine <13755480+alexstine@users.noreply.github.com> * Remove double border in header and add subtle backdrop transparency. * Let's not use "Toggle interface" as a name. * Removes the inline toolbar in distraction free mode. For those who have tested this PR run this in console to unset the preference, which is not otherwise visible anywhere: ``` wp.data.dispatch( 'core/preferences' ).set('core/edit-post', 'inlineToolbar', false); ``` Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> * Adds the mode selector, undo, redo and doc stats back to the toolbar. Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> * creates the distraction free experiment * Revert "creates the distraction free experiment" This reverts commit 4565b66. * Combines two css rules into one. Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> * Undo a new public API `setFeature` in the prefferences package. Use the store directly instead. Co-authored-by: Daniel Richards <677833+talldan@users.noreply.github.com> * Fixes small nits in code. Co-authored-by: Ben Dwyer <275961+scruffian@users.noreply.github.com> Co-authored-by: Matias Ventura <548849+mtias@users.noreply.github.com> Co-authored-by: James Koster <846565+jameskoster@users.noreply.github.com> Co-authored-by: Javier Arce <4933+javierarce@users.noreply.github.com> Co-authored-by: Joen A. <1204802+jasmussen@users.noreply.github.com> Co-authored-by: Alex Stine <13755480+alexstine@users.noreply.github.com> Co-authored-by: Ella van Durpe <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Matías Ventura <mv@matiasventura.com> Co-authored-by: Daniel Richards <677833+talldan@users.noreply.github.com> Co-authored-by: Ben Dwyer <275961+scruffian@users.noreply.github.com>
- Loading branch information
1 parent
6c4ee99
commit 1e2d8b0
Showing
22 changed files
with
332 additions
and
78 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
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.