-
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.
Fix the RTL editor styles and the theme styles option (#27947)
- Loading branch information
1 parent
470e644
commit bf2fc09
Showing
3 changed files
with
17 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,9 +102,7 @@ function Editor( { | |
|
||
const editorSettings = useMemo( () => { | ||
const result = { | ||
...( hasThemeStyles | ||
? settings | ||
: omit( settings, [ 'defaultEditorStyles' ] ) ), | ||
...omit( settings, [ 'defaultEditorStyles', 'styles' ] ), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
youknowriad
Author
Contributor
|
||
__experimentalPreferredStyleVariations: { | ||
value: preferredStyleVariations, | ||
onChange: updatePreferredStyleVariations, | ||
|
@@ -117,9 +115,6 @@ function Editor( { | |
// This is marked as experimental to give time for the quick inserter to mature. | ||
__experimentalSetIsInserterOpened: setIsInserterOpened, | ||
keepCaretInsideBlock, | ||
styles: hasThemeStyles | ||
? settings.styles | ||
: settings.defaultEditorStyles, | ||
}; | ||
|
||
// Omit hidden block types if exists and non-empty. | ||
|
@@ -144,7 +139,6 @@ function Editor( { | |
hasFixedToolbar, | ||
focusMode, | ||
hasReducedUI, | ||
hasThemeStyles, | ||
hiddenBlockTypes, | ||
blockTypes, | ||
preferredStyleVariations, | ||
|
@@ -154,6 +148,10 @@ function Editor( { | |
keepCaretInsideBlock, | ||
] ); | ||
|
||
const styles = useMemo( () => { | ||
return hasThemeStyles ? settings.styles : settings.defaultEditorStyles; | ||
}, [ settings, hasThemeStyles ] ); | ||
|
||
if ( ! post ) { | ||
return null; | ||
} | ||
|
@@ -175,7 +173,7 @@ function Editor( { | |
> | ||
<ErrorBoundary onError={ onError }> | ||
<EditorInitialization postId={ postId } /> | ||
<Layout settings={ settings } /> | ||
<Layout styles={ styles } /> | ||
<KeyboardShortcuts | ||
shortcuts={ preventEventDiscovery } | ||
/> | ||
|
@youknowriad Why was it needed to remove the styles from the settings here? I need it in the block editor packages in #28165.