@wordpress/edit-site 5.29.0 → 5.30.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 (364) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +1 -1
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/block-editor/editor-canvas.js +10 -11
  5. package/build/components/block-editor/editor-canvas.js.map +1 -1
  6. package/build/components/editor/index.js +1 -15
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/global-styles/color-palette-panel.js +9 -0
  9. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  10. package/build/components/global-styles/font-families.js +1 -1
  11. package/build/components/global-styles/font-families.js.map +1 -1
  12. package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -2
  13. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/context.js +62 -58
  15. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/font-card.js +10 -15
  17. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +118 -76
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-demo.js +29 -8
  21. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/index.js +19 -6
  23. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +151 -79
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  27. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js +8 -14
  29. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/index.js +38 -4
  31. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
  33. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  34. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  35. package/build/components/global-styles/header.js +1 -1
  36. package/build/components/global-styles/header.js.map +1 -1
  37. package/build/components/global-styles/highlighted-colors.js +50 -0
  38. package/build/components/global-styles/highlighted-colors.js.map +1 -0
  39. package/build/components/global-styles/preview-colors.js +62 -0
  40. package/build/components/global-styles/preview-colors.js.map +1 -0
  41. package/build/components/global-styles/preview-iframe.js +131 -0
  42. package/build/components/global-styles/preview-iframe.js.map +1 -0
  43. package/build/components/global-styles/preview-styles.js +163 -0
  44. package/build/components/global-styles/preview-styles.js.map +1 -0
  45. package/build/components/global-styles/preview-typography.js +65 -0
  46. package/build/components/global-styles/preview-typography.js.map +1 -0
  47. package/build/components/global-styles/screen-block-list.js +1 -1
  48. package/build/components/global-styles/screen-block-list.js.map +1 -1
  49. package/build/components/global-styles/screen-block.js +1 -1
  50. package/build/components/global-styles/screen-block.js.map +1 -1
  51. package/build/components/global-styles/screen-colors.js +10 -2
  52. package/build/components/global-styles/screen-colors.js.map +1 -1
  53. package/build/components/global-styles/screen-revisions/index.js +2 -2
  54. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  55. package/build/components/global-styles/screen-root.js +2 -2
  56. package/build/components/global-styles/screen-root.js.map +1 -1
  57. package/build/components/global-styles/screen-typography.js +10 -2
  58. package/build/components/global-styles/screen-typography.js.map +1 -1
  59. package/build/components/global-styles/style-variations-container.js +12 -84
  60. package/build/components/global-styles/style-variations-container.js.map +1 -1
  61. package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
  62. package/build/components/global-styles/typography-elements.js.map +1 -0
  63. package/build/components/global-styles/ui.js +27 -2
  64. package/build/components/global-styles/ui.js.map +1 -1
  65. package/build/components/global-styles/utils.js +22 -0
  66. package/build/components/global-styles/utils.js.map +1 -1
  67. package/build/components/global-styles/variations/variation.js +90 -0
  68. package/build/components/global-styles/variations/variation.js.map +1 -0
  69. package/build/components/global-styles/variations/variations-color.js +36 -0
  70. package/build/components/global-styles/variations/variations-color.js.map +1 -0
  71. package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
  72. package/build/components/global-styles/variations/variations-panel.js.map +1 -0
  73. package/build/components/global-styles/variations/variations-typography.js +64 -0
  74. package/build/components/global-styles/variations/variations-typography.js.map +1 -0
  75. package/build/components/header-edit-mode/index.js +12 -11
  76. package/build/components/header-edit-mode/index.js.map +1 -1
  77. package/build/components/header-edit-mode/more-menu/index.js +10 -2
  78. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  79. package/build/components/layout/index.js +4 -1
  80. package/build/components/layout/index.js.map +1 -1
  81. package/build/components/page-patterns/index.js +14 -14
  82. package/build/components/page-patterns/index.js.map +1 -1
  83. package/build/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
  84. package/build/components/page-templates-template-parts/hooks.js.map +1 -0
  85. package/build/components/page-templates-template-parts/index.js +14 -6
  86. package/build/components/page-templates-template-parts/index.js.map +1 -1
  87. package/build/components/resizable-frame/index.js +2 -1
  88. package/build/components/resizable-frame/index.js.map +1 -1
  89. package/build/components/revisions/index.js.map +1 -1
  90. package/build/components/save-panel/index.js +18 -3
  91. package/build/components/save-panel/index.js.map +1 -1
  92. package/build/components/sidebar/index.js +1 -1
  93. package/build/components/sidebar/index.js.map +1 -1
  94. package/build/components/sidebar-dataviews/default-views.js +2 -0
  95. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  96. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  97. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  98. package/build/components/sidebar-navigation-screen-main/index.js +1 -2
  99. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  100. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
  102. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  105. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
  106. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-template/index.js +2 -2
  108. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  109. package/build/components/sidebar-navigation-screen-templates-browse/content.js +4 -4
  110. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  111. package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
  112. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  113. package/build/components/start-template-options/index.js.map +1 -1
  114. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -0
  115. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  116. package/build-module/components/actions/index.js +1 -1
  117. package/build-module/components/actions/index.js.map +1 -1
  118. package/build-module/components/block-editor/editor-canvas.js +10 -11
  119. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  120. package/build-module/components/editor/index.js +2 -16
  121. package/build-module/components/editor/index.js.map +1 -1
  122. package/build-module/components/global-styles/color-palette-panel.js +8 -0
  123. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  124. package/build-module/components/global-styles/font-families.js +1 -1
  125. package/build-module/components/global-styles/font-families.js.map +1 -1
  126. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
  127. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  128. package/build-module/components/global-styles/font-library-modal/context.js +63 -59
  129. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  130. package/build-module/components/global-styles/font-library-modal/font-card.js +11 -16
  131. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  132. package/build-module/components/global-styles/font-library-modal/font-collection.js +121 -79
  133. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  134. package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -9
  135. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  136. package/build-module/components/global-styles/font-library-modal/index.js +19 -6
  137. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  138. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +151 -79
  139. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  140. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +4 -4
  141. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  142. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +9 -15
  143. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  144. package/build-module/components/global-styles/font-library-modal/utils/index.js +37 -4
  145. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  146. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
  147. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  148. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  149. package/build-module/components/global-styles/header.js +1 -1
  150. package/build-module/components/global-styles/header.js.map +1 -1
  151. package/build-module/components/global-styles/highlighted-colors.js +43 -0
  152. package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
  153. package/build-module/components/global-styles/preview-colors.js +54 -0
  154. package/build-module/components/global-styles/preview-colors.js.map +1 -0
  155. package/build-module/components/global-styles/preview-iframe.js +124 -0
  156. package/build-module/components/global-styles/preview-iframe.js.map +1 -0
  157. package/build-module/components/global-styles/preview-styles.js +155 -0
  158. package/build-module/components/global-styles/preview-styles.js.map +1 -0
  159. package/build-module/components/global-styles/preview-typography.js +58 -0
  160. package/build-module/components/global-styles/preview-typography.js.map +1 -0
  161. package/build-module/components/global-styles/screen-block-list.js +1 -1
  162. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  163. package/build-module/components/global-styles/screen-block.js +1 -1
  164. package/build-module/components/global-styles/screen-block.js.map +1 -1
  165. package/build-module/components/global-styles/screen-colors.js +10 -2
  166. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  167. package/build-module/components/global-styles/screen-revisions/index.js +2 -2
  168. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  169. package/build-module/components/global-styles/screen-root.js +2 -2
  170. package/build-module/components/global-styles/screen-root.js.map +1 -1
  171. package/build-module/components/global-styles/screen-typography.js +10 -2
  172. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  173. package/build-module/components/global-styles/style-variations-container.js +13 -85
  174. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  175. package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
  176. package/build-module/components/global-styles/typography-elements.js.map +1 -0
  177. package/build-module/components/global-styles/ui.js +27 -2
  178. package/build-module/components/global-styles/ui.js.map +1 -1
  179. package/build-module/components/global-styles/utils.js +21 -0
  180. package/build-module/components/global-styles/utils.js.map +1 -1
  181. package/build-module/components/global-styles/variations/variation.js +82 -0
  182. package/build-module/components/global-styles/variations/variation.js.map +1 -0
  183. package/build-module/components/global-styles/variations/variations-color.js +28 -0
  184. package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
  185. package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
  186. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
  187. package/build-module/components/global-styles/variations/variations-typography.js +56 -0
  188. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
  189. package/build-module/components/header-edit-mode/index.js +13 -12
  190. package/build-module/components/header-edit-mode/index.js.map +1 -1
  191. package/build-module/components/header-edit-mode/more-menu/index.js +13 -5
  192. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  193. package/build-module/components/layout/index.js +4 -1
  194. package/build-module/components/layout/index.js.map +1 -1
  195. package/build-module/components/page-patterns/index.js +14 -14
  196. package/build-module/components/page-patterns/index.js.map +1 -1
  197. package/build-module/components/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
  198. package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
  199. package/build-module/components/page-templates-template-parts/index.js +13 -5
  200. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  201. package/build-module/components/resizable-frame/index.js +2 -1
  202. package/build-module/components/resizable-frame/index.js.map +1 -1
  203. package/build-module/components/revisions/index.js.map +1 -1
  204. package/build-module/components/save-panel/index.js +18 -3
  205. package/build-module/components/save-panel/index.js.map +1 -1
  206. package/build-module/components/sidebar/index.js +1 -1
  207. package/build-module/components/sidebar/index.js.map +1 -1
  208. package/build-module/components/sidebar-dataviews/default-views.js +3 -1
  209. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  210. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  211. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  212. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
  213. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  215. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
  216. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  217. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  218. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  219. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  220. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  221. package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
  222. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  223. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  224. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  225. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
  226. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  227. package/build-module/components/start-template-options/index.js.map +1 -1
  228. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +63 -1
  229. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  230. package/build-style/style-rtl.css +163 -286
  231. package/build-style/style.css +163 -286
  232. package/package.json +42 -42
  233. package/src/components/actions/index.js +1 -1
  234. package/src/components/block-editor/editor-canvas.js +13 -12
  235. package/src/components/block-editor/style.scss +0 -3
  236. package/src/components/editor/index.js +0 -20
  237. package/src/components/global-styles/color-palette-panel.js +11 -1
  238. package/src/components/global-styles/font-families.js +1 -1
  239. package/src/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
  240. package/src/components/global-styles/font-library-modal/context.js +116 -104
  241. package/src/components/global-styles/font-library-modal/font-card.js +11 -26
  242. package/src/components/global-styles/font-library-modal/font-collection.js +297 -218
  243. package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
  244. package/src/components/global-styles/font-library-modal/index.js +23 -16
  245. package/src/components/global-styles/font-library-modal/installed-fonts.js +243 -114
  246. package/src/components/global-styles/font-library-modal/library-font-variant.js +5 -5
  247. package/src/components/global-styles/font-library-modal/style.scss +15 -8
  248. package/src/components/global-styles/font-library-modal/upload-fonts.js +17 -19
  249. package/src/components/global-styles/font-library-modal/utils/index.js +44 -4
  250. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +2 -1
  251. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +7 -18
  252. package/src/components/global-styles/gradients-palette-panel.js +2 -2
  253. package/src/components/global-styles/header.js +1 -1
  254. package/src/components/global-styles/highlighted-colors.js +39 -0
  255. package/src/components/global-styles/preview-colors.js +61 -0
  256. package/src/components/global-styles/preview-iframe.js +153 -0
  257. package/src/components/global-styles/preview-styles.js +185 -0
  258. package/src/components/global-styles/preview-typography.js +62 -0
  259. package/src/components/global-styles/screen-block-list.js +1 -1
  260. package/src/components/global-styles/screen-block.js +4 -1
  261. package/src/components/global-styles/screen-colors.js +13 -1
  262. package/src/components/global-styles/screen-revisions/index.js +5 -2
  263. package/src/components/global-styles/screen-root.js +2 -2
  264. package/src/components/global-styles/screen-typography.js +19 -2
  265. package/src/components/global-styles/style-variations-container.js +14 -92
  266. package/src/components/global-styles/style.scss +0 -34
  267. package/src/components/global-styles/ui.js +26 -2
  268. package/src/components/global-styles/utils.js +37 -0
  269. package/src/components/global-styles/variations/style.scss +44 -0
  270. package/src/components/global-styles/variations/variation.js +93 -0
  271. package/src/components/global-styles/variations/variations-color.js +30 -0
  272. package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
  273. package/src/components/global-styles/variations/variations-typography.js +85 -0
  274. package/src/components/header-edit-mode/index.js +20 -27
  275. package/src/components/header-edit-mode/more-menu/index.js +17 -8
  276. package/src/components/header-edit-mode/style.scss +4 -0
  277. package/src/components/layout/index.js +5 -0
  278. package/src/components/page-patterns/index.js +21 -21
  279. package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
  280. package/src/components/page-templates-template-parts/index.js +20 -3
  281. package/src/components/page-templates-template-parts/style.scss +48 -0
  282. package/src/components/resizable-frame/index.js +1 -0
  283. package/src/components/revisions/index.js +1 -1
  284. package/src/components/save-panel/index.js +34 -12
  285. package/src/components/sidebar/index.js +1 -1
  286. package/src/components/sidebar-dataviews/default-views.js +3 -1
  287. package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
  288. package/src/components/sidebar-edit-mode/template-panel/index.js +1 -1
  289. package/src/components/sidebar-navigation-screen-main/index.js +0 -2
  290. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
  291. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
  292. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  293. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
  294. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  295. package/src/components/sidebar-navigation-screen-template/index.js +1 -1
  296. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  297. package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
  298. package/src/components/start-template-options/index.js +1 -1
  299. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +173 -0
  300. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +68 -1
  301. package/src/style.scss +2 -2
  302. package/build/components/global-styles/font-library-modal/collection-font-details.js +0 -50
  303. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
  304. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
  305. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
  306. package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
  307. package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
  308. package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
  309. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
  310. package/build/components/global-styles/preview.js +0 -271
  311. package/build/components/global-styles/preview.js.map +0 -1
  312. package/build/components/global-styles/typogrphy-elements.js.map +0 -1
  313. package/build/components/global-styles/variations-panel.js.map +0 -1
  314. package/build/components/list/added-by.js.map +0 -1
  315. package/build/components/list/header.js +0 -55
  316. package/build/components/list/header.js.map +0 -1
  317. package/build/components/list/index.js +0 -80
  318. package/build/components/list/index.js.map +0 -1
  319. package/build/components/list/table.js +0 -94
  320. package/build/components/list/table.js.map +0 -1
  321. package/build/components/list/use-register-shortcuts.js +0 -51
  322. package/build/components/list/use-register-shortcuts.js.map +0 -1
  323. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +0 -36
  324. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
  325. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
  326. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
  327. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
  328. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
  329. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
  330. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
  331. package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
  332. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
  333. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
  334. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
  335. package/build-module/components/global-styles/preview.js +0 -264
  336. package/build-module/components/global-styles/preview.js.map +0 -1
  337. package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
  338. package/build-module/components/global-styles/variations-panel.js.map +0 -1
  339. package/build-module/components/list/added-by.js.map +0 -1
  340. package/build-module/components/list/header.js +0 -47
  341. package/build-module/components/list/header.js.map +0 -1
  342. package/build-module/components/list/index.js +0 -72
  343. package/build-module/components/list/index.js.map +0 -1
  344. package/build-module/components/list/table.js +0 -86
  345. package/build-module/components/list/table.js.map +0 -1
  346. package/build-module/components/list/use-register-shortcuts.js +0 -45
  347. package/build-module/components/list/use-register-shortcuts.js.map +0 -1
  348. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -29
  349. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
  350. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -27
  351. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
  352. package/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
  353. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
  354. package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
  355. package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
  356. package/src/components/global-styles/preview.js +0 -327
  357. package/src/components/list/header.js +0 -48
  358. package/src/components/list/index.js +0 -87
  359. package/src/components/list/style.scss +0 -188
  360. package/src/components/list/table.js +0 -140
  361. package/src/components/list/use-register-shortcuts.js +0 -49
  362. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
  363. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
  364. /package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.29.0",
3
+ "version": "5.30.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,46 +27,46 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.52.0",
31
- "@wordpress/api-fetch": "^6.49.0",
32
- "@wordpress/blob": "^3.52.0",
33
- "@wordpress/block-editor": "^12.20.0",
34
- "@wordpress/block-library": "^8.29.0",
35
- "@wordpress/blocks": "^12.29.0",
36
- "@wordpress/commands": "^0.23.0",
37
- "@wordpress/components": "^27.0.0",
38
- "@wordpress/compose": "^6.29.0",
39
- "@wordpress/core-commands": "^0.21.0",
40
- "@wordpress/core-data": "^6.29.0",
41
- "@wordpress/data": "^9.22.0",
42
- "@wordpress/dataviews": "^0.6.0",
43
- "@wordpress/date": "^4.52.0",
44
- "@wordpress/deprecated": "^3.52.0",
45
- "@wordpress/dom": "^3.52.0",
46
- "@wordpress/editor": "^13.29.0",
47
- "@wordpress/element": "^5.29.0",
48
- "@wordpress/escape-html": "^2.52.0",
49
- "@wordpress/hooks": "^3.52.0",
50
- "@wordpress/html-entities": "^3.52.0",
51
- "@wordpress/i18n": "^4.52.0",
52
- "@wordpress/icons": "^9.43.0",
53
- "@wordpress/interface": "^5.29.0",
54
- "@wordpress/keyboard-shortcuts": "^4.29.0",
55
- "@wordpress/keycodes": "^3.52.0",
56
- "@wordpress/media-utils": "^4.43.0",
57
- "@wordpress/notices": "^4.20.0",
58
- "@wordpress/patterns": "^1.13.0",
59
- "@wordpress/plugins": "^6.20.0",
60
- "@wordpress/preferences": "^3.29.0",
61
- "@wordpress/primitives": "^3.50.0",
62
- "@wordpress/private-apis": "^0.34.0",
63
- "@wordpress/reusable-blocks": "^4.29.0",
64
- "@wordpress/router": "^0.21.0",
65
- "@wordpress/style-engine": "^1.35.0",
66
- "@wordpress/url": "^3.53.0",
67
- "@wordpress/viewport": "^5.29.0",
68
- "@wordpress/widgets": "^3.29.0",
69
- "@wordpress/wordcount": "^3.52.0",
30
+ "@wordpress/a11y": "^3.53.0",
31
+ "@wordpress/api-fetch": "^6.50.0",
32
+ "@wordpress/blob": "^3.53.0",
33
+ "@wordpress/block-editor": "^12.21.0",
34
+ "@wordpress/block-library": "^8.30.0",
35
+ "@wordpress/blocks": "^12.30.0",
36
+ "@wordpress/commands": "^0.24.0",
37
+ "@wordpress/components": "^27.1.0",
38
+ "@wordpress/compose": "^6.30.0",
39
+ "@wordpress/core-commands": "^0.22.0",
40
+ "@wordpress/core-data": "^6.30.0",
41
+ "@wordpress/data": "^9.23.0",
42
+ "@wordpress/dataviews": "^0.7.0",
43
+ "@wordpress/date": "^4.53.0",
44
+ "@wordpress/deprecated": "^3.53.0",
45
+ "@wordpress/dom": "^3.53.0",
46
+ "@wordpress/editor": "^13.30.0",
47
+ "@wordpress/element": "^5.30.0",
48
+ "@wordpress/escape-html": "^2.53.0",
49
+ "@wordpress/hooks": "^3.53.0",
50
+ "@wordpress/html-entities": "^3.53.0",
51
+ "@wordpress/i18n": "^4.53.0",
52
+ "@wordpress/icons": "^9.44.0",
53
+ "@wordpress/interface": "^5.30.0",
54
+ "@wordpress/keyboard-shortcuts": "^4.30.0",
55
+ "@wordpress/keycodes": "^3.53.0",
56
+ "@wordpress/media-utils": "^4.44.0",
57
+ "@wordpress/notices": "^4.21.0",
58
+ "@wordpress/patterns": "^1.14.0",
59
+ "@wordpress/plugins": "^6.21.0",
60
+ "@wordpress/preferences": "^3.30.0",
61
+ "@wordpress/primitives": "^3.51.0",
62
+ "@wordpress/private-apis": "^0.35.0",
63
+ "@wordpress/reusable-blocks": "^4.30.0",
64
+ "@wordpress/router": "^0.22.0",
65
+ "@wordpress/style-engine": "^1.36.0",
66
+ "@wordpress/url": "^3.54.0",
67
+ "@wordpress/viewport": "^5.30.0",
68
+ "@wordpress/widgets": "^3.30.0",
69
+ "@wordpress/wordcount": "^3.53.0",
70
70
  "change-case": "^4.1.2",
71
71
  "classnames": "^2.3.1",
72
72
  "client-zip": "^2.4.4",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "c139588f4c668b38bafbc5431f2f4e3903dbe683"
89
+ "gitHead": "ac3c3e465a083081a86a4da6ee6fb817b41e5130"
90
90
  }
@@ -362,7 +362,7 @@ export const viewPostAction = {
362
362
  },
363
363
  callback( posts ) {
364
364
  const post = posts[ 0 ];
365
- document.location.href = post.link;
365
+ window.open( post.link, '_blank' );
366
366
  },
367
367
  };
368
368
 
@@ -26,10 +26,9 @@ import {
26
26
  const { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );
27
27
 
28
28
  function EditorCanvas( { enableResizing, settings, children, ...props } ) {
29
- const { hasBlocks, isFocusMode, templateType, canvasMode, isZoomOutMode } =
30
- useSelect( ( select ) => {
31
- const { getBlockCount, __unstableGetEditorMode } =
32
- select( blockEditorStore );
29
+ const { hasBlocks, isFocusMode, templateType, canvasMode } = useSelect(
30
+ ( select ) => {
31
+ const { getBlockCount } = select( blockEditorStore );
33
32
  const { getEditedPostType, getCanvasMode } = unlock(
34
33
  select( editSiteStore )
35
34
  );
@@ -38,11 +37,12 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
38
37
  return {
39
38
  templateType: _templateType,
40
39
  isFocusMode: FOCUSABLE_ENTITIES.includes( _templateType ),
41
- isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
42
40
  canvasMode: getCanvasMode(),
43
41
  hasBlocks: !! getBlockCount(),
44
42
  };
45
- }, [] );
43
+ },
44
+ []
45
+ );
46
46
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
47
47
  const [ isFocused, setIsFocused ] = useState( false );
48
48
 
@@ -52,8 +52,11 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
52
52
  }
53
53
  }, [ canvasMode ] );
54
54
 
55
- const viewModeProps = {
56
- 'aria-label': __( 'Editor Canvas' ),
55
+ // In view mode, make the canvas iframe be perceived and behave as a button
56
+ // to switch to edit mode, with a meaningful label and no title attribute.
57
+ const viewModeIframeProps = {
58
+ 'aria-label': __( 'Edit' ),
59
+ title: null,
57
60
  role: 'button',
58
61
  tabIndex: 0,
59
62
  onFocus: () => setIsFocused( true ),
@@ -107,9 +110,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
107
110
  renderAppender={ showBlockAppender }
108
111
  styles={ styles }
109
112
  iframeProps={ {
110
- expand: isZoomOutMode,
111
- scale: isZoomOutMode ? 0.45 : undefined,
112
- frameSize: isZoomOutMode ? 100 : undefined,
113
+ shouldZoom: true,
113
114
  className: classnames(
114
115
  'edit-site-visual-editor__editor-canvas',
115
116
  {
@@ -117,7 +118,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
117
118
  }
118
119
  ),
119
120
  ...props,
120
- ...( canvasMode === 'view' ? viewModeProps : {} ),
121
+ ...( canvasMode === 'view' ? viewModeIframeProps : {} ),
121
122
  } }
122
123
  >
123
124
  { children }
@@ -22,7 +22,6 @@
22
22
  position: relative;
23
23
  height: 100%;
24
24
  display: block;
25
- overflow: hidden;
26
25
  background-color: $gray-300;
27
26
  // Centralize the editor horizontally (flex-direction is column).
28
27
  align-items: center;
@@ -62,8 +61,6 @@
62
61
 
63
62
  .components-resizable-box__container {
64
63
  margin: 0 auto;
65
- // Removing this will cancel the bottom margins in the iframe.
66
- overflow: auto;
67
64
  }
68
65
 
69
66
  &.is-view-mode {
@@ -14,7 +14,6 @@ import {
14
14
  BlockBreadcrumb,
15
15
  BlockToolbar,
16
16
  store as blockEditorStore,
17
- privateApis as blockEditorPrivateApis,
18
17
  BlockInspector,
19
18
  } from '@wordpress/block-editor';
20
19
  import {
@@ -56,7 +55,6 @@ import SiteEditorCanvas from '../block-editor/site-editor-canvas';
56
55
  import TemplatePartConverter from '../template-part-converter';
57
56
  import { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';
58
57
 
59
- const { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );
60
58
  const {
61
59
  ExperimentalEditorProvider: EditorProvider,
62
60
  InserterSidebar,
@@ -74,21 +72,6 @@ const interfaceLabels = {
74
72
  footer: __( 'Editor footer' ),
75
73
  };
76
74
 
77
- // Prevent accidental removal of certain blocks, asking the user for
78
- // confirmation.
79
- const blockRemovalRules = {
80
- 'core/query': __( 'Query Loop displays a list of posts or pages.' ),
81
- 'core/post-content': __(
82
- 'Post Content displays the content of a post or page.'
83
- ),
84
- 'core/post-template': __(
85
- 'Post Template displays each post or page in a Query Loop.'
86
- ),
87
- 'bindings/core/pattern-overrides': __(
88
- 'Blocks from synced patterns that can have overriden content.'
89
- ),
90
- };
91
-
92
75
  export default function Editor( { isLoading } ) {
93
76
  const {
94
77
  record: editedPost,
@@ -243,9 +226,6 @@ export default function Editor( { isLoading } ) {
243
226
  <BlockToolbar hideDragHandle />
244
227
  ) }
245
228
  <SiteEditorCanvas />
246
- <BlockRemovalWarningModal
247
- rules={ blockRemovalRules }
248
- />
249
229
  <PatternModal />
250
230
  </>
251
231
  ) }
@@ -13,6 +13,8 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
13
  * Internal dependencies
14
14
  */
15
15
  import { unlock } from '../../lock-unlock';
16
+ import ColorVariations from './variations/variations-color';
17
+ import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
16
18
 
17
19
  const { useGlobalSetting } = unlock( blockEditorPrivateApis );
18
20
  const mobilePopoverProps = { placement: 'bottom-start', offset: 8 };
@@ -45,7 +47,12 @@ export default function ColorPalettePanel( { name } ) {
45
47
  'color.defaultPalette',
46
48
  name
47
49
  );
48
-
50
+ const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
51
+ property: 'color',
52
+ filter: ( variation ) =>
53
+ variation?.settings?.color &&
54
+ Object.keys( variation?.settings?.color ).length,
55
+ } );
49
56
  const isMobileViewport = useViewportMatch( 'small', '<' );
50
57
  const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
51
58
 
@@ -78,6 +85,9 @@ export default function ColorPalettePanel( { name } ) {
78
85
  popoverProps={ popoverProps }
79
86
  />
80
87
  ) }
88
+ { !! colorVariations.length && (
89
+ <ColorVariations variations={ colorVariations } />
90
+ ) }
81
91
  <PaletteEdit
82
92
  colors={ customColors }
83
93
  onChange={ setCustomColors }
@@ -33,7 +33,7 @@ function FontFamilies() {
33
33
  { !! modalTabOpen && (
34
34
  <FontLibraryModal
35
35
  onRequestClose={ () => toggleModal() }
36
- initialTabId={ modalTabOpen }
36
+ defaultTabId={ modalTabOpen }
37
37
  />
38
38
  ) }
39
39
 
@@ -11,7 +11,7 @@ import {
11
11
  * Internal dependencies
12
12
  */
13
13
  import { getFontFaceVariantName } from './utils';
14
- import FontFaceDemo from './font-demo';
14
+ import FontDemo from './font-demo';
15
15
  import { unlock } from '../../../lock-unlock';
16
16
 
17
17
  function CollectionFontVariant( {
@@ -35,17 +35,17 @@ function CollectionFontVariant( {
35
35
  );
36
36
 
37
37
  return (
38
- <div className="font-library-modal__library-font-variant">
38
+ <div className="font-library-modal__font-card">
39
39
  <Flex justify="flex-start" align="center" gap="1rem">
40
40
  <CheckboxControl
41
41
  checked={ selected }
42
42
  onChange={ handleToggleActivation }
43
- __nextHasNoMarginBottom={ true }
43
+ __nextHasNoMarginBottom
44
44
  id={ checkboxId }
45
45
  />
46
46
  <label htmlFor={ checkboxId }>
47
- <FontFaceDemo
48
- fontFace={ face }
47
+ <FontDemo
48
+ font={ face }
49
49
  text={ displayName }
50
50
  onClick={ handleToggleActivation }
51
51
  />
@@ -27,6 +27,7 @@ import {
27
27
  setUIValuesNeeded,
28
28
  mergeFontFamilies,
29
29
  loadFontFaceInBrowser,
30
+ unloadFontFaceInBrowser,
30
31
  getDisplaySrcFromFontFace,
31
32
  makeFontFacesFormData,
32
33
  makeFontFamilyFormData,
@@ -162,16 +163,6 @@ function FontLibraryProvider( { children } ) {
162
163
  // Demo
163
164
  const [ loadedFontUrls ] = useState( new Set() );
164
165
 
165
- // Theme data
166
- const { site, currentTheme } = useSelect( ( select ) => {
167
- return {
168
- site: select( coreStore ).getSite(),
169
- currentTheme: select( coreStore ).getCurrentTheme(),
170
- };
171
- } );
172
- const themeUrl =
173
- site?.url + '/wp-content/themes/' + currentTheme?.stylesheet;
174
-
175
166
  const getAvailableFontsOutline = ( availableFontFamilies ) => {
176
167
  const outline = availableFontFamilies.reduce( ( acc, font ) => {
177
168
  const availableFontFaces =
@@ -210,113 +201,115 @@ function FontLibraryProvider( { children } ) {
210
201
  return getActivatedFontsOutline( source )[ slug ] || [];
211
202
  };
212
203
 
213
- async function installFont( fontFamilyToInstall ) {
204
+ async function installFonts( fontFamiliesToInstall ) {
214
205
  setIsInstalling( true );
215
206
  try {
216
- // Get the font family if it already exists.
217
- let installedFontFamily = await fetchGetFontFamilyBySlug(
218
- fontFamilyToInstall.slug
219
- );
207
+ const fontFamiliesToActivate = [];
208
+ let installationErrors = [];
220
209
 
221
- // Otherwise create it.
222
- if ( ! installedFontFamily ) {
223
- // Prepare font family form data to install.
224
- installedFontFamily = await fetchInstallFontFamily(
225
- makeFontFamilyFormData( fontFamilyToInstall )
210
+ for ( const fontFamilyToInstall of fontFamiliesToInstall ) {
211
+ let isANewFontFamily = false;
212
+
213
+ // Get the font family if it already exists.
214
+ let installedFontFamily = await fetchGetFontFamilyBySlug(
215
+ fontFamilyToInstall.slug
226
216
  );
227
- }
228
217
 
229
- // Collect font faces that have already been installed (to be activated later)
230
- const alreadyInstalledFontFaces =
231
- installedFontFamily.fontFace && fontFamilyToInstall.fontFace
232
- ? installedFontFamily.fontFace.filter(
218
+ // Otherwise create it.
219
+ if ( ! installedFontFamily ) {
220
+ isANewFontFamily = true;
221
+ // Prepare font family form data to install.
222
+ installedFontFamily = await fetchInstallFontFamily(
223
+ makeFontFamilyFormData( fontFamilyToInstall )
224
+ );
225
+ }
226
+
227
+ // Collect font faces that have already been installed (to be activated later)
228
+ const alreadyInstalledFontFaces =
229
+ installedFontFamily.fontFace && fontFamilyToInstall.fontFace
230
+ ? installedFontFamily.fontFace.filter(
231
+ ( fontFaceToInstall ) =>
232
+ checkFontFaceInstalled(
233
+ fontFaceToInstall,
234
+ fontFamilyToInstall.fontFace
235
+ )
236
+ )
237
+ : [];
238
+
239
+ // Filter out Font Faces that have already been installed (so that they are not re-installed)
240
+ if (
241
+ installedFontFamily.fontFace &&
242
+ fontFamilyToInstall.fontFace
243
+ ) {
244
+ fontFamilyToInstall.fontFace =
245
+ fontFamilyToInstall.fontFace.filter(
233
246
  ( fontFaceToInstall ) =>
234
- checkFontFaceInstalled(
247
+ ! checkFontFaceInstalled(
235
248
  fontFaceToInstall,
236
- fontFamilyToInstall.fontFace
249
+ installedFontFamily.fontFace
237
250
  )
238
- )
239
- : [];
240
-
241
- // Filter out Font Faces that have already been installed (so that they are not re-installed)
242
- if (
243
- installedFontFamily.fontFace &&
244
- fontFamilyToInstall.fontFace
245
- ) {
246
- fontFamilyToInstall.fontFace =
247
- fontFamilyToInstall.fontFace.filter(
248
- ( fontFaceToInstall ) =>
249
- ! checkFontFaceInstalled(
250
- fontFaceToInstall,
251
- installedFontFamily.fontFace
252
- )
251
+ );
252
+ }
253
+
254
+ // Install the fonts (upload the font files to the server and create the post in the database).
255
+ let sucessfullyInstalledFontFaces = [];
256
+ let unsucessfullyInstalledFontFaces = [];
257
+ if ( fontFamilyToInstall?.fontFace?.length > 0 ) {
258
+ const response = await batchInstallFontFaces(
259
+ installedFontFamily.id,
260
+ makeFontFacesFormData( fontFamilyToInstall )
253
261
  );
254
- }
255
-
256
- // Install the fonts (upload the font files to the server and create the post in the database).
257
- let sucessfullyInstalledFontFaces = [];
258
- let unsucessfullyInstalledFontFaces = [];
259
- if ( fontFamilyToInstall?.fontFace?.length > 0 ) {
260
- const response = await batchInstallFontFaces(
261
- installedFontFamily.id,
262
- makeFontFacesFormData( fontFamilyToInstall )
262
+ sucessfullyInstalledFontFaces = response?.successes;
263
+ unsucessfullyInstalledFontFaces = response?.errors;
264
+ }
265
+
266
+ // Use the sucessfully installed font faces
267
+ // As well as any font faces that were already installed (those will be activated)
268
+ if (
269
+ sucessfullyInstalledFontFaces?.length > 0 ||
270
+ alreadyInstalledFontFaces?.length > 0
271
+ ) {
272
+ fontFamilyToInstall.fontFace = [
273
+ ...sucessfullyInstalledFontFaces,
274
+ ...alreadyInstalledFontFaces,
275
+ ];
276
+ fontFamiliesToActivate.push( fontFamilyToInstall );
277
+ } else if ( isANewFontFamily ) {
278
+ // If the font family is new, delete it to avoid having font families without font faces.
279
+ await fetchUninstallFontFamily( installedFontFamily.id );
280
+ }
281
+
282
+ installationErrors = installationErrors.concat(
283
+ unsucessfullyInstalledFontFaces
263
284
  );
264
- sucessfullyInstalledFontFaces = response?.successes;
265
- unsucessfullyInstalledFontFaces = response?.errors;
266
285
  }
267
286
 
268
- const detailedErrorMessage = unsucessfullyInstalledFontFaces.reduce(
269
- ( errorMessageCollection, error ) => {
270
- return `${ errorMessageCollection } ${ error.message }`;
271
- },
272
- ''
273
- );
287
+ if ( fontFamiliesToActivate.length > 0 ) {
288
+ // Activate the font family (add the font family to the global styles).
289
+ activateCustomFontFamilies( fontFamiliesToActivate );
274
290
 
275
- // If there were no successes and nothing already installed then we don't need to activate anything and can bounce now.
276
- if (
277
- fontFamilyToInstall?.fontFace?.length > 0 &&
278
- sucessfullyInstalledFontFaces.length === 0 &&
279
- alreadyInstalledFontFaces.length === 0
280
- ) {
281
- throw new Error(
282
- sprintf(
283
- /* translators: %s: Specific error message returned from server. */
284
- __( 'No font faces were installed. %s' ),
285
- detailedErrorMessage
286
- )
291
+ // Save the global styles to the database.
292
+ await saveSpecifiedEntityEdits(
293
+ 'root',
294
+ 'globalStyles',
295
+ globalStylesId,
296
+ [ 'settings.typography.fontFamilies' ]
287
297
  );
288
- }
289
298
 
290
- // Use the sucessfully installed font faces
291
- // As well as any font faces that were already installed (those will be activated)
292
- if (
293
- sucessfullyInstalledFontFaces?.length > 0 ||
294
- alreadyInstalledFontFaces?.length > 0
295
- ) {
296
- fontFamilyToInstall.fontFace = [
297
- ...sucessfullyInstalledFontFaces,
298
- ...alreadyInstalledFontFaces,
299
- ];
299
+ refreshLibrary();
300
300
  }
301
301
 
302
- // Activate the font family (add the font family to the global styles).
303
- activateCustomFontFamilies( [ fontFamilyToInstall ] );
304
-
305
- // Save the global styles to the database.
306
- saveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [
307
- 'settings.typography.fontFamilies',
308
- ] );
309
-
310
- refreshLibrary();
311
-
312
- if ( unsucessfullyInstalledFontFaces.length > 0 ) {
302
+ if ( installationErrors.length > 0 ) {
313
303
  throw new Error(
314
304
  sprintf(
315
305
  /* translators: %s: Specific error message returned from server. */
316
- __(
317
- 'Some font faces were installed. There were some errors. %s'
318
- ),
319
- detailedErrorMessage
306
+ __( 'There were some errors installing fonts. %s' ),
307
+ installationErrors.reduce(
308
+ ( errorMessageCollection, error ) => {
309
+ return `${ errorMessageCollection } ${ error.message }`;
310
+ },
311
+ ''
312
+ )
320
313
  )
321
314
  );
322
315
  }
@@ -371,18 +364,20 @@ function FontLibraryProvider( { children } ) {
371
364
  ...fontFamilies,
372
365
  [ font.source ]: newCustomFonts,
373
366
  } );
367
+
368
+ if ( font.fontFace ) {
369
+ font.fontFace.forEach( ( face ) => {
370
+ unloadFontFaceInBrowser( face, 'all' );
371
+ } );
372
+ }
374
373
  };
375
374
 
376
375
  const activateCustomFontFamilies = ( fontsToAdd ) => {
377
376
  // Merge the existing custom fonts with the new fonts.
378
- const newCustomFonts = mergeFontFamilies(
379
- fontFamilies?.custom,
380
- fontsToAdd
381
- );
382
377
  // Activate the fonts by set the new custom fonts array.
383
378
  setFontFamilies( {
384
379
  ...fontFamilies,
385
- custom: newCustomFonts,
380
+ custom: mergeFontFamilies( fontFamilies?.custom, fontsToAdd ),
386
381
  } );
387
382
  // Add custom fonts to the browser.
388
383
  fontsToAdd.forEach( ( font ) => {
@@ -410,13 +405,30 @@ function FontLibraryProvider( { children } ) {
410
405
  ...fontFamilies,
411
406
  [ font.source ]: newFonts,
412
407
  } );
408
+
409
+ const isFaceActivated = isFontActivated(
410
+ font.slug,
411
+ face.fontStyle,
412
+ face.fontWeight,
413
+ font.source
414
+ );
415
+
416
+ if ( isFaceActivated ) {
417
+ loadFontFaceInBrowser(
418
+ face,
419
+ getDisplaySrcFromFontFace( face.src ),
420
+ 'all'
421
+ );
422
+ } else {
423
+ unloadFontFaceInBrowser( face, 'all' );
424
+ }
413
425
  };
414
426
 
415
427
  const loadFontFaceAsset = async ( fontFace ) => {
416
428
  // If the font doesn't have a src, don't load it.
417
429
  if ( ! fontFace.src ) return;
418
430
  // Get the src of the font.
419
- const src = getDisplaySrcFromFontFace( fontFace.src, themeUrl );
431
+ const src = getDisplaySrcFromFontFace( fontFace.src );
420
432
  // If the font is already loaded, don't load it again.
421
433
  if ( ! src || loadedFontUrls.has( src ) ) return;
422
434
  // Load the font in the browser.
@@ -467,7 +479,7 @@ function FontLibraryProvider( { children } ) {
467
479
  isFontActivated,
468
480
  getFontFacesActivated,
469
481
  loadFontFaceAsset,
470
- installFont,
482
+ installFonts,
471
483
  uninstallFontFamily,
472
484
  toggleActivateFont,
473
485
  getAvailableFontsOutline,
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { _n, sprintf } from '@wordpress/i18n';
5
5
  import {
6
+ __experimentalUseNavigator as useNavigator,
6
7
  __experimentalText as Text,
7
8
  Button,
8
9
  Flex,
@@ -14,46 +15,30 @@ import {
14
15
  * Internal dependencies
15
16
  */
16
17
  import FontDemo from './font-demo';
17
- import { getFamilyPreviewStyle } from './utils/preview-styles';
18
18
  import { chevronRight } from '@wordpress/icons';
19
19
 
20
- function FontCard( { font, onClick, variantsText } ) {
21
- const fakeFontFace = {
22
- fontStyle: 'normal',
23
- fontWeight: '400',
24
- fontFamily: font.fontFamily,
25
- fake: true,
26
- };
27
-
28
- const displayFontFace =
29
- font.fontFace && font.fontFace.length
30
- ? font?.fontFace?.find(
31
- ( face ) =>
32
- face.fontStyle === 'normal' && face.fontWeight === '400'
33
- ) || font.fontFace[ 0 ]
34
- : fakeFontFace;
35
-
36
- const demoStyle = getFamilyPreviewStyle( font );
37
-
20
+ function FontCard( { font, onClick, variantsText, navigatorPath } ) {
38
21
  const variantsCount = font.fontFace?.length || 1;
39
22
 
40
23
  const style = {
41
24
  cursor: !! onClick ? 'pointer' : 'default',
42
25
  };
43
26
 
27
+ const navigator = useNavigator();
28
+
44
29
  return (
45
30
  <Button
46
- onClick={ onClick }
31
+ onClick={ () => {
32
+ onClick();
33
+ if ( navigatorPath ) {
34
+ navigator.goTo( navigatorPath );
35
+ }
36
+ } }
47
37
  style={ style }
48
38
  className="font-library-modal__font-card"
49
39
  >
50
40
  <Flex justify="space-between" wrap={ false }>
51
- <FontDemo
52
- customPreviewUrl={ font.preview }
53
- fontFace={ displayFontFace }
54
- text={ font.name }
55
- style={ demoStyle }
56
- />
41
+ <FontDemo font={ font } />
57
42
  <Flex justify="flex-end">
58
43
  <FlexItem>
59
44
  <Text className="font-library-modal__font-card__count">