diff --git a/packages/block-editor/src/components/block-list/block-outline.native.js b/packages/block-editor/src/components/block-list/block-outline.native.js deleted file mode 100644 index eabff38fa6e7b..0000000000000 --- a/packages/block-editor/src/components/block-list/block-outline.native.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * External dependencies - */ -import { View } from 'react-native'; - -/** - * WordPress dependencies - */ -import { usePreferredColorSchemeStyle } from '@wordpress/compose'; -import { alignmentHelpers } from '@wordpress/components'; - -/** - * Internal dependencies - */ -import styles from './block.scss'; - -function BlockOutline( { - align, - blockWidth, - isParentSelected, - isSelected, - name, - screenWidth, -} ) { - const { isFullWidth, isContainerRelated } = alignmentHelpers; - const isScreenWidthWider = blockWidth < screenWidth; - - const styleSolidBorder = [ - styles.solidBorder, - isFullWidth( align ) && isScreenWidthWider && styles.borderFullWidth, - isFullWidth( align ) && - isContainerRelated( name ) && - isScreenWidthWider && - styles.containerBorderFullWidth, - usePreferredColorSchemeStyle( - styles.solidBorderColor, - styles.solidBorderColorDark - ), - ]; - const styleDashedBorder = [ - styles.dashedBorder, - usePreferredColorSchemeStyle( - styles.dashedBorderColor, - styles.dashedBorderColorDark - ), - ]; - - return ( - <> - { isSelected && ( - - ) } - { isParentSelected && } - - ); -} - -export default BlockOutline; diff --git a/packages/block-editor/src/components/block-list/block.native.js b/packages/block-editor/src/components/block-list/block.native.js index 89f30572fe331..4f1e335f15271 100644 --- a/packages/block-editor/src/components/block-list/block.native.js +++ b/packages/block-editor/src/components/block-list/block.native.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Pressable, useWindowDimensions, View } from 'react-native'; +import { Pressable, View } from 'react-native'; /** * WordPress dependencies @@ -35,7 +35,6 @@ import { compose, ifCondition, pure } from '@wordpress/compose'; import BlockEdit from '../block-edit'; import BlockDraggable from '../block-draggable'; import BlockInvalidWarning from './block-invalid-warning'; -import BlockOutline from './block-outline'; import { store as blockEditorStore } from '../../store'; import { useLayout } from './layout'; import useSetting from '../use-setting'; @@ -65,14 +64,12 @@ function BlockWrapper( { draggingClientId, draggingEnabled, isDescendentBlockSelected, - isParentSelected, isSelected, isTouchable, marginHorizontal, marginVertical, onFocus, } ) { - const { width: screenWidth } = useWindowDimensions(); const blockWrapperStyles = { flex: 1 }; const blockWrapperStyle = [ blockWrapperStyles, @@ -92,11 +89,6 @@ function BlockWrapper( { onPress={ onFocus } style={ blockWrapperStyle } > - @@ -258,8 +255,6 @@ export default compose( [ const parentId = getBlockRootClientId( clientId ); const hasChildren = !! getBlockCount( clientId ); - const isParentSelected = - selectedBlockClientId && selectedBlockClientId === parentId; const blockOrder = getBlockOrder( parentId ); @@ -271,7 +266,6 @@ export default compose( [ return { hasChildren, - isParentSelected, isSelected, selectedColumnIndex, columns, diff --git a/packages/block-library/src/column/editor.native.scss b/packages/block-library/src/column/editor.native.scss index ef937134a43c3..f76d85ff44b23 100644 --- a/packages/block-library/src/column/editor.native.scss +++ b/packages/block-library/src/column/editor.native.scss @@ -1,7 +1,3 @@ -.columnPlaceholderNotSelected { - padding-top: $block-selected-to-content; -} - .columnPlaceholder { flex: 1; padding: $block-selected-to-content; diff --git a/packages/edit-post/src/components/visual-editor/header.native.js b/packages/edit-post/src/components/visual-editor/header.native.js index 20ed9ae5d8164..f7679e531ec9e 100644 --- a/packages/edit-post/src/components/visual-editor/header.native.js +++ b/packages/edit-post/src/components/visual-editor/header.native.js @@ -16,23 +16,9 @@ import { useEditorWrapperStyles, } from '@wordpress/block-editor'; -/** - * Internal dependencies - */ -import styles from './style.scss'; - const Header = memo( - function EditorHeader( { - editTitle, - setTitleRef, - title, - getStylesFromColorScheme, - } ) { + function EditorHeader( { editTitle, setTitleRef, title } ) { const [ wrapperStyles ] = useEditorWrapperStyles(); - const blockHolderFocusedStyle = getStylesFromColorScheme( - styles.blockHolderFocused, - styles.blockHolderFocusedDark - ); return ( diff --git a/packages/edit-post/src/components/visual-editor/style.native.scss b/packages/edit-post/src/components/visual-editor/style.native.scss deleted file mode 100644 index 7475caa801a2b..0000000000000 --- a/packages/edit-post/src/components/visual-editor/style.native.scss +++ /dev/null @@ -1,18 +0,0 @@ -.blockHolderFullBordered { - border-top-width: $block-selected-border-width; - border-bottom-width: $block-selected-border-width; - border-left-width: $block-selected-border-width; - border-right-width: $block-selected-border-width; - border-radius: 4px; - border-style: solid; - margin-left: 4px; - margin-right: 4px; -} - -.blockHolderFocused { - border-color: $blue-wordpress; -} - -.blockHolderFocusedDark { - border-color: $blue-30; -} diff --git a/packages/editor/src/components/post-title/style.native.scss b/packages/editor/src/components/post-title/style.native.scss index 05727a318300a..42b0b5bce146d 100644 --- a/packages/editor/src/components/post-title/style.native.scss +++ b/packages/editor/src/components/post-title/style.native.scss @@ -1,10 +1,10 @@ .titleContainer { - padding-left: 12; - padding-right: 16; - padding-top: 12; - padding-bottom: 12; - margin-top: 24; + padding-left: $block-edge-to-content; + padding-right: $block-edge-to-content; + padding-top: 6; + padding-bottom: 6; + margin-top: 12; } .dimmed { diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 5a1dc4d533a68..2380e16ddb426 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -10,11 +10,12 @@ For each user feature we should also add a importance categorization label to i --> ## Unreleased +- [**] Add media inserter buttons to editor toolbar [#51827] +- [**] Update native BlockOutline component styles to remove blue border from blocks [#51222] ## 1.99.0 - [*] Rename "Reusable blocks" to "Synced patterns", aligning with the web editor. [#51704] - [**] Fix a crash related to Reanimated when closing the editor [#52320] -- [**] Add media inserter buttons to editor toolbar [#51827] ## 1.98.1 - [*] fix: Display heading level dropdown icons and labels [#52004] diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js index e17e39bd8357f..a5a1b10b692fd 100644 --- a/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js +++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-media-blocks-@canary.test.js @@ -125,9 +125,9 @@ onlyOniOS( 'Gutenberg Editor Cover Block test', () => { const { height } = await coverBlock.getSize(); // Height is set to 20rem, where 1rem is 16. - // There is also block's vertical padding equal 32. - // Finally, the total height should be 20 * 16 + 32 = 352. - expect( height ).toBe( 352 ); + // There is also block's vertical padding equal 16. + // Finally, the total height should be 20 * 16 + 16 = 336. + expect( height ).toBe( 336 ); await coverBlock.click(); expect( coverBlock ).toBeTruthy();