@wordpress/build 0.8.1-next.v.202602271551.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +6 -0
- package/CHANGELOG.md +7 -0
- package/lib/build.mjs +106 -32
- package/package.json +2 -2
- package/templates/module-registration.php.template +40 -38
- package/templates/page-wp-admin.php.template +245 -236
- package/templates/page.php.template +264 -278
- package/templates/routes-page-functions.php.template +12 -16
- package/templates/routes-registration.php.template +49 -45
- package/templates/script-registration.php.template +65 -69
- package/templates/style-registration.php.template +52 -56
|
@@ -15,277 +15,286 @@ global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes, ${{PREFIX}}_{{PAGE_
|
|
|
15
15
|
${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes = array();
|
|
16
16
|
${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items = array();
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes;
|
|
28
|
-
|
|
29
|
-
$route = array( 'path' => $path );
|
|
30
|
-
if ( ! empty( $content_module ) ) {
|
|
31
|
-
$route['content_module'] = $content_module;
|
|
32
|
-
}
|
|
33
|
-
if ( ! empty( $route_module ) ) {
|
|
34
|
-
$route['route_module'] = $route_module;
|
|
35
|
-
}
|
|
18
|
+
/**
|
|
19
|
+
* Register a route for the {{PAGE_SLUG}}-wp-admin page.
|
|
20
|
+
*
|
|
21
|
+
* @param string $path Route path (e.g., '/types/$type/edit/$id').
|
|
22
|
+
* @param string|null $content_module Script module ID for content (stage/inspector).
|
|
23
|
+
* @param string|null $route_module Script module ID for route lifecycle hooks.
|
|
24
|
+
*/
|
|
25
|
+
function {{PREFIX}}_register_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_route( $path, $content_module = null, $route_module = null ) {
|
|
26
|
+
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes;
|
|
36
27
|
|
|
37
|
-
|
|
28
|
+
$route = array( 'path' => $path );
|
|
29
|
+
if ( ! empty( $content_module ) ) {
|
|
30
|
+
$route['content_module'] = $content_module;
|
|
38
31
|
}
|
|
32
|
+
if ( ! empty( $route_module ) ) {
|
|
33
|
+
$route['route_module'] = $route_module;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes[] = $route;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items;
|
|
53
|
-
|
|
54
|
-
$menu_item = array(
|
|
55
|
-
'id' => $id,
|
|
56
|
-
'label' => $label,
|
|
57
|
-
'to' => $to,
|
|
58
|
-
);
|
|
39
|
+
/**
|
|
40
|
+
* Register a menu item for the {{PAGE_SLUG}}-wp-admin page.
|
|
41
|
+
* Note: Menu items are registered but not displayed in single-page mode.
|
|
42
|
+
*
|
|
43
|
+
* @param string $id Menu item ID.
|
|
44
|
+
* @param string $label Display label.
|
|
45
|
+
* @param string $to Route path to navigate to.
|
|
46
|
+
* @param string $parent_id Optional. Parent menu item ID.
|
|
47
|
+
*/
|
|
48
|
+
function {{PREFIX}}_register_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) {
|
|
49
|
+
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items;
|
|
59
50
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
$menu_item = array(
|
|
52
|
+
'id' => $id,
|
|
53
|
+
'label' => $label,
|
|
54
|
+
'to' => $to,
|
|
55
|
+
);
|
|
63
56
|
|
|
64
|
-
|
|
57
|
+
if ( ! empty( $parent_id ) ) {
|
|
58
|
+
$menu_item['parent'] = $parent_id;
|
|
65
59
|
}
|
|
60
|
+
|
|
61
|
+
${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items[] = $menu_item;
|
|
66
62
|
}
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes ?? array();
|
|
77
|
-
}
|
|
64
|
+
/**
|
|
65
|
+
* Get all registered routes for the {{PAGE_SLUG}}-wp-admin page.
|
|
66
|
+
*
|
|
67
|
+
* @return array Array of route objects.
|
|
68
|
+
*/
|
|
69
|
+
function {{PREFIX}}_get_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes() {
|
|
70
|
+
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes;
|
|
71
|
+
return ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes ?? array();
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items ?? array();
|
|
89
|
-
}
|
|
74
|
+
/**
|
|
75
|
+
* Get all registered menu items for the {{PAGE_SLUG}}-wp-admin page.
|
|
76
|
+
*
|
|
77
|
+
* @return array Array of menu item objects.
|
|
78
|
+
*/
|
|
79
|
+
function {{PREFIX}}_get_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items() {
|
|
80
|
+
global ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items;
|
|
81
|
+
return ${{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_menu_items ?? array();
|
|
90
82
|
}
|
|
91
83
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Preload REST API data for the {{PAGE_SLUG}}-wp-admin page.
|
|
86
|
+
* Automatically called during page rendering.
|
|
87
|
+
*/
|
|
88
|
+
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_preload_data() {
|
|
89
|
+
// Define paths to preload - same for all pages
|
|
90
|
+
// Please also change packages/core-data/src/entities.js when changing this.
|
|
91
|
+
$preload_paths = array(
|
|
92
|
+
'/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,image_output_formats,jpeg_interlaced,png_interlaced,gif_interlaced,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
|
|
93
|
+
array( '/wp/v2/settings', 'OPTIONS' ),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Use rest_preload_api_request to gather the preloaded data
|
|
97
|
+
$preload_data = array_reduce(
|
|
98
|
+
$preload_paths,
|
|
99
|
+
'rest_preload_api_request',
|
|
100
|
+
array()
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// Register the preloading middleware with wp-api-fetch
|
|
104
|
+
wp_add_inline_script(
|
|
105
|
+
'wp-api-fetch',
|
|
106
|
+
sprintf(
|
|
107
|
+
'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );',
|
|
108
|
+
wp_json_encode( $preload_data )
|
|
109
|
+
),
|
|
110
|
+
'after'
|
|
111
|
+
);
|
|
112
|
+
}
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Enqueue scripts and styles for the {{PAGE_SLUG}}-wp-admin page.
|
|
116
|
+
* Hooked to admin_enqueue_scripts.
|
|
117
|
+
*
|
|
118
|
+
* @param string $hook_suffix The current admin page.
|
|
119
|
+
*/
|
|
120
|
+
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_enqueue_scripts( $hook_suffix ) {
|
|
121
|
+
// Check all possible ways this page can be accessed:
|
|
122
|
+
// 1. Menu page via admin.php?page={{PAGE_SLUG}}-wp-admin (plugin)
|
|
123
|
+
// 2. Direct file via {{PAGE_SLUG}}.php (Core) - screen ID will be '{{PAGE_SLUG}}'
|
|
124
|
+
$current_screen = get_current_screen();
|
|
125
|
+
$is_our_page = (
|
|
126
|
+
( isset( $_GET['page'] ) && '{{PAGE_SLUG}}-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
|
127
|
+
( $current_screen && '{{PAGE_SLUG}}' === $current_screen->id )
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if ( ! $is_our_page ) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
111
133
|
|
|
112
|
-
|
|
134
|
+
// Load build constants
|
|
135
|
+
$build_constants = require __DIR__ . '/../../constants.php';
|
|
136
|
+
|
|
137
|
+
// Fire init action for extensions to register routes and menu items
|
|
138
|
+
do_action( '{{PAGE_SLUG}}-wp-admin_init' );
|
|
139
|
+
|
|
140
|
+
// Preload REST API data
|
|
141
|
+
{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_preload_data();
|
|
142
|
+
|
|
143
|
+
// Get all registered routes
|
|
144
|
+
$routes = {{PREFIX}}_get_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes();
|
|
145
|
+
|
|
146
|
+
// Get boot module asset file for dependencies
|
|
147
|
+
$asset_file = __DIR__ . '/../../modules/boot/index.min.asset.php';
|
|
148
|
+
if ( file_exists( $asset_file ) ) {
|
|
149
|
+
$asset = require $asset_file;
|
|
150
|
+
|
|
151
|
+
// This script serves two purposes:
|
|
152
|
+
// 1. It ensures all the globals that are made available to the modules are loaded.
|
|
153
|
+
// 2. It initializes the boot module as an inline script.
|
|
154
|
+
wp_register_script( '{{PAGE_SLUG}}-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true );
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* Add inline script to initialize the app using initSinglePage (no menuItems).
|
|
158
|
+
* The dynamic import is deferred until DOMContentLoaded so that all classic
|
|
159
|
+
* script dependencies of @wordpress/boot (wp-private-apis, wp-components,
|
|
160
|
+
* wp-theme, etc.) have finished parsing and executing before the boot module
|
|
161
|
+
* evaluates. Otherwise, a modulepreloaded @wordpress/boot can win the race
|
|
162
|
+
* against the classic-script-printing pass on fast CDN-fronted hosts in
|
|
163
|
+
* Chrome, evaluating before wp.theme.privateApis is defined and throwing
|
|
164
|
+
* "Cannot unlock an undefined object". See <https://core.trac.wordpress.org/ticket/65103>.
|
|
165
|
+
*/
|
|
166
|
+
$init_js_function = <<<'JS'
|
|
167
|
+
( mountId, routes ) => {
|
|
168
|
+
const run = async () => {
|
|
169
|
+
const mod = await import( "@wordpress/boot" );
|
|
170
|
+
mod.initSinglePage( { mountId, routes } );
|
|
171
|
+
};
|
|
172
|
+
if ( document.readyState === "loading" ) {
|
|
173
|
+
document.addEventListener( "DOMContentLoaded", run );
|
|
174
|
+
} else {
|
|
175
|
+
run();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
JS;
|
|
113
179
|
wp_add_inline_script(
|
|
114
|
-
'wp-
|
|
180
|
+
'{{PAGE_SLUG}}-wp-admin-prerequisites',
|
|
115
181
|
sprintf(
|
|
116
|
-
'
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
182
|
+
'( %s )( %s, %s );',
|
|
183
|
+
$init_js_function,
|
|
184
|
+
wp_json_encode( '{{PAGE_SLUG}}-wp-admin-app', JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
|
|
185
|
+
wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
|
|
186
|
+
)
|
|
120
187
|
);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
188
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*/
|
|
131
|
-
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_enqueue_scripts( $hook_suffix ) {
|
|
132
|
-
// Check all possible ways this page can be accessed:
|
|
133
|
-
// 1. Menu page via admin.php?page={{PAGE_SLUG}}-wp-admin (plugin)
|
|
134
|
-
// 2. Direct file via {{PAGE_SLUG}}.php (Core) - screen ID will be '{{PAGE_SLUG}}'
|
|
135
|
-
$current_screen = get_current_screen();
|
|
136
|
-
$is_our_page = (
|
|
137
|
-
( isset( $_GET['page'] ) && '{{PAGE_SLUG}}-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
|
138
|
-
( $current_screen && '{{PAGE_SLUG}}' === $current_screen->id )
|
|
189
|
+
// Register prerequisites style by filtering script dependencies to find registered styles
|
|
190
|
+
$style_dependencies = array_filter(
|
|
191
|
+
$asset['dependencies'],
|
|
192
|
+
function ( $handle ) {
|
|
193
|
+
return wp_style_is( $handle, 'registered' );
|
|
194
|
+
}
|
|
139
195
|
);
|
|
196
|
+
wp_register_style( '{{PAGE_SLUG}}-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] );
|
|
140
197
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
198
|
+
// Build dependencies for {{PAGE_SLUG}}-wp-admin module
|
|
199
|
+
$boot_dependencies = array(
|
|
200
|
+
array(
|
|
201
|
+
'import' => 'static',
|
|
202
|
+
'id' => '@wordpress/boot',
|
|
203
|
+
),
|
|
204
|
+
);
|
|
144
205
|
|
|
145
|
-
//
|
|
146
|
-
$
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
do_action( '{{PAGE_SLUG}}-wp-admin_init' );
|
|
150
|
-
|
|
151
|
-
// Preload REST API data
|
|
152
|
-
{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_preload_data();
|
|
153
|
-
|
|
154
|
-
// Get all registered routes
|
|
155
|
-
$routes = {{PREFIX}}_get_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_routes();
|
|
156
|
-
|
|
157
|
-
// Get boot module asset file for dependencies
|
|
158
|
-
$asset_file = __DIR__ . '/../../modules/boot/index.min.asset.php';
|
|
159
|
-
if ( file_exists( $asset_file ) ) {
|
|
160
|
-
$asset = require $asset_file;
|
|
161
|
-
|
|
162
|
-
// This script serves two purposes:
|
|
163
|
-
// 1. It ensures all the globals that are made available to the modules are loaded.
|
|
164
|
-
// 2. It initializes the boot module as an inline script.
|
|
165
|
-
wp_register_script( '{{PAGE_SLUG}}-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true );
|
|
166
|
-
|
|
167
|
-
// Add inline script to initialize the app using initSinglePage (no menuItems)
|
|
168
|
-
wp_add_inline_script(
|
|
169
|
-
'{{PAGE_SLUG}}-wp-admin-prerequisites',
|
|
170
|
-
sprintf(
|
|
171
|
-
'import("@wordpress/boot").then(mod => mod.initSinglePage({mountId: "%s", routes: %s}));',
|
|
172
|
-
'{{PAGE_SLUG}}-wp-admin-app',
|
|
173
|
-
wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
|
|
174
|
-
)
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
// Register prerequisites style by filtering script dependencies to find registered styles
|
|
178
|
-
$style_dependencies = array_filter(
|
|
179
|
-
$asset['dependencies'],
|
|
180
|
-
function ( $handle ) {
|
|
181
|
-
return wp_style_is( $handle, 'registered' );
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
wp_register_style( '{{PAGE_SLUG}}-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] );
|
|
185
|
-
|
|
186
|
-
// Build dependencies for {{PAGE_SLUG}}-wp-admin module
|
|
187
|
-
$boot_dependencies = array(
|
|
188
|
-
array(
|
|
206
|
+
// Add all registered routes as dependencies
|
|
207
|
+
foreach ( $routes as $route ) {
|
|
208
|
+
if ( isset( $route['route_module'] ) ) {
|
|
209
|
+
$boot_dependencies[] = array(
|
|
189
210
|
'import' => 'static',
|
|
190
|
-
'id' => '
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
'import' => 'static',
|
|
199
|
-
'id' => $route['route_module'],
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
if ( isset( $route['content_module'] ) ) {
|
|
203
|
-
$boot_dependencies[] = array(
|
|
204
|
-
'import' => 'dynamic',
|
|
205
|
-
'id' => $route['content_module'],
|
|
206
|
-
);
|
|
207
|
-
}
|
|
211
|
+
'id' => $route['route_module'],
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
if ( isset( $route['content_module'] ) ) {
|
|
215
|
+
$boot_dependencies[] = array(
|
|
216
|
+
'import' => 'dynamic',
|
|
217
|
+
'id' => $route['content_module'],
|
|
218
|
+
);
|
|
208
219
|
}
|
|
209
|
-
|
|
210
|
-
// Dummy script module to ensure dependencies are loaded
|
|
211
|
-
wp_register_script_module(
|
|
212
|
-
'{{PAGE_SLUG}}-wp-admin',
|
|
213
|
-
$build_constants['build_url'] . 'pages/{{PAGE_SLUG}}/loader.js',
|
|
214
|
-
$boot_dependencies
|
|
215
|
-
);
|
|
216
|
-
|
|
217
|
-
// Enqueue the boot scripts and styles
|
|
218
|
-
wp_enqueue_script( '{{PAGE_SLUG}}-wp-admin-prerequisites' );
|
|
219
|
-
wp_enqueue_script_module( '{{PAGE_SLUG}}-wp-admin' );
|
|
220
|
-
wp_enqueue_style( '{{PAGE_SLUG}}-wp-admin-prerequisites' );
|
|
221
220
|
}
|
|
221
|
+
|
|
222
|
+
// Dummy script module to ensure dependencies are loaded
|
|
223
|
+
wp_register_script_module(
|
|
224
|
+
'{{PAGE_SLUG}}-wp-admin',
|
|
225
|
+
$build_constants['build_url'] . 'pages/{{PAGE_SLUG}}/loader.js',
|
|
226
|
+
$boot_dependencies
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
// Enqueue the boot scripts and styles
|
|
230
|
+
wp_enqueue_script( '{{PAGE_SLUG}}-wp-admin-prerequisites' );
|
|
231
|
+
wp_enqueue_script_module( '{{PAGE_SLUG}}-wp-admin' );
|
|
232
|
+
wp_enqueue_style( '{{PAGE_SLUG}}-wp-admin-prerequisites' );
|
|
222
233
|
}
|
|
223
234
|
}
|
|
224
235
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
#
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
236
|
+
/**
|
|
237
|
+
* Render the {{PAGE_SLUG}}-wp-admin page.
|
|
238
|
+
* Call this function from add_menu_page or add_submenu_page.
|
|
239
|
+
* This renders within the normal WordPress admin interface.
|
|
240
|
+
*/
|
|
241
|
+
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() {
|
|
242
|
+
?>
|
|
243
|
+
<style>
|
|
244
|
+
/* Critical styles to prevent layout shifts - inlined for immediate application */
|
|
245
|
+
|
|
246
|
+
/* Background colors */
|
|
247
|
+
#wpwrap {
|
|
248
|
+
background: var(--wpds-color-fg-content-neutral, #1e1e1e);
|
|
249
|
+
overflow-y: auto;
|
|
250
|
+
}
|
|
251
|
+
body {
|
|
252
|
+
background: #fff;
|
|
253
|
+
}
|
|
244
254
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
/* Reset wp-admin padding */
|
|
256
|
+
#wpcontent {
|
|
257
|
+
padding-inline-start: 0;
|
|
258
|
+
}
|
|
259
|
+
#wpbody-content {
|
|
260
|
+
padding-bottom: 0;
|
|
261
|
+
}
|
|
252
262
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
263
|
+
/* Hide legacy admin elements */
|
|
264
|
+
#wpbody-content > div:not(.boot-layout-container):not(#screen-meta) {
|
|
265
|
+
display: none;
|
|
266
|
+
}
|
|
267
|
+
#wpfooter {
|
|
268
|
+
display: none;
|
|
269
|
+
}
|
|
260
270
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
/* Accessibility regions */
|
|
272
|
+
.a11y-speak-region {
|
|
273
|
+
inset-inline-start: -1px;
|
|
274
|
+
top: -1px;
|
|
275
|
+
}
|
|
266
276
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
277
|
+
/* Admin menu indicators */
|
|
278
|
+
ul#adminmenu a.wp-has-current-submenu::after,
|
|
279
|
+
ul#adminmenu > li.current > a.current::after {
|
|
280
|
+
border-inline-end-color: #fff;
|
|
281
|
+
}
|
|
272
282
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
283
|
+
/* Media frame fix */
|
|
284
|
+
.media-frame select.attachment-filters:last-of-type {
|
|
285
|
+
width: auto;
|
|
286
|
+
max-width: 100%;
|
|
287
|
+
}
|
|
278
288
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
289
|
+
/* Responsive overflow fix for #wpwrap */
|
|
290
|
+
@media (min-width: 782px) {
|
|
291
|
+
#wpwrap {
|
|
292
|
+
overflow-y: initial;
|
|
284
293
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
}
|
|
295
|
+
</style>
|
|
296
|
+
<div id="{{PAGE_SLUG}}-wp-admin-app" class="boot-layout-container"></div>
|
|
297
|
+
<?php
|
|
289
298
|
}
|
|
290
299
|
|
|
291
300
|
// Hook the enqueue function to admin_enqueue_scripts
|