@wordpress/edit-site 6.12.1-next.082ed6819.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 (515) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +3 -16
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-post/index.js +1 -1
  5. package/build/components/add-new-post/index.js.map +1 -1
  6. package/build/components/add-new-template/index.js +1 -5
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/app/index.js +31 -29
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/use-editor-iframe-props.js +8 -8
  11. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  12. package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
  13. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  14. package/build/components/block-editor/use-site-editor-settings.js +4 -4
  15. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  16. package/build/components/dataviews-actions/index.js +1 -5
  17. package/build/components/dataviews-actions/index.js.map +1 -1
  18. package/build/components/editor/index.js +38 -22
  19. package/build/components/editor/index.js.map +1 -1
  20. package/build/components/editor/use-editor-title.js +5 -0
  21. package/build/components/editor/use-editor-title.js.map +1 -1
  22. package/build/components/editor/use-resolve-edited-entity.js +19 -4
  23. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/context.js +0 -1
  25. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
  27. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  29. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  31. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  32. package/build/components/global-styles/preview-colors.js +2 -2
  33. package/build/components/global-styles/preview-colors.js.map +1 -1
  34. package/build/components/global-styles/preview-styles.js +2 -2
  35. package/build/components/global-styles/preview-styles.js.map +1 -1
  36. package/build/components/global-styles/preview-typography.js +2 -2
  37. package/build/components/global-styles/preview-typography.js.map +1 -1
  38. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +10 -29
  39. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  40. package/build/components/global-styles/typography-example.js +8 -1
  41. package/build/components/global-styles/typography-example.js.map +1 -1
  42. package/build/components/global-styles-sidebar/index.js +5 -5
  43. package/build/components/global-styles-sidebar/index.js.map +1 -1
  44. package/build/components/layout/index.js +44 -19
  45. package/build/components/layout/index.js.map +1 -1
  46. package/build/components/page-patterns/delete-category-menu-item.js +1 -4
  47. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  48. package/build/components/page-patterns/fields.js +6 -57
  49. package/build/components/page-patterns/fields.js.map +1 -1
  50. package/build/components/page-patterns/index.js +31 -30
  51. package/build/components/page-patterns/index.js.map +1 -1
  52. package/build/components/page-templates/fields.js +6 -34
  53. package/build/components/page-templates/fields.js.map +1 -1
  54. package/build/components/page-templates/index.js +34 -46
  55. package/build/components/page-templates/index.js.map +1 -1
  56. package/build/components/post-edit/header.js +83 -0
  57. package/build/components/post-edit/header.js.map +1 -0
  58. package/build/components/post-edit/index.js +42 -7
  59. package/build/components/post-edit/index.js.map +1 -1
  60. package/build/components/post-list/index.js +26 -40
  61. package/build/components/post-list/index.js.map +1 -1
  62. package/build/components/posts-app/index.js +10 -16
  63. package/build/components/posts-app/index.js.map +1 -1
  64. package/build/components/posts-app-routes/index.js +3 -7
  65. package/build/components/posts-app-routes/index.js.map +1 -1
  66. package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
  67. package/build/components/posts-app-routes/post-item.js.map +1 -0
  68. package/build/components/posts-app-routes/posts.js +89 -0
  69. package/build/components/posts-app-routes/posts.js.map +1 -0
  70. package/build/components/resizable-frame/index.js +6 -5
  71. package/build/components/resizable-frame/index.js.map +1 -1
  72. package/build/components/save-panel/index.js +9 -6
  73. package/build/components/save-panel/index.js.map +1 -1
  74. package/build/components/sidebar-dataviews/add-new-view.js +7 -8
  75. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  76. package/build/components/sidebar-dataviews/dataview-item.js +5 -8
  77. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  78. package/build/components/sidebar-dataviews/default-views.js +7 -24
  79. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  80. package/build/components/sidebar-dataviews/index.js +4 -3
  81. package/build/components/sidebar-dataviews/index.js.map +1 -1
  82. package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
  83. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  84. package/build/components/sidebar-navigation-item/index.js +8 -5
  85. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  86. package/build/components/sidebar-navigation-screen/index.js +2 -2
  87. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  88. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  89. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  90. package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
  91. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  92. package/build/components/sidebar-navigation-screen-main/index.js +6 -14
  93. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  94. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  95. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  96. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  97. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  98. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  99. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  100. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  101. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  102. package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  103. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
  105. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  106. package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  107. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  109. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  110. package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
  111. package/build/components/site-editor-routes/home.js.map +1 -0
  112. package/build/components/site-editor-routes/index.js +12 -18
  113. package/build/components/site-editor-routes/index.js.map +1 -1
  114. package/build/components/site-editor-routes/navigation-item.js +49 -0
  115. package/build/components/site-editor-routes/navigation-item.js.map +1 -0
  116. package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
  117. package/build/components/site-editor-routes/navigation.js.map +1 -0
  118. package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
  119. package/build/components/site-editor-routes/page-item.js.map +1 -0
  120. package/build/components/site-editor-routes/pages.js +87 -0
  121. package/build/components/site-editor-routes/pages.js.map +1 -0
  122. package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
  123. package/build/components/site-editor-routes/pattern-item.js.map +1 -0
  124. package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
  125. package/build/components/site-editor-routes/patterns.js.map +1 -0
  126. package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
  127. package/build/components/site-editor-routes/styles.js.map +1 -0
  128. package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
  129. package/build/components/site-editor-routes/template-item.js.map +1 -0
  130. package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
  131. package/build/components/site-editor-routes/template-part-item.js.map +1 -0
  132. package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
  133. package/build/components/site-editor-routes/templates.js.map +1 -0
  134. package/build/components/site-hub/index.js +3 -3
  135. package/build/components/site-hub/index.js.map +1 -1
  136. package/build/components/style-book/constants.js +8 -19
  137. package/build/components/style-book/constants.js.map +1 -1
  138. package/build/components/style-book/examples.js +42 -27
  139. package/build/components/style-book/examples.js.map +1 -1
  140. package/build/components/style-book/index.js +21 -5
  141. package/build/components/style-book/index.js.map +1 -1
  142. package/build/components/style-book/types.js.map +1 -1
  143. package/build/hooks/commands/use-common-commands.js +12 -48
  144. package/build/hooks/commands/use-common-commands.js.map +1 -1
  145. package/build/hooks/commands/use-set-command-context.js +2 -2
  146. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  147. package/build/store/private-actions.js +7 -0
  148. package/build/store/private-actions.js.map +1 -1
  149. package/build/store/reducer.js +2 -0
  150. package/build/store/reducer.js.map +1 -1
  151. package/build/utils/is-previewing-theme.js +1 -1
  152. package/build/utils/is-previewing-theme.js.map +1 -1
  153. package/build/utils/use-activate-theme.js +9 -8
  154. package/build/utils/use-activate-theme.js.map +1 -1
  155. package/build-module/components/add-new-pattern/index.js +3 -16
  156. package/build-module/components/add-new-pattern/index.js.map +1 -1
  157. package/build-module/components/add-new-post/index.js +1 -1
  158. package/build-module/components/add-new-post/index.js.map +1 -1
  159. package/build-module/components/add-new-template/index.js +1 -5
  160. package/build-module/components/add-new-template/index.js.map +1 -1
  161. package/build-module/components/app/index.js +33 -31
  162. package/build-module/components/app/index.js.map +1 -1
  163. package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
  164. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  165. package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
  166. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  167. package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
  168. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  169. package/build-module/components/dataviews-actions/index.js +1 -5
  170. package/build-module/components/dataviews-actions/index.js.map +1 -1
  171. package/build-module/components/editor/index.js +38 -22
  172. package/build-module/components/editor/index.js.map +1 -1
  173. package/build-module/components/editor/use-editor-title.js +5 -0
  174. package/build-module/components/editor/use-editor-title.js.map +1 -1
  175. package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
  176. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  177. package/build-module/components/global-styles/font-library-modal/context.js +0 -1
  178. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  179. package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
  180. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  181. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  182. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  183. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  184. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  185. package/build-module/components/global-styles/preview-colors.js +2 -2
  186. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  187. package/build-module/components/global-styles/preview-styles.js +2 -2
  188. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  189. package/build-module/components/global-styles/preview-typography.js +2 -2
  190. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  191. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +12 -31
  192. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  193. package/build-module/components/global-styles/typography-example.js +8 -1
  194. package/build-module/components/global-styles/typography-example.js.map +1 -1
  195. package/build-module/components/global-styles-sidebar/index.js +5 -5
  196. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  197. package/build-module/components/layout/index.js +45 -20
  198. package/build-module/components/layout/index.js.map +1 -1
  199. package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
  200. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  201. package/build-module/components/page-patterns/fields.js +7 -58
  202. package/build-module/components/page-patterns/fields.js.map +1 -1
  203. package/build-module/components/page-patterns/index.js +29 -28
  204. package/build-module/components/page-patterns/index.js.map +1 -1
  205. package/build-module/components/page-templates/fields.js +5 -31
  206. package/build-module/components/page-templates/fields.js.map +1 -1
  207. package/build-module/components/page-templates/index.js +33 -45
  208. package/build-module/components/page-templates/index.js.map +1 -1
  209. package/build-module/components/post-edit/header.js +76 -0
  210. package/build-module/components/post-edit/header.js.map +1 -0
  211. package/build-module/components/post-edit/index.js +42 -7
  212. package/build-module/components/post-edit/index.js.map +1 -1
  213. package/build-module/components/post-list/index.js +26 -40
  214. package/build-module/components/post-list/index.js.map +1 -1
  215. package/build-module/components/posts-app/index.js +11 -17
  216. package/build-module/components/posts-app/index.js.map +1 -1
  217. package/build-module/components/posts-app-routes/index.js +3 -7
  218. package/build-module/components/posts-app-routes/index.js.map +1 -1
  219. package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
  220. package/build-module/components/posts-app-routes/post-item.js.map +1 -0
  221. package/build-module/components/posts-app-routes/posts.js +81 -0
  222. package/build-module/components/posts-app-routes/posts.js.map +1 -0
  223. package/build-module/components/resizable-frame/index.js +6 -5
  224. package/build-module/components/resizable-frame/index.js.map +1 -1
  225. package/build-module/components/save-panel/index.js +9 -6
  226. package/build-module/components/save-panel/index.js.map +1 -1
  227. package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
  228. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  229. package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
  230. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  231. package/build-module/components/sidebar-dataviews/default-views.js +7 -24
  232. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  233. package/build-module/components/sidebar-dataviews/index.js +4 -3
  234. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  235. package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
  236. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  237. package/build-module/components/sidebar-navigation-item/index.js +8 -5
  238. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  239. package/build-module/components/sidebar-navigation-screen/index.js +2 -2
  240. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  241. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  242. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  243. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
  244. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  245. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
  246. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  247. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  248. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  249. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  250. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  251. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  252. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  253. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  254. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  255. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  256. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  257. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
  258. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  259. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  260. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  261. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  262. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  263. package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
  264. package/build-module/components/site-editor-routes/home.js.map +1 -0
  265. package/build-module/components/site-editor-routes/index.js +12 -18
  266. package/build-module/components/site-editor-routes/index.js.map +1 -1
  267. package/build-module/components/site-editor-routes/navigation-item.js +41 -0
  268. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
  269. package/build-module/components/site-editor-routes/navigation.js +38 -0
  270. package/build-module/components/site-editor-routes/navigation.js.map +1 -0
  271. package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
  272. package/build-module/components/site-editor-routes/page-item.js.map +1 -0
  273. package/build-module/components/site-editor-routes/pages.js +79 -0
  274. package/build-module/components/site-editor-routes/pages.js.map +1 -0
  275. package/build-module/components/site-editor-routes/pattern-item.js +18 -0
  276. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
  277. package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
  278. package/build-module/components/site-editor-routes/patterns.js.map +1 -0
  279. package/build-module/components/site-editor-routes/styles.js +44 -0
  280. package/build-module/components/site-editor-routes/styles.js.map +1 -0
  281. package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
  282. package/build-module/components/site-editor-routes/template-item.js.map +1 -0
  283. package/build-module/components/site-editor-routes/template-part-item.js +18 -0
  284. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
  285. package/build-module/components/site-editor-routes/templates.js +33 -0
  286. package/build-module/components/site-editor-routes/templates.js.map +1 -0
  287. package/build-module/components/site-hub/index.js +3 -3
  288. package/build-module/components/site-hub/index.js.map +1 -1
  289. package/build-module/components/style-book/constants.js +8 -19
  290. package/build-module/components/style-book/constants.js.map +1 -1
  291. package/build-module/components/style-book/examples.js +42 -27
  292. package/build-module/components/style-book/examples.js.map +1 -1
  293. package/build-module/components/style-book/index.js +21 -5
  294. package/build-module/components/style-book/index.js.map +1 -1
  295. package/build-module/components/style-book/types.js.map +1 -1
  296. package/build-module/hooks/commands/use-common-commands.js +12 -48
  297. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  298. package/build-module/hooks/commands/use-set-command-context.js +2 -2
  299. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  300. package/build-module/store/private-actions.js +6 -0
  301. package/build-module/store/private-actions.js.map +1 -1
  302. package/build-module/store/reducer.js +2 -0
  303. package/build-module/store/reducer.js.map +1 -1
  304. package/build-module/utils/is-previewing-theme.js +1 -1
  305. package/build-module/utils/is-previewing-theme.js.map +1 -1
  306. package/build-module/utils/use-activate-theme.js +9 -8
  307. package/build-module/utils/use-activate-theme.js.map +1 -1
  308. package/build-style/posts-rtl.css +73 -107
  309. package/build-style/posts.css +73 -107
  310. package/build-style/style-rtl.css +201 -142
  311. package/build-style/style.css +201 -142
  312. package/package.json +40 -40
  313. package/src/components/add-new-pattern/index.js +9 -17
  314. package/src/components/add-new-post/index.js +1 -1
  315. package/src/components/add-new-template/index.js +3 -5
  316. package/src/components/app/index.js +34 -35
  317. package/src/components/block-editor/use-editor-iframe-props.js +5 -4
  318. package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
  319. package/src/components/block-editor/use-site-editor-settings.js +6 -6
  320. package/src/components/dataviews-actions/index.js +1 -5
  321. package/src/components/editor/index.js +64 -29
  322. package/src/components/editor/use-editor-title.js +4 -0
  323. package/src/components/editor/use-resolve-edited-entity.js +17 -2
  324. package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
  325. package/src/components/global-styles/font-library-modal/style.scss +12 -5
  326. package/src/components/global-styles/preview-colors.js +3 -3
  327. package/src/components/global-styles/preview-styles.js +3 -3
  328. package/src/components/global-styles/preview-typography.js +3 -3
  329. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  330. package/src/components/global-styles/style.scss +5 -1
  331. package/src/components/global-styles/typography-example.js +12 -1
  332. package/src/components/global-styles-sidebar/index.js +4 -4
  333. package/src/components/layout/index.js +43 -11
  334. package/src/components/page-patterns/delete-category-menu-item.js +3 -4
  335. package/src/components/page-patterns/fields.js +9 -65
  336. package/src/components/page-patterns/index.js +39 -25
  337. package/src/components/page-patterns/style.scss +0 -28
  338. package/src/components/page-templates/fields.js +3 -31
  339. package/src/components/page-templates/index.js +34 -51
  340. package/src/components/post-edit/header.js +88 -0
  341. package/src/components/post-edit/index.js +39 -7
  342. package/src/components/post-edit/style.scss +10 -0
  343. package/src/components/post-list/index.js +44 -40
  344. package/src/components/post-list/style.scss +0 -36
  345. package/src/components/posts-app/index.js +9 -18
  346. package/src/components/posts-app-routes/index.js +3 -14
  347. package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
  348. package/src/components/posts-app-routes/posts.js +66 -0
  349. package/src/components/resizable-frame/index.js +6 -7
  350. package/src/components/save-panel/index.js +11 -5
  351. package/src/components/sidebar-dataviews/add-new-view.js +9 -9
  352. package/src/components/sidebar-dataviews/dataview-item.js +5 -8
  353. package/src/components/sidebar-dataviews/default-views.js +7 -24
  354. package/src/components/sidebar-dataviews/index.js +2 -2
  355. package/src/components/sidebar-dataviews/style.scss +2 -2
  356. package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
  357. package/src/components/sidebar-navigation-item/index.js +7 -5
  358. package/src/components/sidebar-navigation-item/style.scss +1 -2
  359. package/src/components/sidebar-navigation-screen/index.js +2 -2
  360. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  361. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  362. package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
  363. package/src/components/sidebar-navigation-screen-main/index.js +6 -10
  364. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
  365. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  366. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
  367. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
  368. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
  369. package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
  370. package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
  371. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  372. package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
  373. package/src/components/site-editor-routes/index.js +22 -34
  374. package/src/components/site-editor-routes/navigation-item.js +39 -0
  375. package/src/components/site-editor-routes/navigation.js +34 -0
  376. package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
  377. package/src/components/site-editor-routes/pages.js +66 -0
  378. package/src/components/site-editor-routes/pattern-item.js +15 -0
  379. package/src/components/site-editor-routes/patterns.js +15 -0
  380. package/src/components/site-editor-routes/styles.js +39 -0
  381. package/src/components/site-editor-routes/template-item.js +15 -0
  382. package/src/components/site-editor-routes/template-part-item.js +15 -0
  383. package/src/components/site-editor-routes/templates.js +26 -0
  384. package/src/components/site-hub/index.js +3 -6
  385. package/src/components/style-book/constants.ts +8 -19
  386. package/src/components/style-book/examples.tsx +47 -28
  387. package/src/components/style-book/index.js +28 -5
  388. package/src/components/style-book/types.ts +1 -1
  389. package/src/hooks/commands/use-common-commands.js +14 -72
  390. package/src/hooks/commands/use-set-command-context.js +2 -2
  391. package/src/store/private-actions.js +7 -0
  392. package/src/store/reducer.js +2 -0
  393. package/src/style.scss +1 -0
  394. package/src/utils/is-previewing-theme.js +1 -3
  395. package/src/utils/use-activate-theme.js +4 -3
  396. package/build/components/error-boundary/index.js +0 -47
  397. package/build/components/error-boundary/index.js.map +0 -1
  398. package/build/components/error-boundary/warning.js +0 -42
  399. package/build/components/error-boundary/warning.js.map +0 -1
  400. package/build/components/global-styles/preview-iframe.js.map +0 -1
  401. package/build/components/layout/router.js +0 -92
  402. package/build/components/layout/router.js.map +0 -1
  403. package/build/components/posts-app-routes/home.js.map +0 -1
  404. package/build/components/posts-app-routes/posts-edit.js.map +0 -1
  405. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
  406. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  407. package/build/components/posts-app-routes/posts-list-view.js +0 -48
  408. package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
  409. package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
  410. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  411. package/build/components/posts-app-routes/posts-view.js +0 -41
  412. package/build/components/posts-app-routes/posts-view.js.map +0 -1
  413. package/build/components/routes/link.js +0 -69
  414. package/build/components/routes/link.js.map +0 -1
  415. package/build/components/site-editor-routes/home-edit.js.map +0 -1
  416. package/build/components/site-editor-routes/home-view.js.map +0 -1
  417. package/build/components/site-editor-routes/navigation-edit.js +0 -29
  418. package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
  419. package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
  420. package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  421. package/build/components/site-editor-routes/navigation-item-view.js +0 -30
  422. package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
  423. package/build/components/site-editor-routes/navigation-view.js +0 -28
  424. package/build/components/site-editor-routes/navigation-view.js.map +0 -1
  425. package/build/components/site-editor-routes/pages-edit.js.map +0 -1
  426. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
  427. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  428. package/build/components/site-editor-routes/pages-list-view.js +0 -47
  429. package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
  430. package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
  431. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  432. package/build/components/site-editor-routes/pages-view.js +0 -42
  433. package/build/components/site-editor-routes/pages-view.js.map +0 -1
  434. package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
  435. package/build/components/site-editor-routes/patterns-view.js.map +0 -1
  436. package/build/components/site-editor-routes/styles-view.js.map +0 -1
  437. package/build/components/site-editor-routes/templates-edit.js.map +0 -1
  438. package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
  439. package/build/components/site-editor-routes/templates-view.js +0 -29
  440. package/build/components/site-editor-routes/templates-view.js.map +0 -1
  441. package/build-module/components/error-boundary/index.js +0 -38
  442. package/build-module/components/error-boundary/index.js.map +0 -1
  443. package/build-module/components/error-boundary/warning.js +0 -35
  444. package/build-module/components/error-boundary/warning.js.map +0 -1
  445. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  446. package/build-module/components/layout/router.js +0 -84
  447. package/build-module/components/layout/router.js.map +0 -1
  448. package/build-module/components/posts-app-routes/home.js +0 -40
  449. package/build-module/components/posts-app-routes/home.js.map +0 -1
  450. package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
  451. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
  452. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  453. package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
  454. package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
  455. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
  456. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  457. package/build-module/components/posts-app-routes/posts-view.js +0 -33
  458. package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
  459. package/build-module/components/routes/link.js +0 -61
  460. package/build-module/components/routes/link.js.map +0 -1
  461. package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
  462. package/build-module/components/site-editor-routes/home-view.js +0 -17
  463. package/build-module/components/site-editor-routes/home-view.js.map +0 -1
  464. package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
  465. package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
  466. package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
  467. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  468. package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
  469. package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
  470. package/build-module/components/site-editor-routes/navigation-view.js +0 -20
  471. package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
  472. package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
  473. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  474. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  475. package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
  476. package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
  477. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  478. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  479. package/build-module/components/site-editor-routes/pages-view.js +0 -34
  480. package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
  481. package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
  482. package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
  483. package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
  484. package/build-module/components/site-editor-routes/styles-view.js +0 -25
  485. package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
  486. package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
  487. package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
  488. package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
  489. package/build-module/components/site-editor-routes/templates-view.js +0 -21
  490. package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
  491. package/src/components/error-boundary/index.js +0 -44
  492. package/src/components/error-boundary/test/error-boundary.js +0 -40
  493. package/src/components/error-boundary/warning.js +0 -30
  494. package/src/components/layout/router.js +0 -86
  495. package/src/components/posts-app-routes/home.js +0 -36
  496. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
  497. package/src/components/posts-app-routes/posts-list-view.js +0 -40
  498. package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
  499. package/src/components/posts-app-routes/posts-view.js +0 -35
  500. package/src/components/routes/link.js +0 -68
  501. package/src/components/site-editor-routes/home-edit.js +0 -17
  502. package/src/components/site-editor-routes/navigation-edit.js +0 -22
  503. package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
  504. package/src/components/site-editor-routes/navigation-item-view.js +0 -25
  505. package/src/components/site-editor-routes/navigation-view.js +0 -21
  506. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  507. package/src/components/site-editor-routes/pages-list-view.js +0 -44
  508. package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  509. package/src/components/site-editor-routes/pages-view.js +0 -39
  510. package/src/components/site-editor-routes/patterns-edit.js +0 -24
  511. package/src/components/site-editor-routes/patterns-view.js +0 -22
  512. package/src/components/site-editor-routes/styles-view.js +0 -26
  513. package/src/components/site-editor-routes/templates-edit.js +0 -22
  514. package/src/components/site-editor-routes/templates-list-view.js +0 -28
  515. package/src/components/site-editor-routes/templates-view.js +0 -22
@@ -1 +1 @@
1
- {"version":3,"names":["__","trash","pages","drafts","published","scheduled","pending","notAllowed","useSelect","store","coreStore","useMemo","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IS_ANY","defaultLayouts","layout","primaryField","styles","title","maxWidth","mediaField","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViews","postType","labels","select","getPostType","all_items","slug","icon","view","operator","value"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured_media',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured_media',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,SACCC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,UAAU,QACJ,kBAAkB;AACzB,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,QACT,uBAAuB;AAE9B,OAAO,MAAMC,cAAc,GAAG;EAC7B,CAAEH,YAAY,GAAI;IACjBI,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBC,MAAM,EAAE;QACPC,KAAK,EAAE;UACNC,QAAQ,EAAE;QACX;MACD;IACD;EACD,CAAC;EACD,CAAEP,WAAW,GAAI;IAChBG,MAAM,EAAE;MACPK,UAAU,EAAE,gBAAgB;MAC5BJ,YAAY,EAAE;IACf;EACD,CAAC;EACD,CAAEN,WAAW,GAAI;IAChBK,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBI,UAAU,EAAE;IACb;EACD;AACD,CAAC;AAED,MAAMC,iBAAiB,GAAG;EACzBC,IAAI,EAAEZ,WAAW;EACjBa,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM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ErC,MAAM;MACZsC,IAAI,EAAElB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfY,QAAQ,EAAE3B,eAAe;QACzB4B,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCvB,KAAK,EAAEpB,EAAE,CAAE,SAAU,CAAC;MACtBuC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAElC,OAAO;MACbmC,IAAI,EAAElB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfY,QAAQ,EAAE3B,eAAe;QACzB4B,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCvB,KAAK,EAAEpB,EAAE,CAAE,SAAU,CAAC;MACtBuC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAEjC,UAAU;MAChBkC,IAAI,EAAElB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfY,QAAQ,EAAE3B,eAAe;QACzB4B,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCvB,KAAK,EAAEpB,EAAE,CAAE,OAAQ,CAAC;MACpBuC,IAAI,EAAE,OAAO;MACbC,IAAI,EAAEvC,KAAK;MACXwC,IAAI,EAAE;QACL,GAAGlB,iBAAiB;QACpBC,IAAI,EAAEX,YAAY;QAClBI,MAAM,EAAED,cAAc,CAAEH,YAAY,CAAE,CAACI;MACxC,CAAC;MACDS,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfY,QAAQ,EAAE3B,eAAe;QACzB4B,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAER,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["__","trash","pages","drafts","published","scheduled","pending","notAllowed","useSelect","store","coreStore","useMemo","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IS_ANY","defaultLayouts","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","titleField","mediaField","fields","useDefaultViews","postType","labels","select","getPostType","title","all_items","slug","icon","view","operator","value","layout"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {},\n\t[ LAYOUT_LIST ]: {},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\ttitleField: 'title',\n\tmediaField: 'featured_media',\n\tfields: [ 'author', 'status' ],\n\t...defaultLayouts[ LAYOUT_LIST ],\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,SACCC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,UAAU,QACJ,kBAAkB;AACzB,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,QACT,uBAAuB;AAE9B,OAAO,MAAMC,cAAc,GAAG;EAC7B,CAAEH,YAAY,GAAI,CAAC,CAAC;EACpB,CAAEC,WAAW,GAAI,CAAC,CAAC;EACnB,CAAEF,WAAW,GAAI,CAAC;AACnB,CAAC;AAED,MAAMK,iBAAiB,GAAG;EACzBC,IAAI,EAAEN,WAAW;EACjBO,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACDC,UAAU,EAAE,OAAO;EACnBC,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G,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfe,QAAQ,EAAExB,eAAe;QACzByB,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCN,KAAK,EAAElC,EAAE,CAAE,SAAU,CAAC;MACtBoC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAE/B,OAAO;MACbgC,IAAI,EAAErB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfe,QAAQ,EAAExB,eAAe;QACzByB,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCN,KAAK,EAAElC,EAAE,CAAE,SAAU,CAAC;MACtBoC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAE9B,UAAU;MAChB+B,IAAI,EAAErB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfe,QAAQ,EAAExB,eAAe;QACzByB,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCN,KAAK,EAAElC,EAAE,CAAE,OAAQ,CAAC;MACpBoC,IAAI,EAAE,OAAO;MACbC,IAAI,EAAEpC,KAAK;MACXqC,IAAI,EAAE;QACL,GAAGrB,iBAAiB;QACpBC,IAAI,EAAEL,YAAY;QAClB4B,MAAM,EAAEzB,cAAc,CAAEH,YAAY,CAAE,CAAC4B;MACxC,CAAC;MACDrB,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfe,QAAQ,EAAExB,eAAe;QACzByB,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAET,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
@@ -15,10 +15,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
15
15
  const {
16
16
  useLocation
17
17
  } = unlock(routerPrivateApis);
18
- export default function DataViewsSidebarContent() {
18
+ export default function DataViewsSidebarContent({
19
+ postType
20
+ }) {
19
21
  const {
20
- params: {
21
- postType,
22
+ query: {
22
23
  activeView = 'all',
23
24
  isCustom = 'false'
24
25
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","DataViewsSidebarContent","params","postType","activeView","isCustom","defaultViews","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\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;UACxBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKP,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZK,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCvB,IAAA,CAACF,mBAAmB;MACnBW,UAAU,EAAGA,UAAY;MACzBU,IAAI,EAAGX,QAAU;MACjBE,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","DataViewsSidebarContent","postType","query","activeView","isCustom","defaultViews","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent( { postType } ) {\n\tconst {\n\t\tquery: { activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1D,MAAM;EAAEC;AAAY,CAAC,GAAGT,MAAM,CAAEF,iBAAkB,CAAC;AAEnD,eAAe,SAASY,uBAAuBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/D,MAAM;IACLC,KAAK,EAAE;MAAEC,UAAU,GAAG,KAAK;MAAEC,QAAQ,GAAG;IAAQ;EACjD,CAAC,GAAGL,WAAW,CAAC,CAAC;EACjB,MAAMM,YAAY,GAAGhB,eAAe,CAAE;IAAEY;EAAS,CAAE,CAAC;EACpD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EACA,MAAMK,eAAe,GAAGF,QAAQ,KAAK,MAAM;EAE3C,oBACCN,KAAA,CAAAF,SAAA;IAAAW,QAAA,gBACCb,IAAA,CAACR,SAAS;MAAAqB,QAAA,EACPF,YAAY,CAACG,GAAG,CAAIC,QAAQ,IAAM;QACnC,oBACCf,IAAA,CAACH,YAAY;UAEZmB,IAAI,EAAGD,QAAQ,CAACC,IAAM;UACtBC,KAAK,EAAGF,QAAQ,CAACE,KAAO;UACxBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKP,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZK,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCvB,IAAA,CAACF,mBAAmB;MACnBW,UAAU,EAAGA,UAAY;MACzBU,IAAI,EAAGZ,QAAU;MACjBG,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -6,6 +6,7 @@ import { useMemo, useState } from '@wordpress/element';
6
6
  import { privateApis as routerPrivateApis } from '@wordpress/router';
7
7
  import { useViewportMatch } from '@wordpress/compose';
8
8
  import { Button, privateApis as componentsPrivateApis } from '@wordpress/components';
9
+ import { addQueryArgs } from '@wordpress/url';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
@@ -23,7 +24,6 @@ const {
23
24
  const {
24
25
  Menu
25
26
  } = unlock(componentsPrivateApis);
26
- const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
27
27
  const GlobalStylesPageActions = ({
28
28
  isStyleBookOpened,
29
29
  setIsStyleBookOpened
@@ -61,23 +61,23 @@ const GlobalStylesPageActions = ({
61
61
  };
62
62
  export default function GlobalStylesUIWrapper() {
63
63
  const {
64
- params
64
+ path,
65
+ query
65
66
  } = useLocation();
66
67
  const history = useHistory();
67
68
  const {
68
69
  canvas = 'view'
69
- } = params;
70
+ } = query;
70
71
  const [isStyleBookOpened, setIsStyleBookOpened] = useState(false);
71
72
  const isMobileViewport = useViewportMatch('medium', '<');
72
- const pathWithPrefix = params.path;
73
- const [path, onPathChange] = useMemo(() => {
74
- const processedPath = pathWithPrefix.substring(GLOBAL_STYLES_PATH_PREFIX.length);
75
- return [processedPath ? processedPath : '/', newPath => {
76
- history.push({
77
- path: !newPath || newPath === '/' ? GLOBAL_STYLES_PATH_PREFIX : `${GLOBAL_STYLES_PATH_PREFIX}${newPath}`
78
- });
73
+ const [section, onChangeSection] = useMemo(() => {
74
+ var _query$section;
75
+ return [(_query$section = query.section) !== null && _query$section !== void 0 ? _query$section : '/', updatedSection => {
76
+ history.navigate(addQueryArgs(path, {
77
+ section: updatedSection
78
+ }));
79
79
  }];
80
- }, [pathWithPrefix, history]);
80
+ }, [path, query.section, history]);
81
81
  return /*#__PURE__*/_jsxs(_Fragment, {
82
82
  children: [/*#__PURE__*/_jsx(Page, {
83
83
  actions: !isMobileViewport ? /*#__PURE__*/_jsx(GlobalStylesPageActions, {
@@ -87,8 +87,8 @@ export default function GlobalStylesUIWrapper() {
87
87
  className: "edit-site-styles",
88
88
  title: __('Styles'),
89
89
  children: /*#__PURE__*/_jsx(GlobalStylesUI, {
90
- path: path,
91
- onPathChange: onPathChange
90
+ path: section,
91
+ onPathChange: onChangeSection
92
92
  })
93
93
  }), canvas === 'view' && isStyleBookOpened && /*#__PURE__*/_jsx(StyleBook, {
94
94
  enableResizing: false,
@@ -98,22 +98,22 @@ export default function GlobalStylesUIWrapper() {
98
98
  // Match '/blocks/core%2Fbutton' and
99
99
  // '/blocks/core%2Fbutton/typography', but not
100
100
  // '/blocks/core%2Fbuttons'.
101
- path === `/wp_global_styles/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/wp_global_styles/blocks/${encodeURIComponent(blockName)}/`),
102
- path: path,
101
+ section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`),
102
+ path: section,
103
103
  onSelect: blockName => {
104
104
  if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
105
105
  // Go to color palettes Global Styles.
106
- onPathChange('/colors/palette');
106
+ onChangeSection('/colors/palette');
107
107
  return;
108
108
  }
109
109
  if (blockName === 'typography') {
110
110
  // Go to typography Global Styles.
111
- onPathChange('/typography');
111
+ onChangeSection('/typography');
112
112
  return;
113
113
  }
114
114
 
115
115
  // Now go to the selected block.
116
- onPathChange(`/blocks/${encodeURIComponent(blockName)}`);
116
+ onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
117
117
  }
118
118
  })]
119
119
  });
@@ -1 +1 @@
1
- {"version":3,"names":["__","useMemo","useState","privateApis","routerPrivateApis","useViewportMatch","Button","componentsPrivateApis","GlobalStylesUI","Page","unlock","StyleBook","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useLocation","useHistory","Menu","GLOBAL_STYLES_PATH_PREFIX","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","trigger","__next40pxDefaultSize","variant","size","children","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","params","history","canvas","isMobileViewport","pathWithPrefix","path","onPathChange","processedPath","substring","length","newPath","push","actions","className","title","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\nconst GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = params;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst pathWithPrefix = params.path;\n\tconst [ path, onPathChange ] = useMemo( () => {\n\t\tconst processedPath = pathWithPrefix.substring(\n\t\t\tGLOBAL_STYLES_PATH_PREFIX.length\n\t\t);\n\t\treturn [\n\t\t\tprocessedPath ? processedPath : '/',\n\t\t\t( newPath ) => {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath:\n\t\t\t\t\t\t! newPath || newPath === '/'\n\t\t\t\t\t\t\t? GLOBAL_STYLES_PATH_PREFIX\n\t\t\t\t\t\t\t: `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,\n\t\t\t\t} );\n\t\t\t},\n\t\t];\n\t}, [ pathWithPrefix, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI path={ path } onPathChange={ onPathChange } />\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tpath ===\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }` ||\n\t\t\t\t\t\tpath.startsWith(\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now go to the selected block.\n\t\t\t\t\t\tonPathChange(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,MAAM,EACNH,WAAW,IAAII,qBAAqB,QAC9B,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,qBAAqB;AAChD,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;MACJ2C,OAAO,EACN,CAAET,gBAAgB,gBACjB7B,IAAA,CAACS,uBAAuB;QACvBC,iBAAiB,EAAGA,iBAAmB;QACvCC,oBAAoB,EAAGA;MAAsB,CAC7C,CAAC,GACC,IACJ;MACD4B,SAAS,EAAC,kBAAkB;MAC5BC,KAAK,EAAGtD,EAAE,CAAE,QAAS,CAAG;MAAA8B,QAAA,eAExBhB,IAAA,CAACN,cAAc;QAACqC,IAAI,EAAGA,IAAM;QAACC,YAAY,EAAGA;MAAc,CAAE;IAAC,CACzD,CAAC,EACLJ,MAAM,KAAK,MAAM,IAAIlB,iBAAiB,iBACvCV,IAAA,CAACH,SAAS;MACT4C,cAAc,EAAG,KAAO;MACxBC,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG,KAAO;MAClBC,UAAU,EAAKC,SAAS;MACvB;MACA;MACA;MACAd,IAAI,KACH,4BAA6Be,kBAAkB,CAC9CD,SACD,CAAC,EAAG,IACLd,IAAI,CAACgB,UAAU,CACd,4BAA6BD,kBAAkB,CAC9CD,SACD,CAAC,GACF,CACA;MACDd,IAAI,EAAGA,IAAM;MACbiB,QAAQ,EAAKH,SAAS,IAAM;QAC3B,IACC/C,uBAAuB,CAACmD,IAAI,CACzBC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKN,SAC7B,CAAC,EACA;UACD;UACAb,YAAY,CAAE,iBAAkB,CAAC;UACjC;QACD;QACA,IAAKa,SAAS,KAAK,YAAY,EAAG;UACjC;UACAb,YAAY,CAAE,aAAc,CAAC;UAC7B;QACD;;QAEA;QACAA,YAAY,CACX,WAAYc,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","useMemo","useState","privateApis","routerPrivateApis","useViewportMatch","Button","componentsPrivateApis","addQueryArgs","GlobalStylesUI","Page","unlock","StyleBook","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useLocation","useHistory","Menu","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","trigger","__next40pxDefaultSize","variant","size","children","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","path","query","history","canvas","isMobileViewport","section","onChangeSection","_query$section","updatedSection","navigate","actions","className","title","onPathChange","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { path, query } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = query;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ section, onChangeSection ] = useMemo( () => {\n\t\treturn [\n\t\t\tquery.section ?? '/',\n\t\t\t( updatedSection ) => {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tsection: updatedSection,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t];\n\t}, [ path, query.section, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI\n\t\t\t\t\tpath={ section }\n\t\t\t\t\tonPathChange={ onChangeSection }\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tsection ===\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\t\t\tsection.startsWith(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ section }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonChangeSection( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonChangeSection( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now go to the selected block.\n\t\t\t\t\t\tonChangeSection(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,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CAAC;AAEL","ignoreList":[]}
@@ -19,7 +19,8 @@ import { unlock } from '../../lock-unlock';
19
19
  import { SidebarNavigationContext } from '../sidebar';
20
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
21
  const {
22
- useHistory
22
+ useHistory,
23
+ useLink
23
24
  } = unlock(routerPrivateApis);
24
25
  export default function SidebarNavigationItem({
25
26
  className,
@@ -27,7 +28,7 @@ export default function SidebarNavigationItem({
27
28
  withChevron = false,
28
29
  suffix,
29
30
  uid,
30
- params,
31
+ to,
31
32
  onClick,
32
33
  children,
33
34
  ...props
@@ -41,18 +42,20 @@ export default function SidebarNavigationItem({
41
42
  if (onClick) {
42
43
  onClick(e);
43
44
  navigate('forward');
44
- } else if (params) {
45
+ } else if (to) {
45
46
  e.preventDefault();
46
- history.push(params);
47
+ history.navigate(to);
47
48
  navigate('forward', `[id="${uid}"]`);
48
49
  }
49
50
  }
51
+ const linkProps = useLink(to);
50
52
  return /*#__PURE__*/_jsx(Item, {
51
53
  className: clsx('edit-site-sidebar-navigation-item', {
52
54
  'with-suffix': !withChevron && suffix
53
55
  }, className),
54
- onClick: handleClick,
55
56
  id: uid,
57
+ onClick: handleClick,
58
+ href: to ? linkProps.href : undefined,
56
59
  ...props,
57
60
  children: /*#__PURE__*/_jsxs(HStack, {
58
61
  justify: "flex-start",
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","SidebarNavigationItem","className","icon","withChevron","suffix","uid","params","onClick","children","props","history","navigate","handleClick","e","preventDefault","push","id","justify","style","fill","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tparams,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( params ) {\n\t\t\te.preventDefault();\n\t\t\thistory.push( params );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ handleClick }\n\t\t\tid={ uid }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item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,CAAC;MACtBK,QAAQ,CAAE,SAAS,EAAE,QAASN,GAAG,IAAM,CAAC;IACzC;EACD;EAEA,oBACCT,IAAA,CAACd,IAAI;IACJmB,SAAS,EAAGrB,IAAI,CACf,mCAAmC,EACnC;MAAE,aAAa,EAAE,CAAEuB,WAAW,IAAIC;IAAO,CAAC,EAC1CH,SACD,CAAG;IACHM,OAAO,EAAGK,WAAa;IACvBI,EAAE,EAAGX,GAAK;IAAA,GACLI,KAAK;IAAAD,QAAA,eAEVV,KAAA,CAACd,MAAM;MAACiC,OAAO,EAAC,YAAY;MAAAT,QAAA,GACzBN,IAAI,iBACLN,IAAA,CAACP,IAAI;QACJ6B,KAAK,EAAG;UAAEC,IAAI,EAAE;QAAe,CAAG;QAClCjB,IAAI,EAAGA,IAAM;QACbkB,IAAI,EAAG;MAAI,CACX,CACD,eACDxB,IAAA,CAACX,SAAS;QAAAuB,QAAA,EAAGA;MAAQ,CAAa,CAAC,EACjCL,WAAW,iBACZP,IAAA,CAACP,IAAI;QACJa,IAAI,EAAGhB,KAAK,CAAC,CAAC,GAAGE,gBAAgB,GAAGD,iBAAmB;QACvDc,SAAS,EAAC,wDAAwD;QAClEmB,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEjB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","privateApis","routerPrivateApis","useContext","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useHistory","useLink","SidebarNavigationItem","className","icon","withChevron","suffix","uid","to","onClick","children","props","history","navigate","handleClick","e","preventDefault","linkProps","id","href","undefined","justify","style","fill","size"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLink } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tuid,\n\tto,\n\tonClick,\n\tchildren,\n\t...props\n} ) {\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\t// If there is no custom click handler, create one that navigates to `params`.\n\tfunction handleClick( e ) {\n\t\tif ( onClick ) {\n\t\t\tonClick( e );\n\t\t\tnavigate( 'forward' );\n\t\t} else if ( to ) {\n\t\t\te.preventDefault();\n\t\t\thistory.navigate( to );\n\t\t\tnavigate( 'forward', `[id=\"${ uid }\"]` );\n\t\t}\n\t}\n\tconst linkProps = useLink( to );\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tid={ uid }\n\t\t\tonClick={ handleClick }\n\t\t\thref={ to ? linkProps.href : undefined }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,kBAAkB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,MAAM;EAAEC,UAAU;EAAEC;AAAQ,CAAC,GAAGP,MAAM,CAAEF,iBAAkB,CAAC;AAE3D,eAAe,SAASU,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,IAAI;EACJC,WAAW,GAAG,KAAK;EACnBC,MAAM;EACNC,GAAG;EACHC,EAAE;EACFC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,OAAO,GAAGZ,UAAU,CAAC,CAAC;EAC5B,MAAM;IAAEa;EAAS,CAAC,GAAGpB,UAAU,CAAEE,wBAAyB,CAAC;EAC3D;EACA,SAASmB,WAAWA,CAAEC,CAAC,EAAG;IACzB,IAAKN,OAAO,EAAG;MACdA,OAAO,CAAEM,CAAE,CAAC;MACZF,QAAQ,CAAE,SAAU,CAAC;IACtB,CAAC,MAAM,IAAKL,EAAE,EAAG;MAChBO,CAAC,CAACC,cAAc,CAAC,CAAC;MAClBJ,OAAO,CAACC,QAAQ,CAAEL,EAAG,CAAC;MACtBK,QAAQ,CAAE,SAAS,EAAE,QAASN,GAAG,IAAM,CAAC;IACzC;EACD;EACA,MAAMU,SAAS,GAAGhB,OAAO,CAAEO,EAAG,CAAC;EAE/B,oBACCX,IAAA,CAACd,IAAI;IACJoB,SAAS,EAAGtB,IAAI,CACf,mCAAmC,EACnC;MAAE,aAAa,EAAE,CAAEwB,WAAW,IAAIC;IAAO,CAAC,EAC1CH,SACD,CAAG;IACHe,EAAE,EAAGX,GAAK;IACVE,OAAO,EAAGK,WAAa;IACvBK,IAAI,EAAGX,EAAE,GAAGS,SAAS,CAACE,IAAI,GAAGC,SAAW;IAAA,GACnCT,KAAK;IAAAD,QAAA,eAEVX,KAAA,CAACd,MAAM;MAACoC,OAAO,EAAC,YAAY;MAAAX,QAAA,GACzBN,IAAI,iBACLP,IAAA,CAACP,IAAI;QACJgC,KAAK,EAAG;UAAEC,IAAI,EAAE;QAAe,CAAG;QAClCnB,IAAI,EAAGA,IAAM;QACboB,IAAI,EAAG;MAAI,CACX,CACD,eACD3B,IAAA,CAACX,SAAS;QAAAwB,QAAA,EAAGA;MAAQ,CAAa,CAAC,EACjCL,WAAW,iBACZR,IAAA,CAACP,IAAI;QACJc,IAAI,EAAGjB,KAAK,CAAC,CAAC,GAAGE,gBAAgB,GAAGD,iBAAmB;QACvDe,SAAS,EAAC,wDAAwD;QAClEqB,IAAI,EAAG;MAAI,CACX,CACD,EACC,CAAEnB,WAAW,IAAIC,MAAM;IAAA,CAClB;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
@@ -74,7 +74,7 @@ export default function SidebarNavigationScreen({
74
74
  className: "edit-site-sidebar-navigation-screen__title-icon",
75
75
  children: [!isRoot && /*#__PURE__*/_jsx(SidebarButton, {
76
76
  onClick: () => {
77
- history.push(backPath);
77
+ history.navigate(backPath);
78
78
  navigate('back');
79
79
  },
80
80
  icon: icon,
@@ -83,7 +83,7 @@ export default function SidebarNavigationScreen({
83
83
  }), isRoot && /*#__PURE__*/_jsx(SidebarButton, {
84
84
  icon: icon,
85
85
  label: dashboardLinkText || __('Go to the Dashboard'),
86
- href: dashboardLink || 'index.php'
86
+ href: dashboardLink
87
87
  }), /*#__PURE__*/_jsx(Heading, {
88
88
  className: "edit-site-sidebar-navigation-screen__title",
89
89
  color: '#e0e0e0' /* $gray-200 */,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","push","label","showTooltip","href","color","level","size"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AACxC,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEtD,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAGZ,MAAM,CA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A8C;QAAAD,QAAA,GAC1DpB,WAAW,iBACZd,IAAA;UAAGmC,SAAS,EAAC,kDAAkD;UAAAD,QAAA,EAC5DpB;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACPb,IAAA;MAAQmC,SAAS,EAAC,6CAA6C;MAAAD,QAAA,EAC5DrB;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","useContext","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","select","getSettings","currentlyPreviewingThemeId","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","name","rendered","undefined","location","history","navigate","state","icon","children","className","spacing","justify","alignment","onClick","label","showTooltip","href","color","level","size"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AACxC,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEtD,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAGZ,MAAM,CAAEH,iBAAkB,CAAC;AAE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iBACZd,IAAA;UAAGmC,SAAS,EAAC,kDAAkD;UAAAD,QAAA,EAC5DpB;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACPb,IAAA;MAAQmC,SAAS,EAAC,6CAA6C;MAAAD,QAAA,EAC5DrB;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -2,55 +2,29 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useSelect } from '@wordpress/data';
6
5
  import { __experimentalVStack as VStack } from '@wordpress/components';
7
- import { BlockEditorProvider } from '@wordpress/block-editor';
8
6
 
9
7
  /**
10
8
  * Internal dependencies
11
9
  */
12
10
  import StyleVariationsContainer from '../global-styles/style-variations-container';
13
- import { unlock } from '../../lock-unlock';
14
- import { store as editSiteStore } from '../../store';
15
11
  import ColorVariations from '../global-styles/variations/variations-color';
16
12
  import TypographyVariations from '../global-styles/variations/variations-typography';
17
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
- const noop = () => {};
19
14
  export default function SidebarNavigationScreenGlobalStylesContent() {
20
- const {
21
- storedSettings
22
- } = useSelect(select => {
23
- const {
24
- getSettings
25
- } = unlock(select(editSiteStore));
26
- return {
27
- storedSettings: getSettings()
28
- };
29
- }, []);
30
15
  const gap = 3;
31
-
32
- // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
33
- // loaded. This is necessary because the Iframe component waits until
34
- // the block editor store's `__internalIsInitialized` is true before
35
- // rendering the iframe. Without this, the iframe previews will not render
36
- // in mobile viewport sizes, where the editor canvas is hidden.
37
- return /*#__PURE__*/_jsx(BlockEditorProvider, {
38
- settings: storedSettings,
39
- onChange: noop,
40
- onInput: noop,
41
- children: /*#__PURE__*/_jsxs(VStack, {
42
- spacing: 10,
43
- className: "edit-site-global-styles-variation-container",
44
- children: [/*#__PURE__*/_jsx(StyleVariationsContainer, {
45
- gap: gap
46
- }), /*#__PURE__*/_jsx(ColorVariations, {
47
- title: __('Palettes'),
48
- gap: gap
49
- }), /*#__PURE__*/_jsx(TypographyVariations, {
50
- title: __('Typography'),
51
- gap: gap
52
- })]
53
- })
16
+ return /*#__PURE__*/_jsxs(VStack, {
17
+ spacing: 10,
18
+ className: "edit-site-global-styles-variation-container",
19
+ children: [/*#__PURE__*/_jsx(StyleVariationsContainer, {
20
+ gap: gap
21
+ }), /*#__PURE__*/_jsx(ColorVariations, {
22
+ title: __('Palettes'),
23
+ gap: gap
24
+ }), /*#__PURE__*/_jsx(TypographyVariations, {
25
+ title: __('Typography'),
26
+ gap: gap
27
+ })]
54
28
  });
55
29
  }
56
30
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","useSelect","__experimentalVStack","VStack","BlockEditorProvider","StyleVariationsContainer","unlock","store","editSiteStore","ColorVariations","TypographyVariations","jsx","_jsx","jsxs","_jsxs","noop","SidebarNavigationScreenGlobalStylesContent","storedSettings","select","getSettings","gap","settings","onChange","onInput","children","spacing","className","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,mBAAmB,QAAQ,yBAAyB;;AAE7D;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,6CAA6C;AAClF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,eAAe,MAAM,8CAA8C;AAC1E,OAAOC,oBAAoB,MAAM,mDAAmD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErF,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,0CAA0CA,CAAA,EAAG;EACpE,MAAM;IAAEC;EAAe,CAAC,GAAGhB,SAAS,CAAIiB,MAAM,IAAM;IACnD,MAAM;MAAEC;IAAY,CAAC,GAAGb,MAAM,CAAEY,MAAM,CAAEV,aAAc,CAAE,CAAC;IAEzD,OAAO;MACNS,cAAc,EAAEE,WAAW,CAAC;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,GAAG,GAAG,CAAC;;EAEb;EACA;EACA;EACA;EACA;EACA,oBACCR,IAAA,CAACR,mBAAmB;IACnBiB,QAAQ,EAAGJ,cAAgB;IAC3BK,QAAQ,EAAGP,IAAM;IACjBQ,OAAO,EAAGR,IAAM;IAAAS,QAAA,eAEhBV,KAAA,CAACX,MAAM;MACNsB,OAAO,EAAG,EAAI;MACdC,SAAS,EAAC,6CAA6C;MAAAF,QAAA,gBAEvDZ,IAAA,CAACP,wBAAwB;QAACe,GAAG,EAAGA;MAAK,CAAE,CAAC,eACxCR,IAAA,CAACH,eAAe;QAACkB,KAAK,EAAG3B,EAAE,CAAE,UAAW,CAAG;QAACoB,GAAG,EAAGA;MAAK,CAAE,CAAC,eAC1DR,IAAA,CAACF,oBAAoB;QACpBiB,KAAK,EAAG3B,EAAE,CAAE,YAAa,CAAG;QAC5BoB,GAAG,EAAGA;MAAK,CACX,CAAC;IAAA,CACK;EAAC,CACW,CAAC;AAExB","ignoreList":[]}
1
+ {"version":3,"names":["__","__experimentalVStack","VStack","StyleVariationsContainer","ColorVariations","TypographyVariations","jsx","_jsx","jsxs","_jsxs","SidebarNavigationScreenGlobalStylesContent","gap","spacing","className","children","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;;AAEtE;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,6CAA6C;AAClF,OAAOC,eAAe,MAAM,8CAA8C;AAC1E,OAAOC,oBAAoB,MAAM,mDAAmD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErF,eAAe,SAASC,0CAA0CA,CAAA,EAAG;EACpE,MAAMC,GAAG,GAAG,CAAC;EAEb,oBACCF,KAAA,CAACP,MAAM;IACNU,OAAO,EAAG,EAAI;IACdC,SAAS,EAAC,6CAA6C;IAAAC,QAAA,gBAEvDP,IAAA,CAACJ,wBAAwB;MAACQ,GAAG,EAAGA;IAAK,CAAE,CAAC,eACxCJ,IAAA,CAACH,eAAe;MAACW,KAAK,EAAGf,EAAE,CAAE,UAAW,CAAG;MAACW,GAAG,EAAGA;IAAK,CAAE,CAAC,eAC1DJ,IAAA,CAACF,oBAAoB;MAACU,KAAK,EAAGf,EAAE,CAAE,YAAa,CAAG;MAACW,GAAG,EAAGA;IAAK,CAAE,CAAC;EAAA,CAC1D,CAAC;AAEX","ignoreList":[]}
@@ -2,11 +2,11 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useSelect, useDispatch } from '@wordpress/data';
6
- import { store as coreStore } from '@wordpress/core-data';
5
+ import { useDispatch } from '@wordpress/data';
7
6
  import { useCallback } from '@wordpress/element';
8
7
  import { store as preferencesStore } from '@wordpress/preferences';
9
8
  import { privateApis as routerPrivateApis } from '@wordpress/router';
9
+ import { addQueryArgs } from '@wordpress/url';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
@@ -25,27 +25,17 @@ const {
25
25
  } = unlock(routerPrivateApis);
26
26
  export function SidebarNavigationItemGlobalStyles(props) {
27
27
  const {
28
- params
28
+ name
29
29
  } = useLocation();
30
- const hasGlobalStyleVariations = useSelect(select => !!select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
31
- if (hasGlobalStyleVariations) {
32
- return /*#__PURE__*/_jsx(SidebarNavigationItem, {
33
- ...props,
34
- params: {
35
- path: '/wp_global_styles'
36
- },
37
- uid: "global-styles-navigation-item",
38
- "aria-current": params.path && params.path.startsWith('/wp_global_styles')
39
- });
40
- }
41
30
  return /*#__PURE__*/_jsx(SidebarNavigationItem, {
42
- ...props
31
+ ...props,
32
+ "aria-current": name === 'styles'
43
33
  });
44
34
  }
45
35
  export default function SidebarNavigationScreenGlobalStyles() {
46
36
  const history = useHistory();
47
37
  const {
48
- params
38
+ path
49
39
  } = useLocation();
50
40
  const {
51
41
  revisions,
@@ -62,14 +52,13 @@ export default function SidebarNavigationScreenGlobalStyles() {
62
52
  set: setPreference
63
53
  } = useDispatch(preferencesStore);
64
54
  const openGlobalStyles = useCallback(async () => {
65
- history.push({
66
- ...params,
55
+ history.navigate(addQueryArgs(path, {
67
56
  canvas: 'edit'
68
- }, undefined, {
57
+ }), {
69
58
  transition: 'canvas-mode-edit-transition'
70
59
  });
71
60
  return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
72
- }, [history, params, openGeneralSidebar, setPreference]);
61
+ }, [path, history, openGeneralSidebar, setPreference]);
73
62
  const openRevisions = useCallback(async () => {
74
63
  await openGlobalStyles();
75
64
  // Open the global styles revisions once the canvas mode is set to edit,
@@ -1 +1 @@
1
- {"version":3,"names":["__","useSelect","useDispatch","store","coreStore","useCallback","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationItem","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","MainSidebarNavigationContent","jsx","_jsx","Fragment","_Fragment","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","revisionsCount","openGeneralSidebar","setEditorCanvasContainerView","set","setPreference","openGlobalStyles","push","canvas","undefined","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","children","title","isRoot","description","content","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,wBAAwB,MAAM,+DAA+D;AACpG,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,SAASC,4BAA4B,QAAQ,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAEjF,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGX,MAAM,CAAEF,iBAAkB,CAAC;AAE/D,OAAO,SAASc,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAChC,MAAMK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C,EACjDH,kBAAkB,CAAE,yBAA0B,CAAC,CAC9C,CAAC;EACJ,CAAC,EAAE,CAAEL,OAAO,EAAET,MAAM,EAAEc,kBAAkB,EAAEG,aAAa,CAAG,CAAC;EAE3D,MAAMQ,aAAa,GAAG5C,WAAW,CAAE,YAAY;IAC9C,MAAMqC,gBAAgB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACAH,4BAA4B,CAAE,yBAA0B,CAAC;EAC1D,CAAC,EAAE,CAAEG,gBAAgB,EAAEH,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMW,4BAA4B,GACjC,CAAC,CAAEb,cAAc,IAAI,CAAED,kBAAkB;EAE1C,oBACCnB,IAAA,CAAAE,SAAA;IAAAgC,QAAA,eACClC,IAAA,CAACR,uBAAuB;MACvB2C,KAAK,EAAGpD,EAAE,CAAE,QAAS,CAAG;MACxBqD,MAAM;MACNC,WAAW,EAAGtD,EAAE,CACf,kEACD,CAAG;MACHuD,OAAO,eACNtC,IAAA,CAACF,4BAA4B;QAACyC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLP,4BAA4B,iBAC3BjC,IAAA,CAACH,oCAAoC;QACpC4C,MAAM,EAAGxB,SAAS,GAAI,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjCsB,OAAO,EAAGV;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","useDispatch","useCallback","store","preferencesStore","privateApis","routerPrivateApis","addQueryArgs","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationItem","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","MainSidebarNavigationContent","jsx","_jsx","Fragment","_Fragment","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","name","SidebarNavigationScreenGlobalStyles","history","path","revisions","isLoading","isLoadingRevisions","revisionsCount","openGeneralSidebar","setEditorCanvasContainerView","set","setPreference","openGlobalStyles","navigate","canvas","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","children","title","isRoot","description","content","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA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AE,CAAC,EAAE;MAC3DC,UAAU,EAAE;IACb,CAAE,CAAC;IACH,OAAOC,OAAO,CAACC,GAAG,CAAE,CACnBN,aAAa,CAAE,MAAM,EAAE,iBAAiB,EAAE,KAAM,CAAC,EACjDH,kBAAkB,CAAE,yBAA0B,CAAC,CAC9C,CAAC;EACJ,CAAC,EAAE,CAAEL,IAAI,EAAED,OAAO,EAAEM,kBAAkB,EAAEG,aAAa,CAAG,CAAC;EAEzD,MAAMO,aAAa,GAAGvC,WAAW,CAAE,YAAY;IAC9C,MAAMiC,gBAAgB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACAH,4BAA4B,CAAE,yBAA0B,CAAC;EAC1D,CAAC,EAAE,CAAEG,gBAAgB,EAAEH,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMU,4BAA4B,GACjC,CAAC,CAAEZ,cAAc,IAAI,CAAED,kBAAkB;EAE1C,oBACCb,IAAA,CAAAE,SAAA;IAAAyB,QAAA,eACC3B,IAAA,CAACR,uBAAuB;MACvBoC,KAAK,EAAG5C,EAAE,CAAE,QAAS,CAAG;MACxB6C,MAAM;MACNC,WAAW,EAAG9C,EAAE,CACf,kEACD,CAAG;MACH+C,OAAO,eACN/B,IAAA,CAACF,4BAA4B;QAACkC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLP,4BAA4B,iBAC3B1B,IAAA,CAACH,oCAAoC;QACpCqC,MAAM,EAAGvB,SAAS,GAAI,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjCqB,OAAO,EAAGV;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
@@ -15,43 +15,35 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
15
15
  import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
16
16
  import { unlock } from '../../lock-unlock';
17
17
  import { store as editSiteStore } from '../../store';
18
- import { NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
19
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
19
  export function MainSidebarNavigationContent() {
21
20
  return /*#__PURE__*/_jsxs(ItemGroup, {
22
21
  children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
23
22
  uid: "navigation-navigation-item",
24
- params: {
25
- postType: NAVIGATION_POST_TYPE
26
- },
23
+ to: "/navigation",
27
24
  withChevron: true,
28
25
  icon: navigation,
29
26
  children: __('Navigation')
30
27
  }), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
31
- uid: "styles-navigation-item",
28
+ to: "/styles",
29
+ uid: "global-styles-navigation-item",
32
30
  icon: styles,
33
31
  children: __('Styles')
34
32
  }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
35
33
  uid: "page-navigation-item",
36
- params: {
37
- postType: 'page'
38
- },
34
+ to: "/page",
39
35
  withChevron: true,
40
36
  icon: page,
41
37
  children: __('Pages')
42
38
  }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
43
39
  uid: "template-navigation-item",
44
- params: {
45
- postType: TEMPLATE_POST_TYPE
46
- },
40
+ to: "/template",
47
41
  withChevron: true,
48
42
  icon: layout,
49
43
  children: __('Templates')
50
44
  }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
51
45
  uid: "patterns-navigation-item",
52
- params: {
53
- postType: PATTERN_TYPES.user
54
- },
46
+ to: "/pattern",
55
47
  withChevron: true,
56
48
  icon: symbol,
57
49
  children: __('Patterns')