From 5a623fbf0825298547b80f782e420610e6d61bab Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Wed, 30 Oct 2024 21:49:48 +0100 Subject: [PATCH] ensure that setting object is defined --- .../src/components/post-edit/index.js | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js index 2041e36bfe2db1..ecaa6221e2dec8 100644 --- a/packages/edit-site/src/components/post-edit/index.js +++ b/packages/edit-site/src/components/post-edit/index.js @@ -20,6 +20,8 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor'; import Page from '../page'; import usePostFields from '../post-fields'; import { unlock } from '../../lock-unlock'; +import usePatternSettings from '../page-patterns/use-pattern-settings'; +import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; const { PostCardPanel } = unlock( editorPrivateApis ); @@ -139,17 +141,26 @@ function PostEditForm( { postType, postId } ) { } export function PostEdit( { postType, postId } ) { + const { ExperimentalBlockEditorProvider } = unlock( + blockEditorPrivateApis + ); + const settings = usePatternSettings(); + // Wrap everything in a block editor provider. + // This ensures 'styles' that are needed for the previews are synced + // from the site editor store to the block editor store. return ( - - { postId && ( - - ) } - { ! postId &&

{ __( 'Select a page to edit' ) }

} -
+ + + { postId && ( + + ) } + { ! postId &&

{ __( 'Select a page to edit' ) }

} +
+
); }