@wordpress/edit-site 5.25.0 → 5.25.1-next.79a6196f.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 (438) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/components/block-editor/back-button.js +3 -2
  3. package/build/components/block-editor/back-button.js.map +1 -1
  4. package/build/components/block-editor/resizable-editor.js +2 -2
  5. package/build/components/block-editor/resizable-editor.js.map +1 -1
  6. package/build/components/block-editor/use-post-link-props.js +27 -0
  7. package/build/components/block-editor/use-post-link-props.js.map +1 -0
  8. package/build/components/block-editor/use-site-editor-settings.js +7 -24
  9. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  10. package/build/components/create-template-part-modal/index.js +15 -7
  11. package/build/components/create-template-part-modal/index.js.map +1 -1
  12. package/build/components/editor/index.js +15 -16
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/editor-canvas-container/index.js +9 -7
  15. package/build/components/editor-canvas-container/index.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  17. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  19. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/context.js +5 -5
  21. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
  23. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/index.js +38 -21
  25. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  27. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  29. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
  31. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
  33. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  35. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  36. package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
  37. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  38. package/build/components/global-styles/preview.js +43 -1
  39. package/build/components/global-styles/preview.js.map +1 -1
  40. package/build/components/global-styles/screen-color-palette.js +16 -12
  41. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  42. package/build/components/global-styles/screen-revisions/index.js +52 -52
  43. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  44. package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
  45. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  46. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  47. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  48. package/build/components/global-styles/ui.js +13 -62
  49. package/build/components/global-styles/ui.js.map +1 -1
  50. package/build/components/header-edit-mode/document-tools/index.js +8 -106
  51. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  52. package/build/components/header-edit-mode/index.js +7 -11
  53. package/build/components/header-edit-mode/index.js.map +1 -1
  54. package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
  55. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  56. package/build/components/header-edit-mode/more-menu/index.js +10 -7
  57. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  58. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  59. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  60. package/build/components/keyboard-shortcuts/register.js +0 -36
  61. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  62. package/build/components/layout/index.js +6 -13
  63. package/build/components/layout/index.js.map +1 -1
  64. package/build/components/page-main/index.js +4 -4
  65. package/build/components/page-main/index.js.map +1 -1
  66. package/build/components/page-pages/index.js +84 -37
  67. package/build/components/page-pages/index.js.map +1 -1
  68. package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
  69. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  70. package/build/components/page-patterns/dataviews-patterns.js +307 -0
  71. package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
  72. package/build/components/page-patterns/duplicate-menu-item.js +1 -1
  73. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  74. package/build/components/page-patterns/grid-item.js +4 -3
  75. package/build/components/page-patterns/grid-item.js.map +1 -1
  76. package/build/components/page-patterns/patterns-list.js +2 -1
  77. package/build/components/page-patterns/patterns-list.js.map +1 -1
  78. package/build/components/page-patterns/use-patterns.js +23 -13
  79. package/build/components/page-patterns/use-patterns.js.map +1 -1
  80. package/build/components/page-templates/index.js +312 -36
  81. package/build/components/page-templates/index.js.map +1 -1
  82. package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
  83. package/build/components/pagination/index.js.map +1 -0
  84. package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
  85. package/build/components/post-preview/index.js.map +1 -0
  86. package/build/components/preferences-modal/enable-feature.js +3 -2
  87. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  88. package/build/components/preferences-modal/enable-panel-option.js +33 -0
  89. package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
  90. package/build/components/preferences-modal/index.js +57 -9
  91. package/build/components/preferences-modal/index.js.map +1 -1
  92. package/build/components/revisions/index.js +3 -7
  93. package/build/components/revisions/index.js.map +1 -1
  94. package/build/components/routes/link.js +6 -2
  95. package/build/components/routes/link.js.map +1 -1
  96. package/build/components/save-button/index.js +6 -3
  97. package/build/components/save-button/index.js.map +1 -1
  98. package/build/components/sidebar/index.js +3 -11
  99. package/build/components/sidebar/index.js.map +1 -1
  100. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  101. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  102. package/build/components/sidebar-dataviews/default-views.js +18 -5
  103. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  104. package/build/components/sidebar-dataviews/index.js +3 -3
  105. package/build/components/sidebar-dataviews/index.js.map +1 -1
  106. package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
  107. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  108. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
  109. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  110. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  112. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  113. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  114. package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
  115. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  117. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  119. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-page/index.js +4 -1
  121. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
  123. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  124. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  125. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  126. package/build/components/style-book/index.js +38 -8
  127. package/build/components/style-book/index.js.map +1 -1
  128. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  129. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  130. package/build/hooks/commands/use-edit-mode-commands.js +11 -6
  131. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  132. package/build/index.js +12 -7
  133. package/build/index.js.map +1 -1
  134. package/build/store/actions.js +39 -44
  135. package/build/store/actions.js.map +1 -1
  136. package/build/store/private-actions.js +6 -2
  137. package/build/store/private-actions.js.map +1 -1
  138. package/build/store/reducer.js +0 -46
  139. package/build/store/reducer.js.map +1 -1
  140. package/build/store/selectors.js +32 -41
  141. package/build/store/selectors.js.map +1 -1
  142. package/build/utils/get-is-list-page.js +1 -1
  143. package/build/utils/get-is-list-page.js.map +1 -1
  144. package/build-module/components/block-editor/back-button.js +4 -3
  145. package/build-module/components/block-editor/back-button.js.map +1 -1
  146. package/build-module/components/block-editor/resizable-editor.js +2 -2
  147. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  148. package/build-module/components/block-editor/use-post-link-props.js +20 -0
  149. package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
  150. package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
  151. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  152. package/build-module/components/create-template-part-modal/index.js +14 -7
  153. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  154. package/build-module/components/editor/index.js +16 -17
  155. package/build-module/components/editor/index.js.map +1 -1
  156. package/build-module/components/editor-canvas-container/index.js +9 -7
  157. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  158. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  159. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  160. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  161. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  162. package/build-module/components/global-styles/font-library-modal/context.js +7 -7
  163. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  164. package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
  165. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  166. package/build-module/components/global-styles/font-library-modal/index.js +39 -22
  167. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  168. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  169. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  170. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  171. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  172. package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
  173. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  174. package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
  175. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  176. package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  177. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  178. package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
  179. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  180. package/build-module/components/global-styles/preview.js +45 -3
  181. package/build-module/components/global-styles/preview.js.map +1 -1
  182. package/build-module/components/global-styles/screen-color-palette.js +17 -13
  183. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  184. package/build-module/components/global-styles/screen-revisions/index.js +53 -53
  185. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  186. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
  187. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  188. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  189. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  190. package/build-module/components/global-styles/ui.js +15 -64
  191. package/build-module/components/global-styles/ui.js.map +1 -1
  192. package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
  193. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  194. package/build-module/components/header-edit-mode/index.js +7 -11
  195. package/build-module/components/header-edit-mode/index.js.map +1 -1
  196. package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
  197. package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  198. package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
  199. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  200. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  201. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  202. package/build-module/components/keyboard-shortcuts/register.js +0 -36
  203. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  204. package/build-module/components/layout/index.js +6 -13
  205. package/build-module/components/layout/index.js.map +1 -1
  206. package/build-module/components/page-main/index.js +4 -4
  207. package/build-module/components/page-main/index.js.map +1 -1
  208. package/build-module/components/page-pages/index.js +83 -36
  209. package/build-module/components/page-pages/index.js.map +1 -1
  210. package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
  211. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  212. package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
  213. package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
  214. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  215. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  216. package/build-module/components/page-patterns/grid-item.js +4 -3
  217. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  218. package/build-module/components/page-patterns/patterns-list.js +2 -1
  219. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  220. package/build-module/components/page-patterns/use-patterns.js +23 -13
  221. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  222. package/build-module/components/page-templates/index.js +314 -38
  223. package/build-module/components/page-templates/index.js.map +1 -1
  224. package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
  225. package/build-module/components/pagination/index.js.map +1 -0
  226. package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
  227. package/build-module/components/post-preview/index.js.map +1 -0
  228. package/build-module/components/preferences-modal/enable-feature.js +3 -2
  229. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  230. package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
  231. package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
  232. package/build-module/components/preferences-modal/index.js +57 -9
  233. package/build-module/components/preferences-modal/index.js.map +1 -1
  234. package/build-module/components/revisions/index.js +4 -8
  235. package/build-module/components/revisions/index.js.map +1 -1
  236. package/build-module/components/routes/link.js +5 -2
  237. package/build-module/components/routes/link.js.map +1 -1
  238. package/build-module/components/save-button/index.js +6 -3
  239. package/build-module/components/save-button/index.js.map +1 -1
  240. package/build-module/components/sidebar/index.js +3 -11
  241. package/build-module/components/sidebar/index.js.map +1 -1
  242. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
  243. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  244. package/build-module/components/sidebar-dataviews/default-views.js +17 -5
  245. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  246. package/build-module/components/sidebar-dataviews/index.js +2 -2
  247. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  248. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
  249. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  250. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
  251. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  252. package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
  253. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  254. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  255. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  256. package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
  257. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  259. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  261. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  262. package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
  263. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  264. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
  265. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  266. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  267. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  268. package/build-module/components/style-book/index.js +40 -10
  269. package/build-module/components/style-book/index.js.map +1 -1
  270. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  271. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  272. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
  273. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  274. package/build-module/index.js +12 -7
  275. package/build-module/index.js.map +1 -1
  276. package/build-module/store/actions.js +36 -41
  277. package/build-module/store/actions.js.map +1 -1
  278. package/build-module/store/private-actions.js +6 -2
  279. package/build-module/store/private-actions.js.map +1 -1
  280. package/build-module/store/reducer.js +0 -44
  281. package/build-module/store/reducer.js.map +1 -1
  282. package/build-module/store/selectors.js +30 -38
  283. package/build-module/store/selectors.js.map +1 -1
  284. package/build-module/utils/get-is-list-page.js +1 -1
  285. package/build-module/utils/get-is-list-page.js.map +1 -1
  286. package/build-style/style-rtl.css +366 -268
  287. package/build-style/style.css +366 -268
  288. package/package.json +42 -42
  289. package/src/components/add-new-template/style.scss +2 -1
  290. package/src/components/block-editor/back-button.js +4 -2
  291. package/src/components/block-editor/resizable-editor.js +1 -1
  292. package/src/components/block-editor/style.scss +1 -2
  293. package/src/components/block-editor/use-post-link-props.js +20 -0
  294. package/src/components/block-editor/use-site-editor-settings.js +10 -41
  295. package/src/components/code-editor/style.scss +0 -4
  296. package/src/components/create-template-part-modal/index.js +83 -82
  297. package/src/components/editor/index.js +24 -31
  298. package/src/components/editor-canvas-container/index.js +8 -6
  299. package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
  300. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  301. package/src/components/global-styles/font-library-modal/context.js +7 -7
  302. package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
  303. package/src/components/global-styles/font-library-modal/index.js +44 -24
  304. package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
  305. package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
  306. package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
  307. package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
  308. package/src/components/global-styles/font-library-modal/style.scss +5 -2
  309. package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
  310. package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
  311. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
  312. package/src/components/global-styles/preview.js +55 -3
  313. package/src/components/global-styles/screen-color-palette.js +16 -26
  314. package/src/components/global-styles/screen-revisions/index.js +91 -92
  315. package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
  316. package/src/components/global-styles/screen-revisions/style.scss +77 -20
  317. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
  318. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
  319. package/src/components/global-styles/ui.js +13 -74
  320. package/src/components/header-edit-mode/document-tools/index.js +33 -165
  321. package/src/components/header-edit-mode/index.js +6 -17
  322. package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
  323. package/src/components/header-edit-mode/more-menu/index.js +9 -7
  324. package/src/components/header-edit-mode/style.scss +0 -47
  325. package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
  326. package/src/components/keyboard-shortcuts/register.js +0 -43
  327. package/src/components/layout/index.js +8 -27
  328. package/src/components/layout/style.scss +10 -3
  329. package/src/components/list/style.scss +0 -5
  330. package/src/components/page/style.scss +1 -1
  331. package/src/components/page-main/index.js +8 -8
  332. package/src/components/page-pages/index.js +112 -41
  333. package/src/components/page-pages/style.scss +3 -2
  334. package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
  335. package/src/components/page-patterns/dataviews-patterns.js +380 -0
  336. package/src/components/page-patterns/duplicate-menu-item.js +1 -1
  337. package/src/components/page-patterns/grid-item.js +3 -2
  338. package/src/components/page-patterns/patterns-list.js +2 -1
  339. package/src/components/page-patterns/style.scss +89 -26
  340. package/src/components/page-patterns/use-patterns.js +24 -15
  341. package/src/components/page-templates/index.js +399 -64
  342. package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
  343. package/src/components/pagination/style.scss +5 -0
  344. package/src/components/post-preview/index.js +16 -0
  345. package/src/components/preferences-modal/enable-feature.js +9 -5
  346. package/src/components/preferences-modal/enable-panel-option.js +23 -0
  347. package/src/components/preferences-modal/index.js +107 -22
  348. package/src/components/revisions/index.js +8 -15
  349. package/src/components/routes/link.js +11 -3
  350. package/src/components/save-button/index.js +16 -3
  351. package/src/components/sidebar/index.js +6 -13
  352. package/src/components/sidebar-dataviews/add-new-view.js +1 -1
  353. package/src/components/sidebar-dataviews/default-views.js +23 -6
  354. package/src/components/sidebar-dataviews/index.js +2 -2
  355. package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
  356. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
  357. package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
  358. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
  359. package/src/components/sidebar-edit-mode/style.scss +0 -10
  360. package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
  361. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
  362. package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  363. package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
  364. package/src/components/sidebar-navigation-screen-page/index.js +2 -1
  365. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
  366. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  367. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  368. package/src/components/site-hub/style.scss +5 -2
  369. package/src/components/style-book/index.js +65 -21
  370. package/src/components/style-book/style.scss +3 -3
  371. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  372. package/src/hooks/commands/use-edit-mode-commands.js +8 -12
  373. package/src/index.js +11 -5
  374. package/src/store/actions.js +35 -45
  375. package/src/store/private-actions.js +7 -3
  376. package/src/store/reducer.js +0 -44
  377. package/src/store/selectors.js +32 -38
  378. package/src/store/test/actions.js +11 -39
  379. package/src/store/test/reducer.js +1 -82
  380. package/src/store/test/selectors.js +0 -24
  381. package/src/style.scss +2 -1
  382. package/src/utils/get-is-list-page.js +2 -3
  383. package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  384. package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
  385. package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  386. package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
  387. package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  388. package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
  389. package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  390. package/build/components/page-pages/side-editor.js.map +0 -1
  391. package/build/components/page-patterns/pagination.js.map +0 -1
  392. package/build/components/page-templates/dataviews-templates.js +0 -317
  393. package/build/components/page-templates/dataviews-templates.js.map +0 -1
  394. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
  395. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  396. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
  397. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  398. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
  399. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  400. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
  401. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  402. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
  403. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  404. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  405. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
  406. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  407. package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
  408. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  409. package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
  410. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  411. package/build-module/components/page-pages/side-editor.js.map +0 -1
  412. package/build-module/components/page-patterns/pagination.js.map +0 -1
  413. package/build-module/components/page-templates/dataviews-templates.js +0 -309
  414. package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
  415. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
  416. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  417. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
  418. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  419. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
  420. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  421. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
  422. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  423. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
  424. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  425. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
  426. package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
  427. package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
  428. package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
  429. package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
  430. package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
  431. package/src/components/page-pages/side-editor.js +0 -14
  432. package/src/components/page-templates/dataviews-templates.js +0 -360
  433. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
  434. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
  435. package/src/components/secondary-sidebar/style.scss +0 -65
  436. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
  437. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
  438. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
@@ -13,6 +13,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
13
13
  import { closeSmall } from '@wordpress/icons';
14
14
  import { useFocusOnMount, useFocusReturn } from '@wordpress/compose';
15
15
  import { store as preferencesStore } from '@wordpress/preferences';
16
+ import { store as editorStore } from '@wordpress/editor';
16
17
 
17
18
  /**
18
19
  * Internal dependencies
@@ -33,6 +34,7 @@ function getEditorCanvasContainerTitle( view ) {
33
34
  case 'style-book':
34
35
  return __( 'Style Book' );
35
36
  case 'global-styles-revisions':
37
+ case 'global-styles-revisions:style-book':
36
38
  return __( 'Global styles revisions' );
37
39
  default:
38
40
  return '';
@@ -61,7 +63,7 @@ function EditorCanvasContainer( {
61
63
  ).getEditorCanvasContainerView();
62
64
 
63
65
  const _showListViewByDefault = select( preferencesStore ).get(
64
- 'core/edit-site',
66
+ 'core',
65
67
  'showListViewByDefault'
66
68
  );
67
69
 
@@ -76,6 +78,8 @@ function EditorCanvasContainer( {
76
78
  const { setEditorCanvasContainerView } = unlock(
77
79
  useDispatch( editSiteStore )
78
80
  );
81
+ const { setIsListViewOpened } = useDispatch( editorStore );
82
+
79
83
  const focusOnMountRef = useFocusOnMount( 'firstElement' );
80
84
  const sectionFocusReturnRef = useFocusReturn();
81
85
  const title = useMemo(
@@ -83,15 +87,13 @@ function EditorCanvasContainer( {
83
87
  [ editorCanvasContainerView ]
84
88
  );
85
89
 
86
- const { setIsListViewOpened } = useDispatch( editSiteStore );
87
-
88
90
  function onCloseContainer() {
89
- if ( typeof onClose === 'function' ) {
90
- onClose();
91
- }
92
91
  setIsListViewOpened( showListViewByDefault );
93
92
  setEditorCanvasContainerView( undefined );
94
93
  setIsClosed( true );
94
+ if ( typeof onClose === 'function' ) {
95
+ onClose();
96
+ }
95
97
  }
96
98
 
97
99
  function closeOnEscape( event ) {
@@ -1,14 +1,18 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { CheckboxControl, Flex } from '@wordpress/components';
4
+ import {
5
+ CheckboxControl,
6
+ Flex,
7
+ privateApis as componentsPrivateApis,
8
+ } from '@wordpress/components';
5
9
 
6
10
  /**
7
11
  * Internal dependencies
8
12
  */
9
13
  import { getFontFaceVariantName } from './utils';
10
14
  import FontFaceDemo from './font-demo';
11
- import { kebabCase } from '../../../../../block-editor/src/utils/object';
15
+ import { unlock } from '../../../lock-unlock';
12
16
 
13
17
  function CollectionFontVariant( {
14
18
  face,
@@ -25,6 +29,7 @@ function CollectionFontVariant( {
25
29
  };
26
30
 
27
31
  const displayName = font.name + ' ' + getFontFaceVariantName( face );
32
+ const { kebabCase } = unlock( componentsPrivateApis );
28
33
  const checkboxId = kebabCase(
29
34
  `${ font.slug }-${ getFontFaceVariantName( face ) }`
30
35
  );
@@ -13,8 +13,8 @@ function ConfirmDeleteDialog( {
13
13
  return (
14
14
  <ConfirmDialog
15
15
  isOpen={ isConfirmDeleteOpen }
16
- cancelButtonText={ __( 'No, keep the font' ) }
17
- confirmButtonText={ __( 'Yes, uninstall' ) }
16
+ cancelButtonText={ __( 'Cancel' ) }
17
+ confirmButtonText={ __( 'Delete' ) }
18
18
  onCancel={ handleCancelUninstall }
19
19
  onConfirm={ handleConfirmUninstall }
20
20
  >
@@ -22,7 +22,7 @@ function ConfirmDeleteDialog( {
22
22
  sprintf(
23
23
  /* translators: %s: Name of the font. */
24
24
  __(
25
- 'Would you like to remove %s and all its variants and assets?'
25
+ 'Are you sure you want to delete "%s" font and all its variants and assets?'
26
26
  ),
27
27
  font.name
28
28
  ) }
@@ -14,7 +14,7 @@ import {
14
14
  * Internal dependencies
15
15
  */
16
16
  import {
17
- fetchInstallFonts,
17
+ fetchInstallFont,
18
18
  fetchUninstallFonts,
19
19
  fetchFontCollections,
20
20
  fetchFontCollection,
@@ -26,7 +26,7 @@ import {
26
26
  mergeFontFamilies,
27
27
  loadFontFaceInBrowser,
28
28
  getDisplaySrcFromFontFace,
29
- makeFormDataFromFontFamilies,
29
+ makeFormDataFromFontFamily,
30
30
  } from './utils';
31
31
  import { toggleFont } from './utils/toggleFont';
32
32
  import getIntersectingFontFaces from './utils/get-intersecting-font-faces';
@@ -192,19 +192,19 @@ function FontLibraryProvider( { children } ) {
192
192
  return getActivatedFontsOutline( source )[ slug ] || [];
193
193
  };
194
194
 
195
- async function installFonts( fonts ) {
195
+ async function installFont( font ) {
196
196
  setIsInstalling( true );
197
197
  try {
198
198
  // Prepare formData to install.
199
- const formData = makeFormDataFromFontFamilies( fonts );
199
+ const formData = makeFormDataFromFontFamily( font );
200
200
  // Install the fonts (upload the font files to the server and create the post in the database).
201
- const response = await fetchInstallFonts( formData );
201
+ const response = await fetchInstallFont( formData );
202
202
  const fontsInstalled = response?.successes || [];
203
203
  // Get intersecting font faces between the fonts we tried to installed and the fonts that were installed
204
204
  // (to avoid activating a non installed font).
205
205
  const fontToBeActivated = getIntersectingFontFaces(
206
206
  fontsInstalled,
207
- fonts
207
+ [ font ]
208
208
  );
209
209
  // Activate the font families (add the font families to the global styles).
210
210
  activateCustomFontFamilies( fontToBeActivated );
@@ -358,7 +358,7 @@ function FontLibraryProvider( { children } ) {
358
358
  isFontActivated,
359
359
  getFontFacesActivated,
360
360
  loadFontFaceAsset,
361
- installFonts,
361
+ installFont,
362
362
  uninstallFont,
363
363
  toggleActivateFont,
364
364
  getAvailableFontsOutline,
@@ -21,7 +21,7 @@ import { search, closeSmall } from '@wordpress/icons';
21
21
  /**
22
22
  * Internal dependencies
23
23
  */
24
- import TabLayout from './tab-layout';
24
+ import TabPanelLayout from './tab-panel-layout';
25
25
  import { FontLibraryContext } from './context';
26
26
  import FontsGrid from './fonts-grid';
27
27
  import FontCard from './font-card';
@@ -54,7 +54,7 @@ function FontCollection( { id } ) {
54
54
  const [ renderConfirmDialog, setRenderConfirmDialog ] = useState(
55
55
  requiresPermission && ! getGoogleFontsPermissionFromStorage()
56
56
  );
57
- const { collections, getFontCollection, installFonts } =
57
+ const { collections, getFontCollection, installFont } =
58
58
  useContext( FontLibraryContext );
59
59
  const selectedCollection = collections.find(
60
60
  ( collection ) => collection.id === id
@@ -92,6 +92,11 @@ function FontCollection( { id } ) {
92
92
  setNotice( null );
93
93
  }, [ id ] );
94
94
 
95
+ useEffect( () => {
96
+ // If the selected fonts change, reset the selected fonts to install
97
+ setFontsToInstall( [] );
98
+ }, [ selectedFont ] );
99
+
95
100
  // Reset notice after 5 seconds
96
101
  useEffect( () => {
97
102
  if ( notice && notice?.duration !== 0 ) {
@@ -149,14 +154,14 @@ function FontCollection( { id } ) {
149
154
  };
150
155
 
151
156
  const handleInstall = async () => {
152
- const response = await installFonts( fontsToInstall );
157
+ const response = await installFont( fontsToInstall[ 0 ] );
153
158
  const installNotice = getNoticeFromInstallResponse( response );
154
159
  setNotice( installNotice );
155
160
  resetFontsToInstall();
156
161
  };
157
162
 
158
163
  return (
159
- <TabLayout
164
+ <TabPanelLayout
160
165
  title={
161
166
  ! selectedFont ? selectedCollection.name : selectedFont.name
162
167
  }
@@ -270,7 +275,7 @@ function FontCollection( { id } ) {
270
275
  ) ) }
271
276
  </FontsGrid>
272
277
  ) }
273
- </TabLayout>
278
+ </TabPanelLayout>
274
279
  );
275
280
  }
276
281
 
@@ -2,7 +2,10 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { Modal, TabPanel } from '@wordpress/components';
5
+ import {
6
+ Modal,
7
+ privateApis as componentsPrivateApis,
8
+ } from '@wordpress/components';
6
9
  import { useContext } from '@wordpress/element';
7
10
 
8
11
  /**
@@ -12,33 +15,33 @@ import InstalledFonts from './installed-fonts';
12
15
  import FontCollection from './font-collection';
13
16
  import UploadFonts from './upload-fonts';
14
17
  import { FontLibraryContext } from './context';
18
+ import { unlock } from '../../../lock-unlock';
19
+
20
+ const { Tabs } = unlock( componentsPrivateApis );
15
21
 
16
22
  const DEFAULT_TABS = [
17
23
  {
18
- name: 'installed-fonts',
24
+ id: 'installed-fonts',
19
25
  title: __( 'Library' ),
20
- className: 'installed-fonts',
21
26
  },
22
27
  {
23
- name: 'upload-fonts',
28
+ id: 'upload-fonts',
24
29
  title: __( 'Upload' ),
25
- className: 'upload-fonts',
26
30
  },
27
31
  ];
28
32
 
29
33
  const tabsFromCollections = ( collections ) =>
30
34
  collections.map( ( { id, name } ) => ( {
31
- name: id,
35
+ id,
32
36
  title:
33
37
  collections.length === 1 && id === 'default-font-collection'
34
38
  ? __( 'Install Fonts' )
35
39
  : name,
36
- className: 'collection',
37
40
  } ) );
38
41
 
39
42
  function FontLibraryModal( {
40
43
  onRequestClose,
41
- initialTabName = 'installed-fonts',
44
+ initialTabId = 'installed-fonts',
42
45
  } ) {
43
46
  const { collections } = useContext( FontLibraryContext );
44
47
 
@@ -54,22 +57,39 @@ function FontLibraryModal( {
54
57
  isFullScreen
55
58
  className="font-library-modal"
56
59
  >
57
- <TabPanel
58
- className="font-library-modal__tab-panel"
59
- initialTabName={ initialTabName }
60
- tabs={ tabs }
61
- >
62
- { ( tab ) => {
63
- switch ( tab.name ) {
64
- case 'upload-fonts':
65
- return <UploadFonts />;
66
- case 'installed-fonts':
67
- return <InstalledFonts />;
68
- default:
69
- return <FontCollection id={ tab.name } />;
70
- }
71
- } }
72
- </TabPanel>
60
+ <div className="font-library-modal__tabs">
61
+ <Tabs initialTabId={ initialTabId }>
62
+ <Tabs.TabList>
63
+ { tabs.map( ( { id, title } ) => (
64
+ <Tabs.Tab key={ id } tabId={ id }>
65
+ { title }
66
+ </Tabs.Tab>
67
+ ) ) }
68
+ </Tabs.TabList>
69
+ { tabs.map( ( { id } ) => {
70
+ let contents;
71
+ switch ( id ) {
72
+ case 'upload-fonts':
73
+ contents = <UploadFonts />;
74
+ break;
75
+ case 'installed-fonts':
76
+ contents = <InstalledFonts />;
77
+ break;
78
+ default:
79
+ contents = <FontCollection id={ id } />;
80
+ }
81
+ return (
82
+ <Tabs.TabPanel
83
+ key={ id }
84
+ tabId={ id }
85
+ focusable={ false }
86
+ >
87
+ { contents }
88
+ </Tabs.TabPanel>
89
+ );
90
+ } ) }
91
+ </Tabs>
92
+ </div>
73
93
  </Modal>
74
94
  );
75
95
  }
@@ -16,7 +16,7 @@ import {
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
- import TabLayout from './tab-layout';
19
+ import TabPanelLayout from './tab-panel-layout';
20
20
  import { FontLibraryContext } from './context';
21
21
  import FontsGrid from './fonts-grid';
22
22
  import LibraryFontDetails from './library-font-details';
@@ -92,7 +92,7 @@ function InstalledFonts() {
92
92
  }, [ notice ] );
93
93
 
94
94
  return (
95
- <TabLayout
95
+ <TabPanelLayout
96
96
  title={ libraryFontSelected?.name || '' }
97
97
  description={ tabDescription }
98
98
  handleBack={ !! libraryFontSelected && handleUnselectFont }
@@ -173,7 +173,7 @@ function InstalledFonts() {
173
173
  handleCancelUninstall={ handleCancelUninstall }
174
174
  />
175
175
  ) }
176
- </TabLayout>
176
+ </TabPanelLayout>
177
177
  );
178
178
  }
179
179
 
@@ -2,7 +2,11 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useContext } from '@wordpress/element';
5
- import { CheckboxControl, Flex } from '@wordpress/components';
5
+ import {
6
+ CheckboxControl,
7
+ Flex,
8
+ privateApis as componentsPrivateApis,
9
+ } from '@wordpress/components';
6
10
 
7
11
  /**
8
12
  * Internal dependencies
@@ -10,7 +14,7 @@ import { CheckboxControl, Flex } from '@wordpress/components';
10
14
  import { getFontFaceVariantName } from './utils';
11
15
  import { FontLibraryContext } from './context';
12
16
  import FontFaceDemo from './font-demo';
13
- import { kebabCase } from '../../../../../block-editor/src/utils/object';
17
+ import { unlock } from '../../../lock-unlock';
14
18
 
15
19
  function LibraryFontVariant( { face, font } ) {
16
20
  const { isFontActivated, toggleActivateFont } =
@@ -34,6 +38,7 @@ function LibraryFontVariant( { face, font } ) {
34
38
  };
35
39
 
36
40
  const displayName = font.name + ' ' + getFontFaceVariantName( face );
41
+ const { kebabCase } = unlock( componentsPrivateApis );
37
42
  const checkboxId = kebabCase(
38
43
  `${ font.slug }-${ getFontFaceVariantName( face ) }`
39
44
  );
@@ -11,6 +11,7 @@ import {
11
11
  FormFileUpload,
12
12
  Notice,
13
13
  FlexItem,
14
+ privateApis as componentsPrivateApis,
14
15
  } from '@wordpress/components';
15
16
  import { useContext, useState, useEffect } from '@wordpress/element';
16
17
 
@@ -23,10 +24,14 @@ import { Font } from '../../../../lib/lib-font.browser';
23
24
  import makeFamiliesFromFaces from './utils/make-families-from-faces';
24
25
  import { loadFontFaceInBrowser } from './utils';
25
26
  import { getNoticeFromInstallResponse } from './utils/get-notice-from-response';
27
+ import { unlock } from '../../../lock-unlock';
28
+
29
+ const { ProgressBar } = unlock( componentsPrivateApis );
26
30
 
27
31
  function LocalFonts() {
28
- const { installFonts } = useContext( FontLibraryContext );
32
+ const { installFont } = useContext( FontLibraryContext );
29
33
  const [ notice, setNotice ] = useState( null );
34
+ const [ isUploading, setIsUploading ] = useState( false );
30
35
  const supportedFormats =
31
36
  ALLOWED_FILE_EXTENSIONS.slice( 0, -1 )
32
37
  .map( ( extension ) => `.${ extension }` )
@@ -58,6 +63,7 @@ function LocalFonts() {
58
63
  */
59
64
  const handleFilesUpload = ( files ) => {
60
65
  setNotice( null );
66
+ setIsUploading( true );
61
67
  const uniqueFilenames = new Set();
62
68
  const selectedFiles = [ ...files ];
63
69
  const allowedFiles = selectedFiles.filter( ( file ) => {
@@ -147,9 +153,21 @@ function LocalFonts() {
147
153
  */
148
154
  const handleInstall = async ( fontFaces ) => {
149
155
  const fontFamilies = makeFamiliesFromFaces( fontFaces );
150
- const response = await installFonts( fontFamilies );
156
+
157
+ if ( fontFamilies.length > 1 ) {
158
+ setNotice( {
159
+ type: 'error',
160
+ message: __(
161
+ 'Variants from only one font family can be uploaded at a time.'
162
+ ),
163
+ } );
164
+ return;
165
+ }
166
+
167
+ const response = await installFont( fontFamilies[ 0 ] );
151
168
  const installNotice = getNoticeFromInstallResponse( response );
152
169
  setNotice( installNotice );
170
+ setIsUploading( false );
153
171
  };
154
172
 
155
173
  return (
@@ -157,31 +175,28 @@ function LocalFonts() {
157
175
  <Spacer margin={ 16 } />
158
176
  <DropZone onFilesDrop={ handleDropZone } />
159
177
  <VStack className="font-library-modal__local-fonts">
160
- <FormFileUpload
161
- accept={ ALLOWED_FILE_EXTENSIONS.map(
162
- ( ext ) => `.${ ext }`
163
- ).join( ',' ) }
164
- multiple={ true }
165
- onChange={ onFilesUpload }
166
- render={ ( { openFileDialog } ) => (
167
- <Button
168
- className="font-library-modal__upload-area"
169
- onClick={ openFileDialog }
170
- >
171
- <span>{ __( 'Upload font' ) }</span>
172
- </Button>
173
- ) }
174
- />
175
- { notice && (
178
+ { ! isUploading && (
179
+ <FormFileUpload
180
+ accept={ ALLOWED_FILE_EXTENSIONS.map(
181
+ ( ext ) => `.${ ext }`
182
+ ).join( ',' ) }
183
+ multiple={ true }
184
+ onChange={ onFilesUpload }
185
+ render={ ( { openFileDialog } ) => (
186
+ <Button
187
+ className="font-library-modal__upload-area"
188
+ onClick={ openFileDialog }
189
+ >
190
+ <span>{ __( 'Upload font' ) }</span>
191
+ </Button>
192
+ ) }
193
+ />
194
+ ) }
195
+ { isUploading && (
176
196
  <FlexItem>
177
- <Spacer margin={ 2 } />
178
- <Notice
179
- isDismissible={ false }
180
- status={ notice.type }
181
- className="font-library-modal__upload-area__notice"
182
- >
183
- { notice.message }
184
- </Notice>
197
+ <div className="font-library-modal__upload-area">
198
+ <ProgressBar />
199
+ </div>
185
200
  </FlexItem>
186
201
  ) }
187
202
  <Spacer margin={ 2 } />
@@ -194,6 +209,18 @@ function LocalFonts() {
194
209
  supportedFormats
195
210
  ) }
196
211
  </Text>
212
+ { ! isUploading && notice && (
213
+ <FlexItem>
214
+ <Spacer margin={ 2 } />
215
+ <Notice
216
+ isDismissible={ false }
217
+ status={ notice.type }
218
+ className="font-library-modal__upload-area__notice"
219
+ >
220
+ { notice.message }
221
+ </Notice>
222
+ </FlexItem>
223
+ ) }
197
224
  </VStack>
198
225
  </>
199
226
  );
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import apiFetch from '@wordpress/api-fetch';
9
9
 
10
- export async function fetchInstallFonts( data ) {
10
+ export async function fetchInstallFont( data ) {
11
11
  const config = {
12
- path: '/wp/v2/fonts',
12
+ path: '/wp/v2/font-families',
13
13
  method: 'POST',
14
14
  body: data,
15
15
  };
@@ -21,7 +21,7 @@ export async function fetchUninstallFonts( fonts ) {
21
21
  font_families: fonts,
22
22
  };
23
23
  const config = {
24
- path: '/wp/v2/fonts',
24
+ path: '/wp/v2/font-families',
25
25
  method: 'DELETE',
26
26
  data,
27
27
  };
@@ -30,7 +30,7 @@ export async function fetchUninstallFonts( fonts ) {
30
30
 
31
31
  export async function fetchFontCollections() {
32
32
  const config = {
33
- path: '/wp/v2/fonts/collections',
33
+ path: '/wp/v2/font-collections',
34
34
  method: 'GET',
35
35
  };
36
36
  return apiFetch( config );
@@ -38,7 +38,7 @@ export async function fetchFontCollections() {
38
38
 
39
39
  export async function fetchFontCollection( id ) {
40
40
  const config = {
41
- path: `/wp/v2/fonts/collections/${ id }`,
41
+ path: `/wp/v2/font-collections/${ id }`,
42
42
  method: 'GET',
43
43
  };
44
44
  return apiFetch( config );
@@ -24,7 +24,7 @@
24
24
  }
25
25
  }
26
26
 
27
- .font-library-modal__tab-layout {
27
+ .font-library-modal__tabpanel-layout {
28
28
 
29
29
  main {
30
30
  padding-bottom: 4rem;
@@ -75,7 +75,7 @@
75
75
  padding-bottom: 1rem;
76
76
  }
77
77
 
78
- .font-library-modal__tab-panel {
78
+ .font-library-modal__tabs {
79
79
  [role="tablist"] {
80
80
  position: sticky;
81
81
  top: 0;
@@ -94,6 +94,9 @@
94
94
  justify-content: center;
95
95
  height: 250px;
96
96
  width: 100%;
97
+ }
98
+
99
+ button.font-library-modal__upload-area {
97
100
  background-color: #f0f0f0;
98
101
  }
99
102
 
@@ -11,9 +11,15 @@ import {
11
11
  } from '@wordpress/components';
12
12
  import { chevronLeft } from '@wordpress/icons';
13
13
 
14
- function TabLayout( { title, description, handleBack, children, footer } ) {
14
+ function TabPanelLayout( {
15
+ title,
16
+ description,
17
+ handleBack,
18
+ children,
19
+ footer,
20
+ } ) {
15
21
  return (
16
- <div className="font-library-modal__tab-layout">
22
+ <div className="font-library-modal__tabpanel-layout">
17
23
  <Spacer margin={ 4 } />
18
24
  <VStack spacing={ 4 } justify="space-between">
19
25
  <header>
@@ -47,4 +53,4 @@ function TabLayout( { title, description, handleBack, children, footer } ) {
47
53
  );
48
54
  }
49
55
 
50
- export default TabLayout;
56
+ export default TabPanelLayout;
@@ -1,12 +1,13 @@
1
1
  /**
2
- * External dependencies
2
+ * WordPress dependencies
3
3
  */
4
- import { paramCase as kebabCase } from 'change-case';
4
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import { FONT_WEIGHTS, FONT_STYLES } from './constants';
10
+ import { unlock } from '../../../../lock-unlock';
10
11
 
11
12
  export function setUIValuesNeeded( font, extraValues = {} ) {
12
13
  if ( ! font.name && ( font.fontFamily || font.slug ) ) {
@@ -129,25 +130,21 @@ export function getDisplaySrcFromFontFace( input, urlPrefix ) {
129
130
  return src;
130
131
  }
131
132
 
132
- // This function replicates one behavior of _wp_to_kebab_case().
133
- // Additional context: https://github.com/WordPress/gutenberg/issues/53695
134
- export function wpKebabCase( str ) {
135
- // If a string contains a digit followed by a number, insert a dash between them.
136
- return kebabCase( str ).replace(
137
- /([a-zA-Z])(\d)|(\d)([a-zA-Z])/g,
138
- '$1$3-$2$4'
139
- );
140
- }
141
-
142
- export function makeFormDataFromFontFamilies( fontFamilies ) {
133
+ export function makeFormDataFromFontFamily( fontFamily ) {
143
134
  const formData = new FormData();
144
- const newFontFamilies = fontFamilies.map( ( family, familyIndex ) => {
145
- family.slug = wpKebabCase( family.slug );
146
- if ( family?.fontFace ) {
147
- family.fontFace = family.fontFace.map( ( face, faceIndex ) => {
135
+ const { kebabCase } = unlock( componentsPrivateApis );
136
+
137
+ const newFontFamily = {
138
+ ...fontFamily,
139
+ slug: kebabCase( fontFamily.slug ),
140
+ };
141
+
142
+ if ( newFontFamily?.fontFace ) {
143
+ const newFontFaces = newFontFamily.fontFace.map(
144
+ ( face, faceIndex ) => {
148
145
  if ( face.file ) {
149
146
  // Slugified file name because the it might contain spaces or characters treated differently on the server.
150
- const fileId = `file-${ familyIndex }-${ faceIndex }`;
147
+ const fileId = `file-${ faceIndex }`;
151
148
  // Add the files to the formData
152
149
  formData.append( fileId, face.file, face.file.name );
153
150
  // remove the file object from the face object the file is referenced by the uploadedFile key
@@ -159,10 +156,11 @@ export function makeFormDataFromFontFamilies( fontFamilies ) {
159
156
  return newFace;
160
157
  }
161
158
  return face;
162
- } );
163
- }
164
- return family;
165
- } );
166
- formData.append( 'font_families', JSON.stringify( newFontFamilies ) );
159
+ }
160
+ );
161
+ newFontFamily.fontFace = newFontFaces;
162
+ }
163
+
164
+ formData.append( 'font_family_settings', JSON.stringify( newFontFamily ) );
167
165
  return formData;
168
166
  }