Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/boot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- Mount the plugins registered with `registerPlugin`, so the sidebars, panels and menu items they fill render ([#81754](https://github.com/WordPress/gutenberg/pull/81754)).
- Canvas: Show the site's front end where a route names no entity and the theme has no block templates to resolve one from, instead of an editor with nothing open. Was previously handled by the home route alone, leaving `/identity` broken on a classic theme ([#81749](https://github.com/WordPress/gutenberg/pull/81749)).
- Canvas: Do not offer to edit a trashed entity from its preview ([#81632](https://github.com/WordPress/gutenberg/pull/81632)).
- Translate the click-to-edit label on a previewed canvas, and name the action rather than the gesture ([#81620](https://github.com/WordPress/gutenberg/pull/81620)).
Expand Down
1 change: 1 addition & 0 deletions packages/boot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@wordpress/keycodes": "file:../keycodes",
"@wordpress/lazy-editor": "file:../lazy-editor",
"@wordpress/notices": "file:../notices",
"@wordpress/plugins": "file:../plugins",
"@wordpress/primitives": "file:../primitives",
"@wordpress/private-apis": "file:../private-apis",
"@wordpress/route": "file:../route",
Expand Down
34 changes: 34 additions & 0 deletions packages/boot/src/components/plugin-area/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useDispatch } from '@wordpress/data';
import { __, sprintf } from '@wordpress/i18n';
import { store as noticesStore } from '@wordpress/notices';
import { PluginArea as WPPluginArea } from '@wordpress/plugins';

/**
* Mounts every plugin registered with `registerPlugin`, so the fills they
* render reach their slots.
*
* Sits at the root rather than with the editor: a plugin's fills mostly target
* editor slots, but the component holding them is also where it registers
* commands and extends a list, which the routes without a canvas need too.
*
* @return The mount point. Renders whatever the plugins do, and nothing itself.
*/
export default function PluginArea() {
const { createErrorNotice } = useDispatch( noticesStore );

return (
<WPPluginArea
onError={ ( name ) => {
createErrorNotice(
sprintf(
/* translators: %s: plugin name */
__(
'The "%s" plugin has encountered an error and cannot be rendered.'
),
name
)
);
} }
/>
);
}
2 changes: 2 additions & 0 deletions packages/boot/src/components/root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Sidebar from '../sidebar';
import SavePanel from '../save-panel';
import CanvasRenderer from '../canvas-renderer';
import ErrorBoundary from '../error-boundary';
import PluginArea from '../plugin-area';
import useRouteTitle from '../app/use-route-title';
import { unlock } from '../../lock-unlock';
import type { CanvasData } from '../../store/types';
Expand Down Expand Up @@ -57,6 +58,7 @@ export default function Root() {
return (
<SlotFillProvider>
<Tooltip.Provider>
<PluginArea />
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
Expand Down
2 changes: 2 additions & 0 deletions packages/boot/src/components/root/single-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ThemeProvider } from '@wordpress/theme';
import { UnsavedChangesWarning } from '@wordpress/editor';
import SavePanel from '../save-panel';
import CanvasRenderer from '../canvas-renderer';
import PluginArea from '../plugin-area';
import { unlock } from '../../lock-unlock';
import type { CanvasData } from '../../store/types';
import useSyncBodyBackground from './use-sync-body-background';
Expand Down Expand Up @@ -39,6 +40,7 @@ export default function RootSinglePage() {

return (
<SlotFillProvider>
<PluginArea />
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
Expand Down
1 change: 1 addition & 0 deletions packages/boot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{ "path": "../keycodes/tsconfig.build.json" },
{ "path": "../lazy-editor" },
{ "path": "../notices/tsconfig.build.json" },
{ "path": "../plugins" },
{ "path": "../primitives" },
{ "path": "../private-apis" },
{ "path": "../route" },
Expand Down
Loading