@wordpress/boot 0.25.0 → 0.26.0

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.
Files changed (71) hide show
  1. package/build-module/components/app/index.mjs +29 -53
  2. package/build-module/components/app/index.mjs.map +1 -7
  3. package/build-module/components/app/router.mjs +238 -214
  4. package/build-module/components/app/router.mjs.map +1 -7
  5. package/build-module/components/app/use-route-title.mjs +35 -42
  6. package/build-module/components/app/use-route-title.mjs.map +1 -7
  7. package/build-module/components/canvas/back-button.mjs +21 -20
  8. package/build-module/components/canvas/back-button.mjs.map +1 -7
  9. package/build-module/components/canvas/index.mjs +104 -130
  10. package/build-module/components/canvas/index.mjs.map +1 -7
  11. package/build-module/components/canvas/site-preview.mjs +36 -43
  12. package/build-module/components/canvas/site-preview.mjs.map +1 -7
  13. package/build-module/components/canvas/use-navigate-to-entity-record.mjs +109 -113
  14. package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +1 -7
  15. package/build-module/components/canvas/viewport.mjs +25 -13
  16. package/build-module/components/canvas/viewport.mjs.map +1 -7
  17. package/build-module/components/canvas-renderer/index.mjs +40 -32
  18. package/build-module/components/canvas-renderer/index.mjs.map +1 -7
  19. package/build-module/components/error-boundary/index.mjs +160 -108
  20. package/build-module/components/error-boundary/index.mjs.map +1 -7
  21. package/build-module/components/navigation/drilldown-item/index.mjs +124 -127
  22. package/build-module/components/navigation/drilldown-item/index.mjs.map +1 -7
  23. package/build-module/components/navigation/dropdown-item/index.mjs +156 -173
  24. package/build-module/components/navigation/dropdown-item/index.mjs.map +1 -7
  25. package/build-module/components/navigation/index.mjs +55 -90
  26. package/build-module/components/navigation/index.mjs.map +1 -7
  27. package/build-module/components/navigation/items.mjs +51 -53
  28. package/build-module/components/navigation/items.mjs.map +1 -7
  29. package/build-module/components/navigation/navigation-item/index.mjs +120 -114
  30. package/build-module/components/navigation/navigation-item/index.mjs.map +1 -7
  31. package/build-module/components/navigation/navigation-screen/index.mjs +192 -185
  32. package/build-module/components/navigation/navigation-screen/index.mjs.map +1 -7
  33. package/build-module/components/navigation/path-matching.mjs +74 -73
  34. package/build-module/components/navigation/path-matching.mjs.map +1 -7
  35. package/build-module/components/navigation/router-link-item.mjs +13 -11
  36. package/build-module/components/navigation/router-link-item.mjs.map +1 -7
  37. package/build-module/components/navigation/use-sidebar-parent.mjs +37 -48
  38. package/build-module/components/navigation/use-sidebar-parent.mjs.map +1 -7
  39. package/build-module/components/plugin-area/index.mjs +20 -24
  40. package/build-module/components/plugin-area/index.mjs.map +1 -7
  41. package/build-module/components/root/index.mjs +227 -242
  42. package/build-module/components/root/index.mjs.map +1 -7
  43. package/build-module/components/root/single-page.mjs +174 -148
  44. package/build-module/components/root/single-page.mjs.map +1 -7
  45. package/build-module/components/root/use-sync-body-background.mjs +28 -22
  46. package/build-module/components/root/use-sync-body-background.mjs.map +1 -7
  47. package/build-module/components/save-button/index.mjs +170 -214
  48. package/build-module/components/save-button/index.mjs.map +1 -7
  49. package/build-module/components/save-panel/index.mjs +110 -106
  50. package/build-module/components/save-panel/index.mjs.map +1 -7
  51. package/build-module/components/save-panel/use-save-shortcut.mjs +42 -51
  52. package/build-module/components/save-panel/use-save-shortcut.mjs.map +1 -7
  53. package/build-module/components/sidebar/index.mjs +126 -104
  54. package/build-module/components/sidebar/index.mjs.map +1 -7
  55. package/build-module/index.mjs +1 -7
  56. package/build-module/lock-unlock.mjs +5 -10
  57. package/build-module/lock-unlock.mjs.map +1 -7
  58. package/build-module/store/actions.mjs +34 -31
  59. package/build-module/store/actions.mjs.map +1 -7
  60. package/build-module/store/index.mjs +9 -11
  61. package/build-module/store/index.mjs.map +1 -7
  62. package/build-module/store/reducer.mjs +48 -55
  63. package/build-module/store/reducer.mjs.map +1 -7
  64. package/build-module/store/selectors.mjs +21 -16
  65. package/build-module/store/selectors.mjs.map +1 -7
  66. package/build-module/store/types.mjs +0 -1
  67. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  68. package/package.json +28 -28
  69. package/src/components/error-boundary/index.tsx +50 -4
  70. package/build-module/index.mjs.map +0 -7
  71. package/build-module/store/types.mjs.map +0 -7
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/root/index.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/root/style.module.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { SnackbarNotices } from '@wordpress/notices';\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport { menu } from '@wordpress/icons';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { UnsavedChangesWarning } from '@wordpress/editor';\nimport { Page, getAdminThemeColors } from '@wordpress/admin-ui';\nimport { Tooltip } from '@wordpress/ui';\nimport { ThemeProvider } from '@wordpress/theme';\nimport Sidebar from '../sidebar';\nimport SavePanel from '../save-panel';\nimport CanvasRenderer from '../canvas-renderer';\nimport ErrorBoundary from '../error-boundary';\nimport PluginArea from '../plugin-area';\nimport useRouteTitle from '../app/use-route-title';\nimport { unlock } from '../../lock-unlock';\nimport type { CanvasData } from '../../store/types';\nimport useSyncBodyBackground from './use-sync-body-background';\nimport styles from './style.module.scss';\n\nconst { useLocation, useMatches, Outlet } = unlock( routePrivateApis );\n\nexport default function Root() {\n\tconst matches = useMatches();\n\tconst location = useLocation();\n\tconst currentMatch = matches[ matches.length - 1 ];\n\tconst canvas = ( currentMatch?.loaderData as any )?.canvas as\n\t\tCanvasData | null | undefined;\n\tconst routeContentModule = ( currentMatch?.loaderData as any )\n\t\t?.routeContentModule as string | undefined;\n\tconst isFullScreen = canvas && ! canvas.isPreview;\n\n\tuseRouteTitle();\n\n\t// Mobile sidebar state\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ isMobileSidebarOpen, setIsMobileSidebarOpen ] = useState( false );\n\tconst disableMotion = useReducedMotion();\n\t// Close mobile sidebar on viewport resize and path change\n\tuseEffect( () => {\n\t\tsetIsMobileSidebarOpen( false );\n\t}, [ location.pathname, isMobileViewport ] );\n\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\n\tconst layoutRef = useSyncBodyBackground();\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t<PluginArea />\n\t\t\t\t<ThemeProvider\n\t\t\t\t\tisRoot\n\t\t\t\t\tcolor={ { ...themeColors, background: '#f8f8f8' } }\n\t\t\t\t>\n\t\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ layoutRef }\n\t\t\t\t\t\t\tclassName={ clsx( styles.layout, {\n\t\t\t\t\t\t\t\t[ styles[ 'has-canvas' ] ]:\n\t\t\t\t\t\t\t\t\t!! canvas || canvas === null,\n\t\t\t\t\t\t\t\t[ styles[ 'has-full-canvas' ] ]: isFullScreen,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t<SnackbarNotices\n\t\t\t\t\t\t\t\tclassName={ styles[ 'notices-snackbar' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isMobileViewport && (\n\t\t\t\t\t\t\t\t<Page.SidebarToggleFill>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ticon={ menu }\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen( true )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open navigation panel' ) }\n\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Page.SidebarToggleFill>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ /* Mobile Sidebar Backdrop */ }\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ isMobileViewport &&\n\t\t\t\t\t\t\t\t\tisMobileSidebarOpen &&\n\t\t\t\t\t\t\t\t\t! isFullScreen && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.2,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ 'sidebar-backdrop' ]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Close navigation panel'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t\t{ /* Mobile Sidebar */ }\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ isMobileViewport &&\n\t\t\t\t\t\t\t\t\tisMobileSidebarOpen &&\n\t\t\t\t\t\t\t\t\t! isFullScreen && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tinitial={ { x: '-100%' } }\n\t\t\t\t\t\t\t\t\t\t\tanimate={ { x: 0 } }\n\t\t\t\t\t\t\t\t\t\t\texit={ { x: '-100%' } }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.2,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\tstyles.sidebar,\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ 'is-mobile' ]\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t\t{ /* Desktop Sidebar */ }\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! isFullScreen && (\n\t\t\t\t\t\t\t\t<div className={ styles.sidebar }>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<div className={ styles.surfaces }>\n\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\tcolor={ {\n\t\t\t\t\t\t\t\t\t\t...themeColors,\n\t\t\t\t\t\t\t\t\t\t// Reset to the default background color.\n\t\t\t\t\t\t\t\t\t\tbackground: '#fcfcfc',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Outlet />\n\t\t\t\t\t\t\t\t\t{ /* Render Canvas in Root to prevent remounting on route changes */ }\n\t\t\t\t\t\t\t\t\t{ ( canvas || canvas === null ) && (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx( styles.canvas, {\n\t\t\t\t\t\t\t\t\t\t\t\t[ styles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t'has-mobile-drawer'\n\t\t\t\t\t\t\t\t\t\t\t\t] ]:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvas?.isPreview &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport,\n\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ canvas?.isPreview &&\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'mobile-sidebar-drawer'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ menu }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open navigation panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<CanvasRenderer\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvas={ canvas }\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteContentModule={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trouteContentModule\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ThemeProvider>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"b215aa5eaa\", \".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"c8317e9ebb034cfa__layout\",\"has-full-canvas\":\"e97bb2807a9c4687__has-full-canvas\",\"notices-snackbar\":\"b8f8c6cf9ae266bf__notices-snackbar\",\"components-snackbar\":\"_94ac6b8f274ce2f6__components-snackbar\",\"sidebar-backdrop\":\"bfc3fedf39b1cf71__sidebar-backdrop\",\"sidebar\":\"bb4f70cd030be0a3__sidebar\",\"is-mobile\":\"_27e6d590dc5963c9__is-mobile\",\"mobile-sidebar-drawer\":\"_0eb5d3a3e94d6273__mobile-sidebar-drawer\",\"layout-single-page\":\"_26789cb167e9f578__layout-single-page\",\"canvas\":\"fb03501e629fd04e__canvas\",\"has-mobile-drawer\":\"fa94dab2ab1e36f3__has-mobile-drawer\",\"surfaces\":\"a03baddce3ef2026__surfaces\",\"stage\":\"d12c9efe707e6cb3__stage\",\"inspector\":\"_7ffe3a3db6f69647__inspector\",\"has-canvas\":\"f7fe42ef8c67e96f__has-canvas\",\"zoomOut\":\"ef68027ea03aa34b__zoomOut\",\"zoomIn\":\"_0752ac81dff4c432__zoomIn\",\"slideFromRight\":\"_3a2e4dc465681136__slideFromRight\",\"slideToRight\":\"_86a367ac26a1b61e__slideToRight\",\"slideHeaderFromTop\":\"_462399c0e9d64199__slideHeaderFromTop\",\"slideHeaderToTop\":\"_8b272f30d43c9f38__slideHeaderToTop\",\"slideSidebarFromRight\":\"_69ed6a71d53a2e0c__slideSidebarFromRight\",\"slideSidebarToRight\":\"bf0697a36b00caad__slideSidebarToRight\"};\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,eAAe,wBAAwB;AAChD,SAAS,uBAAuB;AAChC,SAAS,kBAAkB,wBAAwB;AACnD;AAAA,EACC,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY;AACrB,SAAS,UAAU,WAAW,eAAe;AAC7C,SAAS,UAAU;AACnB,SAAS,6BAA6B;AACtC,SAAS,MAAM,2BAA2B;AAC1C,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,OAAO,aAAa;AACpB,OAAO,eAAe;AACtB,OAAO,oBAAoB;AAC3B,OAAO,mBAAmB;AAC1B,OAAO,gBAAgB;AACvB,OAAO,mBAAmB;AAC1B,SAAS,cAAc;AAEvB,OAAO,2BAA2B;;;ACflC,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA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;AAAA,0BAChC,CAAE,qBACD,mBACD,CAAE,GACD,QAAQ,aACR;AAAA,wBACF,CAAE;AAAA,wBAEA;AAAA,kCAAQ,aACT,oBACC;AAAA,4BAAC;AAAA;AAAA,8BACA,WACC,qBACC,uBACD;AAAA,8BAGD;AAAA,gCAAC;AAAA;AAAA,kCACA,MAAO;AAAA,kCACP,SAAU,MACT;AAAA,oCACC;AAAA,kCACD;AAAA,kCAED,OAAQ;AAAA,oCACP;AAAA,kCACD;AAAA,kCACA,MAAK;AAAA;AAAA,8BACN;AAAA;AAAA,0BACD;AAAA,0BAEF,oBAAC,iBACA;AAAA,4BAAC;AAAA;AAAA,8BACA;AAAA,8BACA;AAAA;AAAA,0BAGD,GACD;AAAA;AAAA;AAAA,oBACD;AAAA;AAAA;AAAA,cAEF,GACD;AAAA;AAAA;AAAA,QACD,GACD;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"index.mjs","names":["routePrivateApis","styles","AnimatePresence","motion"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/root/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"fed1a7ec24\", \"._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"_5c711a1cecefd5e8__layout\",\"has-full-canvas\":\"_52e00bad88ace7ce__has-full-canvas\",\"notices-snackbar\":\"eeebb116829e2f94__notices-snackbar\",\"components-snackbar\":\"cb865dcda5233b3b__components-snackbar\",\"sidebar-backdrop\":\"_04b3b4e8346a2b7b__sidebar-backdrop\",\"sidebar\":\"_615b052cf60fcff2__sidebar\",\"is-mobile\":\"_6be5d95ddf25e57f__is-mobile\",\"mobile-sidebar-drawer\":\"fd8d6491146392ce__mobile-sidebar-drawer\",\"layout-single-page\":\"f37b94fd2c1f6020__layout-single-page\",\"canvas\":\"_6da399dd0a232c1f__canvas\",\"has-mobile-drawer\":\"_5568e036ddaba310__has-mobile-drawer\",\"surfaces\":\"ff37ba01b23d0bcb__surfaces\",\"stage\":\"e323e272b8b8ed4f__stage\",\"inspector\":\"b37b199f2111c5f8__inspector\",\"has-canvas\":\"bbaf96f69377ab55__has-canvas\",\"zoomOut\":\"_2e385023a338e4a9__zoomOut\",\"zoomIn\":\"e245c2f64b6256de__zoomIn\",\"slideFromRight\":\"_9aa5832f67721dd4__slideFromRight\",\"slideToRight\":\"_4d20ae2879ce77c4__slideToRight\",\"slideHeaderFromTop\":\"e56b4b1bb9ff1176__slideHeaderFromTop\",\"slideHeaderToTop\":\"e54b49876d2b7dc3__slideHeaderToTop\",\"slideSidebarFromRight\":\"f74156de1cf32837__slideSidebarFromRight\",\"slideSidebarToRight\":\"_157f548b8629f8b5__slideSidebarToRight\"};\n","import clsx from 'clsx';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { SnackbarNotices } from '@wordpress/notices';\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport { menu } from '@wordpress/icons';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { UnsavedChangesWarning } from '@wordpress/editor';\nimport { Page, getAdminThemeColors } from '@wordpress/admin-ui';\nimport { Tooltip } from '@wordpress/ui';\nimport { ThemeProvider } from '@wordpress/theme';\nimport Sidebar from '../sidebar';\nimport SavePanel from '../save-panel';\nimport CanvasRenderer from '../canvas-renderer';\nimport ErrorBoundary from '../error-boundary';\nimport PluginArea from '../plugin-area';\nimport useRouteTitle from '../app/use-route-title';\nimport { unlock } from '../../lock-unlock';\nimport type { CanvasData } from '../../store/types';\nimport useSyncBodyBackground from './use-sync-body-background';\nimport styles from './style.module.scss';\n\nconst { useLocation, useMatches, Outlet } = unlock( routePrivateApis );\n\nexport default function Root() {\n\tconst matches = useMatches();\n\tconst location = useLocation();\n\tconst currentMatch = matches[ matches.length - 1 ];\n\tconst canvas = ( currentMatch?.loaderData as any )?.canvas as\n\t\tCanvasData | null | undefined;\n\tconst routeContentModule = ( currentMatch?.loaderData as any )\n\t\t?.routeContentModule as string | undefined;\n\tconst isFullScreen = canvas && ! canvas.isPreview;\n\n\tuseRouteTitle();\n\n\t// Mobile sidebar state\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ isMobileSidebarOpen, setIsMobileSidebarOpen ] = useState( false );\n\tconst disableMotion = useReducedMotion();\n\t// Close mobile sidebar on viewport resize and path change\n\tuseEffect( () => {\n\t\tsetIsMobileSidebarOpen( false );\n\t}, [ location.pathname, isMobileViewport ] );\n\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\n\tconst layoutRef = useSyncBodyBackground();\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t<PluginArea />\n\t\t\t\t<ThemeProvider\n\t\t\t\t\tisRoot\n\t\t\t\t\tcolor={ { ...themeColors, background: '#f8f8f8' } }\n\t\t\t\t>\n\t\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ layoutRef }\n\t\t\t\t\t\t\tclassName={ clsx( styles.layout, {\n\t\t\t\t\t\t\t\t[ styles[ 'has-canvas' ] ]:\n\t\t\t\t\t\t\t\t\t!! canvas || canvas === null,\n\t\t\t\t\t\t\t\t[ styles[ 'has-full-canvas' ] ]: isFullScreen,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t<SnackbarNotices\n\t\t\t\t\t\t\t\tclassName={ styles[ 'notices-snackbar' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isMobileViewport && (\n\t\t\t\t\t\t\t\t<Page.SidebarToggleFill>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ticon={ menu }\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen( true )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open navigation panel' ) }\n\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Page.SidebarToggleFill>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ /* Mobile Sidebar Backdrop */ }\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ isMobileViewport &&\n\t\t\t\t\t\t\t\t\tisMobileSidebarOpen &&\n\t\t\t\t\t\t\t\t\t! isFullScreen && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.2,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ 'sidebar-backdrop' ]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Close navigation panel'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t\t{ /* Mobile Sidebar */ }\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ isMobileViewport &&\n\t\t\t\t\t\t\t\t\tisMobileSidebarOpen &&\n\t\t\t\t\t\t\t\t\t! isFullScreen && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tinitial={ { x: '-100%' } }\n\t\t\t\t\t\t\t\t\t\t\tanimate={ { x: 0 } }\n\t\t\t\t\t\t\t\t\t\t\texit={ { x: '-100%' } }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.2,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\tstyles.sidebar,\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ 'is-mobile' ]\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t\t{ /* Desktop Sidebar */ }\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! isFullScreen && (\n\t\t\t\t\t\t\t\t<div className={ styles.sidebar }>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<div className={ styles.surfaces }>\n\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\tcolor={ {\n\t\t\t\t\t\t\t\t\t\t...themeColors,\n\t\t\t\t\t\t\t\t\t\t// Reset to the default background color.\n\t\t\t\t\t\t\t\t\t\tbackground: '#fcfcfc',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Outlet />\n\t\t\t\t\t\t\t\t\t{ /* Render Canvas in Root to prevent remounting on route changes */ }\n\t\t\t\t\t\t\t\t\t{ ( canvas || canvas === null ) && (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx( styles.canvas, {\n\t\t\t\t\t\t\t\t\t\t\t\t[ styles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t'has-mobile-drawer'\n\t\t\t\t\t\t\t\t\t\t\t\t] ]:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvas?.isPreview &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport,\n\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ canvas?.isPreview &&\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'mobile-sidebar-drawer'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ menu }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsMobileSidebarOpen(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open navigation panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<CanvasRenderer\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvas={ canvas }\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteContentModule={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trouteContentModule\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ThemeProvider>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAA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C,iBAAO,KAAR;MACC,SAAU,EAAE,GAAG,QAAQ;MACvB,SAAU,EAAE,GAAG,EAAE;MACjB,MAAO,EAAE,GAAG,QAAQ;MACpB,YAAa;OACZ,MAAM;OACN,UAAU,gBACP,IACA;OACH,MAAM;MACP;MACA,WAAY,KACXF,qBAAO,SACPA,qBAAQ,YACT;MAEA,UAAA,oBAAC,SAAD,CAAU,CAAA;KACC,CAAA,EAEE,CAAA;KAEf,CAAE,oBAAoB,CAAE,gBACzB,oBAAC,OAAD;MAAK,WAAYA,qBAAO;MACvB,UAAA,oBAAC,SAAD,CAAU,CAAA;KACN,CAAA;KAEN,oBAAC,OAAD;MAAK,WAAYA,qBAAO;MACvB,UAAA,qBAAC,eAAD;OACC,OAAQ;QACP,GAAG;QAEH,YAAY;OACb;OALD,UAAA,CAOC,oBAAC,QAAD,CAAS,CAAA,IAEL,UAAU,WAAW,SACxB,qBAAC,OAAD;QACC,WAAY,KAAMA,qBAAO,QAAQ,GAC9BA,qBACD,uBAEA,QAAQ,aACR,iBACF,CAAE;QAPH,UAAA,CASG,QAAQ,aACT,oBACC,oBAAC,OAAD;SACC,WACCA,qBACC;SAIF,UAAA,oBAAC,QAAD;UACC,MAAO;UACP,eACC,uBACC,IACD;UAED,OAAQ,GACP,uBACD;UACA,MAAK;SACL,CAAA;QACG,CAAA,GAEP,oBAAC,eAAD,EAAA,UACC,oBAAC,gBAAD;SACU;SAER;QAED,CAAA,EACa,CAAA,CACX;OAEQ,CAAA,CAAA;;KACX,CAAA;IACD;;EACS,CAAA;CACD,CAAA,CACE,EAAA,CAAA,EACD,CAAA;AAEpB"}
@@ -1,6 +1,5 @@
1
- // packages/boot/src/components/root/single-page.tsx
2
1
  import clsx from "clsx";
3
- import { privateApis as routePrivateApis } from "@wordpress/route";
2
+ import { privateApis } from "@wordpress/route";
4
3
  import { SnackbarNotices } from "@wordpress/notices";
5
4
  import { SlotFillProvider } from "@wordpress/components";
6
5
  import { useMemo } from "@wordpress/element";
@@ -12,164 +11,191 @@ import CanvasRenderer from "../canvas-renderer/index.mjs";
12
11
  import PluginArea from "../plugin-area/index.mjs";
13
12
  import { unlock } from "../../lock-unlock.mjs";
14
13
  import useSyncBodyBackground from "./use-sync-body-background.mjs";
15
-
14
+ import useRouteTitle from "../app/use-route-title.mjs";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
16
  // packages/style-runtime/src/index.ts
17
- var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
17
+ const STYLE_HASH_ATTRIBUTE = "data-wp-hash";
18
+ /**
19
+ * Returns the shared style runtime registry.
20
+ *
21
+ * The registry is stored on `globalThis` so separately bundled copies of this
22
+ * package can coordinate through the same document and style maps.
23
+ *
24
+ * @return The shared runtime registry.
25
+ */
18
26
  function getRuntime() {
19
- const globalScope = globalThis;
20
- if (globalScope.__wpStyleRuntime) {
21
- return globalScope.__wpStyleRuntime;
22
- }
23
- globalScope.__wpStyleRuntime = {
24
- documents: /* @__PURE__ */ new Map(),
25
- styles: /* @__PURE__ */ new Map(),
26
- injectedStyles: /* @__PURE__ */ new WeakMap()
27
- };
28
- if (typeof document !== "undefined") {
29
- registerDocument(document);
30
- }
31
- return globalScope.__wpStyleRuntime;
27
+ const globalScope = globalThis;
28
+ if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
29
+ globalScope.__wpStyleRuntime = {
30
+ documents: /* @__PURE__ */ new Map(),
31
+ styles: /* @__PURE__ */ new Map(),
32
+ injectedStyles: /* @__PURE__ */ new WeakMap()
33
+ };
34
+ if (typeof document !== "undefined") registerDocument(document);
35
+ return globalScope.__wpStyleRuntime;
32
36
  }
37
+ /**
38
+ * Checks whether a document already contains a style tag for a hash.
39
+ *
40
+ * @param targetDocument Document to inspect.
41
+ * @param hash Stable hash for the transformed CSS.
42
+ *
43
+ * @return Whether the style hash already exists in the document.
44
+ */
33
45
  function documentContainsStyleHash(targetDocument, hash) {
34
- if (!targetDocument.head) {
35
- return false;
36
- }
37
- for (const style of targetDocument.head.querySelectorAll(
38
- `style[${STYLE_HASH_ATTRIBUTE}]`
39
- )) {
40
- if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
41
- return true;
42
- }
43
- }
44
- return false;
46
+ if (!targetDocument.head) return false;
47
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) return true;
48
+ return false;
45
49
  }
50
+ /**
51
+ * Injects a registered style into a document, unless that document already
52
+ * contains a style tag for the same hash.
53
+ *
54
+ * @param targetDocument Document to inject the style into.
55
+ * @param hash Stable hash for the transformed CSS.
56
+ * @param css CSS text to inject.
57
+ */
46
58
  function injectStyle(targetDocument, hash, css) {
47
- if (!targetDocument.head) {
48
- return;
49
- }
50
- const runtime = getRuntime();
51
- let injectedStyles = runtime.injectedStyles.get(targetDocument);
52
- if (!injectedStyles) {
53
- injectedStyles = /* @__PURE__ */ new Set();
54
- runtime.injectedStyles.set(targetDocument, injectedStyles);
55
- }
56
- if (injectedStyles.has(hash)) {
57
- return;
58
- }
59
- if (documentContainsStyleHash(targetDocument, hash)) {
60
- injectedStyles.add(hash);
61
- return;
62
- }
63
- const style = targetDocument.createElement("style");
64
- style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
65
- style.appendChild(targetDocument.createTextNode(css));
66
- targetDocument.head.appendChild(style);
67
- injectedStyles.add(hash);
59
+ if (!targetDocument.head) return;
60
+ const runtime = getRuntime();
61
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
62
+ if (!injectedStyles) {
63
+ injectedStyles = /* @__PURE__ */ new Set();
64
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
65
+ }
66
+ if (injectedStyles.has(hash)) return;
67
+ if (documentContainsStyleHash(targetDocument, hash)) {
68
+ injectedStyles.add(hash);
69
+ return;
70
+ }
71
+ const style = targetDocument.createElement("style");
72
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
73
+ style.appendChild(targetDocument.createTextNode(css));
74
+ targetDocument.head.appendChild(style);
75
+ injectedStyles.add(hash);
68
76
  }
77
+ /**
78
+ * Registers a document as a style injection target.
79
+ *
80
+ * Existing registered styles are replayed into the document immediately.
81
+ * Documents are reference-counted so multiple providers can safely register the
82
+ * same document without one cleanup removing it while another registration is
83
+ * still active.
84
+ *
85
+ * @param targetDocument Document to receive registered styles.
86
+ * @return Cleanup function that unregisters this document registration.
87
+ */
69
88
  function registerDocument(targetDocument) {
70
- const runtime = getRuntime();
71
- runtime.documents.set(
72
- targetDocument,
73
- (runtime.documents.get(targetDocument) ?? 0) + 1
74
- );
75
- for (const [hash, css] of runtime.styles) {
76
- injectStyle(targetDocument, hash, css);
77
- }
78
- return () => {
79
- const count = runtime.documents.get(targetDocument);
80
- if (count === void 0) {
81
- return;
82
- }
83
- if (count <= 1) {
84
- runtime.documents.delete(targetDocument);
85
- return;
86
- }
87
- runtime.documents.set(targetDocument, count - 1);
88
- };
89
+ const runtime = getRuntime();
90
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
91
+ for (const [hash, css] of runtime.styles) injectStyle(targetDocument, hash, css);
92
+ return () => {
93
+ const count = runtime.documents.get(targetDocument);
94
+ if (count === void 0) return;
95
+ if (count <= 1) {
96
+ runtime.documents.delete(targetDocument);
97
+ return;
98
+ }
99
+ runtime.documents.set(targetDocument, count - 1);
100
+ };
89
101
  }
102
+ /**
103
+ * Registers a style and injects it into all registered documents.
104
+ *
105
+ * The hash is used as the deduplication key, so calling this repeatedly with
106
+ * the same hash will not add duplicate style tags to a document.
107
+ * Registered styles are retained for the lifetime of the page so they can be
108
+ * replayed into documents that are registered later.
109
+ *
110
+ * @param hash Stable hash for the transformed CSS.
111
+ * @param css CSS text to inject.
112
+ */
90
113
  function registerStyle(hash, css) {
91
- const runtime = getRuntime();
92
- runtime.styles.set(hash, css);
93
- for (const targetDocument of runtime.documents.keys()) {
94
- injectStyle(targetDocument, hash, css);
95
- }
114
+ const runtime = getRuntime();
115
+ runtime.styles.set(hash, css);
116
+ for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
96
117
  }
97
-
98
118
  // packages/boot/src/components/root/style.module.scss
99
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
100
- registerStyle("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}");
101
- }
102
- var style_module_default = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" };
103
-
119
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("fed1a7ec24", "._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}");
120
+ var style_module_default = {
121
+ "layout": "_5c711a1cecefd5e8__layout",
122
+ "has-full-canvas": "_52e00bad88ace7ce__has-full-canvas",
123
+ "notices-snackbar": "eeebb116829e2f94__notices-snackbar",
124
+ "components-snackbar": "cb865dcda5233b3b__components-snackbar",
125
+ "sidebar-backdrop": "_04b3b4e8346a2b7b__sidebar-backdrop",
126
+ "sidebar": "_615b052cf60fcff2__sidebar",
127
+ "is-mobile": "_6be5d95ddf25e57f__is-mobile",
128
+ "mobile-sidebar-drawer": "fd8d6491146392ce__mobile-sidebar-drawer",
129
+ "layout-single-page": "f37b94fd2c1f6020__layout-single-page",
130
+ "canvas": "_6da399dd0a232c1f__canvas",
131
+ "has-mobile-drawer": "_5568e036ddaba310__has-mobile-drawer",
132
+ "surfaces": "ff37ba01b23d0bcb__surfaces",
133
+ "stage": "e323e272b8b8ed4f__stage",
134
+ "inspector": "b37b199f2111c5f8__inspector",
135
+ "has-canvas": "bbaf96f69377ab55__has-canvas",
136
+ "zoomOut": "_2e385023a338e4a9__zoomOut",
137
+ "zoomIn": "e245c2f64b6256de__zoomIn",
138
+ "slideFromRight": "_9aa5832f67721dd4__slideFromRight",
139
+ "slideToRight": "_4d20ae2879ce77c4__slideToRight",
140
+ "slideHeaderFromTop": "e56b4b1bb9ff1176__slideHeaderFromTop",
141
+ "slideHeaderToTop": "e54b49876d2b7dc3__slideHeaderToTop",
142
+ "slideSidebarFromRight": "f74156de1cf32837__slideSidebarFromRight",
143
+ "slideSidebarToRight": "_157f548b8629f8b5__slideSidebarToRight"
144
+ };
104
145
  // packages/boot/src/components/root/single-page.tsx
105
- import useRouteTitle from "../app/use-route-title.mjs";
106
- import { jsx, jsxs } from "react/jsx-runtime";
107
- var { useMatches, Outlet } = unlock(routePrivateApis);
146
+ const { useMatches, Outlet } = unlock(privateApis);
147
+ /**
148
+ * Root component for single page mode (no sidebar).
149
+ * Used when rendering pages within wp-admin without taking over the full page.
150
+ */
108
151
  function RootSinglePage() {
109
- const matches = useMatches();
110
- const currentMatch = matches[matches.length - 1];
111
- const canvas = currentMatch?.loaderData?.canvas;
112
- const routeContentModule = currentMatch?.loaderData?.routeContentModule;
113
- const isFullScreen = canvas && !canvas.isPreview;
114
- useRouteTitle();
115
- const themeColors = useMemo(getAdminThemeColors, []);
116
- const layoutRef = useSyncBodyBackground();
117
- return /* @__PURE__ */ jsxs(SlotFillProvider, { children: [
118
- /* @__PURE__ */ jsx(PluginArea, {}),
119
- /* @__PURE__ */ jsx(
120
- ThemeProvider,
121
- {
122
- isRoot: true,
123
- color: { ...themeColors, background: "#f8f8f8" },
124
- children: /* @__PURE__ */ jsx(ThemeProvider, { color: themeColors, children: /* @__PURE__ */ jsxs(
125
- "div",
126
- {
127
- ref: layoutRef,
128
- className: clsx(
129
- style_module_default.layout,
130
- style_module_default["layout-single-page"],
131
- {
132
- [style_module_default["has-canvas"]]: !!canvas || canvas === null,
133
- [style_module_default["has-full-canvas"]]: isFullScreen
134
- }
135
- ),
136
- children: [
137
- /* @__PURE__ */ jsx(UnsavedChangesWarning, {}),
138
- /* @__PURE__ */ jsx(SavePanel, {}),
139
- /* @__PURE__ */ jsx(
140
- SnackbarNotices,
141
- {
142
- className: style_module_default["notices-snackbar"]
143
- }
144
- ),
145
- /* @__PURE__ */ jsx("div", { className: style_module_default.surfaces, children: /* @__PURE__ */ jsxs(
146
- ThemeProvider,
147
- {
148
- color: {
149
- ...themeColors,
150
- // Reset to the default background color.
151
- background: "#fcfcfc"
152
- },
153
- children: [
154
- /* @__PURE__ */ jsx(Outlet, {}),
155
- (canvas || canvas === null) && /* @__PURE__ */ jsx("div", { className: style_module_default.canvas, children: /* @__PURE__ */ jsx(
156
- CanvasRenderer,
157
- {
158
- canvas,
159
- routeContentModule
160
- }
161
- ) })
162
- ]
163
- }
164
- ) })
165
- ]
166
- }
167
- ) })
168
- }
169
- )
170
- ] });
152
+ const matches = useMatches();
153
+ const currentMatch = matches[matches.length - 1];
154
+ const canvas = (currentMatch?.loaderData)?.canvas;
155
+ const routeContentModule = (currentMatch?.loaderData)?.routeContentModule;
156
+ const isFullScreen = canvas && !canvas.isPreview;
157
+ useRouteTitle();
158
+ const themeColors = useMemo(getAdminThemeColors, []);
159
+ const layoutRef = useSyncBodyBackground();
160
+ return /* @__PURE__ */ jsxs(SlotFillProvider, { children: [/* @__PURE__ */ jsx(PluginArea, {}), /* @__PURE__ */ jsx(ThemeProvider, {
161
+ isRoot: true,
162
+ color: {
163
+ ...themeColors,
164
+ background: "#f8f8f8"
165
+ },
166
+ children: /* @__PURE__ */ jsx(ThemeProvider, {
167
+ color: themeColors,
168
+ children: /* @__PURE__ */ jsxs("div", {
169
+ ref: layoutRef,
170
+ className: clsx(style_module_default.layout, style_module_default["layout-single-page"], {
171
+ [style_module_default["has-canvas"]]: !!canvas || canvas === null,
172
+ [style_module_default["has-full-canvas"]]: isFullScreen
173
+ }),
174
+ children: [
175
+ /* @__PURE__ */ jsx(UnsavedChangesWarning, {}),
176
+ /* @__PURE__ */ jsx(SavePanel, {}),
177
+ /* @__PURE__ */ jsx(SnackbarNotices, { className: style_module_default["notices-snackbar"] }),
178
+ /* @__PURE__ */ jsx("div", {
179
+ className: style_module_default.surfaces,
180
+ children: /* @__PURE__ */ jsxs(ThemeProvider, {
181
+ color: {
182
+ ...themeColors,
183
+ background: "#fcfcfc"
184
+ },
185
+ children: [/* @__PURE__ */ jsx(Outlet, {}), (canvas || canvas === null) && /* @__PURE__ */ jsx("div", {
186
+ className: style_module_default.canvas,
187
+ children: /* @__PURE__ */ jsx(CanvasRenderer, {
188
+ canvas,
189
+ routeContentModule
190
+ })
191
+ })]
192
+ })
193
+ })
194
+ ]
195
+ })
196
+ })
197
+ })] });
171
198
  }
172
- export {
173
- RootSinglePage as default
174
- };
175
- //# sourceMappingURL=single-page.mjs.map
199
+ export { RootSinglePage as default };
200
+
201
+ //# sourceMappingURL=single-page.mjs.map