@wordpress/boot 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/build-module/components/app/index.mjs.map +1 -1
  2. package/build-module/components/app/router.mjs +24 -24
  3. package/build-module/components/app/router.mjs.map +1 -1
  4. package/build-module/components/app/use-route-focus.mjs +162 -0
  5. package/build-module/components/app/use-route-focus.mjs.map +1 -0
  6. package/build-module/components/app/use-route-title.mjs +6 -1
  7. package/build-module/components/app/use-route-title.mjs.map +1 -1
  8. package/build-module/components/canvas/index.mjs +1 -1
  9. package/build-module/components/canvas/index.mjs.map +1 -1
  10. package/build-module/components/canvas/use-navigate-to-entity-record.mjs +20 -12
  11. package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +1 -1
  12. package/build-module/components/error-boundary/index.mjs +2 -2
  13. package/build-module/components/error-boundary/index.mjs.map +1 -1
  14. package/build-module/components/navigation/drilldown-item/index.mjs +3 -3
  15. package/build-module/components/navigation/drilldown-item/index.mjs.map +1 -1
  16. package/build-module/components/navigation/dropdown-item/index.mjs +3 -3
  17. package/build-module/components/navigation/dropdown-item/index.mjs.map +1 -1
  18. package/build-module/components/navigation/navigation-item/index.mjs +3 -3
  19. package/build-module/components/navigation/navigation-item/index.mjs.map +1 -1
  20. package/build-module/components/navigation/navigation-screen/index.mjs +7 -7
  21. package/build-module/components/navigation/navigation-screen/index.mjs.map +1 -1
  22. package/build-module/components/navigation/router-link-item.mjs.map +1 -1
  23. package/build-module/components/plugin-area/index.mjs +5 -1
  24. package/build-module/components/plugin-area/index.mjs.map +1 -1
  25. package/build-module/components/root/index.mjs +31 -28
  26. package/build-module/components/root/index.mjs.map +1 -1
  27. package/build-module/components/root/single-page.mjs +28 -25
  28. package/build-module/components/root/single-page.mjs.map +1 -1
  29. package/build-module/components/save-button/index.mjs +8 -3
  30. package/build-module/components/save-button/index.mjs.map +1 -1
  31. package/build-module/components/save-panel/index.mjs +3 -1
  32. package/build-module/components/save-panel/index.mjs.map +1 -1
  33. package/build-module/components/sidebar/index.mjs +11 -11
  34. package/build-module/components/sidebar/index.mjs.map +1 -1
  35. package/build-types/components/app/use-route-focus.d.ts +14 -0
  36. package/build-types/components/app/use-route-focus.d.ts.map +1 -0
  37. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +3 -1
  38. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -1
  39. package/build-types/components/root/index.d.ts.map +1 -1
  40. package/build-types/components/root/single-page.d.ts.map +1 -1
  41. package/build-types/components/save-button/index.d.ts.map +1 -1
  42. package/build-types/components/save-panel/index.d.ts.map +1 -1
  43. package/build-types/components/sidebar/index.d.ts.map +1 -1
  44. package/package.json +35 -28
  45. package/src/components/app/test/fixtures/own-focus.tsx +22 -0
  46. package/src/components/app/test/fixtures/settings-general.tsx +21 -0
  47. package/src/components/app/test/fixtures/settings.tsx +10 -0
  48. package/src/components/app/test/navigation-focus.browser.test.tsx +108 -0
  49. package/src/components/app/use-route-focus.ts +53 -0
  50. package/src/components/canvas/index.tsx +1 -1
  51. package/src/components/canvas/use-navigate-to-entity-record.ts +33 -16
  52. package/src/components/error-boundary/index.tsx +2 -2
  53. package/src/components/navigation/drilldown-item/index.tsx +3 -3
  54. package/src/components/navigation/dropdown-item/index.tsx +3 -3
  55. package/src/components/navigation/navigation-item/index.tsx +3 -3
  56. package/src/components/navigation/navigation-item/style.module.scss +13 -7
  57. package/src/components/navigation/navigation-screen/index.tsx +2 -2
  58. package/src/components/navigation/navigation-screen/style.module.scss +1 -1
  59. package/src/components/navigation/router-link-item.tsx +3 -3
  60. package/src/components/root/_layout.module.scss +8 -1
  61. package/src/components/root/index.tsx +11 -4
  62. package/src/components/root/single-page.tsx +4 -1
  63. package/src/components/root/test/admin-scheme-sidebar.browser.test.tsx +120 -0
  64. package/src/components/save-button/index.tsx +7 -2
  65. package/src/components/save-panel/index.tsx +4 -1
  66. package/src/components/sidebar/index.tsx +10 -6
  67. package/src/components/sidebar/style.module.scss +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/components/app/index.tsx"],"sourcesContent":["import { createRoot, StrictMode, type ComponentType } from '@wordpress/element';\nimport { dispatch, useSelect } from '@wordpress/data';\nimport Router from './router';\nimport RootSinglePage from '../root/single-page';\nimport { store } from '../../store';\nimport type { MenuItem, Route } from '../../store/types';\n\ninterface AppProps {\n\trootComponent?: ComponentType;\n}\n\nfunction App( { rootComponent }: AppProps ) {\n\tconst routes = useSelect( ( select ) => select( store ).getRoutes(), [] );\n\n\treturn <Router routes={ routes } rootComponent={ rootComponent } />;\n}\n\n/*\n * Import and run page init modules.\n * Each module must export an async `init` function,\n * awaited before the app renders so startup tasks finish first.\n */\nasync function runInitModules( initModules?: string[] ) {\n\tfor ( const moduleId of initModules ?? [] ) {\n\t\tconst module = await import( moduleId );\n\t\tawait module.init();\n\t}\n}\n\ninterface InitProps {\n\tmountId: string;\n\tmenuItems?: MenuItem[];\n\troutes?: Route[];\n\tinitModules?: string[];\n\tdashboardLink?: string;\n}\n\nexport async function init( {\n\tmountId,\n\tmenuItems,\n\troutes,\n\tinitModules,\n\tdashboardLink,\n}: InitProps ) {\n\t( menuItems ?? [] ).forEach( ( menuItem ) => {\n\t\tdispatch( store ).registerMenuItem( menuItem.id, menuItem );\n\t} );\n\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\tif ( dashboardLink ) {\n\t\tdispatch( store ).setDashboardLink( dashboardLink );\n\t}\n\n\tawait runInitModules( initModules );\n\n\t// Render the app\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n\ninterface InitSinglePageProps {\n\tmountId: string;\n\troutes?: Route[];\n\tinitModules?: string[];\n}\n\nexport async function initSinglePage( {\n\tmountId,\n\troutes,\n\tinitModules,\n}: InitSinglePageProps ) {\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\tawait runInitModules( initModules );\n\n\t// Render the app without sidebar\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App rootComponent={ RootSinglePage } />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAWA,SAAS,IAAK,EAAE,iBAA4B;CAC3C,MAAM,SAAS,WAAa,WAAY,OAAQ,KAAM,CAAC,CAAC,UAAU,GAAG,CAAC,CAAE;CAExE,OAAO,oBAAC,QAAD;EAAiB;EAAyB;CAAiB,CAAA;AACnE;AAOA,eAAe,eAAgB,aAAyB;CACvD,KAAM,MAAM,YAAY,eAAe,CAAC,GAEvC,OAAM,MADe,OAAQ,UAAA,CAChB,KAAK;AAEpB;AAUA,eAAsB,KAAM,EAC3B,SACA,WACA,QACA,aACA,iBACc;CACd,CAAE,aAAa,CAAC,EAAA,CAAI,SAAW,aAAc;EAC5C,SAAU,KAAM,CAAC,CAAC,iBAAkB,SAAS,IAAI,QAAS;CAC3D,CAAE;CAEF,CAAE,UAAU,CAAC,EAAA,CAAI,SAAW,UAAW;EACtC,SAAU,KAAM,CAAC,CAAC,cAAe,KAAM;CACxC,CAAE;CAEF,IAAK,eACJ,SAAU,KAAM,CAAC,CAAC,iBAAkB,aAAc;CAGnD,MAAM,eAAgB,WAAY;CAGlC,MAAM,cAAc,SAAS,eAAgB,OAAQ;CACrD,IAAK,aAEJ,WADyB,WACtB,CAAC,CAAC,OACJ,oBAAC,YAAD,EAAA,UACC,oBAAC,KAAD,CAAM,CAAA,EACK,CAAA,CACb;AAEF;AAQA,eAAsB,eAAgB,EACrC,SACA,QACA,eACwB;CACxB,CAAE,UAAU,CAAC,EAAA,CAAI,SAAW,UAAW;EACtC,SAAU,KAAM,CAAC,CAAC,cAAe,KAAM;CACxC,CAAE;CAEF,MAAM,eAAgB,WAAY;CAGlC,MAAM,cAAc,SAAS,eAAgB,OAAQ;CACrD,IAAK,aAEJ,WADyB,WACtB,CAAC,CAAC,OACJ,oBAAC,YAAD,EAAA,UACC,oBAAC,KAAD,EAAK,eAAgB,eAAkB,CAAA,EAC5B,CAAA,CACb;AAEF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/components/app/index.tsx"],"sourcesContent":["import { createRoot, StrictMode, type ComponentType } from '@wordpress/element';\nimport { dispatch, useSelect } from '@wordpress/data';\nimport Router from './router';\nimport RootSinglePage from '../root/single-page';\nimport { store } from '../../store';\nimport type { MenuItem, Route } from '../../store/types';\n\ninterface AppProps {\n\trootComponent?: ComponentType;\n}\n\nfunction App( { rootComponent }: AppProps ) {\n\tconst routes = useSelect( ( select ) => select( store ).getRoutes(), [] );\n\n\treturn <Router routes={ routes } rootComponent={ rootComponent } />;\n}\n\n/*\n * Import and run page init modules.\n * Each module must export an async `init` function,\n * awaited before the app renders so startup tasks finish first.\n */\nasync function runInitModules( initModules?: string[] ) {\n\tfor ( const moduleId of initModules ?? [] ) {\n\t\tconst module = await import( moduleId );\n\t\tawait module.init();\n\t}\n}\n\ninterface InitProps {\n\tmountId: string;\n\tmenuItems?: MenuItem[];\n\troutes?: Route[];\n\tinitModules?: string[];\n\tdashboardLink?: string;\n}\n\nexport async function init( {\n\tmountId,\n\tmenuItems,\n\troutes,\n\tinitModules,\n\tdashboardLink,\n}: InitProps ) {\n\t( menuItems ?? [] ).forEach( ( menuItem ) => {\n\t\tdispatch( store ).registerMenuItem( menuItem.id, menuItem );\n\t} );\n\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\tif ( dashboardLink ) {\n\t\tdispatch( store ).setDashboardLink( dashboardLink );\n\t}\n\n\tawait runInitModules( initModules );\n\n\t// Render the app\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n\ninterface InitSinglePageProps {\n\tmountId: string;\n\troutes?: Route[];\n\tinitModules?: string[];\n}\n\nexport async function initSinglePage( {\n\tmountId,\n\troutes,\n\tinitModules,\n}: InitSinglePageProps ) {\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\tawait runInitModules( initModules );\n\n\t// Render the app without sidebar\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App rootComponent={ RootSinglePage } />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAWA,SAAS,IAAK,EAAE,iBAA4B;CAC3C,MAAM,SAAS,WAAa,WAAY,OAAQ,KAAM,CAAC,CAAC,UAAU,GAAG,CAAC,CAAE;CAExE,OAAO,oBAAC,QAAD;EAAiB;EAAyB;CAAiB,CAAA;AACnE;AAOA,eAAe,eAAgB,aAAyB;CACvD,KAAM,MAAM,YAAY,eAAe,CAAC,GAEvC,OAAM,MADe,OAAQ,UAAA,CAChB,KAAK;AAEpB;AAUA,eAAsB,KAAM,EAC3B,SACA,WACA,QACA,aACA,iBACc;CACd,CAAE,aAAa,CAAC,EAAA,CAAI,SAAW,aAAc;EAC5C,SAAU,KAAM,CAAC,CAAC,iBAAkB,SAAS,IAAI,QAAS;CAC3D,CAAE;CAEF,CAAE,UAAU,CAAC,EAAA,CAAI,SAAW,UAAW;EACtC,SAAU,KAAM,CAAC,CAAC,cAAe,KAAM;CACxC,CAAE;CAEF,IAAK,eACJ,SAAU,KAAM,CAAC,CAAC,iBAAkB,aAAc;CAGnD,MAAM,eAAgB,WAAY;CAGlC,MAAM,cAAc,SAAS,eAAgB,OAAQ;CACrD,IAAK,aACS,WAAY,WACtB,CAAC,CAAC,OACJ,oBAAC,YAAD,EAAA,UACC,oBAAC,KAAD,CAAM,CAAA,EACK,CAAA,CACb;AAEF;AAQA,eAAsB,eAAgB,EACrC,SACA,QACA,eACwB;CACxB,CAAE,UAAU,CAAC,EAAA,CAAI,SAAW,UAAW;EACtC,SAAU,KAAM,CAAC,CAAC,cAAe,KAAM;CACxC,CAAE;CAEF,MAAM,eAAgB,WAAY;CAGlC,MAAM,cAAc,SAAS,eAAgB,OAAQ;CACrD,IAAK,aACS,WAAY,WACtB,CAAC,CAAC,OACJ,oBAAC,YAAD,EAAA,UACC,oBAAC,KAAD,EAAK,eAAgB,eAAkB,CAAA,EAC5B,CAAA,CACb;AAEF"}
@@ -111,31 +111,31 @@ function registerStyle(hash, css) {
111
111
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
112
112
  }
113
113
  // packages/boot/src/components/root/style.module.scss
114
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("fed1a7ec24", "._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}");
114
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("a1e6beedc4", ".ec570fbb2868f496__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){.ec570fbb2868f496__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.ec570fbb2868f496__layout{min-height:calc(100vh - 32px)}body:has(.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas) .ec570fbb2868f496__layout{min-height:100vh}}:where(.ec570fbb2868f496__layout) img{height:auto;max-width:100%}.ec570fbb2868f496__layout ._1c9a312567e28b20__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}.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .components-snackbar,.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .d4a42c38e09753ae__components-snackbar{margin-inline:auto}._8e41abc61ab38a0b__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}._9c70c6016411e369__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._9c70c6016411e369__sidebar.b5ec24928c8da36b__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}.ed28d4367377467b__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._452d7ff5ac74eb84__layout-single-page .ed28d4367377467b__mobile-sidebar-drawer{top:46px}.ed28d4367377467b__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}.e6b2ba021c702ffb__canvas._7cfa87f7a2463610__has-mobile-drawer{padding-top:65px;position:relative}._0ec9efcb29281d50__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._0ec9efcb29281d50__surfaces{margin:8px}._452d7ff5ac74eb84__layout-single-page ._0ec9efcb29281d50__surfaces{height:calc(100vh - 40px);margin-top:0;margin-inline-start:0;position:sticky;top:32px}}.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{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}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:auto}}.a7bbf3aae333d0d8__stage{z-index:2}@media (min-width:782px){.a7bbf3aae333d0d8__stage{z-index:auto}}.e674251381793b5f__inspector{z-index:3}@media (min-width:782px){.e674251381793b5f__inspector{z-index:auto}}.e6b2ba021c702ffb__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}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.e6b2ba021c702ffb__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:auto}.e674251381793b5f__inspector,.ec570fbb2868f496__layout._15176d330d368459__has-canvas .a7bbf3aae333d0d8__stage{max-width:400px}}.e6b2ba021c702ffb__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas ._0ec9efcb29281d50__surfaces{gap:0;margin:0}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .a7bbf3aae333d0d8__stage,.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e674251381793b5f__inspector{display:none}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__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)}._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:46px}@media (min-width:782px){._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:32px}}@media (max-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector,.e6b2ba021c702ffb__canvas:not(._7cfa87f7a2463610__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.ed28d4367377467b__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.e6b2ba021c702ffb__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.e6b2ba021c702ffb__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.a7bbf3aae333d0d8__stage{view-transition-name:boot--stage}.e674251381793b5f__inspector{view-transition-name:boot--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a7bbf3aae333d0d8__stage{view-transition-name:boot-safari--stage}.e674251381793b5f__inspector{view-transition-name:boot-safari--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.ec570fbb2868f496__layout) *{view-transition-name:none!important}}:root:has(.ec570fbb2868f496__layout)::view-transition-new(root),:root:has(.ec570fbb2868f496__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.ec570fbb2868f496__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-header),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector),:root:has(.ec570fbb2868f496__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(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_5a1779b2f2c90caf__zoomOut;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_4e45a7a3e5f56197__zoomIn;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_537b6d2e5041d8b9__slideFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:db499c91f24ad370__slideToRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_6b902826dce37697__slideHeaderFromTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8e9025331ac47b17__slideHeaderToTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_08fb3da5295b47f8__slideSidebarFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:a0bb8b58f3887328__slideSidebarToRight;will-change:transform}@keyframes _5a1779b2f2c90caf__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _4e45a7a3e5f56197__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _537b6d2e5041d8b9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes db499c91f24ad370__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _6b902826dce37697__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8e9025331ac47b17__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _08fb3da5295b47f8__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes a0bb8b58f3887328__slideSidebarToRight{to{transform:translateX(100%)}}");
115
115
  var style_module_default = {
116
- "layout": "_5c711a1cecefd5e8__layout",
117
- "has-full-canvas": "_52e00bad88ace7ce__has-full-canvas",
118
- "notices-snackbar": "eeebb116829e2f94__notices-snackbar",
119
- "components-snackbar": "cb865dcda5233b3b__components-snackbar",
120
- "sidebar-backdrop": "_04b3b4e8346a2b7b__sidebar-backdrop",
121
- "sidebar": "_615b052cf60fcff2__sidebar",
122
- "is-mobile": "_6be5d95ddf25e57f__is-mobile",
123
- "mobile-sidebar-drawer": "fd8d6491146392ce__mobile-sidebar-drawer",
124
- "layout-single-page": "f37b94fd2c1f6020__layout-single-page",
125
- "canvas": "_6da399dd0a232c1f__canvas",
126
- "has-mobile-drawer": "_5568e036ddaba310__has-mobile-drawer",
127
- "surfaces": "ff37ba01b23d0bcb__surfaces",
128
- "stage": "e323e272b8b8ed4f__stage",
129
- "inspector": "b37b199f2111c5f8__inspector",
130
- "has-canvas": "bbaf96f69377ab55__has-canvas",
131
- "zoomOut": "_2e385023a338e4a9__zoomOut",
132
- "zoomIn": "e245c2f64b6256de__zoomIn",
133
- "slideFromRight": "_9aa5832f67721dd4__slideFromRight",
134
- "slideToRight": "_4d20ae2879ce77c4__slideToRight",
135
- "slideHeaderFromTop": "e56b4b1bb9ff1176__slideHeaderFromTop",
136
- "slideHeaderToTop": "e54b49876d2b7dc3__slideHeaderToTop",
137
- "slideSidebarFromRight": "f74156de1cf32837__slideSidebarFromRight",
138
- "slideSidebarToRight": "_157f548b8629f8b5__slideSidebarToRight"
116
+ "layout": "ec570fbb2868f496__layout",
117
+ "has-full-canvas": "_412c860698817aa8__has-full-canvas",
118
+ "notices-snackbar": "_1c9a312567e28b20__notices-snackbar",
119
+ "components-snackbar": "d4a42c38e09753ae__components-snackbar",
120
+ "sidebar-backdrop": "_8e41abc61ab38a0b__sidebar-backdrop",
121
+ "sidebar": "_9c70c6016411e369__sidebar",
122
+ "is-mobile": "b5ec24928c8da36b__is-mobile",
123
+ "mobile-sidebar-drawer": "ed28d4367377467b__mobile-sidebar-drawer",
124
+ "layout-single-page": "_452d7ff5ac74eb84__layout-single-page",
125
+ "canvas": "e6b2ba021c702ffb__canvas",
126
+ "has-mobile-drawer": "_7cfa87f7a2463610__has-mobile-drawer",
127
+ "surfaces": "_0ec9efcb29281d50__surfaces",
128
+ "stage": "a7bbf3aae333d0d8__stage",
129
+ "inspector": "e674251381793b5f__inspector",
130
+ "has-canvas": "_15176d330d368459__has-canvas",
131
+ "zoomOut": "_5a1779b2f2c90caf__zoomOut",
132
+ "zoomIn": "_4e45a7a3e5f56197__zoomIn",
133
+ "slideFromRight": "_537b6d2e5041d8b9__slideFromRight",
134
+ "slideToRight": "db499c91f24ad370__slideToRight",
135
+ "slideHeaderFromTop": "_6b902826dce37697__slideHeaderFromTop",
136
+ "slideHeaderToTop": "_8e9025331ac47b17__slideHeaderToTop",
137
+ "slideSidebarFromRight": "_08fb3da5295b47f8__slideSidebarFromRight",
138
+ "slideSidebarToRight": "a0bb8b58f3887328__slideSidebarToRight"
139
139
  };
140
140
  // packages/boot/src/components/app/router.tsx
141
141
  const { createLazyRoute, createRouter, createRootRoute, createRoute, RouterProvider, createBrowserHistory, parseHref, useLoaderData } = unlock(privateApis);
@@ -1 +1 @@
1
- {"version":3,"file":"router.mjs","names":["routePrivateApis","styles","coreStore"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/app/router.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"fed1a7ec24\", \"._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"_5c711a1cecefd5e8__layout\",\"has-full-canvas\":\"_52e00bad88ace7ce__has-full-canvas\",\"notices-snackbar\":\"eeebb116829e2f94__notices-snackbar\",\"components-snackbar\":\"cb865dcda5233b3b__components-snackbar\",\"sidebar-backdrop\":\"_04b3b4e8346a2b7b__sidebar-backdrop\",\"sidebar\":\"_615b052cf60fcff2__sidebar\",\"is-mobile\":\"_6be5d95ddf25e57f__is-mobile\",\"mobile-sidebar-drawer\":\"fd8d6491146392ce__mobile-sidebar-drawer\",\"layout-single-page\":\"f37b94fd2c1f6020__layout-single-page\",\"canvas\":\"_6da399dd0a232c1f__canvas\",\"has-mobile-drawer\":\"_5568e036ddaba310__has-mobile-drawer\",\"surfaces\":\"ff37ba01b23d0bcb__surfaces\",\"stage\":\"e323e272b8b8ed4f__stage\",\"inspector\":\"b37b199f2111c5f8__inspector\",\"has-canvas\":\"bbaf96f69377ab55__has-canvas\",\"zoomOut\":\"_2e385023a338e4a9__zoomOut\",\"zoomIn\":\"e245c2f64b6256de__zoomIn\",\"slideFromRight\":\"_9aa5832f67721dd4__slideFromRight\",\"slideToRight\":\"_4d20ae2879ce77c4__slideToRight\",\"slideHeaderFromTop\":\"e56b4b1bb9ff1176__slideHeaderFromTop\",\"slideHeaderToTop\":\"e54b49876d2b7dc3__slideHeaderToTop\",\"slideSidebarFromRight\":\"f74156de1cf32837__slideSidebarFromRight\",\"slideSidebarToRight\":\"_157f548b8629f8b5__slideSidebarToRight\"};\n","import type { ComponentType } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { Page } from '@wordpress/admin-ui';\nimport {\n\tprivateApis as routePrivateApis,\n\ttype AnyRoute,\n} from '@wordpress/route';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport Root from '../root';\nimport styles from '../root/style.module.scss';\nimport ErrorBoundary from '../error-boundary';\nimport type { Route, RouteConfig, RouteLoaderContext } from '../../store/types';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tRouterProvider,\n\tcreateBrowserHistory,\n\tparseHref,\n\tuseLoaderData,\n} = unlock( routePrivateApis );\n\n// Not found component\nfunction NotFoundComponent() {\n\treturn (\n\t\t<div className={ styles.stage }>\n\t\t\t<Page title={ __( 'Route not found' ) } hasPadding>\n\t\t\t\t{ __( \"The page you're looking for does not exist\" ) }\n\t\t\t</Page>\n\t\t</div>\n\t);\n}\n\n/**\n * Creates a TanStack route from a Route definition.\n *\n * @param route Route configuration\n * @param parentRoute Parent route.\n * @return Tanstack Route.\n */\nfunction createRouteFromDefinition( route: Route, parentRoute: AnyRoute ) {\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\tconst routeConfig = module.route || {};\n\n\t\t\t\tif ( routeConfig.beforeLoad ) {\n\t\t\t\t\treturn routeConfig.beforeLoad( {\n\t\t\t\t\t\tparams: opts.params || {},\n\t\t\t\t\t\tsearch: opts.search || {},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tloader: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tlet routeConfig: RouteConfig = {};\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\trouteConfig = module.route || {};\n\t\t\t}\n\n\t\t\tconst context: RouteLoaderContext = {\n\t\t\t\tparams: opts.params || {},\n\t\t\t\tsearch: opts.deps || {},\n\t\t\t};\n\n\t\t\tconst [ , loaderData, canvasData, titleData ] = await Promise.all( [\n\t\t\t\tresolveSelect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t),\n\t\t\t\trouteConfig.loader\n\t\t\t\t\t? routeConfig.loader( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.canvas\n\t\t\t\t\t? routeConfig.canvas( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.title\n\t\t\t\t\t? routeConfig.title( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t] );\n\n\t\t\tlet inspector = true;\n\t\t\tif ( routeConfig.inspector ) {\n\t\t\t\tinspector = await routeConfig.inspector( context );\n\t\t\t}\n\n\t\t\tlet stage = true;\n\t\t\tif ( routeConfig.stage ) {\n\t\t\t\tstage = await routeConfig.stage( context );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...( loaderData as any ),\n\t\t\t\tcanvas: canvasData,\n\t\t\t\tinspector,\n\t\t\t\tstage,\n\t\t\t\ttitle: titleData,\n\t\t\t\trouteContentModule: route.content_module,\n\t\t\t};\n\t\t},\n\t\tloaderDeps: ( opts: any ) => opts.search,\n\t} );\n\n\t// Chain .lazy() to preload content module on intent\n\ttanstackRoute = tanstackRoute.lazy( async () => {\n\t\tconst module = route.content_module\n\t\t\t? await import( route.content_module )\n\t\t\t: {};\n\n\t\tconst Stage = module.stage;\n\t\tconst Inspector = module.inspector;\n\n\t\treturn createLazyRoute( route.path )( {\n\t\t\tcomponent: function RouteComponent() {\n\t\t\t\tconst { inspector: showInspector, stage: showStage } =\n\t\t\t\t\tuseLoaderData( { from: route.path } ) ?? {};\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ Stage && showStage && (\n\t\t\t\t\t\t\t<div className={ styles.stage }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Stage />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Inspector && showInspector && (\n\t\t\t\t\t\t\t<div className={ styles.inspector }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Inspector />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\t} );\n\n\treturn tanstackRoute;\n}\n\n/**\n * Creates a route tree from route definitions.\n *\n * @param routes Routes definition.\n * @param rootComponent Root component to use for the router.\n * @return Router tree.\n */\nfunction createRouteTree(\n\troutes: Route[],\n\trootComponent: ComponentType = Root\n) {\n\tconst rootRoute = createRootRoute( {\n\t\tcomponent: rootComponent as any,\n\t\tcontext: () => ( {} ),\n\t} );\n\n\t// Create routes from definitions (now synchronous)\n\tconst dynamicRoutes = routes.map( ( route ) =>\n\t\tcreateRouteFromDefinition( route, rootRoute )\n\t);\n\n\treturn rootRoute.addChildren( dynamicRoutes );\n}\n\n// Create custom history that parses ?p= query parameter\nfunction createPathHistory() {\n\treturn createBrowserHistory( {\n\t\tparseLocation: () => {\n\t\t\tconst url = new URL( window.location.href );\n\t\t\tconst path = url.searchParams.get( 'p' ) || '/';\n\t\t\tconst pathHref = `${ path }${ url.hash }`;\n\t\t\treturn parseHref( pathHref, window.history.state );\n\t\t},\n\t\tcreateHref: ( href: string ) => {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tsearchParams.set( 'p', href );\n\t\t\treturn `${ window.location.pathname }?${ searchParams }`;\n\t\t},\n\t} );\n}\n\ninterface RouterProps {\n\troutes: Route[];\n\trootComponent?: ComponentType;\n}\n\nexport default function Router( {\n\troutes,\n\trootComponent = Root,\n}: RouterProps ) {\n\tconst router = useMemo( () => {\n\t\tconst history = createPathHistory();\n\t\tconst routeTree = createRouteTree( routes, rootComponent );\n\n\t\treturn createRouter( {\n\t\t\thistory,\n\t\t\trouteTree,\n\t\t\tdefaultPreload: 'intent',\n\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\tdefaultViewTransition: {\n\t\t\t\ttypes: ( {\n\t\t\t\t\tfromLocation,\n\t\t\t\t}: {\n\t\t\t\t\tfromLocation?: unknown;\n\t\t\t\t\ttoLocation: unknown;\n\t\t\t\t\tpathChanged: boolean;\n\t\t\t\t\threfChanged: boolean;\n\t\t\t\t\thashChanged: boolean;\n\t\t\t\t} ) => {\n\t\t\t\t\t// Disable view transition on initial navigation (no previous location)\n\t\t\t\t\tif ( ! fromLocation ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable with navigation type for subsequent navigations\n\t\t\t\t\treturn [ 'navigate' ];\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}, [ routes, rootComponent ] );\n\n\treturn <RouterProvider router={ router } />;\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,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC,IAAK,MAAM,aAAc,oBAAqB,MAAM,MACnD,OAAO;CAIT,OAAO;AACR;;;;;;;;;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;CAC3E,IAAK,CAAE,eAAe,MACrB;CAGD,MAAM,UAAU,WAAW;CAC3B,IAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;CAEhE,IAAK,CAAE,gBAAiB;EACvB,iCAAiB,IAAI,IAAI;EACzB,QAAQ,eAAe,IAAK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AAc;AAC7C;AAGA,SAAS,oBAAoB;CAC5B,OAAO,qBAAsB;EAC5B,qBAAqB;GACpB,MAAM,MAAM,IAAI,IAAK,OAAO,SAAS,IAAK;GAE1C,MAAM,WAAW,GADJ,IAAI,aAAa,IAAK,GAAI,KAAK,MACd,IAAI;GAClC,OAAO,UAAW,UAAU,OAAO,QAAQ,KAAM;EAClD;EACA,aAAc,SAAkB;GAC/B,MAAM,eAAe,IAAI,gBAAiB,OAAO,SAAS,MAAO;GACjE,aAAa,IAAK,KAAK,IAAK;GAC5B,OAAO,GAAI,OAAO,SAAS,SAAU,GAAI;EAC1C;CACD,CAAE;AACH;AAOA,SAAwB,OAAQ,EAC/B,QACA,gBAAgB,QACA;CAChB,MAAM,SAAS,cAAe;EAC7B,MAAM,UAAU,kBAAkB;EAClC,MAAM,YAAY,gBAAiB,QAAQ,aAAc;EAEzD,OAAO,aAAc;GACpB;GACA;GACA,gBAAgB;GAChB,0BAA0B;GAC1B,uBAAuB,EACtB,QAAS,EACR,mBAOM;IAEN,IAAK,CAAE,cACN,OAAO;IAIR,OAAO,CAAE,UAAW;GACrB,EACD;EACD,CAAE;CACH,GAAG,CAAE,QAAQ,aAAc,CAAE;CAE7B,OAAO,oBAAC,gBAAD,EAAyB,OAAU,CAAA;AAC3C"}
1
+ {"version":3,"file":"router.mjs","names":["routePrivateApis","styles","coreStore"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/app/router.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(\"a1e6beedc4\", \".ec570fbb2868f496__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){.ec570fbb2868f496__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.ec570fbb2868f496__layout{min-height:calc(100vh - 32px)}body:has(.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas) .ec570fbb2868f496__layout{min-height:100vh}}:where(.ec570fbb2868f496__layout) img{height:auto;max-width:100%}.ec570fbb2868f496__layout ._1c9a312567e28b20__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}.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .components-snackbar,.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .d4a42c38e09753ae__components-snackbar{margin-inline:auto}._8e41abc61ab38a0b__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}._9c70c6016411e369__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._9c70c6016411e369__sidebar.b5ec24928c8da36b__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}.ed28d4367377467b__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._452d7ff5ac74eb84__layout-single-page .ed28d4367377467b__mobile-sidebar-drawer{top:46px}.ed28d4367377467b__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}.e6b2ba021c702ffb__canvas._7cfa87f7a2463610__has-mobile-drawer{padding-top:65px;position:relative}._0ec9efcb29281d50__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._0ec9efcb29281d50__surfaces{margin:8px}._452d7ff5ac74eb84__layout-single-page ._0ec9efcb29281d50__surfaces{height:calc(100vh - 40px);margin-top:0;margin-inline-start:0;position:sticky;top:32px}}.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{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}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:auto}}.a7bbf3aae333d0d8__stage{z-index:2}@media (min-width:782px){.a7bbf3aae333d0d8__stage{z-index:auto}}.e674251381793b5f__inspector{z-index:3}@media (min-width:782px){.e674251381793b5f__inspector{z-index:auto}}.e6b2ba021c702ffb__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}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.e6b2ba021c702ffb__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:auto}.e674251381793b5f__inspector,.ec570fbb2868f496__layout._15176d330d368459__has-canvas .a7bbf3aae333d0d8__stage{max-width:400px}}.e6b2ba021c702ffb__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas ._0ec9efcb29281d50__surfaces{gap:0;margin:0}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .a7bbf3aae333d0d8__stage,.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e674251381793b5f__inspector{display:none}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__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)}._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:46px}@media (min-width:782px){._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:32px}}@media (max-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector,.e6b2ba021c702ffb__canvas:not(._7cfa87f7a2463610__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.ed28d4367377467b__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.e6b2ba021c702ffb__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.e6b2ba021c702ffb__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.a7bbf3aae333d0d8__stage{view-transition-name:boot--stage}.e674251381793b5f__inspector{view-transition-name:boot--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a7bbf3aae333d0d8__stage{view-transition-name:boot-safari--stage}.e674251381793b5f__inspector{view-transition-name:boot-safari--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.ec570fbb2868f496__layout) *{view-transition-name:none!important}}:root:has(.ec570fbb2868f496__layout)::view-transition-new(root),:root:has(.ec570fbb2868f496__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.ec570fbb2868f496__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-header),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector),:root:has(.ec570fbb2868f496__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(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_5a1779b2f2c90caf__zoomOut;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_4e45a7a3e5f56197__zoomIn;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_537b6d2e5041d8b9__slideFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:db499c91f24ad370__slideToRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_6b902826dce37697__slideHeaderFromTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8e9025331ac47b17__slideHeaderToTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_08fb3da5295b47f8__slideSidebarFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:a0bb8b58f3887328__slideSidebarToRight;will-change:transform}@keyframes _5a1779b2f2c90caf__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _4e45a7a3e5f56197__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _537b6d2e5041d8b9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes db499c91f24ad370__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _6b902826dce37697__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8e9025331ac47b17__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _08fb3da5295b47f8__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes a0bb8b58f3887328__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"ec570fbb2868f496__layout\",\"has-full-canvas\":\"_412c860698817aa8__has-full-canvas\",\"notices-snackbar\":\"_1c9a312567e28b20__notices-snackbar\",\"components-snackbar\":\"d4a42c38e09753ae__components-snackbar\",\"sidebar-backdrop\":\"_8e41abc61ab38a0b__sidebar-backdrop\",\"sidebar\":\"_9c70c6016411e369__sidebar\",\"is-mobile\":\"b5ec24928c8da36b__is-mobile\",\"mobile-sidebar-drawer\":\"ed28d4367377467b__mobile-sidebar-drawer\",\"layout-single-page\":\"_452d7ff5ac74eb84__layout-single-page\",\"canvas\":\"e6b2ba021c702ffb__canvas\",\"has-mobile-drawer\":\"_7cfa87f7a2463610__has-mobile-drawer\",\"surfaces\":\"_0ec9efcb29281d50__surfaces\",\"stage\":\"a7bbf3aae333d0d8__stage\",\"inspector\":\"e674251381793b5f__inspector\",\"has-canvas\":\"_15176d330d368459__has-canvas\",\"zoomOut\":\"_5a1779b2f2c90caf__zoomOut\",\"zoomIn\":\"_4e45a7a3e5f56197__zoomIn\",\"slideFromRight\":\"_537b6d2e5041d8b9__slideFromRight\",\"slideToRight\":\"db499c91f24ad370__slideToRight\",\"slideHeaderFromTop\":\"_6b902826dce37697__slideHeaderFromTop\",\"slideHeaderToTop\":\"_8e9025331ac47b17__slideHeaderToTop\",\"slideSidebarFromRight\":\"_08fb3da5295b47f8__slideSidebarFromRight\",\"slideSidebarToRight\":\"a0bb8b58f3887328__slideSidebarToRight\"};\n","import type { ComponentType } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { Page } from '@wordpress/admin-ui';\nimport {\n\tprivateApis as routePrivateApis,\n\ttype AnyRoute,\n} from '@wordpress/route';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport Root from '../root';\nimport styles from '../root/style.module.scss';\nimport ErrorBoundary from '../error-boundary';\nimport type { Route, RouteConfig, RouteLoaderContext } from '../../store/types';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tRouterProvider,\n\tcreateBrowserHistory,\n\tparseHref,\n\tuseLoaderData,\n} = unlock( routePrivateApis );\n\n// Not found component\nfunction NotFoundComponent() {\n\treturn (\n\t\t<div className={ styles.stage }>\n\t\t\t<Page title={ __( 'Route not found' ) } hasPadding>\n\t\t\t\t{ __( \"The page you're looking for does not exist\" ) }\n\t\t\t</Page>\n\t\t</div>\n\t);\n}\n\n/**\n * Creates a TanStack route from a Route definition.\n *\n * @param route Route configuration\n * @param parentRoute Parent route.\n * @return Tanstack Route.\n */\nfunction createRouteFromDefinition( route: Route, parentRoute: AnyRoute ) {\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\tconst routeConfig = module.route || {};\n\n\t\t\t\tif ( routeConfig.beforeLoad ) {\n\t\t\t\t\treturn routeConfig.beforeLoad( {\n\t\t\t\t\t\tparams: opts.params || {},\n\t\t\t\t\t\tsearch: opts.search || {},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tloader: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tlet routeConfig: RouteConfig = {};\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\trouteConfig = module.route || {};\n\t\t\t}\n\n\t\t\tconst context: RouteLoaderContext = {\n\t\t\t\tparams: opts.params || {},\n\t\t\t\tsearch: opts.deps || {},\n\t\t\t};\n\n\t\t\tconst [ , loaderData, canvasData, titleData ] = await Promise.all( [\n\t\t\t\tresolveSelect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t),\n\t\t\t\trouteConfig.loader\n\t\t\t\t\t? routeConfig.loader( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.canvas\n\t\t\t\t\t? routeConfig.canvas( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.title\n\t\t\t\t\t? routeConfig.title( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t] );\n\n\t\t\tlet inspector = true;\n\t\t\tif ( routeConfig.inspector ) {\n\t\t\t\tinspector = await routeConfig.inspector( context );\n\t\t\t}\n\n\t\t\tlet stage = true;\n\t\t\tif ( routeConfig.stage ) {\n\t\t\t\tstage = await routeConfig.stage( context );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...( loaderData as any ),\n\t\t\t\tcanvas: canvasData,\n\t\t\t\tinspector,\n\t\t\t\tstage,\n\t\t\t\ttitle: titleData,\n\t\t\t\trouteContentModule: route.content_module,\n\t\t\t};\n\t\t},\n\t\tloaderDeps: ( opts: any ) => opts.search,\n\t} );\n\n\t// Chain .lazy() to preload content module on intent\n\ttanstackRoute = tanstackRoute.lazy( async () => {\n\t\tconst module = route.content_module\n\t\t\t? await import( route.content_module )\n\t\t\t: {};\n\n\t\tconst Stage = module.stage;\n\t\tconst Inspector = module.inspector;\n\n\t\treturn createLazyRoute( route.path )( {\n\t\t\tcomponent: function RouteComponent() {\n\t\t\t\tconst { inspector: showInspector, stage: showStage } =\n\t\t\t\t\tuseLoaderData( { from: route.path } ) ?? {};\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ Stage && showStage && (\n\t\t\t\t\t\t\t<div className={ styles.stage }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Stage />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Inspector && showInspector && (\n\t\t\t\t\t\t\t<div className={ styles.inspector }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Inspector />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\t} );\n\n\treturn tanstackRoute;\n}\n\n/**\n * Creates a route tree from route definitions.\n *\n * @param routes Routes definition.\n * @param rootComponent Root component to use for the router.\n * @return Router tree.\n */\nfunction createRouteTree(\n\troutes: Route[],\n\trootComponent: ComponentType = Root\n) {\n\tconst rootRoute = createRootRoute( {\n\t\tcomponent: rootComponent as any,\n\t\tcontext: () => ( {} ),\n\t} );\n\n\t// Create routes from definitions (now synchronous)\n\tconst dynamicRoutes = routes.map( ( route ) =>\n\t\tcreateRouteFromDefinition( route, rootRoute )\n\t);\n\n\treturn rootRoute.addChildren( dynamicRoutes );\n}\n\n// Create custom history that parses ?p= query parameter\nfunction createPathHistory() {\n\treturn createBrowserHistory( {\n\t\tparseLocation: () => {\n\t\t\tconst url = new URL( window.location.href );\n\t\t\tconst path = url.searchParams.get( 'p' ) || '/';\n\t\t\tconst pathHref = `${ path }${ url.hash }`;\n\t\t\treturn parseHref( pathHref, window.history.state );\n\t\t},\n\t\tcreateHref: ( href: string ) => {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tsearchParams.set( 'p', href );\n\t\t\treturn `${ window.location.pathname }?${ searchParams }`;\n\t\t},\n\t} );\n}\n\ninterface RouterProps {\n\troutes: Route[];\n\trootComponent?: ComponentType;\n}\n\nexport default function Router( {\n\troutes,\n\trootComponent = Root,\n}: RouterProps ) {\n\tconst router = useMemo( () => {\n\t\tconst history = createPathHistory();\n\t\tconst routeTree = createRouteTree( routes, rootComponent );\n\n\t\treturn createRouter( {\n\t\t\thistory,\n\t\t\trouteTree,\n\t\t\tdefaultPreload: 'intent',\n\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\tdefaultViewTransition: {\n\t\t\t\ttypes: ( {\n\t\t\t\t\tfromLocation,\n\t\t\t\t}: {\n\t\t\t\t\tfromLocation?: unknown;\n\t\t\t\t\ttoLocation: unknown;\n\t\t\t\t\tpathChanged: boolean;\n\t\t\t\t\threfChanged: boolean;\n\t\t\t\t\thashChanged: boolean;\n\t\t\t\t} ) => {\n\t\t\t\t\t// Disable view transition on initial navigation (no previous location)\n\t\t\t\t\tif ( ! fromLocation ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable with navigation type for subsequent navigations\n\t\t\t\t\treturn [ 'navigate' ];\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}, [ routes, rootComponent ] );\n\n\treturn <RouterProvider router={ router } />;\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,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAA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EAAyB,OAAU,CAAA;AAC3C"}
@@ -0,0 +1,162 @@
1
+ import { useEffect, useRef } from "@wordpress/element";
2
+ import { privateApis } from "@wordpress/route";
3
+ import { unlock } from "../../lock-unlock.mjs";
4
+ // packages/style-runtime/src/index.ts
5
+ const STYLE_HASH_ATTRIBUTE = "data-wp-hash";
6
+ /**
7
+ * Returns the shared style runtime registry.
8
+ *
9
+ * The registry is stored on `globalThis` so separately bundled copies of this
10
+ * package can coordinate through the same document and style maps.
11
+ *
12
+ * @return The shared runtime registry.
13
+ */
14
+ function getRuntime() {
15
+ const globalScope = globalThis;
16
+ if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
17
+ globalScope.__wpStyleRuntime = {
18
+ documents: /* @__PURE__ */ new Map(),
19
+ styles: /* @__PURE__ */ new Map(),
20
+ injectedStyles: /* @__PURE__ */ new WeakMap()
21
+ };
22
+ if (typeof document !== "undefined") registerDocument(document);
23
+ return globalScope.__wpStyleRuntime;
24
+ }
25
+ /**
26
+ * Checks whether a document already contains a style tag for a hash.
27
+ *
28
+ * @param targetDocument Document to inspect.
29
+ * @param hash Stable hash for the transformed CSS.
30
+ *
31
+ * @return Whether the style hash already exists in the document.
32
+ */
33
+ function documentContainsStyleHash(targetDocument, hash) {
34
+ if (!targetDocument.head) return false;
35
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) return true;
36
+ return false;
37
+ }
38
+ /**
39
+ * Injects a registered style into a document, unless that document already
40
+ * contains a style tag for the same hash.
41
+ *
42
+ * @param targetDocument Document to inject the style into.
43
+ * @param hash Stable hash for the transformed CSS.
44
+ * @param css CSS text to inject.
45
+ */
46
+ function injectStyle(targetDocument, hash, css) {
47
+ if (!targetDocument.head) return;
48
+ const runtime = getRuntime();
49
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
50
+ if (!injectedStyles) {
51
+ injectedStyles = /* @__PURE__ */ new Set();
52
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
53
+ }
54
+ if (injectedStyles.has(hash)) return;
55
+ if (documentContainsStyleHash(targetDocument, hash)) {
56
+ injectedStyles.add(hash);
57
+ return;
58
+ }
59
+ const style = targetDocument.createElement("style");
60
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
61
+ style.appendChild(targetDocument.createTextNode(css));
62
+ targetDocument.head.appendChild(style);
63
+ injectedStyles.add(hash);
64
+ }
65
+ /**
66
+ * Registers a document as a style injection target.
67
+ *
68
+ * Existing registered styles are replayed into the document immediately.
69
+ * Documents are reference-counted so multiple providers can safely register the
70
+ * same document without one cleanup removing it while another registration is
71
+ * still active.
72
+ *
73
+ * @param targetDocument Document to receive registered styles.
74
+ * @return Cleanup function that unregisters this document registration.
75
+ */
76
+ function registerDocument(targetDocument) {
77
+ const runtime = getRuntime();
78
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
79
+ for (const [hash, css] of runtime.styles) injectStyle(targetDocument, hash, css);
80
+ return () => {
81
+ const count = runtime.documents.get(targetDocument);
82
+ if (count === void 0) return;
83
+ if (count <= 1) {
84
+ runtime.documents.delete(targetDocument);
85
+ return;
86
+ }
87
+ runtime.documents.set(targetDocument, count - 1);
88
+ };
89
+ }
90
+ /**
91
+ * Registers a style and injects it into all registered documents.
92
+ *
93
+ * The hash is used as the deduplication key, so calling this repeatedly with
94
+ * the same hash will not add duplicate style tags to a document.
95
+ * Registered styles are retained for the lifetime of the page so they can be
96
+ * replayed into documents that are registered later.
97
+ *
98
+ * @param hash Stable hash for the transformed CSS.
99
+ * @param css CSS text to inject.
100
+ */
101
+ function registerStyle(hash, css) {
102
+ const runtime = getRuntime();
103
+ runtime.styles.set(hash, css);
104
+ for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
105
+ }
106
+ // packages/boot/src/components/root/style.module.scss
107
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("a1e6beedc4", ".ec570fbb2868f496__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){.ec570fbb2868f496__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.ec570fbb2868f496__layout{min-height:calc(100vh - 32px)}body:has(.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas) .ec570fbb2868f496__layout{min-height:100vh}}:where(.ec570fbb2868f496__layout) img{height:auto;max-width:100%}.ec570fbb2868f496__layout ._1c9a312567e28b20__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}.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .components-snackbar,.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .d4a42c38e09753ae__components-snackbar{margin-inline:auto}._8e41abc61ab38a0b__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}._9c70c6016411e369__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._9c70c6016411e369__sidebar.b5ec24928c8da36b__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}.ed28d4367377467b__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._452d7ff5ac74eb84__layout-single-page .ed28d4367377467b__mobile-sidebar-drawer{top:46px}.ed28d4367377467b__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}.e6b2ba021c702ffb__canvas._7cfa87f7a2463610__has-mobile-drawer{padding-top:65px;position:relative}._0ec9efcb29281d50__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._0ec9efcb29281d50__surfaces{margin:8px}._452d7ff5ac74eb84__layout-single-page ._0ec9efcb29281d50__surfaces{height:calc(100vh - 40px);margin-top:0;margin-inline-start:0;position:sticky;top:32px}}.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{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}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:auto}}.a7bbf3aae333d0d8__stage{z-index:2}@media (min-width:782px){.a7bbf3aae333d0d8__stage{z-index:auto}}.e674251381793b5f__inspector{z-index:3}@media (min-width:782px){.e674251381793b5f__inspector{z-index:auto}}.e6b2ba021c702ffb__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}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.e6b2ba021c702ffb__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:auto}.e674251381793b5f__inspector,.ec570fbb2868f496__layout._15176d330d368459__has-canvas .a7bbf3aae333d0d8__stage{max-width:400px}}.e6b2ba021c702ffb__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas ._0ec9efcb29281d50__surfaces{gap:0;margin:0}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .a7bbf3aae333d0d8__stage,.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e674251381793b5f__inspector{display:none}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__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)}._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:46px}@media (min-width:782px){._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:32px}}@media (max-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector,.e6b2ba021c702ffb__canvas:not(._7cfa87f7a2463610__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.ed28d4367377467b__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.e6b2ba021c702ffb__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.e6b2ba021c702ffb__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.a7bbf3aae333d0d8__stage{view-transition-name:boot--stage}.e674251381793b5f__inspector{view-transition-name:boot--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a7bbf3aae333d0d8__stage{view-transition-name:boot-safari--stage}.e674251381793b5f__inspector{view-transition-name:boot-safari--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.ec570fbb2868f496__layout) *{view-transition-name:none!important}}:root:has(.ec570fbb2868f496__layout)::view-transition-new(root),:root:has(.ec570fbb2868f496__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.ec570fbb2868f496__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-header),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector),:root:has(.ec570fbb2868f496__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(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_5a1779b2f2c90caf__zoomOut;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_4e45a7a3e5f56197__zoomIn;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_537b6d2e5041d8b9__slideFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:db499c91f24ad370__slideToRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_6b902826dce37697__slideHeaderFromTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8e9025331ac47b17__slideHeaderToTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_08fb3da5295b47f8__slideSidebarFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:a0bb8b58f3887328__slideSidebarToRight;will-change:transform}@keyframes _5a1779b2f2c90caf__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _4e45a7a3e5f56197__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _537b6d2e5041d8b9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes db499c91f24ad370__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _6b902826dce37697__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8e9025331ac47b17__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _08fb3da5295b47f8__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes a0bb8b58f3887328__slideSidebarToRight{to{transform:translateX(100%)}}");
108
+ var style_module_default = {
109
+ "layout": "ec570fbb2868f496__layout",
110
+ "has-full-canvas": "_412c860698817aa8__has-full-canvas",
111
+ "notices-snackbar": "_1c9a312567e28b20__notices-snackbar",
112
+ "components-snackbar": "d4a42c38e09753ae__components-snackbar",
113
+ "sidebar-backdrop": "_8e41abc61ab38a0b__sidebar-backdrop",
114
+ "sidebar": "_9c70c6016411e369__sidebar",
115
+ "is-mobile": "b5ec24928c8da36b__is-mobile",
116
+ "mobile-sidebar-drawer": "ed28d4367377467b__mobile-sidebar-drawer",
117
+ "layout-single-page": "_452d7ff5ac74eb84__layout-single-page",
118
+ "canvas": "e6b2ba021c702ffb__canvas",
119
+ "has-mobile-drawer": "_7cfa87f7a2463610__has-mobile-drawer",
120
+ "surfaces": "_0ec9efcb29281d50__surfaces",
121
+ "stage": "a7bbf3aae333d0d8__stage",
122
+ "inspector": "e674251381793b5f__inspector",
123
+ "has-canvas": "_15176d330d368459__has-canvas",
124
+ "zoomOut": "_5a1779b2f2c90caf__zoomOut",
125
+ "zoomIn": "_4e45a7a3e5f56197__zoomIn",
126
+ "slideFromRight": "_537b6d2e5041d8b9__slideFromRight",
127
+ "slideToRight": "db499c91f24ad370__slideToRight",
128
+ "slideHeaderFromTop": "_6b902826dce37697__slideHeaderFromTop",
129
+ "slideHeaderToTop": "_8e9025331ac47b17__slideHeaderToTop",
130
+ "slideSidebarFromRight": "_08fb3da5295b47f8__slideSidebarFromRight",
131
+ "slideSidebarToRight": "a0bb8b58f3887328__slideSidebarToRight"
132
+ };
133
+ // packages/boot/src/components/app/use-route-focus.ts
134
+ const { useRouterState } = unlock(privateApis);
135
+ /**
136
+ * Hook that moves focus to the new page when a navigation removes the focused
137
+ * element, such as a breadcrumb link that becomes the new page's heading.
138
+ * Otherwise focus falls back to the document body, and keyboard and screen
139
+ * reader users lose their place.
140
+ *
141
+ * It runs in an effect after the route resolves. Effects of the page content
142
+ * run before it, so the page can move focus itself first.
143
+ *
144
+ * @param layoutRef Ref to the layout element that contains the stage.
145
+ */
146
+ function useRouteFocus(layoutRef) {
147
+ const href = useRouterState({ select: (state) => state.resolvedLocation?.href });
148
+ const previousHrefRef = useRef(href);
149
+ useEffect(() => {
150
+ const previousHref = previousHrefRef.current;
151
+ previousHrefRef.current = href;
152
+ if (!previousHref || href === previousHref) return;
153
+ const layout = layoutRef.current;
154
+ if (!layout) return;
155
+ const { activeElement, body } = layout.ownerDocument;
156
+ if (activeElement && activeElement !== body) return;
157
+ layout.querySelector(`.${style_module_default.stage} [role="region"]`)?.focus();
158
+ }, [href, layoutRef]);
159
+ }
160
+ export { useRouteFocus as default };
161
+
162
+ //# sourceMappingURL=use-route-focus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-route-focus.mjs","names":["routePrivateApis","styles"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/app/use-route-focus.ts"],"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(\"a1e6beedc4\", \".ec570fbb2868f496__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){.ec570fbb2868f496__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.ec570fbb2868f496__layout{min-height:calc(100vh - 32px)}body:has(.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas) .ec570fbb2868f496__layout{min-height:100vh}}:where(.ec570fbb2868f496__layout) img{height:auto;max-width:100%}.ec570fbb2868f496__layout ._1c9a312567e28b20__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}.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .components-snackbar,.ec570fbb2868f496__layout ._1c9a312567e28b20__notices-snackbar .d4a42c38e09753ae__components-snackbar{margin-inline:auto}._8e41abc61ab38a0b__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}._9c70c6016411e369__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._9c70c6016411e369__sidebar.b5ec24928c8da36b__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}.ed28d4367377467b__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._452d7ff5ac74eb84__layout-single-page .ed28d4367377467b__mobile-sidebar-drawer{top:46px}.ed28d4367377467b__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}.e6b2ba021c702ffb__canvas._7cfa87f7a2463610__has-mobile-drawer{padding-top:65px;position:relative}._0ec9efcb29281d50__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._0ec9efcb29281d50__surfaces{margin:8px}._452d7ff5ac74eb84__layout-single-page ._0ec9efcb29281d50__surfaces{height:calc(100vh - 40px);margin-top:0;margin-inline-start:0;position:sticky;top:32px}}.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{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}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._452d7ff5ac74eb84__layout-single-page .a7bbf3aae333d0d8__stage,._452d7ff5ac74eb84__layout-single-page .e674251381793b5f__inspector{height:auto}}.a7bbf3aae333d0d8__stage{z-index:2}@media (min-width:782px){.a7bbf3aae333d0d8__stage{z-index:auto}}.e674251381793b5f__inspector{z-index:3}@media (min-width:782px){.e674251381793b5f__inspector{z-index:auto}}.e6b2ba021c702ffb__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}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.e6b2ba021c702ffb__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._452d7ff5ac74eb84__layout-single-page .e6b2ba021c702ffb__canvas{height:auto}.e674251381793b5f__inspector,.ec570fbb2868f496__layout._15176d330d368459__has-canvas .a7bbf3aae333d0d8__stage{max-width:400px}}.e6b2ba021c702ffb__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas ._0ec9efcb29281d50__surfaces{gap:0;margin:0}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .a7bbf3aae333d0d8__stage,.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e674251381793b5f__inspector{display:none}.ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__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)}._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:46px}@media (min-width:782px){._452d7ff5ac74eb84__layout-single-page .ec570fbb2868f496__layout._412c860698817aa8__has-full-canvas .e6b2ba021c702ffb__canvas{top:32px}}@media (max-width:782px){.a7bbf3aae333d0d8__stage,.e674251381793b5f__inspector,.e6b2ba021c702ffb__canvas:not(._7cfa87f7a2463610__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.ed28d4367377467b__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.e6b2ba021c702ffb__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.e6b2ba021c702ffb__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.a7bbf3aae333d0d8__stage{view-transition-name:boot--stage}.e674251381793b5f__inspector{view-transition-name:boot--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a7bbf3aae333d0d8__stage{view-transition-name:boot-safari--stage}.e674251381793b5f__inspector{view-transition-name:boot-safari--inspector}.e6b2ba021c702ffb__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.ec570fbb2868f496__layout) *{view-transition-name:none!important}}:root:has(.ec570fbb2868f496__layout)::view-transition-new(root),:root:has(.ec570fbb2868f496__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.ec570fbb2868f496__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-header),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.ec570fbb2868f496__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector),:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector),:root:has(.ec570fbb2868f496__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(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas),:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_5a1779b2f2c90caf__zoomOut;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--stage):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_4e45a7a3e5f56197__zoomIn;will-change:transform,opacity}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_537b6d2e5041d8b9__slideFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas):only-child,:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:db499c91f24ad370__slideToRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_6b902826dce37697__slideHeaderFromTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8e9025331ac47b17__slideHeaderToTop;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_08fb3da5295b47f8__slideSidebarFromRight;will-change:transform}:root:has(.ec570fbb2868f496__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:a0bb8b58f3887328__slideSidebarToRight;will-change:transform}@keyframes _5a1779b2f2c90caf__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _4e45a7a3e5f56197__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _537b6d2e5041d8b9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes db499c91f24ad370__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _6b902826dce37697__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8e9025331ac47b17__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _08fb3da5295b47f8__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes a0bb8b58f3887328__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"ec570fbb2868f496__layout\",\"has-full-canvas\":\"_412c860698817aa8__has-full-canvas\",\"notices-snackbar\":\"_1c9a312567e28b20__notices-snackbar\",\"components-snackbar\":\"d4a42c38e09753ae__components-snackbar\",\"sidebar-backdrop\":\"_8e41abc61ab38a0b__sidebar-backdrop\",\"sidebar\":\"_9c70c6016411e369__sidebar\",\"is-mobile\":\"b5ec24928c8da36b__is-mobile\",\"mobile-sidebar-drawer\":\"ed28d4367377467b__mobile-sidebar-drawer\",\"layout-single-page\":\"_452d7ff5ac74eb84__layout-single-page\",\"canvas\":\"e6b2ba021c702ffb__canvas\",\"has-mobile-drawer\":\"_7cfa87f7a2463610__has-mobile-drawer\",\"surfaces\":\"_0ec9efcb29281d50__surfaces\",\"stage\":\"a7bbf3aae333d0d8__stage\",\"inspector\":\"e674251381793b5f__inspector\",\"has-canvas\":\"_15176d330d368459__has-canvas\",\"zoomOut\":\"_5a1779b2f2c90caf__zoomOut\",\"zoomIn\":\"_4e45a7a3e5f56197__zoomIn\",\"slideFromRight\":\"_537b6d2e5041d8b9__slideFromRight\",\"slideToRight\":\"db499c91f24ad370__slideToRight\",\"slideHeaderFromTop\":\"_6b902826dce37697__slideHeaderFromTop\",\"slideHeaderToTop\":\"_8e9025331ac47b17__slideHeaderToTop\",\"slideSidebarFromRight\":\"_08fb3da5295b47f8__slideSidebarFromRight\",\"slideSidebarToRight\":\"a0bb8b58f3887328__slideSidebarToRight\"};\n","import { useEffect, useRef, type RefObject } from '@wordpress/element';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { unlock } from '../../lock-unlock';\nimport styles from '../root/style.module.scss';\n\nconst { useRouterState } = unlock( routePrivateApis );\n\n/**\n * Hook that moves focus to the new page when a navigation removes the focused\n * element, such as a breadcrumb link that becomes the new page's heading.\n * Otherwise focus falls back to the document body, and keyboard and screen\n * reader users lose their place.\n *\n * It runs in an effect after the route resolves. Effects of the page content\n * run before it, so the page can move focus itself first.\n *\n * @param layoutRef Ref to the layout element that contains the stage.\n */\nexport default function useRouteFocus(\n\tlayoutRef: RefObject< HTMLElement | null >\n) {\n\tconst href: string | undefined = useRouterState( {\n\t\tselect: ( state: { resolvedLocation?: { href: string } } ) =>\n\t\t\tstate.resolvedLocation?.href,\n\t} );\n\tconst previousHrefRef = useRef( href );\n\n\tuseEffect( () => {\n\t\tconst previousHref = previousHrefRef.current;\n\t\tpreviousHrefRef.current = href;\n\n\t\t// The initial page load has no previous location.\n\t\tif ( ! previousHref || href === previousHref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layout = layoutRef.current;\n\t\tif ( ! layout ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { activeElement, body } = layout.ownerDocument;\n\t\tif ( activeElement && activeElement !== body ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlayout\n\t\t\t.querySelector< HTMLElement >(\n\t\t\t\t`.${ styles.stage } [role=\"region\"]`\n\t\t\t)\n\t\t\t?.focus();\n\t}, [ href, layoutRef ] );\n}\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AAE,eAAe,SAAS,OAAO;EACvC,IAAK,iBAAiB,kBAAkB,MACvC;EAGD,OACE,cACA,IAAKC,qBAAO,MAAO,iBACpB,CAAC,EACC,MAAM;CACV,GAAG,CAAE,MAAM,SAAU,CAAE;AACxB"}
@@ -28,7 +28,12 @@ function useRouteTitle() {
28
28
  if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") {
29
29
  const decodedRouteTitle = decodeEntities(routeTitle);
30
30
  const decodedSiteTitle = decodeEntities(siteTitle);
31
- const formattedTitle = sprintf(__("%1$s ‹ %2$s — WordPress"), decodedRouteTitle, decodedSiteTitle);
31
+ const formattedTitle = sprintf(
32
+ /** translators: Admin document title. 1: Admin screen name, 2: Site name. */
33
+ __("%1$s ‹ %2$s — WordPress"),
34
+ decodedRouteTitle,
35
+ decodedSiteTitle
36
+ );
32
37
  document.title = formattedTitle;
33
38
  if (decodedRouteTitle) speak(decodedRouteTitle, "assertive");
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-route-title.mjs","names":["routePrivateApis","coreStore"],"sources":["../../../src/components/app/use-route-title.ts"],"sourcesContent":["import { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore, type UnstableBase } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useMatches } = unlock( routePrivateApis );\n\n/**\n * Hook that manages document title updates based on route changes.\n * Formats titles with WordPress conventions and announces them to screen readers.\n *\n * This hook should be called from the Root component to ensure it runs on every route.\n */\nexport default function useRouteTitle() {\n\tconst location = useLocation();\n\tconst matches = useMatches();\n\tconst currentMatch = matches[ matches.length - 1 ];\n\tconst routeTitle = ( currentMatch?.loaderData as any )?.title as\n\t\tstring | undefined;\n\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord< UnstableBase >(\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase'\n\t\t\t)?.name,\n\t\t[]\n\t);\n\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\trouteTitle &&\n\t\t\ttypeof routeTitle === 'string' &&\n\t\t\tsiteTitle &&\n\t\t\ttypeof siteTitle === 'string'\n\t\t) {\n\t\t\t// Decode entities for display\n\t\t\tconst decodedRouteTitle = decodeEntities( routeTitle );\n\t\t\tconst decodedSiteTitle = decodeEntities( siteTitle );\n\n\t\t\t// Format title following WordPress admin conventions\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\tdecodedRouteTitle,\n\t\t\t\tdecodedSiteTitle\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tif ( decodedRouteTitle ) {\n\t\t\t\tspeak( decodedRouteTitle, 'assertive' );\n\t\t\t}\n\t\t}\n\t}, [ routeTitle, siteTitle, location ] );\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,EAAE,aAAa,eAAe,OAAQA,WAAiB;;;;;;;AAQ7D,SAAwB,gBAAgB;CACvC,MAAM,WAAW,YAAY;CAC7B,MAAM,UAAU,WAAW;CAE3B,MAAM,cADe,QAAS,QAAQ,SAAS,EACd,EAAE,WAAA,EAAqB;CAGxD,MAAM,YAAY,WACf,WACD,OAAQC,KAAU,CAAC,CAAC,gBACnB,QACA,gBACD,CAAC,EAAE,MACJ,CAAC,CACF;CAEA,MAAM,uBAAuB,OAAQ,IAAK;CAE1C,gBAAiB;EAChB,qBAAqB,UAAU;CAChC,GAAG,CAAE,QAAS,CAAE;CAEhB,gBAAiB;EAEhB,IAAK,qBAAqB,SACzB;EAGD,IACC,cACA,OAAO,eAAe,YACtB,aACA,OAAO,cAAc,UACpB;GAED,MAAM,oBAAoB,eAAgB,UAAW;GACrD,MAAM,mBAAmB,eAAgB,SAAU;GAGnD,MAAM,iBAAiB,QAEtB,GAAI,yBAA0B,GAC9B,mBACA,gBACD;GAEA,SAAS,QAAQ;GAGjB,IAAK,mBACJ,MAAO,mBAAmB,WAAY;EAExC;CACD,GAAG;EAAE;EAAY;EAAW;CAAS,CAAE;AACxC"}
1
+ {"version":3,"file":"use-route-title.mjs","names":["routePrivateApis","coreStore"],"sources":["../../../src/components/app/use-route-title.ts"],"sourcesContent":["import { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore, type UnstableBase } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useMatches } = unlock( routePrivateApis );\n\n/**\n * Hook that manages document title updates based on route changes.\n * Formats titles with WordPress conventions and announces them to screen readers.\n *\n * This hook should be called from the Root component to ensure it runs on every route.\n */\nexport default function useRouteTitle() {\n\tconst location = useLocation();\n\tconst matches = useMatches();\n\tconst currentMatch = matches[ matches.length - 1 ];\n\tconst routeTitle = ( currentMatch?.loaderData as any )?.title as\n\t\tstring | undefined;\n\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord< UnstableBase >(\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase'\n\t\t\t)?.name,\n\t\t[]\n\t);\n\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\trouteTitle &&\n\t\t\ttypeof routeTitle === 'string' &&\n\t\t\tsiteTitle &&\n\t\t\ttypeof siteTitle === 'string'\n\t\t) {\n\t\t\t// Decode entities for display\n\t\t\tconst decodedRouteTitle = decodeEntities( routeTitle );\n\t\t\tconst decodedSiteTitle = decodeEntities( siteTitle );\n\n\t\t\t// Format title following WordPress admin conventions\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Site name. */\n\t\t\t\t__( '%1$s ‹ %2$s — WordPress' ),\n\t\t\t\tdecodedRouteTitle,\n\t\t\t\tdecodedSiteTitle\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tif ( decodedRouteTitle ) {\n\t\t\t\tspeak( decodedRouteTitle, 'assertive' );\n\t\t\t}\n\t\t}\n\t}, [ routeTitle, siteTitle, location ] );\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,EAAE,aAAa,eAAe,OAAQA,WAAiB;;;;;;;AAQ7D,SAAwB,gBAAgB;CACvC,MAAM,WAAW,YAAY;CAC7B,MAAM,UAAU,WAAW;CAE3B,MAAM,cADe,QAAS,QAAQ,SAAS,EACd,EAAE,WAAA,EAAqB;CAGxD,MAAM,YAAY,WACf,WACD,OAAQC,KAAU,CAAC,CAAC,gBACnB,QACA,gBACD,CAAC,EAAE,MACJ,CAAC,CACF;CAEA,MAAM,uBAAuB,OAAQ,IAAK;CAE1C,gBAAiB;EAChB,qBAAqB,UAAU;CAChC,GAAG,CAAE,QAAS,CAAE;CAEhB,gBAAiB;EAEhB,IAAK,qBAAqB,SACzB;EAGD,IACC,cACA,OAAO,eAAe,YACtB,aACA,OAAO,cAAc,UACpB;GAED,MAAM,oBAAoB,eAAgB,UAAW;GACrD,MAAM,mBAAmB,eAAgB,SAAU;GAGnD,MAAM,iBAAiB;;IAEtB,GAAI,yBAA0B;IAC9B;IACA;GACD;GAEA,SAAS,QAAQ;GAGjB,IAAK,mBACJ,MAAO,mBAAmB,WAAY;EAExC;CACD,GAAG;EAAE;EAAY;EAAW;CAAS,CAAE;AACxC"}
@@ -22,7 +22,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
22
22
  function Canvas({ canvas }) {
23
23
  const [Editor, setEditor] = useState(null);
24
24
  const navigate = useNavigate();
25
- const { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord();
25
+ const { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord(canvas.postType, canvas.postId);
26
26
  const onActionPerformed = useActionPerformed(canvas.postType);
27
27
  const viewport = useSearch({
28
28
  strict: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["coreStore","bootStore","WCSpinner"],"sources":["../../../src/components/canvas/index.tsx"],"sourcesContent":["import { useState, useEffect, useMemo } from '@wordpress/element';\nimport { Spinner as WCSpinner } from '@wordpress/components';\nimport { useNavigate, useSearch } from '@wordpress/route';\nimport { __ } from '@wordpress/i18n';\nimport { inertValue } from '@wordpress/react-inert-value';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as bootStore } from '../../store';\nimport type { CanvasData } from '../../store/types';\nimport BootBackButton from './back-button';\nimport SitePreview from './site-preview';\nimport useNavigateToEntityRecord, {\n\tuseActionPerformed,\n} from './use-navigate-to-entity-record';\nimport { getDeviceType } from './viewport';\n\ninterface CanvasProps {\n\tcanvas: CanvasData;\n}\n\n/**\n * Canvas component that dynamically loads and renders the lazy editor.\n *\n * @param {Object} props - Component props\n * @param {Object} props.canvas - Canvas data containing postType and postId\n * @return Canvas surface with editor\n */\nexport default function Canvas( { canvas }: CanvasProps ) {\n\tconst [ Editor, setEditor ] = useState< any >( null );\n\tconst navigate = useNavigate();\n\tconst { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } =\n\t\tuseNavigateToEntityRecord();\n\tconst onActionPerformed = useActionPerformed( canvas.postType );\n\n\t/*\n\t * An entity can be asked to be edited at a particular width — a navigation\n\t * overlay meant for mobile — and carries the width it was left at when\n\t * returned to. Anything else opens at the default.\n\t */\n\tconst viewport = useSearch( {\n\t\tstrict: false,\n\t\tselect: ( search ) => ( search as { viewport?: string } ).viewport,\n\t} ) as string | undefined;\n\n\t/*\n\t * Where clicking a previewed canvas goes, resolved the same way the editor\n\t * resolves anywhere else it sends you to edit an entity, and whether it\n\t * should go anywhere at all: a trashed entity has to be restored before it\n\t * can be edited.\n\t *\n\t * The record is the one the editor loads for this canvas, so reading it\n\t * here costs no request of its own.\n\t */\n\t/*\n\t * A route that names no entity leaves the editor to resolve one, which it\n\t * does from the block templates only a block theme has. `undefined` while\n\t * the theme is still being read.\n\t */\n\tconst hasEntity = !! ( canvas.postType && canvas.postId );\n\tconst isBlockTheme = useSelect(\n\t\t( select ) =>\n\t\t\t(\n\t\t\t\tselect( coreStore ).getCurrentTheme() as\n\t\t\t\t\t{ is_block_theme?: boolean } | undefined\n\t\t\t )?.is_block_theme,\n\t\t[]\n\t);\n\n\tconst { editLink, isTrashed } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! canvas.postType || ! canvas.postId ) {\n\t\t\t\treturn { editLink: undefined, isTrashed: false };\n\t\t\t}\n\n\t\t\tconst record = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcanvas.postType,\n\t\t\t\tcanvas.postId\n\t\t\t) as { status?: string } | undefined;\n\n\t\t\treturn {\n\t\t\t\teditLink: select( bootStore ).getEntityLink(\n\t\t\t\t\tcanvas.postType,\n\t\t\t\t\tcanvas.postId\n\t\t\t\t),\n\t\t\t\tisTrashed: record?.status === 'trash',\n\t\t\t};\n\t\t},\n\t\t[ canvas.postType, canvas.postId ]\n\t);\n\n\t/*\n\t * Memoized because the editor provider pushes these settings into the store\n\t * whenever their identity changes, and the callbacks have to stay stable for\n\t * the block inspector to keep offering the same affordance.\n\t */\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\tisPreviewMode: canvas.isPreview,\n\t\t\tstyles: canvas.isPreview\n\t\t\t\t? [ { css: 'body{min-height:100vh;}' } ]\n\t\t\t\t: [],\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tcanvas.isPreview,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseEffect( () => {\n\t\t// Dynamically import the lazy-editor module\n\t\timport( '@wordpress/lazy-editor' )\n\t\t\t.then( ( module ) => {\n\t\t\t\tsetEditor( () => module.Editor );\n\t\t\t} )\n\t\t\t.catch( ( error ) => {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error( 'Failed to load lazy editor:', error );\n\t\t\t} );\n\t}, [] );\n\n\t// Nothing for the editor to open, so show the site the route configures.\n\tif ( ! hasEntity && isBlockTheme === false ) {\n\t\treturn <SitePreview />;\n\t}\n\n\t// Show spinner while loading the editor module, and until it is known which\n\t// of the two this canvas is, so the wrong one is never shown first.\n\tif ( ! Editor || ( ! hasEntity && isBlockTheme === undefined ) ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tpadding: '2rem',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<WCSpinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Render back button in full-screen mode (when not preview)\n\t// Uses render prop pattern to receive fillProps from Slot\n\tconst backButton = ! canvas.isPreview\n\t\t? ( { length }: { length: number } ) => (\n\t\t\t\t<BootBackButton length={ length } />\n\t\t\t)\n\t\t: undefined;\n\n\t// Render the editor with canvas data\n\treturn (\n\t\t<div style={ { height: '100%', position: 'relative' } }>\n\t\t\t<div\n\t\t\t\tstyle={ { height: '100%' } }\n\t\t\t\tinert={ inertValue( canvas.isPreview ) }\n\t\t\t>\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={ canvas.postType }\n\t\t\t\t\tpostId={ canvas.postId }\n\t\t\t\t\trenderingMode={ canvas.renderingMode }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tbackButton={ backButton }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\tinitialViewport={ getDeviceType( viewport ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ canvas.isPreview && editLink && (\n\t\t\t\t<div\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tisTrashed\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: () => navigate( { to: editLink } )\n\t\t\t\t\t}\n\t\t\t\t\tonKeyDown={ ( e ) => {\n\t\t\t\t\t\tif ( isTrashed ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( e.key === 'Enter' || e.key === ' ' ) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tnavigate( { to: editLink } );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tinset: 0,\n\t\t\t\t\t\tcursor: isTrashed ? 'default' : 'pointer',\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t} }\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\taria-disabled={ isTrashed }\n\t\t\t\t\taria-label={ __( 'Edit' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,SAAwB,OAAQ,EAAE,UAAwB;CACzD,MAAM,CAAE,QAAQ,aAAc,SAAiB,I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B,YAAY;GACZ,QAAQ;GACR,SAAS;EACV;EAEA,UAAA,oBAACC,SAAD,CAAY,CAAA;CACR,CAAA;CAMP,MAAM,aAAa,CAAE,OAAO,aACvB,EAAE,aACJ,oBAAC,gBAAD,EAAyB,OAAU,CAAA,IAEnC,KAAA;CAGH,OACC,qBAAC,OAAD;EAAK,OAAQ;GAAE,QAAQ;GAAQ,UAAU;EAAW;EAApD,UAAA,CACC,oBAAC,OAAD;GACC,OAAQ,EAAE,QAAQ,OAAO;GACzB,OAAQ,WAAY,OAAO,SAAU;GAErC,UAAA,oBAAC,QAAD;IACC,UAAW,OAAO;IAClB,QAAS,OAAO;IAChB,eAAgB,OAAO;IACZ;IACE;IACO;IACpB,iBAAkB,cAAe,QAAS;GAC1C,CAAA;EACG,CAAA,GACH,OAAO,aAAa,YACrB,oBAAC,OAAD;GACC,SACC,YACG,KAAA,UACM,SAAU,EAAE,IAAI,SAAS,CAAE;GAErC,YAAc,MAAO;IACpB,IAAK,WACJ;IAED,IAAK,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAM;KACzC,EAAE,eAAe;KACjB,SAAU,EAAE,IAAI,SAAS,CAAE;IAC5B;GACD;GACA,OAAQ;IACP,UAAU;IACV,OAAO;IACP,QAAQ,YAAY,YAAY;IAChC,QAAQ;GACT;GACA,MAAK;GACL,UAAW;GACX,iBAAgB;GAChB,cAAa,GAAI,MAAO;EACxB,CAAA,CAEE;;AAEP"}
1
+ {"version":3,"file":"index.mjs","names":["coreStore","bootStore","WCSpinner"],"sources":["../../../src/components/canvas/index.tsx"],"sourcesContent":["import { useState, useEffect, useMemo } from '@wordpress/element';\nimport { Spinner as WCSpinner } from '@wordpress/components';\nimport { useNavigate, useSearch } from '@wordpress/route';\nimport { __ } from '@wordpress/i18n';\nimport { inertValue } from '@wordpress/react-inert-value';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as bootStore } from '../../store';\nimport type { CanvasData } from '../../store/types';\nimport BootBackButton from './back-button';\nimport SitePreview from './site-preview';\nimport useNavigateToEntityRecord, {\n\tuseActionPerformed,\n} from './use-navigate-to-entity-record';\nimport { getDeviceType } from './viewport';\n\ninterface CanvasProps {\n\tcanvas: CanvasData;\n}\n\n/**\n * Canvas component that dynamically loads and renders the lazy editor.\n *\n * @param {Object} props - Component props\n * @param {Object} props.canvas - Canvas data containing postType and postId\n * @return Canvas surface with editor\n */\nexport default function Canvas( { canvas }: CanvasProps ) {\n\tconst [ Editor, setEditor ] = useState< any >( null );\n\tconst navigate = useNavigate();\n\tconst { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } =\n\t\tuseNavigateToEntityRecord( canvas.postType, canvas.postId );\n\tconst onActionPerformed = useActionPerformed( canvas.postType );\n\n\t/*\n\t * An entity can be asked to be edited at a particular width — a navigation\n\t * overlay meant for mobile — and carries the width it was left at when\n\t * returned to. Anything else opens at the default.\n\t */\n\tconst viewport = useSearch( {\n\t\tstrict: false,\n\t\tselect: ( search ) => ( search as { viewport?: string } ).viewport,\n\t} ) as string | undefined;\n\n\t/*\n\t * Where clicking a previewed canvas goes, resolved the same way the editor\n\t * resolves anywhere else it sends you to edit an entity, and whether it\n\t * should go anywhere at all: a trashed entity has to be restored before it\n\t * can be edited.\n\t *\n\t * The record is the one the editor loads for this canvas, so reading it\n\t * here costs no request of its own.\n\t */\n\t/*\n\t * A route that names no entity leaves the editor to resolve one, which it\n\t * does from the block templates only a block theme has. `undefined` while\n\t * the theme is still being read.\n\t */\n\tconst hasEntity = !! ( canvas.postType && canvas.postId );\n\tconst isBlockTheme = useSelect(\n\t\t( select ) =>\n\t\t\t(\n\t\t\t\tselect( coreStore ).getCurrentTheme() as\n\t\t\t\t\t{ is_block_theme?: boolean } | undefined\n\t\t\t )?.is_block_theme,\n\t\t[]\n\t);\n\n\tconst { editLink, isTrashed } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! canvas.postType || ! canvas.postId ) {\n\t\t\t\treturn { editLink: undefined, isTrashed: false };\n\t\t\t}\n\n\t\t\tconst record = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcanvas.postType,\n\t\t\t\tcanvas.postId\n\t\t\t) as { status?: string } | undefined;\n\n\t\t\treturn {\n\t\t\t\teditLink: select( bootStore ).getEntityLink(\n\t\t\t\t\tcanvas.postType,\n\t\t\t\t\tcanvas.postId\n\t\t\t\t),\n\t\t\t\tisTrashed: record?.status === 'trash',\n\t\t\t};\n\t\t},\n\t\t[ canvas.postType, canvas.postId ]\n\t);\n\n\t/*\n\t * Memoized because the editor provider pushes these settings into the store\n\t * whenever their identity changes, and the callbacks have to stay stable for\n\t * the block inspector to keep offering the same affordance.\n\t */\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\tisPreviewMode: canvas.isPreview,\n\t\t\tstyles: canvas.isPreview\n\t\t\t\t? [ { css: 'body{min-height:100vh;}' } ]\n\t\t\t\t: [],\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tcanvas.isPreview,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseEffect( () => {\n\t\t// Dynamically import the lazy-editor module\n\t\timport( '@wordpress/lazy-editor' )\n\t\t\t.then( ( module ) => {\n\t\t\t\tsetEditor( () => module.Editor );\n\t\t\t} )\n\t\t\t.catch( ( error ) => {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error( 'Failed to load lazy editor:', error );\n\t\t\t} );\n\t}, [] );\n\n\t// Nothing for the editor to open, so show the site the route configures.\n\tif ( ! hasEntity && isBlockTheme === false ) {\n\t\treturn <SitePreview />;\n\t}\n\n\t// Show spinner while loading the editor module, and until it is known which\n\t// of the two this canvas is, so the wrong one is never shown first.\n\tif ( ! Editor || ( ! hasEntity && isBlockTheme === undefined ) ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tpadding: '2rem',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<WCSpinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Render back button in full-screen mode (when not preview)\n\t// Uses render prop pattern to receive fillProps from Slot\n\tconst backButton = ! canvas.isPreview\n\t\t? ( { length }: { length: number } ) => (\n\t\t\t\t<BootBackButton length={ length } />\n\t\t\t)\n\t\t: undefined;\n\n\t// Render the editor with canvas data\n\treturn (\n\t\t<div style={ { height: '100%', position: 'relative' } }>\n\t\t\t<div\n\t\t\t\tstyle={ { height: '100%' } }\n\t\t\t\tinert={ inertValue( canvas.isPreview ) }\n\t\t\t>\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={ canvas.postType }\n\t\t\t\t\tpostId={ canvas.postId }\n\t\t\t\t\trenderingMode={ canvas.renderingMode }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tbackButton={ backButton }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\tinitialViewport={ getDeviceType( viewport ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ canvas.isPreview && editLink && (\n\t\t\t\t<div\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tisTrashed\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: () => navigate( { to: editLink } )\n\t\t\t\t\t}\n\t\t\t\t\tonKeyDown={ ( e ) => {\n\t\t\t\t\t\tif ( isTrashed ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( e.key === 'Enter' || e.key === ' ' ) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tnavigate( { to: editLink } );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\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