@wordpress/edit-site 5.26.0 → 5.27.1

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 (340) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +139 -36
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/editor-canvas-container/index.js +1 -1
  5. package/build/components/editor-canvas-container/index.js.map +1 -1
  6. package/build/components/global-styles/font-families.js +3 -2
  7. package/build/components/global-styles/font-families.js.map +1 -1
  8. package/build/components/global-styles/font-family-item.js +3 -4
  9. package/build/components/global-styles/font-family-item.js.map +1 -1
  10. package/build/components/global-styles/font-library-modal/context.js +80 -41
  11. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  12. package/build/components/global-styles/font-library-modal/font-collection.js +49 -22
  13. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  15. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/index.js +4 -4
  17. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  19. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/library-font-card.js +1 -1
  21. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  23. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/local-fonts.js +13 -4
  25. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/resolvers.js +49 -20
  27. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/tab-panel-layout.js +6 -2
  29. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  31. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/index.js +103 -17
  33. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  35. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  36. package/build/components/global-styles/screen-block.js +10 -0
  37. package/build/components/global-styles/screen-block.js.map +1 -1
  38. package/build/components/global-styles/screen-typography.js +4 -1
  39. package/build/components/global-styles/screen-typography.js.map +1 -1
  40. package/build/components/layout/hooks.js +6 -5
  41. package/build/components/layout/hooks.js.map +1 -1
  42. package/build/components/layout/index.js +19 -28
  43. package/build/components/layout/index.js.map +1 -1
  44. package/build/components/layout/router.js +135 -0
  45. package/build/components/layout/router.js.map +1 -0
  46. package/build/components/page-pages/index.js +92 -69
  47. package/build/components/page-pages/index.js.map +1 -1
  48. package/build/components/page-patterns/dataviews-pattern-actions.js +11 -6
  49. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  50. package/build/components/page-patterns/index.js +295 -15
  51. package/build/components/page-patterns/index.js.map +1 -1
  52. package/build/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +51 -23
  53. package/build/components/page-templates-template-parts/actions.js.map +1 -0
  54. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  55. package/build/components/page-templates-template-parts/index.js +395 -0
  56. package/build/components/page-templates-template-parts/index.js.map +1 -0
  57. package/build/components/preferences-modal/index.js +9 -134
  58. package/build/components/preferences-modal/index.js.map +1 -1
  59. package/build/components/revisions/index.js +1 -1
  60. package/build/components/revisions/index.js.map +1 -1
  61. package/build/components/save-button/index.js +4 -2
  62. package/build/components/save-button/index.js.map +1 -1
  63. package/build/components/save-panel/index.js +6 -5
  64. package/build/components/save-panel/index.js.map +1 -1
  65. package/build/components/sidebar/index.js +3 -1
  66. package/build/components/sidebar/index.js.map +1 -1
  67. package/build/components/sidebar-dataviews/dataview-item.js +3 -1
  68. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  69. package/build/components/sidebar-dataviews/default-views.js +4 -2
  70. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  71. package/build/components/sidebar-dataviews/index.js +2 -2
  72. package/build/components/sidebar-dataviews/index.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen/index.js +8 -7
  74. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-pages/index.js +2 -10
  76. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +26 -3
  78. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  80. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  81. package/build/components/sidebar-navigation-screen-templates-browse/content.js +76 -0
  82. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  83. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  84. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  85. package/build/components/site-hub/index.js +3 -1
  86. package/build/components/site-hub/index.js.map +1 -1
  87. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -12
  88. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  89. package/build/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  90. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  91. package/build/hooks/commands/use-edit-mode-commands.js +33 -5
  92. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  93. package/build/hooks/push-changes-to-global-styles/index.js +13 -6
  94. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  95. package/build/hooks/template-part-edit.js +7 -6
  96. package/build/hooks/template-part-edit.js.map +1 -1
  97. package/build/index.js +1 -1
  98. package/build/index.js.map +1 -1
  99. package/build/store/actions.js +11 -29
  100. package/build/store/actions.js.map +1 -1
  101. package/build/store/private-actions.js +85 -1
  102. package/build/store/private-actions.js.map +1 -1
  103. package/build/store/selectors.js +2 -2
  104. package/build/store/selectors.js.map +1 -1
  105. package/build/utils/get-is-list-page.js +1 -1
  106. package/build/utils/get-is-list-page.js.map +1 -1
  107. package/build/utils/use-actual-current-theme.js +32 -0
  108. package/build/utils/use-actual-current-theme.js.map +1 -0
  109. package/build-module/components/actions/index.js +139 -36
  110. package/build-module/components/actions/index.js.map +1 -1
  111. package/build-module/components/editor-canvas-container/index.js +1 -1
  112. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  113. package/build-module/components/global-styles/font-families.js +3 -2
  114. package/build-module/components/global-styles/font-families.js.map +1 -1
  115. package/build-module/components/global-styles/font-family-item.js +4 -5
  116. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  117. package/build-module/components/global-styles/font-library-modal/context.js +82 -42
  118. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  119. package/build-module/components/global-styles/font-library-modal/font-collection.js +49 -22
  120. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  121. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  122. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  123. package/build-module/components/global-styles/font-library-modal/index.js +4 -4
  124. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  125. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  126. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  127. package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
  128. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  129. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  130. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  131. package/build-module/components/global-styles/font-library-modal/local-fonts.js +13 -4
  132. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  133. package/build-module/components/global-styles/font-library-modal/resolvers.js +45 -18
  134. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  135. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +6 -2
  136. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  137. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  138. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  139. package/build-module/components/global-styles/font-library-modal/utils/index.js +99 -16
  140. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  141. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  142. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  143. package/build-module/components/global-styles/screen-block.js +10 -0
  144. package/build-module/components/global-styles/screen-block.js.map +1 -1
  145. package/build-module/components/global-styles/screen-typography.js +4 -1
  146. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  147. package/build-module/components/layout/hooks.js +6 -5
  148. package/build-module/components/layout/hooks.js.map +1 -1
  149. package/build-module/components/layout/index.js +19 -28
  150. package/build-module/components/layout/index.js.map +1 -1
  151. package/build-module/components/layout/router.js +127 -0
  152. package/build-module/components/layout/router.js.map +1 -0
  153. package/build-module/components/page-pages/index.js +91 -70
  154. package/build-module/components/page-pages/index.js.map +1 -1
  155. package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -6
  156. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  157. package/build-module/components/page-patterns/index.js +296 -16
  158. package/build-module/components/page-patterns/index.js.map +1 -1
  159. package/build-module/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +52 -24
  160. package/build-module/components/page-templates-template-parts/actions.js.map +1 -0
  161. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  162. package/build-module/components/page-templates-template-parts/index.js +385 -0
  163. package/build-module/components/page-templates-template-parts/index.js.map +1 -0
  164. package/build-module/components/preferences-modal/index.js +12 -136
  165. package/build-module/components/preferences-modal/index.js.map +1 -1
  166. package/build-module/components/revisions/index.js +1 -1
  167. package/build-module/components/revisions/index.js.map +1 -1
  168. package/build-module/components/save-button/index.js +4 -2
  169. package/build-module/components/save-button/index.js.map +1 -1
  170. package/build-module/components/save-panel/index.js +7 -6
  171. package/build-module/components/save-panel/index.js.map +1 -1
  172. package/build-module/components/sidebar/index.js +3 -1
  173. package/build-module/components/sidebar/index.js.map +1 -1
  174. package/build-module/components/sidebar-dataviews/dataview-item.js +3 -1
  175. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  176. package/build-module/components/sidebar-dataviews/default-views.js +4 -2
  177. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  178. package/build-module/components/sidebar-dataviews/index.js +2 -2
  179. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  180. package/build-module/components/sidebar-navigation-screen/index.js +8 -7
  181. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  182. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -10
  183. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  184. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +27 -4
  185. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  186. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  187. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  188. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +68 -0
  189. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  190. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  191. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  192. package/build-module/components/site-hub/index.js +3 -1
  193. package/build-module/components/site-hub/index.js.map +1 -1
  194. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -11
  195. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  196. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  197. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  198. package/build-module/hooks/commands/use-edit-mode-commands.js +33 -5
  199. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  200. package/build-module/hooks/push-changes-to-global-styles/index.js +13 -6
  201. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  202. package/build-module/hooks/template-part-edit.js +7 -6
  203. package/build-module/hooks/template-part-edit.js.map +1 -1
  204. package/build-module/index.js +1 -1
  205. package/build-module/index.js.map +1 -1
  206. package/build-module/store/actions.js +13 -30
  207. package/build-module/store/actions.js.map +1 -1
  208. package/build-module/store/private-actions.js +83 -0
  209. package/build-module/store/private-actions.js.map +1 -1
  210. package/build-module/store/selectors.js +2 -2
  211. package/build-module/store/selectors.js.map +1 -1
  212. package/build-module/utils/get-is-list-page.js +1 -1
  213. package/build-module/utils/get-is-list-page.js.map +1 -1
  214. package/build-module/utils/use-actual-current-theme.js +24 -0
  215. package/build-module/utils/use-actual-current-theme.js.map +1 -0
  216. package/build-style/style-rtl.css +316 -215
  217. package/build-style/style.css +316 -215
  218. package/package.json +42 -42
  219. package/src/components/actions/index.js +236 -84
  220. package/src/components/editor-canvas-container/index.js +1 -1
  221. package/src/components/global-styles/font-families.js +14 -8
  222. package/src/components/global-styles/font-family-item.js +7 -4
  223. package/src/components/global-styles/font-library-modal/context.js +156 -50
  224. package/src/components/global-styles/font-library-modal/font-collection.js +56 -21
  225. package/src/components/global-styles/font-library-modal/fonts-grid.js +6 -2
  226. package/src/components/global-styles/font-library-modal/index.js +4 -4
  227. package/src/components/global-styles/font-library-modal/installed-fonts.js +18 -8
  228. package/src/components/global-styles/font-library-modal/library-font-card.js +2 -1
  229. package/src/components/global-styles/font-library-modal/library-font-variant.js +10 -9
  230. package/src/components/global-styles/font-library-modal/local-fonts.js +14 -4
  231. package/src/components/global-styles/font-library-modal/resolvers.js +50 -17
  232. package/src/components/global-styles/font-library-modal/style.scss +23 -35
  233. package/src/components/global-styles/font-library-modal/tab-panel-layout.js +30 -26
  234. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +19 -2
  235. package/src/components/global-styles/font-library-modal/utils/index.js +136 -29
  236. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +7 -3
  237. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +40 -10
  238. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +5 -5
  239. package/src/components/global-styles/screen-block.js +10 -0
  240. package/src/components/global-styles/screen-typography.js +9 -3
  241. package/src/components/global-styles/style.scss +4 -0
  242. package/src/components/header-edit-mode/style.scss +15 -5
  243. package/src/components/layout/hooks.js +6 -5
  244. package/src/components/layout/index.js +80 -96
  245. package/src/components/layout/router.js +121 -0
  246. package/src/components/layout/style.scss +13 -16
  247. package/src/components/page/style.scss +1 -8
  248. package/src/components/page-pages/index.js +142 -148
  249. package/src/components/page-pages/style.scss +41 -2
  250. package/src/components/page-patterns/dataviews-pattern-actions.js +11 -6
  251. package/src/components/page-patterns/index.js +392 -14
  252. package/src/components/page-patterns/style.scss +36 -2
  253. package/src/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +90 -37
  254. package/src/components/{page-templates → page-templates-template-parts}/index.js +198 -169
  255. package/src/components/page-templates-template-parts/style.scss +44 -0
  256. package/src/components/preferences-modal/index.js +8 -211
  257. package/src/components/revisions/index.js +1 -1
  258. package/src/components/save-button/index.js +7 -4
  259. package/src/components/save-panel/index.js +13 -12
  260. package/src/components/sidebar/index.js +4 -5
  261. package/src/components/sidebar-dataviews/dataview-item.js +2 -1
  262. package/src/components/sidebar-dataviews/default-views.js +4 -2
  263. package/src/components/sidebar-dataviews/index.js +8 -6
  264. package/src/components/sidebar-navigation-item/style.scss +1 -1
  265. package/src/components/sidebar-navigation-screen/index.js +19 -10
  266. package/src/components/sidebar-navigation-screen-pages/index.js +2 -10
  267. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +32 -6
  268. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  269. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  270. package/src/components/sidebar-navigation-screen-templates-browse/content.js +73 -0
  271. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -1
  272. package/src/components/site-hub/index.js +4 -1
  273. package/src/components/site-hub/style.scss +1 -12
  274. package/src/components/site-icon/style.scss +1 -1
  275. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +40 -10
  276. package/src/components/sync-state-with-url/use-sync-path-with-url.js +32 -0
  277. package/src/hooks/commands/use-edit-mode-commands.js +50 -3
  278. package/src/hooks/push-changes-to-global-styles/index.js +29 -23
  279. package/src/hooks/template-part-edit.js +12 -12
  280. package/src/index.js +1 -1
  281. package/src/store/actions.js +17 -51
  282. package/src/store/private-actions.js +133 -0
  283. package/src/store/selectors.js +2 -4
  284. package/src/style.scss +2 -1
  285. package/src/utils/get-is-list-page.js +3 -2
  286. package/src/utils/use-actual-current-theme.js +27 -0
  287. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  288. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  289. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -71
  290. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  291. package/build/components/page-main/index.js +0 -44
  292. package/build/components/page-main/index.js.map +0 -1
  293. package/build/components/page-patterns/dataviews-patterns.js +0 -307
  294. package/build/components/page-patterns/dataviews-patterns.js.map +0 -1
  295. package/build/components/page-template-parts/add-new-template-part.js.map +0 -1
  296. package/build/components/page-template-parts/index.js +0 -81
  297. package/build/components/page-template-parts/index.js.map +0 -1
  298. package/build/components/page-templates/index.js +0 -352
  299. package/build/components/page-templates/index.js.map +0 -1
  300. package/build/components/page-templates/template-actions.js.map +0 -1
  301. package/build/components/post-preview/index.js +0 -29
  302. package/build/components/post-preview/index.js.map +0 -1
  303. package/build/components/preferences-modal/enable-feature.js +0 -36
  304. package/build/components/preferences-modal/enable-feature.js.map +0 -1
  305. package/build/components/preferences-modal/enable-panel-option.js +0 -33
  306. package/build/components/preferences-modal/enable-panel-option.js.map +0 -1
  307. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -52
  308. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  309. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -63
  310. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  311. package/build-module/components/page-main/index.js +0 -36
  312. package/build-module/components/page-main/index.js.map +0 -1
  313. package/build-module/components/page-patterns/dataviews-patterns.js +0 -299
  314. package/build-module/components/page-patterns/dataviews-patterns.js.map +0 -1
  315. package/build-module/components/page-template-parts/add-new-template-part.js.map +0 -1
  316. package/build-module/components/page-template-parts/index.js +0 -73
  317. package/build-module/components/page-template-parts/index.js.map +0 -1
  318. package/build-module/components/page-templates/index.js +0 -344
  319. package/build-module/components/page-templates/index.js.map +0 -1
  320. package/build-module/components/page-templates/template-actions.js.map +0 -1
  321. package/build-module/components/post-preview/index.js +0 -21
  322. package/build-module/components/post-preview/index.js.map +0 -1
  323. package/build-module/components/preferences-modal/enable-feature.js +0 -29
  324. package/build-module/components/preferences-modal/enable-feature.js.map +0 -1
  325. package/build-module/components/preferences-modal/enable-panel-option.js +0 -26
  326. package/build-module/components/preferences-modal/enable-panel-option.js.map +0 -1
  327. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  328. package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -62
  329. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +0 -271
  330. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +0 -58
  331. package/src/components/page-main/index.js +0 -38
  332. package/src/components/page-patterns/dataviews-patterns.js +0 -380
  333. package/src/components/page-template-parts/index.js +0 -99
  334. package/src/components/page-templates/style.scss +0 -13
  335. package/src/components/post-preview/index.js +0 -16
  336. package/src/components/preferences-modal/enable-feature.js +0 -31
  337. package/src/components/preferences-modal/enable-panel-option.js +0 -23
  338. /package/build/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  339. /package/build-module/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  340. /package/src/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
@@ -1,45 +1,78 @@
1
- /**
2
- * WordPress dependencies
3
- *
4
- */
5
1
  /**
6
2
  * WordPress dependencies
7
3
  */
8
4
  import apiFetch from '@wordpress/api-fetch';
9
5
 
10
- export async function fetchInstallFont( data ) {
6
+ const FONT_FAMILIES_URL = '/wp/v2/font-families';
7
+ const FONT_COLLECTIONS_URL = '/wp/v2/font-collections';
8
+
9
+ export async function fetchInstallFontFamily( data ) {
11
10
  const config = {
12
- path: '/wp/v2/font-families',
11
+ path: FONT_FAMILIES_URL,
13
12
  method: 'POST',
14
13
  body: data,
15
14
  };
16
- return apiFetch( config );
15
+ const response = await apiFetch( config );
16
+ return {
17
+ id: response.id,
18
+ ...response.font_family_settings,
19
+ fontFace: [],
20
+ };
17
21
  }
18
22
 
19
- export async function fetchUninstallFonts( fonts ) {
20
- const data = {
21
- font_families: fonts,
23
+ export async function fetchInstallFontFace( fontFamilyId, data ) {
24
+ const config = {
25
+ path: `${ FONT_FAMILIES_URL }/${ fontFamilyId }/font-faces`,
26
+ method: 'POST',
27
+ body: data,
28
+ };
29
+ const response = await apiFetch( config );
30
+ return {
31
+ id: response.id,
32
+ ...response.font_face_settings,
22
33
  };
34
+ }
35
+
36
+ export async function fetchGetFontFamilyBySlug( slug ) {
37
+ const config = {
38
+ path: `${ FONT_FAMILIES_URL }?slug=${ slug }&_embed=true`,
39
+ method: 'GET',
40
+ };
41
+ const response = await apiFetch( config );
42
+ if ( ! response || response.length === 0 ) {
43
+ return null;
44
+ }
45
+ const fontFamilyPost = response[ 0 ];
46
+ return {
47
+ id: fontFamilyPost.id,
48
+ ...fontFamilyPost.font_family_settings,
49
+ fontFace:
50
+ fontFamilyPost?._embedded?.font_faces.map(
51
+ ( face ) => face.font_face_settings
52
+ ) || [],
53
+ };
54
+ }
55
+
56
+ export async function fetchUninstallFontFamily( fontFamilyId ) {
23
57
  const config = {
24
- path: '/wp/v2/font-families',
58
+ path: `${ FONT_FAMILIES_URL }/${ fontFamilyId }?force=true`,
25
59
  method: 'DELETE',
26
- data,
27
60
  };
28
- return apiFetch( config );
61
+ return await apiFetch( config );
29
62
  }
30
63
 
31
64
  export async function fetchFontCollections() {
32
65
  const config = {
33
- path: '/wp/v2/font-collections',
66
+ path: FONT_COLLECTIONS_URL,
34
67
  method: 'GET',
35
68
  };
36
- return apiFetch( config );
69
+ return await apiFetch( config );
37
70
  }
38
71
 
39
72
  export async function fetchFontCollection( id ) {
40
73
  const config = {
41
- path: `/wp/v2/font-collections/${ id }`,
74
+ path: `${ FONT_COLLECTIONS_URL }/${ id }`,
42
75
  method: 'GET',
43
76
  };
44
- return apiFetch( config );
77
+ return await apiFetch( config );
45
78
  }
@@ -26,18 +26,18 @@
26
26
 
27
27
  .font-library-modal__tabpanel-layout {
28
28
 
29
- main {
30
- padding-bottom: 4rem;
29
+ .font-library-modal__tabpanel-layout__main {
30
+ padding-bottom: $grid-unit-80;
31
31
  }
32
32
 
33
- footer {
34
- border-top: 1px solid #e5e5e5;
35
- margin: 0 -32px -32px;
36
- padding: 16px 32px;
33
+ .font-library-modal__tabpanel-layout__footer {
34
+ border-top: 1px solid $gray-300;
35
+ margin: 0 #{$grid-unit-40 * -1} #{$grid-unit-40 * -1};
36
+ padding: $grid-unit-20 $grid-unit-40;
37
37
  position: absolute;
38
- bottom: 32px;
38
+ bottom: $grid-unit-40;
39
39
  width: 100%;
40
- background-color: #fff;
40
+ background-color: $white;
41
41
  }
42
42
 
43
43
  }
@@ -50,9 +50,10 @@
50
50
  }
51
51
 
52
52
  .font-library-modal__font-card {
53
- border: 1px solid #e5e5e5;
53
+ border: 1px solid $gray-200;
54
+ width: 100%;
54
55
  height: auto;
55
- padding: 1rem;
56
+ padding: $grid-unit-20;
56
57
  margin-top: -1px; /* To collapse the margin with the previous element */
57
58
 
58
59
  .font-library-modal__font-card__name {
@@ -60,30 +61,29 @@
60
61
  }
61
62
 
62
63
  .font-library-modal__font-card__count {
63
- color: #6e6e6e;
64
+ color: $gray-700;
64
65
  }
65
66
  }
66
67
 
67
68
  .font-library-modal__library-font-variant {
68
- border: 1px solid #e5e5e5;
69
- padding: 1rem;
69
+ border: 1px solid $gray-200;
70
+ padding: $grid-unit-20;
70
71
  margin-top: -1px; /* To collapse the margin with the previous element */
71
72
  }
72
73
 
73
74
  .font-library-modal__font-variant {
74
- border-bottom: 1px solid #e5e5e5;
75
- padding-bottom: 1rem;
75
+ border-bottom: 1px solid $gray-200;
76
+ padding-bottom: $grid-unit-20;
76
77
  }
77
78
 
78
79
  .font-library-modal__tabs {
79
80
  [role="tablist"] {
80
81
  position: sticky;
81
82
  top: 0;
82
- width: calc(100% + 64px);
83
- border-bottom: 1px solid #e6e6e6;
84
- background: #fff;
85
- margin: 0 -32px;
86
- padding: 0 16px;
83
+ border-bottom: 1px solid $gray-300;
84
+ background: $white;
85
+ margin: 0 #{$grid-unit-40 * -1};
86
+ padding: 0 $grid-unit-20;
87
87
  z-index: 1;
88
88
  }
89
89
  }
@@ -92,12 +92,12 @@
92
92
  align-items: center;
93
93
  display: flex;
94
94
  justify-content: center;
95
- height: 250px;
95
+ height: $grid-unit-80 * 4; // 256px
96
96
  width: 100%;
97
97
  }
98
98
 
99
99
  button.font-library-modal__upload-area {
100
- background-color: #f0f0f0;
100
+ background-color: $gray-100;
101
101
  }
102
102
 
103
103
  .font-library-modal__local-fonts {
@@ -105,7 +105,7 @@ button.font-library-modal__upload-area {
105
105
  width: 80%;
106
106
 
107
107
  .font-library-modal__upload-area__text {
108
- color: #6e6e6e;
108
+ color: $gray-700;
109
109
  }
110
110
 
111
111
  .font-library-modal__upload-area__notice {
@@ -113,14 +113,6 @@ button.font-library-modal__upload-area {
113
113
  }
114
114
  }
115
115
 
116
- .font-library-modal__font-name {
117
- font-weight: bold;
118
- }
119
-
120
- .font-library-modal__font-filename {
121
- color: #6e6e6e;
122
- }
123
-
124
116
  .font-library-modal__font-variant_demo-wrapper {
125
117
  white-space: nowrap;
126
118
  overflow: hidden;
@@ -153,7 +145,3 @@ button.font-library-modal__upload-area {
153
145
  max-width: 350px;
154
146
  }
155
147
  }
156
-
157
- .font-library-modal__font-collection__notice {
158
- margin: 0;
159
- }
@@ -22,32 +22,36 @@ function TabPanelLayout( {
22
22
  <div className="font-library-modal__tabpanel-layout">
23
23
  <Spacer margin={ 4 } />
24
24
  <VStack spacing={ 4 } justify="space-between">
25
- <header>
26
- <VStack spacing={ 2 }>
27
- <HStack justify="flex-start">
28
- { !! handleBack && (
29
- <Button
30
- variant="tertiary"
31
- onClick={ handleBack }
32
- icon={ chevronLeft }
33
- size="small"
34
- />
35
- ) }
36
- { title && (
37
- <Heading
38
- level={ 2 }
39
- size={ 13 }
40
- className="edit-site-global-styles-header"
41
- >
42
- { title }
43
- </Heading>
44
- ) }
45
- </HStack>
46
- { description && <Text>{ description }</Text> }
47
- </VStack>
48
- </header>
49
- <main>{ children }</main>
50
- { footer && <footer>{ footer }</footer> }
25
+ <VStack spacing={ 2 }>
26
+ <HStack justify="flex-start">
27
+ { !! handleBack && (
28
+ <Button
29
+ variant="tertiary"
30
+ onClick={ handleBack }
31
+ icon={ chevronLeft }
32
+ size="small"
33
+ />
34
+ ) }
35
+ { title && (
36
+ <Heading
37
+ level={ 2 }
38
+ size={ 13 }
39
+ className="edit-site-global-styles-header"
40
+ >
41
+ { title }
42
+ </Heading>
43
+ ) }
44
+ </HStack>
45
+ { description && <Text>{ description }</Text> }
46
+ </VStack>
47
+ <div className="font-library-modal__tabpanel-layout__main">
48
+ { children }
49
+ </div>
50
+ { footer && (
51
+ <div className="font-library-modal__tabpanel-layout__footer">
52
+ { footer }
53
+ </div>
54
+ ) }
51
55
  </VStack>
52
56
  </div>
53
57
  );
@@ -1,16 +1,33 @@
1
+ /**
2
+ * Filters a list of fonts based on the specified filters.
3
+ *
4
+ * This function filters a given array of fonts based on the criteria provided in the filters object.
5
+ * It supports filtering by category and a search term. If the category is provided and not equal to 'all',
6
+ * the function filters the fonts array to include only those fonts that belong to the specified category.
7
+ * Additionally, if a search term is provided, it filters the fonts array to include only those fonts
8
+ * whose name includes the search term, case-insensitively.
9
+ *
10
+ * @param {Array} fonts Array of font objects in font-collection schema fashion to be filtered. Each font object should have a 'categories' property and a 'font_family_settings' property with a 'name' key.
11
+ * @param {Object} filters Object containing the filter criteria. It should have a 'category' key and/or a 'search' key.
12
+ * The 'category' key is a string representing the category to filter by.
13
+ * The 'search' key is a string representing the search term to filter by.
14
+ * @return {Array} Array of filtered font objects based on the provided criteria.
15
+ */
1
16
  export default function filterFonts( fonts, filters ) {
2
17
  const { category, search } = filters;
3
18
  let filteredFonts = fonts || [];
4
19
 
5
20
  if ( category && category !== 'all' ) {
6
21
  filteredFonts = filteredFonts.filter(
7
- ( font ) => font.category === category
22
+ ( font ) => font.categories.indexOf( category ) !== -1
8
23
  );
9
24
  }
10
25
 
11
26
  if ( search ) {
12
27
  filteredFonts = filteredFonts.filter( ( font ) =>
13
- font.name.toLowerCase().includes( search.toLowerCase() )
28
+ font.font_family_settings.name
29
+ .toLowerCase()
30
+ .includes( search.toLowerCase() )
14
31
  );
15
32
  }
16
33
 
@@ -8,6 +8,13 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
8
8
  */
9
9
  import { FONT_WEIGHTS, FONT_STYLES } from './constants';
10
10
  import { unlock } from '../../../../lock-unlock';
11
+ import { fetchInstallFontFace } from '../resolvers';
12
+ import { formatFontFamily } from './preview-styles';
13
+
14
+ /**
15
+ * Browser dependencies
16
+ */
17
+ const { File } = window;
11
18
 
12
19
  export function setUIValuesNeeded( font, extraValues = {} ) {
13
20
  if ( ! font.name && ( font.fontFamily || font.slug ) ) {
@@ -87,13 +94,18 @@ export async function loadFontFaceInBrowser( fontFace, source, addTo = 'all' ) {
87
94
  // eslint-disable-next-line no-undef
88
95
  } else if ( source instanceof File ) {
89
96
  dataSource = await source.arrayBuffer();
97
+ } else {
98
+ return;
90
99
  }
91
100
 
92
- // eslint-disable-next-line no-undef
93
- const newFont = new FontFace( fontFace.fontFamily, dataSource, {
94
- style: fontFace.fontStyle,
95
- weight: fontFace.fontWeight,
96
- } );
101
+ const newFont = new window.FontFace(
102
+ formatFontFamily( fontFace.fontFamily ),
103
+ dataSource,
104
+ {
105
+ style: fontFace.fontStyle,
106
+ weight: fontFace.fontWeight,
107
+ }
108
+ );
97
109
 
98
110
  const loadedFace = await newFont.load();
99
111
 
@@ -130,37 +142,132 @@ export function getDisplaySrcFromFontFace( input, urlPrefix ) {
130
142
  return src;
131
143
  }
132
144
 
133
- export function makeFormDataFromFontFamily( fontFamily ) {
145
+ export function makeFontFamilyFormData( fontFamily ) {
134
146
  const formData = new FormData();
135
147
  const { kebabCase } = unlock( componentsPrivateApis );
136
148
 
137
- const newFontFamily = {
138
- ...fontFamily,
149
+ const { fontFace, category, ...familyWithValidParameters } = fontFamily;
150
+ const fontFamilySettings = {
151
+ ...familyWithValidParameters,
139
152
  slug: kebabCase( fontFamily.slug ),
140
153
  };
141
154
 
142
- if ( newFontFamily?.fontFace ) {
143
- const newFontFaces = newFontFamily.fontFace.map(
144
- ( face, faceIndex ) => {
145
- if ( face.file ) {
146
- // Slugified file name because the it might contain spaces or characters treated differently on the server.
147
- const fileId = `file-${ faceIndex }`;
148
- // Add the files to the formData
149
- formData.append( fileId, face.file, face.file.name );
150
- // remove the file object from the face object the file is referenced by the uploadedFile key
151
- const { file, ...faceWithoutFileProperty } = face;
152
- const newFace = {
153
- ...faceWithoutFileProperty,
154
- uploadedFile: fileId,
155
- };
156
- return newFace;
157
- }
158
- return face;
155
+ formData.append(
156
+ 'font_family_settings',
157
+ JSON.stringify( fontFamilySettings )
158
+ );
159
+ return formData;
160
+ }
161
+
162
+ export function makeFontFacesFormData( font ) {
163
+ if ( font?.fontFace ) {
164
+ const fontFacesFormData = font.fontFace.map( ( face, faceIndex ) => {
165
+ const formData = new FormData();
166
+ if ( face.file ) {
167
+ // Slugified file name because the it might contain spaces or characters treated differently on the server.
168
+ const fileId = `file-${ faceIndex }`;
169
+ // Add the files to the formData
170
+ formData.append( fileId, face.file, face.file.name );
171
+ // remove the file object from the face object the file is referenced in src
172
+ const { file, ...faceWithoutFileProperty } = face;
173
+ const fontFaceSettings = {
174
+ ...faceWithoutFileProperty,
175
+ src: fileId,
176
+ };
177
+ formData.append(
178
+ 'font_face_settings',
179
+ JSON.stringify( fontFaceSettings )
180
+ );
181
+ } else {
182
+ formData.append( 'font_face_settings', JSON.stringify( face ) );
159
183
  }
160
- );
161
- newFontFamily.fontFace = newFontFaces;
184
+ return formData;
185
+ } );
186
+
187
+ return fontFacesFormData;
162
188
  }
189
+ }
163
190
 
164
- formData.append( 'font_family_settings', JSON.stringify( newFontFamily ) );
165
- return formData;
191
+ export async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {
192
+ const promises = fontFacesData.map( ( faceData ) =>
193
+ fetchInstallFontFace( fontFamilyId, faceData )
194
+ );
195
+ const responses = await Promise.allSettled( promises );
196
+
197
+ const results = {
198
+ errors: [],
199
+ successes: [],
200
+ };
201
+
202
+ responses.forEach( ( result, index ) => {
203
+ if ( result.status === 'fulfilled' ) {
204
+ const response = result.value;
205
+ if ( response.id ) {
206
+ results.successes.push( response );
207
+ } else {
208
+ results.errors.push( {
209
+ data: fontFacesData[ index ],
210
+ message: `Error: ${ response.message }`,
211
+ } );
212
+ }
213
+ } else {
214
+ // Handle network errors or other fetch-related errors
215
+ results.errors.push( {
216
+ data: fontFacesData[ index ],
217
+ message: `Fetch error: ${ result.reason.message }`,
218
+ } );
219
+ }
220
+ } );
221
+
222
+ return results;
223
+ }
224
+
225
+ /*
226
+ * Downloads a font face asset from a URL to the client and returns a File object.
227
+ */
228
+ export async function downloadFontFaceAsset( url ) {
229
+ return fetch( new Request( url ) )
230
+ .then( ( response ) => {
231
+ if ( ! response.ok ) {
232
+ throw new Error(
233
+ `Error downloading font face asset from ${ url }. Server responded with status: ${ response.status }`
234
+ );
235
+ }
236
+ return response.blob();
237
+ } )
238
+ .then( ( blob ) => {
239
+ const filename = url.split( '/' ).pop();
240
+ const file = new File( [ blob ], filename, {
241
+ type: blob.type,
242
+ } );
243
+ return file;
244
+ } )
245
+ .catch( ( error ) => {
246
+ // eslint-disable-next-line no-console
247
+ console.error(
248
+ `Error downloading font face asset from ${ url }:`,
249
+ error
250
+ );
251
+ throw error;
252
+ } );
253
+ }
254
+
255
+ /*
256
+ * Determine if a given Font Face is present in a given collection.
257
+ * We determine that a font face has been installed by comparing the fontWeight and fontStyle
258
+ *
259
+ * @param {Object} fontFace The Font Face to seek
260
+ * @param {Array} collection The Collection to seek in
261
+ * @returns True if the font face is found in the collection. Otherwise False.
262
+ */
263
+ export function checkFontFaceInstalled( fontFace, collection ) {
264
+ return (
265
+ -1 !==
266
+ collection.findIndex( ( collectionFontFace ) => {
267
+ return (
268
+ collectionFontFace.fontWeight === fontFace.fontWeight &&
269
+ collectionFontFace.fontStyle === fontFace.fontStyle
270
+ );
271
+ } )
272
+ );
166
273
  }
@@ -35,9 +35,13 @@ export function formatFontFamily( input ) {
35
35
  .split( ',' )
36
36
  .map( ( font ) => {
37
37
  font = font.trim(); // Remove any leading or trailing white spaces
38
- // If the font doesn't have single quotes and contains a space, then add single quotes around it
39
- if ( ! font.startsWith( "'" ) && font.indexOf( ' ' ) !== -1 ) {
40
- return `'${ font }'`;
38
+ // If the font doesn't start with quotes and contains a space, then wrap in quotes.
39
+ // Check that string starts with a single or double quote and not a space
40
+ if (
41
+ ! ( font.startsWith( '"' ) || font.startsWith( "'" ) ) &&
42
+ font.indexOf( ' ' ) !== -1
43
+ ) {
44
+ return `"${ font }"`;
41
45
  }
42
46
  return font; // Return font as is if no transformation is needed
43
47
  } )
@@ -5,11 +5,26 @@ import filterFonts from '../filter-fonts';
5
5
 
6
6
  describe( 'filterFonts', () => {
7
7
  const mockFonts = [
8
- { name: 'Arial', category: 'sans-serif' },
9
- { name: 'Arial Condensed', category: 'sans-serif' },
10
- { name: 'Times New Roman', category: 'serif' },
11
- { name: 'Courier New', category: 'monospace' },
12
- { name: 'Romantic', category: 'cursive' },
8
+ {
9
+ font_family_settings: { name: 'Arial' },
10
+ categories: [ 'sans-serif' ],
11
+ },
12
+ {
13
+ font_family_settings: { name: 'Arial Condensed' },
14
+ categories: [ 'sans-serif' ],
15
+ },
16
+ {
17
+ font_family_settings: { name: 'Times New Roman' },
18
+ categories: [ 'serif' ],
19
+ },
20
+ {
21
+ font_family_settings: { name: 'Courier New' },
22
+ categories: [ 'monospace' ],
23
+ },
24
+ {
25
+ font_family_settings: { name: 'Romantic' },
26
+ categories: [ 'cursive' ],
27
+ },
13
28
  ];
14
29
 
15
30
  it( 'should return all fonts if no filters are provided', () => {
@@ -20,7 +35,10 @@ describe( 'filterFonts', () => {
20
35
  it( 'should filter by category', () => {
21
36
  const result = filterFonts( mockFonts, { category: 'serif' } );
22
37
  expect( result ).toEqual( [
23
- { name: 'Times New Roman', category: 'serif' },
38
+ {
39
+ font_family_settings: { name: 'Times New Roman' },
40
+ categories: [ 'serif' ],
41
+ },
24
42
  ] );
25
43
  } );
26
44
 
@@ -32,15 +50,24 @@ describe( 'filterFonts', () => {
32
50
  it( 'should filter by search', () => {
33
51
  const result = filterFonts( mockFonts, { search: 'ari' } );
34
52
  expect( result ).toEqual( [
35
- { name: 'Arial', category: 'sans-serif' },
36
- { name: 'Arial Condensed', category: 'sans-serif' },
53
+ {
54
+ font_family_settings: { name: 'Arial' },
55
+ categories: [ 'sans-serif' ],
56
+ },
57
+ {
58
+ font_family_settings: { name: 'Arial Condensed' },
59
+ categories: [ 'sans-serif' ],
60
+ },
37
61
  ] );
38
62
  } );
39
63
 
40
64
  it( 'should be case insensitive when filtering by search', () => {
41
65
  const result = filterFonts( mockFonts, { search: 'RoMANtic' } );
42
66
  expect( result ).toEqual( [
43
- { name: 'Romantic', category: 'cursive' },
67
+ {
68
+ font_family_settings: { name: 'Romantic' },
69
+ categories: [ 'cursive' ],
70
+ },
44
71
  ] );
45
72
  } );
46
73
 
@@ -50,7 +77,10 @@ describe( 'filterFonts', () => {
50
77
  search: 'Times',
51
78
  } );
52
79
  expect( result ).toEqual( [
53
- { name: 'Times New Roman', category: 'serif' },
80
+ {
81
+ font_family_settings: { name: 'Times New Roman' },
82
+ categories: [ 'serif' ],
83
+ },
54
84
  ] );
55
85
  } );
56
86
 
@@ -123,13 +123,13 @@ describe( 'getFamilyPreviewStyle', () => {
123
123
  describe( 'formatFontFamily', () => {
124
124
  it( 'should transform "Baloo 2, system-ui" correctly', () => {
125
125
  expect( formatFontFamily( 'Baloo 2, system-ui' ) ).toBe(
126
- "'Baloo 2', system-ui"
126
+ '"Baloo 2", system-ui'
127
127
  );
128
128
  } );
129
129
 
130
130
  it( 'should ignore extra spaces', () => {
131
131
  expect( formatFontFamily( ' Baloo 2 , system-ui' ) ).toBe(
132
- "'Baloo 2', system-ui"
132
+ '"Baloo 2", system-ui'
133
133
  );
134
134
  } );
135
135
 
@@ -144,18 +144,18 @@ describe( 'formatFontFamily', () => {
144
144
  } );
145
145
 
146
146
  it( 'should wrap single font name with spaces in quotes', () => {
147
- expect( formatFontFamily( 'Baloo 2' ) ).toBe( "'Baloo 2'" );
147
+ expect( formatFontFamily( 'Baloo 2' ) ).toBe( '"Baloo 2"' );
148
148
  } );
149
149
 
150
150
  it( 'should wrap multiple font names with spaces in quotes', () => {
151
151
  expect( formatFontFamily( 'Baloo Bhai 2, Baloo 2' ) ).toBe(
152
- "'Baloo Bhai 2', 'Baloo 2'"
152
+ '"Baloo Bhai 2", "Baloo 2"'
153
153
  );
154
154
  } );
155
155
 
156
156
  it( 'should wrap only those font names with spaces which are not already quoted', () => {
157
157
  expect( formatFontFamily( 'Baloo Bhai 2, Arial' ) ).toBe(
158
- "'Baloo Bhai 2', Arial"
158
+ '"Baloo Bhai 2", Arial'
159
159
  );
160
160
  } );
161
161
  } );
@@ -109,6 +109,16 @@ function ScreenBlock( { name, variation } ) {
109
109
  settings.spacing.blockGap = false;
110
110
  }
111
111
 
112
+ // Only allow `aspectRatio` support if the block is not the grouping block.
113
+ // The grouping block allows the user to use Group, Row and Stack variations,
114
+ // and it is highly likely that the user will not want to set an aspect ratio
115
+ // for all three at once. Until there is the ability to set a different aspect
116
+ // ratio for each variation, we disable the aspect ratio controls for the
117
+ // grouping block in global styles.
118
+ if ( settings?.dimensions?.aspectRatio && name === 'core/group' ) {
119
+ settings.dimensions.aspectRatio = false;
120
+ }
121
+
112
122
  const blockVariations = useBlockVariations( name );
113
123
  const hasTypographyPanel = useHasTypographyPanel( settings );
114
124
  const hasColorPanel = useHasColorPanel( settings );