@wordpress/edit-site 5.1.0 → 5.3.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 (415) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/add-new-template/add-custom-generic-template-modal.js +8 -10
  4. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  5. package/build/components/add-new-template/add-custom-template-modal.js +0 -1
  6. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  7. package/build/components/add-new-template/new-template-part.js +5 -9
  8. package/build/components/add-new-template/new-template-part.js.map +1 -1
  9. package/build/components/app/index.js +2 -7
  10. package/build/components/app/index.js.map +1 -1
  11. package/build/components/block-editor/editor-canvas.js +0 -1
  12. package/build/components/block-editor/editor-canvas.js.map +1 -1
  13. package/build/components/block-editor/index.js +25 -59
  14. package/build/components/block-editor/index.js.map +1 -1
  15. package/build/components/block-editor/inserter-media-categories.js +237 -0
  16. package/build/components/block-editor/inserter-media-categories.js.map +1 -0
  17. package/build/components/block-editor/resize-handle.js +2 -1
  18. package/build/components/block-editor/resize-handle.js.map +1 -1
  19. package/build/components/canvas-spinner/index.js +20 -0
  20. package/build/components/canvas-spinner/index.js.map +1 -0
  21. package/build/components/create-template-part-modal/index.js +4 -2
  22. package/build/components/create-template-part-modal/index.js.map +1 -1
  23. package/build/components/editor/index.js +4 -2
  24. package/build/components/editor/index.js.map +1 -1
  25. package/build/components/error-boundary/index.js +2 -12
  26. package/build/components/error-boundary/index.js.map +1 -1
  27. package/build/components/error-boundary/warning.js +5 -28
  28. package/build/components/error-boundary/warning.js.map +1 -1
  29. package/build/components/global-styles/block-preview-panel.js +10 -4
  30. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  31. package/build/components/global-styles/border-panel.js +18 -9
  32. package/build/components/global-styles/border-panel.js.map +1 -1
  33. package/build/components/global-styles/color-palette-panel.js +13 -7
  34. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  35. package/build/components/global-styles/context-menu.js +47 -4
  36. package/build/components/global-styles/context-menu.js.map +1 -1
  37. package/build/components/global-styles/custom-css.js +65 -14
  38. package/build/components/global-styles/custom-css.js.map +1 -1
  39. package/build/components/global-styles/dimensions-panel.js +50 -27
  40. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  41. package/build/components/global-styles/global-styles-provider.js +13 -3
  42. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  43. package/build/components/global-styles/gradients-palette-panel.js +17 -11
  44. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  45. package/build/components/global-styles/hooks.js +21 -142
  46. package/build/components/global-styles/hooks.js.map +1 -1
  47. package/build/components/global-styles/index.js +0 -28
  48. package/build/components/global-styles/index.js.map +1 -1
  49. package/build/components/global-styles/palette.js +11 -4
  50. package/build/components/global-styles/palette.js.map +1 -1
  51. package/build/components/global-styles/preview.js +18 -15
  52. package/build/components/global-styles/preview.js.map +1 -1
  53. package/build/components/global-styles/screen-background-color.js +28 -13
  54. package/build/components/global-styles/screen-background-color.js.map +1 -1
  55. package/build/components/global-styles/screen-block-list.js +4 -1
  56. package/build/components/global-styles/screen-block-list.js.map +1 -1
  57. package/build/components/global-styles/screen-border.js +16 -4
  58. package/build/components/global-styles/screen-border.js.map +1 -1
  59. package/build/components/global-styles/screen-button-color.js +17 -9
  60. package/build/components/global-styles/screen-button-color.js.map +1 -1
  61. package/build/components/global-styles/screen-colors.js +59 -26
  62. package/build/components/global-styles/screen-colors.js.map +1 -1
  63. package/build/components/global-styles/screen-css.js +20 -8
  64. package/build/components/global-styles/screen-css.js.map +1 -1
  65. package/build/components/global-styles/screen-heading-color.js +24 -16
  66. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  67. package/build/components/global-styles/screen-layout.js +9 -3
  68. package/build/components/global-styles/screen-layout.js.map +1 -1
  69. package/build/components/global-styles/screen-link-color.js +19 -11
  70. package/build/components/global-styles/screen-link-color.js.map +1 -1
  71. package/build/components/global-styles/screen-root.js +25 -9
  72. package/build/components/global-styles/screen-root.js.map +1 -1
  73. package/build/components/global-styles/screen-style-variations.js +8 -4
  74. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  75. package/build/components/global-styles/screen-text-color.js +15 -7
  76. package/build/components/global-styles/screen-text-color.js.map +1 -1
  77. package/build/components/global-styles/screen-typography.js +23 -11
  78. package/build/components/global-styles/screen-typography.js.map +1 -1
  79. package/build/components/global-styles/screen-variations.js +71 -0
  80. package/build/components/global-styles/screen-variations.js.map +1 -0
  81. package/build/components/global-styles/shadow-panel.js +196 -0
  82. package/build/components/global-styles/shadow-panel.js.map +1 -0
  83. package/build/components/global-styles/typography-panel.js +37 -22
  84. package/build/components/global-styles/typography-panel.js.map +1 -1
  85. package/build/components/global-styles/typography-preview.js +19 -9
  86. package/build/components/global-styles/typography-preview.js.map +1 -1
  87. package/build/components/global-styles/ui.js +139 -21
  88. package/build/components/global-styles/ui.js.map +1 -1
  89. package/build/components/global-styles/utils.js +8 -290
  90. package/build/components/global-styles/utils.js.map +1 -1
  91. package/build/components/global-styles/variations-panel.js +85 -0
  92. package/build/components/global-styles/variations-panel.js.map +1 -0
  93. package/build/components/global-styles-renderer/index.js +7 -5
  94. package/build/components/global-styles-renderer/index.js.map +1 -1
  95. package/build/components/header-edit-mode/document-actions/index.js +2 -2
  96. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  97. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  98. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  99. package/build/components/layout/index.js +86 -15
  100. package/build/components/layout/index.js.map +1 -1
  101. package/build/components/list/actions/rename-menu-item.js +8 -11
  102. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  103. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +3 -2
  104. package/build/components/navigation-inspector/index.js.map +1 -0
  105. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +13 -15
  106. package/build/components/navigation-inspector/navigation-menu.js.map +1 -0
  107. package/build/components/sidebar/index.js +3 -1
  108. package/build/components/sidebar/index.js.map +1 -1
  109. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +3 -18
  110. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  111. package/build/components/sidebar-edit-mode/index.js +1 -14
  112. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  113. package/build/components/sidebar-navigation-screen/index.js +3 -2
  114. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen-main/index.js +23 -1
  116. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +35 -0
  118. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  119. package/build/components/sidebar-navigation-screen-templates/index.js +3 -8
  120. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  121. package/build/components/site-hub/index.js +11 -11
  122. package/build/components/site-hub/index.js.map +1 -1
  123. package/build/components/site-icon/index.js +1 -1
  124. package/build/components/site-icon/index.js.map +1 -1
  125. package/build/components/style-book/index.js +7 -4
  126. package/build/components/style-book/index.js.map +1 -1
  127. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +54 -0
  128. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
  129. package/build/components/template-details/edit-template-title.js +1 -0
  130. package/build/components/template-details/edit-template-title.js.map +1 -1
  131. package/build/components/template-details/template-part-area-selector.js +1 -0
  132. package/build/components/template-details/template-part-area-selector.js.map +1 -1
  133. package/build/components/template-part-converter/convert-to-template-part.js +5 -9
  134. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  135. package/build/experiments.js +19 -0
  136. package/build/experiments.js.map +1 -0
  137. package/build/hooks/push-changes-to-global-styles/index.js +68 -9
  138. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  139. package/build/index.js +53 -60
  140. package/build/index.js.map +1 -1
  141. package/build/store/reducer.js +1 -1
  142. package/build/store/reducer.js.map +1 -1
  143. package/build/store/selectors.js +7 -27
  144. package/build/store/selectors.js.map +1 -1
  145. package/build/store/utils.js +77 -0
  146. package/build/store/utils.js.map +1 -0
  147. package/build/utils/template-part-create.js +71 -0
  148. package/build/utils/template-part-create.js.map +1 -0
  149. package/build-module/components/add-new-template/add-custom-generic-template-modal.js +9 -11
  150. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  151. package/build-module/components/add-new-template/add-custom-template-modal.js +0 -1
  152. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  153. package/build-module/components/add-new-template/new-template-part.js +5 -9
  154. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  155. package/build-module/components/app/index.js +2 -7
  156. package/build-module/components/app/index.js.map +1 -1
  157. package/build-module/components/block-editor/editor-canvas.js +0 -1
  158. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  159. package/build-module/components/block-editor/index.js +27 -57
  160. package/build-module/components/block-editor/index.js.map +1 -1
  161. package/build-module/components/block-editor/inserter-media-categories.js +225 -0
  162. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -0
  163. package/build-module/components/block-editor/resize-handle.js +2 -1
  164. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  165. package/build-module/components/canvas-spinner/index.js +12 -0
  166. package/build-module/components/canvas-spinner/index.js.map +1 -0
  167. package/build-module/components/create-template-part-modal/index.js +5 -3
  168. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  169. package/build-module/components/editor/index.js +3 -2
  170. package/build-module/components/editor/index.js.map +1 -1
  171. package/build-module/components/error-boundary/index.js +2 -12
  172. package/build-module/components/error-boundary/index.js.map +1 -1
  173. package/build-module/components/error-boundary/warning.js +5 -28
  174. package/build-module/components/error-boundary/warning.js.map +1 -1
  175. package/build-module/components/global-styles/block-preview-panel.js +10 -4
  176. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  177. package/build-module/components/global-styles/border-panel.js +18 -11
  178. package/build-module/components/global-styles/border-panel.js.map +1 -1
  179. package/build-module/components/global-styles/color-palette-panel.js +11 -7
  180. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  181. package/build-module/components/global-styles/context-menu.js +46 -8
  182. package/build-module/components/global-styles/context-menu.js.map +1 -1
  183. package/build-module/components/global-styles/custom-css.js +61 -15
  184. package/build-module/components/global-styles/custom-css.js.map +1 -1
  185. package/build-module/components/global-styles/dimensions-panel.js +50 -28
  186. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  187. package/build-module/components/global-styles/global-styles-provider.js +7 -2
  188. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  189. package/build-module/components/global-styles/gradients-palette-panel.js +15 -11
  190. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  191. package/build-module/components/global-styles/hooks.js +23 -134
  192. package/build-module/components/global-styles/hooks.js.map +1 -1
  193. package/build-module/components/global-styles/index.js +0 -2
  194. package/build-module/components/global-styles/index.js.map +1 -1
  195. package/build-module/components/global-styles/palette.js +10 -5
  196. package/build-module/components/global-styles/palette.js.map +1 -1
  197. package/build-module/components/global-styles/preview.js +18 -14
  198. package/build-module/components/global-styles/preview.js.map +1 -1
  199. package/build-module/components/global-styles/screen-background-color.js +27 -15
  200. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  201. package/build-module/components/global-styles/screen-block-list.js +3 -1
  202. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  203. package/build-module/components/global-styles/screen-border.js +14 -4
  204. package/build-module/components/global-styles/screen-border.js.map +1 -1
  205. package/build-module/components/global-styles/screen-button-color.js +17 -11
  206. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  207. package/build-module/components/global-styles/screen-colors.js +56 -27
  208. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  209. package/build-module/components/global-styles/screen-css.js +21 -9
  210. package/build-module/components/global-styles/screen-css.js.map +1 -1
  211. package/build-module/components/global-styles/screen-heading-color.js +24 -18
  212. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  213. package/build-module/components/global-styles/screen-layout.js +8 -3
  214. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  215. package/build-module/components/global-styles/screen-link-color.js +19 -13
  216. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  217. package/build-module/components/global-styles/screen-root.js +23 -9
  218. package/build-module/components/global-styles/screen-root.js.map +1 -1
  219. package/build-module/components/global-styles/screen-style-variations.js +5 -2
  220. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  221. package/build-module/components/global-styles/screen-text-color.js +15 -9
  222. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  223. package/build-module/components/global-styles/screen-typography.js +19 -10
  224. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  225. package/build-module/components/global-styles/screen-variations.js +54 -0
  226. package/build-module/components/global-styles/screen-variations.js.map +1 -0
  227. package/build-module/components/global-styles/shadow-panel.js +177 -0
  228. package/build-module/components/global-styles/shadow-panel.js.map +1 -0
  229. package/build-module/components/global-styles/typography-panel.js +37 -24
  230. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  231. package/build-module/components/global-styles/typography-preview.js +17 -9
  232. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  233. package/build-module/components/global-styles/ui.js +132 -22
  234. package/build-module/components/global-styles/ui.js.map +1 -1
  235. package/build-module/components/global-styles/utils.js +7 -277
  236. package/build-module/components/global-styles/utils.js.map +1 -1
  237. package/build-module/components/global-styles/variations-panel.js +68 -0
  238. package/build-module/components/global-styles/variations-panel.js.map +1 -0
  239. package/build-module/components/global-styles-renderer/index.js +5 -5
  240. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  241. package/build-module/components/header-edit-mode/document-actions/index.js +2 -2
  242. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  243. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  244. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  245. package/build-module/components/layout/index.js +86 -17
  246. package/build-module/components/layout/index.js.map +1 -1
  247. package/build-module/components/list/actions/rename-menu-item.js +9 -12
  248. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  249. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +3 -2
  250. package/build-module/components/navigation-inspector/index.js.map +1 -0
  251. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +13 -16
  252. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -0
  253. package/build-module/components/sidebar/index.js +2 -1
  254. package/build-module/components/sidebar/index.js.map +1 -1
  255. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +6 -21
  256. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  257. package/build-module/components/sidebar-edit-mode/index.js +1 -13
  258. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  259. package/build-module/components/sidebar-navigation-screen/index.js +3 -2
  260. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  261. package/build-module/components/sidebar-navigation-screen-main/index.js +22 -2
  262. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  263. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +23 -0
  264. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  265. package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -9
  266. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  267. package/build-module/components/site-hub/index.js +12 -11
  268. package/build-module/components/site-hub/index.js.map +1 -1
  269. package/build-module/components/site-icon/index.js +1 -1
  270. package/build-module/components/site-icon/index.js.map +1 -1
  271. package/build-module/components/style-book/index.js +8 -5
  272. package/build-module/components/style-book/index.js.map +1 -1
  273. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +43 -0
  274. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
  275. package/build-module/components/template-details/edit-template-title.js +1 -0
  276. package/build-module/components/template-details/edit-template-title.js.map +1 -1
  277. package/build-module/components/template-details/template-part-area-selector.js +1 -0
  278. package/build-module/components/template-details/template-part-area-selector.js.map +1 -1
  279. package/build-module/components/template-part-converter/convert-to-template-part.js +5 -9
  280. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  281. package/build-module/experiments.js +9 -0
  282. package/build-module/experiments.js.map +1 -0
  283. package/build-module/hooks/push-changes-to-global-styles/index.js +65 -6
  284. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  285. package/build-module/index.js +52 -60
  286. package/build-module/index.js.map +1 -1
  287. package/build-module/store/reducer.js +1 -1
  288. package/build-module/store/reducer.js.map +1 -1
  289. package/build-module/store/selectors.js +6 -26
  290. package/build-module/store/selectors.js.map +1 -1
  291. package/build-module/store/utils.js +66 -0
  292. package/build-module/store/utils.js.map +1 -0
  293. package/build-module/utils/template-part-create.js +53 -0
  294. package/build-module/utils/template-part-create.js.map +1 -0
  295. package/build-style/style-rtl.css +448 -278
  296. package/build-style/style.css +448 -278
  297. package/package.json +32 -30
  298. package/src/components/add-new-template/add-custom-generic-template-modal.js +20 -28
  299. package/src/components/add-new-template/add-custom-template-modal.js +0 -1
  300. package/src/components/add-new-template/new-template-part.js +12 -11
  301. package/src/components/add-new-template/style.scss +0 -4
  302. package/src/components/app/index.js +2 -2
  303. package/src/components/block-editor/editor-canvas.js +0 -1
  304. package/src/components/block-editor/index.js +21 -77
  305. package/src/components/block-editor/inserter-media-categories.js +247 -0
  306. package/src/components/block-editor/resize-handle.js +6 -2
  307. package/src/components/block-editor/style.scss +55 -7
  308. package/src/components/canvas-spinner/index.js +12 -0
  309. package/src/components/canvas-spinner/style.scss +7 -0
  310. package/src/components/create-template-part-modal/index.js +75 -67
  311. package/src/components/create-template-part-modal/style.scss +0 -10
  312. package/src/components/editor/index.js +5 -3
  313. package/src/components/error-boundary/index.js +2 -10
  314. package/src/components/error-boundary/warning.js +6 -35
  315. package/src/components/global-styles/README.md +1 -75
  316. package/src/components/global-styles/block-preview-panel.js +16 -4
  317. package/src/components/global-styles/border-panel.js +22 -16
  318. package/src/components/global-styles/color-palette-panel.js +10 -7
  319. package/src/components/global-styles/context-menu.js +117 -41
  320. package/src/components/global-styles/custom-css.js +76 -19
  321. package/src/components/global-styles/dimensions-panel.js +58 -31
  322. package/src/components/global-styles/global-styles-provider.js +6 -2
  323. package/src/components/global-styles/gradients-palette-panel.js +17 -11
  324. package/src/components/global-styles/hooks.js +31 -155
  325. package/src/components/global-styles/index.js +0 -2
  326. package/src/components/global-styles/palette.js +9 -5
  327. package/src/components/global-styles/preview.js +19 -13
  328. package/src/components/global-styles/screen-background-color.js +42 -19
  329. package/src/components/global-styles/screen-block-list.js +6 -1
  330. package/src/components/global-styles/screen-border.js +13 -5
  331. package/src/components/global-styles/screen-button-color.js +21 -19
  332. package/src/components/global-styles/screen-colors.js +66 -22
  333. package/src/components/global-styles/screen-css.js +30 -14
  334. package/src/components/global-styles/screen-heading-color.js +32 -27
  335. package/src/components/global-styles/screen-layout.js +7 -4
  336. package/src/components/global-styles/screen-link-color.js +34 -22
  337. package/src/components/global-styles/screen-root.js +24 -9
  338. package/src/components/global-styles/screen-style-variations.js +7 -2
  339. package/src/components/global-styles/screen-text-color.js +15 -15
  340. package/src/components/global-styles/screen-typography.js +34 -12
  341. package/src/components/global-styles/screen-variations.js +47 -0
  342. package/src/components/global-styles/shadow-panel.js +174 -0
  343. package/src/components/global-styles/style.scss +94 -1
  344. package/src/components/global-styles/typography-panel.js +58 -23
  345. package/src/components/global-styles/typography-preview.js +28 -9
  346. package/src/components/global-styles/ui.js +130 -17
  347. package/src/components/global-styles/utils.js +7 -330
  348. package/src/components/global-styles/variations-panel.js +78 -0
  349. package/src/components/global-styles-renderer/index.js +3 -4
  350. package/src/components/header-edit-mode/document-actions/index.js +1 -1
  351. package/src/components/keyboard-shortcut-help-modal/index.js +0 -1
  352. package/src/components/layout/index.js +116 -21
  353. package/src/components/layout/style.scss +29 -5
  354. package/src/components/list/actions/rename-menu-item.js +14 -23
  355. package/src/components/list/style.scss +0 -4
  356. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +3 -4
  357. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +10 -12
  358. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss +4 -17
  359. package/src/components/sidebar/index.js +2 -0
  360. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +8 -32
  361. package/src/components/sidebar-edit-mode/index.js +0 -11
  362. package/src/components/sidebar-edit-mode/settings-header/style.scss +8 -0
  363. package/src/components/sidebar-navigation-item/style.scss +28 -3
  364. package/src/components/sidebar-navigation-screen/index.js +4 -3
  365. package/src/components/sidebar-navigation-screen/style.scss +2 -0
  366. package/src/components/sidebar-navigation-screen-main/index.js +23 -1
  367. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +25 -0
  368. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +12 -0
  369. package/src/components/sidebar-navigation-screen-templates/index.js +12 -19
  370. package/src/components/site-hub/index.js +120 -109
  371. package/src/components/site-hub/style.scss +7 -1
  372. package/src/components/site-icon/index.js +1 -1
  373. package/src/components/site-icon/style.scss +2 -2
  374. package/src/components/style-book/index.js +10 -5
  375. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +40 -0
  376. package/src/components/template-details/edit-template-title.js +1 -0
  377. package/src/components/template-details/template-part-area-selector.js +1 -0
  378. package/src/components/template-part-converter/convert-to-template-part.js +12 -10
  379. package/src/experiments.js +10 -0
  380. package/src/hooks/push-changes-to-global-styles/index.js +66 -8
  381. package/src/index.js +51 -59
  382. package/src/store/reducer.js +1 -1
  383. package/src/store/selectors.js +6 -26
  384. package/src/store/test/utils.js +181 -0
  385. package/src/store/utils.js +69 -0
  386. package/src/style.scss +4 -2
  387. package/src/utils/template-part-create.js +62 -0
  388. package/src/utils/test/template-part-create.js +63 -0
  389. package/build/components/global-styles/context.js +0 -22
  390. package/build/components/global-styles/context.js.map +0 -1
  391. package/build/components/global-styles/typography-utils.js +0 -92
  392. package/build/components/global-styles/typography-utils.js.map +0 -1
  393. package/build/components/global-styles/use-global-styles-output.js +0 -857
  394. package/build/components/global-styles/use-global-styles-output.js.map +0 -1
  395. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -42
  396. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  397. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  398. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  399. package/build-module/components/global-styles/context.js +0 -12
  400. package/build-module/components/global-styles/context.js.map +0 -1
  401. package/build-module/components/global-styles/typography-utils.js +0 -84
  402. package/build-module/components/global-styles/typography-utils.js.map +0 -1
  403. package/build-module/components/global-styles/use-global-styles-output.js +0 -815
  404. package/build-module/components/global-styles/use-global-styles-output.js.map +0 -1
  405. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -28
  406. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  407. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  408. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  409. package/src/components/global-styles/context.js +0 -15
  410. package/src/components/global-styles/test/typography-utils.js +0 -393
  411. package/src/components/global-styles/test/use-global-styles-output.js +0 -814
  412. package/src/components/global-styles/test/utils.js +0 -206
  413. package/src/components/global-styles/typography-utils.js +0 -87
  414. package/src/components/global-styles/use-global-styles-output.js +0 -936
  415. package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/use-global-styles-output.js"],"names":["get","isEmpty","kebabCase","pickBy","set","__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","getBlockTypes","useSelect","useContext","useMemo","getCSSRules","__unstablePresetDuotoneFilter","PresetDuotoneFilter","__experimentalGetGapCSSValue","getGapCSSValue","store","blockEditorStore","PRESET_METADATA","ROOT_BLOCK_SELECTOR","scopeSelector","getTypographyFontSizeValue","GlobalStylesContext","useSetting","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","flattenTree","input","prefix","token","result","Object","keys","key","newKey","replace","newLeaf","newPrefix","getStylesDeclarations","blockStyles","useRootPaddingAlign","tree","isRoot","output","entries","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","rule","ruleValue","ref","refPath","size","settings","getLayoutStyles","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","blockGap","layout","definitions","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","getNodesWithStyles","blockSelectors","nodes","styles","pickStyleKeys","treeToPickFrom","elements","blocks","blockName","node","duotoneSelector","hasLayoutSupport","featureSelectors","elementName","sel","elementSelectors","elementSelector","getNodesWithSettings","pickPresets","presets","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","featureName","featureSelector","featureStyles","featureDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getBlockSelectors","blockTypes","blockType","supports","__experimentalSelector","__experimentalDuotone","__experimentalLayout","__experimentalDefault","featureKey","undefined","updateConfigWithSeparator","config","needsSeparatorStyleUpdate","background","text","border","useGlobalStylesOutput","merged","mergedConfig","select","getSettings","customProperties","globalStyles","filters","stylesheets","css","isGlobalStyles"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,OAAd,EAAuBC,SAAvB,EAAkCC,MAAlC,EAA0CC,GAA1C,QAAqD,QAArD;AAEA;AACA;AACA;;AACA,SACCC,6BAA6B,IAAIC,cADlC,EAECC,uBAAuB,IAAIC,QAF5B,EAGCC,aAHD,QAIO,mBAJP;AAKA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,OAArB,QAAoC,oBAApC;AACA,SAASC,WAAT,QAA4B,yBAA5B;AACA,SACCC,6BAA6B,IAAIC,mBADlC,EAECC,4BAA4B,IAAIC,cAFjC,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAMA;AACA;AACA;;AACA,SAASC,eAAT,EAA0BC,mBAA1B,EAA+CC,aAA/C,QAAoE,SAApE;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,mBAAT,QAAoC,WAApC;AACA,SAASC,UAAT,QAA2B,SAA3B,C,CAEA;AACA;;AACA,MAAMC,qCAAqC,GAAG;AAC7CC,EAAAA,oBAAoB,EAAE,QADuB;AAE7CC,EAAAA,KAAK,EAAE,OAFsC;AAG7CC,EAAAA,OAAO,EAAE,SAHoC;AAI7CC,EAAAA,UAAU,EAAE;AAJiC,CAA9C;;AAOA,SAASC,iBAAT,CAA4BC,eAA5B,EAA8C;AAAA;;AAC7C,QAAMC,yBAAyB,GAAG,MAAlC;AACA,QAA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GAHoC,CAArC;AAKA,SAAO9I,OAAO,CAAE,MAAM;AAAA;;AACrB,QAAK,mBAAEmL,YAAF,0CAAE,cAAc3D,MAAhB,KAA0B,oBAAE2D,YAAF,2CAAE,eAAcrF,QAAhB,CAA/B,EAA0D;AACzD,aAAO,EAAP;AACA;;AACDqF,IAAAA,YAAY,GAAGR,yBAAyB,CAAEQ,YAAF,CAAxC;AACA,UAAM7D,cAAc,GAAG2C,iBAAiB,CAAEpK,aAAa,EAAf,CAAxC;AACA,UAAMyL,gBAAgB,GAAG3C,kBAAkB,CAC1CwC,YAD0C,EAE1C7D,cAF0C,CAA3C;AAIA,UAAMiE,YAAY,GAAG1C,QAAQ,CAC5BsC,YAD4B,EAE5B7D,cAF4B,EAG5BrB,kBAH4B,EAI5BC,qBAJ4B,EAK5B4C,mBAL4B,CAA7B;AAOA,UAAM0C,OAAO,GAAGxB,YAAY,CAAEmB,YAAF,EAAgB7D,cAAhB,CAA5B;AACA,UAAMmE,WAAW,GAAG,CACnB;AACCC,MAAAA,GAAG,EAAEJ,gBADN;AAECK,MAAAA,cAAc,EAAE;AAFjB,KADmB,EAKnB;AACCD,MAAAA,GAAG,EAAEH,YADN;AAECI,MAAAA,cAAc,EAAE;AAFjB,KALmB,EASnB;AACA;AACCD,MAAAA,GAAG,2BAAEP,YAAY,CAAC3D,MAAb,CAAoBkE,GAAtB,yEAA6B,EADjC;AAECC,MAAAA,cAAc,EAAE;AAFjB,KAVmB,CAApB;AAgBA,WAAO,CAAEF,WAAF,EAAeN,YAAY,CAACrF,QAA5B,EAAsC0F,OAAtC,CAAP;AACA,GAnCa,EAmCX,CACFvF,kBADE,EAEFC,qBAFE,EAGFiF,YAHE,EAIFrC,mBAJE,CAnCW,CAAd;AAyCA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, isEmpty, kebabCase, pickBy, set } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockTypes,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { getCSSRules } from '@wordpress/style-engine';\nimport {\n\t__unstablePresetDuotoneFilter as PresetDuotoneFilter,\n\t__experimentalGetGapCSSValue as getGapCSSValue,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PRESET_METADATA, ROOT_BLOCK_SELECTOR, scopeSelector } from './utils';\nimport { getTypographyFontSizeValue } from './typography-utils';\nimport { GlobalStylesContext } from './context';\nimport { useSetting } from './hooks';\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\nfunction compileStyleValue( uncompiledValue ) {\n\tconst VARIABLE_REFERENCE_PREFIX = 'var:';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\n\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param {Object} blockPresets\n * @param {Object} mergedSettings Merged theme.json settings.\n *\n * @return {Array<Object>} An array of style declarations.\n */\nfunction getPresetsDeclarations( blockPresets = {}, mergedSettings ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {\n\t\t\tconst presetByOrigin = get( blockPresets, path, [] );\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param {string} blockSelector\n * @param {Object} blockPresets\n * @return {string} CSS declarations for the preset classes.\n */\nfunction getPresetsClasses( blockSelector, blockPresets = {} ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, cssVarInfix, classes } ) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = get( blockPresets, path, [] );\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( { slug } ) => {\n\t\t\t\t\t\tclasses.forEach( ( { classSuffix, propertyName } ) => {\n\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\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\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters( blockPresets = {} ) {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata ) => {\n\t\tconst presetByOrigin = get( blockPresets, metadata.path, {} );\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset ) => (\n\t\t\t\t\t<PresetDuotoneFilter\n\t\t\t\t\t\tpreset={ preset }\n\t\t\t\t\t\tkey={ preset.slug }\n\t\t\t\t\t/>\n\t\t\t\t) )\n\t\t\t);\n\t} );\n}\n\nfunction flattenTree( input = {}, prefix, token ) {\n\tlet result = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param {Object} blockStyles Block styles.\n *\n * @param {string} selector The selector these declarations should attach to.\n *\n * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector.\n *\n * @param {Object} tree A theme.json tree containing layout definitions.\n *\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {}\n) {\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries( STYLE_PROPERTY ).reduce(\n\t\t(\n\t\t\tdeclarations,\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = get( blockStyles, pathToValue );\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( !! properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif ( ! get( styleValue, [ prop ], false ) ) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\t\tget( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if ( get( blockStyles, pathToValue, false ) ) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\tget( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule ) => {\n\t\t// Don't output padding properties if padding variables are set.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\tuseRootPaddingAlign &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = rule.value;\n\t\tif ( typeof ruleValue !== 'string' && ruleValue?.ref ) {\n\t\t\tconst refPath = ruleValue.ref.split( '.' );\n\t\t\truleValue = get( tree, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! ruleValue || !! ruleValue?.ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ size: ruleValue },\n\t\t\t\ttree?.settings?.typography\n\t\t\t);\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param {Object} props\n * @param {Object} props.tree A theme.json tree containing layout definitions.\n * @param {Object} props.style A style object containing spacing values.\n * @param {string} props.selector Selector used to group together layout styling rules.\n * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.\n * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.\n * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.\n * @return {string} Generated CSS rules for the layout styles.\n */\nexport function getLayoutStyles( {\n\ttree,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n} ) {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && tree?.settings?.layout?.definitions ) {\n\t\tObject.values( tree.settings.layout.definitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif ( ! hasBlockGapSupport && 'flex' !== name ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\n\t\t\t\t\t\t\t\t\t\t}`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `${ selector } .${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`\n\t\t\t\t\t\t\t\t\t\t: `${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ selector } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif (\n\t\tselector === ROOT_BLOCK_SELECTOR &&\n\t\ttree?.settings?.layout?.definitions\n\t) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( tree.settings.layout.definitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles } ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\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);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `${ selector } .${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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 ruleset;\n}\n\nexport const getNodesWithStyles = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickStyleKeys = ( treeToPickFrom ) =>\n\t\tpickBy( treeToPickFrom, ( value, key ) =>\n\t\t\t[\n\t\t\t\t'border',\n\t\t\t\t'color',\n\t\t\t\t'dimensions',\n\t\t\t\t'spacing',\n\t\t\t\t'typography',\n\t\t\t\t'filter',\n\t\t\t\t'outline',\n\t\t\t\t'shadow',\n\t\t\t].includes( key )\n\t\t);\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( !! styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( !! tree.styles?.elements[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements[ name ],\n\t\t\t\tselector,\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\t\t\tif (\n\t\t\t\t!! blockStyles &&\n\t\t\t\t!! blockSelectors?.[ blockName ]?.selector\n\t\t\t) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( node?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!! value &&\n\t\t\t\t\t\t!! blockSelectors?.[ blockName ] &&\n\t\t\t\t\t\t!! ELEMENTS?.[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ].selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\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.join( ',' ),\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 nodes;\n};\n\nexport const getNodesWithSettings = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom ) => {\n\t\tconst presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = get( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tset( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( ! isEmpty( presets ) || !! custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif ( ! isEmpty( blockPresets ) || !! blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const toCustomProperties = ( tree, blockSelectors ) => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = getPresetsDeclarations( presets, tree?.settings );\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset = ruleset + `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const toStyles = (\n\ttree,\n\tblockSelectors,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tdisableLayoutStyles = false\n) => {\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\n\t/*\n\t * Reset default browser margin on the root body element.\n\t * This is set on the root selector **before** generating the ruleset\n\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t * `margin` in its `spacing` declaration for the `body` element then these\n\t * user-generated values take precedence in the CSS cascade.\n\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t */\n\tlet ruleset = 'body {margin: 0;';\n\n\tif ( contentSize ) {\n\t\truleset += ` --wp--style--global--content-size: ${ contentSize };`;\n\t}\n\n\tif ( wideSize ) {\n\t\truleset += ` --wp--style--global--wide-size: ${ wideSize };`;\n\t}\n\n\tif ( useRootPaddingAlign ) {\n\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*=\"wp-block-\"]:not(.alignfull):not([class*=\"__\"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*=\"wp-block-\"]:not(.alignfull):not([class*=\"__\"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;\n\t}\n\n\truleset += '}';\n\n\tnodesWithStyles.forEach(\n\t\t( {\n\t\t\tselector,\n\t\t\tduotoneSelector,\n\t\t\tstyles,\n\t\t\tfallbackGapValue,\n\t\t\thasLayoutSupport,\n\t\t\tfeatureSelectors,\n\t\t} ) => {\n\t\t\t// Process styles for block support features with custom feature level\n\t\t\t// CSS selectors set.\n\t\t\tif ( featureSelectors ) {\n\t\t\t\tObject.entries( featureSelectors ).forEach(\n\t\t\t\t\t( [ featureName, featureSelector ] ) => {\n\t\t\t\t\t\tif ( styles?.[ featureName ] ) {\n\t\t\t\t\t\t\tconst featureStyles = {\n\t\t\t\t\t\t\t\t[ featureName ]: styles[ featureName ],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations( featureStyles );\n\t\t\t\t\t\t\tdelete styles[ featureName ];\n\n\t\t\t\t\t\t\tif ( !! featureDeclarations.length ) {\n\t\t\t\t\t\t\t\truleset =\n\t\t\t\t\t\t\t\t\truleset +\n\t\t\t\t\t\t\t\t\t`${ featureSelector }{${ featureDeclarations.join(\n\t\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t\t) } }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst duotoneStyles = {};\n\t\t\tif ( styles?.filter ) {\n\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\tdelete styles.filter;\n\t\t\t}\n\n\t\t\t// Process duotone styles (they use color.__experimentalDuotone selector).\n\t\t\tif ( duotoneSelector ) {\n\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\tif ( duotoneDeclarations.length > 0 ) {\n\t\t\t\t\truleset =\n\t\t\t\t\t\truleset +\n\t\t\t\t\t\t`${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process blockGap and layout styles.\n\t\t\tif (\n\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t) {\n\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\ttree,\n\t\t\t\t\tstyle: styles,\n\t\t\t\t\tselector,\n\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\tfallbackGapValue,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\tconst declarations = getStylesDeclarations(\n\t\t\t\tstyles,\n\t\t\t\tselector,\n\t\t\t\tuseRootPaddingAlign,\n\t\t\t\ttree\n\t\t\t);\n\t\t\tif ( declarations?.length ) {\n\t\t\t\truleset =\n\t\t\t\t\truleset + `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t\t}\n\n\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t);\n\n\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `selector` maybe provided in a form\n\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t// string.\n\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\truleset = ruleset + pseudoRule;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\t/* Add alignment / layout styles */\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\n\tif ( hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`.wp-site-blocks > * + * { margin-block-start: ${ gapValue }; }`;\n\t}\n\n\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\tif ( ROOT_BLOCK_SELECTOR === selector ) {\n\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\tselector = '';\n\t\t}\n\n\t\tconst classes = getPresetsClasses( selector, presets );\n\t\tif ( ! isEmpty( classes ) ) {\n\t\t\truleset = ruleset + classes;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport function toSvgFilters( tree, blockSelectors ) {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nexport const getBlockSelectors = ( blockTypes ) => {\n\tconst result = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector =\n\t\t\tblockType?.supports?.__experimentalSelector ??\n\t\t\t'.wp-block-' + name.replace( 'core/', '' ).replace( '/', '-' );\n\t\tconst duotoneSelector =\n\t\t\tblockType?.supports?.color?.__experimentalDuotone ?? null;\n\t\tconst hasLayoutSupport = !! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = {};\n\t\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t\t( [ featureKey, featureName ] ) => {\n\t\t\t\tconst featureSelector =\n\t\t\t\t\tblockType?.supports?.[ featureKey ]?.__experimentalSelector;\n\n\t\t\t\tif ( featureSelector ) {\n\t\t\t\t\tfeatureSelectors[ featureName ] = scopeSelector(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\tfeatureSelector\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param {Object} config Theme.json configuration file object.\n * @return {Object} configTheme.json configuration file object updated.\n */\nfunction updateConfigWithSeparator( config ) {\n\tconst needsSeparatorStyleUpdate =\n\t\tconfig.styles?.blocks[ 'core/separator' ] &&\n\t\tconfig.styles?.blocks[ 'core/separator' ].color?.background &&\n\t\t! config.styles?.blocks[ 'core/separator' ].color?.text &&\n\t\t! config.styles?.blocks[ 'core/separator' ].border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...config.styles.blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ],\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ].color,\n\t\t\t\t\t\t\ttext: config.styles?.blocks[ 'core/separator' ]\n\t\t\t\t\t\t\t\t.color.background,\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\treturn config;\n}\n\nexport function useGlobalStylesOutput() {\n\tlet { merged: mergedConfig } = useContext( GlobalStylesContext );\n\n\tconst [ blockGap ] = useSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.\n\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn !! getSettings().disableLayoutStyles;\n\t} );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tmergedConfig = updateConfigWithSeparator( mergedConfig );\n\t\tconst blockSelectors = getBlockSelectors( getBlockTypes() );\n\t\tconst customProperties = toCustomProperties(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors\n\t\t);\n\t\tconst globalStyles = toStyles(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles\n\t\t);\n\t\tconst filters = toSvgFilters( mergedConfig, blockSelectors );\n\t\tconst stylesheets = [\n\t\t\t{\n\t\t\t\tcss: customProperties,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcss: globalStyles,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t\t{\n\t\t\t\tcss: mergedConfig.styles.css ?? '',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t];\n\n\t\treturn [ stylesheets, mergedConfig.settings, filters ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t] );\n}\n"]}
@@ -1,28 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { FlexBlock, Flex } from '@wordpress/components';
7
- import { __ } from '@wordpress/i18n';
8
- import { navigation } from '@wordpress/icons';
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- import DefaultSidebar from '../default-sidebar';
14
- import NavigationInspector from './navigation-inspector';
15
- export default function NavigationMenuSidebar() {
16
- return createElement(DefaultSidebar, {
17
- className: "edit-site-navigation-menu-sidebar",
18
- identifier: "edit-site/navigation-menu",
19
- title: __('Navigation'),
20
- icon: navigation,
21
- closeLabel: __('Close navigation menu sidebar'),
22
- panelClassName: "edit-site-navigation-menu-sidebar__panel",
23
- header: createElement(Flex, null, createElement(FlexBlock, null, createElement("strong", null, __('Navigation Menus')), createElement("span", {
24
- className: "edit-site-navigation-sidebar__beta"
25
- }, __('Beta'))))
26
- }, createElement(NavigationInspector, null));
27
- }
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js"],"names":["FlexBlock","Flex","__","navigation","DefaultSidebar","NavigationInspector","NavigationMenuSidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,IAApB,QAAgC,uBAAhC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,wBAAhC;AAEA,eAAe,SAASC,qBAAT,GAAiC;AAC/C,SACC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,UAAU,EAAC,2BAFZ;AAGC,IAAA,KAAK,EAAGJ,EAAE,CAAE,YAAF,CAHX;AAIC,IAAA,IAAI,EAAGC,UAJR;AAKC,IAAA,UAAU,EAAGD,EAAE,CAAE,+BAAF,CALhB;AAMC,IAAA,cAAc,EAAC,0CANhB;AAOC,IAAA,MAAM,EACL,cAAC,IAAD,QACC,cAAC,SAAD,QACC,8BAAUA,EAAE,CAAE,kBAAF,CAAZ,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGA,EAAE,CAAE,MAAF,CADL,CAFD,CADD;AARF,KAkBC,cAAC,mBAAD,OAlBD,CADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexBlock, Flex } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from '../default-sidebar';\nimport NavigationInspector from './navigation-inspector';\n\nexport default function NavigationMenuSidebar() {\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-navigation-menu-sidebar\"\n\t\t\tidentifier=\"edit-site/navigation-menu\"\n\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\ticon={ navigation }\n\t\t\tcloseLabel={ __( 'Close navigation menu sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-navigation-menu-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Navigation Menus' ) }</strong>\n\t\t\t\t\t\t<span className=\"edit-site-navigation-sidebar__beta\">\n\t\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<NavigationInspector />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js"],"names":["useSelect","useState","useEffect","SelectControl","store","coreStore","useEntityBlockEditor","blockEditorStore","BlockEditorProvider","speak","useInstanceId","__","NavigationMenu","NAVIGATION_MENUS_QUERY","per_page","status","NavigationInspector","selectedNavigationBlockId","clientIdToRef","navigationMenus","isResolvingNavigationMenus","hasResolvedNavigationMenus","firstNavigationBlockId","select","__experimentalGetActiveBlockIdByBlockNames","__experimentalGetGlobalBlocksByName","getBlock","getEntityRecords","hasFinishedResolution","isResolving","navigationMenusQuery","selectedNavId","navBlockIds","idToRef","forEach","id","attributes","ref","navMenuListId","firstNavRefInTemplate","firstNavigationMenuRef","defaultNavigationMenuId","currentMenuId","setCurrentMenuId","options","map","title","value","label","rendered","innerBlocks","onInput","onChange","isLoadingInnerBlocks","hasLoadedInnerBlocks","isLoading","hasMoreThanOneNavigationMenu","length","hasNavigationMenus","publishedInnerBlocks","hasInnerBlocks","undefined","newMenuId","Number"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,KAAK,IAAIC,SAAlB,EAA6BC,oBAA7B,QAAyD,sBAAzD;AACA,SACCF,KAAK,IAAIG,gBADV,EAECC,mBAFD,QAGO,yBAHP;AAIA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC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L,SAAtB,IACD;AAAG,IAAA,SAAS,EAAC;AAAb,KACG5C,EAAE,CAAE,2BAAF,CADL,CA5CF,CADD;AAmDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport { SelectControl } from '@wordpress/components';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tstore as blockEditorStore,\n\tBlockEditorProvider,\n} from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenu from './navigation-menu';\n\nconst NAVIGATION_MENUS_QUERY = [ { per_page: -1, status: 'publish' } ];\n\nexport default function NavigationInspector() {\n\tconst {\n\t\tselectedNavigationBlockId,\n\t\tclientIdToRef,\n\t\tnavigationMenus,\n\t\tisResolvingNavigationMenus,\n\t\thasResolvedNavigationMenus,\n\t\tfirstNavigationBlockId,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetActiveBlockIdByBlockNames,\n\t\t\t__experimentalGetGlobalBlocksByName,\n\t\t\tgetBlock,\n\t\t} = select( blockEditorStore );\n\n\t\tconst { getEntityRecords, hasFinishedResolution, isResolving } =\n\t\t\tselect( coreStore );\n\n\t\tconst navigationMenusQuery = [\n\t\t\t'postType',\n\t\t\t'wp_navigation',\n\t\t\tNAVIGATION_MENUS_QUERY[ 0 ],\n\t\t];\n\n\t\t// Get the active Navigation block (if present).\n\t\tconst selectedNavId =\n\t\t\t__experimentalGetActiveBlockIdByBlockNames( 'core/navigation' );\n\n\t\t// Get all Navigation blocks currently within the editor canvas.\n\t\tconst navBlockIds =\n\t\t\t__experimentalGetGlobalBlocksByName( 'core/navigation' );\n\t\tconst idToRef = {};\n\t\tnavBlockIds.forEach( ( id ) => {\n\t\t\tidToRef[ id ] = getBlock( id )?.attributes?.ref;\n\t\t} );\n\t\treturn {\n\t\t\tselectedNavigationBlockId: selectedNavId,\n\t\t\tfirstNavigationBlockId: navBlockIds?.[ 0 ],\n\t\t\tclientIdToRef: idToRef,\n\t\t\tnavigationMenus: getEntityRecords( ...navigationMenusQuery ),\n\t\t\tisResolvingNavigationMenus: isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tnavigationMenusQuery\n\t\t\t),\n\t\t\thasResolvedNavigationMenus: hasFinishedResolution(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tnavigationMenusQuery\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst navMenuListId = useInstanceId(\n\t\tNavigationMenu,\n\t\t'edit-site-navigation-inspector-menu'\n\t);\n\n\tconst firstNavRefInTemplate = clientIdToRef[ firstNavigationBlockId ];\n\tconst firstNavigationMenuRef = navigationMenus?.[ 0 ]?.id;\n\n\t// Default Navigation Menu is either:\n\t// - the Navigation Menu referenced by the first Nav block within the template.\n\t// - the first of the available Navigation Menus (`wp_navigation`) posts.\n\tconst defaultNavigationMenuId =\n\t\tfirstNavRefInTemplate || firstNavigationMenuRef;\n\n\t// The Navigation Menu manually selected by the user within the Nav inspector.\n\tconst [ currentMenuId, setCurrentMenuId ] = useState(\n\t\tfirstNavRefInTemplate\n\t);\n\n\t// If a Nav block is selected within the canvas then set the\n\t// Navigation Menu referenced by it's `ref` attribute to be\n\t// active within the Navigation sidebar.\n\tuseEffect( () => {\n\t\tif ( selectedNavigationBlockId ) {\n\t\t\tsetCurrentMenuId( clientIdToRef[ selectedNavigationBlockId ] );\n\t\t}\n\t}, [ selectedNavigationBlockId ] );\n\n\tlet options = [];\n\tif ( navigationMenus ) {\n\t\toptions = navigationMenus.map( ( { id, title } ) => ( {\n\t\t\tvalue: id,\n\t\t\tlabel: title.rendered,\n\t\t} ) );\n\t}\n\n\tconst [ innerBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_navigation',\n\t\t{ id: currentMenuId || defaultNavigationMenuId }\n\t);\n\n\tconst { isLoadingInnerBlocks, hasLoadedInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isResolving, hasFinishedResolution } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tisLoadingInnerBlocks: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_navigation',\n\t\t\t\t\tcurrentMenuId || defaultNavigationMenuId,\n\t\t\t\t] ),\n\t\t\t\thasLoadedInnerBlocks: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t[\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_navigation',\n\t\t\t\t\t\tcurrentMenuId || defaultNavigationMenuId,\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ currentMenuId, defaultNavigationMenuId ]\n\t);\n\n\tconst isLoading = ! ( hasResolvedNavigationMenus && hasLoadedInnerBlocks );\n\n\tconst hasMoreThanOneNavigationMenu = navigationMenus?.length > 1;\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\t// Entity block editor will return entities that are not currently published.\n\t// Guard by only allowing their usage if there are published Nav Menus.\n\tconst publishedInnerBlocks = hasNavigationMenus ? innerBlocks : [];\n\n\tconst hasInnerBlocks = !! publishedInnerBlocks?.length;\n\n\tuseEffect( () => {\n\t\tif ( isResolvingNavigationMenus ) {\n\t\t\tspeak( 'Loading Navigation sidebar menus.' );\n\t\t}\n\n\t\tif ( hasResolvedNavigationMenus ) {\n\t\t\tspeak( 'Navigation sidebar menus have loaded.' );\n\t\t}\n\t}, [ isResolvingNavigationMenus, hasResolvedNavigationMenus ] );\n\n\tuseEffect( () => {\n\t\tif ( isLoadingInnerBlocks ) {\n\t\t\tspeak( 'Loading Navigation sidebar selected menu items.' );\n\t\t}\n\n\t\tif ( hasLoadedInnerBlocks ) {\n\t\t\tspeak( 'Navigation sidebar selected menu items have loaded.' );\n\t\t}\n\t}, [ isLoadingInnerBlocks, hasLoadedInnerBlocks ] );\n\n\treturn (\n\t\t<div className=\"edit-site-navigation-inspector\">\n\t\t\t{ hasResolvedNavigationMenus && ! hasNavigationMenus && (\n\t\t\t\t<p className=\"edit-site-navigation-inspector__empty-msg\">\n\t\t\t\t\t{ __( 'There are no Navigation Menus.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t{ ! hasResolvedNavigationMenus && (\n\t\t\t\t<div className=\"edit-site-navigation-inspector__placeholder\" />\n\t\t\t) }\n\t\t\t{ hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (\n\t\t\t\t<SelectControl\n\t\t\t\t\taria-controls={\n\t\t\t\t\t\t// aria-controls should only apply when referenced element is in DOM\n\t\t\t\t\t\thasLoadedInnerBlocks ? navMenuListId : undefined\n\t\t\t\t\t}\n\t\t\t\t\tvalue={ currentMenuId || defaultNavigationMenuId }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( newMenuId ) =>\n\t\t\t\t\t\tsetCurrentMenuId( Number( newMenuId ) )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isLoading && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"edit-site-navigation-inspector__placeholder is-child\" />\n\t\t\t\t\t<div className=\"edit-site-navigation-inspector__placeholder is-child\" />\n\t\t\t\t\t<div className=\"edit-site-navigation-inspector__placeholder is-child\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ hasInnerBlocks && ! isLoading && (\n\t\t\t\t<BlockEditorProvider\n\t\t\t\t\tvalue={ publishedInnerBlocks }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tonInput={ onInput }\n\t\t\t\t>\n\t\t\t\t\t<NavigationMenu\n\t\t\t\t\t\tid={ navMenuListId }\n\t\t\t\t\t\tinnerBlocks={ publishedInnerBlocks }\n\t\t\t\t\t/>\n\t\t\t\t</BlockEditorProvider>\n\t\t\t) }\n\n\t\t\t{ ! hasInnerBlocks && ! isLoading && (\n\t\t\t\t<p className=\"edit-site-navigation-inspector__empty-msg\">\n\t\t\t\t\t{ __( 'Navigation Menu is empty.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js"],"names":["__experimentalListView","ListView","__experimentalOffCanvasEditor","OffCanvasEditor","store","blockEditorStore","useEffect","useDispatch","ALLOWED_BLOCKS","NavigationMenu","innerBlocks","id","updateBlockListSettings","allowedBlocks","forEach","block","name","clientId","window","__experimentalEnableOffCanvasNavigationEditor"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,sBAAsB,IAAIC,QAD3B,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA,MAAMC,cAAc,GAAG;AACtB,qBAAmB,CAClB,sBADkB,EAElB,aAFkB,EAGlB,mBAHkB,EAIlB,gBAJkB,EAKlB,aALkB,EAMlB,gBANkB,EAOlB,iBAPkB,EAQlB,gBARkB,EASlB,yBATkB,CADG;AAYtB,uBAAqB,CAAE,kBAAF,CAZC;AAatB,6BAA2B,CAC1B,sBAD0B,EAE1B,yBAF0B,CAbL;AAiBtB,0BAAwB,CACvB,sBADuB,EAEvB,yBAFuB;AAjBF,CAAvB;AAuBA,eAAe,SAASC,cAAT,OAA+C;AAAA;;AAAA,MAAtB;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,GAAsB;AAC7D,QAAM;AAAEC,IAAAA;AAAF,MAA8BL,WAAW,CAAEF,gBAAF,CAA/C,CAD6D,CAG7D;AACA;;AACAC,EAAAA,SAAS,CAAE,MAAM;AAChBM,IAAAA,uBAAuB,CAAE,EAAF,EAAM;AAC5BC,MAAAA,aAAa,EAAEL,cAAc,CAAE,iBAAF;AADD,KAAN,CAAvB;AAGAE,IAAAA,WAAW,CAACI,OAAZ,CAAuBC,KAAF,IAAa;AACjC,UAAKP,cAAc,CAAEO,KAAK,CAACC,IAAR,CAAnB,EAAoC;AACnCJ,QAAAA,uBAAuB,CAAEG,KAAK,CAACE,QAAR,EAAkB;AACxCJ,UAAAA,aAAa,EAAEL,cAAc,CAAEO,KAAK,CAACC,IAAR;AADW,SAAlB,CAAvB;AAGA;AACD,KAND;AAOA,GAXQ,EAWN,CAAEJ,uBAAF,EAA2BF,WAA3B,CAXM,CAAT;;AAaA,iBAAKQ,MAAL,oCAAK,QAAQC,6CAAb,EAA6D;AAC5D,WACC,cAAC,eAAD;AACC,MAAA,MAAM,EAAGT,WADV;AAEC,MAAA,mBAAmB,EAAG;AAFvB,MADD;AAMA;;AACD,SAAO,cAAC,QAAD;AAAU,IAAA,EAAE,EAAGC;AAAf,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalListView as ListView,\n\t__experimentalOffCanvasEditor as OffCanvasEditor,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\n\nconst ALLOWED_BLOCKS = {\n\t'core/navigation': [\n\t\t'core/navigation-link',\n\t\t'core/search',\n\t\t'core/social-links',\n\t\t'core/page-list',\n\t\t'core/spacer',\n\t\t'core/home-link',\n\t\t'core/site-title',\n\t\t'core/site-logo',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/social-links': [ 'core/social-link' ],\n\t'core/navigation-submenu': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n\t'core/navigation-link': [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t],\n};\n\nexport default function NavigationMenu( { innerBlocks, id } ) {\n\tconst { updateBlockListSettings } = useDispatch( blockEditorStore );\n\n\t//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList\n\t//Think through a better way of doing this, possible with adding allowed blocks to block library metadata\n\tuseEffect( () => {\n\t\tupdateBlockListSettings( '', {\n\t\t\tallowedBlocks: ALLOWED_BLOCKS[ 'core/navigation' ],\n\t\t} );\n\t\tinnerBlocks.forEach( ( block ) => {\n\t\t\tif ( ALLOWED_BLOCKS[ block.name ] ) {\n\t\t\t\tupdateBlockListSettings( block.clientId, {\n\t\t\t\t\tallowedBlocks: ALLOWED_BLOCKS[ block.name ],\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}, [ updateBlockListSettings, innerBlocks ] );\n\n\tif ( window?.__experimentalEnableOffCanvasNavigationEditor ) {\n\t\treturn (\n\t\t\t<OffCanvasEditor\n\t\t\t\tblocks={ innerBlocks }\n\t\t\t\tselectBlockInCanvas={ false }\n\t\t\t/>\n\t\t);\n\t}\n\treturn <ListView id={ id } />;\n}\n"]}
@@ -1,15 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createContext } from '@wordpress/element';
5
-
6
- export const DEFAULT_GLOBAL_STYLES_CONTEXT = {
7
- user: {},
8
- base: {},
9
- merged: {},
10
- setUserConfig: () => {},
11
- };
12
-
13
- export const GlobalStylesContext = createContext(
14
- DEFAULT_GLOBAL_STYLES_CONTEXT
15
- );
@@ -1,393 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { getTypographyFontSizeValue } from '../typography-utils';
5
-
6
- describe( 'typography utils', () => {
7
- describe( 'getTypographyFontSizeValue', () => {
8
- [
9
- {
10
- message:
11
- 'should return value when fluid typography is not active',
12
- preset: {
13
- size: '28px',
14
- },
15
- typographySettings: undefined,
16
- expected: '28px',
17
- },
18
-
19
- {
20
- message: 'should return value where font size is 0',
21
- preset: {
22
- size: 0,
23
- },
24
- typographySettings: undefined,
25
- expected: 0,
26
- },
27
-
28
- {
29
- message: "should return value where font size is '0'",
30
- preset: {
31
- size: '0',
32
- },
33
- typographySettings: undefined,
34
- expected: '0',
35
- },
36
-
37
- {
38
- message: 'should return value where `size` is `null`.',
39
- preset: {
40
- size: null,
41
- },
42
- typographySettings: null,
43
- expected: null,
44
- },
45
-
46
- {
47
- message: 'should return value when fluid is `false`',
48
- preset: {
49
- size: '28px',
50
- fluid: false,
51
- },
52
- typographySettings: {
53
- fluid: true,
54
- },
55
- expected: '28px',
56
- },
57
-
58
- {
59
- message: 'should return already clamped value',
60
- preset: {
61
- size: 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
62
- fluid: false,
63
- },
64
- typographySettings: {
65
- fluid: true,
66
- },
67
- expected:
68
- 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
69
- },
70
-
71
- {
72
- message: 'should return value with unsupported unit',
73
- preset: {
74
- size: '1000%',
75
- fluid: false,
76
- },
77
- typographySettings: {
78
- fluid: true,
79
- },
80
- expected: '1000%',
81
- },
82
-
83
- {
84
- message: 'should return clamp value with rem min and max units',
85
- preset: {
86
- size: '1.75rem',
87
- },
88
- typographySettings: {
89
- fluid: true,
90
- },
91
- expected:
92
- 'clamp(1.313rem, 1.313rem + ((1vw - 0.48rem) * 0.84), 1.75rem)',
93
- },
94
-
95
- {
96
- message: 'should return clamp value with eem min and max units',
97
- preset: {
98
- size: '1.75em',
99
- },
100
- typographySettings: {
101
- fluid: true,
102
- },
103
- expected:
104
- 'clamp(1.313em, 1.313rem + ((1vw - 0.48em) * 0.84), 1.75em)',
105
- },
106
-
107
- {
108
- message: 'should return clamp value for floats',
109
- preset: {
110
- size: '100.175px',
111
- },
112
- typographySettings: {
113
- fluid: true,
114
- },
115
- expected:
116
- 'clamp(75.131px, 4.696rem + ((1vw - 7.68px) * 3.01), 100.175px)',
117
- },
118
-
119
- {
120
- message:
121
- 'should coerce integer to `px` and returns clamp value',
122
- preset: {
123
- size: 33,
124
- fluid: true,
125
- },
126
- typographySettings: {
127
- fluid: true,
128
- },
129
- expected:
130
- 'clamp(24.75px, 1.547rem + ((1vw - 7.68px) * 0.992), 33px)',
131
- },
132
-
133
- {
134
- message: 'should coerce float to `px` and returns clamp value',
135
- preset: {
136
- size: 100.23,
137
- fluid: true,
138
- },
139
- typographySettings: {
140
- fluid: true,
141
- },
142
- expected:
143
- 'clamp(75.173px, 4.698rem + ((1vw - 7.68px) * 3.012), 100.23px)',
144
- },
145
-
146
- {
147
- message:
148
- 'should return clamp value when `fluid` is empty array',
149
- preset: {
150
- size: '28px',
151
- fluid: [],
152
- },
153
- typographySettings: {
154
- fluid: true,
155
- },
156
- expected:
157
- 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 0.841), 28px)',
158
- },
159
-
160
- {
161
- message: 'should return clamp value when `fluid` is `null`',
162
- preset: {
163
- size: '28px',
164
- fluid: null,
165
- },
166
- typographySettings: {
167
- fluid: true,
168
- },
169
- expected:
170
- 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 0.841), 28px)',
171
- },
172
-
173
- {
174
- message:
175
- 'should return clamp value if min font size is greater than max',
176
- preset: {
177
- size: '3rem',
178
- fluid: {
179
- min: '5rem',
180
- max: '32px',
181
- },
182
- },
183
- typographySettings: {
184
- fluid: true,
185
- },
186
- expected:
187
- 'clamp(5rem, 5rem + ((1vw - 0.48rem) * -5.769), 32px)',
188
- },
189
-
190
- {
191
- message: 'should return value with invalid min/max fluid units',
192
- preset: {
193
- size: '10em',
194
- fluid: {
195
- min: '20vw',
196
- max: '50%',
197
- },
198
- },
199
- typographySettings: {
200
- fluid: true,
201
- },
202
- expected: '10em',
203
- },
204
-
205
- {
206
- message:
207
- 'should return value when size is < lower bounds and no fluid min/max set',
208
- preset: {
209
- size: '3px',
210
- },
211
- typographySettings: {
212
- fluid: true,
213
- },
214
- expected: '3px',
215
- },
216
-
217
- {
218
- message:
219
- 'should return value when size is equal to lower bounds and no fluid min/max set',
220
- preset: {
221
- size: '14px',
222
- },
223
- typographySettings: {
224
- fluid: true,
225
- },
226
- expected: '14px',
227
- },
228
-
229
- {
230
- message:
231
- 'should return clamp value with different min max units',
232
- preset: {
233
- size: '28px',
234
- fluid: {
235
- min: '20px',
236
- max: '50rem',
237
- },
238
- },
239
- typographySettings: {
240
- fluid: true,
241
- },
242
- expected:
243
- 'clamp(20px, 1.25rem + ((1vw - 7.68px) * 93.75), 50rem)',
244
- },
245
-
246
- {
247
- message:
248
- 'should return clamp value where no fluid max size is set',
249
- preset: {
250
- size: '28px',
251
- fluid: {
252
- min: '2.6rem',
253
- },
254
- },
255
- typographySettings: {
256
- fluid: true,
257
- },
258
- expected:
259
- 'clamp(2.6rem, 2.6rem + ((1vw - 0.48rem) * -1.635), 28px)',
260
- },
261
-
262
- {
263
- message:
264
- 'should return clamp value where no fluid min size is set',
265
- preset: {
266
- size: '28px',
267
- fluid: {
268
- max: '80px',
269
- },
270
- },
271
- typographySettings: {
272
- fluid: true,
273
- },
274
- expected:
275
- 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 7.091), 80px)',
276
- },
277
-
278
- {
279
- message:
280
- 'should not apply lower bound test when fluid values are set',
281
- preset: {
282
- size: '1.5rem',
283
- fluid: {
284
- min: '0.5rem',
285
- max: '5rem',
286
- },
287
- },
288
- typographySettings: {
289
- fluid: true,
290
- },
291
- expected:
292
- 'clamp(0.5rem, 0.5rem + ((1vw - 0.48rem) * 8.654), 5rem)',
293
- },
294
-
295
- {
296
- message:
297
- 'should not apply lower bound test when only fluid min is set',
298
- preset: {
299
- size: '20px',
300
- fluid: {
301
- min: '12px',
302
- },
303
- },
304
- typographySettings: {
305
- fluid: true,
306
- },
307
- expected:
308
- 'clamp(12px, 0.75rem + ((1vw - 7.68px) * 0.962), 20px)',
309
- },
310
-
311
- {
312
- message:
313
- 'should not apply lower bound test when only fluid max is set',
314
- preset: {
315
- size: '0.875rem',
316
- fluid: {
317
- max: '20rem',
318
- },
319
- },
320
- typographySettings: {
321
- fluid: true,
322
- },
323
- expected:
324
- 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 36.779), 20rem)',
325
- },
326
-
327
- {
328
- message:
329
- 'should return clamp value when min and max font sizes are equal',
330
- preset: {
331
- size: '4rem',
332
- fluid: {
333
- min: '30px',
334
- max: '30px',
335
- },
336
- },
337
- typographySettings: {
338
- fluid: true,
339
- },
340
- expected: 'clamp(30px, 1.875rem + ((1vw - 7.68px) * 1), 30px)',
341
- },
342
-
343
- {
344
- message:
345
- 'should use default min font size value where min font size unit in fluid config is not supported',
346
- preset: {
347
- size: '15px',
348
- },
349
- typographySettings: {
350
- fluid: {
351
- minFontSize: '16%',
352
- },
353
- },
354
- expected:
355
- 'clamp(14px, 0.875rem + ((1vw - 7.68px) * 0.12), 15px)',
356
- },
357
-
358
- // Equivalent custom config PHP unit tests in `test_should_covert_font_sizes_to_fluid_values()`.
359
- {
360
- message: 'should return clamp value using custom fluid config',
361
- preset: {
362
- size: '17px',
363
- },
364
- typographySettings: {
365
- fluid: {
366
- minFontSize: '16px',
367
- },
368
- },
369
- expected: 'clamp(16px, 1rem + ((1vw - 7.68px) * 0.12), 17px)',
370
- },
371
-
372
- {
373
- message:
374
- 'should return value when font size <= custom min font size bound',
375
- preset: {
376
- size: '15px',
377
- },
378
- typographySettings: {
379
- fluid: {
380
- minFontSize: '16px',
381
- },
382
- },
383
- expected: '15px',
384
- },
385
- ].forEach( ( { message, preset, typographySettings, expected } ) => {
386
- it( `${ message }`, () => {
387
- expect(
388
- getTypographyFontSizeValue( preset, typographySettings )
389
- ).toBe( expected );
390
- } );
391
- } );
392
- } );
393
- } );