Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2b3c19d
Update CHANGELOG
SiobhyB Mar 24, 2022
37960ce
Add 'add content' text
SiobhyB Mar 24, 2022
5ad815a
Add 'isDefaultView' check
SiobhyB Mar 24, 2022
556ac19
Rename CSS selectors to follow BEM methodology
SiobhyB Mar 24, 2022
53db20c
[WIP] Implement styles using 'isDefaultView' check
SiobhyB Mar 24, 2022
392832f
Separate 'defaultViewProps' for readability
SiobhyB Mar 25, 2022
b0693a7
Improvement to CSS code quality
SiobhyB Mar 29, 2022
8197083
Separate 'defaultViewText' into its own variable
SiobhyB Mar 29, 2022
46c31dd
Update CHANGELOG
SiobhyB Mar 29, 2022
03aa6ae
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Mar 29, 2022
532c437
Remove redundant code causing unit test failure
SiobhyB Mar 29, 2022
b7ac622
Add styling for dark mode
SiobhyB Mar 29, 2022
d699e78
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Mar 29, 2022
38df61c
Vertically align text within button
SiobhyB Mar 31, 2022
4af6403
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Mar 31, 2022
005e6c7
Update text for clarity
SiobhyB Mar 31, 2022
4b5aa48
Assign larger height to toolbar in default view
SiobhyB Apr 6, 2022
19e5eb5
Hide new default view style when title's selected
SiobhyB Apr 6, 2022
ede9c16
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Apr 6, 2022
0212fbf
Apply CSS for default toolbar
SiobhyB Apr 6, 2022
c31c897
Tweaks to button's styling
SiobhyB Apr 6, 2022
d8684a2
Update text in expanded button
SiobhyB Apr 7, 2022
0039c10
Set icon size to 24 (the default)
SiobhyB Apr 7, 2022
7769cac
Update height of editor's default toolbar
SiobhyB Apr 7, 2022
4a2ed4a
Refine expanded button's padding
SiobhyB Apr 7, 2022
c459a7b
Update button's background colour in light mode
SiobhyB Apr 7, 2022
d2822fe
Prevent expanded button displaying in some cases
SiobhyB Apr 7, 2022
82eeb5f
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Apr 7, 2022
7d3399f
Revert "false fix"
SiobhyB Apr 8, 2022
fd73fa6
Turn 'isDefaultView' into 'global' editor setting
SiobhyB Apr 10, 2022
db5d32e
Prevent unwanted 'flash' of 'expanded' button
SiobhyB Apr 10, 2022
a35a8e5
Tweak code comment for clarity
SiobhyB Apr 10, 2022
3715ee6
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
SiobhyB Apr 10, 2022
ac5607e
Remove redundant code causing test failures
SiobhyB Apr 10, 2022
95cda71
Revert "Remove redundant code causing test failures"
SiobhyB Apr 10, 2022
24d9294
Revert "Turn 'isDefaultView' into 'global' editor setting"
fluiddot Apr 12, 2022
adf4173
Revert "Prevent unwanted 'flash' of 'expanded' button"
fluiddot Apr 12, 2022
bc9b4ea
Preserve isDefaultView value while inserter is open
fluiddot Apr 12, 2022
86fada7
Rename isInserterOpen state value
fluiddot Apr 12, 2022
28e772b
Apply BEM naming in header toolbar styles
fluiddot Apr 12, 2022
ee54130
Rename default view to expanded mode
fluiddot Apr 12, 2022
ee12890
Use hasSelectedBlock selector
fluiddot Apr 12, 2022
fc2403f
Fix header toolbar height in layout component
fluiddot Apr 12, 2022
4106e33
Add style mock
fluiddot Apr 12, 2022
1820356
Merge branch 'trunk' into rnmobile/update/default-block-inserter-button
fluiddot Apr 13, 2022
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
Prev Previous commit
Next Next commit
Revert "Turn 'isDefaultView' into 'global' editor setting"
This reverts commit fd73fa6.
  • Loading branch information
fluiddot committed Apr 12, 2022
commit 24d929482b74c93eda78de3b8c66698d1c507648
1 change: 0 additions & 1 deletion packages/block-editor/src/store/defaults.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const SETTINGS_DEFAULTS = {
background: true,
},
},
isDefaultView: true,
};

export { PREFERENCES_DEFAULTS, SETTINGS_DEFAULTS };
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,13 @@ export default compose( [
getBlockRootClientId,
getBlockSelectionEnd,
hasInserterItems,
getSelectedBlockClientId,
} = select( blockEditorStore );
const { getEditorSettings } = select( editorStore );
const { getEditorSettings, isPostTitleSelected } = select(
editorStore
);
const isAnyBlockSelected = getSelectedBlockClientId();
const isTitleSelected = isPostTitleSelected();
return {
hasRedo: select( editorStore ).hasEditorRedo(),
hasUndo: select( editorStore ).hasEditorUndo(),
Expand All @@ -143,8 +148,7 @@ export default compose( [
isTextModeEnabled:
select( editPostStore ).getEditorMode() === 'text',
isRTL: select( blockEditorStore ).getSettings().isRTL,
isDefaultView: select( blockEditorStore ).getSettings()
.isDefaultView,
isDefaultView: ! isAnyBlockSelected && ! isTitleSelected,
};
} ),
withDispatch( ( dispatch ) => {
Expand Down
17 changes: 3 additions & 14 deletions packages/edit-post/src/editor.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { I18nManager } from 'react-native';
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
import { EditorProvider, store as editorStore } from '@wordpress/editor';
import { EditorProvider } from '@wordpress/editor';
import { parse, serialize, store as blocksStore } from '@wordpress/blocks';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
Expand All @@ -19,7 +19,6 @@ import {
} from '@wordpress/react-native-bridge';
import { SlotFillProvider } from '@wordpress/components';
import { store as coreStore } from '@wordpress/core-data';
import { store as blockEditorStore } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -53,15 +52,13 @@ class Editor extends Component {
hasFixedToolbar,
focusMode,
hiddenBlockTypes,
blockTypes,
isDefaultView
blockTypes
) {
settings = {
...settings,
isRTL: I18nManager.isRTL,
hasFixedToolbar,
focusMode,
isDefaultView,
};

// Omit hidden block types if exists and non-empty.
Expand Down Expand Up @@ -141,7 +138,6 @@ class Editor extends Component {
postType,
featuredImageId,
initialHtml,
isDefaultView,
...props
} = this.props;

Expand All @@ -150,8 +146,7 @@ class Editor extends Component {
hasFixedToolbar,
focusMode,
hiddenBlockTypes,
blockTypes,
isDefaultView
blockTypes
);

const normalizedPost = post || {
Expand Down Expand Up @@ -189,17 +184,13 @@ class Editor extends Component {

export default compose( [
withSelect( ( select ) => {
const { getSelectedBlockClientId } = select( blockEditorStore );
const { isPostTitleSelected } = select( editorStore );
const {
isFeatureActive,
getEditorMode,
__experimentalGetPreviewDeviceType,
getHiddenBlockTypes,
} = select( editPostStore );
const { getBlockTypes } = select( blocksStore );
const isAnyBlockSelected =
getSelectedBlockClientId() || isPostTitleSelected();

return {
hasFixedToolbar:
Expand All @@ -209,8 +200,6 @@ export default compose( [
mode: getEditorMode(),
hiddenBlockTypes: getHiddenBlockTypes(),
blockTypes: getBlockTypes(),
isDefaultView:
isFeatureActive( 'isDefaultView' ) && ! isAnyBlockSelected,
};
} ),
withDispatch( ( dispatch ) => {
Expand Down
1 change: 0 additions & 1 deletion packages/edit-post/src/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function initializeEditor( id, postType, postId ) {
openPanels: [ 'post-status' ],
preferredStyleVariations: {},
welcomeGuide: true,
isDefaultView: true,
} );

return <Editor postId={ postId } postType={ postType } />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import { store as editorStore } from '../../store';

function useNativeBlockEditorSettings( settings, hasTemplate ) {
const capabilities = settings.capabilities ?? {};
const editorSettings = {
...useBlockEditorSettings( settings, hasTemplate ),
isDefaultView: settings.isDefaultView,
};
const editorSettings = useBlockEditorSettings( settings, hasTemplate );

const supportReusableBlock = capabilities.reusableBlock === true;
const { reusableBlocks } = useSelect(
Expand Down