Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styles: remove wp-editor from wp-edit-blocks dependencies #33496

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions 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 Expand Up @@ -387,7 +386,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-navigation',
gutenberg_url( 'build/edit-navigation/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-edit-blocks' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks' ),
$version
);
$styles->add_data( 'wp-edit-navigation', 'rtl', 'replace' );
Expand All @@ -396,7 +395,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-site',
gutenberg_url( 'build/edit-site/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-edit-blocks' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks' ),
$version
);
$styles->add_data( 'wp-edit-site', 'rtl', 'replace' );
Expand All @@ -405,7 +404,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-edit-widgets',
gutenberg_url( 'build/edit-widgets/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-edit-blocks', 'wp-reusable-blocks', 'wp-widgets' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-reusable-blocks', 'wp-widgets' ),
$version
);
$styles->add_data( 'wp-edit-widgets', 'rtl', 'replace' );
Expand All @@ -423,7 +422,7 @@ function gutenberg_register_packages_styles( $styles ) {
$styles,
'wp-customize-widgets',
gutenberg_url( 'build/customize-widgets/style.css' ),
array( 'wp-components', 'wp-block-editor', 'wp-edit-blocks', 'wp-widgets' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-widgets' ),
$version
);
$styles->add_data( 'wp-customize-widgets', 'rtl', 'replace' );
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";