@wordpress/edit-site 5.30.0 → 5.32.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 (470) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-editor/editor-canvas.js +24 -4
  3. package/build/components/block-editor/editor-canvas.js.map +1 -1
  4. package/build/components/block-editor/site-editor-canvas.js +15 -4
  5. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  6. package/build/components/block-editor/use-site-editor-settings.js +1 -1
  7. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  8. package/build/components/editor/index.js +12 -3
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/editor-canvas-container/index.js +1 -2
  11. package/build/components/editor-canvas-container/index.js.map +1 -1
  12. package/build/components/global-styles/background-panel.js +38 -0
  13. package/build/components/global-styles/background-panel.js.map +1 -0
  14. package/build/components/global-styles/color-palette-panel.js +0 -9
  15. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  16. package/build/components/global-styles/font-families.js +1 -1
  17. package/build/components/global-styles/font-families.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/context.js +53 -17
  19. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-collection.js +4 -3
  21. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +3 -2
  23. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  27. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/utils/index.js +22 -4
  29. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  31. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  32. package/build/components/global-styles/header.js +1 -1
  33. package/build/components/global-styles/header.js.map +1 -1
  34. package/build/components/global-styles/hooks.js +50 -1
  35. package/build/components/global-styles/hooks.js.map +1 -1
  36. package/build/components/global-styles/palette.js +3 -1
  37. package/build/components/global-styles/palette.js.map +1 -1
  38. package/build/components/global-styles/preview-colors.js +2 -2
  39. package/build/components/global-styles/preview-colors.js.map +1 -1
  40. package/build/components/global-styles/preview-iframe.js +0 -1
  41. package/build/components/global-styles/preview-iframe.js.map +1 -1
  42. package/build/components/global-styles/preview-styles.js +2 -2
  43. package/build/components/global-styles/preview-styles.js.map +1 -1
  44. package/build/components/global-styles/root-menu.js +8 -2
  45. package/build/components/global-styles/root-menu.js.map +1 -1
  46. package/build/components/global-styles/screen-background.js +34 -0
  47. package/build/components/global-styles/screen-background.js.map +1 -0
  48. package/build/components/global-styles/screen-color-palette.js +2 -2
  49. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  50. package/build/components/global-styles/screen-colors.js +5 -10
  51. package/build/components/global-styles/screen-colors.js.map +1 -1
  52. package/build/components/global-styles/screen-style-variations.js +3 -37
  53. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  54. package/build/components/global-styles/screen-typography.js +6 -11
  55. package/build/components/global-styles/screen-typography.js.map +1 -1
  56. package/build/components/global-styles/style-variations-container.js +5 -2
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-elements.js +3 -1
  59. package/build/components/global-styles/typography-elements.js.map +1 -1
  60. package/build/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  61. package/build/components/global-styles/typography-example.js.map +1 -0
  62. package/build/components/global-styles/typography-preview.js +3 -1
  63. package/build/components/global-styles/typography-preview.js.map +1 -1
  64. package/build/components/global-styles/ui.js +4 -1
  65. package/build/components/global-styles/ui.js.map +1 -1
  66. package/build/components/global-styles/utils.js +1 -1
  67. package/build/components/global-styles/utils.js.map +1 -1
  68. package/build/components/global-styles/variations/variations-color.js +13 -7
  69. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  70. package/build/components/global-styles/variations/variations-typography.js +34 -37
  71. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  72. package/build/components/header-edit-mode/index.js +2 -1
  73. package/build/components/header-edit-mode/index.js.map +1 -1
  74. package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
  75. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  76. package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
  77. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  78. package/build/components/keyboard-shortcuts/global.js +17 -3
  79. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  80. package/build/components/layout/animation.js +129 -0
  81. package/build/components/layout/animation.js.map +1 -0
  82. package/build/components/layout/index.js +9 -17
  83. package/build/components/layout/index.js.map +1 -1
  84. package/build/components/layout/router.js +22 -22
  85. package/build/components/layout/router.js.map +1 -1
  86. package/build/components/page-pages/index.js +24 -27
  87. package/build/components/page-pages/index.js.map +1 -1
  88. package/build/components/page-patterns/delete-category-menu-item.js +6 -1
  89. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  90. package/build/components/page-patterns/index.js +19 -32
  91. package/build/components/page-patterns/index.js.map +1 -1
  92. package/build/components/page-patterns/search-items.js +16 -58
  93. package/build/components/page-patterns/search-items.js.map +1 -1
  94. package/build/components/page-patterns/use-patterns.js +9 -9
  95. package/build/components/page-patterns/use-patterns.js.map +1 -1
  96. package/build/components/page-templates-template-parts/actions.js +54 -41
  97. package/build/components/page-templates-template-parts/actions.js.map +1 -1
  98. package/build/components/page-templates-template-parts/index.js +31 -69
  99. package/build/components/page-templates-template-parts/index.js.map +1 -1
  100. package/build/components/plugin-template-setting-panel/index.js +12 -1
  101. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  102. package/build/components/save-button/index.js +45 -16
  103. package/build/components/save-button/index.js.map +1 -1
  104. package/build/components/save-hub/index.js +8 -112
  105. package/build/components/save-hub/index.js.map +1 -1
  106. package/build/components/save-panel/index.js +14 -9
  107. package/build/components/save-panel/index.js.map +1 -1
  108. package/build/components/sidebar/index.js +3 -8
  109. package/build/components/sidebar/index.js.map +1 -1
  110. package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  111. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  112. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  113. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  114. package/build/components/sidebar-dataviews/default-views.js +3 -3
  115. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  116. package/build/components/sidebar-dataviews/index.js +5 -4
  117. package/build/components/sidebar-dataviews/index.js.map +1 -1
  118. package/build/components/sidebar-edit-mode/index.js +1 -2
  119. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  120. package/build/components/sidebar-edit-mode/page-panels/index.js +7 -17
  121. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  122. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  123. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  124. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
  125. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  126. package/build/components/sidebar-edit-mode/template-panel/index.js +32 -18
  127. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  129. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -1
  131. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
  133. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  134. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  135. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
  139. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-template/index.js +5 -1
  141. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  143. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  144. package/build/components/style-book/index.js +1 -1
  145. package/build/components/style-book/index.js.map +1 -1
  146. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  147. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  148. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  149. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  150. package/build/components/template-actions/index.js +44 -27
  151. package/build/components/template-actions/index.js.map +1 -1
  152. package/build/components/welcome-guide/editor.js +11 -2
  153. package/build/components/welcome-guide/editor.js.map +1 -1
  154. package/build/hooks/index.js +0 -1
  155. package/build/hooks/index.js.map +1 -1
  156. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  157. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  158. package/build/store/selectors.js +1 -9
  159. package/build/store/selectors.js.map +1 -1
  160. package/build/utils/constants.js +5 -3
  161. package/build/utils/constants.js.map +1 -1
  162. package/build/utils/get-is-list-page.js +1 -1
  163. package/build/utils/get-is-list-page.js.map +1 -1
  164. package/build/utils/math.js +98 -0
  165. package/build/utils/math.js.map +1 -0
  166. package/build-module/components/block-editor/editor-canvas.js +24 -4
  167. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  168. package/build-module/components/block-editor/site-editor-canvas.js +15 -4
  169. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  170. package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
  171. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  172. package/build-module/components/editor/index.js +13 -4
  173. package/build-module/components/editor/index.js.map +1 -1
  174. package/build-module/components/editor-canvas-container/index.js +1 -2
  175. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  176. package/build-module/components/global-styles/background-panel.js +31 -0
  177. package/build-module/components/global-styles/background-panel.js.map +1 -0
  178. package/build-module/components/global-styles/color-palette-panel.js +0 -8
  179. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  180. package/build-module/components/global-styles/font-families.js +1 -1
  181. package/build-module/components/global-styles/font-families.js.map +1 -1
  182. package/build-module/components/global-styles/font-library-modal/context.js +54 -18
  183. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  184. package/build-module/components/global-styles/font-library-modal/font-collection.js +4 -3
  185. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  186. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +4 -3
  187. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  188. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  189. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  190. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  191. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  192. package/build-module/components/global-styles/font-library-modal/utils/index.js +22 -4
  193. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  194. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  195. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  196. package/build-module/components/global-styles/header.js +1 -1
  197. package/build-module/components/global-styles/header.js.map +1 -1
  198. package/build-module/components/global-styles/hooks.js +48 -1
  199. package/build-module/components/global-styles/hooks.js.map +1 -1
  200. package/build-module/components/global-styles/palette.js +3 -1
  201. package/build-module/components/global-styles/palette.js.map +1 -1
  202. package/build-module/components/global-styles/preview-colors.js +2 -2
  203. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  204. package/build-module/components/global-styles/preview-iframe.js +0 -1
  205. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  206. package/build-module/components/global-styles/preview-styles.js +2 -2
  207. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  208. package/build-module/components/global-styles/root-menu.js +9 -3
  209. package/build-module/components/global-styles/root-menu.js.map +1 -1
  210. package/build-module/components/global-styles/screen-background.js +26 -0
  211. package/build-module/components/global-styles/screen-background.js.map +1 -0
  212. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  213. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  214. package/build-module/components/global-styles/screen-colors.js +5 -10
  215. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  216. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  217. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  218. package/build-module/components/global-styles/screen-typography.js +6 -11
  219. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  220. package/build-module/components/global-styles/style-variations-container.js +5 -2
  221. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  222. package/build-module/components/global-styles/typography-elements.js +3 -1
  223. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  224. package/build-module/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  225. package/build-module/components/global-styles/typography-example.js.map +1 -0
  226. package/build-module/components/global-styles/typography-preview.js +3 -1
  227. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  228. package/build-module/components/global-styles/ui.js +4 -1
  229. package/build-module/components/global-styles/ui.js.map +1 -1
  230. package/build-module/components/global-styles/utils.js +1 -1
  231. package/build-module/components/global-styles/utils.js.map +1 -1
  232. package/build-module/components/global-styles/variations/variations-color.js +13 -7
  233. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  234. package/build-module/components/global-styles/variations/variations-typography.js +35 -38
  235. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  236. package/build-module/components/header-edit-mode/index.js +2 -1
  237. package/build-module/components/header-edit-mode/index.js.map +1 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
  239. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
  241. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  242. package/build-module/components/keyboard-shortcuts/global.js +17 -3
  243. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  244. package/build-module/components/layout/animation.js +122 -0
  245. package/build-module/components/layout/animation.js.map +1 -0
  246. package/build-module/components/layout/index.js +9 -17
  247. package/build-module/components/layout/index.js.map +1 -1
  248. package/build-module/components/layout/router.js +22 -22
  249. package/build-module/components/layout/router.js.map +1 -1
  250. package/build-module/components/page-pages/index.js +25 -28
  251. package/build-module/components/page-pages/index.js.map +1 -1
  252. package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
  253. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  254. package/build-module/components/page-patterns/index.js +21 -34
  255. package/build-module/components/page-patterns/index.js.map +1 -1
  256. package/build-module/components/page-patterns/search-items.js +14 -55
  257. package/build-module/components/page-patterns/search-items.js.map +1 -1
  258. package/build-module/components/page-patterns/use-patterns.js +9 -9
  259. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  260. package/build-module/components/page-templates-template-parts/actions.js +54 -40
  261. package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
  262. package/build-module/components/page-templates-template-parts/index.js +34 -72
  263. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  264. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  265. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  266. package/build-module/components/save-button/index.js +46 -17
  267. package/build-module/components/save-button/index.js.map +1 -1
  268. package/build-module/components/save-hub/index.js +10 -114
  269. package/build-module/components/save-hub/index.js.map +1 -1
  270. package/build-module/components/save-panel/index.js +14 -9
  271. package/build-module/components/save-panel/index.js.map +1 -1
  272. package/build-module/components/sidebar/index.js +3 -8
  273. package/build-module/components/sidebar/index.js.map +1 -1
  274. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  275. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  276. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  277. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  278. package/build-module/components/sidebar-dataviews/default-views.js +4 -4
  279. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  280. package/build-module/components/sidebar-dataviews/index.js +5 -4
  281. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  282. package/build-module/components/sidebar-edit-mode/index.js +1 -2
  283. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  284. package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -20
  285. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  286. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  287. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  288. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
  289. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  290. package/build-module/components/sidebar-edit-mode/template-panel/index.js +33 -19
  291. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  293. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -2
  295. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
  297. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  298. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  299. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  300. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  301. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
  303. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  304. package/build-module/components/sidebar-navigation-screen-template/index.js +5 -1
  305. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  306. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  307. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  308. package/build-module/components/style-book/index.js +1 -1
  309. package/build-module/components/style-book/index.js.map +1 -1
  310. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  311. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  312. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  313. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  314. package/build-module/components/template-actions/index.js +44 -27
  315. package/build-module/components/template-actions/index.js.map +1 -1
  316. package/build-module/components/welcome-guide/editor.js +11 -2
  317. package/build-module/components/welcome-guide/editor.js.map +1 -1
  318. package/build-module/hooks/index.js +0 -1
  319. package/build-module/hooks/index.js.map +1 -1
  320. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  321. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  322. package/build-module/store/selectors.js +1 -9
  323. package/build-module/store/selectors.js.map +1 -1
  324. package/build-module/utils/constants.js +4 -2
  325. package/build-module/utils/constants.js.map +1 -1
  326. package/build-module/utils/get-is-list-page.js +1 -1
  327. package/build-module/utils/get-is-list-page.js.map +1 -1
  328. package/build-module/utils/math.js +92 -0
  329. package/build-module/utils/math.js.map +1 -0
  330. package/build-style/style-rtl.css +146 -130
  331. package/build-style/style.css +146 -130
  332. package/package.json +44 -44
  333. package/src/components/block-editor/editor-canvas.js +34 -9
  334. package/src/components/block-editor/site-editor-canvas.js +10 -7
  335. package/src/components/block-editor/use-site-editor-settings.js +0 -2
  336. package/src/components/editor/index.js +11 -4
  337. package/src/components/editor-canvas-container/index.js +0 -1
  338. package/src/components/global-styles/background-panel.js +34 -0
  339. package/src/components/global-styles/color-palette-panel.js +0 -11
  340. package/src/components/global-styles/font-families.js +1 -1
  341. package/src/components/global-styles/font-library-modal/context.js +77 -31
  342. package/src/components/global-styles/font-library-modal/font-collection.js +4 -3
  343. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
  344. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  345. package/src/components/global-styles/font-library-modal/style.scss +15 -6
  346. package/src/components/global-styles/font-library-modal/upload-fonts.js +53 -8
  347. package/src/components/global-styles/font-library-modal/utils/index.js +21 -8
  348. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +4 -0
  349. package/src/components/global-styles/header.js +1 -1
  350. package/src/components/global-styles/hooks.js +68 -1
  351. package/src/components/global-styles/palette.js +3 -1
  352. package/src/components/global-styles/preview-colors.js +2 -2
  353. package/src/components/global-styles/preview-iframe.js +0 -1
  354. package/src/components/global-styles/preview-styles.js +2 -2
  355. package/src/components/global-styles/root-menu.js +12 -1
  356. package/src/components/global-styles/screen-background.js +29 -0
  357. package/src/components/global-styles/screen-color-palette.js +2 -2
  358. package/src/components/global-styles/screen-colors.js +4 -15
  359. package/src/components/global-styles/screen-style-variations.js +4 -36
  360. package/src/components/global-styles/screen-typography.js +6 -20
  361. package/src/components/global-styles/style-variations-container.js +2 -1
  362. package/src/components/global-styles/style.scss +15 -10
  363. package/src/components/global-styles/typography-elements.js +5 -1
  364. package/src/components/global-styles/{preview-typography.js → typography-example.js} +3 -1
  365. package/src/components/global-styles/typography-preview.js +3 -1
  366. package/src/components/global-styles/ui.js +5 -0
  367. package/src/components/global-styles/utils.js +1 -1
  368. package/src/components/global-styles/variations/style.scss +32 -23
  369. package/src/components/global-styles/variations/variations-color.js +12 -6
  370. package/src/components/global-styles/variations/variations-typography.js +41 -60
  371. package/src/components/header-edit-mode/index.js +1 -0
  372. package/src/components/header-edit-mode/style.scss +28 -17
  373. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  374. package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
  375. package/src/components/keyboard-shortcuts/global.js +16 -4
  376. package/src/components/layout/animation.js +122 -0
  377. package/src/components/layout/index.js +12 -27
  378. package/src/components/layout/router.js +26 -25
  379. package/src/components/layout/style.scss +2 -0
  380. package/src/components/page-pages/index.js +33 -54
  381. package/src/components/page-patterns/delete-category-menu-item.js +7 -0
  382. package/src/components/page-patterns/index.js +22 -31
  383. package/src/components/page-patterns/search-items.js +13 -58
  384. package/src/components/page-patterns/use-patterns.js +17 -10
  385. package/src/components/page-templates-template-parts/actions.js +106 -91
  386. package/src/components/page-templates-template-parts/index.js +41 -93
  387. package/src/components/page-templates-template-parts/style.scss +5 -0
  388. package/src/components/plugin-template-setting-panel/index.js +14 -1
  389. package/src/components/save-button/index.js +55 -26
  390. package/src/components/save-hub/index.js +20 -164
  391. package/src/components/save-panel/index.js +24 -17
  392. package/src/components/sidebar/index.js +2 -8
  393. package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  394. package/src/components/sidebar-dataviews/dataview-item.js +2 -2
  395. package/src/components/sidebar-dataviews/default-views.js +12 -4
  396. package/src/components/sidebar-dataviews/index.js +5 -4
  397. package/src/components/sidebar-edit-mode/index.js +0 -2
  398. package/src/components/sidebar-edit-mode/page-panels/index.js +31 -62
  399. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  400. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  401. package/src/components/sidebar-edit-mode/template-panel/index.js +33 -24
  402. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  403. package/src/components/sidebar-navigation-screen/style.scss +21 -9
  404. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  405. package/src/components/sidebar-navigation-screen-global-styles/index.js +29 -2
  406. package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +2 -3
  407. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
  408. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
  409. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  410. package/src/components/sidebar-navigation-screen-template/index.js +6 -1
  411. package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  412. package/src/components/style-book/index.js +1 -3
  413. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  414. package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
  415. package/src/components/template-actions/index.js +63 -46
  416. package/src/components/welcome-guide/editor.js +9 -6
  417. package/src/hooks/index.js +0 -1
  418. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +21 -4
  419. package/src/store/selectors.js +3 -15
  420. package/src/style.scss +0 -2
  421. package/src/utils/constants.js +4 -2
  422. package/src/utils/get-is-list-page.js +1 -1
  423. package/src/utils/math.js +93 -0
  424. package/build/components/actions/index.js +0 -321
  425. package/build/components/actions/index.js.map +0 -1
  426. package/build/components/global-styles/preview-typography.js.map +0 -1
  427. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -42
  428. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  429. package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
  430. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  431. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  432. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  433. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  434. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  435. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  436. package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
  437. package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  438. package/build/hooks/template-part-edit.js +0 -82
  439. package/build/hooks/template-part-edit.js.map +0 -1
  440. package/build/store/utils.js +0 -71
  441. package/build/store/utils.js.map +0 -1
  442. package/build-module/components/actions/index.js +0 -310
  443. package/build-module/components/actions/index.js.map +0 -1
  444. package/build-module/components/global-styles/preview-typography.js.map +0 -1
  445. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
  446. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  447. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
  448. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  449. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  450. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  451. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  452. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  453. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  454. package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
  455. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  456. package/build-module/hooks/template-part-edit.js +0 -75
  457. package/build-module/hooks/template-part-edit.js.map +0 -1
  458. package/build-module/store/utils.js +0 -64
  459. package/build-module/store/utils.js.map +0 -1
  460. package/src/components/actions/index.js +0 -411
  461. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
  462. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -37
  463. package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
  464. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  465. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  466. package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
  467. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
  468. package/src/hooks/template-part-edit.js +0 -89
  469. package/src/store/test/utils.js +0 -191
  470. package/src/store/utils.js +0 -69
@@ -134,9 +134,9 @@ export function unloadFontFaceInBrowser( fontFace, removeFrom = 'all' ) {
134
134
  const unloadFontFace = ( fonts ) => {
135
135
  fonts.forEach( ( f ) => {
136
136
  if (
137
- f.family === formatFontFaceName( fontFace.fontFamily ) &&
138
- f.weight === fontFace.fontWeight &&
139
- f.style === fontFace.fontStyle
137
+ f.family === formatFontFaceName( fontFace?.fontFamily ) &&
138
+ f.weight === fontFace?.fontWeight &&
139
+ f.style === fontFace?.fontStyle
140
140
  ) {
141
141
  fonts.delete( f );
142
142
  }
@@ -234,10 +234,23 @@ export function makeFontFacesFormData( font ) {
234
234
  }
235
235
 
236
236
  export async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {
237
- const promises = fontFacesData.map( ( faceData ) =>
238
- fetchInstallFontFace( fontFamilyId, faceData )
239
- );
240
- const responses = await Promise.allSettled( promises );
237
+ const responses = [];
238
+
239
+ /*
240
+ * Uses the same response format as Promise.allSettled, but executes requests in sequence to work
241
+ * around a race condition that can cause an error when the fonts directory doesn't exist yet.
242
+ */
243
+ for ( const faceData of fontFacesData ) {
244
+ try {
245
+ const response = await fetchInstallFontFace(
246
+ fontFamilyId,
247
+ faceData
248
+ );
249
+ responses.push( { status: 'fulfilled', value: response } );
250
+ } catch ( error ) {
251
+ responses.push( { status: 'rejected', reason: error } );
252
+ }
253
+ }
241
254
 
242
255
  const results = {
243
256
  errors: [],
@@ -259,7 +272,7 @@ export async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {
259
272
  // Handle network errors or other fetch-related errors
260
273
  results.errors.push( {
261
274
  data: fontFacesData[ index ],
262
- message: `Fetch error: ${ result.reason.message }`,
275
+ message: result.reason.message,
263
276
  } );
264
277
  }
265
278
  } );
@@ -87,6 +87,10 @@ export function formatFontFamily( input ) {
87
87
  * formatFontFaceName(", 'Open Sans', 'Helvetica Neue', sans-serif") => "Open Sans"
88
88
  */
89
89
  export function formatFontFaceName( input ) {
90
+ if ( ! input ) {
91
+ return '';
92
+ }
93
+
90
94
  let output = input.trim();
91
95
  if ( output.includes( ',' ) ) {
92
96
  output = output
@@ -26,7 +26,7 @@ function ScreenHeader( { title, description, onBack } ) {
26
26
  }
27
27
  icon={ isRTL() ? chevronRight : chevronLeft }
28
28
  size="small"
29
- aria-label={ __( 'Navigate to the previous view' ) }
29
+ label={ __( 'Back' ) }
30
30
  onClick={ onBack }
31
31
  />
32
32
  <Spacer>
@@ -9,14 +9,21 @@ import a11yPlugin from 'colord/plugins/a11y';
9
9
  */
10
10
  import { store as blocksStore } from '@wordpress/blocks';
11
11
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
12
+ import { useContext } from '@wordpress/element';
13
+ import { __ } from '@wordpress/i18n';
12
14
 
13
15
  /**
14
16
  * Internal dependencies
15
17
  */
18
+ import { mergeBaseAndUserConfigs } from './global-styles-provider';
19
+ import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
20
+ import { getFontFamilies } from './utils';
16
21
  import { unlock } from '../../lock-unlock';
17
22
  import { useSelect } from '@wordpress/data';
18
23
 
19
- const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
24
+ const { useGlobalSetting, useGlobalStyle, GlobalStylesContext } = unlock(
25
+ blockEditorPrivateApis
26
+ );
20
27
 
21
28
  // Enable colord's a11y plugin.
22
29
  extend( [ a11yPlugin ] );
@@ -92,3 +99,63 @@ export function useSupportedStyles( name, element ) {
92
99
 
93
100
  return supportedPanels;
94
101
  }
102
+
103
+ export function useColorVariations() {
104
+ const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
105
+ property: 'color',
106
+ } );
107
+ /*
108
+ * Filter out variations with no settings or styles.
109
+ */
110
+ return colorVariations?.length
111
+ ? colorVariations.filter( ( variation ) => {
112
+ const { settings, styles, title } = variation;
113
+ return (
114
+ title === __( 'Default' ) || // Always preseve the default variation.
115
+ Object.keys( settings ).length > 0 ||
116
+ Object.keys( styles ).length > 0
117
+ );
118
+ } )
119
+ : [];
120
+ }
121
+
122
+ export function useTypographyVariations() {
123
+ const typographyVariations =
124
+ useCurrentMergeThemeStyleVariationsWithUserConfig( {
125
+ property: 'typography',
126
+ } );
127
+
128
+ const { base } = useContext( GlobalStylesContext );
129
+ /*
130
+ * Filter duplicate variations based on whether the variaitons
131
+ * have different heading and body font families.
132
+ */
133
+ return typographyVariations?.length
134
+ ? Object.values(
135
+ typographyVariations.reduce( ( acc, variation ) => {
136
+ const [ bodyFontFamily, headingFontFamily ] =
137
+ getFontFamilies(
138
+ mergeBaseAndUserConfigs( base, variation )
139
+ );
140
+
141
+ // Always preseve the default variation.
142
+ if ( variation?.title === 'Default' ) {
143
+ acc[
144
+ `${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
145
+ ] = variation;
146
+ } else if (
147
+ headingFontFamily?.name &&
148
+ bodyFontFamily?.name &&
149
+ ! acc[
150
+ `${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
151
+ ]
152
+ ) {
153
+ acc[
154
+ `${ headingFontFamily?.name }:${ bodyFontFamily?.name }`
155
+ ] = variation;
156
+ }
157
+ return acc;
158
+ }, {} )
159
+ )
160
+ : [];
161
+ }
@@ -87,7 +87,9 @@ function Palette( { name } ) {
87
87
  </ColorIndicatorWrapper>
88
88
  ) ) }
89
89
  </ZStack>
90
- <FlexItem>{ paletteButtonText }</FlexItem>
90
+ <FlexItem className="edit-site-global-styles-screen-colors__palette-count">
91
+ { paletteButtonText }
92
+ </FlexItem>
91
93
  </HStack>
92
94
  </NavigationButtonAsItem>
93
95
  </ItemGroup>
@@ -40,7 +40,7 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
40
40
  } }
41
41
  >
42
42
  <HStack
43
- spacing={ 10 * ratio }
43
+ spacing={ 5 * ratio }
44
44
  justify="center"
45
45
  style={ {
46
46
  height: '100%',
@@ -48,7 +48,7 @@ const StylesPreviewColors = ( { label, isFocused, withHoverView } ) => {
48
48
  } }
49
49
  >
50
50
  <HighlightedColors
51
- normalizedColorSwatchSize={ 66 }
51
+ normalizedColorSwatchSize={ 56 }
52
52
  ratio={ ratio }
53
53
  />
54
54
  </HStack>
@@ -118,7 +118,6 @@ export default function PreviewIframe( {
118
118
  <Iframe
119
119
  className="edit-site-global-styles-preview__iframe"
120
120
  style={ {
121
- width: '100%',
122
121
  height: normalizedHeight * ratio,
123
122
  } }
124
123
  onMouseEnter={ () => setIsHovered( true ) }
@@ -13,7 +13,7 @@ import {
13
13
  */
14
14
  import { unlock } from '../../lock-unlock';
15
15
  import { useStylesPreviewColors } from './hooks';
16
- import PreviewTypography from './preview-typography';
16
+ import TypographyExample from './typography-example';
17
17
  import HighlightedColors from './highlighted-colors';
18
18
  import PreviewIframe from './preview-iframe';
19
19
 
@@ -89,7 +89,7 @@ const PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {
89
89
  overflow: 'hidden',
90
90
  } }
91
91
  >
92
- <PreviewTypography
92
+ <TypographyExample
93
93
  fontSize={ 65 * ratio }
94
94
  variation={ variation }
95
95
  />
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
5
- import { typography, color, layout } from '@wordpress/icons';
5
+ import { typography, color, layout, image } from '@wordpress/icons';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
8
 
@@ -18,6 +18,7 @@ const {
18
18
  useHasColorPanel,
19
19
  useGlobalSetting,
20
20
  useSettingsForBlockElement,
21
+ useHasBackgroundPanel,
21
22
  } = unlock( blockEditorPrivateApis );
22
23
 
23
24
  function RootMenu() {
@@ -27,6 +28,7 @@ function RootMenu() {
27
28
  const hasColorPanel = useHasColorPanel( settings );
28
29
  const hasDimensionsPanel = useHasDimensionsPanel( settings );
29
30
  const hasLayoutPanel = hasDimensionsPanel;
31
+ const hasBackgroundPanel = useHasBackgroundPanel( settings );
30
32
 
31
33
  return (
32
34
  <>
@@ -58,6 +60,15 @@ function RootMenu() {
58
60
  { __( 'Layout' ) }
59
61
  </NavigationButtonAsItem>
60
62
  ) }
63
+ { hasBackgroundPanel && (
64
+ <NavigationButtonAsItem
65
+ icon={ image }
66
+ path="/background"
67
+ aria-label={ __( 'Background styles' ) }
68
+ >
69
+ { __( 'Background' ) }
70
+ </NavigationButtonAsItem>
71
+ ) }
61
72
  </ItemGroup>
62
73
  </>
63
74
  );
@@ -0,0 +1,29 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import BackgroundPanel from './background-panel';
11
+ import ScreenHeader from './header';
12
+ import { unlock } from '../../lock-unlock';
13
+
14
+ const { useHasBackgroundPanel, useGlobalSetting } = unlock(
15
+ blockEditorPrivateApis
16
+ );
17
+
18
+ function ScreenBackground() {
19
+ const [ settings ] = useGlobalSetting( '' );
20
+ const hasBackgroundPanel = useHasBackgroundPanel( settings );
21
+ return (
22
+ <>
23
+ <ScreenHeader title={ __( 'Background' ) } />
24
+ { hasBackgroundPanel && <BackgroundPanel /> }
25
+ </>
26
+ );
27
+ }
28
+
29
+ export default ScreenBackground;
@@ -25,8 +25,8 @@ function ScreenColorPalette( { name } ) {
25
25
  />
26
26
  <Tabs>
27
27
  <Tabs.TabList>
28
- <Tabs.Tab tabId="solid">Solid</Tabs.Tab>
29
- <Tabs.Tab tabId="gradient">Gradient</Tabs.Tab>
28
+ <Tabs.Tab tabId="solid">{ __( 'Solid' ) }</Tabs.Tab>
29
+ <Tabs.Tab tabId="gradient">{ __( 'Gradient' ) }</Tabs.Tab>
30
30
  </Tabs.TabList>
31
31
  <Tabs.TabPanel tabId="solid" focusable={ false }>
32
32
  <ColorPalettePanel name={ name } />
@@ -12,7 +12,6 @@ import ScreenHeader from './header';
12
12
  import Palette from './palette';
13
13
  import { unlock } from '../../lock-unlock';
14
14
  import ColorVariations from './variations/variations-color';
15
- import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
16
15
 
17
16
  const {
18
17
  useGlobalStyle,
@@ -31,28 +30,18 @@ function ScreenColors() {
31
30
  const [ rawSettings ] = useGlobalSetting( '' );
32
31
  const settings = useSettingsForBlockElement( rawSettings );
33
32
 
34
- const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
35
- property: 'color',
36
- filter: ( variation ) =>
37
- variation?.settings?.color &&
38
- Object.keys( variation?.settings?.color ).length,
39
- } );
40
33
  return (
41
34
  <>
42
35
  <ScreenHeader
43
36
  title={ __( 'Colors' ) }
44
37
  description={ __(
45
- 'Manage palettes and the default color of different global elements on the site.'
38
+ 'Palette colors and the application of those colors on site elements.'
46
39
  ) }
47
40
  />
48
- <div className="edit-site-global-styles-screen-colors">
49
- <VStack spacing={ 3 }>
50
- { !! colorVariations.length && (
51
- <ColorVariations variations={ colorVariations } />
52
- ) }
53
-
41
+ <div className="edit-site-global-styles-screen">
42
+ <VStack spacing={ 7 }>
43
+ <ColorVariations title={ __( 'Presets' ) } />
54
44
  <Palette />
55
-
56
45
  <StylesColorPanel
57
46
  inheritedValue={ inheritedStyle }
58
47
  value={ style }
@@ -3,9 +3,7 @@
3
3
  */
4
4
  import { Card, CardBody } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { store as blockEditorStore } from '@wordpress/block-editor';
7
- import { useEffect, useRef } from '@wordpress/element';
8
- import { useSelect, useDispatch } from '@wordpress/data';
6
+ import { useZoomOut } from '@wordpress/block-editor';
9
7
 
10
8
  /**
11
9
  * Internal dependencies
@@ -14,43 +12,13 @@ import ScreenHeader from './header';
14
12
  import StyleVariationsContainer from './style-variations-container';
15
13
 
16
14
  function ScreenStyleVariations() {
17
- const { mode } = useSelect( ( select ) => {
18
- return {
19
- mode: select( blockEditorStore ).__unstableGetEditorMode(),
20
- };
21
- }, [] );
22
-
23
- const shouldRevertInitialMode = useRef( null );
24
- useEffect( () => {
25
- // ignore changes to zoom-out mode as we explictily change to it on mount.
26
- if ( mode !== 'zoom-out' ) {
27
- shouldRevertInitialMode.current = false;
28
- }
29
- }, [ mode ] );
30
-
31
- // Intentionality left without any dependency.
32
- // This effect should only run the first time the component is rendered.
33
- // The effect opens the zoom-out view if it is not open before when applying a style variation.
34
- useEffect( () => {
35
- if ( mode !== 'zoom-out' ) {
36
- __unstableSetEditorMode( 'zoom-out' );
37
- shouldRevertInitialMode.current = true;
38
- return () => {
39
- // if there were not mode changes revert to the initial mode when unmounting.
40
- if ( shouldRevertInitialMode.current ) {
41
- __unstableSetEditorMode( mode );
42
- }
43
- };
44
- }
45
- // eslint-disable-next-line react-hooks/exhaustive-deps
46
- }, [] );
47
-
48
- const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
15
+ // Move to zoom out mode when this component is mounted
16
+ // and back to the previous mode when unmounted.
17
+ useZoomOut();
49
18
 
50
19
  return (
51
20
  <>
52
21
  <ScreenHeader
53
- back="/"
54
22
  title={ __( 'Browse styles' ) }
55
23
  description={ __(
56
24
  'Choose a variation to change the look of the site.'
@@ -13,7 +13,6 @@ import TypographyElements from './typography-elements';
13
13
  import TypographyVariations from './variations/variations-typography';
14
14
  import FontFamilies from './font-families';
15
15
  import ScreenHeader from './header';
16
- import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
17
16
 
18
17
  function ScreenTypography() {
19
18
  const fontLibraryEnabled = useSelect(
@@ -21,33 +20,20 @@ function ScreenTypography() {
21
20
  select( editorStore ).getEditorSettings().fontLibraryEnabled,
22
21
  []
23
22
  );
24
- const typographyVariations =
25
- useCurrentMergeThemeStyleVariationsWithUserConfig( {
26
- property: 'typography',
27
- filter: ( variation ) =>
28
- variation?.settings?.typography?.fontFamilies &&
29
- Object.keys( variation?.settings?.typography?.fontFamilies )
30
- .length,
31
- } );
32
23
 
33
24
  return (
34
25
  <>
35
26
  <ScreenHeader
36
27
  title={ __( 'Typography' ) }
37
28
  description={ __(
38
- 'Manage the typography settings for different elements.'
29
+ 'Typography styles and the application of those styles on site elements.'
39
30
  ) }
40
31
  />
41
- <div className="edit-site-global-styles-screen-typography">
42
- <VStack spacing={ 6 }>
43
- { !! typographyVariations.length && (
44
- <TypographyVariations />
45
- ) }
46
- { ! window.__experimentalDisableFontLibrary && (
47
- <VStack spacing={ 3 }>
48
- { fontLibraryEnabled && <FontFamilies /> }
49
- </VStack>
50
- ) }
32
+ <div className="edit-site-global-styles-screen">
33
+ <VStack spacing={ 7 }>
34
+ <TypographyVariations title={ __( 'Presets' ) } />
35
+ { ! window.__experimentalDisableFontLibrary &&
36
+ fontLibraryEnabled && <FontFamilies /> }
51
37
  <TypographyElements />
52
38
  </VStack>
53
39
  </div>
@@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
13
13
  import PreviewStyles from './preview-styles';
14
14
  import Variation from './variations/variation';
15
15
 
16
- export default function StyleVariationsContainer() {
16
+ export default function StyleVariationsContainer( { gap = 2 } ) {
17
17
  const variations = useSelect( ( select ) => {
18
18
  return select(
19
19
  coreStore
@@ -39,6 +39,7 @@ export default function StyleVariationsContainer() {
39
39
  <Grid
40
40
  columns={ 2 }
41
41
  className="edit-site-global-styles-style-variations-container"
42
+ gap={ gap }
42
43
  >
43
44
  { withEmptyVariation.map( ( variation, index ) => (
44
45
  <Variation key={ index } variation={ variation }>
@@ -7,8 +7,10 @@
7
7
  }
8
8
 
9
9
  .edit-site-global-styles-preview__iframe {
10
+ border-radius: $radius-block-ui + 1px; // Visually resembles the $radius-block-ui.
10
11
  max-width: 100%;
11
12
  display: block;
13
+ width: 100%;
12
14
  }
13
15
 
14
16
  .edit-site-typography-preview {
@@ -27,9 +29,8 @@
27
29
  max-width: 100%;
28
30
  }
29
31
 
30
- .edit-site-global-styles-screen-typography,
31
- .edit-site-global-styles-screen-css {
32
- margin: $grid-unit-20;
32
+ .edit-site-global-styles-screen {
33
+ margin: $grid-unit-15 $grid-unit-20 $grid-unit-20;
33
34
  }
34
35
 
35
36
  .edit-site-global-styles-screen-typography__indicator {
@@ -50,14 +51,16 @@
50
51
  justify-content: center;
51
52
  }
52
53
 
53
- .edit-site-global-styles-screen-colors {
54
- margin: $grid-unit-20;
54
+ .edit-site-global-styles-screen .color-block-support-panel {
55
+ padding-left: 0;
56
+ padding-right: 0;
57
+ padding-top: 0;
58
+ border-top: none;
59
+ row-gap: calc(#{$grid-unit-05} * 3);
60
+ }
55
61
 
56
- .color-block-support-panel {
57
- padding-left: 0;
58
- padding-right: 0;
59
- border-top: none;
60
- }
62
+ .edit-site-global-styles-screen-colors__palette-count {
63
+ color: $gray-700;
61
64
  }
62
65
 
63
66
  .edit-site-global-styles-header__description {
@@ -113,6 +116,7 @@
113
116
  flex: 1 1 auto;
114
117
  display: flex;
115
118
  flex-direction: column;
119
+ margin: $grid-unit-20;
116
120
 
117
121
  .components-v-stack {
118
122
  flex: 1 1 auto;
@@ -165,3 +169,4 @@
165
169
  .edit-site-global-styles-sidebar__panel .block-editor-block-icon svg {
166
170
  fill: currentColor;
167
171
  }
172
+
@@ -35,6 +35,7 @@ function ElementItem( { parentMenu, element, label } ) {
35
35
  prefix + 'typography.letterSpacing'
36
36
  );
37
37
  const [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );
38
+ const [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );
38
39
  const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );
39
40
  const [ color ] = useGlobalStyle( prefix + 'color.text' );
40
41
 
@@ -54,7 +55,10 @@ function ElementItem( { parentMenu, element, label } ) {
54
55
  className="edit-site-global-styles-screen-typography__indicator"
55
56
  style={ {
56
57
  fontFamily: fontFamily ?? 'serif',
57
- background: gradientValue ?? backgroundColor,
58
+ background:
59
+ gradientValue ??
60
+ backgroundColor ??
61
+ fallbackBackgroundColor,
58
62
  color,
59
63
  fontStyle,
60
64
  fontWeight,
@@ -37,7 +37,6 @@ export default function PreviewTypography( { fontSize, variation } ) {
37
37
 
38
38
  return (
39
39
  <motion.div
40
- className="edit-site-global-styles_preview-typography"
41
40
  animate={ {
42
41
  scale: 1,
43
42
  opacity: 1,
@@ -50,6 +49,9 @@ export default function PreviewTypography( { fontSize, variation } ) {
50
49
  delay: 0.3,
51
50
  type: 'tween',
52
51
  } }
52
+ style={ {
53
+ textAlign: 'center',
54
+ } }
53
55
  >
54
56
  <span style={ headingPreviewStyle }>
55
57
  { _x( 'A', 'Uppercase letter A' ) }
@@ -27,6 +27,7 @@ export default function TypographyPreview( { name, element, headingLevel } ) {
27
27
  prefix + 'color.background',
28
28
  name
29
29
  );
30
+ const [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );
30
31
  const [ color ] = useGlobalStyle( prefix + 'color.text', name );
31
32
  const [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );
32
33
  const [ fontStyle ] = useGlobalStyle(
@@ -53,7 +54,8 @@ export default function TypographyPreview( { name, element, headingLevel } ) {
53
54
  className="edit-site-typography-preview"
54
55
  style={ {
55
56
  fontFamily: fontFamily ?? 'serif',
56
- background: gradientValue ?? backgroundColor,
57
+ background:
58
+ gradientValue ?? backgroundColor ?? fallbackBackgroundColor,
57
59
  color,
58
60
  fontSize,
59
61
  fontStyle,
@@ -40,6 +40,7 @@ import ScreenStyleVariations from './screen-style-variations';
40
40
  import StyleBook from '../style-book';
41
41
  import ScreenCSS from './screen-css';
42
42
  import ScreenRevisions from './screen-revisions';
43
+ import ScreenBackground from './screen-background';
43
44
  import { unlock } from '../../lock-unlock';
44
45
  import { store as editSiteStore } from '../../store';
45
46
 
@@ -344,6 +345,10 @@ function GlobalStylesUI() {
344
345
  <ScreenRevisions />
345
346
  </GlobalStylesNavigationScreen>
346
347
 
348
+ <GlobalStylesNavigationScreen path={ '/background' }>
349
+ <ScreenBackground />
350
+ </GlobalStylesNavigationScreen>
351
+
347
352
  { blocks.map( ( block ) => (
348
353
  <GlobalStylesNavigationScreen
349
354
  key={ 'menu-block-' + block.name }
@@ -12,7 +12,7 @@ export function getVariationClassName( variation ) {
12
12
  }
13
13
 
14
14
  function getFontFamilyFromSetting( fontFamilies, setting ) {
15
- if ( ! setting ) {
15
+ if ( ! Array.isArray( fontFamilies ) || ! setting ) {
16
16
  return null;
17
17
  }
18
18