diff --git a/packages/block-library/src/index.native.js b/packages/block-library/src/index.native.js index 984e5c290135d0..863cd4ef3315d1 100644 --- a/packages/block-library/src/index.native.js +++ b/packages/block-library/src/index.native.js @@ -179,14 +179,6 @@ const devOnly = ( block ) => ( !! __DEV__ ? block : null ); const iOSOnly = ( block ) => Platform.OS === 'ios' ? block : devOnly( block ); -// To be removed once Quote V2 is released on the web editor. -function quoteCheck( quoteBlock, blocksFlags ) { - if ( blocksFlags?.__experimentalEnableQuoteBlockV2 ) { - quoteBlock.settings = quoteBlock?.settingsV2; - } - return quoteBlock; -} - // Hide the Classic block and SocialLink block addFilter( 'blocks.registerBlockType', @@ -238,10 +230,9 @@ addFilter( * * registerCoreBlocks(); * ``` - * @param {Object} [blocksFlags] Experimental flags * */ -export const registerCoreBlocks = ( blocksFlags ) => { +export const registerCoreBlocks = () => { // When adding new blocks to this list please also consider updating /src/block-support/supported-blocks.json in the Gutenberg-Mobile repo [ paragraph, @@ -254,7 +245,7 @@ export const registerCoreBlocks = ( blocksFlags ) => { nextpage, separator, list, - quoteCheck( quote, blocksFlags ), + quote, mediaText, preformatted, gallery, diff --git a/packages/edit-post/src/test/editor.native.js b/packages/edit-post/src/test/editor.native.js index b1eee7eb1234be..5293cf35c12abe 100644 --- a/packages/edit-post/src/test/editor.native.js +++ b/packages/edit-post/src/test/editor.native.js @@ -28,9 +28,7 @@ const unsupportedBlock = ` jest.useFakeTimers( 'legacy' ); describe( 'Editor', () => { - beforeAll( () => { - registerCoreBlocks(); - } ); + beforeAll( registerCoreBlocks ); it( 'detects unsupported block and sends hasUnsupportedBlocks true to native', () => { RNReactNativeGutenbergBridge.editorDidMount = jest.fn(); diff --git a/packages/react-native-editor/src/setup.js b/packages/react-native-editor/src/setup.js index b55b9a4253cec3..8457f3998b2d83 100644 --- a/packages/react-native-editor/src/setup.js +++ b/packages/react-native-editor/src/setup.js @@ -58,12 +58,9 @@ const gutenbergSetup = () => { const setupInitHooks = () => { addAction( 'native.pre-render', 'core/react-native-editor', ( props ) => { - const capabilities = props.capabilities ?? {}; - const blocksFlags = { - __experimentalEnableQuoteBlockV2: props?.quoteBlockV2, - }; + registerBlocks(); - registerBlocks( blocksFlags ); + const capabilities = props.capabilities ?? {}; // Unregister non-supported blocks by capabilities if ( @@ -119,12 +116,12 @@ const setupInitHooks = () => { }; let blocksRegistered = false; -const registerBlocks = ( blocksFlags ) => { +const registerBlocks = () => { if ( blocksRegistered ) { return; } - registerCoreBlocks( blocksFlags ); + registerCoreBlocks(); blocksRegistered = true; }; diff --git a/packages/react-native-editor/src/test/index.test.js b/packages/react-native-editor/src/test/index.test.js index 9d4569b114ec32..b80509b7fdc8af 100644 --- a/packages/react-native-editor/src/test/index.test.js +++ b/packages/react-native-editor/src/test/index.test.js @@ -190,7 +190,8 @@ describe( 'Register Gutenberg', () => { {}, { component: EditorComponent } ); - const blockList = screen.getByTestId( 'block-list-wrapper' ); + // Inner blocks create BlockLists so let's take into account selecting the main one + const blockList = screen.getAllByTestId( 'block-list-wrapper' )[ 0 ]; expect( blockList ).toBeVisible(); expect( console ).toHaveLoggedWith( 'Hermes is: true' );