diff --git a/theme/assets/src/block-editor/hooks.js b/theme/assets/src/block-editor/hooks.js index 133ff3f64..bd2d1617e 100644 --- a/theme/assets/src/block-editor/hooks.js +++ b/theme/assets/src/block-editor/hooks.js @@ -21,6 +21,11 @@ import { addFilter } from '@wordpress/hooks'; import { createHigherOrderComponent } from '@wordpress/compose'; import { useEffect } from '@wordpress/element'; +const blockClassPrefillMap = { + 'core/site-title': 'site-title mdc-typography mdc-typography--headline6', + 'core/post-title': 'mdc-typography mdc-typography-headline2 entry-title', +}; + /** * Trigger a class change when component is rendered. * @@ -36,10 +41,9 @@ const withAttributeChange = createHigherOrderComponent( BlockEdit => { } = props; useEffect( () => { - if ( 'core/site-title' === name && ! className ) { + if ( blockClassPrefillMap[ name ] && ! className ) { props.setAttributes( { - className: - 'site-title mdc-typography mdc-typography--headline6', + className: blockClassPrefillMap[ name ], } ); } // Use empty array to make sure this runs only once. diff --git a/theme/assets/src/block-editor/plugins/hide-sections/index.js b/theme/assets/src/block-editor/plugins/hide-sections/index.js index 4607fb3c7..aaa5b081e 100644 --- a/theme/assets/src/block-editor/plugins/hide-sections/index.js +++ b/theme/assets/src/block-editor/plugins/hide-sections/index.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +/* global materialDesignThemeEditorVars */ /** * Wordpress Dependencies */ @@ -117,7 +117,10 @@ const WrappedSectionControl = compose( [ } ), ] )( HideSection ); -registerPlugin( 'material-hide-sections', { - render: WrappedSectionControl, - icon: , -} ); +/** @member {{isFse:boolean}} materialDesignThemeEditorVars */ +if ( ! materialDesignThemeEditorVars?.isFse ) { + registerPlugin( 'material-hide-sections', { + render: WrappedSectionControl, + icon: , + } ); +} diff --git a/theme/block-templates/blank.html b/theme/block-templates/blank.html new file mode 100644 index 000000000..3fed9dcdf --- /dev/null +++ b/theme/block-templates/blank.html @@ -0,0 +1 @@ + diff --git a/theme/block-templates/page-no-title.html b/theme/block-templates/page-no-title.html new file mode 100644 index 000000000..febbe92e9 --- /dev/null +++ b/theme/block-templates/page-no-title.html @@ -0,0 +1,11 @@ + + + +
+ + + +
+ + + diff --git a/theme/block-templates/page.html b/theme/block-templates/page.html index a5657e947..e87e28a80 100644 --- a/theme/block-templates/page.html +++ b/theme/block-templates/page.html @@ -1,23 +1,16 @@ - -
- - -
- + +
- - - +
+ - -
- -
+ +
- +
diff --git a/theme/inc/block-editor.php b/theme/inc/block-editor.php index cc4434753..37a04e36e 100644 --- a/theme/inc/block-editor.php +++ b/theme/inc/block-editor.php @@ -27,7 +27,9 @@ function setup() { add_action( 'init', __NAMESPACE__ . '\\register_disable_section_meta' ); add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\enqueue_block_editor_assets' ); - add_action( 'body_class', __NAMESPACE__ . '\\filter_body_class' ); + if ( ! is_fse() ) { + add_action( 'body_class', __NAMESPACE__ . '\\filter_body_class' ); + } $blocks = new Blocks(); $blocks->init(); @@ -84,6 +86,14 @@ function enqueue_block_editor_assets() { false ); + wp_localize_script( + 'material-block-editor-js-theme', + 'materialDesignThemeEditorVars', + [ + 'isFse' => is_fse(), + ] + ); + if ( ! wp_style_is( 'material-google-fonts', 'enqueued' ) ) { // Ideally this should be injected by the plugin if not fallback to default fonts. wp_enqueue_style( diff --git a/theme/theme.json b/theme/theme.json index 70b4910a3..49d5b50a0 100644 --- a/theme/theme.json +++ b/theme/theme.json @@ -9,6 +9,13 @@ "page", "post" ] + }, + { + "name": "page-no-title", + "title": "Page (No Title)", + "postTypes": [ + "page" + ] } ], "templateParts": [