Skip to content

Commit

Permalink
Styles: remove wp-editor from wp-edit-blocks dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Sep 20, 2022
1 parent 749e412 commit 40ab267
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
1 change: 0 additions & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ function gutenberg_register_packages_styles( $styles ) {

$wp_edit_blocks_dependencies = array(
'wp-components',
'wp-editor',
// This need to be added before the block library styles,
// The block library styles override the "reset" styles.
'wp-reset-editor-styles',
Expand Down
9 changes: 8 additions & 1 deletion packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default function VisualEditor( { styles } ) {
themeSupportsLayout,
assets,
useRootPaddingAwareAlignments,
isFocusMode,
} = useSelect( ( select ) => {
const _settings = select( blockEditorStore ).getSettings();
return {
Expand All @@ -131,6 +132,7 @@ export default function VisualEditor( { styles } ) {
assets: _settings.__unstableResolvedAssets,
useRootPaddingAwareAlignments:
_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,
isFocusMode: _settings.focusMode,
};
}, [] );
const { clearSelectedBlock } = useDispatch( blockEditorStore );
Expand Down Expand Up @@ -265,7 +267,12 @@ export default function VisualEditor( { styles } ) {
) }
{ ! isTemplateMode && (
<div
className="edit-post-visual-editor__post-title-wrapper"
className={ classnames(
'edit-post-visual-editor__post-title-wrapper',
{
'is-focus-mode': isFocusMode,
}
) }
contentEditable={ false }
>
<PostTitle ref={ titleRef } />
Expand Down
17 changes: 7 additions & 10 deletions packages/editor/src/components/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,23 @@ function PostTitle( _, forwardedRef ) {
const { editPost } = useDispatch( editorStore );
const { insertDefaultBlock, clearSelectedBlock, insertBlocks } =
useDispatch( blockEditorStore );
const { isCleanNewPost, title, placeholder, isFocusMode, hasFixedToolbar } =
useSelect( ( select ) => {
const { isCleanNewPost, title, placeholder, hasFixedToolbar } = useSelect(
( select ) => {
const { getEditedPostAttribute, isCleanNewPost: _isCleanNewPost } =
select( editorStore );
const { getSettings } = select( blockEditorStore );
const {
titlePlaceholder,
focusMode,
hasFixedToolbar: _hasFixedToolbar,
} = getSettings();
const { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =
getSettings();

return {
isCleanNewPost: _isCleanNewPost(),
title: getEditedPostAttribute( 'title' ),
placeholder: titlePlaceholder,
isFocusMode: focusMode,
hasFixedToolbar: _hasFixedToolbar,
};
}, [] );
},
[]
);

useImperativeHandle( forwardedRef, () => ( {
focus: () => {
Expand Down Expand Up @@ -193,7 +191,6 @@ function PostTitle( _, forwardedRef ) {
'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text',
{
'is-selected': isSelected,
'is-focus-mode': isFocusMode,
'has-fixed-toolbar': hasFixedToolbar,
}
);
Expand Down
13 changes: 0 additions & 13 deletions packages/editor/src/components/post-title/style.scss

This file was deleted.

1 change: 0 additions & 1 deletion packages/editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@import "./components/post-text-editor/style.scss";
@import "./components/post-url/style.scss";
@import "./components/post-visibility/style.scss";
@import "./components/post-title/style.scss";
@import "./components/post-trash/style.scss";
@import "./components/table-of-contents/style.scss";
@import "./components/template-validation-notice/style.scss";

0 comments on commit 40ab267

Please sign in to comment.