@wordpress/edit-site 6.13.0 → 6.13.1-next.a9f418477.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 (514) 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-post/index.js +1 -1
  4. package/build/components/add-new-post/index.js.map +1 -1
  5. package/build/components/add-new-template/index.js +1 -5
  6. package/build/components/add-new-template/index.js.map +1 -1
  7. package/build/components/app/index.js +31 -29
  8. package/build/components/app/index.js.map +1 -1
  9. package/build/components/block-editor/use-editor-iframe-props.js +8 -8
  10. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  11. package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
  12. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  13. package/build/components/block-editor/use-site-editor-settings.js +4 -4
  14. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  15. package/build/components/dataviews-actions/index.js +1 -5
  16. package/build/components/dataviews-actions/index.js.map +1 -1
  17. package/build/components/editor/index.js +38 -22
  18. package/build/components/editor/index.js.map +1 -1
  19. package/build/components/editor/use-editor-title.js +5 -0
  20. package/build/components/editor/use-editor-title.js.map +1 -1
  21. package/build/components/editor/use-resolve-edited-entity.js +19 -4
  22. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/context.js +0 -1
  24. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
  26. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  28. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  30. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  31. package/build/components/global-styles/preview-colors.js +2 -2
  32. package/build/components/global-styles/preview-colors.js.map +1 -1
  33. package/build/components/global-styles/preview-styles.js +2 -2
  34. package/build/components/global-styles/preview-styles.js.map +1 -1
  35. package/build/components/global-styles/preview-typography.js +2 -2
  36. package/build/components/global-styles/preview-typography.js.map +1 -1
  37. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +10 -29
  38. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  39. package/build/components/global-styles/typography-example.js +8 -1
  40. package/build/components/global-styles/typography-example.js.map +1 -1
  41. package/build/components/global-styles-sidebar/index.js +5 -5
  42. package/build/components/global-styles-sidebar/index.js.map +1 -1
  43. package/build/components/layout/index.js +44 -19
  44. package/build/components/layout/index.js.map +1 -1
  45. package/build/components/page-patterns/delete-category-menu-item.js +1 -4
  46. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  47. package/build/components/page-patterns/fields.js +6 -57
  48. package/build/components/page-patterns/fields.js.map +1 -1
  49. package/build/components/page-patterns/index.js +31 -30
  50. package/build/components/page-patterns/index.js.map +1 -1
  51. package/build/components/page-templates/fields.js +6 -34
  52. package/build/components/page-templates/fields.js.map +1 -1
  53. package/build/components/page-templates/index.js +34 -46
  54. package/build/components/page-templates/index.js.map +1 -1
  55. package/build/components/post-edit/header.js +83 -0
  56. package/build/components/post-edit/header.js.map +1 -0
  57. package/build/components/post-edit/index.js +42 -7
  58. package/build/components/post-edit/index.js.map +1 -1
  59. package/build/components/post-list/index.js +26 -40
  60. package/build/components/post-list/index.js.map +1 -1
  61. package/build/components/posts-app/index.js +10 -16
  62. package/build/components/posts-app/index.js.map +1 -1
  63. package/build/components/posts-app-routes/index.js +3 -7
  64. package/build/components/posts-app-routes/index.js.map +1 -1
  65. package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
  66. package/build/components/posts-app-routes/post-item.js.map +1 -0
  67. package/build/components/posts-app-routes/posts.js +89 -0
  68. package/build/components/posts-app-routes/posts.js.map +1 -0
  69. package/build/components/resizable-frame/index.js +6 -5
  70. package/build/components/resizable-frame/index.js.map +1 -1
  71. package/build/components/save-panel/index.js +9 -6
  72. package/build/components/save-panel/index.js.map +1 -1
  73. package/build/components/sidebar-dataviews/add-new-view.js +7 -8
  74. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  75. package/build/components/sidebar-dataviews/dataview-item.js +5 -8
  76. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  77. package/build/components/sidebar-dataviews/default-views.js +7 -24
  78. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  79. package/build/components/sidebar-dataviews/index.js +4 -3
  80. package/build/components/sidebar-dataviews/index.js.map +1 -1
  81. package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
  82. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  83. package/build/components/sidebar-navigation-item/index.js +8 -5
  84. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen/index.js +2 -2
  86. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  88. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
  90. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-main/index.js +6 -14
  92. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  94. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  96. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  98. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  100. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  102. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
  104. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  105. package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  106. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  108. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  109. package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
  110. package/build/components/site-editor-routes/home.js.map +1 -0
  111. package/build/components/site-editor-routes/index.js +12 -18
  112. package/build/components/site-editor-routes/index.js.map +1 -1
  113. package/build/components/site-editor-routes/navigation-item.js +49 -0
  114. package/build/components/site-editor-routes/navigation-item.js.map +1 -0
  115. package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
  116. package/build/components/site-editor-routes/navigation.js.map +1 -0
  117. package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
  118. package/build/components/site-editor-routes/page-item.js.map +1 -0
  119. package/build/components/site-editor-routes/pages.js +87 -0
  120. package/build/components/site-editor-routes/pages.js.map +1 -0
  121. package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
  122. package/build/components/site-editor-routes/pattern-item.js.map +1 -0
  123. package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
  124. package/build/components/site-editor-routes/patterns.js.map +1 -0
  125. package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
  126. package/build/components/site-editor-routes/styles.js.map +1 -0
  127. package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
  128. package/build/components/site-editor-routes/template-item.js.map +1 -0
  129. package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
  130. package/build/components/site-editor-routes/template-part-item.js.map +1 -0
  131. package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
  132. package/build/components/site-editor-routes/templates.js.map +1 -0
  133. package/build/components/site-hub/index.js +3 -3
  134. package/build/components/site-hub/index.js.map +1 -1
  135. package/build/components/style-book/constants.js +8 -19
  136. package/build/components/style-book/constants.js.map +1 -1
  137. package/build/components/style-book/examples.js +42 -27
  138. package/build/components/style-book/examples.js.map +1 -1
  139. package/build/components/style-book/index.js +21 -5
  140. package/build/components/style-book/index.js.map +1 -1
  141. package/build/components/style-book/types.js.map +1 -1
  142. package/build/hooks/commands/use-common-commands.js +12 -48
  143. package/build/hooks/commands/use-common-commands.js.map +1 -1
  144. package/build/hooks/commands/use-set-command-context.js +2 -2
  145. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  146. package/build/store/private-actions.js +7 -0
  147. package/build/store/private-actions.js.map +1 -1
  148. package/build/store/reducer.js +2 -0
  149. package/build/store/reducer.js.map +1 -1
  150. package/build/utils/is-previewing-theme.js +1 -1
  151. package/build/utils/is-previewing-theme.js.map +1 -1
  152. package/build/utils/use-activate-theme.js +9 -8
  153. package/build/utils/use-activate-theme.js.map +1 -1
  154. package/build-module/components/add-new-pattern/index.js +3 -16
  155. package/build-module/components/add-new-pattern/index.js.map +1 -1
  156. package/build-module/components/add-new-post/index.js +1 -1
  157. package/build-module/components/add-new-post/index.js.map +1 -1
  158. package/build-module/components/add-new-template/index.js +1 -5
  159. package/build-module/components/add-new-template/index.js.map +1 -1
  160. package/build-module/components/app/index.js +33 -31
  161. package/build-module/components/app/index.js.map +1 -1
  162. package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
  163. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  164. package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
  165. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  166. package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
  167. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  168. package/build-module/components/dataviews-actions/index.js +1 -5
  169. package/build-module/components/dataviews-actions/index.js.map +1 -1
  170. package/build-module/components/editor/index.js +38 -22
  171. package/build-module/components/editor/index.js.map +1 -1
  172. package/build-module/components/editor/use-editor-title.js +5 -0
  173. package/build-module/components/editor/use-editor-title.js.map +1 -1
  174. package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
  175. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  176. package/build-module/components/global-styles/font-library-modal/context.js +0 -1
  177. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  178. package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
  179. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  180. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  181. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  182. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  183. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  184. package/build-module/components/global-styles/preview-colors.js +2 -2
  185. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  186. package/build-module/components/global-styles/preview-styles.js +2 -2
  187. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  188. package/build-module/components/global-styles/preview-typography.js +2 -2
  189. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  190. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +12 -31
  191. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  192. package/build-module/components/global-styles/typography-example.js +8 -1
  193. package/build-module/components/global-styles/typography-example.js.map +1 -1
  194. package/build-module/components/global-styles-sidebar/index.js +5 -5
  195. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  196. package/build-module/components/layout/index.js +45 -20
  197. package/build-module/components/layout/index.js.map +1 -1
  198. package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
  199. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  200. package/build-module/components/page-patterns/fields.js +7 -58
  201. package/build-module/components/page-patterns/fields.js.map +1 -1
  202. package/build-module/components/page-patterns/index.js +29 -28
  203. package/build-module/components/page-patterns/index.js.map +1 -1
  204. package/build-module/components/page-templates/fields.js +5 -31
  205. package/build-module/components/page-templates/fields.js.map +1 -1
  206. package/build-module/components/page-templates/index.js +33 -45
  207. package/build-module/components/page-templates/index.js.map +1 -1
  208. package/build-module/components/post-edit/header.js +76 -0
  209. package/build-module/components/post-edit/header.js.map +1 -0
  210. package/build-module/components/post-edit/index.js +42 -7
  211. package/build-module/components/post-edit/index.js.map +1 -1
  212. package/build-module/components/post-list/index.js +26 -40
  213. package/build-module/components/post-list/index.js.map +1 -1
  214. package/build-module/components/posts-app/index.js +11 -17
  215. package/build-module/components/posts-app/index.js.map +1 -1
  216. package/build-module/components/posts-app-routes/index.js +3 -7
  217. package/build-module/components/posts-app-routes/index.js.map +1 -1
  218. package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
  219. package/build-module/components/posts-app-routes/post-item.js.map +1 -0
  220. package/build-module/components/posts-app-routes/posts.js +81 -0
  221. package/build-module/components/posts-app-routes/posts.js.map +1 -0
  222. package/build-module/components/resizable-frame/index.js +6 -5
  223. package/build-module/components/resizable-frame/index.js.map +1 -1
  224. package/build-module/components/save-panel/index.js +9 -6
  225. package/build-module/components/save-panel/index.js.map +1 -1
  226. package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
  227. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  228. package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
  229. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  230. package/build-module/components/sidebar-dataviews/default-views.js +7 -24
  231. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  232. package/build-module/components/sidebar-dataviews/index.js +4 -3
  233. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  234. package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
  235. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  236. package/build-module/components/sidebar-navigation-item/index.js +8 -5
  237. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  238. package/build-module/components/sidebar-navigation-screen/index.js +2 -2
  239. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  240. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  241. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  242. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
  243. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  244. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
  245. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  246. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  247. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  248. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  249. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  250. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  251. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  253. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  254. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  255. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  256. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
  257. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  259. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  261. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  262. package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
  263. package/build-module/components/site-editor-routes/home.js.map +1 -0
  264. package/build-module/components/site-editor-routes/index.js +12 -18
  265. package/build-module/components/site-editor-routes/index.js.map +1 -1
  266. package/build-module/components/site-editor-routes/navigation-item.js +41 -0
  267. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
  268. package/build-module/components/site-editor-routes/navigation.js +38 -0
  269. package/build-module/components/site-editor-routes/navigation.js.map +1 -0
  270. package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
  271. package/build-module/components/site-editor-routes/page-item.js.map +1 -0
  272. package/build-module/components/site-editor-routes/pages.js +79 -0
  273. package/build-module/components/site-editor-routes/pages.js.map +1 -0
  274. package/build-module/components/site-editor-routes/pattern-item.js +18 -0
  275. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
  276. package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
  277. package/build-module/components/site-editor-routes/patterns.js.map +1 -0
  278. package/build-module/components/site-editor-routes/styles.js +44 -0
  279. package/build-module/components/site-editor-routes/styles.js.map +1 -0
  280. package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
  281. package/build-module/components/site-editor-routes/template-item.js.map +1 -0
  282. package/build-module/components/site-editor-routes/template-part-item.js +18 -0
  283. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
  284. package/build-module/components/site-editor-routes/templates.js +33 -0
  285. package/build-module/components/site-editor-routes/templates.js.map +1 -0
  286. package/build-module/components/site-hub/index.js +3 -3
  287. package/build-module/components/site-hub/index.js.map +1 -1
  288. package/build-module/components/style-book/constants.js +8 -19
  289. package/build-module/components/style-book/constants.js.map +1 -1
  290. package/build-module/components/style-book/examples.js +42 -27
  291. package/build-module/components/style-book/examples.js.map +1 -1
  292. package/build-module/components/style-book/index.js +21 -5
  293. package/build-module/components/style-book/index.js.map +1 -1
  294. package/build-module/components/style-book/types.js.map +1 -1
  295. package/build-module/hooks/commands/use-common-commands.js +12 -48
  296. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  297. package/build-module/hooks/commands/use-set-command-context.js +2 -2
  298. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  299. package/build-module/store/private-actions.js +6 -0
  300. package/build-module/store/private-actions.js.map +1 -1
  301. package/build-module/store/reducer.js +2 -0
  302. package/build-module/store/reducer.js.map +1 -1
  303. package/build-module/utils/is-previewing-theme.js +1 -1
  304. package/build-module/utils/is-previewing-theme.js.map +1 -1
  305. package/build-module/utils/use-activate-theme.js +9 -8
  306. package/build-module/utils/use-activate-theme.js.map +1 -1
  307. package/build-style/posts-rtl.css +73 -107
  308. package/build-style/posts.css +73 -107
  309. package/build-style/style-rtl.css +201 -142
  310. package/build-style/style.css +201 -142
  311. package/package.json +40 -40
  312. package/src/components/add-new-pattern/index.js +9 -17
  313. package/src/components/add-new-post/index.js +1 -1
  314. package/src/components/add-new-template/index.js +3 -5
  315. package/src/components/app/index.js +34 -35
  316. package/src/components/block-editor/use-editor-iframe-props.js +5 -4
  317. package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
  318. package/src/components/block-editor/use-site-editor-settings.js +6 -6
  319. package/src/components/dataviews-actions/index.js +1 -5
  320. package/src/components/editor/index.js +64 -29
  321. package/src/components/editor/use-editor-title.js +4 -0
  322. package/src/components/editor/use-resolve-edited-entity.js +17 -2
  323. package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
  324. package/src/components/global-styles/font-library-modal/style.scss +12 -5
  325. package/src/components/global-styles/preview-colors.js +3 -3
  326. package/src/components/global-styles/preview-styles.js +3 -3
  327. package/src/components/global-styles/preview-typography.js +3 -3
  328. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  329. package/src/components/global-styles/style.scss +5 -1
  330. package/src/components/global-styles/typography-example.js +12 -1
  331. package/src/components/global-styles-sidebar/index.js +4 -4
  332. package/src/components/layout/index.js +43 -11
  333. package/src/components/page-patterns/delete-category-menu-item.js +3 -4
  334. package/src/components/page-patterns/fields.js +9 -65
  335. package/src/components/page-patterns/index.js +39 -25
  336. package/src/components/page-patterns/style.scss +0 -28
  337. package/src/components/page-templates/fields.js +3 -31
  338. package/src/components/page-templates/index.js +34 -51
  339. package/src/components/post-edit/header.js +88 -0
  340. package/src/components/post-edit/index.js +39 -7
  341. package/src/components/post-edit/style.scss +10 -0
  342. package/src/components/post-list/index.js +44 -40
  343. package/src/components/post-list/style.scss +0 -36
  344. package/src/components/posts-app/index.js +9 -18
  345. package/src/components/posts-app-routes/index.js +3 -14
  346. package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
  347. package/src/components/posts-app-routes/posts.js +66 -0
  348. package/src/components/resizable-frame/index.js +6 -7
  349. package/src/components/save-panel/index.js +11 -5
  350. package/src/components/sidebar-dataviews/add-new-view.js +9 -9
  351. package/src/components/sidebar-dataviews/dataview-item.js +5 -8
  352. package/src/components/sidebar-dataviews/default-views.js +7 -24
  353. package/src/components/sidebar-dataviews/index.js +2 -2
  354. package/src/components/sidebar-dataviews/style.scss +2 -2
  355. package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
  356. package/src/components/sidebar-navigation-item/index.js +7 -5
  357. package/src/components/sidebar-navigation-item/style.scss +1 -2
  358. package/src/components/sidebar-navigation-screen/index.js +2 -2
  359. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  360. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  361. package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
  362. package/src/components/sidebar-navigation-screen-main/index.js +6 -10
  363. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
  364. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  365. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
  366. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
  367. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
  368. package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
  369. package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
  370. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  371. package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
  372. package/src/components/site-editor-routes/index.js +22 -34
  373. package/src/components/site-editor-routes/navigation-item.js +39 -0
  374. package/src/components/site-editor-routes/navigation.js +34 -0
  375. package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
  376. package/src/components/site-editor-routes/pages.js +66 -0
  377. package/src/components/site-editor-routes/pattern-item.js +15 -0
  378. package/src/components/site-editor-routes/patterns.js +15 -0
  379. package/src/components/site-editor-routes/styles.js +39 -0
  380. package/src/components/site-editor-routes/template-item.js +15 -0
  381. package/src/components/site-editor-routes/template-part-item.js +15 -0
  382. package/src/components/site-editor-routes/templates.js +26 -0
  383. package/src/components/site-hub/index.js +3 -6
  384. package/src/components/style-book/constants.ts +8 -19
  385. package/src/components/style-book/examples.tsx +47 -28
  386. package/src/components/style-book/index.js +28 -5
  387. package/src/components/style-book/types.ts +1 -1
  388. package/src/hooks/commands/use-common-commands.js +14 -72
  389. package/src/hooks/commands/use-set-command-context.js +2 -2
  390. package/src/store/private-actions.js +7 -0
  391. package/src/store/reducer.js +2 -0
  392. package/src/style.scss +1 -0
  393. package/src/utils/is-previewing-theme.js +1 -3
  394. package/src/utils/use-activate-theme.js +4 -3
  395. package/build/components/error-boundary/index.js +0 -47
  396. package/build/components/error-boundary/index.js.map +0 -1
  397. package/build/components/error-boundary/warning.js +0 -42
  398. package/build/components/error-boundary/warning.js.map +0 -1
  399. package/build/components/global-styles/preview-iframe.js.map +0 -1
  400. package/build/components/layout/router.js +0 -92
  401. package/build/components/layout/router.js.map +0 -1
  402. package/build/components/posts-app-routes/home.js.map +0 -1
  403. package/build/components/posts-app-routes/posts-edit.js.map +0 -1
  404. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
  405. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  406. package/build/components/posts-app-routes/posts-list-view.js +0 -48
  407. package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
  408. package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
  409. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  410. package/build/components/posts-app-routes/posts-view.js +0 -41
  411. package/build/components/posts-app-routes/posts-view.js.map +0 -1
  412. package/build/components/routes/link.js +0 -69
  413. package/build/components/routes/link.js.map +0 -1
  414. package/build/components/site-editor-routes/home-edit.js.map +0 -1
  415. package/build/components/site-editor-routes/home-view.js.map +0 -1
  416. package/build/components/site-editor-routes/navigation-edit.js +0 -29
  417. package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
  418. package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
  419. package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  420. package/build/components/site-editor-routes/navigation-item-view.js +0 -30
  421. package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
  422. package/build/components/site-editor-routes/navigation-view.js +0 -28
  423. package/build/components/site-editor-routes/navigation-view.js.map +0 -1
  424. package/build/components/site-editor-routes/pages-edit.js.map +0 -1
  425. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
  426. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  427. package/build/components/site-editor-routes/pages-list-view.js +0 -47
  428. package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
  429. package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
  430. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  431. package/build/components/site-editor-routes/pages-view.js +0 -42
  432. package/build/components/site-editor-routes/pages-view.js.map +0 -1
  433. package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
  434. package/build/components/site-editor-routes/patterns-view.js.map +0 -1
  435. package/build/components/site-editor-routes/styles-view.js.map +0 -1
  436. package/build/components/site-editor-routes/templates-edit.js.map +0 -1
  437. package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
  438. package/build/components/site-editor-routes/templates-view.js +0 -29
  439. package/build/components/site-editor-routes/templates-view.js.map +0 -1
  440. package/build-module/components/error-boundary/index.js +0 -38
  441. package/build-module/components/error-boundary/index.js.map +0 -1
  442. package/build-module/components/error-boundary/warning.js +0 -35
  443. package/build-module/components/error-boundary/warning.js.map +0 -1
  444. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  445. package/build-module/components/layout/router.js +0 -84
  446. package/build-module/components/layout/router.js.map +0 -1
  447. package/build-module/components/posts-app-routes/home.js +0 -40
  448. package/build-module/components/posts-app-routes/home.js.map +0 -1
  449. package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
  450. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
  451. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  452. package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
  453. package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
  454. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
  455. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  456. package/build-module/components/posts-app-routes/posts-view.js +0 -33
  457. package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
  458. package/build-module/components/routes/link.js +0 -61
  459. package/build-module/components/routes/link.js.map +0 -1
  460. package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
  461. package/build-module/components/site-editor-routes/home-view.js +0 -17
  462. package/build-module/components/site-editor-routes/home-view.js.map +0 -1
  463. package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
  464. package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
  465. package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
  466. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  467. package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
  468. package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
  469. package/build-module/components/site-editor-routes/navigation-view.js +0 -20
  470. package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
  471. package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
  472. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  473. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  474. package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
  475. package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
  476. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  477. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  478. package/build-module/components/site-editor-routes/pages-view.js +0 -34
  479. package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
  480. package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
  481. package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
  482. package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
  483. package/build-module/components/site-editor-routes/styles-view.js +0 -25
  484. package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
  485. package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
  486. package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
  487. package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
  488. package/build-module/components/site-editor-routes/templates-view.js +0 -21
  489. package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
  490. package/src/components/error-boundary/index.js +0 -44
  491. package/src/components/error-boundary/test/error-boundary.js +0 -40
  492. package/src/components/error-boundary/warning.js +0 -30
  493. package/src/components/layout/router.js +0 -86
  494. package/src/components/posts-app-routes/home.js +0 -36
  495. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
  496. package/src/components/posts-app-routes/posts-list-view.js +0 -40
  497. package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
  498. package/src/components/posts-app-routes/posts-view.js +0 -35
  499. package/src/components/routes/link.js +0 -68
  500. package/src/components/site-editor-routes/home-edit.js +0 -17
  501. package/src/components/site-editor-routes/navigation-edit.js +0 -22
  502. package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
  503. package/src/components/site-editor-routes/navigation-item-view.js +0 -25
  504. package/src/components/site-editor-routes/navigation-view.js +0 -21
  505. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  506. package/src/components/site-editor-routes/pages-list-view.js +0 -44
  507. package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  508. package/src/components/site-editor-routes/pages-view.js +0 -39
  509. package/src/components/site-editor-routes/patterns-edit.js +0 -24
  510. package/src/components/site-editor-routes/patterns-view.js +0 -22
  511. package/src/components/site-editor-routes/styles-view.js +0 -26
  512. package/src/components/site-editor-routes/templates-edit.js +0 -22
  513. package/src/components/site-editor-routes/templates-list-view.js +0 -28
  514. package/src/components/site-editor-routes/templates-view.js +0 -22
@@ -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;AAAs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GACpBxD,KAAK,GACL,IAAAyD,aAAO,EACP;UACA,IAAAR,QAAE,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,O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WAAA,CAAAmD,GAAA,EAAC/D,WAAA,CAAAsE,qBAAO;UACPb,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":[]}
@@ -6,12 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = SidebarNavigationScreenGlobalStylesContent;
8
8
  var _i18n = require("@wordpress/i18n");
9
- var _data = require("@wordpress/data");
10
9
  var _components = require("@wordpress/components");
11
- var _blockEditor = require("@wordpress/block-editor");
12
10
  var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
13
- var _lockUnlock = require("../../lock-unlock");
14
- var _store = require("../../store");
15
11
  var _variationsColor = _interopRequireDefault(require("../global-styles/variations/variations-color"));
16
12
  var _variationsTypography = _interopRequireDefault(require("../global-styles/variations/variations-typography"));
17
13
  var _jsxRuntime = require("react/jsx-runtime");
@@ -23,42 +19,20 @@ var _jsxRuntime = require("react/jsx-runtime");
23
19
  * Internal dependencies
24
20
  */
25
21
 
26
- const noop = () => {};
27
22
  function SidebarNavigationScreenGlobalStylesContent() {
28
- const {
29
- storedSettings
30
- } = (0, _data.useSelect)(select => {
31
- const {
32
- getSettings
33
- } = (0, _lockUnlock.unlock)(select(_store.store));
34
- return {
35
- storedSettings: getSettings()
36
- };
37
- }, []);
38
23
  const gap = 3;
39
-
40
- // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
41
- // loaded. This is necessary because the Iframe component waits until
42
- // the block editor store's `__internalIsInitialized` is true before
43
- // rendering the iframe. Without this, the iframe previews will not render
44
- // in mobile viewport sizes, where the editor canvas is hidden.
45
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockEditorProvider, {
46
- settings: storedSettings,
47
- onChange: noop,
48
- onInput: noop,
49
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
50
- spacing: 10,
51
- className: "edit-site-global-styles-variation-container",
52
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
53
- gap: gap
54
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
55
- title: (0, _i18n.__)('Palettes'),
56
- gap: gap
57
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
58
- title: (0, _i18n.__)('Typography'),
59
- gap: gap
60
- })]
61
- })
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
25
+ spacing: 10,
26
+ className: "edit-site-global-styles-variation-container",
27
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
28
+ gap: gap
29
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
30
+ title: (0, _i18n.__)('Palettes'),
31
+ gap: gap
32
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
33
+ title: (0, _i18n.__)('Typography'),
34
+ gap: gap
35
+ })]
62
36
  });
63
37
  }
64
38
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_components","_blockEditor","_styleVariationsContainer","_interopRequireDefault","_lockUnlock","_store","_variationsColor","_variationsTypography","_jsxRuntime","noop","SidebarNavigationScreenGlobalStylesContent","storedSettings","useSelect","select","getSettings","unlock","editSiteStore","gap","jsx","BlockEditorProvider","settings","onChange","onInput","children","jsxs","__experimentalVStack","spacing","className","default","title","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nconst noop = () => {};\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t\t<TypographyVariations\n\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\tgap={ gap }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,yBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,qBAAA,GAAAJ,sBAAA,CAAAL,OAAA;AAAqF,IAAAU,WAAA,GAAAV,OAAA;AAfrF;AACA;AACA;;AAMA;AACA;AACA;;AAOA,MAAMW,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEN,SAASC,0CAA0CA,CAAA,EAAG;EACpE,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACnD,MAAM;MAAEC;IAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEF,MAAM,CAAEG,YAAc,CAAE,CAAC;IAEzD,OAAO;MACNL,cAAc,EAAEG,WAAW,CAAC;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMG,GAAG,GAAG,CAAC;;EAEb;EACA;EACA;EACA;EACA;EACA,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAACjB,YAAA,CAAAkB,mBAAmB;IACnBC,QAAQ,EAAGT,cAAgB;IAC3BU,QAAQ,EAAGZ,IAAM;IACjBa,OAAO,EAAGb,IAAM;IAAAc,QAAA,eAEhB,IAAAf,WAAA,CAAAgB,IAAA,EAACxB,WAAA,CAAAyB,oBAAM;MACNC,OAAO,EAAG,EAAI;MACdC,SAAS,EAAC,6CAA6C;MAAAJ,QAAA,gBAEvD,IAAAf,WAAA,CAAAU,GAAA,EAAChB,yBAAA,CAAA0B,OAAwB;QAACX,GAAG,EAAGA;MAAK,CAAE,CAAC,eACxC,IAAAT,WAAA,CAAAU,GAAA,EAACZ,gBAAA,CAAAsB,OAAe;QAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;QAACb,GAAG,EAAGA;MAAK,CAAE,CAAC,eAC1D,IAAAT,WAAA,CAAAU,GAAA,EAACX,qBAAA,CAAAqB,OAAoB;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;QAC5Bb,GAAG,EAAGA;MAAK,CACX,CAAC;IAAA,CACK;EAAC,CACW,CAAC;AAExB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_styleVariationsContainer","_interopRequireDefault","_variationsColor","_variationsTypography","_jsxRuntime","SidebarNavigationScreenGlobalStylesContent","gap","jsxs","__experimentalVStack","spacing","className","children","jsx","default","title","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst gap = 3;\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 10 }\n\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t>\n\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t<TypographyVariations title={ __( 'Typography' ) } gap={ gap } />\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,yBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,qBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAqF,IAAAM,WAAA,GAAAN,OAAA;AAXrF;AACA;AACA;;AAIA;AACA;AACA;;AAKe,SAASO,0CAA0CA,CAAA,EAAG;EACpE,MAAMC,GAAG,GAAG,CAAC;EAEb,oBACC,IAAAF,WAAA,CAAAG,IAAA,EAACR,WAAA,CAAAS,oBAAM;IACNC,OAAO,EAAG,EAAI;IACdC,SAAS,EAAC,6CAA6C;IAAAC,QAAA,gBAEvD,IAAAP,WAAA,CAAAQ,GAAA,EAACZ,yBAAA,CAAAa,OAAwB;MAACP,GAAG,EAAGA;IAAK,CAAE,CAAC,eACxC,IAAAF,WAAA,CAAAQ,GAAA,EAACV,gBAAA,CAAAW,OAAe;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;MAACT,GAAG,EAAGA;IAAK,CAAE,CAAC,eAC1D,IAAAF,WAAA,CAAAQ,GAAA,EAACT,qBAAA,CAAAU,OAAoB;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;MAACT,GAAG,EAAGA;IAAK,CAAE,CAAC;EAAA,CAC1D,CAAC;AAEX","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,G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CAAAc,GAAA,EAACf,4BAAA,CAAAmD,4BAA4B;QAACC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLV,4BAA4B,iBAC3B,IAAA1C,WAAA,CAAAc,GAAA,EAAChB,qCAAA,CAAAiB,OAAoC;QACpCsC,MAAM,EAAGhC,SAAS,GAAI,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;EAC9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,EAAE,CAAEI,gBAAgB,EAAEJ,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMa,4BAA4B,GACjC,CAAC,CAAElB,cAAc,IAAI,CAAED,kBAAkB;EAE1C,oBACC,IAAAf,WAAA,CAAAQ,GAAA,EAAAR,WAAA,CAAAmC,QAAA;IAAAC,QAAA,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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d;AAEe,SAASS,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,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,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;AAAqD,IAAAW,WAAA,GAAAX,OAAA;AAhBrD;AACA;AACA;;AAOA;AACA;AACA;;AAOO,SAASY,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAACd,WAAA,CAAAe,uBAAS;IAAAC,QAAA,gBACT,IAAAJ,WAAA,CAAAK,GAAA,EAACT,sBAAA,CAAAU,OAAqB;MACrBC,GAAG,EAAC,4BAA4B;MAChCC,EAAE,EAAC,aAAa;MAChBC,WAAW;MACXC,IAAI,EAAGC,iBAAY;MAAAP,QAAA,EAEjB,IAAAQ,QAAE,EAAE,YAAa;IAAC,CACE,CAAC,eACxB,IAAAZ,WAAA,CAAAK,GAAA,EAACR,oCAAA,CAAAgB,iCAAiC;MACjCL,EAAE,EAAC,SAAS;MACZD,GAAG,EAAC,+BAA+B;MACnCG,IAAI,EAAGI,aAAQ;MAAAV,QAAA,EAEb,IAAAQ,QAAE,EAAE,QAAS;IAAC,CACkB,CAAC,eACpC,IAAAZ,WAAA,CAAAK,GAAA,EAACT,sBAAA,CAAAU,OAAqB;MACrBC,GAAG,EAAC,sBA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Runtime.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, {
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_icons","_i18n","_element","_router","_renameModal","_interopRequireDefault","_deleteConfirmDialog","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","useState","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","jsxs","Fragment","children","jsx","DropdownMenu","className","label","__","icon","moreVertical","popoverProps","onClose","MenuGroup","MenuItem","onClick","push","postId","postType","canvas","isDestructive","default","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\tpostId: menuId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA2C,IAAAS,WAAA,GAAAT,OAAA;AAd3C;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEU;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,MAAMC,aAAa,GAAG;EACrBC,QAAQ,EAAE;AACX,CA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YAAAT,QAAA,EAED,IAAAK,QAAE,EAAE,QAAS;UAAC,CACP,CAAC,eACX,IAAA7B,WAAA,CAAAyB,GAAA,EAACnC,WAAA,CAAA6C,QAAQ;YACRC,OAAO,EAAGA,CAAA,KAAM;cACflB,OAAO,CAACmB,IAAI,CAAE;gBACbC,MAAM,EAAE1B,MAAM;gBACd2B,QAAQ,EAAE,eAAe;gBACzBC,MAAM,EAAE;cACT,CAAE,CAAC;YACJ,CAAG;YAAAhB,QAAA,EAED,IAAAK,QAAE,EAAE,MAAO;UAAC,CACL,CAAC,eACX,IAAA7B,WAAA,CAAAyB,GAAA,EAACnC,WAAA,CAAA6C,QAAQ;YACRC,OAAO,EAAGA,CAAA,KAAM;cACf1B,WAAW,CAAC,CAAC;cACbuB,OAAO,CAAC,CAAC;YACV,CAAG;YAAAT,QAAA,EAED,IAAAK,QAAE,EAAE,WAAY;UAAC,CACV,CAAC,eACX,IAAA7B,WAAA,CAAAyB,GAAA,EAACnC,WAAA,CAAA6C,QAAQ;YACRM,aAAa;YACbL,OAAO,EAAGA,CAAA,KAAM;cACff,uBAAuB,CAAC,CAAC;;cAEzB;cACAY,OAAO,CAAC,CAAC;YACV,CAAG;YAAAT,QAAA,EAED,IAAAK,QAAE,EAAE,QAAS;UAAC,CACP,CAAC;QAAA,CACD;MAAC,CACR;IACL,CACY,CAAC,EACbb,uBAAuB,iBACxB,IAAAhB,WAAA,CAAAyB,GAAA,EAAC3B,oBAAA,CAAA4C,OAAmB;MACnBT,OAAO,EAAGd,WAAa;MACvBwB,SAAS,EAAGnC;IAAU,CACtB,CACD,EACCK,eAAe,iBAChB,IAAAb,WAAA,CAAAyB,GAAA,EAAC7B,YAAA,CAAA8C,OAAW;MACXT,OAAO,EAAGd,WAAa;MACvBR,SAAS,EAAGA,SAAW;MACvBF,MAAM,EAAGA;IAAQ,CACjB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_icons","_i18n","_element","_router","_renameModal","_interopRequireDefault","_deleteConfirmDialog","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","menuId","renameModalOpen","setRenameModalOpen","useState","deleteConfirmDialogOpen","setDeleteConfirmDialogOpen","history","closeModals","openRenameModal","openDeleteConfirmDialog","jsxs","Fragment","children","jsx","DropdownMenu","className","label","__","icon","moreVertical","popoverProps","onClose","MenuGroup","MenuItem","onClick","navigate","isDestructive","default","onConfirm"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteConfirmDialog from './delete-confirm-dialog';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteConfirmDialogOpen, setDeleteConfirmDialogOpen ] =\n\t\tuseState( false );\n\n\tconst history = useHistory();\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteConfirmDialogOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t`/wp_navigation/${ menuId }?canvas=edit`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteConfirmDialog();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t{ deleteConfirmDialogOpen && (\n\t\t\t\t<DeleteConfirmDialog\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA2C,IAAAS,WAAA,GAAAT,OAAA;AAd3C;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEU;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,MAAMC,aAAa,GAAG;EACrBC,QAAQ,EAAE;AACX,CAAC;AAEc,SAASC,wBAAwBA,CAAEC,KAAK,EAAG;EACzD,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGL,KAAK;EAElE,MAAM,CAAEM,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACjE,MAAM,CAAEC,uBAAuB,EAAEC,0BAA0B,CAAE,GAC5D,IAAAF,iBAAQ,EAAE,KAAM,CAAC;EAElB,MAAMG,OAAO,GAAGjB,UAAU,CAAC,CAAC;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A,CAAA,KAAM;cACf1B,WAAW,CAAC,CAAC;cACbuB,OAAO,CAAC,CAAC;YACV,CAAG;YAAAT,QAAA,EAED,IAAAK,QAAE,EAAE,WAAY;UAAC,CACV,CAAC,eACX,IAAA7B,WAAA,CAAAyB,GAAA,EAACnC,WAAA,CAAA6C,QAAQ;YACRG,aAAa;YACbF,OAAO,EAAGA,CAAA,KAAM;cACff,uBAAuB,CAAC,CAAC;;cAEzB;cACAY,OAAO,CAAC,CAAC;YACV,CAAG;YAAAT,QAAA,EAED,IAAAK,QAAE,EAAE,QAAS;UAAC,CACP,CAAC;QAAA,CACD;MAAC,CACR;IACL,CACY,CAAC,EACbb,uBAAuB,iBACxB,IAAAhB,WAAA,CAAAyB,GAAA,EAAC3B,oBAAA,CAAAyC,OAAmB;MACnBN,OAAO,EAAGd,WAAa;MACvBqB,SAAS,EAAGhC;IAAU,CACtB,CACD,EACCK,eAAe,iBAChB,IAAAb,WAAA,CAAAyB,GAAA,EAAC7B,YAAA,CAAA2C,OAAW;MACXN,OAAO,EAAGd,WAAa;MACvBR,SAAS,EAAGA,SAAW;MACvBF,MAAM,EAAGA;IAAQ,CACjB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -43,9 +43,7 @@ function useDeleteNavigationMenu() {
43
43
  createSuccessNotice((0, _i18n.__)('Navigation Menu successfully deleted.'), {
44
44
  type: 'snackbar'
45
45
  });
46
- history.push({
47
- postType: 'wp_navigation'
48
- });
46
+ history.navivate('/navigation');
49
47
  } catch (error) {
50
48
  createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
51
49
  (0, _i18n.__)(`Unable to delete Navigation Menu (%s).`), error?.message), {
@@ -129,10 +127,7 @@ function useDuplicateNavigationMenu() {
129
127
  createSuccessNotice((0, _i18n.__)('Duplicated Navigation Menu'), {
130
128
  type: 'snackbar'
131
129
  });
132
- history.push({
133
- postType: _.postType,
134
- postId: savedRecord.id
135
- });
130
+ history.navigate(`/wp_navigation/${savedRecord.id}`);
136
131
  }
137
132
  } catch (error) {
138
133
  createErrorNotice((0, _i18n.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","push","error","sprintf","message","useSaveNavigationMenu","getEditedEntityRecord","useSelect","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","NAVIGATION_POST_TYPE","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","_x","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.push( { postType: 'wp_navigation' } );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t_x( '%s (Copy)', 'navigation menu' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.push( { postType, postId: savedRecord.id } );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,CAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAM;EAAEQ;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,SAASC,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACvD,MAAM;IAAEC,mBAAmB;IAAEC;EAAkB,CAAC,GAC/C,IAAAH,iBAAW,EAAEI,cAAa,CAAC;EAC5B,MAAMC,OAAO,GAAGV,UAAU,CAAC,CAAC;EAE5B,MAAMW,YAAY,GAAG,MAAQC,cAAc,IAAM;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E,IAAArB,aAAO,EACb;QACA,IAAAyB,QAAE,EAAE,WAAW,EAAE,iBAAkB,CAAC,EACpCL,SACD,CAAC;QACDM,OAAO,EAAEpC,cAAc,EAAEoC,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACCjC,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAK6B,WAAW,EAAG;QAClBvC,mBAAmB,CAAE,IAAAW,QAAE,EAAE,4BAA6B,CAAC,EAAE;UACxDC,IAAI,EAAE;QACP,CAAE,CAAC;QACHT,OAAO,CAACU,IAAI,CAAE;UAAEL,QAAQ,EAARA,UAAQ;UAAEF,MAAM,EAAEiC,WAAW,CAAChC;QAAG,CAAE,CAAC;MACrD;IACD,CAAC,CAAC,OAAQO,KAAK,EAAG;MACjBb,iBAAiB,CAChB,IAAAc,aAAO,EACN;MACA,IAAAJ,QAAE,EAAE,2CAA4C,CAAC,EACjDG,KAAK,EAAEE,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOsB,eAAe;AACvB;AAEe,SAASU,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNxC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_coreData","require","_i18n","_data","_notices","_router","_","_constants","_lockUnlock","useHistory","unlock","routerPrivateApis","useDeleteNavigationMenu","deleteEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","history","handleDelete","navigationMenu","postId","id","postType","force","throwOnError","__","type","navivate","error","sprintf","message","useSaveNavigationMenu","getEditedEntityRecord","useSelect","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","NAVIGATION_POST_TYPE","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","_x","content","raw","status","navigate","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.navivate( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t_x( '%s (Copy)', 'navigation menu' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.navigate( `/wp_navigation/${ savedRecord.id }` );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: use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,QAAE,EAAE,2CAA4C,CAAC,EACjDG,KAAK,EAAEE,OACR,CAAC,EAED;QACCJ,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOsB,eAAe;AACvB;AAEe,SAASW,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNzC,YAAY,EAAER,uBAAuB,CAAC,CAAC;IACvC6B,UAAU,EAAER,qBAAqB,CAAC,CAAC;IACnCiB,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
@@ -15,7 +15,6 @@ var _icons = require("@wordpress/icons");
15
15
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
16
16
  var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
17
17
  var _constants = require("./constants");
18
- var _link = require("../routes/link");
19
18
  var _singleNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu/single-navigation-menu"));
20
19
  var _useNavigationMenuHandlers = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers"));
21
20
  var _lockUnlock = require("../../lock-unlock");
@@ -130,12 +129,8 @@ const NavMenuItem = ({
130
129
  postId,
131
130
  ...props
132
131
  }) => {
133
- const linkInfo = (0, _link.useLink)({
134
- postId,
135
- postType: 'wp_navigation'
136
- });
137
132
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
138
- ...linkInfo,
133
+ to: `/wp_navigation/${postId}`,
139
134
  ...props
140
135
  });
141
136
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_link","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","_x","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","useEntityRecords","NAVIGATION_POST_TYPE","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","unlock","useSelect","coreStore","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","hasNavigationMenus","length","jsx","SidebarNavigationScreenWrapper","children","Spinner","className","description","default","navigationMenu","edits","__experimentalItemGroup","map","index","NavMenuItem","postId","withChevron","icon","navigation","rendered","actions","content","props","linkInfo","useLink","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,O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,MAAM;IACNU,QAAQ,EAAE;EACX,CAAE,CAAC;EACH,oBAAO,IAAAzD,WAAA,CAAAkC,GAAA,EAACzC,sBAAA,CAAA+C,OAAqB;IAAA,GAAMe,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_coreData","_data","_htmlEntities","_components","_icons","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_constants","_singleNavigationMenu","_useNavigationMenuHandlers","_lockUnlock","_constants2","_jsxRuntime","buildMenuLabel","title","id","status","sprintf","__","decodeEntities","_x","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","useEntityRecords","NAVIGATION_POST_TYPE","PRELOADED_NAVIGATION_MENUS_QUERY","isLoading","getNavigationFallbackId","unlock","useSelect","coreStore","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","useNavigationMenuHandlers","hasNavigationMenus","length","jsx","SidebarNavigationScreenWrapper","children","Spinner","className","description","default","navigationMenu","edits","__experimentalItemGroup","map","index","NavMenuItem","postId","withChevron","icon","navigation","rendered","actions","content","props","to"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ `/wp_navigation/${ postId }` }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,sBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,0BAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAA6D,IAAAc,WAAA,GAAAd,OAAA;AAvB7D;AACA;AACA;;AAYA;AACA;AACA;;AASA;AACA,SAASe,cAAcA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EAC5C,IAAK,CAAEF,KAAK,EAAG;IACd;IACA,OAAO,IAAAG,aAAO,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC,EAAEH,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAO,IAAAG,4BAAc,EAAEL,KAAM,CAAC;EAC/B;EAEA,OAAO,IAAAG,aAAO;EACb;EACA,IAAAG,QAAE,EAAE,aAAa,EAAE,YAAa,CAAC,EACjC,IAAAD,4BAAc,EAAEL,KAAM,CAA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AAuB;IACvBtC,KAAK,EAAGA,KAAK,IAAI,IAAAI,QAAE,EAAE,YAAa,CAAG;IACrC8C,OAAO,EAAGA,OAAS;IACnBb,WAAW,EAAGA,WAAW,IAAI,IAAAjC,QAAE,EAAE,+BAAgC,CAAG;IACpEI,QAAQ,EAAGA,QAAU;IACrB2C,OAAO,EAAGjB;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMU,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGO;AAAM,CAAC,KAAM;EAC/C,oBACC,IAAAtD,WAAA,CAAAkC,GAAA,EAACxC,sBAAA,CAAA8C,OAAqB;IACrBe,EAAE,EAAG,kBAAmBR,MAAM,EAAK;IAAA,GAC9BO;EAAK,CACV,CAAC;AAEJ,CAAC","ignoreList":[]}
@@ -27,10 +27,14 @@ const POPOVER_PROPS = {
27
27
  */
28
28
 
29
29
  const {
30
- useHistory
30
+ useHistory,
31
+ useLocation
31
32
  } = (0, _lockUnlock.unlock)(_router.privateApis);
32
33
  function LeafMoreMenu(props) {
33
34
  const history = useHistory();
35
+ const {
36
+ path
37
+ } = useLocation();
34
38
  const {
35
39
  block
36
40
  } = props;
@@ -64,30 +68,20 @@ function LeafMoreMenu(props) {
64
68
  name
65
69
  } = selectedBlock;
66
70
  if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
67
- const {
68
- params
69
- } = history.getLocationWithParams();
70
- history.push({
71
- postType: attributes.type,
72
- postId: attributes.id,
73
- canvas: 'edit'
74
- }, {
75
- backPath: params
71
+ history.navigate(`/${attributes.type}/${attributes.id}?canvas=edit`, {
72
+ state: {
73
+ backPath: path
74
+ }
76
75
  });
77
76
  }
78
77
  if (name === 'core/page-list-item' && attributes.id && history) {
79
- const {
80
- params
81
- } = history.getLocationWithParams();
82
- history.push({
83
- postType: 'page',
84
- postId: attributes.id,
85
- canvas: 'edit'
86
- }, {
87
- backPath: params
78
+ history.navigate(`/page/${attributes.id}?canvas=edit`, {
79
+ state: {
80
+ backPath: path
81
+ }
88
82
  });
89
83
  }
90
- }, [history]);
84
+ }, [path, history]);
91
85
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
92
86
  icon: _icons.moreVertical,
93
87
  label: (0, _i18n.__)('Options'),