@wordpress/boot 0.20.0 → 0.21.2-next.v.202608281122.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 (126) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +4 -0
  3. package/build-module/components/app/router.mjs +100 -4
  4. package/build-module/components/app/router.mjs.map +3 -3
  5. package/build-module/components/canvas/index.mjs +72 -13
  6. package/build-module/components/canvas/index.mjs.map +2 -2
  7. package/build-module/components/canvas/site-preview.mjs +50 -0
  8. package/build-module/components/canvas/site-preview.mjs.map +7 -0
  9. package/build-module/components/canvas/use-navigate-to-entity-record.mjs +122 -0
  10. package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +7 -0
  11. package/build-module/components/canvas/viewport.mjs +18 -0
  12. package/build-module/components/canvas/viewport.mjs.map +7 -0
  13. package/build-module/components/error-boundary/index.mjs +129 -0
  14. package/build-module/components/error-boundary/index.mjs.map +7 -0
  15. package/build-module/components/navigation/drilldown-item/index.mjs +91 -1
  16. package/build-module/components/navigation/drilldown-item/index.mjs.map +3 -3
  17. package/build-module/components/navigation/dropdown-item/index.mjs +98 -11
  18. package/build-module/components/navigation/dropdown-item/index.mjs.map +4 -4
  19. package/build-module/components/navigation/index.mjs +0 -1
  20. package/build-module/components/navigation/index.mjs.map +2 -2
  21. package/build-module/components/navigation/navigation-item/index.mjs +88 -15
  22. package/build-module/components/navigation/navigation-item/index.mjs.map +3 -3
  23. package/build-module/components/navigation/navigation-screen/index.mjs +111 -38
  24. package/build-module/components/navigation/navigation-screen/index.mjs.map +3 -3
  25. package/build-module/components/plugin-area/index.mjs +29 -0
  26. package/build-module/components/plugin-area/index.mjs.map +7 -0
  27. package/build-module/components/root/index.mjs +220 -122
  28. package/build-module/components/root/index.mjs.map +3 -3
  29. package/build-module/components/root/single-page.mjs +139 -47
  30. package/build-module/components/root/single-page.mjs.map +3 -3
  31. package/build-module/components/root/use-sync-body-background.mjs.map +1 -1
  32. package/build-module/components/save-button/index.mjs +127 -16
  33. package/build-module/components/save-button/index.mjs.map +3 -3
  34. package/build-module/components/save-panel/index.mjs +91 -1
  35. package/build-module/components/save-panel/index.mjs.map +3 -3
  36. package/build-module/components/sidebar/index.mjs +90 -10
  37. package/build-module/components/sidebar/index.mjs.map +3 -3
  38. package/build-module/index.mjs +0 -16
  39. package/build-module/index.mjs.map +3 -3
  40. package/build-module/store/actions.mjs +8 -0
  41. package/build-module/store/actions.mjs.map +2 -2
  42. package/build-module/store/reducer.mjs +16 -1
  43. package/build-module/store/reducer.mjs.map +2 -2
  44. package/build-module/store/selectors.mjs +9 -0
  45. package/build-module/store/selectors.mjs.map +2 -2
  46. package/build-types/components/app/router.d.ts.map +1 -1
  47. package/build-types/components/canvas/index.d.ts.map +1 -1
  48. package/build-types/components/canvas/site-preview.d.ts +10 -0
  49. package/build-types/components/canvas/site-preview.d.ts.map +1 -0
  50. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +40 -0
  51. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -0
  52. package/build-types/components/canvas/viewport.d.ts +15 -0
  53. package/build-types/components/canvas/viewport.d.ts.map +1 -0
  54. package/build-types/components/error-boundary/index.d.ts +22 -0
  55. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  56. package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
  57. package/build-types/components/navigation/dropdown-item/index.d.ts +0 -1
  58. package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
  59. package/build-types/components/navigation/index.d.ts.map +1 -1
  60. package/build-types/components/navigation/navigation-item/index.d.ts +0 -1
  61. package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
  62. package/build-types/components/navigation/navigation-screen/index.d.ts +0 -1
  63. package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
  64. package/build-types/components/plugin-area/index.d.ts +12 -0
  65. package/build-types/components/plugin-area/index.d.ts.map +1 -0
  66. package/build-types/components/root/index.d.ts +0 -1
  67. package/build-types/components/root/index.d.ts.map +1 -1
  68. package/build-types/components/root/single-page.d.ts +0 -1
  69. package/build-types/components/root/single-page.d.ts.map +1 -1
  70. package/build-types/components/root/use-sync-body-background.d.ts +1 -1
  71. package/build-types/components/save-button/index.d.ts +0 -1
  72. package/build-types/components/save-button/index.d.ts.map +1 -1
  73. package/build-types/components/save-panel/index.d.ts.map +1 -1
  74. package/build-types/components/sidebar/index.d.ts +0 -1
  75. package/build-types/components/sidebar/index.d.ts.map +1 -1
  76. package/build-types/index.d.ts +0 -2
  77. package/build-types/index.d.ts.map +1 -1
  78. package/build-types/store/actions.d.ts +15 -2
  79. package/build-types/store/actions.d.ts.map +1 -1
  80. package/build-types/store/reducer.d.ts.map +1 -1
  81. package/build-types/store/selectors.d.ts +12 -0
  82. package/build-types/store/selectors.d.ts.map +1 -1
  83. package/build-types/store/types.d.ts +34 -3
  84. package/build-types/store/types.d.ts.map +1 -1
  85. package/package.json +27 -25
  86. package/src/components/app/router.tsx +19 -7
  87. package/src/components/canvas/index.tsx +117 -15
  88. package/src/components/canvas/site-preview.tsx +64 -0
  89. package/src/components/canvas/use-navigate-to-entity-record.ts +220 -0
  90. package/src/components/canvas/viewport.ts +34 -0
  91. package/src/components/error-boundary/index.tsx +71 -0
  92. package/src/components/error-boundary/style.module.scss +13 -0
  93. package/src/components/navigation/drilldown-item/index.tsx +2 -1
  94. package/src/components/navigation/dropdown-item/index.tsx +10 -6
  95. package/src/components/navigation/dropdown-item/{style.scss → style.module.scss} +6 -2
  96. package/src/components/navigation/index.tsx +0 -1
  97. package/src/components/navigation/navigation-item/index.tsx +3 -6
  98. package/src/components/navigation/navigation-item/{style.scss → style.module.scss} +7 -14
  99. package/src/components/navigation/navigation-screen/index.tsx +6 -15
  100. package/src/components/navigation/navigation-screen/{style.scss → style.module.scss} +10 -9
  101. package/src/components/plugin-area/index.tsx +34 -0
  102. package/src/components/root/{style.scss → _layout.module.scss} +71 -40
  103. package/src/components/root/_view-transitions.module.scss +205 -0
  104. package/src/components/root/index.tsx +44 -24
  105. package/src/components/root/single-page.tsx +15 -7
  106. package/src/components/root/style.module.scss +2 -0
  107. package/src/components/root/use-sync-body-background.ts +1 -1
  108. package/src/components/save-button/index.tsx +36 -14
  109. package/src/components/save-button/style.module.scss +10 -0
  110. package/src/components/save-panel/index.tsx +2 -1
  111. package/src/components/save-panel/style.module.scss +7 -0
  112. package/src/components/sidebar/index.tsx +5 -5
  113. package/src/components/sidebar/style.module.scss +29 -0
  114. package/src/index.tsx +0 -2
  115. package/src/store/actions.ts +18 -1
  116. package/src/store/reducer.ts +19 -0
  117. package/src/store/selectors.ts +28 -0
  118. package/src/store/types.ts +37 -3
  119. package/build-style/style-rtl.css +0 -133
  120. package/build-style/style.css +0 -133
  121. package/build-style/view-transitions-rtl.css +0 -189
  122. package/build-style/view-transitions.css +0 -189
  123. package/src/components/save-button/style.scss +0 -9
  124. package/src/components/sidebar/style.scss +0 -23
  125. package/src/style.scss +0 -34
  126. package/src/view-transitions.scss +0 -221
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/navigation/dropdown-item/index.tsx", "../../../../src/components/navigation/dropdown-item/style.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { chevronDownSmall } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../../store';\nimport NavigationItem from '../navigation-item';\nimport { wrapIcon } from '../items';\nimport type { IconType, MenuItem } from '../../../store/types';\nimport './style.scss';\n\nconst ANIMATION_DURATION = 0.2;\n\ninterface DropdownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the parent menu item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the dropdown item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the dropdown item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Whether this dropdown is currently expanded.\n\t */\n\tisExpanded: boolean;\n\t/**\n\t * Function to toggle this dropdown's expanded state.\n\t */\n\tonToggle: () => void;\n}\n\nexport default function DropdownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tchildren,\n\tisExpanded,\n\tonToggle,\n}: DropdownItemProps ) {\n\tconst menuItems: MenuItem[] = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems(),\n\t\t[]\n\t);\n\tconst items = menuItems.filter( ( item ) => item.parent === id );\n\tconst disableMotion = useReducedMotion();\n\treturn (\n\t\t<div className=\"boot-dropdown-item\">\n\t\t\t<Item\n\t\t\t\tclassName={ clsx( 'boot-navigation-item', className ) }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tonToggle();\n\t\t\t\t} }\n\t\t\t\tonMouseDown={ ( e ) => e.preventDefault() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t\t>\n\t\t\t\t\t{ wrapIcon( icon, false ) }\n\t\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t\t<WCIcon\n\t\t\t\t\t\ticon={ chevronDownSmall }\n\t\t\t\t\t\tclassName={ clsx( 'boot-dropdown-item__chevron', {\n\t\t\t\t\t\t\t'is-up': isExpanded,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t</Item>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\t\tanimate={ { height: 'auto' } }\n\t\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName=\"boot-dropdown-item__children\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</NavigationItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='608eff82f3']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"608eff82f3\");\n\tstyle.appendChild(document.createTextNode(\".boot-dropdown-item__children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}.boot-dropdown-item__chevron.is-up{transform:rotate(180deg)}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AAEjB;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,OACvB;AACP,SAAS,wBAAw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;AAAA;AAAA,cACH;AAAA;AAAA;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,mBAAgB,SAAU,OACxB,wBACD;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACA,SAAU,EAAE,QAAQ,EAAE;AAAA,QACtB,SAAU,EAAE,QAAQ,OAAO;AAAA,QAC3B,MAAO,EAAE,QAAQ,EAAE;AAAA,QACnB,YAAa;AAAA,UACZ,MAAM;AAAA,UACN,UAAU,gBAAgB,IAAI;AAAA,UAC9B,MAAM;AAAA,QACP;AAAA,QACA,WAAU;AAAA,QAER,gBAAM,IAAK,CAAE,MAAM,UACpB;AAAA,UAAC;AAAA;AAAA,YAEA,IAAK,KAAK;AAAA,YACV,uBAAwB;AAAA,YAEtB,eAAK;AAAA;AAAA,UAJD;AAAA,QAKP,CACC;AAAA;AAAA,IACH,GAEF;AAAA,KACD;AAEF;",
6
- "names": []
3
+ "sources": ["../../../../src/components/navigation/dropdown-item/index.tsx", "../../../../../style-runtime/src/index.ts", "../../../../src/components/navigation/navigation-item/style.module.scss", "../../../../src/components/navigation/dropdown-item/style.module.scss"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { chevronDownSmall } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../../store';\nimport NavigationItem from '../navigation-item';\nimport { wrapIcon } from '../items';\nimport type { IconType, MenuItem } from '../../../store/types';\nimport navigationItemStyles from '../navigation-item/style.module.scss';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.2;\n\ninterface DropdownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the parent menu item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the dropdown item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the dropdown item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Whether this dropdown is currently expanded.\n\t */\n\tisExpanded: boolean;\n\t/**\n\t * Function to toggle this dropdown's expanded state.\n\t */\n\tonToggle: () => void;\n}\n\nexport default function DropdownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tchildren,\n\tisExpanded,\n\tonToggle,\n}: DropdownItemProps ) {\n\tconst menuItems: MenuItem[] = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems(),\n\t\t[]\n\t);\n\tconst items = menuItems.filter( ( item ) => item.parent === id );\n\tconst disableMotion = useReducedMotion();\n\treturn (\n\t\t<div className={ styles.dropdown }>\n\t\t\t<Item\n\t\t\t\tclassName={ clsx( navigationItemStyles.item, className ) }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tonToggle();\n\t\t\t\t} }\n\t\t\t\tonMouseDown={ ( e ) => e.preventDefault() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t\t>\n\t\t\t\t\t{ wrapIcon( icon, false ) }\n\t\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t\t<WCIcon\n\t\t\t\t\t\ticon={ chevronDownSmall }\n\t\t\t\t\t\tclassName={ clsx( styles.chevron, {\n\t\t\t\t\t\t\t[ styles[ 'is-up' ] ]: isExpanded,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t</Item>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\t\tanimate={ { height: 'auto' } }\n\t\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ styles[ 'dropdown-children' ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tnavigationItemStyles[ 'is-compact' ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</NavigationItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"74796ab776\", \".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"d5331ded354c389a__item\",\"is-compact\":\"_44ce5374f19a05f7__is-compact\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"1a6b086e6c\", \"._093b894bfb82e8de__dropdown{display:block}._5954dba25ac6e16f__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._9a14116ec9dae0e2__chevron.a9ebdaa3f36d6986__is-up{transform:rotate(180deg)}\");\n}\nexport default {\"dropdown\":\"_093b894bfb82e8de__dropdown\",\"dropdown-children\":\"_5954dba25ac6e16f__dropdown-children\",\"chevron\":\"_9a14116ec9dae0e2__chevron\",\"is-up\":\"a9ebdaa3f36d6986__is-up\"};\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AAEjB;AAAA,EACC;AAA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A,sBAAQ,mBAAoB;AAAA,QAEtC,gBAAM,IAAK,CAAE,MAAM,UACpB;AAAA,UAAC;AAAA;AAAA,YAEA,WACC,qBAAsB,YAAa;AAAA,YAEpC,IAAK,KAAK;AAAA,YACV,uBAAwB;AAAA,YAEtB,eAAK;AAAA;AAAA,UAPD;AAAA,QAQP,CACC;AAAA;AAAA,IACH,GAEF;AAAA,KACD;AAEF;",
6
+ "names": ["style_module_default", "style_module_default"]
7
7
  }
@@ -57,7 +57,6 @@ function Navigation() {
57
57
  DropdownItem,
58
58
  {
59
59
  id: item.id,
60
- className: "boot-navigation-item",
61
60
  icon: item.icon,
62
61
  shouldShowPlaceholder: hasRealIcons,
63
62
  isExpanded: parentDropdownId === item.id,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/navigation/index.tsx"],
4
- "sourcesContent": ["import { useState, useMemo, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../store';\nimport NavigationItem from './navigation-item';\nimport DrilldownItem from './drilldown-item';\nimport DropdownItem from './dropdown-item';\nimport NavigationScreen from './navigation-screen';\nimport { useSidebarParent } from './use-sidebar-parent';\nimport type { MenuItem } from '../../store/types';\n\nfunction Navigation() {\n\tconst backButtonRef = useRef< HTMLButtonElement >( null );\n\tconst [ animationDirection, setAnimationDirection ] = useState<\n\t\t'forward' | 'backward' | null\n\t>( null );\n\tconst [ parentId, setParentId, parentDropdownId, setParentDropdownId ] =\n\t\tuseSidebarParent();\n\tconst menuItems = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems() as MenuItem[],\n\t\t[]\n\t);\n\tconst parent = useMemo(\n\t\t() => menuItems.find( ( item ) => item.id === parentId ),\n\t\t[ menuItems, parentId ]\n\t);\n\t// Create a unique key for the current navigation state\n\t// The sidebar will animate when the key changes.\n\tconst navigationKey = parent ? `drilldown-${ parent.id }` : 'root';\n\n\t// We use transitions to handle navigation clicks\n\t// This allows smooth animations and non blocking navigation.\n\tconst handleNavigate = ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => {\n\t\tsetAnimationDirection( direction );\n\t\tsetParentId( id );\n\t};\n\n\tconst handleDropdownToggle = ( dropdownId: string ) => {\n\t\tsetParentDropdownId(\n\t\t\tparentDropdownId === dropdownId ? undefined : dropdownId\n\t\t);\n\t};\n\n\tconst items = useMemo(\n\t\t() => menuItems.filter( ( item ) => item.parent === parentId ),\n\t\t[ menuItems, parentId ]\n\t);\n\n\tconst hasRealIcons = items.some( ( item ) => !! item.icon );\n\n\treturn (\n\t\t<NavigationScreen\n\t\t\tisRoot={ ! parent }\n\t\t\ttitle={ parent ? parent.label : '' }\n\t\t\tbackMenuItem={ parent?.parent }\n\t\t\tbackButtonRef={ backButtonRef }\n\t\t\tanimationDirection={ animationDirection || undefined }\n\t\t\tnavigationKey={ navigationKey }\n\t\t\tonNavigate={ handleNavigate }\n\t\t\tcontent={\n\t\t\t\t<div role=\"list\">\n\t\t\t\t\t{ items.map( ( item: MenuItem ) => {\n\t\t\t\t\t\tif ( item.parent_type === 'dropdown' ) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\t\tid={ item.id }\n\t\t\t\t\t\t\t\t\tclassName=\"boot-navigation-item\"\n\t\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t\t\tisExpanded={ parentDropdownId === item.id }\n\t\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\t\thandleDropdownToggle( item.id )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( item.parent_type === 'drilldown' ) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<DrilldownItem\n\t\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\t\tid={ item.id }\n\t\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t\t\tonNavigate={ handleNavigate }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t</DrilldownItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</NavigationItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Navigation;\n"],
5
- "mappings": ";AAAA,SAAS,UAAU,SAAS,cAAc;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,OAAO,oBAAoB;AAC3B,OAAO,mBAAmB;AAC1B,OAAO,kBAAkB;AACzB,OAAO,sBAAsB;AAC7B,SAAS,wBAAwB;AAgEzB;AA7DR,SAAS,aAAa;AACrB,QAAM,gBAAgB,OAA6B,IAAK;AACxD,QAAM,CAAE,oBAAoB,qBAAsB,IAAI,SAEnD,IAAK;AACR,QAAM,CAAE,UAAU,aAAa,kBAAkB,mBAAoB,IACpE,iBAAiB;AAClB,Q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AAK,gBAAgB,aAAc;AACvC,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA,IAAK,KAAK;AAAA,cACV,MAAO,KAAK;AAAA,cACZ,uBAAwB;AAAA,cACxB,YAAa;AAAA,cAEX,eAAK;AAAA;AAAA,YAND,KAAK;AAAA,UAOZ;AAAA,QAEF;AAEA,eACC;AAAA,UAAC;AAAA;AAAA,YAEA,IAAK,KAAK;AAAA,YACV,MAAO,KAAK;AAAA,YACZ,uBAAwB;AAAA,YAEtB,eAAK;AAAA;AAAA,UALD,KAAK;AAAA,QAMZ;AAAA,MAEF,CAAE,GACH;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["import { useState, useMemo, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../store';\nimport NavigationItem from './navigation-item';\nimport DrilldownItem from './drilldown-item';\nimport DropdownItem from './dropdown-item';\nimport NavigationScreen from './navigation-screen';\nimport { useSidebarParent } from './use-sidebar-parent';\nimport type { MenuItem } from '../../store/types';\n\nfunction Navigation() {\n\tconst backButtonRef = useRef< HTMLButtonElement >( null );\n\tconst [ animationDirection, setAnimationDirection ] = useState<\n\t\t'forward' | 'backward' | null\n\t>( null );\n\tconst [ parentId, setParentId, parentDropdownId, setParentDropdownId ] =\n\t\tuseSidebarParent();\n\tconst menuItems = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems() as MenuItem[],\n\t\t[]\n\t);\n\tconst parent = useMemo(\n\t\t() => menuItems.find( ( item ) => item.id === parentId ),\n\t\t[ menuItems, parentId ]\n\t);\n\t// Create a unique key for the current navigation state\n\t// The sidebar will animate when the key changes.\n\tconst navigationKey = parent ? `drilldown-${ parent.id }` : 'root';\n\n\t// We use transitions to handle navigation clicks\n\t// This allows smooth animations and non blocking navigation.\n\tconst handleNavigate = ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => {\n\t\tsetAnimationDirection( direction );\n\t\tsetParentId( id );\n\t};\n\n\tconst handleDropdownToggle = ( dropdownId: string ) => {\n\t\tsetParentDropdownId(\n\t\t\tparentDropdownId === dropdownId ? undefined : dropdownId\n\t\t);\n\t};\n\n\tconst items = useMemo(\n\t\t() => menuItems.filter( ( item ) => item.parent === parentId ),\n\t\t[ menuItems, parentId ]\n\t);\n\n\tconst hasRealIcons = items.some( ( item ) => !! item.icon );\n\n\treturn (\n\t\t<NavigationScreen\n\t\t\tisRoot={ ! parent }\n\t\t\ttitle={ parent ? parent.label : '' }\n\t\t\tbackMenuItem={ parent?.parent }\n\t\t\tbackButtonRef={ backButtonRef }\n\t\t\tanimationDirection={ animationDirection || undefined }\n\t\t\tnavigationKey={ navigationKey }\n\t\t\tonNavigate={ handleNavigate }\n\t\t\tcontent={\n\t\t\t\t<div role=\"list\">\n\t\t\t\t\t{ items.map( ( item: MenuItem ) => {\n\t\t\t\t\t\tif ( item.parent_type === 'dropdown' ) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\t\tid={ item.id }\n\t\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t\t\tisExpanded={ parentDropdownId === item.id }\n\t\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\t\thandleDropdownToggle( item.id )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( item.parent_type === 'drilldown' ) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<DrilldownItem\n\t\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\t\tid={ item.id }\n\t\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t\t\tonNavigate={ handleNavigate }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t\t</DrilldownItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ hasRealIcons }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</NavigationItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Navigation;\n"],
5
+ "mappings": ";AAAA,SAAS,UAAU,SAAS,cAAc;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,OAAO,oBAAoB;AAC3B,OAAO,mBAAmB;AAC1B,OAAO,kBAAkB;AACzB,OAAO,sBAAsB;AAC7B,SAAS,wBAAwB;AAgEzB;AA7DR,SAAS,aAAa;AACrB,QAAM,gBAAgB,OAA6B,IAAK;AACxD,QAAM,CAAE,oBAAoB,qBAAsB,IAAI,SAEnD,IAAK;AACR,QAAM,CAAE,UAAU,aAAa,kBAAkB,mBAAoB,IACpE,iBAAiB;AAClB,QAAM,YAAY;AAAA,IACjB,CAAE;AAAA;AAAA,MAED,OAAQ,UAAW,EAAE,aAAa;AAAA;AAAA,IACnC,CAAC;AAAA,EACF;AACA,QAAM,SAAS;AAAA,IACd,MAAM,UAAU,KAAM,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KAAK;AAAA,UAOZ;AAAA,QAEF;AAEA,eACC;AAAA,UAAC;AAAA;AAAA,YAEA,IAAK,KAAK;AAAA,YACV,MAAO,KAAK;AAAA,YACZ,uBAAwB;AAAA,YAEtB,eAAK;AAAA;AAAA,UALD,KAAK;AAAA,QAMZ;AAAA,MAEF,CAAE,GACH;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -8,13 +8,93 @@ import {
8
8
  import RouterLinkItem from "../router-link-item.mjs";
9
9
  import { wrapIcon } from "../items.mjs";
10
10
 
11
- // packages/boot/src/components/navigation/navigation-item/style.scss
12
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='4e60007e70']")) {
13
- const style = document.createElement("style");
14
- style.setAttribute("data-wp-hash", "4e60007e70");
15
- style.appendChild(document.createTextNode(".boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.boot-navigation-item.components-item.active{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}"));
16
- document.head.appendChild(style);
11
+ // packages/style-runtime/src/index.ts
12
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
13
+ function getRuntime() {
14
+ const globalScope = globalThis;
15
+ if (globalScope.__wpStyleRuntime) {
16
+ return globalScope.__wpStyleRuntime;
17
+ }
18
+ globalScope.__wpStyleRuntime = {
19
+ documents: /* @__PURE__ */ new Map(),
20
+ styles: /* @__PURE__ */ new Map(),
21
+ injectedStyles: /* @__PURE__ */ new WeakMap()
22
+ };
23
+ if (typeof document !== "undefined") {
24
+ registerDocument(document);
25
+ }
26
+ return globalScope.__wpStyleRuntime;
27
+ }
28
+ function documentContainsStyleHash(targetDocument, hash) {
29
+ if (!targetDocument.head) {
30
+ return false;
31
+ }
32
+ for (const style of targetDocument.head.querySelectorAll(
33
+ `style[${STYLE_HASH_ATTRIBUTE}]`
34
+ )) {
35
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
36
+ return true;
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+ function injectStyle(targetDocument, hash, css) {
42
+ if (!targetDocument.head) {
43
+ return;
44
+ }
45
+ const runtime = getRuntime();
46
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
47
+ if (!injectedStyles) {
48
+ injectedStyles = /* @__PURE__ */ new Set();
49
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
50
+ }
51
+ if (injectedStyles.has(hash)) {
52
+ return;
53
+ }
54
+ if (documentContainsStyleHash(targetDocument, hash)) {
55
+ injectedStyles.add(hash);
56
+ return;
57
+ }
58
+ const style = targetDocument.createElement("style");
59
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
60
+ style.appendChild(targetDocument.createTextNode(css));
61
+ targetDocument.head.appendChild(style);
62
+ injectedStyles.add(hash);
17
63
  }
64
+ function registerDocument(targetDocument) {
65
+ const runtime = getRuntime();
66
+ runtime.documents.set(
67
+ targetDocument,
68
+ (runtime.documents.get(targetDocument) ?? 0) + 1
69
+ );
70
+ for (const [hash, css] of runtime.styles) {
71
+ injectStyle(targetDocument, hash, css);
72
+ }
73
+ return () => {
74
+ const count = runtime.documents.get(targetDocument);
75
+ if (count === void 0) {
76
+ return;
77
+ }
78
+ if (count <= 1) {
79
+ runtime.documents.delete(targetDocument);
80
+ return;
81
+ }
82
+ runtime.documents.set(targetDocument, count - 1);
83
+ };
84
+ }
85
+ function registerStyle(hash, css) {
86
+ const runtime = getRuntime();
87
+ runtime.styles.set(hash, css);
88
+ for (const targetDocument of runtime.documents.keys()) {
89
+ injectStyle(targetDocument, hash, css);
90
+ }
91
+ }
92
+
93
+ // packages/boot/src/components/navigation/navigation-item/style.module.scss
94
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
95
+ registerStyle("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}");
96
+ }
97
+ var style_module_default = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" };
18
98
 
19
99
  // packages/boot/src/components/navigation/navigation-item/index.tsx
20
100
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -38,19 +118,12 @@ function NavigationItem({
38
118
  {
39
119
  as: "a",
40
120
  href: to,
41
- className: clsx("boot-navigation-item", className),
121
+ className: clsx(style_module_default.item, className),
42
122
  children: content
43
123
  }
44
124
  );
45
125
  }
46
- return /* @__PURE__ */ jsx(
47
- RouterLinkItem,
48
- {
49
- to,
50
- className: clsx("boot-navigation-item", className),
51
- children: content
52
- }
53
- );
126
+ return /* @__PURE__ */ jsx(RouterLinkItem, { to, className: clsx(style_module_default.item, className), children: content });
54
127
  }
55
128
  export {
56
129
  NavigationItem as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/navigation/navigation-item/index.tsx", "../../../../src/components/navigation/navigation-item/style.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport RouterLinkItem from '../router-link-item';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport './style.scss';\n\ninterface NavigationItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The path to navigate to.\n\t */\n\tto: string;\n}\n\nexport default function NavigationItem( {\n\tclassName,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tto,\n}: NavigationItemProps ) {\n\t// Check if the 'to' prop is an external URL\n\tconst isExternal = ! String(\n\t\tnew URL( to, window.location.origin )\n\t).startsWith( window.location.origin );\n\n\tconst content = (\n\t\t<HStack justify=\"flex-start\" spacing={ 2 } style={ { flexGrow: '1' } }>\n\t\t\t{ wrapIcon( icon, shouldShowPlaceholder ) }\n\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t</HStack>\n\t);\n\n\tif ( isExternal ) {\n\t\t// Render as a regular anchor tag for external URLs\n\t\treturn (\n\t\t\t<Item\n\t\t\t\tas=\"a\"\n\t\t\t\thref={ to }\n\t\t\t\tclassName={ clsx( 'boot-navigation-item', className ) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Item>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RouterLinkItem\n\t\t\tto={ to }\n\t\t\tclassName={ clsx( 'boot-navigation-item', className ) }\n\t\t>\n\t\t\t{ content }\n\t\t</RouterLinkItem>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='4e60007e70']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"4e60007e70\");\n\tstyle.appendChild(document.createTextNode(\".boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.boot-navigation-item.components-item.active{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AAEjB;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AACP,OAAO,oBAAoB;AAC3B,SAAS,gBAAgB;;;ACRzB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,69CAA69C,CAAC;AACxgD,WAAS,KAAK,YAAY,KAAK;AAChC;;;AD2CE,SAEC,KAFD;AAba,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,EACA;AACD,GAAyB;AAExB,QAAM,aAAa,CAAE;AAAA,IACpB,IAAI,IAAK,IAAI,OAAO,SAAS,MAAO;AAAA,EACrC,EAAE,WAAY,OAAO,SAAS,MAAO;AAErC,QAAM,UACL,qBAAC,UAAO,SAAQ,cAAa,SAAU,GAAI,OAAQ,EAAE,UAAU,IAAI,GAChE;AAAA,aAAU,MAAM,qBAAsB;AAAA,IACxC,oBAAC,aAAY,UAAU;AAAA,KACxB;AAGD,MAAK,YAAa;AAEjB,WACC;AAAA,MAAC;AAAA;AAAA,QACA,IAAG;AAAA,QACH,MAAO;AAAA,QACP,WAAY,KAAM,wBAAwB,SAAU;AAAA,QAElD;AAAA;AAAA,IACH;AAAA,EAEF;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,WAAY,KAAM,wBAAwB,SAAU;AAAA,MAElD;AAAA;AAAA,EACH;AAEF;",
3
+ "sources": ["../../../../src/components/navigation/navigation-item/index.tsx", "../../../../../style-runtime/src/index.ts", "../../../../src/components/navigation/navigation-item/style.module.scss"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport RouterLinkItem from '../router-link-item';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport styles from './style.module.scss';\n\ninterface NavigationItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The path to navigate to.\n\t */\n\tto: string;\n}\n\nexport default function NavigationItem( {\n\tclassName,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tto,\n}: NavigationItemProps ) {\n\t// Check if the 'to' prop is an external URL\n\tconst isExternal = ! String(\n\t\tnew URL( to, window.location.origin )\n\t).startsWith( window.location.origin );\n\n\tconst content = (\n\t\t<HStack justify=\"flex-start\" spacing={ 2 } style={ { flexGrow: '1' } }>\n\t\t\t{ wrapIcon( icon, shouldShowPlaceholder ) }\n\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t</HStack>\n\t);\n\n\tif ( isExternal ) {\n\t\t// Render as a regular anchor tag for external URLs\n\t\treturn (\n\t\t\t<Item\n\t\t\t\tas=\"a\"\n\t\t\t\thref={ to }\n\t\t\t\tclassName={ clsx( styles.item, className ) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Item>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RouterLinkItem to={ to } className={ clsx( styles.item, className ) }>\n\t\t\t{ content }\n\t\t</RouterLinkItem>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"74796ab776\", \".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"d5331ded354c389a__item\",\"is-compact\":\"_44ce5374f19a05f7__is-compact\"};\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AAEjB;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AACP,OAAO,oBAAoB;AAC3B,SAAS,gBAAgB;;;ACEzB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAK,gBAAgB,cAAe;AAAA,EAC5D;AAEA,MAAK,e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EACA;AACD,GAAyB;AAExB,QAAM,aAAa,CAAE;AAAA,IACpB,IAAI,IAAK,IAAI,OAAO,SAAS,MAAO;AAAA,EACrC,EAAE,WAAY,OAAO,SAAS,MAAO;AAErC,QAAM,UACL,qBAAC,UAAO,SAAQ,cAAa,SAAU,GAAI,OAAQ,EAAE,UAAU,IAAI,GAChE;AAAA,aAAU,MAAM,qBAAsB;AAAA,IACxC,oBAAC,aAAY,UAAU;AAAA,KACxB;AAGD,MAAK,YAAa;AAEjB,WACC;AAAA,MAAC;AAAA;AAAA,QACA,IAAG;AAAA,QACH,MAAO;AAAA,QACP,WAAY,KAAM,qBAAO,MAAM,SAAU;AAAA,QAEvC;AAAA;AAAA,IACH;AAAA,EAEF;AAEA,SACC,oBAAC,kBAAe,IAAU,WAAY,KAAM,qBAAO,MAAM,SAAU,GAChE,mBACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -10,13 +10,93 @@ import { isRTL, __ } from "@wordpress/i18n";
10
10
  import { chevronRight, chevronLeft } from "@wordpress/icons";
11
11
  import { useReducedMotion } from "@wordpress/compose";
12
12
 
13
- // packages/boot/src/components/navigation/navigation-screen/style.scss
14
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='db54ac7e93']")) {
15
- const style = document.createElement("style");
16
- style.setAttribute("data-wp-hash", "db54ac7e93");
17
- style.appendChild(document.createTextNode(".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}"));
18
- document.head.appendChild(style);
13
+ // packages/style-runtime/src/index.ts
14
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
15
+ function getRuntime() {
16
+ const globalScope = globalThis;
17
+ if (globalScope.__wpStyleRuntime) {
18
+ return globalScope.__wpStyleRuntime;
19
+ }
20
+ globalScope.__wpStyleRuntime = {
21
+ documents: /* @__PURE__ */ new Map(),
22
+ styles: /* @__PURE__ */ new Map(),
23
+ injectedStyles: /* @__PURE__ */ new WeakMap()
24
+ };
25
+ if (typeof document !== "undefined") {
26
+ registerDocument(document);
27
+ }
28
+ return globalScope.__wpStyleRuntime;
29
+ }
30
+ function documentContainsStyleHash(targetDocument, hash) {
31
+ if (!targetDocument.head) {
32
+ return false;
33
+ }
34
+ for (const style of targetDocument.head.querySelectorAll(
35
+ `style[${STYLE_HASH_ATTRIBUTE}]`
36
+ )) {
37
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ function injectStyle(targetDocument, hash, css) {
44
+ if (!targetDocument.head) {
45
+ return;
46
+ }
47
+ const runtime = getRuntime();
48
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
49
+ if (!injectedStyles) {
50
+ injectedStyles = /* @__PURE__ */ new Set();
51
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
52
+ }
53
+ if (injectedStyles.has(hash)) {
54
+ return;
55
+ }
56
+ if (documentContainsStyleHash(targetDocument, hash)) {
57
+ injectedStyles.add(hash);
58
+ return;
59
+ }
60
+ const style = targetDocument.createElement("style");
61
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
62
+ style.appendChild(targetDocument.createTextNode(css));
63
+ targetDocument.head.appendChild(style);
64
+ injectedStyles.add(hash);
65
+ }
66
+ function registerDocument(targetDocument) {
67
+ const runtime = getRuntime();
68
+ runtime.documents.set(
69
+ targetDocument,
70
+ (runtime.documents.get(targetDocument) ?? 0) + 1
71
+ );
72
+ for (const [hash, css] of runtime.styles) {
73
+ injectStyle(targetDocument, hash, css);
74
+ }
75
+ return () => {
76
+ const count = runtime.documents.get(targetDocument);
77
+ if (count === void 0) {
78
+ return;
79
+ }
80
+ if (count <= 1) {
81
+ runtime.documents.delete(targetDocument);
82
+ return;
83
+ }
84
+ runtime.documents.set(targetDocument, count - 1);
85
+ };
86
+ }
87
+ function registerStyle(hash, css) {
88
+ const runtime = getRuntime();
89
+ runtime.styles.set(hash, css);
90
+ for (const targetDocument of runtime.documents.keys()) {
91
+ injectStyle(targetDocument, hash, css);
92
+ }
93
+ }
94
+
95
+ // packages/boot/src/components/navigation/navigation-screen/style.module.scss
96
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
97
+ registerStyle("9bfc8fef50", ".c93eb5f7b870f29c__screen{padding-block-end:4px}.c93eb5f7b870f29c__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.bee113ef4a391bcd__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}._2f6050d2407c9dee__title{flex-grow:1;overflow-wrap:break-word}._2f6050d2407c9dee__title._2f6050d2407c9dee__title,._2f6050d2407c9dee__title._2f6050d2407c9dee__title ._2f6050d2407c9dee__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.e78f7a9cf7e91164__actions{display:flex;flex-shrink:0}");
19
98
  }
99
+ var style_module_default = { "screen": "c93eb5f7b870f29c__screen", "title-icon": "bee113ef4a391bcd__title-icon", "title": "_2f6050d2407c9dee__title", "actions": "e78f7a9cf7e91164__actions" };
20
100
 
21
101
  // packages/boot/src/components/navigation/navigation-screen/index.tsx
22
102
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -56,7 +136,7 @@ function NavigationScreen({
56
136
  return /* @__PURE__ */ jsx(
57
137
  "div",
58
138
  {
59
- className: "boot-navigation-screen",
139
+ className: style_module_default.screen,
60
140
  style: {
61
141
  overflow: "hidden",
62
142
  position: "relative",
@@ -83,37 +163,30 @@ function NavigationScreen({
83
163
  gridRow: "1"
84
164
  },
85
165
  children: [
86
- /* @__PURE__ */ jsxs(
87
- HStack,
88
- {
89
- spacing: 2,
90
- className: "boot-navigation-screen__title-icon",
91
- children: [
92
- !isRoot && /* @__PURE__ */ jsx(
93
- Button,
94
- {
95
- ref: backButtonRef,
96
- icon,
97
- onClick: handleBackClick,
98
- label: __("Back"),
99
- size: "small",
100
- variant: "tertiary"
101
- }
102
- ),
103
- /* @__PURE__ */ jsx(
104
- Heading,
105
- {
106
- className: "boot-navigation-screen__title",
107
- level: 1,
108
- size: "15px",
109
- children: title
110
- }
111
- ),
112
- actions && /* @__PURE__ */ jsx("div", { className: "boot-navigation-screen__actions", children: actions })
113
- ]
114
- }
115
- ),
116
- description && /* @__PURE__ */ jsx("div", { className: "boot-navigation-screen__description", children: description }),
166
+ /* @__PURE__ */ jsxs(HStack, { spacing: 2, className: style_module_default["title-icon"], children: [
167
+ !isRoot && /* @__PURE__ */ jsx(
168
+ Button,
169
+ {
170
+ ref: backButtonRef,
171
+ icon,
172
+ onClick: handleBackClick,
173
+ label: __("Back"),
174
+ size: "small",
175
+ variant: "tertiary"
176
+ }
177
+ ),
178
+ /* @__PURE__ */ jsx(
179
+ Heading,
180
+ {
181
+ className: style_module_default.title,
182
+ level: 1,
183
+ size: "15px",
184
+ children: title
185
+ }
186
+ ),
187
+ actions && /* @__PURE__ */ jsx("div", { className: style_module_default.actions, children: actions })
188
+ ] }),
189
+ description && /* @__PURE__ */ jsx("div", { children: description }),
117
190
  content
118
191
  ]
119
192
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/navigation/navigation-screen/index.tsx", "../../../../src/components/navigation/navigation-screen/style.scss"],
4
- "sourcesContent": ["import type { ReactNode, RefObject } from 'react';\nimport {\n\t__experimentalHeading as Heading,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport './style.scss';\n\nconst ANIMATION_DURATION = 0.3;\nconst slideVariants = {\n\tinitial: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: direction === 'forward' ? 100 : -100,\n\t\topacity: 0,\n\t} ),\n\tanimate: {\n\t\tx: 0,\n\t\topacity: 1,\n\t},\n\texit: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: direction === 'forward' ? 100 : -100,\n\t\topacity: 0,\n\t} ),\n};\n\nexport default function NavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n\tanimationDirection,\n\tbackMenuItem,\n\tbackButtonRef,\n\tnavigationKey,\n\tonNavigate,\n}: {\n\tisRoot?: boolean;\n\ttitle: string;\n\tactions?: ReactNode;\n\tcontent: ReactNode;\n\tdescription?: ReactNode;\n\tbackMenuItem?: string;\n\tbackButtonRef?: RefObject< HTMLButtonElement | null >;\n\tanimationDirection?: 'forward' | 'backward';\n\tnavigationKey?: string;\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n} ) {\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\tconst disableMotion = useReducedMotion();\n\n\tconst handleBackClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id: backMenuItem, direction: 'backward' } );\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"boot-navigation-screen\"\n\t\t\tstyle={ {\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tposition: 'relative',\n\t\t\t\tdisplay: 'grid',\n\t\t\t\tgridTemplateColumns: '1fr',\n\t\t\t\tgridTemplateRows: '1fr',\n\t\t\t} }\n\t\t>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ navigationKey }\n\t\t\t\t\tcustom={ animationDirection }\n\t\t\t\t\tvariants={ slideVariants }\n\t\t\t\t\tinitial=\"initial\"\n\t\t\t\t\tanimate=\"animate\"\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\tease: [ 0.33, 0, 0, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tgridColumn: '1',\n\t\t\t\t\t\tgridRow: '1',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\tclassName=\"boot-navigation-screen__title-icon\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ backButtonRef }\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName=\"boot-navigation-screen__title\"\n\t\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\t\tsize=\"15px\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t\t<div className=\"boot-navigation-screen__actions\">\n\t\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<div className=\"boot-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ content }\n\t\t\t\t</motion.div>\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='db54ac7e93']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"db54ac7e93\");\n\tstyle.appendChild(document.createTextNode(\".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";AACA;AAAA,EACC,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B;AAAA,EACA,wBAAwB;AAAA,OAClB;AACP,SAAS,OAAO,UAAU;AAC1B,SAAS,cAAc,mBAAmB;AAC1C,SAAS,wBAAwB;;;ACVjC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,ykBAAykB,CAAC;AACpnB,WAAS,KAAK,YAAY,KAAK;AAChC;;;AD2FK,SAKE,KALF;AAnFL,IAAM,qBAAqB;AAC3B,IAAM,gBAAgB;AAAA,EACrB,SAAS,CAAE,eAAyC;AAAA,IACnD,GAAG,cAAc,YAAY,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AQ,GAAI,MAAO;AAAA,sBACnB,MAAK;AAAA,sBACL,SAAQ;AAAA;AAAA,kBACT;AAAA,kBAED;AAAA,oBAAC;AAAA;AAAA,sBACA,WAAU;AAAA,sBACV,OAAQ;AAAA,sBACR,MAAK;AAAA,sBAEH;AAAA;AAAA,kBACH;AAAA,kBACE,WACD,oBAAC,SAAI,WAAU,mCACZ,mBACH;AAAA;AAAA;AAAA,YAEF;AAAA,YAEE,eACD,oBAAC,SAAI,WAAU,uCACZ,uBACH;AAAA,YAGC;AAAA;AAAA;AAAA,QAnDI;AAAA,MAoDP,GACD;AAAA;AAAA,EACD;AAEF;",
3
+ "sources": ["../../../../src/components/navigation/navigation-screen/index.tsx", "../../../../../style-runtime/src/index.ts", "../../../../src/components/navigation/navigation-screen/style.module.scss"],
4
+ "sourcesContent": ["import type { ReactNode, RefObject } from 'react';\nimport {\n\t__experimentalHeading as Heading,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.3;\nconst slideVariants = {\n\tinitial: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: direction === 'forward' ? 100 : -100,\n\t\topacity: 0,\n\t} ),\n\tanimate: {\n\t\tx: 0,\n\t\topacity: 1,\n\t},\n\texit: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: direction === 'forward' ? 100 : -100,\n\t\topacity: 0,\n\t} ),\n};\n\nexport default function NavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n\tanimationDirection,\n\tbackMenuItem,\n\tbackButtonRef,\n\tnavigationKey,\n\tonNavigate,\n}: {\n\tisRoot?: boolean;\n\ttitle: string;\n\tactions?: ReactNode;\n\tcontent: ReactNode;\n\tdescription?: ReactNode;\n\tbackMenuItem?: string;\n\tbackButtonRef?: RefObject< HTMLButtonElement | null >;\n\tanimationDirection?: 'forward' | 'backward';\n\tnavigationKey?: string;\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n} ) {\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\tconst disableMotion = useReducedMotion();\n\n\tconst handleBackClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id: backMenuItem, direction: 'backward' } );\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ styles.screen }\n\t\t\tstyle={ {\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tposition: 'relative',\n\t\t\t\tdisplay: 'grid',\n\t\t\t\tgridTemplateColumns: '1fr',\n\t\t\t\tgridTemplateRows: '1fr',\n\t\t\t} }\n\t\t>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ navigationKey }\n\t\t\t\t\tcustom={ animationDirection }\n\t\t\t\t\tvariants={ slideVariants }\n\t\t\t\t\tinitial=\"initial\"\n\t\t\t\t\tanimate=\"animate\"\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\tease: [ 0.33, 0, 0, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tgridColumn: '1',\n\t\t\t\t\t\tgridRow: '1',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack spacing={ 2 } className={ styles[ 'title-icon' ] }>\n\t\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ backButtonRef }\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName={ styles.title }\n\t\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\t\tsize=\"15px\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t\t<div className={ styles.actions }>{ actions }</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\n\t\t\t\t\t{ description && <div>{ description }</div> }\n\n\t\t\t\t\t{ content }\n\t\t\t\t</motion.div>\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"9bfc8fef50\", \".c93eb5f7b870f29c__screen{padding-block-end:4px}.c93eb5f7b870f29c__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.bee113ef4a391bcd__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}._2f6050d2407c9dee__title{flex-grow:1;overflow-wrap:break-word}._2f6050d2407c9dee__title._2f6050d2407c9dee__title,._2f6050d2407c9dee__title._2f6050d2407c9dee__title ._2f6050d2407c9dee__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.e78f7a9cf7e91164__actions{display:flex;flex-shrink:0}\");\n}\nexport default {\"screen\":\"c93eb5f7b870f29c__screen\",\"title-icon\":\"bee113ef4a391bcd__title-icon\",\"title\":\"_2f6050d2407c9dee__title\",\"actions\":\"e78f7a9cf7e91164__actions\"};\n"],
5
+ "mappings": ";AACA;AAAA,EACC,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B;AAAA,EACA,wBAAwB;AAAA,OAClB;AACP,SAAS,OAAO,UAAU;AAC1B,SAAS,cAAc,mBAAmB;AAC1C,SAAS,wBAAwB;;;ACAjC,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAK,gBAAgB,cAAe;AAAA,EAC5D;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;AAAA,kBACA,KAAM;AAAA,kBACN;AAAA,kBACA,SAAU;AAAA,kBACV,OAAQ,GAAI,MAAO;AAAA,kBACnB,MAAK;AAAA,kBACL,SAAQ;AAAA;AAAA,cACT;AAAA,cAED;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAY,qBAAO;AAAA,kBACnB,OAAQ;AAAA,kBACR,MAAK;AAAA,kBAEH;AAAA;AAAA,cACH;AAAA,cACE,WACD,oBAAC,SAAI,WAAY,qBAAO,SAAY,mBAAS;AAAA,eAE/C;AAAA,YAEE,eAAe,oBAAC,SAAM,uBAAa;AAAA,YAEnC;AAAA;AAAA;AAAA,QA1CI;AAAA,MA2CP,GACD;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,29 @@
1
+ // packages/boot/src/components/plugin-area/index.tsx
2
+ import { useDispatch } from "@wordpress/data";
3
+ import { __, sprintf } from "@wordpress/i18n";
4
+ import { store as noticesStore } from "@wordpress/notices";
5
+ import { PluginArea as WPPluginArea } from "@wordpress/plugins";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function PluginArea() {
8
+ const { createErrorNotice } = useDispatch(noticesStore);
9
+ return /* @__PURE__ */ jsx(
10
+ WPPluginArea,
11
+ {
12
+ onError: (name) => {
13
+ createErrorNotice(
14
+ sprintf(
15
+ /* translators: %s: plugin name */
16
+ __(
17
+ 'The "%s" plugin has encountered an error and cannot be rendered.'
18
+ ),
19
+ name
20
+ )
21
+ );
22
+ }
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ PluginArea as default
28
+ };
29
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/plugin-area/index.tsx"],
4
+ "sourcesContent": ["import { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { PluginArea as WPPluginArea } from '@wordpress/plugins';\n\n/**\n * Mounts every plugin registered with `registerPlugin`, so the fills they\n * render reach their slots.\n *\n * Sits at the root rather than with the editor: a plugin's fills mostly target\n * editor slots, but the component holding them is also where it registers\n * commands and extends a list, which the routes without a canvas need too.\n *\n * @return The mount point. Renders whatever the plugins do, and nothing itself.\n */\nexport default function PluginArea() {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\treturn (\n\t\t<WPPluginArea\n\t\t\tonError={ ( name ) => {\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tname\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";AAAA,SAAS,mBAAmB;AAC5B,SAAS,IAAI,eAAe;AAC5B,SAAS,SAAS,oBAAoB;AACtC,SAAS,cAAc,oBAAoB;AAgBzC;AAJa,SAAR,aAA8B;AACpC,QAAM,EAAE,kBAAkB,IAAI,YAAa,YAAa;AAExD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,CAAE,SAAU;AACrB;AAAA,UACC;AAAA;AAAA,YAEC;AAAA,cACC;AAAA,YACD;AAAA,YACA;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
7
+ }