Skip to content

Commit

Permalink
Remove use of contentOnly block editing mode for synced patterns (W…
Browse files Browse the repository at this point in the history
…ordPress#67364)

* Remove use of `contentOnly` block editing mode for synced patterns

* Update unit tests

----

Co-authored-by: talldan <[email protected]>
  • Loading branch information
talldan and talldan authored Nov 28, 2024
1 parent 9a9af21 commit 2f6ef27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ function getDerivedBlockEditingModesForTree(
return;
}

derivedBlockEditingModes.set( clientId, 'contentOnly' );
// Else do nothing, use the default block editing mode.
return;
}

Expand Down
4 changes: 1 addition & 3 deletions packages/block-editor/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3828,7 +3828,6 @@ describe( 'state', () => {
expect( initialState.derivedBlockEditingModes ).toEqual(
new Map(
Object.entries( {
'root-pattern': 'contentOnly',
'pattern-paragraph': 'disabled',
'pattern-group': 'disabled',
'pattern-paragraph-with-overrides': 'contentOnly',
Expand Down Expand Up @@ -3883,7 +3882,6 @@ describe( 'state', () => {
expect( derivedBlockEditingModes ).toEqual(
new Map(
Object.entries( {
'root-pattern': 'contentOnly', // Pattern and section.
'pattern-paragraph': 'disabled',
'pattern-group': 'disabled',
'pattern-paragraph-with-overrides': 'contentOnly', // Pattern child with bindings.
Expand All @@ -3903,7 +3901,7 @@ describe( 'state', () => {
'paragraph-1': 'contentOnly', // Content block in section.
'group-2': 'disabled',
'paragraph-2': 'contentOnly', // Content block in section.
'root-pattern': 'contentOnly', // Pattern and section.
'root-pattern': 'contentOnly', // Section.
'pattern-paragraph': 'disabled',
'pattern-group': 'disabled',
'pattern-paragraph-with-overrides': 'contentOnly', // Pattern child with bindings.
Expand Down

0 comments on commit 2f6ef27

Please sign in to comment.