@wordpress/edit-site 6.13.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 (442) hide show
  1. package/build/components/add-new-pattern/index.js +3 -16
  2. package/build/components/add-new-pattern/index.js.map +1 -1
  3. package/build/components/add-new-template/index.js +1 -5
  4. package/build/components/add-new-template/index.js.map +1 -1
  5. package/build/components/app/index.js +31 -29
  6. package/build/components/app/index.js.map +1 -1
  7. package/build/components/block-editor/use-editor-iframe-props.js +8 -8
  8. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  9. package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
  10. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  11. package/build/components/block-editor/use-site-editor-settings.js +4 -4
  12. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  13. package/build/components/dataviews-actions/index.js +1 -5
  14. package/build/components/dataviews-actions/index.js.map +1 -1
  15. package/build/components/editor/index.js +38 -22
  16. package/build/components/editor/index.js.map +1 -1
  17. package/build/components/editor/use-editor-title.js +5 -0
  18. package/build/components/editor/use-editor-title.js.map +1 -1
  19. package/build/components/editor/use-resolve-edited-entity.js +19 -4
  20. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/context.js +0 -1
  22. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
  24. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  26. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  29. package/build/components/global-styles-sidebar/index.js +5 -5
  30. package/build/components/global-styles-sidebar/index.js.map +1 -1
  31. package/build/components/layout/index.js +31 -13
  32. package/build/components/layout/index.js.map +1 -1
  33. package/build/components/page-patterns/delete-category-menu-item.js +1 -4
  34. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  35. package/build/components/page-patterns/fields.js +6 -11
  36. package/build/components/page-patterns/fields.js.map +1 -1
  37. package/build/components/page-patterns/index.js +14 -16
  38. package/build/components/page-patterns/index.js.map +1 -1
  39. package/build/components/page-templates/fields.js +8 -17
  40. package/build/components/page-templates/fields.js.map +1 -1
  41. package/build/components/page-templates/index.js +13 -12
  42. package/build/components/page-templates/index.js.map +1 -1
  43. package/build/components/post-edit/index.js +38 -3
  44. package/build/components/post-edit/index.js.map +1 -1
  45. package/build/components/post-list/index.js +25 -39
  46. package/build/components/post-list/index.js.map +1 -1
  47. package/build/components/posts-app/index.js +10 -16
  48. package/build/components/posts-app/index.js.map +1 -1
  49. package/build/components/posts-app-routes/index.js +3 -7
  50. package/build/components/posts-app-routes/index.js.map +1 -1
  51. package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
  52. package/build/components/posts-app-routes/post-item.js.map +1 -0
  53. package/build/components/posts-app-routes/posts.js +89 -0
  54. package/build/components/posts-app-routes/posts.js.map +1 -0
  55. package/build/components/resizable-frame/index.js +6 -5
  56. package/build/components/resizable-frame/index.js.map +1 -1
  57. package/build/components/save-panel/index.js +9 -6
  58. package/build/components/save-panel/index.js.map +1 -1
  59. package/build/components/sidebar-dataviews/add-new-view.js +7 -8
  60. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  61. package/build/components/sidebar-dataviews/dataview-item.js +5 -8
  62. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  63. package/build/components/sidebar-dataviews/index.js +4 -3
  64. package/build/components/sidebar-dataviews/index.js.map +1 -1
  65. package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
  66. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  67. package/build/components/sidebar-navigation-item/index.js +8 -5
  68. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  69. package/build/components/sidebar-navigation-screen/index.js +2 -2
  70. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  71. package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
  72. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen-main/index.js +6 -14
  74. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  76. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  78. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  80. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  81. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  82. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  83. package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  84. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
  86. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  88. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  90. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  91. package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
  92. package/build/components/site-editor-routes/home.js.map +1 -0
  93. package/build/components/site-editor-routes/index.js +12 -18
  94. package/build/components/site-editor-routes/index.js.map +1 -1
  95. package/build/components/site-editor-routes/navigation-item.js +49 -0
  96. package/build/components/site-editor-routes/navigation-item.js.map +1 -0
  97. package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
  98. package/build/components/site-editor-routes/navigation.js.map +1 -0
  99. package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
  100. package/build/components/site-editor-routes/page-item.js.map +1 -0
  101. package/build/components/site-editor-routes/pages.js +87 -0
  102. package/build/components/site-editor-routes/pages.js.map +1 -0
  103. package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
  104. package/build/components/site-editor-routes/pattern-item.js.map +1 -0
  105. package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
  106. package/build/components/site-editor-routes/patterns.js.map +1 -0
  107. package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
  108. package/build/components/site-editor-routes/styles.js.map +1 -0
  109. package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
  110. package/build/components/site-editor-routes/template-item.js.map +1 -0
  111. package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
  112. package/build/components/site-editor-routes/template-part-item.js.map +1 -0
  113. package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
  114. package/build/components/site-editor-routes/templates.js.map +1 -0
  115. package/build/components/site-hub/index.js +3 -3
  116. package/build/components/site-hub/index.js.map +1 -1
  117. package/build/components/style-book/constants.js +8 -19
  118. package/build/components/style-book/constants.js.map +1 -1
  119. package/build/components/style-book/index.js +5 -0
  120. package/build/components/style-book/index.js.map +1 -1
  121. package/build/hooks/commands/use-common-commands.js +12 -48
  122. package/build/hooks/commands/use-common-commands.js.map +1 -1
  123. package/build/hooks/commands/use-set-command-context.js +2 -2
  124. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  125. package/build/store/private-actions.js +7 -0
  126. package/build/store/private-actions.js.map +1 -1
  127. package/build/store/reducer.js +2 -0
  128. package/build/store/reducer.js.map +1 -1
  129. package/build/utils/is-previewing-theme.js +1 -1
  130. package/build/utils/is-previewing-theme.js.map +1 -1
  131. package/build/utils/use-activate-theme.js +9 -8
  132. package/build/utils/use-activate-theme.js.map +1 -1
  133. package/build-module/components/add-new-pattern/index.js +3 -16
  134. package/build-module/components/add-new-pattern/index.js.map +1 -1
  135. package/build-module/components/add-new-template/index.js +1 -5
  136. package/build-module/components/add-new-template/index.js.map +1 -1
  137. package/build-module/components/app/index.js +33 -31
  138. package/build-module/components/app/index.js.map +1 -1
  139. package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
  140. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  141. package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
  142. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  143. package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
  144. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  145. package/build-module/components/dataviews-actions/index.js +1 -5
  146. package/build-module/components/dataviews-actions/index.js.map +1 -1
  147. package/build-module/components/editor/index.js +38 -22
  148. package/build-module/components/editor/index.js.map +1 -1
  149. package/build-module/components/editor/use-editor-title.js +5 -0
  150. package/build-module/components/editor/use-editor-title.js.map +1 -1
  151. package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
  152. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  153. package/build-module/components/global-styles/font-library-modal/context.js +0 -1
  154. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  155. package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
  156. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  157. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  158. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  159. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  160. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  161. package/build-module/components/global-styles-sidebar/index.js +5 -5
  162. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  163. package/build-module/components/layout/index.js +33 -15
  164. package/build-module/components/layout/index.js.map +1 -1
  165. package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
  166. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  167. package/build-module/components/page-patterns/fields.js +6 -11
  168. package/build-module/components/page-patterns/fields.js.map +1 -1
  169. package/build-module/components/page-patterns/index.js +14 -16
  170. package/build-module/components/page-patterns/index.js.map +1 -1
  171. package/build-module/components/page-templates/fields.js +7 -14
  172. package/build-module/components/page-templates/fields.js.map +1 -1
  173. package/build-module/components/page-templates/index.js +13 -12
  174. package/build-module/components/page-templates/index.js.map +1 -1
  175. package/build-module/components/post-edit/index.js +38 -3
  176. package/build-module/components/post-edit/index.js.map +1 -1
  177. package/build-module/components/post-list/index.js +25 -39
  178. package/build-module/components/post-list/index.js.map +1 -1
  179. package/build-module/components/posts-app/index.js +11 -17
  180. package/build-module/components/posts-app/index.js.map +1 -1
  181. package/build-module/components/posts-app-routes/index.js +3 -7
  182. package/build-module/components/posts-app-routes/index.js.map +1 -1
  183. package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
  184. package/build-module/components/posts-app-routes/post-item.js.map +1 -0
  185. package/build-module/components/posts-app-routes/posts.js +81 -0
  186. package/build-module/components/posts-app-routes/posts.js.map +1 -0
  187. package/build-module/components/resizable-frame/index.js +6 -5
  188. package/build-module/components/resizable-frame/index.js.map +1 -1
  189. package/build-module/components/save-panel/index.js +9 -6
  190. package/build-module/components/save-panel/index.js.map +1 -1
  191. package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
  192. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  193. package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
  194. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  195. package/build-module/components/sidebar-dataviews/index.js +4 -3
  196. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  197. package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
  198. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  199. package/build-module/components/sidebar-navigation-item/index.js +8 -5
  200. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  201. package/build-module/components/sidebar-navigation-screen/index.js +2 -2
  202. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  203. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
  204. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  205. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
  206. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  207. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  208. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  209. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  210. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  211. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  212. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  213. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  214. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  215. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  216. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  217. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
  218. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  219. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  220. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  221. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  222. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  223. package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
  224. package/build-module/components/site-editor-routes/home.js.map +1 -0
  225. package/build-module/components/site-editor-routes/index.js +12 -18
  226. package/build-module/components/site-editor-routes/index.js.map +1 -1
  227. package/build-module/components/site-editor-routes/navigation-item.js +41 -0
  228. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
  229. package/build-module/components/site-editor-routes/navigation.js +38 -0
  230. package/build-module/components/site-editor-routes/navigation.js.map +1 -0
  231. package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
  232. package/build-module/components/site-editor-routes/page-item.js.map +1 -0
  233. package/build-module/components/site-editor-routes/pages.js +79 -0
  234. package/build-module/components/site-editor-routes/pages.js.map +1 -0
  235. package/build-module/components/site-editor-routes/pattern-item.js +18 -0
  236. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
  237. package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
  238. package/build-module/components/site-editor-routes/patterns.js.map +1 -0
  239. package/build-module/components/site-editor-routes/styles.js +44 -0
  240. package/build-module/components/site-editor-routes/styles.js.map +1 -0
  241. package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
  242. package/build-module/components/site-editor-routes/template-item.js.map +1 -0
  243. package/build-module/components/site-editor-routes/template-part-item.js +18 -0
  244. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
  245. package/build-module/components/site-editor-routes/templates.js +33 -0
  246. package/build-module/components/site-editor-routes/templates.js.map +1 -0
  247. package/build-module/components/site-hub/index.js +3 -3
  248. package/build-module/components/site-hub/index.js.map +1 -1
  249. package/build-module/components/style-book/constants.js +8 -19
  250. package/build-module/components/style-book/constants.js.map +1 -1
  251. package/build-module/components/style-book/index.js +5 -0
  252. package/build-module/components/style-book/index.js.map +1 -1
  253. package/build-module/hooks/commands/use-common-commands.js +12 -48
  254. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  255. package/build-module/hooks/commands/use-set-command-context.js +2 -2
  256. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  257. package/build-module/store/private-actions.js +6 -0
  258. package/build-module/store/private-actions.js.map +1 -1
  259. package/build-module/store/reducer.js +2 -0
  260. package/build-module/store/reducer.js.map +1 -1
  261. package/build-module/utils/is-previewing-theme.js +1 -1
  262. package/build-module/utils/is-previewing-theme.js.map +1 -1
  263. package/build-module/utils/use-activate-theme.js +9 -8
  264. package/build-module/utils/use-activate-theme.js.map +1 -1
  265. package/build-style/style-rtl.css +94 -12
  266. package/build-style/style.css +94 -12
  267. package/package.json +40 -40
  268. package/src/components/add-new-pattern/index.js +9 -17
  269. package/src/components/add-new-template/index.js +3 -5
  270. package/src/components/app/index.js +34 -35
  271. package/src/components/block-editor/use-editor-iframe-props.js +5 -4
  272. package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
  273. package/src/components/block-editor/use-site-editor-settings.js +6 -6
  274. package/src/components/dataviews-actions/index.js +1 -5
  275. package/src/components/editor/index.js +64 -29
  276. package/src/components/editor/use-editor-title.js +4 -0
  277. package/src/components/editor/use-resolve-edited-entity.js +17 -2
  278. package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
  279. package/src/components/global-styles/font-library-modal/style.scss +12 -5
  280. package/src/components/global-styles/style.scss +4 -0
  281. package/src/components/global-styles-sidebar/index.js +4 -4
  282. package/src/components/layout/index.js +36 -6
  283. package/src/components/page-patterns/delete-category-menu-item.js +3 -4
  284. package/src/components/page-patterns/fields.js +12 -11
  285. package/src/components/page-patterns/index.js +16 -14
  286. package/src/components/page-templates/fields.js +4 -15
  287. package/src/components/page-templates/index.js +18 -13
  288. package/src/components/post-edit/index.js +36 -2
  289. package/src/components/post-list/index.js +43 -39
  290. package/src/components/posts-app/index.js +9 -18
  291. package/src/components/posts-app-routes/index.js +3 -14
  292. package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
  293. package/src/components/posts-app-routes/posts.js +66 -0
  294. package/src/components/resizable-frame/index.js +6 -7
  295. package/src/components/save-panel/index.js +11 -5
  296. package/src/components/sidebar-dataviews/add-new-view.js +9 -9
  297. package/src/components/sidebar-dataviews/dataview-item.js +5 -8
  298. package/src/components/sidebar-dataviews/index.js +2 -2
  299. package/src/components/sidebar-dataviews/style.scss +2 -2
  300. package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
  301. package/src/components/sidebar-navigation-item/index.js +7 -5
  302. package/src/components/sidebar-navigation-item/style.scss +1 -2
  303. package/src/components/sidebar-navigation-screen/index.js +2 -2
  304. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  305. package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
  306. package/src/components/sidebar-navigation-screen-main/index.js +6 -10
  307. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
  308. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  309. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
  310. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
  311. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
  312. package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
  313. package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
  314. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  315. package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
  316. package/src/components/site-editor-routes/index.js +22 -34
  317. package/src/components/site-editor-routes/navigation-item.js +39 -0
  318. package/src/components/site-editor-routes/navigation.js +34 -0
  319. package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
  320. package/src/components/site-editor-routes/pages.js +66 -0
  321. package/src/components/site-editor-routes/pattern-item.js +15 -0
  322. package/src/components/site-editor-routes/patterns.js +15 -0
  323. package/src/components/site-editor-routes/styles.js +39 -0
  324. package/src/components/site-editor-routes/template-item.js +15 -0
  325. package/src/components/site-editor-routes/template-part-item.js +15 -0
  326. package/src/components/site-editor-routes/templates.js +26 -0
  327. package/src/components/site-hub/index.js +3 -6
  328. package/src/components/style-book/constants.ts +8 -19
  329. package/src/components/style-book/index.js +5 -0
  330. package/src/hooks/commands/use-common-commands.js +14 -72
  331. package/src/hooks/commands/use-set-command-context.js +2 -2
  332. package/src/store/private-actions.js +7 -0
  333. package/src/store/reducer.js +2 -0
  334. package/src/utils/is-previewing-theme.js +1 -3
  335. package/src/utils/use-activate-theme.js +4 -3
  336. package/build/components/layout/router.js +0 -92
  337. package/build/components/layout/router.js.map +0 -1
  338. package/build/components/posts-app-routes/home.js.map +0 -1
  339. package/build/components/posts-app-routes/posts-edit.js.map +0 -1
  340. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
  341. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  342. package/build/components/posts-app-routes/posts-list-view.js +0 -48
  343. package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
  344. package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
  345. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  346. package/build/components/posts-app-routes/posts-view.js +0 -41
  347. package/build/components/posts-app-routes/posts-view.js.map +0 -1
  348. package/build/components/routes/link.js +0 -69
  349. package/build/components/routes/link.js.map +0 -1
  350. package/build/components/site-editor-routes/home-edit.js.map +0 -1
  351. package/build/components/site-editor-routes/home-view.js.map +0 -1
  352. package/build/components/site-editor-routes/navigation-edit.js +0 -29
  353. package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
  354. package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
  355. package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  356. package/build/components/site-editor-routes/navigation-item-view.js +0 -30
  357. package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
  358. package/build/components/site-editor-routes/navigation-view.js +0 -28
  359. package/build/components/site-editor-routes/navigation-view.js.map +0 -1
  360. package/build/components/site-editor-routes/pages-edit.js.map +0 -1
  361. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
  362. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  363. package/build/components/site-editor-routes/pages-list-view.js +0 -47
  364. package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
  365. package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
  366. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  367. package/build/components/site-editor-routes/pages-view.js +0 -42
  368. package/build/components/site-editor-routes/pages-view.js.map +0 -1
  369. package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
  370. package/build/components/site-editor-routes/patterns-view.js.map +0 -1
  371. package/build/components/site-editor-routes/styles-view.js.map +0 -1
  372. package/build/components/site-editor-routes/templates-edit.js.map +0 -1
  373. package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
  374. package/build/components/site-editor-routes/templates-view.js +0 -29
  375. package/build/components/site-editor-routes/templates-view.js.map +0 -1
  376. package/build-module/components/layout/router.js +0 -84
  377. package/build-module/components/layout/router.js.map +0 -1
  378. package/build-module/components/posts-app-routes/home.js +0 -40
  379. package/build-module/components/posts-app-routes/home.js.map +0 -1
  380. package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
  381. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
  382. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  383. package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
  384. package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
  385. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
  386. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  387. package/build-module/components/posts-app-routes/posts-view.js +0 -33
  388. package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
  389. package/build-module/components/routes/link.js +0 -61
  390. package/build-module/components/routes/link.js.map +0 -1
  391. package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
  392. package/build-module/components/site-editor-routes/home-view.js +0 -17
  393. package/build-module/components/site-editor-routes/home-view.js.map +0 -1
  394. package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
  395. package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
  396. package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
  397. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  398. package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
  399. package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
  400. package/build-module/components/site-editor-routes/navigation-view.js +0 -20
  401. package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
  402. package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
  403. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  404. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  405. package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
  406. package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
  407. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  408. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  409. package/build-module/components/site-editor-routes/pages-view.js +0 -34
  410. package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
  411. package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
  412. package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
  413. package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
  414. package/build-module/components/site-editor-routes/styles-view.js +0 -25
  415. package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
  416. package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
  417. package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
  418. package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
  419. package/build-module/components/site-editor-routes/templates-view.js +0 -21
  420. package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
  421. package/src/components/layout/router.js +0 -86
  422. package/src/components/posts-app-routes/home.js +0 -36
  423. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
  424. package/src/components/posts-app-routes/posts-list-view.js +0 -40
  425. package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
  426. package/src/components/posts-app-routes/posts-view.js +0 -35
  427. package/src/components/routes/link.js +0 -68
  428. package/src/components/site-editor-routes/home-edit.js +0 -17
  429. package/src/components/site-editor-routes/navigation-edit.js +0 -22
  430. package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
  431. package/src/components/site-editor-routes/navigation-item-view.js +0 -25
  432. package/src/components/site-editor-routes/navigation-view.js +0 -21
  433. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  434. package/src/components/site-editor-routes/pages-list-view.js +0 -44
  435. package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  436. package/src/components/site-editor-routes/pages-view.js +0 -39
  437. package/src/components/site-editor-routes/patterns-edit.js +0 -24
  438. package/src/components/site-editor-routes/patterns-view.js +0 -22
  439. package/src/components/site-editor-routes/styles-view.js +0 -26
  440. package/src/components/site-editor-routes/templates-edit.js +0 -22
  441. package/src/components/site-editor-routes/templates-list-view.js +0 -28
  442. package/src/components/site-editor-routes/templates-view.js +0 -22
@@ -9,7 +9,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _router = require("@wordpress/router");
10
10
  var _components = require("@wordpress/components");
11
11
  var _dataviews = require("@wordpress/dataviews");
12
- var _link = require("../routes/link");
12
+ var _url = require("@wordpress/url");
13
13
  var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
14
14
  var _lockUnlock = require("../../lock-unlock");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
@@ -39,21 +39,18 @@ function DataViewItem({
39
39
  suffix
40
40
  }) {
41
41
  const {
42
- params: {
43
- postType
44
- }
42
+ path
45
43
  } = useLocation();
46
44
  const iconToUse = icon || _dataviews.VIEW_LAYOUTS.find(v => v.type === type).icon;
47
45
  let activeView = isCustom ? customViewId : slug;
48
46
  if (activeView === 'all') {
49
47
  activeView = undefined;
50
48
  }
51
- const linkInfo = (0, _link.useLink)({
52
- postType,
49
+ const query = {
53
50
  layout: type,
54
51
  activeView,
55
52
  isCustom: isCustom ? 'true' : undefined
56
- });
53
+ };
57
54
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
58
55
  justify: "flex-start",
59
56
  className: (0, _clsx.default)('edit-site-sidebar-dataviews-dataview-item', {
@@ -61,7 +58,7 @@ function DataViewItem({
61
58
  }),
62
59
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
63
60
  icon: iconToUse,
64
- ...linkInfo,
61
+ to: (0, _url.addQueryArgs)(path, query),
65
62
  "aria-current": isActive ? 'true' : undefined,
66
63
  children: title
67
64
  }), suffix]
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_link","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","postType","iconToUse","VIEW_LAYOUTS","find","v","activeView","undefined","linkInfo","useLink","layout","jsxs","__experimentalHStack","justify","className","clsx","children","jsx","default"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { postType },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tlet activeView = isCustom ? customViewId : slug;\n\tif ( activeView === 'all' ) {\n\t\tactiveView = undefined;\n\t}\n\tconst linkInfo = useLink( {\n\t\tpostType,\n\t\tlayout: type,\n\t\tactiveView,\n\t\tisCustom: isCustom ? 'true' : undefined,\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAjB3C;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAS;EACpB,CAAC,GAAGb,WAAW,CAAC,CAAC;EAEjB,MAAMc,SAAS,GACdN,IAAI,IAAIO,uBAAY,CAACC,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACV,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,IAAIU,UAAU,GAAGR,QAAQ,GAAGJ,YAAY,GAAGD,IAAI;EAC/C,IAAKa,UAAU,KAAK,KAAK,EAAG;IAC3BA,UAAU,GAAGC,SAAS;EACvB;EACA,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBR,QAAQ;IACRS,MAAM,EAAEf,IAAI;IACZW,UAAU;IACVR,QAAQ,EAAEA,QAAQ,GAAG,MAAM,GAAGS;EAC/B,CAAE,CAAC;EACH,oBACC,IAAApB,WAAA,CAAAwB,IAAA,EAAC7B,WAAA,CAAA8B,oBAAM;IACNC,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG,IAAAC,aAAI,EAAE,2CAA2C,EAAE;MAC9D,aAAa,EAAElB;IAChB,CAAE,CAAG;IAAAmB,QAAA,gBAEL,IAAA7B,WAAA,CAAA8B,GAAA,EAAChC,sBAAA,CAAAiC,OAAqB;MACrBtB,IAAI,EAAGM,SAAW;MAAA,GACbM,QAAQ;MACb,gBAAeX,QAAQ,GAAG,MAAM,GAAGU,SAAW;MAAAS,QAAA,EAE5CxB;IAAK,CACe,CAAC,EACtBO,MAAM;EAAA,CACD,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_url","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","path","iconToUse","VIEW_LAYOUTS","find","v","activeView","undefined","query","layout","jsxs","__experimentalHStack","justify","className","clsx","children","jsx","default","to","addQueryArgs"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst { path } = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tlet activeView = isCustom ? customViewId : slug;\n\tif ( activeView === 'all' ) {\n\t\tactiveView = undefined;\n\t}\n\tconst query = {\n\t\tlayout: type,\n\t\tactiveView,\n\t\tisCustom: isCustom ? 'true' : undefined,\n\t};\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\tto={ addQueryArgs( path, query ) }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAKA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAjB3C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAK,CAAC,GAAGZ,WAAW,CAAC,CAAC;EAE9B,MAAMa,SAAS,GACdL,IAAI,IAAIM,uBAAY,CAACC,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACT,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,IAAIS,UAAU,GAAGP,QAAQ,GAAGJ,YAAY,GAAGD,IAAI;EAC/C,IAAKY,UAAU,KAAK,KAAK,EAAG;IAC3BA,UAAU,GAAGC,SAAS;EACvB;EACA,MAAMC,KAAK,GAAG;IACbC,MAAM,EAAEb,IAAI;IACZU,UAAU;IACVP,QAAQ,EAAEA,QAAQ,GAAG,MAAM,GAAGQ;EAC/B,CAAC;EACD,oBACC,IAAAnB,WAAA,CAAAsB,IAAA,EAAC3B,WAAA,CAAA4B,oBAAM;IACNC,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG,IAAAC,aAAI,EAAE,2CAA2C,EAAE;MAC9D,aAAa,EAAEhB;IAChB,CAAE,CAAG;IAAAiB,QAAA,gBAEL,IAAA3B,WAAA,CAAA4B,GAAA,EAAC9B,sBAAA,CAAA+B,OAAqB;MACrBpB,IAAI,EAAGK,SAAW;MAClBgB,EAAE,EAAG,IAAAC,iBAAY,EAAElB,IAAI,EAAEO,KAAM,CAAG;MAClC,gBAAeV,QAAQ,GAAG,MAAM,GAAGS,SAAW;MAAAQ,QAAA,EAE5CtB;IAAK,CACe,CAAC,EACtBO,MAAM;EAAA,CACD,CAAC;AAEX","ignoreList":[]}
@@ -23,10 +23,11 @@ var _jsxRuntime = require("react/jsx-runtime");
23
23
  const {
24
24
  useLocation
25
25
  } = (0, _lockUnlock.unlock)(_router.privateApis);
26
- function DataViewsSidebarContent() {
26
+ function DataViewsSidebarContent({
27
+ postType
28
+ }) {
27
29
  const {
28
- params: {
29
- postType,
30
+ query: {
30
31
  activeView = 'all',
31
32
  isCustom = 'false'
32
33
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_router","_defaultViews","_lockUnlock","_dataviewItem","_interopRequireDefault","_customDataviewsList","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewsSidebarContent","params","postType","activeView","isCustom","defaultViews","useDefaultViews","isCustomBoolean","jsxs","Fragment","children","jsx","__experimentalItemGroup","map","dataview","default","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView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AAAlB,WAAA,CAAAe,GAAA,EAAClB,aAAA,CAAAsB,OAAY;UAEZC,IAAI,EAAGF,QAAQ,CAACE,IAAM;UACtBC,KAAK,EAAGH,QAAQ,CAACG,KAAO;UACxBC,IAAI,EAAGJ,QAAQ,CAACI,IAAM;UACtBC,IAAI,EAAGL,QAAQ,CAACM,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAEd,eAAe,IACjBO,QAAQ,CAACE,IAAI,KAAKb,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZU,QAAQ,CAACE,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClC,IAAA3B,WAAA,CAAAe,GAAA,EAAChB,oBAAA,CAAAoB,OAAmB;MACnBZ,UAAU,EAAGA,UAAY;MACzBgB,IAAI,EAAGjB,QAAU;MACjBE,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_router","_defaultViews","_lockUnlock","_dataviewItem","_interopRequireDefault","_customDataviewsList","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewsSidebarContent","postType","query","activeView","isCustom","defaultViews","useDefaultViews","isCustomBoolean","jsxs","Fragment","children","jsx","__experimentalItemGroup","map","dataview","default","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent( { postType } ) {\n\tconst {\n\t\tquery: { activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAD,sBAAA,CAAAL,OAAA;AAA0D,IAAAO,WAAA,GAAAP,OAAA;AAZ1D;AACA;AACA;;AAIA;AACA;AACA;;AAMA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,uBAAuBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/D,MAAM;IACLC,KAAK,EAAE;MAAEC,UAAU,GAAG,KAAK;MAAEC,QAAQ,GAAG;IAAQ;EACjD,CAAC,GAAGP,WAAW,CAAC,CAAC;EACjB,MAAMQ,YAAY,GAAG,IAAAC,6BAAe,EAAE;IAAEL;EAAS,CAAE,CAAC;EACpD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EACA,MAAMM,eAAe,GAAGH,QAAQ,KAAK,MAAM;EAE3C,oBACC,IAAAR,WAAA,CAAAY,IAAA,EAAAZ,WAAA,CAAAa,QAAA;IAAAC,QAAA,gBACC,IAAAd,WAAA,CAAAe,GAAA,EAACvB,WAAA,CAAAwB,uBAAS;MAAAF,QAAA,EACPL,YAAY,CAACQ,GAAG,CAAIC,QAAQ,IAAM;QACnC,oBACC,IAAAlB,WAAA,CAAAe,GAAA,EAAClB,aAAA,CAAAsB,OAAY;UAEZC,IAAI,EAAGF,QAAQ,CAACE,IAAM;UACtBC,KAAK,EAAGH,QAAQ,CAACG,KAAO;UACxBC,IAAI,EAAGJ,QAAQ,CAACI,IAAM;UACtBC,IAAI,EAAGL,QAAQ,CAACM,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAEd,eAAe,IACjBO,QAAQ,CAACE,IAAI,KAAKb,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZU,QAAQ,CAACE,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClC,IAAA3B,WAAA,CAAAe,GAAA,EAAChB,oBAAA,CAAAoB,OAAmB;MACnBZ,UAAU,EAAGA,UAAY;MACzBgB,IAAI,EAAGlB,QAAU;MACjBG,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -10,6 +10,7 @@ var _element = require("@wordpress/element");
10
10
  var _router = require("@wordpress/router");
11
11
  var _compose = require("@wordpress/compose");
12
12
  var _components = require("@wordpress/components");
13
+ var _url = require("@wordpress/url");
13
14
  var _ui = _interopRequireDefault(require("../global-styles/ui"));
14
15
  var _page = _interopRequireDefault(require("../page"));
15
16
  var _lockUnlock = require("../../lock-unlock");
@@ -31,7 +32,6 @@ const {
31
32
  const {
32
33
  Menu
33
34
  } = (0, _lockUnlock.unlock)(_components.privateApis);
34
- const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
35
35
  const GlobalStylesPageActions = ({
36
36
  isStyleBookOpened,
37
37
  setIsStyleBookOpened
@@ -69,23 +69,23 @@ const GlobalStylesPageActions = ({
69
69
  };
70
70
  function GlobalStylesUIWrapper() {
71
71
  const {
72
- params
72
+ path,
73
+ query
73
74
  } = useLocation();
74
75
  const history = useHistory();
75
76
  const {
76
77
  canvas = 'view'
77
- } = params;
78
+ } = query;
78
79
  const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(false);
79
80
  const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
80
- const pathWithPrefix = params.path;
81
- const [path, onPathChange] = (0, _element.useMemo)(() => {
82
- const processedPath = pathWithPrefix.substring(GLOBAL_STYLES_PATH_PREFIX.length);
83
- return [processedPath ? processedPath : '/', newPath => {
84
- history.push({
85
- path: !newPath || newPath === '/' ? GLOBAL_STYLES_PATH_PREFIX : `${GLOBAL_STYLES_PATH_PREFIX}${newPath}`
86
- });
81
+ const [section, onChangeSection] = (0, _element.useMemo)(() => {
82
+ var _query$section;
83
+ return [(_query$section = query.section) !== null && _query$section !== void 0 ? _query$section : '/', updatedSection => {
84
+ history.navigate((0, _url.addQueryArgs)(path, {
85
+ section: updatedSection
86
+ }));
87
87
  }];
88
- }, [pathWithPrefix, history]);
88
+ }, [path, query.section, history]);
89
89
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
90
90
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
91
91
  actions: !isMobileViewport ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesPageActions, {
@@ -95,8 +95,8 @@ function GlobalStylesUIWrapper() {
95
95
  className: "edit-site-styles",
96
96
  title: (0, _i18n.__)('Styles'),
97
97
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.default, {
98
- path: path,
99
- onPathChange: onPathChange
98
+ path: section,
99
+ onPathChange: onChangeSection
100
100
  })
101
101
  }), canvas === 'view' && isStyleBookOpened && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.default, {
102
102
  enableResizing: false,
@@ -106,22 +106,22 @@ function GlobalStylesUIWrapper() {
106
106
  // Match '/blocks/core%2Fbutton' and
107
107
  // '/blocks/core%2Fbutton/typography', but not
108
108
  // '/blocks/core%2Fbuttons'.
109
- path === `/wp_global_styles/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/wp_global_styles/blocks/${encodeURIComponent(blockName)}/`),
110
- path: path,
109
+ section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`),
110
+ path: section,
111
111
  onSelect: blockName => {
112
112
  if (_constants.STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
113
113
  // Go to color palettes Global Styles.
114
- onPathChange('/colors/palette');
114
+ onChangeSection('/colors/palette');
115
115
  return;
116
116
  }
117
117
  if (blockName === 'typography') {
118
118
  // Go to typography Global Styles.
119
- onPathChange('/typography');
119
+ onChangeSection('/typography');
120
120
  return;
121
121
  }
122
122
 
123
123
  // Now go to the selected block.
124
- onPathChange(`/blocks/${encodeURIComponent(blockName)}`);
124
+ onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
125
125
  }
126
126
  })]
127
127
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_ui","_interopRequireDefault","_page","_lockUnlock","_styleBook","_constants","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","Menu","componentsPrivateApis","GLOBAL_STYLES_PATH_PREFIX","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","jsxs","trigger","jsx","Button","__next40pxDefaultSize","variant","size","children","__","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","params","history","canvas","useState","isMobileViewport","useViewportMatch","pathWithPrefix","path","onPathChange","useMemo","processedPath","substring","length","newPath","push","Fragment","default","actions","className","title","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","STYLE_BOOK_COLOR_GROUPS","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\nconst GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = params;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst pathWithPrefix = params.path;\n\tconst [ path, onPathChange ] = useMemo( () => {\n\t\tconst processedPath = pathWithPrefix.substring(\n\t\t\tGLOBAL_STYLES_PATH_PREFIX.length\n\t\t);\n\t\treturn [\n\t\t\tprocessedPath ? processedPath : '/',\n\t\t\t( newPath ) => {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath:\n\t\t\t\t\t\t! newPath || newPath === '/'\n\t\t\t\t\t\t\t? GLOBAL_STYLES_PATH_PREFIX\n\t\t\t\t\t\t\t: `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,\n\t\t\t\t} );\n\t\t\t},\n\t\t];\n\t}, [ pathWithPrefix, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI path={ path } onPathChange={ onPathChange } />\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tpath ===\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }` ||\n\t\t\t\t\t\tpath.startsWith(\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now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AAO;MACzBC,QAAQ,EAAG,KAAO;MAClBC,UAAU,EAAKC,SAAS;MACvB;MACA;MACA;MACAjB,IAAI,KACH,4BAA6BkB,kBAAkB,CAC9CD,SACD,CAAC,EAAG,IACLjB,IAAI,CAACmB,UAAU,CACd,4BAA6BD,kBAAkB,CAC9CD,SACD,CAAC,GACF,CACA;MACDjB,IAAI,EAAGA,IAAM;MACboB,QAAQ,EAAKH,SAAS,IAAM;QAC3B,IACCI,kCAAuB,CAACC,IAAI,CACzBC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKP,SAC7B,CAAC,EACA;UACD;UACAhB,YAAY,CAAE,iBAAkB,CAAC;UACjC;QACD;QACA,IAAKgB,SAAS,KAAK,YAAY,EAAG;UACjC;UACAhB,YAAY,CAAE,aAAc,CAAC;UAC7B;QACD;;QAEA;QACAA,YAAY,CACX,WAAYiB,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_url","_ui","_interopRequireDefault","_page","_lockUnlock","_styleBook","_constants","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","Menu","componentsPrivateApis","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","jsxs","trigger","jsx","Button","__next40pxDefaultSize","variant","size","children","__","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","path","query","history","canvas","useState","isMobileViewport","useViewportMatch","section","onChangeSection","useMemo","_query$section","updatedSection","navigate","addQueryArgs","Fragment","default","actions","className","title","onPathChange","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","STYLE_BOOK_COLOR_GROUPS","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { path, query } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = query;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ section, onChangeSection ] = useMemo( () => {\n\t\treturn [\n\t\t\tquery.section ?? '/',\n\t\t\t( updatedSection ) => {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tsection: updatedSection,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t];\n\t}, [ path, query.section, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI\n\t\t\t\t\tpath={ section }\n\t\t\t\t\tonPathChange={ onChangeSection }\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tsection ===\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\t\t\tsection.startsWith(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ section }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonChangeSection( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonChangeSection( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now go to the selected block.\n\t\t\t\t\t\tonChangeSection(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,GAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAAkE,IAAAY,WAAA,GAAAZ,OAAA;AApBlE;AACA;A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,gBAAgB,gBACjB,IAAAjC,WAAA,CAAAY,GAAA,EAACL,uBAAuB;QACvBC,iBAAiB,EAAGA,iBAAmB;QACvCC,oBAAoB,EAAGA;MAAsB,CAC7C,CAAC,GACC,IACJ;MACDoC,SAAS,EAAC,kBAAkB;MAC5BC,KAAK,EAAG,IAAA5B,QAAE,EAAE,QAAS,CAAG;MAAAD,QAAA,eAExB,IAAAjB,WAAA,CAAAY,GAAA,EAAClB,GAAA,CAAAiD,OAAc;QACdf,IAAI,EAAGO,OAAS;QAChBY,YAAY,EAAGX;MAAiB,CAChC;IAAC,CACG,CAAC,EACLL,MAAM,KAAK,MAAM,IAAIvB,iBAAiB,iBACvC,IAAAR,WAAA,CAAAY,GAAA,EAACd,UAAA,CAAA6C,OAAS;MACTK,cAAc,EAAG,KAAO;MACxBC,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG,KAAO;MAClBC,UAAU,EAAKC,SAAS;MACvB;MACA;MACA;MACAjB,OAAO,KACN,WAAYkB,kBAAkB,CAAED,SAAU,CAAC,EAAG,IAC/CjB,OAAO,CAACmB,UAAU,CACjB,WAAYD,kBAAkB,CAAED,SAAU,CAAC,GAC5C,CACA;MACDxB,IAAI,EAAGO,OAAS;MAChBoB,QAAQ,EAAKH,SAAS,IAAM;QAC3B,IACCI,kCAAuB,CAACC,IAAI,CACzBC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKP,SAC7B,CAAC,EACA;UACD;UACAhB,eAAe,CAAE,iBAAkB,CAAC;UACpC;QACD;QACA,IAAKgB,SAAS,KAAK,YAAY,EAAG;UACjC;UACAhB,eAAe,CAAE,aAAc,CAAC;UAChC;QACD;;QAEA;QACAA,eAAe,CACd,WAAYiB,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -27,7 +27,8 @@ var _jsxRuntime = require("react/jsx-runtime");
27
27
  */
28
28
 
29
29
  const {
30
- useHistory
30
+ useHistory,
31
+ useLink
31
32
  } = (0, _lockUnlock.unlock)(_router.privateApis);
32
33
  function SidebarNavigationItem({
33
34
  className,
@@ -35,7 +36,7 @@ function SidebarNavigationItem({
35
36
  withChevron = false,
36
37
  suffix,
37
38
  uid,
38
- params,
39
+ to,
39
40
  onClick,
40
41
  children,
41
42
  ...props
@@ -49,18 +50,20 @@ function SidebarNavigationItem({
49
50
  if (onClick) {
50
51
  onClick(e);
51
52
  navigate('forward');
52
- } else if (params) {
53
+ } else if (to) {
53
54
  e.preventDefault();
54
- history.push(params);
55
+ history.navigate(to);
55
56
  navigate('forward', `[id="${uid}"]`);
56
57
  }
57
58
  }
59
+ const linkProps = useLink(to);
58
60
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItem, {
59
61
  className: (0, _clsx.default)('edit-site-sidebar-navigation-item', {
60
62
  'with-suffix': !withChevron && suffix
61
63
  }, className),
62
- onClick: handleClick,
63
64
  id: uid,
65
+ onClick: handleClick,
66
+ href: to ? linkProps.href : undefined,
64
67
  ...props,
65
68
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
66
69
  justify: "flex-start",
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_router","_element","_lockUnlock","_sidebar","_jsxRuntime","useHistory","unlock","routerPrivateApis","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","useContext","SidebarNavigationContext","handleClick","e","preventDefault","push","jsx","__experimentalItem","clsx","id","jsxs","__experimentalHStack","justify","Icon","style","fill","size","FlexBlock","isRTL","chevronLeftSmall","chevronRightSmall"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/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AAAmB,aAAI,EACf,mCAAmC,EACnC;MAAE,aAAa,EAAE,CAAEjB,WAAW,IAAIC;IAAO,CAAC,EAC1CH,SACD,CAAG;IACHM,OAAO,EAAGO,WAAa;IACvBO,EAAE,EAAGhB,GAAK;IAAA,GACLI,KAAK;IAAAD,QAAA,eAEV,IAAAZ,WAAA,CAAA0B,IAAA,EAACjC,WAAA,CAAAkC,oBAAM;MAACC,OAAO,EAAC,YAAY;MAAAhB,QAAA,GACzBN,IAAI,iBACL,IAAAN,WAAA,CAAAsB,GAAA,EAAC3B,MAAA,CAAAkC,IAAI;QACJC,KAAK,EAAG;UAAEC,IAAI,EAAE;QAAe,CAAG;QAClCzB,IAAI,EAAGA,IAAM;QACb0B,IAAI,EAAG;MAAI,CACX,CACD,eACD,IAAAhC,WAAA,CAAAsB,GAAA,EAAC7B,WAAA,CAAAwC,SAAS;QAAArB,QAAA,EAAGA;MAAQ,CAAa,CAAC,EACjCL,WAAW,iBACZ,IAAAP,WAAA,CAAAsB,GAAA,EAAC3B,MAAA,CAAAkC,IAAI;QACJvB,IAAI,EAAG,IAAA4B,WAAK,EAAC,CAAC,GAAGC,uBAAgB,GAAGC,wBAAmB;QACvD/B,SAAS,EAAC,wDAAwD;QAClE2B,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEzB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_router","_element","_lockUnlock","_sidebar","_jsxRuntime","useHistory","useLink","unlock","routerPrivateApis","SidebarNavigationItem","className","icon","withChevron","suffix","uid","to","onClick","children","props","history","navigate","useContext","SidebarNavigationContext","handleClick","e","preventDefault","linkProps","jsx","__experimentalItem","clsx","id","href","undefined","jsxs","__experimentalHStack","justify","Icon","style","fill","size","FlexBlock","isRTL","chevronLeftSmall","chevronRightSmall"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLink } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tto,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( to ) {\n\t\t\te.preventDefault();\n\t\t\thistory.navigate( to );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\tconst linkProps = useLink( to );\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tid={ uid }\n\t\t\tonClick={ handleClick }\n\t\t\thref={ to ? linkProps.href : undefined }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAES,UAAU;EAAEC;AAAQ,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE5C,SAASC,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,IAAI;EACJC,WAAW,GAAG,KAAK;EACnBC,MAAM;EACNC,GAAG;EACHC,EAAE;EACFC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,OAAO,GAAGd,UAAU,CAAC,CAAC;EAC5B,MAAM;IAAEe;EAAS,CAAC,GAAG,IAAAC,mBAAU,EAAEC,iCAAyB,CAAC;EAC3D;EACA,SAASC,WAAWA,CAAEC,CAAC,EAAG;IACzB,IAAKR,OAAO,EAAG;MACdA,OAAO,CAAEQ,CAAE,CAAC;MACZJ,QAAQ,CAAE,SAAU,CAAC;IACtB,CAAC,MAAM,IAAKL,EAAE,EAAG;MAChBS,CAAC,CAACC,cAA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@@ function SidebarNavigationScreen({
82
82
  className: "edit-site-sidebar-navigation-screen__title-icon",
83
83
  children: [!isRoot && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
84
84
  onClick: () => {
85
- history.push(backPath);
85
+ history.navigate(backPath);
86
86
  navigate('back');
87
87
  },
88
88
  icon: icon,
@@ -91,7 +91,7 @@ function SidebarNavigationScreen({
91
91
  }), isRoot && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
92
92
  icon: icon,
93
93
  label: dashboardLinkText || (0, _i18n.__)('Go to the Dashboard'),
94
- href: dashboardLink || 'index.php'
94
+ href: dashboardLink
95
95
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHeading, {
96
96
  className: "edit-site-sidebar-navigation-screen__title",
97
97
  color: '#e0e0e0' /* $gray-200 */,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AAIA,IAAAY,QAAA,GAAAZ,OAAA;AAAsD,IAAAa,WAAA,GAAAb,OAAA;AA9BtD;AACA;AACA;;AAGA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AE,EAAE,uBAAwB,CAAC,EAC7BvC,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAK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Pb,SAAS,EAAC,4CAA4C;UACtDc,KAAK,EAAG,SAAS,CAAC,eAAiB;UACnCC,KAAK,EAAG,CAAG;UACXC,IAAI,EAAG,EAAI;UAAAlB,QAAA,EAET,CAAE,IAAAmB,oCAAiB,EAAC,CAAC,GACpBvD,KAAK,GACL,IAAAwD,aAAO,EACP;UACA,IAAAR,QAAE,EAAE,uBAAwB,CAAC,EAC7BtC,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -8,10 +8,10 @@ exports.SidebarNavigationItemGlobalStyles = SidebarNavigationItemGlobalStyles;
8
8
  exports.default = SidebarNavigationScreenGlobalStyles;
9
9
  var _i18n = require("@wordpress/i18n");
10
10
  var _data = require("@wordpress/data");
11
- var _coreData = require("@wordpress/core-data");
12
11
  var _element = require("@wordpress/element");
13
12
  var _preferences = require("@wordpress/preferences");
14
13
  var _router = require("@wordpress/router");
14
+ var _url = require("@wordpress/url");
15
15
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
16
16
  var _lockUnlock = require("../../lock-unlock");
17
17
  var _store = require("../../store");
@@ -34,27 +34,17 @@ const {
34
34
  } = (0, _lockUnlock.unlock)(_router.privateApis);
35
35
  function SidebarNavigationItemGlobalStyles(props) {
36
36
  const {
37
- params
37
+ name
38
38
  } = useLocation();
39
- const hasGlobalStyleVariations = (0, _data.useSelect)(select => !!select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
40
- if (hasGlobalStyleVariations) {
41
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
42
- ...props,
43
- params: {
44
- path: '/wp_global_styles'
45
- },
46
- uid: "global-styles-navigation-item",
47
- "aria-current": params.path && params.path.startsWith('/wp_global_styles')
48
- });
49
- }
50
39
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
51
- ...props
40
+ ...props,
41
+ "aria-current": name === 'styles'
52
42
  });
53
43
  }
54
44
  function SidebarNavigationScreenGlobalStyles() {
55
45
  const history = useHistory();
56
46
  const {
57
- params
47
+ path
58
48
  } = useLocation();
59
49
  const {
60
50
  revisions,
@@ -71,14 +61,13 @@ function SidebarNavigationScreenGlobalStyles() {
71
61
  set: setPreference
72
62
  } = (0, _data.useDispatch)(_preferences.store);
73
63
  const openGlobalStyles = (0, _element.useCallback)(async () => {
74
- history.push({
75
- ...params,
64
+ history.navigate((0, _url.addQueryArgs)(path, {
76
65
  canvas: 'edit'
77
- }, undefined, {
66
+ }), {
78
67
  transition: 'canvas-mode-edit-transition'
79
68
  });
80
69
  return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
81
- }, [history, params, openGeneralSidebar, setPreference]);
70
+ }, [path, history, openGeneralSidebar, setPreference]);
82
71
  const openRevisions = (0, _element.useCallback)(async () => {
83
72
  await openGlobalStyles();
84
73
  // Open the global styles revisions once the canvas mode is set to edit,
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_coreData","_element","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationItem","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenMain","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","revisionsCount","useGlobalStylesRevisions","openGeneralSidebar","useDispatch","editSiteStore","setEditorCanvasContainerView","set","setPreference","preferencesStore","openGlobalStyles","useCallback","push","canvas","undefined","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","Fragment","children","title","__","isRoot","description","content","MainSidebarNavigationContent","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\taria-current={\n\t\t\t\t\tparams.path && params.path.startsWith( '/wp_global_styles' )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\treturn <SidebarNavigationItem { ...props } />;\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst {\n\t\trevisions,\n\t\tisLoading: isLoadingRevisions,\n\t\trevisionsCount,\n\t} = useGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\n\t\t);\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst shouldShowGlobalStylesFooter =\n\t\t!! revisionsCount && ! isLoadingRevisions;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\trevisionsCount={ revisionsCount }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,yBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qCAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,4BAAA,GAAAb,OAAA;AAAiF,IAAAc,WAAA,GAAAd,OAAA;AAnBjF;AACA;AACA;;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,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjC8B,OAAO,EAAGb;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_element","_preferences","_router","_url","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationItem","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenMain","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","name","jsx","default","SidebarNavigationScreenGlobalStyles","history","path","revisions","isLoading","isLoadingRevisions","revisionsCount","useGlobalStylesRevisions","openGeneralSidebar","useDispatch","editSiteStore","setEditorCanvasContainerView","set","setPreference","preferencesStore","openGlobalStyles","useCallback","navigate","addQueryArgs","canvas","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","Fragment","children","title","__","isRoot","description","content","MainSidebarNavigationContent","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { name } = useLocation();\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\taria-current={ name === 'styles' }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { path } = useLocation();\n\tconst {\n\t\trevisions,\n\t\tisLoading: isLoadingRevisions,\n\t\trevisionsCount,\n\t} = useGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.navigate( addQueryArgs( path, { canvas: 'edit' } ), {\n\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t} );\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ path, history, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst shouldShowGlobalStylesFooter =\n\t\t!! revisionsCount && ! isLoadingRevisions;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\trevisionsCount={ revisionsCount }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,yBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qCAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,4BAAA,GAAAb,OAAA;AAAiF,IAAAc,WAAA,GAAAd,OAAA;AAnBjF;AACA;AACA;;AAQA;AACA;AACA;;AASA,MAAM;EAAEe,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAExD,SAASC,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGN,WAAW,CAAC,CAAC;EAC9B,oBACC,IAAAD,WAAA,CAAAQ,GAAA,EAACZ,sBAAA,CAAAa,OAAqB;IAAA,GAChBH,KAAK;IACV,gBAAeC,IAAI,KAAK;EAAU,CAClC,CAAC;AAEJ;AAEe,SAASG,mCAAmCA,CAAA,EAAG;EAC7D,MAAMC,OAAO,GAAGT,UAAU,CAAC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,eACC,IAAApC,WAAA,CAAAQ,GAAA,EAAChB,wBAAA,CAAAiB,OAAuB;MACvB4B,KAAK,EAAG,IAAAC,QAAE,EAAE,QAAS,CAAG;MACxBC,MAAM;MACNC,WAAW,EAAG,IAAAF,QAAE,EACf,kEACD,CAAG;MACHG,OAAO,eACN,IAAAzC,WAAA,CAAAQ,GAAA,EAACT,4BAAA,CAAA2C,4BAA4B;QAACC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLV,4BAA4B,iBAC3B,IAAAlC,WAAA,CAAAQ,GAAA,EAACV,qCAAA,CAAAW,OAAoC;QACpCoC,MAAM,EAAGhC,SAAS,GAAI,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjC8B,OAAO,EAAGb;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
@@ -16,7 +16,6 @@ var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigati
16
16
  var _sidebarNavigationScreenGlobalStyles = require("../sidebar-navigation-screen-global-styles");
17
17
  var _lockUnlock = require("../../lock-unlock");
18
18
  var _store = require("../../store");
19
- var _constants = require("../../utils/constants");
20
19
  var _jsxRuntime = require("react/jsx-runtime");
21
20
  /**
22
21
  * WordPress dependencies
@@ -30,37 +29,30 @@ function MainSidebarNavigationContent() {
30
29
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
31
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
32
31
  uid: "navigation-navigation-item",
33
- params: {
34
- postType: _constants.NAVIGATION_POST_TYPE
35
- },
32
+ to: "/navigation",
36
33
  withChevron: true,
37
34
  icon: _icons.navigation,
38
35
  children: (0, _i18n.__)('Navigation')
39
36
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
40
- uid: "styles-navigation-item",
37
+ to: "/styles",
38
+ uid: "global-styles-navigation-item",
41
39
  icon: _icons.styles,
42
40
  children: (0, _i18n.__)('Styles')
43
41
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
44
42
  uid: "page-navigation-item",
45
- params: {
46
- postType: 'page'
47
- },
43
+ to: "/page",
48
44
  withChevron: true,
49
45
  icon: _icons.page,
50
46
  children: (0, _i18n.__)('Pages')
51
47
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
52
48
  uid: "template-navigation-item",
53
- params: {
54
- postType: _constants.TEMPLATE_POST_TYPE
55
- },
49
+ to: "/template",
56
50
  withChevron: true,
57
51
  icon: _icons.layout,
58
52
  children: (0, _i18n.__)('Templates')
59
53
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
60
54
  uid: "patterns-navigation-item",
61
- params: {
62
- postType: _constants.PATTERN_TYPES.user
63
- },
55
+ to: "/pattern",
64
56
  withChevron: true,
65
57
  icon: _icons.symbol,
66
58
  children: (0, _i18n.__)('Patterns')
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","params","postType","NAVIGATION_POST_TYPE","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","TEMPLATE_POST_TYPE","layout","PATTERN_TYPES","user","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAI+B,IAAAY,WAAA,GAAAZ,OAAA;AArB/B;AACA;AACA;;AAOA;AACA;AACA;;AAYO,SAASa,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAACf,WAAA,CAAAgB,uBAAS;IAAAC,QAAA,gBACT,IAAAJ,WAAA,CAAAK,GAAA,EAACV,sBAAA,CAAAW,OAAqB;MACrBC,GAAG,EAAC,4BAA4B;MAChCC,MAAM,EAAG;QAAEC,QAAQ,EAAEC;MAAqB,CAAG;MAC7CC,WAAW;MACXC,IAAI,E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AC;EAC1C,CAAC,EAAE,CAAEL,4BAA4B,CAAG,CAAC;EAErC,oBACC,IAAAxB,WAAA,CAAAK,GAAA,EAACZ,wBAAA,CAAAa,OAAuB;IACvBwB,MAAM;IACNC,KAAK,EAAG,IAAAjB,QAAE,EAAE,QAAS,CAAG;IACxBkB,WAAW,EAAG,IAAAlB,QAAE,EACf,kEACD,CAAG;IACHmB,OAAO,eAAG,IAAAjC,WAAA,CAAAK,GAAA,EAACJ,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","to","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","layout","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tto=\"/navigation\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tto=\"/styles\"\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tto=\"/page\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tto=\"/template\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tto=\"/pattern\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAA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EAAC,0BAA0B;MAC9BC,EAAE,EAAC,WAAW;MACdC,WAAW;MACXC,IAAI,EAAGM,aAAQ;MAAAZ,QAAA,EAEb,IAAAQ,QAAE,EAAE,WAAY;IAAC,CACG,CAAC,eACxB,IAAAZ,WAAA,CAAAK,GAAA,EAACT,sBAAA,CAAAU,OAAqB;MACrBC,GAAG,EAAC,0BAA0B;MAC9BC,EAAE,EAAC,UAAU;MACbC,WAAW;MACXC,IAAI,EAAGO,aAAQ;MAAAb,QAAA,EAEb,IAAAQ,QAAE,EAAE,UAAW;IAAC,CACI,CAAC;EAAA,CACd,CAAC;AAEd;AAEe,SAASM,2BAA2BA,CAAA,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAG,IAAAC,kBAAM,EAC9C,IAAAC,iBAAW,EAAEC,YAAc,CAC5B,CAAC;;EAED;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChBJ,4BAA4B,CAAEK,SAAU,CAAC;EAC1C,CAAC,EAAE,CAAEL,4BAA4B,CAAG,CAAC;EAErC,oBACC,IAAAnB,WAAA,CAAAK,GAAA,EAACX,wBAAA,CAAAY,OAAuB;IACvBmB,MAAM;IACNC,KAAK,EAAG,IAAAd,QAAE,EAAE,QAAS,CAAG;IACxBe,WAAW,EAAG,IAAAf,QAAE,EACf,kEACD,CAAG;IACHgB,OAAO,eAAG,IAAA5B,WAAA,CAAAK,GAAA,EAACJ,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
@@ -64,11 +64,7 @@ function ScreenNavigationMoreMenu(props) {
64
64
  children: (0, _i18n.__)('Rename')
65
65
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
66
66
  onClick: () => {
67
- history.push({
68
- postId: menuId,
69
- postType: 'wp_navigation',
70
- canvas: 'edit'
71
- });
67
+ history.navigate(`/wp_navigation/${menuId}?canvas=edit`);
72
68
  },
73
69
  children: (0, _i18n.__)('Edit')
74
70
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {