Skip to content

Commit

Permalink
Post Editor: Set the default value of the editorTool to edit (WordPre…
Browse files Browse the repository at this point in the history
…ss#66636)

* Post Editor: Set the default value of the editorTool to edit

* Change the condition of _showEmptyBlockSideInserter

* Set the default value of the editorTool to "edit" for both post editor and site editor
  • Loading branch information
arthur791004 authored Nov 1, 2024
1 parent d6cb227 commit b69bca9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export function useShowBlockTools() {
const _showEmptyBlockSideInserter =
clientId &&
! isTyping() &&
editorMode === 'edit' &&
// Hide the block inserter on the navigation mode.
// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
editorMode !== 'navigation' &&
isEmptyDefaultBlock;
const _showBlockToolbarPopover =
! getSettings().hasFixedToolbar &&
Expand Down
1 change: 1 addition & 0 deletions packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function initializeEditor(
dispatch( preferencesStore ).setDefaults( 'core', {
allowRightClickOverrides: true,
editorMode: 'visual',
editorTool: 'edit',
fixedToolbar: false,
hiddenBlockTypes: [],
inactivePanels: [],
Expand Down
1 change: 1 addition & 0 deletions packages/edit-post/src/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function initializeEditor( id, postType, postId ) {
welcomeGuide: true,
} );
dispatch( preferencesStore ).setDefaults( 'core', {
editorTool: 'edit',
hiddenBlockTypes: [],
inactivePanels: [],
openPanels: [ 'post-status' ],
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function initializeEditor( id, settings ) {
allowRightClickOverrides: true,
distractionFree: false,
editorMode: 'visual',
editorTool: 'edit',
fixedToolbar: false,
focusMode: false,
inactivePanels: [],
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export function initializePostsDashboard( id, settings ) {
allowRightClickOverrides: true,
distractionFree: false,
editorMode: 'visual',
editorTool: 'edit',
fixedToolbar: false,
focusMode: false,
inactivePanels: [],
Expand Down

0 comments on commit b69bca9

Please sign in to comment.