-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Reorganize the site editor to introduce Browse Mode. #44770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2090043
16b18f8
82d3778
c72f552
7b43bc2
525ce71
6ae91c8
11ba051
87df95d
c08add2
d6983d3
1d81206
2269126
54b547f
c5cf7d9
b5cae0e
5dcaea3
096b23b
62328a6
86914ed
ab14e6f
c070c55
0e139af
7331a5e
1e1b378
ce5f07f
138bb5b
da7fd8d
0a04fe4
b964e7c
fd12005
1505ab7
dd9a0f6
adbdafc
eddd2b5
3cd8109
b2e08f7
b2aff8a
5594734
133bdde
06d7833
63a4180
cd51ae8
913322f
64a75b7
e78bd97
9b437e1
d01e26a
1a0f80e
68fd4af
e954612
a4fbe48
0b36c3c
258622b
4b312eb
8d7e1d5
72f74fc
c228eb6
0263436
7b92eb8
3aaad16
e8918cd
940250e
ae2c7d0
82af6ca
fb76172
3efae5a
39b86fd
16de8a2
d5bc732
96e43b3
7f91013
c27764a
d54f42b
5676e75
ecfc594
04f8d7e
d53a47f
732cea6
ad0ff98
acb368f
3191104
d5dcbc7
a8683bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
| /** | ||
| * Updates the site-editor.php file | ||
| * | ||
| * @package gutenberg | ||
| */ | ||
|
|
||
| /** | ||
| * Remove home template setting for WP 6.2. | ||
| * | ||
| * @param array $settings Existing block editor settings. | ||
| * @param WP_Block_Editor_Context $context The current block editor context. | ||
| * @return array | ||
| */ | ||
| function gutenberg_site_editor_unset_homepage_setting( $settings, $context ) { | ||
| if ( isset( $context->post ) ) { | ||
| return $settings; | ||
| } | ||
|
|
||
| unset( $settings['__unstableHomeTemplate'] ); | ||
|
|
||
| return $settings; | ||
| } | ||
| add_filter( 'block_editor_settings_all', 'gutenberg_site_editor_unset_homepage_setting', 10, 2 ); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * External dependencies | ||
| */ | ||
| import type { Page } from '@playwright/test'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { enterEditMode } from './toggle-canvas-mode'; | ||
|
|
||
| type AdminConstructorProps = { | ||
| page: Page; | ||
| }; | ||
|
|
||
| export class SiteEditor { | ||
| page: Page; | ||
|
|
||
| constructor( { page }: AdminConstructorProps ) { | ||
| this.page = page; | ||
| } | ||
|
|
||
| enterEditMode = enterEditMode.bind( this ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * Enters the site editor edit mode. | ||
| * | ||
| * @this {import('.').SiteEditor} | ||
| */ | ||
| export async function enterEditMode() { | ||
| await this.page.click( '.edit-site-layout__edit-button' ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally don't think it's necessary to add a new It'd also be good to favor role selectors
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to follow what we did for the current utils but I'm happy to adjust if necessary. Where would you put this utility if it's not in a new SiteEditor class?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could go in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the idea of inlining because it's a very common utility in the site editor. Actually, thinking more, I think personally I like it better as it is. I can see us adding utilities to navigate between sidebar items in the site editor as we expand them. (going to templates, template parts, styles, navigation) |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.