@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.cd6172eb0.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 (443) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +3 -16
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +1 -5
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/app/index.js +31 -29
  7. package/build/components/app/index.js.map +1 -1
  8. package/build/components/block-editor/use-editor-iframe-props.js +8 -8
  9. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  10. package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
  11. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  12. package/build/components/block-editor/use-site-editor-settings.js +4 -4
  13. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  14. package/build/components/dataviews-actions/index.js +1 -5
  15. package/build/components/dataviews-actions/index.js.map +1 -1
  16. package/build/components/editor/index.js +38 -22
  17. package/build/components/editor/index.js.map +1 -1
  18. package/build/components/editor/use-editor-title.js +5 -0
  19. package/build/components/editor/use-editor-title.js.map +1 -1
  20. package/build/components/editor/use-resolve-edited-entity.js +19 -4
  21. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/context.js +0 -1
  23. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
  25. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  27. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  29. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  30. package/build/components/global-styles-sidebar/index.js +5 -5
  31. package/build/components/global-styles-sidebar/index.js.map +1 -1
  32. package/build/components/layout/index.js +31 -13
  33. package/build/components/layout/index.js.map +1 -1
  34. package/build/components/page-patterns/delete-category-menu-item.js +1 -4
  35. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  36. package/build/components/page-patterns/fields.js +6 -11
  37. package/build/components/page-patterns/fields.js.map +1 -1
  38. package/build/components/page-patterns/index.js +14 -16
  39. package/build/components/page-patterns/index.js.map +1 -1
  40. package/build/components/page-templates/fields.js +8 -17
  41. package/build/components/page-templates/fields.js.map +1 -1
  42. package/build/components/page-templates/index.js +13 -12
  43. package/build/components/page-templates/index.js.map +1 -1
  44. package/build/components/post-edit/index.js +38 -3
  45. package/build/components/post-edit/index.js.map +1 -1
  46. package/build/components/post-list/index.js +25 -39
  47. package/build/components/post-list/index.js.map +1 -1
  48. package/build/components/posts-app/index.js +10 -16
  49. package/build/components/posts-app/index.js.map +1 -1
  50. package/build/components/posts-app-routes/index.js +3 -7
  51. package/build/components/posts-app-routes/index.js.map +1 -1
  52. package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
  53. package/build/components/posts-app-routes/post-item.js.map +1 -0
  54. package/build/components/posts-app-routes/posts.js +89 -0
  55. package/build/components/posts-app-routes/posts.js.map +1 -0
  56. package/build/components/resizable-frame/index.js +6 -5
  57. package/build/components/resizable-frame/index.js.map +1 -1
  58. package/build/components/save-panel/index.js +9 -6
  59. package/build/components/save-panel/index.js.map +1 -1
  60. package/build/components/sidebar-dataviews/add-new-view.js +7 -8
  61. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  62. package/build/components/sidebar-dataviews/dataview-item.js +5 -8
  63. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  64. package/build/components/sidebar-dataviews/index.js +4 -3
  65. package/build/components/sidebar-dataviews/index.js.map +1 -1
  66. package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
  67. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  68. package/build/components/sidebar-navigation-item/index.js +8 -5
  69. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  70. package/build/components/sidebar-navigation-screen/index.js +2 -2
  71. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  72. package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
  73. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  74. package/build/components/sidebar-navigation-screen-main/index.js +6 -14
  75. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  76. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  77. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  78. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  79. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  80. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  81. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  82. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  83. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  84. package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  85. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  86. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
  87. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  88. package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  89. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  90. package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  91. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  92. package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
  93. package/build/components/site-editor-routes/home.js.map +1 -0
  94. package/build/components/site-editor-routes/index.js +12 -18
  95. package/build/components/site-editor-routes/index.js.map +1 -1
  96. package/build/components/site-editor-routes/navigation-item.js +49 -0
  97. package/build/components/site-editor-routes/navigation-item.js.map +1 -0
  98. package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
  99. package/build/components/site-editor-routes/navigation.js.map +1 -0
  100. package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
  101. package/build/components/site-editor-routes/page-item.js.map +1 -0
  102. package/build/components/site-editor-routes/pages.js +87 -0
  103. package/build/components/site-editor-routes/pages.js.map +1 -0
  104. package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
  105. package/build/components/site-editor-routes/pattern-item.js.map +1 -0
  106. package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
  107. package/build/components/site-editor-routes/patterns.js.map +1 -0
  108. package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
  109. package/build/components/site-editor-routes/styles.js.map +1 -0
  110. package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
  111. package/build/components/site-editor-routes/template-item.js.map +1 -0
  112. package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
  113. package/build/components/site-editor-routes/template-part-item.js.map +1 -0
  114. package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
  115. package/build/components/site-editor-routes/templates.js.map +1 -0
  116. package/build/components/site-hub/index.js +3 -3
  117. package/build/components/site-hub/index.js.map +1 -1
  118. package/build/components/style-book/constants.js +8 -19
  119. package/build/components/style-book/constants.js.map +1 -1
  120. package/build/components/style-book/index.js +5 -0
  121. package/build/components/style-book/index.js.map +1 -1
  122. package/build/hooks/commands/use-common-commands.js +12 -48
  123. package/build/hooks/commands/use-common-commands.js.map +1 -1
  124. package/build/hooks/commands/use-set-command-context.js +2 -2
  125. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  126. package/build/store/private-actions.js +7 -0
  127. package/build/store/private-actions.js.map +1 -1
  128. package/build/store/reducer.js +2 -0
  129. package/build/store/reducer.js.map +1 -1
  130. package/build/utils/is-previewing-theme.js +1 -1
  131. package/build/utils/is-previewing-theme.js.map +1 -1
  132. package/build/utils/use-activate-theme.js +9 -8
  133. package/build/utils/use-activate-theme.js.map +1 -1
  134. package/build-module/components/add-new-pattern/index.js +3 -16
  135. package/build-module/components/add-new-pattern/index.js.map +1 -1
  136. package/build-module/components/add-new-template/index.js +1 -5
  137. package/build-module/components/add-new-template/index.js.map +1 -1
  138. package/build-module/components/app/index.js +33 -31
  139. package/build-module/components/app/index.js.map +1 -1
  140. package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
  141. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  142. package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
  143. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  144. package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
  145. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  146. package/build-module/components/dataviews-actions/index.js +1 -5
  147. package/build-module/components/dataviews-actions/index.js.map +1 -1
  148. package/build-module/components/editor/index.js +38 -22
  149. package/build-module/components/editor/index.js.map +1 -1
  150. package/build-module/components/editor/use-editor-title.js +5 -0
  151. package/build-module/components/editor/use-editor-title.js.map +1 -1
  152. package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
  153. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  154. package/build-module/components/global-styles/font-library-modal/context.js +0 -1
  155. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  156. package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
  157. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  158. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  159. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  160. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  161. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  162. package/build-module/components/global-styles-sidebar/index.js +5 -5
  163. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  164. package/build-module/components/layout/index.js +33 -15
  165. package/build-module/components/layout/index.js.map +1 -1
  166. package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
  167. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  168. package/build-module/components/page-patterns/fields.js +6 -11
  169. package/build-module/components/page-patterns/fields.js.map +1 -1
  170. package/build-module/components/page-patterns/index.js +14 -16
  171. package/build-module/components/page-patterns/index.js.map +1 -1
  172. package/build-module/components/page-templates/fields.js +7 -14
  173. package/build-module/components/page-templates/fields.js.map +1 -1
  174. package/build-module/components/page-templates/index.js +13 -12
  175. package/build-module/components/page-templates/index.js.map +1 -1
  176. package/build-module/components/post-edit/index.js +38 -3
  177. package/build-module/components/post-edit/index.js.map +1 -1
  178. package/build-module/components/post-list/index.js +25 -39
  179. package/build-module/components/post-list/index.js.map +1 -1
  180. package/build-module/components/posts-app/index.js +11 -17
  181. package/build-module/components/posts-app/index.js.map +1 -1
  182. package/build-module/components/posts-app-routes/index.js +3 -7
  183. package/build-module/components/posts-app-routes/index.js.map +1 -1
  184. package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
  185. package/build-module/components/posts-app-routes/post-item.js.map +1 -0
  186. package/build-module/components/posts-app-routes/posts.js +81 -0
  187. package/build-module/components/posts-app-routes/posts.js.map +1 -0
  188. package/build-module/components/resizable-frame/index.js +6 -5
  189. package/build-module/components/resizable-frame/index.js.map +1 -1
  190. package/build-module/components/save-panel/index.js +9 -6
  191. package/build-module/components/save-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
  193. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  194. package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
  195. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  196. package/build-module/components/sidebar-dataviews/index.js +4 -3
  197. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  198. package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
  199. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-item/index.js +8 -5
  201. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  202. package/build-module/components/sidebar-navigation-screen/index.js +2 -2
  203. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
  205. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
  207. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  209. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  210. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  211. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  212. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  213. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  215. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  216. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  217. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  218. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
  219. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  220. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  221. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  222. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  223. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  224. package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
  225. package/build-module/components/site-editor-routes/home.js.map +1 -0
  226. package/build-module/components/site-editor-routes/index.js +12 -18
  227. package/build-module/components/site-editor-routes/index.js.map +1 -1
  228. package/build-module/components/site-editor-routes/navigation-item.js +41 -0
  229. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
  230. package/build-module/components/site-editor-routes/navigation.js +38 -0
  231. package/build-module/components/site-editor-routes/navigation.js.map +1 -0
  232. package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
  233. package/build-module/components/site-editor-routes/page-item.js.map +1 -0
  234. package/build-module/components/site-editor-routes/pages.js +79 -0
  235. package/build-module/components/site-editor-routes/pages.js.map +1 -0
  236. package/build-module/components/site-editor-routes/pattern-item.js +18 -0
  237. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
  238. package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
  239. package/build-module/components/site-editor-routes/patterns.js.map +1 -0
  240. package/build-module/components/site-editor-routes/styles.js +44 -0
  241. package/build-module/components/site-editor-routes/styles.js.map +1 -0
  242. package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
  243. package/build-module/components/site-editor-routes/template-item.js.map +1 -0
  244. package/build-module/components/site-editor-routes/template-part-item.js +18 -0
  245. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
  246. package/build-module/components/site-editor-routes/templates.js +33 -0
  247. package/build-module/components/site-editor-routes/templates.js.map +1 -0
  248. package/build-module/components/site-hub/index.js +3 -3
  249. package/build-module/components/site-hub/index.js.map +1 -1
  250. package/build-module/components/style-book/constants.js +8 -19
  251. package/build-module/components/style-book/constants.js.map +1 -1
  252. package/build-module/components/style-book/index.js +5 -0
  253. package/build-module/components/style-book/index.js.map +1 -1
  254. package/build-module/hooks/commands/use-common-commands.js +12 -48
  255. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  256. package/build-module/hooks/commands/use-set-command-context.js +2 -2
  257. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  258. package/build-module/store/private-actions.js +6 -0
  259. package/build-module/store/private-actions.js.map +1 -1
  260. package/build-module/store/reducer.js +2 -0
  261. package/build-module/store/reducer.js.map +1 -1
  262. package/build-module/utils/is-previewing-theme.js +1 -1
  263. package/build-module/utils/is-previewing-theme.js.map +1 -1
  264. package/build-module/utils/use-activate-theme.js +9 -8
  265. package/build-module/utils/use-activate-theme.js.map +1 -1
  266. package/build-style/style-rtl.css +94 -12
  267. package/build-style/style.css +94 -12
  268. package/package.json +40 -40
  269. package/src/components/add-new-pattern/index.js +9 -17
  270. package/src/components/add-new-template/index.js +3 -5
  271. package/src/components/app/index.js +34 -35
  272. package/src/components/block-editor/use-editor-iframe-props.js +5 -4
  273. package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
  274. package/src/components/block-editor/use-site-editor-settings.js +6 -6
  275. package/src/components/dataviews-actions/index.js +1 -5
  276. package/src/components/editor/index.js +64 -29
  277. package/src/components/editor/use-editor-title.js +4 -0
  278. package/src/components/editor/use-resolve-edited-entity.js +17 -2
  279. package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
  280. package/src/components/global-styles/font-library-modal/style.scss +12 -5
  281. package/src/components/global-styles/style.scss +4 -0
  282. package/src/components/global-styles-sidebar/index.js +4 -4
  283. package/src/components/layout/index.js +36 -6
  284. package/src/components/page-patterns/delete-category-menu-item.js +3 -4
  285. package/src/components/page-patterns/fields.js +12 -11
  286. package/src/components/page-patterns/index.js +16 -14
  287. package/src/components/page-templates/fields.js +4 -15
  288. package/src/components/page-templates/index.js +18 -13
  289. package/src/components/post-edit/index.js +36 -2
  290. package/src/components/post-list/index.js +43 -39
  291. package/src/components/posts-app/index.js +9 -18
  292. package/src/components/posts-app-routes/index.js +3 -14
  293. package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
  294. package/src/components/posts-app-routes/posts.js +66 -0
  295. package/src/components/resizable-frame/index.js +6 -7
  296. package/src/components/save-panel/index.js +11 -5
  297. package/src/components/sidebar-dataviews/add-new-view.js +9 -9
  298. package/src/components/sidebar-dataviews/dataview-item.js +5 -8
  299. package/src/components/sidebar-dataviews/index.js +2 -2
  300. package/src/components/sidebar-dataviews/style.scss +2 -2
  301. package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
  302. package/src/components/sidebar-navigation-item/index.js +7 -5
  303. package/src/components/sidebar-navigation-item/style.scss +1 -2
  304. package/src/components/sidebar-navigation-screen/index.js +2 -2
  305. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  306. package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
  307. package/src/components/sidebar-navigation-screen-main/index.js +6 -10
  308. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
  309. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  310. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
  311. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
  312. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
  313. package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
  314. package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
  315. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  316. package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
  317. package/src/components/site-editor-routes/index.js +22 -34
  318. package/src/components/site-editor-routes/navigation-item.js +39 -0
  319. package/src/components/site-editor-routes/navigation.js +34 -0
  320. package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
  321. package/src/components/site-editor-routes/pages.js +66 -0
  322. package/src/components/site-editor-routes/pattern-item.js +15 -0
  323. package/src/components/site-editor-routes/patterns.js +15 -0
  324. package/src/components/site-editor-routes/styles.js +39 -0
  325. package/src/components/site-editor-routes/template-item.js +15 -0
  326. package/src/components/site-editor-routes/template-part-item.js +15 -0
  327. package/src/components/site-editor-routes/templates.js +26 -0
  328. package/src/components/site-hub/index.js +3 -6
  329. package/src/components/style-book/constants.ts +8 -19
  330. package/src/components/style-book/index.js +5 -0
  331. package/src/hooks/commands/use-common-commands.js +14 -72
  332. package/src/hooks/commands/use-set-command-context.js +2 -2
  333. package/src/store/private-actions.js +7 -0
  334. package/src/store/reducer.js +2 -0
  335. package/src/utils/is-previewing-theme.js +1 -3
  336. package/src/utils/use-activate-theme.js +4 -3
  337. package/build/components/layout/router.js +0 -92
  338. package/build/components/layout/router.js.map +0 -1
  339. package/build/components/posts-app-routes/home.js.map +0 -1
  340. package/build/components/posts-app-routes/posts-edit.js.map +0 -1
  341. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
  342. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  343. package/build/components/posts-app-routes/posts-list-view.js +0 -48
  344. package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
  345. package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
  346. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  347. package/build/components/posts-app-routes/posts-view.js +0 -41
  348. package/build/components/posts-app-routes/posts-view.js.map +0 -1
  349. package/build/components/routes/link.js +0 -69
  350. package/build/components/routes/link.js.map +0 -1
  351. package/build/components/site-editor-routes/home-edit.js.map +0 -1
  352. package/build/components/site-editor-routes/home-view.js.map +0 -1
  353. package/build/components/site-editor-routes/navigation-edit.js +0 -29
  354. package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
  355. package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
  356. package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  357. package/build/components/site-editor-routes/navigation-item-view.js +0 -30
  358. package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
  359. package/build/components/site-editor-routes/navigation-view.js +0 -28
  360. package/build/components/site-editor-routes/navigation-view.js.map +0 -1
  361. package/build/components/site-editor-routes/pages-edit.js.map +0 -1
  362. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
  363. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  364. package/build/components/site-editor-routes/pages-list-view.js +0 -47
  365. package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
  366. package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
  367. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  368. package/build/components/site-editor-routes/pages-view.js +0 -42
  369. package/build/components/site-editor-routes/pages-view.js.map +0 -1
  370. package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
  371. package/build/components/site-editor-routes/patterns-view.js.map +0 -1
  372. package/build/components/site-editor-routes/styles-view.js.map +0 -1
  373. package/build/components/site-editor-routes/templates-edit.js.map +0 -1
  374. package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
  375. package/build/components/site-editor-routes/templates-view.js +0 -29
  376. package/build/components/site-editor-routes/templates-view.js.map +0 -1
  377. package/build-module/components/layout/router.js +0 -84
  378. package/build-module/components/layout/router.js.map +0 -1
  379. package/build-module/components/posts-app-routes/home.js +0 -40
  380. package/build-module/components/posts-app-routes/home.js.map +0 -1
  381. package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
  382. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
  383. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  384. package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
  385. package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
  386. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
  387. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  388. package/build-module/components/posts-app-routes/posts-view.js +0 -33
  389. package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
  390. package/build-module/components/routes/link.js +0 -61
  391. package/build-module/components/routes/link.js.map +0 -1
  392. package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
  393. package/build-module/components/site-editor-routes/home-view.js +0 -17
  394. package/build-module/components/site-editor-routes/home-view.js.map +0 -1
  395. package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
  396. package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
  397. package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
  398. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  399. package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
  400. package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
  401. package/build-module/components/site-editor-routes/navigation-view.js +0 -20
  402. package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
  403. package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
  404. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  405. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  406. package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
  407. package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
  408. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  409. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  410. package/build-module/components/site-editor-routes/pages-view.js +0 -34
  411. package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
  412. package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
  413. package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
  414. package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
  415. package/build-module/components/site-editor-routes/styles-view.js +0 -25
  416. package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
  417. package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
  418. package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
  419. package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
  420. package/build-module/components/site-editor-routes/templates-view.js +0 -21
  421. package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
  422. package/src/components/layout/router.js +0 -86
  423. package/src/components/posts-app-routes/home.js +0 -36
  424. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
  425. package/src/components/posts-app-routes/posts-list-view.js +0 -40
  426. package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
  427. package/src/components/posts-app-routes/posts-view.js +0 -35
  428. package/src/components/routes/link.js +0 -68
  429. package/src/components/site-editor-routes/home-edit.js +0 -17
  430. package/src/components/site-editor-routes/navigation-edit.js +0 -22
  431. package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
  432. package/src/components/site-editor-routes/navigation-item-view.js +0 -25
  433. package/src/components/site-editor-routes/navigation-view.js +0 -21
  434. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  435. package/src/components/site-editor-routes/pages-list-view.js +0 -44
  436. package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  437. package/src/components/site-editor-routes/pages-view.js +0 -39
  438. package/src/components/site-editor-routes/patterns-edit.js +0 -24
  439. package/src/components/site-editor-routes/patterns-view.js +0 -22
  440. package/src/components/site-editor-routes/styles-view.js +0 -26
  441. package/src/components/site-editor-routes/templates-edit.js +0 -22
  442. package/src/components/site-editor-routes/templates-list-view.js +0 -28
  443. package/src/components/site-editor-routes/templates-view.js +0 -22
@@ -9,6 +9,7 @@ import {
9
9
  Button,
10
10
  privateApis as componentsPrivateApis,
11
11
  } from '@wordpress/components';
12
+ import { addQueryArgs } from '@wordpress/url';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -21,7 +22,6 @@ import { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';
21
22
 
22
23
  const { useLocation, useHistory } = unlock( routerPrivateApis );
23
24
  const { Menu } = unlock( componentsPrivateApis );
24
- const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
25
25
 
26
26
  const GlobalStylesPageActions = ( {
27
27
  isStyleBookOpened,
@@ -63,28 +63,23 @@ const GlobalStylesPageActions = ( {
63
63
  };
64
64
 
65
65
  export default function GlobalStylesUIWrapper() {
66
- const { params } = useLocation();
66
+ const { path, query } = useLocation();
67
67
  const history = useHistory();
68
- const { canvas = 'view' } = params;
68
+ const { canvas = 'view' } = query;
69
69
  const [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );
70
70
  const isMobileViewport = useViewportMatch( 'medium', '<' );
71
- const pathWithPrefix = params.path;
72
- const [ path, onPathChange ] = useMemo( () => {
73
- const processedPath = pathWithPrefix.substring(
74
- GLOBAL_STYLES_PATH_PREFIX.length
75
- );
71
+ const [ section, onChangeSection ] = useMemo( () => {
76
72
  return [
77
- processedPath ? processedPath : '/',
78
- ( newPath ) => {
79
- history.push( {
80
- path:
81
- ! newPath || newPath === '/'
82
- ? GLOBAL_STYLES_PATH_PREFIX
83
- : `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,
84
- } );
73
+ query.section ?? '/',
74
+ ( updatedSection ) => {
75
+ history.navigate(
76
+ addQueryArgs( path, {
77
+ section: updatedSection,
78
+ } )
79
+ );
85
80
  },
86
81
  ];
87
- }, [ pathWithPrefix, history ] );
82
+ }, [ path, query.section, history ] );
88
83
 
89
84
  return (
90
85
  <>
@@ -100,7 +95,10 @@ export default function GlobalStylesUIWrapper() {
100
95
  className="edit-site-styles"
101
96
  title={ __( 'Styles' ) }
102
97
  >
103
- <GlobalStylesUI path={ path } onPathChange={ onPathChange } />
98
+ <GlobalStylesUI
99
+ path={ section }
100
+ onPathChange={ onChangeSection }
101
+ />
104
102
  </Page>
105
103
  { canvas === 'view' && isStyleBookOpened && (
106
104
  <StyleBook
@@ -111,17 +109,13 @@ export default function GlobalStylesUIWrapper() {
111
109
  // Match '/blocks/core%2Fbutton' and
112
110
  // '/blocks/core%2Fbutton/typography', but not
113
111
  // '/blocks/core%2Fbuttons'.
114
- path ===
115
- `/wp_global_styles/blocks/${ encodeURIComponent(
116
- blockName
117
- ) }` ||
118
- path.startsWith(
119
- `/wp_global_styles/blocks/${ encodeURIComponent(
120
- blockName
121
- ) }/`
112
+ section ===
113
+ `/blocks/${ encodeURIComponent( blockName ) }` ||
114
+ section.startsWith(
115
+ `/blocks/${ encodeURIComponent( blockName ) }/`
122
116
  )
123
117
  }
124
- path={ path }
118
+ path={ section }
125
119
  onSelect={ ( blockName ) => {
126
120
  if (
127
121
  STYLE_BOOK_COLOR_GROUPS.find(
@@ -129,17 +123,17 @@ export default function GlobalStylesUIWrapper() {
129
123
  )
130
124
  ) {
131
125
  // Go to color palettes Global Styles.
132
- onPathChange( '/colors/palette' );
126
+ onChangeSection( '/colors/palette' );
133
127
  return;
134
128
  }
135
129
  if ( blockName === 'typography' ) {
136
130
  // Go to typography Global Styles.
137
- onPathChange( '/typography' );
131
+ onChangeSection( '/typography' );
138
132
  return;
139
133
  }
140
134
 
141
135
  // Now go to the selected block.
142
- onPathChange(
136
+ onChangeSection(
143
137
  `/blocks/${ encodeURIComponent( blockName ) }`
144
138
  );
145
139
  } }
@@ -22,7 +22,7 @@ import { useContext } from '@wordpress/element';
22
22
  import { unlock } from '../../lock-unlock';
23
23
  import { SidebarNavigationContext } from '../sidebar';
24
24
 
25
- const { useHistory } = unlock( routerPrivateApis );
25
+ const { useHistory, useLink } = unlock( routerPrivateApis );
26
26
 
27
27
  export default function SidebarNavigationItem( {
28
28
  className,
@@ -30,7 +30,7 @@ export default function SidebarNavigationItem( {
30
30
  withChevron = false,
31
31
  suffix,
32
32
  uid,
33
- params,
33
+ to,
34
34
  onClick,
35
35
  children,
36
36
  ...props
@@ -42,12 +42,13 @@ export default function SidebarNavigationItem( {
42
42
  if ( onClick ) {
43
43
  onClick( e );
44
44
  navigate( 'forward' );
45
- } else if ( params ) {
45
+ } else if ( to ) {
46
46
  e.preventDefault();
47
- history.push( params );
47
+ history.navigate( to );
48
48
  navigate( 'forward', `[id="${ uid }"]` );
49
49
  }
50
50
  }
51
+ const linkProps = useLink( to );
51
52
 
52
53
  return (
53
54
  <Item
@@ -56,8 +57,9 @@ export default function SidebarNavigationItem( {
56
57
  { 'with-suffix': ! withChevron && suffix },
57
58
  className
58
59
  ) }
59
- onClick={ handleClick }
60
60
  id={ uid }
61
+ onClick={ handleClick }
62
+ href={ to ? linkProps.href : undefined }
61
63
  { ...props }
62
64
  >
63
65
  <HStack justify="flex-start">
@@ -9,7 +9,6 @@
9
9
  &:focus,
10
10
  &[aria-current="true"] {
11
11
  color: $gray-200;
12
- background: $gray-800;
13
12
 
14
13
  .edit-site-sidebar-navigation-item__drilldown-indicator {
15
14
  fill: $gray-200;
@@ -17,7 +16,7 @@
17
16
  }
18
17
 
19
18
  &[aria-current="true"] {
20
- background: var(--wp-admin-theme-color);
19
+ background: $gray-800;
21
20
  color: $white;
22
21
  }
23
22
 
@@ -83,7 +83,7 @@ export default function SidebarNavigationScreen( {
83
83
  { ! isRoot && (
84
84
  <SidebarButton
85
85
  onClick={ () => {
86
- history.push( backPath );
86
+ history.navigate( backPath );
87
87
  navigate( 'back' );
88
88
  } }
89
89
  icon={ icon }
@@ -97,7 +97,7 @@ export default function SidebarNavigationScreen( {
97
97
  label={
98
98
  dashboardLinkText || __( 'Go to the Dashboard' )
99
99
  }
100
- href={ dashboardLink || 'index.php' }
100
+ href={ dashboardLink }
101
101
  />
102
102
  ) }
103
103
  <Heading
@@ -18,7 +18,7 @@
18
18
  .edit-site-sidebar-navigation-screen__content {
19
19
  padding: 0 $grid-unit-20;
20
20
 
21
- .edit-site-sidebar-navigation-screen-details-footer {
21
+ .components-item-group {
22
22
  margin-left: -$grid-unit-20;
23
23
  margin-right: -$grid-unit-20;
24
24
  }
@@ -131,7 +131,7 @@
131
131
  margin: $grid-unit-20 0 0;
132
132
  border-top: 1px solid $gray-800;
133
133
 
134
- .components-item-group {
134
+ .edit-site-sidebar-navigation-screen-details-footer {
135
135
  margin-left: -$grid-unit-20;
136
136
  margin-right: -$grid-unit-20;
137
137
  }
@@ -2,11 +2,11 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useSelect, useDispatch } from '@wordpress/data';
6
- import { store as coreStore } from '@wordpress/core-data';
5
+ import { useDispatch } from '@wordpress/data';
7
6
  import { useCallback } from '@wordpress/element';
8
7
  import { store as preferencesStore } from '@wordpress/preferences';
9
8
  import { privateApis as routerPrivateApis } from '@wordpress/router';
9
+ import { addQueryArgs } from '@wordpress/url';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
@@ -22,32 +22,18 @@ import { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main'
22
22
  const { useLocation, useHistory } = unlock( routerPrivateApis );
23
23
 
24
24
  export function SidebarNavigationItemGlobalStyles( props ) {
25
- const { params } = useLocation();
26
- const hasGlobalStyleVariations = useSelect(
27
- ( select ) =>
28
- !! select(
29
- coreStore
30
- ).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
31
- []
25
+ const { name } = useLocation();
26
+ return (
27
+ <SidebarNavigationItem
28
+ { ...props }
29
+ aria-current={ name === 'styles' }
30
+ />
32
31
  );
33
- if ( hasGlobalStyleVariations ) {
34
- return (
35
- <SidebarNavigationItem
36
- { ...props }
37
- params={ { path: '/wp_global_styles' } }
38
- uid="global-styles-navigation-item"
39
- aria-current={
40
- params.path && params.path.startsWith( '/wp_global_styles' )
41
- }
42
- />
43
- );
44
- }
45
- return <SidebarNavigationItem { ...props } />;
46
32
  }
47
33
 
48
34
  export default function SidebarNavigationScreenGlobalStyles() {
49
35
  const history = useHistory();
50
- const { params } = useLocation();
36
+ const { path } = useLocation();
51
37
  const {
52
38
  revisions,
53
39
  isLoading: isLoadingRevisions,
@@ -60,21 +46,14 @@ export default function SidebarNavigationScreenGlobalStyles() {
60
46
  const { set: setPreference } = useDispatch( preferencesStore );
61
47
 
62
48
  const openGlobalStyles = useCallback( async () => {
63
- history.push(
64
- {
65
- ...params,
66
- canvas: 'edit',
67
- },
68
- undefined,
69
- {
70
- transition: 'canvas-mode-edit-transition',
71
- }
72
- );
49
+ history.navigate( addQueryArgs( path, { canvas: 'edit' } ), {
50
+ transition: 'canvas-mode-edit-transition',
51
+ } );
73
52
  return Promise.all( [
74
53
  setPreference( 'core', 'distractionFree', false ),
75
54
  openGeneralSidebar( 'edit-site/global-styles' ),
76
55
  ] );
77
- }, [ history, params, openGeneralSidebar, setPreference ] );
56
+ }, [ path, history, openGeneralSidebar, setPreference ] );
78
57
 
79
58
  const openRevisions = useCallback( async () => {
80
59
  await openGlobalStyles();
@@ -15,32 +15,28 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
15
15
  import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
16
16
  import { unlock } from '../../lock-unlock';
17
17
  import { store as editSiteStore } from '../../store';
18
- import {
19
- NAVIGATION_POST_TYPE,
20
- TEMPLATE_POST_TYPE,
21
- PATTERN_TYPES,
22
- } from '../../utils/constants';
23
18
 
24
19
  export function MainSidebarNavigationContent() {
25
20
  return (
26
21
  <ItemGroup>
27
22
  <SidebarNavigationItem
28
23
  uid="navigation-navigation-item"
29
- params={ { postType: NAVIGATION_POST_TYPE } }
24
+ to="/navigation"
30
25
  withChevron
31
26
  icon={ navigation }
32
27
  >
33
28
  { __( 'Navigation' ) }
34
29
  </SidebarNavigationItem>
35
30
  <SidebarNavigationItemGlobalStyles
36
- uid="styles-navigation-item"
31
+ to="/styles"
32
+ uid="global-styles-navigation-item"
37
33
  icon={ styles }
38
34
  >
39
35
  { __( 'Styles' ) }
40
36
  </SidebarNavigationItemGlobalStyles>
41
37
  <SidebarNavigationItem
42
38
  uid="page-navigation-item"
43
- params={ { postType: 'page' } }
39
+ to="/page"
44
40
  withChevron
45
41
  icon={ page }
46
42
  >
@@ -48,7 +44,7 @@ export function MainSidebarNavigationContent() {
48
44
  </SidebarNavigationItem>
49
45
  <SidebarNavigationItem
50
46
  uid="template-navigation-item"
51
- params={ { postType: TEMPLATE_POST_TYPE } }
47
+ to="/template"
52
48
  withChevron
53
49
  icon={ layout }
54
50
  >
@@ -56,7 +52,7 @@ export function MainSidebarNavigationContent() {
56
52
  </SidebarNavigationItem>
57
53
  <SidebarNavigationItem
58
54
  uid="patterns-navigation-item"
59
- params={ { postType: PATTERN_TYPES.user } }
55
+ to="/pattern"
60
56
  withChevron
61
57
  icon={ symbol }
62
58
  >
@@ -58,11 +58,9 @@ export default function ScreenNavigationMoreMenu( props ) {
58
58
  </MenuItem>
59
59
  <MenuItem
60
60
  onClick={ () => {
61
- history.push( {
62
- postId: menuId,
63
- postType: 'wp_navigation',
64
- canvas: 'edit',
65
- } );
61
+ history.navigate(
62
+ `/wp_navigation/${ menuId }?canvas=edit`
63
+ );
66
64
  } }
67
65
  >
68
66
  { __( 'Edit' ) }
@@ -42,7 +42,7 @@ function useDeleteNavigationMenu() {
42
42
  type: 'snackbar',
43
43
  }
44
44
  );
45
- history.push( { postType: 'wp_navigation' } );
45
+ history.navivate( '/navigation' );
46
46
  } catch ( error ) {
47
47
  createErrorNotice(
48
48
  sprintf(
@@ -165,7 +165,7 @@ function useDuplicateNavigationMenu() {
165
165
  createSuccessNotice( __( 'Duplicated Navigation Menu' ), {
166
166
  type: 'snackbar',
167
167
  } );
168
- history.push( { postType, postId: savedRecord.id } );
168
+ history.navigate( `/wp_navigation/${ savedRecord.id }` );
169
169
  }
170
170
  } catch ( error ) {
171
171
  createErrorNotice(
@@ -18,7 +18,6 @@ import { navigation } from '@wordpress/icons';
18
18
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
19
19
  import SidebarNavigationItem from '../sidebar-navigation-item';
20
20
  import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
21
- import { useLink } from '../routes/link';
22
21
  import SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';
23
22
  import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';
24
23
  import { unlock } from '../../lock-unlock';
@@ -152,9 +151,10 @@ export function SidebarNavigationScreenWrapper( {
152
151
  }
153
152
 
154
153
  const NavMenuItem = ( { postId, ...props } ) => {
155
- const linkInfo = useLink( {
156
- postId,
157
- postType: 'wp_navigation',
158
- } );
159
- return <SidebarNavigationItem { ...linkInfo } { ...props } />;
154
+ return (
155
+ <SidebarNavigationItem
156
+ to={ `/wp_navigation/${ postId }` }
157
+ { ...props }
158
+ />
159
+ );
160
160
  };
@@ -20,10 +20,11 @@ const POPOVER_PROPS = {
20
20
  */
21
21
  import { unlock } from '../../lock-unlock';
22
22
 
23
- const { useHistory } = unlock( routerPrivateApis );
23
+ const { useHistory, useLocation } = unlock( routerPrivateApis );
24
24
 
25
25
  export default function LeafMoreMenu( props ) {
26
26
  const history = useHistory();
27
+ const { path } = useLocation();
27
28
  const { block } = props;
28
29
  const { clientId } = block;
29
30
  const { moveBlocksDown, moveBlocksUp, removeBlocks } =
@@ -59,33 +60,20 @@ export default function LeafMoreMenu( props ) {
59
60
  attributes.type &&
60
61
  history
61
62
  ) {
62
- const { params } = history.getLocationWithParams();
63
- history.push(
63
+ history.navigate(
64
+ `/${ attributes.type }/${ attributes.id }?canvas=edit`,
64
65
  {
65
- postType: attributes.type,
66
- postId: attributes.id,
67
- canvas: 'edit',
68
- },
69
- {
70
- backPath: params,
66
+ state: { backPath: path },
71
67
  }
72
68
  );
73
69
  }
74
70
  if ( name === 'core/page-list-item' && attributes.id && history ) {
75
- const { params } = history.getLocationWithParams();
76
- history.push(
77
- {
78
- postType: 'page',
79
- postId: attributes.id,
80
- canvas: 'edit',
81
- },
82
- {
83
- backPath: params,
84
- }
85
- );
71
+ history.navigate( `/page/${ attributes.id }?canvas=edit`, {
72
+ state: { backPath: path },
73
+ } );
86
74
  }
87
75
  },
88
- [ history ]
76
+ [ path, history ]
89
77
  );
90
78
 
91
79
  return (
@@ -2,13 +2,6 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import SidebarNavigationItem from '../sidebar-navigation-item';
5
- import { useLink } from '../routes/link';
6
- import {
7
- TEMPLATE_PART_POST_TYPE,
8
- TEMPLATE_PART_ALL_AREAS_CATEGORY,
9
- PATTERN_DEFAULT_CATEGORY,
10
- PATTERN_TYPES,
11
- } from '../../utils/constants';
12
5
 
13
6
  export default function CategoryItem( {
14
7
  count,
@@ -18,28 +11,20 @@ export default function CategoryItem( {
18
11
  label,
19
12
  type,
20
13
  } ) {
21
- const linkInfo = useLink( {
22
- categoryId:
23
- id !== TEMPLATE_PART_ALL_AREAS_CATEGORY &&
24
- id !== PATTERN_DEFAULT_CATEGORY
25
- ? id
26
- : undefined,
27
- postType:
28
- type === TEMPLATE_PART_POST_TYPE
29
- ? TEMPLATE_PART_POST_TYPE
30
- : PATTERN_TYPES.user,
31
- } );
32
-
33
14
  if ( ! count ) {
34
15
  return;
35
16
  }
17
+ const queryArgs = [ `postType=${ type }` ];
18
+ if ( id ) {
19
+ queryArgs.push( `categoryId=${ id }` );
20
+ }
36
21
 
37
22
  return (
38
23
  <SidebarNavigationItem
39
- { ...linkInfo }
40
24
  icon={ icon }
41
25
  suffix={ <span>{ count }</span> }
42
26
  aria-current={ isActive ? 'true' : undefined }
27
+ to={ `/pattern?${ queryArgs.join( '&' ) }` }
43
28
  >
44
29
  { label }
45
30
  </SidebarNavigationItem>
@@ -104,12 +104,11 @@ function CategoriesGroup( {
104
104
 
105
105
  export default function SidebarNavigationScreenPatterns( { backPath } ) {
106
106
  const {
107
- params: { postType, categoryId },
107
+ query: { postType = 'wp_block', categoryId },
108
108
  } = useLocation();
109
- const currentType = postType || PATTERN_TYPES.user;
110
109
  const currentCategory =
111
110
  categoryId ||
112
- ( currentType === PATTERN_TYPES.user
111
+ ( postType === PATTERN_TYPES.user
113
112
  ? PATTERN_DEFAULT_CATEGORY
114
113
  : TEMPLATE_PART_ALL_AREAS_CATEGORY );
115
114
 
@@ -143,7 +142,7 @@ export default function SidebarNavigationScreenPatterns( { backPath } ) {
143
142
  templatePartAreas={ templatePartAreas }
144
143
  patternCategories={ patternCategories }
145
144
  currentCategory={ currentCategory }
146
- currentType={ currentType }
145
+ currentType={ postType }
147
146
  />
148
147
  </>
149
148
  ) }
@@ -4,35 +4,41 @@
4
4
  import { useEntityRecords } from '@wordpress/core-data';
5
5
  import { useMemo } from '@wordpress/element';
6
6
  import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
7
+ import { __ } from '@wordpress/i18n';
8
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
9
+ import { addQueryArgs } from '@wordpress/url';
7
10
 
8
11
  /**
9
12
  * Internal dependencies
10
13
  */
11
- import DataViewItem from '../sidebar-dataviews/dataview-item';
14
+ import SidebarNavigationItem from '../sidebar-navigation-item';
12
15
  import { useAddedBy } from '../page-templates/hooks';
13
16
  import { layout } from '@wordpress/icons';
14
17
  import { TEMPLATE_POST_TYPE } from '../../utils/constants';
18
+ import { unlock } from '../../lock-unlock';
19
+
20
+ const { useLocation } = unlock( routerPrivateApis );
15
21
 
16
22
  const EMPTY_ARRAY = [];
17
23
 
18
24
  function TemplateDataviewItem( { template, isActive } ) {
19
25
  const { text, icon } = useAddedBy( template.type, template.id );
26
+
20
27
  return (
21
- <DataViewItem
22
- key={ text }
23
- slug={ text }
24
- title={ text }
28
+ <SidebarNavigationItem
29
+ to={ addQueryArgs( '/template', { activeView: text } ) }
25
30
  icon={ icon }
26
- isActive={ isActive }
27
- isCustom={ false }
28
- />
31
+ aria-current={ isActive }
32
+ >
33
+ { text }
34
+ </SidebarNavigationItem>
29
35
  );
30
36
  }
31
37
 
32
- export default function DataviewsTemplatesSidebarContent( {
33
- activeView,
34
- title,
35
- } ) {
38
+ export default function DataviewsTemplatesSidebarContent() {
39
+ const {
40
+ query: { activeView = 'all' },
41
+ } = useLocation();
36
42
  const { records } = useEntityRecords( 'postType', TEMPLATE_POST_TYPE, {
37
43
  per_page: -1,
38
44
  } );
@@ -52,13 +58,13 @@ export default function DataviewsTemplatesSidebarContent( {
52
58
 
53
59
  return (
54
60
  <ItemGroup>
55
- <DataViewItem
56
- slug="all"
57
- title={ title }
61
+ <SidebarNavigationItem
62
+ to="/template"
58
63
  icon={ layout }
59
- isActive={ activeView === 'all' }
60
- isCustom={ false }
61
- />
64
+ aria-current={ activeView === 'all' }
65
+ >
66
+ { __( 'All templates' ) }
67
+ </SidebarNavigationItem>
62
68
  { firstItemPerAuthorText.map( ( template ) => {
63
69
  return (
64
70
  <TemplateDataviewItem
@@ -2,22 +2,14 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { privateApis as routerPrivateApis } from '@wordpress/router';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
11
- import { unlock } from '../../lock-unlock';
12
10
  import DataviewsTemplatesSidebarContent from './content';
13
11
 
14
- const { useLocation } = unlock( routerPrivateApis );
15
-
16
12
  export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
17
- const {
18
- params: { activeView = 'all' },
19
- } = useLocation();
20
-
21
13
  return (
22
14
  <SidebarNavigationScreen
23
15
  title={ __( 'Templates' ) }
@@ -25,12 +17,7 @@ export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
25
17
  'Create new templates, or reset any customizations made to the templates supplied by your theme.'
26
18
  ) }
27
19
  backPath={ backPath }
28
- content={
29
- <DataviewsTemplatesSidebarContent
30
- activeView={ activeView }
31
- title={ __( 'All templates' ) }
32
- />
33
- }
20
+ content={ <DataviewsTemplatesSidebarContent /> }
34
21
  />
35
22
  );
36
23
  }
@@ -4,13 +4,12 @@
4
4
  import Editor from '../editor';
5
5
  import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
6
6
 
7
- export const homeViewRoute = {
8
- name: 'home-view',
9
- match: ( params ) => {
10
- return params.canvas !== 'edit';
11
- },
7
+ export const homeRoute = {
8
+ name: 'home',
9
+ path: '/',
12
10
  areas: {
13
11
  sidebar: <SidebarNavigationScreenMain />,
14
12
  preview: <Editor />,
13
+ mobile: <SidebarNavigationScreenMain />,
15
14
  },
16
15
  };