@wordpress/boot 0.25.0 → 0.27.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.
- package/build-module/components/app/index.mjs +29 -53
- package/build-module/components/app/index.mjs.map +1 -7
- package/build-module/components/app/router.mjs +238 -214
- package/build-module/components/app/router.mjs.map +1 -7
- package/build-module/components/app/use-route-title.mjs +35 -42
- package/build-module/components/app/use-route-title.mjs.map +1 -7
- package/build-module/components/canvas/back-button.mjs +21 -20
- package/build-module/components/canvas/back-button.mjs.map +1 -7
- package/build-module/components/canvas/index.mjs +104 -130
- package/build-module/components/canvas/index.mjs.map +1 -7
- package/build-module/components/canvas/site-preview.mjs +36 -43
- package/build-module/components/canvas/site-preview.mjs.map +1 -7
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs +109 -113
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +1 -7
- package/build-module/components/canvas/viewport.mjs +25 -13
- package/build-module/components/canvas/viewport.mjs.map +1 -7
- package/build-module/components/canvas-renderer/index.mjs +40 -32
- package/build-module/components/canvas-renderer/index.mjs.map +1 -7
- package/build-module/components/error-boundary/index.mjs +161 -109
- package/build-module/components/error-boundary/index.mjs.map +1 -7
- package/build-module/components/navigation/drilldown-item/index.mjs +124 -127
- package/build-module/components/navigation/drilldown-item/index.mjs.map +1 -7
- package/build-module/components/navigation/dropdown-item/index.mjs +156 -173
- package/build-module/components/navigation/dropdown-item/index.mjs.map +1 -7
- package/build-module/components/navigation/index.mjs +55 -90
- package/build-module/components/navigation/index.mjs.map +1 -7
- package/build-module/components/navigation/items.mjs +51 -53
- package/build-module/components/navigation/items.mjs.map +1 -7
- package/build-module/components/navigation/navigation-item/index.mjs +120 -114
- package/build-module/components/navigation/navigation-item/index.mjs.map +1 -7
- package/build-module/components/navigation/navigation-screen/index.mjs +192 -185
- package/build-module/components/navigation/navigation-screen/index.mjs.map +1 -7
- package/build-module/components/navigation/path-matching.mjs +74 -73
- package/build-module/components/navigation/path-matching.mjs.map +1 -7
- package/build-module/components/navigation/router-link-item.mjs +13 -11
- package/build-module/components/navigation/router-link-item.mjs.map +1 -7
- package/build-module/components/navigation/use-sidebar-parent.mjs +37 -48
- package/build-module/components/navigation/use-sidebar-parent.mjs.map +1 -7
- package/build-module/components/plugin-area/index.mjs +20 -24
- package/build-module/components/plugin-area/index.mjs.map +1 -7
- package/build-module/components/root/index.mjs +228 -243
- package/build-module/components/root/index.mjs.map +1 -7
- package/build-module/components/root/single-page.mjs +174 -148
- package/build-module/components/root/single-page.mjs.map +1 -7
- package/build-module/components/root/use-sync-body-background.mjs +28 -22
- package/build-module/components/root/use-sync-body-background.mjs.map +1 -7
- package/build-module/components/save-button/index.mjs +170 -214
- package/build-module/components/save-button/index.mjs.map +1 -7
- package/build-module/components/save-panel/index.mjs +110 -106
- package/build-module/components/save-panel/index.mjs.map +1 -7
- package/build-module/components/save-panel/use-save-shortcut.mjs +42 -51
- package/build-module/components/save-panel/use-save-shortcut.mjs.map +1 -7
- package/build-module/components/sidebar/index.mjs +126 -104
- package/build-module/components/sidebar/index.mjs.map +1 -7
- package/build-module/index.mjs +1 -7
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/store/actions.mjs +34 -31
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/index.mjs +9 -11
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/reducer.mjs +48 -55
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/selectors.mjs +21 -16
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/store/types.mjs +0 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/components/error-boundary/index.tsx +52 -6
- package/src/components/navigation/navigation-screen/index.tsx +2 -2
- package/src/components/root/_layout.module.scss +1 -1
- package/src/components/root/index.tsx +7 -3
- package/build-module/index.mjs.map +0 -7
- 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,EACpB;AAEA,cAAY,m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,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(\"5af927cba5\", \"._56935e6282cea626__layout{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._56935e6282cea626__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._56935e6282cea626__layout{min-height:calc(100vh - 32px)}body:has(._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas) ._56935e6282cea626__layout{min-height:100vh}}:where(._56935e6282cea626__layout) img{height:auto;max-width:100%}._56935e6282cea626__layout ._4b753b79328f00f2__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}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .components-snackbar,._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .efa1f12116c3fb44__components-snackbar{margin-inline:auto}.a42f10ffa1623b1a__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}._24ece5d7d830027c__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._24ece5d7d830027c__sidebar.ea25e130be9dcc55__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._46722ab62d8eeeca__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._5021a5c25e2952a7__layout-single-page ._46722ab62d8eeeca__mobile-sidebar-drawer{top:46px}._46722ab62d8eeeca__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}._690b80eca9eb9eb6__canvas._47abeba36a2c03ed__has-mobile-drawer{padding-top:65px;position:relative}._52f74c33fd2757fc__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._52f74c33fd2757fc__surfaces{margin:8px}._5021a5c25e2952a7__layout-single-page ._52f74c33fd2757fc__surfaces{margin-top:0;margin-inline-start:0}}._8510aae3042dca12__inspector,.ed02476df88803b9__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}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._8510aae3042dca12__inspector,.ed02476df88803b9__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:auto}}.ed02476df88803b9__stage{z-index:2}@media (min-width:782px){.ed02476df88803b9__stage{z-index:auto}}._8510aae3042dca12__inspector{z-index:3}@media (min-width:782px){._8510aae3042dca12__inspector{z-index:auto}}._690b80eca9eb9eb6__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}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._690b80eca9eb9eb6__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:auto}._56935e6282cea626__layout.b4c4ba65515802c9__has-canvas .ed02476df88803b9__stage,._8510aae3042dca12__inspector{max-width:400px}}._690b80eca9eb9eb6__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._52f74c33fd2757fc__surfaces{gap:0;margin:0}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._8510aae3042dca12__inspector,._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas .ed02476df88803b9__stage{display:none}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__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)}._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:46px}@media (min-width:782px){._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:32px}}@media (max-width:782px){._690b80eca9eb9eb6__canvas:not(._47abeba36a2c03ed__has-mobile-drawer),._8510aae3042dca12__inspector,.ed02476df88803b9__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._46722ab62d8eeeca__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._690b80eca9eb9eb6__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._690b80eca9eb9eb6__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.ed02476df88803b9__stage{view-transition-name:boot--stage}._8510aae3042dca12__inspector{view-transition-name:boot--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.ed02476df88803b9__stage{view-transition-name:boot-safari--stage}._8510aae3042dca12__inspector{view-transition-name:boot-safari--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._56935e6282cea626__layout) *{view-transition-name:none!important}}:root:has(._56935e6282cea626__layout)::view-transition-new(root),:root:has(._56935e6282cea626__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._56935e6282cea626__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-header),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._56935e6282cea626__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector),:root:has(._56935e6282cea626__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(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ab73776591f19033__zoomOut;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_10c071ed4bf0c4f2__zoomIn;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_30a8540aba2100e9__slideFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:aea85e2dfc564485__slideToRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_8ad9a41739bd9fbe__slideHeaderFromTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:f56b26b5d5c9bc72__slideHeaderToTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:a2ba8d5a4515e038__slideSidebarFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_6ddf6cb6adc49ad6__slideSidebarToRight;will-change:transform}@keyframes ab73776591f19033__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _10c071ed4bf0c4f2__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _30a8540aba2100e9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes aea85e2dfc564485__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _8ad9a41739bd9fbe__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes f56b26b5d5c9bc72__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes a2ba8d5a4515e038__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _6ddf6cb6adc49ad6__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"_56935e6282cea626__layout\",\"has-full-canvas\":\"_8fc7f864ef1ff9d4__has-full-canvas\",\"notices-snackbar\":\"_4b753b79328f00f2__notices-snackbar\",\"components-snackbar\":\"efa1f12116c3fb44__components-snackbar\",\"sidebar-backdrop\":\"a42f10ffa1623b1a__sidebar-backdrop\",\"sidebar\":\"_24ece5d7d830027c__sidebar\",\"is-mobile\":\"ea25e130be9dcc55__is-mobile\",\"mobile-sidebar-drawer\":\"_46722ab62d8eeeca__mobile-sidebar-drawer\",\"layout-single-page\":\"_5021a5c25e2952a7__layout-single-page\",\"canvas\":\"_690b80eca9eb9eb6__canvas\",\"has-mobile-drawer\":\"_47abeba36a2c03ed__has-mobile-drawer\",\"surfaces\":\"_52f74c33fd2757fc__surfaces\",\"stage\":\"ed02476df88803b9__stage\",\"inspector\":\"_8510aae3042dca12__inspector\",\"has-canvas\":\"b4c4ba65515802c9__has-canvas\",\"zoomOut\":\"ab73776591f19033__zoomOut\",\"zoomIn\":\"_10c071ed4bf0c4f2__zoomIn\",\"slideFromRight\":\"_30a8540aba2100e9__slideFromRight\",\"slideToRight\":\"aea85e2dfc564485__slideToRight\",\"slideHeaderFromTop\":\"_8ad9a41739bd9fbe__slideHeaderFromTop\",\"slideHeaderToTop\":\"f56b26b5d5c9bc72__slideHeaderToTop\",\"slideSidebarFromRight\":\"a2ba8d5a4515e038__slideSidebarFromRight\",\"slideSidebarToRight\":\"_6ddf6cb6adc49ad6__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 { __, isRTL } 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={ {\n\t\t\t\t\t\t\t\t\t\t\t\tx: isRTL() ? '100%' : '-100%',\n\t\t\t\t\t\t\t\t\t\t\t} }\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={ {\n\t\t\t\t\t\t\t\t\t\t\t\tx: isRTL() ? '100%' : '-100%',\n\t\t\t\t\t\t\t\t\t\t\t} }\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,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,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,IAAI,SAAS,QACvB;MACA,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
|
|
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
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
35
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
103
|
-
|
|
119
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("5af927cba5", "._56935e6282cea626__layout{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._56935e6282cea626__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._56935e6282cea626__layout{min-height:calc(100vh - 32px)}body:has(._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas) ._56935e6282cea626__layout{min-height:100vh}}:where(._56935e6282cea626__layout) img{height:auto;max-width:100%}._56935e6282cea626__layout ._4b753b79328f00f2__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}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .components-snackbar,._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .efa1f12116c3fb44__components-snackbar{margin-inline:auto}.a42f10ffa1623b1a__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}._24ece5d7d830027c__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._24ece5d7d830027c__sidebar.ea25e130be9dcc55__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._46722ab62d8eeeca__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._5021a5c25e2952a7__layout-single-page ._46722ab62d8eeeca__mobile-sidebar-drawer{top:46px}._46722ab62d8eeeca__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}._690b80eca9eb9eb6__canvas._47abeba36a2c03ed__has-mobile-drawer{padding-top:65px;position:relative}._52f74c33fd2757fc__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._52f74c33fd2757fc__surfaces{margin:8px}._5021a5c25e2952a7__layout-single-page ._52f74c33fd2757fc__surfaces{margin-top:0;margin-inline-start:0}}._8510aae3042dca12__inspector,.ed02476df88803b9__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}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._8510aae3042dca12__inspector,.ed02476df88803b9__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:auto}}.ed02476df88803b9__stage{z-index:2}@media (min-width:782px){.ed02476df88803b9__stage{z-index:auto}}._8510aae3042dca12__inspector{z-index:3}@media (min-width:782px){._8510aae3042dca12__inspector{z-index:auto}}._690b80eca9eb9eb6__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}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._690b80eca9eb9eb6__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:auto}._56935e6282cea626__layout.b4c4ba65515802c9__has-canvas .ed02476df88803b9__stage,._8510aae3042dca12__inspector{max-width:400px}}._690b80eca9eb9eb6__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._52f74c33fd2757fc__surfaces{gap:0;margin:0}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._8510aae3042dca12__inspector,._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas .ed02476df88803b9__stage{display:none}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__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)}._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:46px}@media (min-width:782px){._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:32px}}@media (max-width:782px){._690b80eca9eb9eb6__canvas:not(._47abeba36a2c03ed__has-mobile-drawer),._8510aae3042dca12__inspector,.ed02476df88803b9__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._46722ab62d8eeeca__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._690b80eca9eb9eb6__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._690b80eca9eb9eb6__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.ed02476df88803b9__stage{view-transition-name:boot--stage}._8510aae3042dca12__inspector{view-transition-name:boot--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.ed02476df88803b9__stage{view-transition-name:boot-safari--stage}._8510aae3042dca12__inspector{view-transition-name:boot-safari--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._56935e6282cea626__layout) *{view-transition-name:none!important}}:root:has(._56935e6282cea626__layout)::view-transition-new(root),:root:has(._56935e6282cea626__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._56935e6282cea626__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-header),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._56935e6282cea626__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector),:root:has(._56935e6282cea626__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(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ab73776591f19033__zoomOut;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_10c071ed4bf0c4f2__zoomIn;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_30a8540aba2100e9__slideFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:aea85e2dfc564485__slideToRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_8ad9a41739bd9fbe__slideHeaderFromTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:f56b26b5d5c9bc72__slideHeaderToTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:a2ba8d5a4515e038__slideSidebarFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_6ddf6cb6adc49ad6__slideSidebarToRight;will-change:transform}@keyframes ab73776591f19033__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _10c071ed4bf0c4f2__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _30a8540aba2100e9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes aea85e2dfc564485__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _8ad9a41739bd9fbe__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes f56b26b5d5c9bc72__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes a2ba8d5a4515e038__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _6ddf6cb6adc49ad6__slideSidebarToRight{to{transform:translateX(100%)}}");
|
|
120
|
+
var style_module_default = {
|
|
121
|
+
"layout": "_56935e6282cea626__layout",
|
|
122
|
+
"has-full-canvas": "_8fc7f864ef1ff9d4__has-full-canvas",
|
|
123
|
+
"notices-snackbar": "_4b753b79328f00f2__notices-snackbar",
|
|
124
|
+
"components-snackbar": "efa1f12116c3fb44__components-snackbar",
|
|
125
|
+
"sidebar-backdrop": "a42f10ffa1623b1a__sidebar-backdrop",
|
|
126
|
+
"sidebar": "_24ece5d7d830027c__sidebar",
|
|
127
|
+
"is-mobile": "ea25e130be9dcc55__is-mobile",
|
|
128
|
+
"mobile-sidebar-drawer": "_46722ab62d8eeeca__mobile-sidebar-drawer",
|
|
129
|
+
"layout-single-page": "_5021a5c25e2952a7__layout-single-page",
|
|
130
|
+
"canvas": "_690b80eca9eb9eb6__canvas",
|
|
131
|
+
"has-mobile-drawer": "_47abeba36a2c03ed__has-mobile-drawer",
|
|
132
|
+
"surfaces": "_52f74c33fd2757fc__surfaces",
|
|
133
|
+
"stage": "ed02476df88803b9__stage",
|
|
134
|
+
"inspector": "_8510aae3042dca12__inspector",
|
|
135
|
+
"has-canvas": "b4c4ba65515802c9__has-canvas",
|
|
136
|
+
"zoomOut": "ab73776591f19033__zoomOut",
|
|
137
|
+
"zoomIn": "_10c071ed4bf0c4f2__zoomIn",
|
|
138
|
+
"slideFromRight": "_30a8540aba2100e9__slideFromRight",
|
|
139
|
+
"slideToRight": "aea85e2dfc564485__slideToRight",
|
|
140
|
+
"slideHeaderFromTop": "_8ad9a41739bd9fbe__slideHeaderFromTop",
|
|
141
|
+
"slideHeaderToTop": "f56b26b5d5c9bc72__slideHeaderToTop",
|
|
142
|
+
"slideSidebarFromRight": "a2ba8d5a4515e038__slideSidebarFromRight",
|
|
143
|
+
"slideSidebarToRight": "_6ddf6cb6adc49ad6__slideSidebarToRight"
|
|
144
|
+
};
|
|
104
145
|
// packages/boot/src/components/root/single-page.tsx
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
//# sourceMappingURL=single-page.mjs.map
|
|
199
|
+
export { RootSinglePage as default };
|
|
200
|
+
|
|
201
|
+
//# sourceMappingURL=single-page.mjs.map
|