@wordpress/edit-site 6.10.0 → 6.12.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 (516) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-post/index.js +1 -1
  3. package/build/components/add-new-post/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +1 -1
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/utils.js +8 -8
  7. package/build/components/add-new-template/utils.js.map +1 -1
  8. package/build/components/app/index.js +2 -2
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/use-editor-iframe-props.js +29 -22
  11. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  12. package/build/components/block-editor/use-site-editor-settings.js +10 -8
  13. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  14. package/build/components/editor/index.js +32 -14
  15. package/build/components/editor/index.js.map +1 -1
  16. package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
  17. package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  18. package/build/components/editor/use-editor-title.js +30 -13
  19. package/build/components/editor/use-editor-title.js.map +1 -1
  20. package/build/components/global-styles/font-sizes/font-size.js +6 -6
  21. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  22. package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -1
  23. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  24. package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
  25. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  26. package/build/components/global-styles/palette.js +16 -13
  27. package/build/components/global-styles/palette.js.map +1 -1
  28. package/build/components/global-styles/root-menu.js +0 -4
  29. package/build/components/global-styles/root-menu.js.map +1 -1
  30. package/build/components/global-styles/screen-block-list.js +0 -4
  31. package/build/components/global-styles/screen-block-list.js.map +1 -1
  32. package/build/components/global-styles/screen-css.js +1 -1
  33. package/build/components/global-styles/screen-css.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -24
  35. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  36. package/build/components/global-styles/screen-root.js +0 -3
  37. package/build/components/global-styles/screen-root.js.map +1 -1
  38. package/build/components/global-styles/screen-style-variations.js +5 -1
  39. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  40. package/build/components/global-styles/shadows-edit-panel.js +11 -13
  41. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  42. package/build/components/global-styles/shadows-panel.js +0 -3
  43. package/build/components/global-styles/shadows-panel.js.map +1 -1
  44. package/build/components/global-styles/typography-elements.js +1 -4
  45. package/build/components/global-styles/typography-elements.js.map +1 -1
  46. package/build/components/global-styles/ui.js +49 -2
  47. package/build/components/global-styles/ui.js.map +1 -1
  48. package/build/components/global-styles/variations/variation.js +2 -2
  49. package/build/components/global-styles/variations/variation.js.map +1 -1
  50. package/build/components/global-styles/variations/variations-panel.js +0 -1
  51. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  52. package/build/components/global-styles-renderer/index.js +6 -8
  53. package/build/components/global-styles-renderer/index.js.map +1 -1
  54. package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
  55. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  56. package/build/components/global-styles-sidebar/index.js +43 -30
  57. package/build/components/global-styles-sidebar/index.js.map +1 -1
  58. package/build/components/layout/animation.js +1 -3
  59. package/build/components/layout/animation.js.map +1 -1
  60. package/build/components/layout/hooks.js +1 -10
  61. package/build/components/layout/hooks.js.map +1 -1
  62. package/build/components/layout/index.js +23 -35
  63. package/build/components/layout/index.js.map +1 -1
  64. package/build/components/layout/router.js +17 -140
  65. package/build/components/layout/router.js.map +1 -1
  66. package/build/components/page-patterns/delete-category-menu-item.js +3 -3
  67. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  68. package/build/components/page-patterns/fields.js +3 -7
  69. package/build/components/page-patterns/fields.js.map +1 -1
  70. package/build/components/page-patterns/use-pattern-settings.js +1 -1
  71. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  72. package/build/components/page-templates/fields.js +1 -2
  73. package/build/components/page-templates/fields.js.map +1 -1
  74. package/build/components/page-templates/index.js +1 -2
  75. package/build/components/page-templates/index.js.map +1 -1
  76. package/build/components/pagination/index.js +1 -1
  77. package/build/components/pagination/index.js.map +1 -1
  78. package/build/components/post-edit/index.js +15 -5
  79. package/build/components/post-edit/index.js.map +1 -1
  80. package/build/components/post-fields/index.js +4 -244
  81. package/build/components/post-fields/index.js.map +1 -1
  82. package/build/components/post-list/index.js +12 -2
  83. package/build/components/post-list/index.js.map +1 -1
  84. package/build/components/posts-app/index.js.map +1 -1
  85. package/build/components/posts-app/router.js +4 -4
  86. package/build/components/posts-app/router.js.map +1 -1
  87. package/build/components/resizable-frame/index.js +21 -9
  88. package/build/components/resizable-frame/index.js.map +1 -1
  89. package/build/components/revisions/index.js +1 -1
  90. package/build/components/revisions/index.js.map +1 -1
  91. package/build/components/save-keyboard-shortcut/index.js +78 -0
  92. package/build/components/save-keyboard-shortcut/index.js.map +1 -0
  93. package/build/components/save-panel/index.js +17 -6
  94. package/build/components/save-panel/index.js.map +1 -1
  95. package/build/components/sidebar/index.js +11 -3
  96. package/build/components/sidebar/index.js.map +1 -1
  97. package/build/components/sidebar-dataviews/default-views.js +2 -5
  98. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  99. package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
  100. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  101. package/build/components/sidebar-navigation-screen/index.js +2 -1
  102. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-global-styles/index.js +33 -71
  104. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  105. package/build/components/sidebar-navigation-screen-main/index.js +43 -42
  106. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  108. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  109. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
  110. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  111. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
  112. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  113. package/build/components/site-editor-routes/home-edit.js +26 -0
  114. package/build/components/site-editor-routes/home-edit.js.map +1 -0
  115. package/build/components/site-editor-routes/home-view.js +25 -0
  116. package/build/components/site-editor-routes/home-view.js.map +1 -0
  117. package/build/components/site-editor-routes/index.js +49 -0
  118. package/build/components/site-editor-routes/index.js.map +1 -0
  119. package/build/components/site-editor-routes/navigation-edit.js +29 -0
  120. package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
  121. package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
  122. package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  123. package/build/components/site-editor-routes/navigation-item-view.js +30 -0
  124. package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
  125. package/build/components/site-editor-routes/navigation-view.js +28 -0
  126. package/build/components/site-editor-routes/navigation-view.js.map +1 -0
  127. package/build/components/site-editor-routes/pages-edit.js +43 -0
  128. package/build/components/site-editor-routes/pages-edit.js.map +1 -0
  129. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
  130. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  131. package/build/components/site-editor-routes/pages-list-view.js +47 -0
  132. package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
  133. package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
  134. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  135. package/build/components/site-editor-routes/pages-view.js +42 -0
  136. package/build/components/site-editor-routes/pages-view.js.map +1 -0
  137. package/build/components/site-editor-routes/patterns-edit.js +31 -0
  138. package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
  139. package/build/components/site-editor-routes/patterns-view.js +29 -0
  140. package/build/components/site-editor-routes/patterns-view.js.map +1 -0
  141. package/build/components/site-editor-routes/styles-edit.js +33 -0
  142. package/build/components/site-editor-routes/styles-edit.js.map +1 -0
  143. package/build/components/site-editor-routes/styles-view.js +33 -0
  144. package/build/components/site-editor-routes/styles-view.js.map +1 -0
  145. package/build/components/site-editor-routes/templates-edit.js +31 -0
  146. package/build/components/site-editor-routes/templates-edit.js.map +1 -0
  147. package/build/components/site-editor-routes/templates-list-view.js +34 -0
  148. package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
  149. package/build/components/site-editor-routes/templates-view.js +29 -0
  150. package/build/components/site-editor-routes/templates-view.js.map +1 -0
  151. package/build/components/site-hub/index.js +22 -8
  152. package/build/components/site-hub/index.js.map +1 -1
  153. package/build/components/style-book/color-examples.js +46 -0
  154. package/build/components/style-book/color-examples.js.map +1 -0
  155. package/build/components/style-book/constants.js +85 -13
  156. package/build/components/style-book/constants.js.map +1 -1
  157. package/build/components/style-book/duotone-examples.js +55 -0
  158. package/build/components/style-book/duotone-examples.js.map +1 -0
  159. package/build/components/style-book/examples.js +116 -3
  160. package/build/components/style-book/examples.js.map +1 -1
  161. package/build/components/style-book/index.js +161 -46
  162. package/build/components/style-book/index.js.map +1 -1
  163. package/build/components/style-book/types.js.map +1 -1
  164. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +38 -33
  165. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  166. package/build/components/welcome-guide/index.js +4 -2
  167. package/build/components/welcome-guide/index.js.map +1 -1
  168. package/build/components/welcome-guide/page.js +1 -9
  169. package/build/components/welcome-guide/page.js.map +1 -1
  170. package/build/components/welcome-guide/template.js +1 -12
  171. package/build/components/welcome-guide/template.js.map +1 -1
  172. package/build/hooks/commands/use-common-commands.js +61 -45
  173. package/build/hooks/commands/use-common-commands.js.map +1 -1
  174. package/build/hooks/commands/use-set-command-context.js +12 -15
  175. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  176. package/build/index.js +1 -0
  177. package/build/index.js.map +1 -1
  178. package/build/posts.js +1 -0
  179. package/build/posts.js.map +1 -1
  180. package/build/store/private-actions.js +8 -60
  181. package/build/store/private-actions.js.map +1 -1
  182. package/build/store/private-selectors.js +4 -12
  183. package/build/store/private-selectors.js.map +1 -1
  184. package/build/store/reducer.js +9 -18
  185. package/build/store/reducer.js.map +1 -1
  186. package/build-module/components/add-new-post/index.js +1 -1
  187. package/build-module/components/add-new-post/index.js.map +1 -1
  188. package/build-module/components/add-new-template/index.js +1 -1
  189. package/build-module/components/add-new-template/index.js.map +1 -1
  190. package/build-module/components/add-new-template/utils.js +9 -9
  191. package/build-module/components/add-new-template/utils.js.map +1 -1
  192. package/build-module/components/app/index.js +4 -4
  193. package/build-module/components/app/index.js.map +1 -1
  194. package/build-module/components/block-editor/use-editor-iframe-props.js +30 -23
  195. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  196. package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
  197. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  198. package/build-module/components/editor/index.js +32 -14
  199. package/build-module/components/editor/index.js.map +1 -1
  200. package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
  201. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
  202. package/build-module/components/editor/use-editor-title.js +31 -14
  203. package/build-module/components/editor/use-editor-title.js.map +1 -1
  204. package/build-module/components/global-styles/font-sizes/font-size.js +6 -6
  205. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  206. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -1
  207. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
  208. package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -4
  209. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  210. package/build-module/components/global-styles/palette.js +17 -14
  211. package/build-module/components/global-styles/palette.js.map +1 -1
  212. package/build-module/components/global-styles/root-menu.js +0 -4
  213. package/build-module/components/global-styles/root-menu.js.map +1 -1
  214. package/build-module/components/global-styles/screen-block-list.js +0 -4
  215. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  216. package/build-module/components/global-styles/screen-css.js +1 -1
  217. package/build-module/components/global-styles/screen-css.js.map +1 -1
  218. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -25
  219. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  220. package/build-module/components/global-styles/screen-root.js +0 -3
  221. package/build-module/components/global-styles/screen-root.js.map +1 -1
  222. package/build-module/components/global-styles/screen-style-variations.js +5 -1
  223. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  224. package/build-module/components/global-styles/shadows-edit-panel.js +11 -13
  225. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  226. package/build-module/components/global-styles/shadows-panel.js +0 -3
  227. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  228. package/build-module/components/global-styles/typography-elements.js +2 -5
  229. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  230. package/build-module/components/global-styles/ui.js +50 -3
  231. package/build-module/components/global-styles/ui.js.map +1 -1
  232. package/build-module/components/global-styles/variations/variation.js +3 -3
  233. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  234. package/build-module/components/global-styles/variations/variations-panel.js +0 -1
  235. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  236. package/build-module/components/global-styles-renderer/index.js +6 -8
  237. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  238. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -1
  239. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  240. package/build-module/components/global-styles-sidebar/index.js +44 -31
  241. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  242. package/build-module/components/layout/animation.js +1 -3
  243. package/build-module/components/layout/animation.js.map +1 -1
  244. package/build-module/components/layout/hooks.js +1 -9
  245. package/build-module/components/layout/hooks.js.map +1 -1
  246. package/build-module/components/layout/index.js +23 -35
  247. package/build-module/components/layout/index.js.map +1 -1
  248. package/build-module/components/layout/router.js +17 -139
  249. package/build-module/components/layout/router.js.map +1 -1
  250. package/build-module/components/page-patterns/delete-category-menu-item.js +4 -4
  251. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  252. package/build-module/components/page-patterns/fields.js +4 -8
  253. package/build-module/components/page-patterns/fields.js.map +1 -1
  254. package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
  255. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  256. package/build-module/components/page-templates/fields.js +1 -2
  257. package/build-module/components/page-templates/fields.js.map +1 -1
  258. package/build-module/components/page-templates/index.js +1 -2
  259. package/build-module/components/page-templates/index.js.map +1 -1
  260. package/build-module/components/pagination/index.js +1 -1
  261. package/build-module/components/pagination/index.js.map +1 -1
  262. package/build-module/components/post-edit/index.js +15 -5
  263. package/build-module/components/post-edit/index.js.map +1 -1
  264. package/build-module/components/post-fields/index.js +7 -246
  265. package/build-module/components/post-fields/index.js.map +1 -1
  266. package/build-module/components/post-list/index.js +12 -2
  267. package/build-module/components/post-list/index.js.map +1 -1
  268. package/build-module/components/posts-app/index.js +2 -2
  269. package/build-module/components/posts-app/index.js.map +1 -1
  270. package/build-module/components/posts-app/router.js +3 -3
  271. package/build-module/components/posts-app/router.js.map +1 -1
  272. package/build-module/components/resizable-frame/index.js +21 -10
  273. package/build-module/components/resizable-frame/index.js.map +1 -1
  274. package/build-module/components/revisions/index.js +1 -1
  275. package/build-module/components/revisions/index.js.map +1 -1
  276. package/build-module/components/save-keyboard-shortcut/index.js +71 -0
  277. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
  278. package/build-module/components/save-panel/index.js +17 -6
  279. package/build-module/components/save-panel/index.js.map +1 -1
  280. package/build-module/components/sidebar/index.js +11 -3
  281. package/build-module/components/sidebar/index.js.map +1 -1
  282. package/build-module/components/sidebar-dataviews/default-views.js +2 -5
  283. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  284. package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
  285. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  286. package/build-module/components/sidebar-navigation-screen/index.js +2 -1
  287. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  288. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +34 -72
  289. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
  291. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  293. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  295. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
  297. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  298. package/build-module/components/site-editor-routes/home-edit.js +18 -0
  299. package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
  300. package/build-module/components/site-editor-routes/home-view.js +17 -0
  301. package/build-module/components/site-editor-routes/home-view.js.map +1 -0
  302. package/build-module/components/site-editor-routes/index.js +42 -0
  303. package/build-module/components/site-editor-routes/index.js.map +1 -0
  304. package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
  305. package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
  306. package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
  307. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
  308. package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
  309. package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
  310. package/build-module/components/site-editor-routes/navigation-view.js +20 -0
  311. package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
  312. package/build-module/components/site-editor-routes/pages-edit.js +35 -0
  313. package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
  314. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  315. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
  316. package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
  317. package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
  318. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  319. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
  320. package/build-module/components/site-editor-routes/pages-view.js +34 -0
  321. package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
  322. package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
  323. package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
  324. package/build-module/components/site-editor-routes/patterns-view.js +21 -0
  325. package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
  326. package/build-module/components/site-editor-routes/styles-edit.js +25 -0
  327. package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
  328. package/build-module/components/site-editor-routes/styles-view.js +25 -0
  329. package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
  330. package/build-module/components/site-editor-routes/templates-edit.js +23 -0
  331. package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
  332. package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
  333. package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
  334. package/build-module/components/site-editor-routes/templates-view.js +21 -0
  335. package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
  336. package/build-module/components/site-hub/index.js +22 -8
  337. package/build-module/components/site-hub/index.js.map +1 -1
  338. package/build-module/components/style-book/color-examples.js +38 -0
  339. package/build-module/components/style-book/color-examples.js.map +1 -0
  340. package/build-module/components/style-book/constants.js +84 -12
  341. package/build-module/components/style-book/constants.js.map +1 -1
  342. package/build-module/components/style-book/duotone-examples.js +48 -0
  343. package/build-module/components/style-book/duotone-examples.js.map +1 -0
  344. package/build-module/components/style-book/examples.js +117 -3
  345. package/build-module/components/style-book/examples.js.map +1 -1
  346. package/build-module/components/style-book/index.js +164 -49
  347. package/build-module/components/style-book/index.js.map +1 -1
  348. package/build-module/components/style-book/types.js.map +1 -1
  349. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +38 -33
  350. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  351. package/build-module/components/welcome-guide/index.js +4 -2
  352. package/build-module/components/welcome-guide/index.js.map +1 -1
  353. package/build-module/components/welcome-guide/page.js +1 -9
  354. package/build-module/components/welcome-guide/page.js.map +1 -1
  355. package/build-module/components/welcome-guide/template.js +1 -11
  356. package/build-module/components/welcome-guide/template.js.map +1 -1
  357. package/build-module/hooks/commands/use-common-commands.js +61 -45
  358. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  359. package/build-module/hooks/commands/use-set-command-context.js +12 -15
  360. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  361. package/build-module/index.js +1 -0
  362. package/build-module/index.js.map +1 -1
  363. package/build-module/posts.js +1 -0
  364. package/build-module/posts.js.map +1 -1
  365. package/build-module/store/private-actions.js +6 -58
  366. package/build-module/store/private-actions.js.map +1 -1
  367. package/build-module/store/private-selectors.js +3 -11
  368. package/build-module/store/private-selectors.js.map +1 -1
  369. package/build-module/store/reducer.js +9 -18
  370. package/build-module/store/reducer.js.map +1 -1
  371. package/build-style/posts-rtl.css +60 -14
  372. package/build-style/posts.css +60 -14
  373. package/build-style/style-rtl.css +232 -50
  374. package/build-style/style.css +232 -50
  375. package/package.json +42 -41
  376. package/src/components/add-new-post/index.js +1 -1
  377. package/src/components/add-new-template/index.js +1 -1
  378. package/src/components/add-new-template/utils.js +12 -9
  379. package/src/components/app/index.js +4 -4
  380. package/src/components/block-editor/use-editor-iframe-props.js +23 -20
  381. package/src/components/block-editor/use-site-editor-settings.js +12 -10
  382. package/src/components/editor/index.js +50 -17
  383. package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
  384. package/src/components/editor/use-editor-title.js +40 -16
  385. package/src/components/editor-canvas-container/style.scss +0 -1
  386. package/src/components/global-styles/font-sizes/font-size.js +11 -15
  387. package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
  388. package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
  389. package/src/components/global-styles/palette.js +21 -18
  390. package/src/components/global-styles/root-menu.js +3 -16
  391. package/src/components/global-styles/screen-block-list.js +0 -7
  392. package/src/components/global-styles/screen-css.js +1 -0
  393. package/src/components/global-styles/screen-revisions/revisions-buttons.js +30 -33
  394. package/src/components/global-styles/screen-revisions/style.scss +11 -17
  395. package/src/components/global-styles/screen-root.js +3 -12
  396. package/src/components/global-styles/screen-style-variations.js +4 -1
  397. package/src/components/global-styles/shadows-edit-panel.js +16 -15
  398. package/src/components/global-styles/shadows-panel.js +0 -4
  399. package/src/components/global-styles/typography-elements.js +3 -11
  400. package/src/components/global-styles/ui.js +53 -2
  401. package/src/components/global-styles/variations/variation.js +3 -3
  402. package/src/components/global-styles/variations/variations-panel.js +0 -1
  403. package/src/components/global-styles-renderer/index.js +4 -10
  404. package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
  405. package/src/components/global-styles-sidebar/index.js +86 -65
  406. package/src/components/global-styles-sidebar/style.scss +6 -0
  407. package/src/components/layout/animation.js +0 -1
  408. package/src/components/layout/hooks.js +1 -7
  409. package/src/components/layout/index.js +22 -35
  410. package/src/components/layout/router.js +18 -133
  411. package/src/components/layout/style.scss +2 -2
  412. package/src/components/page-patterns/delete-category-menu-item.js +4 -4
  413. package/src/components/page-patterns/fields.js +6 -12
  414. package/src/components/page-patterns/style.scss +0 -5
  415. package/src/components/page-patterns/use-pattern-settings.js +1 -1
  416. package/src/components/page-templates/fields.js +2 -3
  417. package/src/components/page-templates/index.js +0 -1
  418. package/src/components/pagination/index.js +1 -1
  419. package/src/components/post-edit/index.js +45 -6
  420. package/src/components/post-edit/style.scss +7 -0
  421. package/src/components/post-fields/index.js +22 -323
  422. package/src/components/post-fields/style.scss +3 -0
  423. package/src/components/post-list/index.js +10 -4
  424. package/src/components/post-list/style.scss +30 -4
  425. package/src/components/posts-app/index.js +2 -2
  426. package/src/components/posts-app/router.js +3 -3
  427. package/src/components/resizable-frame/index.js +19 -10
  428. package/src/components/revisions/index.js +4 -1
  429. package/src/components/save-keyboard-shortcut/index.js +69 -0
  430. package/src/components/save-panel/index.js +30 -32
  431. package/src/components/sidebar/index.js +23 -7
  432. package/src/components/sidebar-dataviews/default-views.js +2 -5
  433. package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
  434. package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
  435. package/src/components/sidebar-navigation-item/style.scss +2 -2
  436. package/src/components/sidebar-navigation-screen/index.js +2 -1
  437. package/src/components/sidebar-navigation-screen-global-styles/index.js +42 -99
  438. package/src/components/sidebar-navigation-screen-main/index.js +46 -45
  439. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  440. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
  441. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
  442. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
  443. package/src/components/site-editor-routes/README.md +20 -0
  444. package/src/components/site-editor-routes/home-edit.js +17 -0
  445. package/src/components/site-editor-routes/home-view.js +16 -0
  446. package/src/components/site-editor-routes/index.js +60 -0
  447. package/src/components/site-editor-routes/navigation-edit.js +22 -0
  448. package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
  449. package/src/components/site-editor-routes/navigation-item-view.js +25 -0
  450. package/src/components/site-editor-routes/navigation-view.js +21 -0
  451. package/src/components/site-editor-routes/pages-edit.js +35 -0
  452. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
  453. package/src/components/site-editor-routes/pages-list-view.js +44 -0
  454. package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
  455. package/src/components/site-editor-routes/pages-view.js +39 -0
  456. package/src/components/site-editor-routes/patterns-edit.js +24 -0
  457. package/src/components/site-editor-routes/patterns-view.js +22 -0
  458. package/src/components/site-editor-routes/styles-edit.js +26 -0
  459. package/src/components/site-editor-routes/styles-view.js +26 -0
  460. package/src/components/site-editor-routes/templates-edit.js +22 -0
  461. package/src/components/site-editor-routes/templates-list-view.js +28 -0
  462. package/src/components/site-editor-routes/templates-view.js +22 -0
  463. package/src/components/site-hub/index.js +35 -18
  464. package/src/components/site-hub/style.scss +4 -0
  465. package/src/components/site-icon/style.scss +16 -0
  466. package/src/components/style-book/color-examples.tsx +44 -0
  467. package/src/components/style-book/constants.ts +94 -13
  468. package/src/components/style-book/duotone-examples.tsx +53 -0
  469. package/src/components/style-book/examples.tsx +217 -0
  470. package/src/components/style-book/index.js +235 -60
  471. package/src/components/style-book/style.scss +12 -14
  472. package/src/components/style-book/test/categories.js +0 -5
  473. package/src/components/style-book/types.ts +34 -1
  474. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +65 -65
  475. package/src/components/welcome-guide/index.js +3 -3
  476. package/src/components/welcome-guide/page.js +1 -7
  477. package/src/components/welcome-guide/template.js +1 -8
  478. package/src/hooks/commands/use-common-commands.js +257 -230
  479. package/src/hooks/commands/use-set-command-context.js +7 -9
  480. package/src/index.js +1 -0
  481. package/src/posts.js +1 -0
  482. package/src/store/private-actions.js +7 -79
  483. package/src/store/private-selectors.js +4 -11
  484. package/src/store/reducer.js +10 -18
  485. package/src/style.scss +3 -1
  486. package/build/components/async/index.js +0 -51
  487. package/build/components/async/index.js.map +0 -1
  488. package/build/components/keyboard-shortcuts/global.js +0 -53
  489. package/build/components/keyboard-shortcuts/global.js.map +0 -1
  490. package/build/components/keyboard-shortcuts/register.js +0 -34
  491. package/build/components/keyboard-shortcuts/register.js.map +0 -1
  492. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
  493. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  494. package/build/components/use-edited-entity-record/index.js +0 -60
  495. package/build/components/use-edited-entity-record/index.js.map +0 -1
  496. package/build/hooks/commands/use-edit-mode-commands.js +0 -175
  497. package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
  498. package/build-module/components/async/index.js +0 -44
  499. package/build-module/components/async/index.js.map +0 -1
  500. package/build-module/components/keyboard-shortcuts/global.js +0 -46
  501. package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
  502. package/build-module/components/keyboard-shortcuts/register.js +0 -27
  503. package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
  504. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
  505. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
  506. package/build-module/components/use-edited-entity-record/index.js +0 -53
  507. package/build-module/components/use-edited-entity-record/index.js.map +0 -1
  508. package/build-module/hooks/commands/use-edit-mode-commands.js +0 -167
  509. package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
  510. package/src/components/async/index.js +0 -43
  511. package/src/components/keyboard-shortcuts/global.js +0 -47
  512. package/src/components/keyboard-shortcuts/register.js +0 -27
  513. package/src/components/style-book/examples.ts +0 -63
  514. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
  515. package/src/components/use-edited-entity-record/index.js +0 -58
  516. package/src/hooks/commands/use-edit-mode-commands.js +0 -172
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = GlobalStylesUIWrapper;
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _element = require("@wordpress/element");
10
+ var _router = require("@wordpress/router");
11
+ var _compose = require("@wordpress/compose");
12
+ var _components = require("@wordpress/components");
13
+ var _ui = _interopRequireDefault(require("../global-styles/ui"));
14
+ var _page = _interopRequireDefault(require("../page"));
15
+ var _lockUnlock = require("../../lock-unlock");
16
+ var _styleBook = _interopRequireDefault(require("../style-book"));
17
+ var _constants = require("../style-book/constants");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ /**
20
+ * WordPress dependencies
21
+ */
22
+
23
+ /**
24
+ * Internal dependencies
25
+ */
26
+
27
+ const {
28
+ useLocation,
29
+ useHistory
30
+ } = (0, _lockUnlock.unlock)(_router.privateApis);
31
+ const {
32
+ Menu
33
+ } = (0, _lockUnlock.unlock)(_components.privateApis);
34
+ const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
35
+ const GlobalStylesPageActions = ({
36
+ isStyleBookOpened,
37
+ setIsStyleBookOpened
38
+ }) => {
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu, {
40
+ trigger: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
41
+ __next40pxDefaultSize: true,
42
+ variant: "tertiary",
43
+ size: "compact",
44
+ children: (0, _i18n.__)('Preview')
45
+ }),
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu.RadioItem, {
47
+ value: true,
48
+ checked: isStyleBookOpened,
49
+ name: "styles-preview-actions",
50
+ onChange: () => setIsStyleBookOpened(true),
51
+ defaultChecked: true,
52
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemLabel, {
53
+ children: (0, _i18n.__)('Style book')
54
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
55
+ children: (0, _i18n.__)('Preview blocks and styles.')
56
+ })]
57
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu.RadioItem, {
58
+ value: false,
59
+ checked: !isStyleBookOpened,
60
+ name: "styles-preview-actions",
61
+ onChange: () => setIsStyleBookOpened(false),
62
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemLabel, {
63
+ children: (0, _i18n.__)('Site')
64
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
65
+ children: (0, _i18n.__)('Preview your site.')
66
+ })]
67
+ })]
68
+ });
69
+ };
70
+ function GlobalStylesUIWrapper() {
71
+ const {
72
+ params
73
+ } = useLocation();
74
+ const history = useHistory();
75
+ const {
76
+ canvas = 'view'
77
+ } = params;
78
+ const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(false);
79
+ const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
80
+ const pathWithPrefix = params.path;
81
+ const [path, onPathChange] = (0, _element.useMemo)(() => {
82
+ const processedPath = pathWithPrefix.substring(GLOBAL_STYLES_PATH_PREFIX.length);
83
+ return [processedPath ? processedPath : '/', newPath => {
84
+ history.push({
85
+ path: !newPath || newPath === '/' ? GLOBAL_STYLES_PATH_PREFIX : `${GLOBAL_STYLES_PATH_PREFIX}${newPath}`
86
+ });
87
+ }];
88
+ }, [pathWithPrefix, history]);
89
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
90
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
91
+ actions: !isMobileViewport ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesPageActions, {
92
+ isStyleBookOpened: isStyleBookOpened,
93
+ setIsStyleBookOpened: setIsStyleBookOpened
94
+ }) : null,
95
+ className: "edit-site-styles",
96
+ title: (0, _i18n.__)('Styles'),
97
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.default, {
98
+ path: path,
99
+ onPathChange: onPathChange
100
+ })
101
+ }), canvas === 'view' && isStyleBookOpened && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.default, {
102
+ enableResizing: false,
103
+ showCloseButton: false,
104
+ showTabs: false,
105
+ isSelected: blockName =>
106
+ // Match '/blocks/core%2Fbutton' and
107
+ // '/blocks/core%2Fbutton/typography', but not
108
+ // '/blocks/core%2Fbuttons'.
109
+ path === `/wp_global_styles/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/wp_global_styles/blocks/${encodeURIComponent(blockName)}/`),
110
+ path: path,
111
+ onSelect: blockName => {
112
+ if (_constants.STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
113
+ // Go to color palettes Global Styles.
114
+ onPathChange('/colors/palette');
115
+ return;
116
+ }
117
+ if (blockName === 'typography') {
118
+ // Go to typography Global Styles.
119
+ onPathChange('/typography');
120
+ return;
121
+ }
122
+
123
+ // Now go to the selected block.
124
+ onPathChange(`/blocks/${encodeURIComponent(blockName)}`);
125
+ }
126
+ })]
127
+ });
128
+ }
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_ui","_interopRequireDefault","_page","_lockUnlock","_styleBook","_constants","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","Menu","componentsPrivateApis","GLOBAL_STYLES_PATH_PREFIX","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","jsxs","trigger","jsx","Button","__next40pxDefaultSize","variant","size","children","__","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","params","history","canvas","useState","isMobileViewport","useViewportMatch","pathWithPrefix","path","onPathChange","useMemo","processedPath","substring","length","newPath","push","Fragment","default","actions","className","title","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","STYLE_BOOK_COLOR_GROUPS","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\nconst GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = params;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst pathWithPrefix = params.path;\n\tconst [ path, onPathChange ] = useMemo( () => {\n\t\tconst processedPath = pathWithPrefix.substring(\n\t\t\tGLOBAL_STYLES_PATH_PREFIX.length\n\t\t);\n\t\treturn [\n\t\t\tprocessedPath ? processedPath : '/',\n\t\t\t( newPath ) => {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath:\n\t\t\t\t\t\t! newPath || newPath === '/'\n\t\t\t\t\t\t\t? GLOBAL_STYLES_PATH_PREFIX\n\t\t\t\t\t\t\t: `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,\n\t\t\t\t} );\n\t\t\t},\n\t\t];\n\t}, [ pathWithPrefix, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI path={ path } onPathChange={ onPathChange } />\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tpath ===\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }` ||\n\t\t\t\t\t\tpath.startsWith(\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now 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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAQA,IAAAK,GAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,KAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAH,sBAAA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AC7B;QACD;;QAEA;QACAA,YAAY,CACX,WAAYiB,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -97,7 +97,8 @@ function SidebarNavigationScreen({
97
97
  color: '#e0e0e0' /* $gray-200 */,
98
98
  level: 1,
99
99
  size: 20,
100
- children: !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)('Previewing %1$s: %2$s', previewingThemeName, title)
100
+ children: !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)(/* translators: 1: theme name. 2: title */
101
+ (0, _i18n.__)('Previewing %1$s: %2$s'), previewingThemeName, title)
101
102
  }), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
102
103
  className: "edit-site-sidebar-navigation-screen__actions",
103
104
  children: actions
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AAIA,IAAAY,QAAA,GAAAZ,OAAA;AAAsD,IAAAa,WAAA,GAAAb,OAAA;AA9BtD;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;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CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_icons","_coreData","_data","_router","_element","_store","_lockUnlock","_sidebarButton","_isPreviewingTheme","_sidebar","_jsxRuntime","useHistory","useLocation","unlock","routerPrivateApis","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","previewingThemeName","useSelect","select","getSettings","editSiteStore","currentlyPreviewingThemeId","currentlyPreviewingTheme","__experimentalDashboardLink","__experimentalDashboardLinkText","coreStore","getTheme","name","rendered","undefined","location","history","navigate","useContext","SidebarNavigationContext","state","icon","isRTL","chevronRight","chevronLeft","jsxs","Fragment","children","__experimentalVStack","className","clsx","spacing","justify","__experimentalHStack","alignment","jsx","default","onClick","push","label","__","showTooltip","href","__experimentalHeading","color","level","size","isPreviewingTheme","sprintf"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\tdashboardLinkText:\n\t\t\t\t\tgetSettings().__experimentalDashboardLinkText,\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { navigate } = useContext( SidebarNavigationContext );\n\tconst backPath = backPathProp ?? location.state?.backPath;\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ clsx( 'edit-site-sidebar-navigation-screen__main', {\n\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t} ) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( backPath );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: theme name. 2: title */\n\t\t\t\t\t\t\t\t\t__( 'Previewing %1$s: %2$s' ),\n\t\t\t\t\t\t\t\t\tpreviewingThemeName,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAA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AG,SAAS,CAAC,eAAiB;UACnCC,KAAK,EAAG,CAAG;UACXC,IAAI,EAAG,EAAI;UAAAnB,QAAA,EAET,CAAE,IAAAoB,oCAAiB,EAAC,CAAC,GACpBxD,KAAK,GACL,IAAAyD,aAAO,EACP;UACA,IAAAR,QAAE,EAAE,uBAAwB,CAAC,EAC7BvC,mBAAmB,EACnBV,KACA;QAAC,CACI,CAAC,EACRC,OAAO,iBACR,IAAAR,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,8CAA8C;UAAAF,QAAA,EAC1DnC;QAAO,CACL,CACL;MAAA,CACM,CAAC,EACPC,IAAI,iBACL,IAAAT,WAAA,CAAAmD,GAAA,EAAAnD,WAAA,CAAA0C,QAAA;QAAAC,QAAA,eACC,IAAA3C,WAAA,CAAAmD,GAAA;UAAKN,SAAS,EAAC,2CAA2C;UAAAF,QAAA,EACvDlC;QAAI,CACF;MAAC,CACL,CACF,eAED,IAAAT,WAAA,CAAAyC,IAAA;QAAKI,SAAS,EAAC,8CAA8C;QAAAF,QAAA,GAC1D/B,WAAW,iBACZ,IAAAZ,WAAA,CAAAmD,GAAA;UAAGN,SAAS,EAAC,kDAAkD;UAAAF,QAAA,EAC5D/B;QAAW,CACX,CACH,EACCF,OAAO;MAAA,CACL,CAAC;IAAA,CACC,CAAC,EACPC,MAAM,iBACP,IAAAX,WAAA,CAAAmD,GAAA;MAAQN,SAAS,EAAC,6CAA6C;MAAAF,QAAA,EAC5DhC;IAAM,CACD,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -7,22 +7,18 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.SidebarNavigationItemGlobalStyles = SidebarNavigationItemGlobalStyles;
8
8
  exports.default = SidebarNavigationScreenGlobalStyles;
9
9
  var _i18n = require("@wordpress/i18n");
10
- var _icons = require("@wordpress/icons");
11
10
  var _data = require("@wordpress/data");
12
11
  var _coreData = require("@wordpress/core-data");
13
- var _compose = require("@wordpress/compose");
14
12
  var _element = require("@wordpress/element");
15
- var _editor = require("@wordpress/editor");
16
13
  var _preferences = require("@wordpress/preferences");
14
+ var _router = require("@wordpress/router");
17
15
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
18
16
  var _lockUnlock = require("../../lock-unlock");
19
17
  var _store = require("../../store");
20
- var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
21
18
  var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
22
- var _styleBook = _interopRequireDefault(require("../style-book"));
23
19
  var _useGlobalStylesRevisions = _interopRequireDefault(require("../global-styles/screen-revisions/use-global-styles-revisions"));
24
20
  var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../sidebar-navigation-screen-details-footer"));
25
- var _content = _interopRequireDefault(require("./content"));
21
+ var _sidebarNavigationScreenMain = require("../sidebar-navigation-screen-main");
26
22
  var _jsxRuntime = require("react/jsx-runtime");
27
23
  /**
28
24
  * WordPress dependencies
@@ -32,13 +28,14 @@ var _jsxRuntime = require("react/jsx-runtime");
32
28
  * Internal dependencies
33
29
  */
34
30
 
31
+ const {
32
+ useLocation,
33
+ useHistory
34
+ } = (0, _lockUnlock.unlock)(_router.privateApis);
35
35
  function SidebarNavigationItemGlobalStyles(props) {
36
36
  const {
37
- openGeneralSidebar
38
- } = (0, _data.useDispatch)(_store.store);
39
- const {
40
- setCanvasMode
41
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
37
+ params
38
+ } = useLocation();
42
39
  const hasGlobalStyleVariations = (0, _data.useSelect)(select => !!select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
43
40
  if (hasGlobalStyleVariations) {
44
41
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
@@ -46,22 +43,19 @@ function SidebarNavigationItemGlobalStyles(props) {
46
43
  params: {
47
44
  path: '/wp_global_styles'
48
45
  },
49
- uid: "global-styles-navigation-item"
46
+ uid: "global-styles-navigation-item",
47
+ "aria-current": params.path && params.path.startsWith('/wp_global_styles')
50
48
  });
51
49
  }
52
50
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
53
- ...props,
54
- onClick: () => {
55
- // Switch to edit mode.
56
- setCanvasMode('edit');
57
- // Open global styles sidebar.
58
- openGeneralSidebar('edit-site/global-styles');
59
- }
51
+ ...props
60
52
  });
61
53
  }
62
- function SidebarNavigationScreenGlobalStyles({
63
- backPath
64
- }) {
54
+ function SidebarNavigationScreenGlobalStyles() {
55
+ const history = useHistory();
56
+ const {
57
+ params
58
+ } = useLocation();
65
59
  const {
66
60
  revisions,
67
61
  isLoading: isLoadingRevisions
@@ -70,23 +64,12 @@ function SidebarNavigationScreenGlobalStyles({
70
64
  openGeneralSidebar
71
65
  } = (0, _data.useDispatch)(_store.store);
72
66
  const {
73
- setIsListViewOpened
74
- } = (0, _data.useDispatch)(_editor.store);
75
- const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
76
- const {
77
- setCanvasMode,
78
67
  setEditorCanvasContainerView
79
68
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
80
69
  const {
81
- isViewMode,
82
- isStyleBookOpened,
83
70
  revisionsCount
84
71
  } = (0, _data.useSelect)(select => {
85
72
  var _globalStyles$_links$;
86
- const {
87
- getCanvasMode,
88
- getEditorCanvasContainerView
89
- } = (0, _lockUnlock.unlock)(select(_store.store));
90
73
  const {
91
74
  getEntityRecord,
92
75
  __experimentalGetCurrentGlobalStylesId
@@ -94,8 +77,6 @@ function SidebarNavigationScreenGlobalStyles({
94
77
  const globalStylesId = __experimentalGetCurrentGlobalStylesId();
95
78
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
96
79
  return {
97
- isViewMode: 'view' === getCanvasMode(),
98
- isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
99
80
  revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
100
81
  };
101
82
  }, []);
@@ -103,16 +84,14 @@ function SidebarNavigationScreenGlobalStyles({
103
84
  set: setPreference
104
85
  } = (0, _data.useDispatch)(_preferences.store);
105
86
  const openGlobalStyles = (0, _element.useCallback)(async () => {
106
- return Promise.all([setPreference('core', 'distractionFree', false), setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]);
107
- }, [setCanvasMode, openGeneralSidebar, setPreference]);
108
- const openStyleBook = (0, _element.useCallback)(async () => {
109
- await openGlobalStyles();
110
- // Open the Style Book once the canvas mode is set to edit,
111
- // and the global styles sidebar is open. This ensures that
112
- // the Style Book is not prematurely closed.
113
- setEditorCanvasContainerView('style-book');
114
- setIsListViewOpened(false);
115
- }, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]);
87
+ history.push({
88
+ ...params,
89
+ canvas: 'edit'
90
+ }, undefined, {
91
+ transition: 'canvas-mode-edit-transition'
92
+ });
93
+ return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
94
+ }, [history, params, openGeneralSidebar, setPreference]);
116
95
  const openRevisions = (0, _element.useCallback)(async () => {
117
96
  await openGlobalStyles();
118
97
  // Open the global styles revisions once the canvas mode is set to edit,
@@ -126,36 +105,19 @@ function SidebarNavigationScreenGlobalStyles({
126
105
  const hasRevisions = revisionsCount > 0;
127
106
  const modifiedDateTime = revisions?.[0]?.modified;
128
107
  const shouldShowGlobalStylesFooter = hasRevisions && !isLoadingRevisions && modifiedDateTime;
129
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
130
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
131
- title: (0, _i18n.__)('Styles'),
132
- description: (0, _i18n.__)('Choose a different style combination for the theme styles.'),
133
- backPath: backPath,
134
- content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_content.default, {}),
108
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
109
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
110
+ title: (0, _i18n.__)('Design'),
111
+ isRoot: true,
112
+ description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
113
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.MainSidebarNavigationContent, {
114
+ activeItem: "styles-navigation-item"
115
+ }),
135
116
  footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsFooter.default, {
136
117
  record: revisions?.[0],
137
118
  onClick: openRevisions
138
- }),
139
- actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
140
- children: [!isMobileViewport && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
141
- icon: _icons.seen,
142
- label: (0, _i18n.__)('Style Book'),
143
- onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined),
144
- isPressed: isStyleBookOpened
145
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
146
- icon: _icons.edit,
147
- label: (0, _i18n.__)('Edit styles'),
148
- onClick: async () => await openGlobalStyles()
149
- })]
150
119
  })
151
- }), isStyleBookOpened && !isMobileViewport && isViewMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.default, {
152
- enableResizing: false,
153
- isSelected: () => false,
154
- onClick: openStyleBook,
155
- onSelect: openStyleBook,
156
- showCloseButton: false,
157
- showTabs: false
158
- })]
120
+ })
159
121
  });
160
122
  }
161
123
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","setCanvasMode","unlock","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\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/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\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 hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\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\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\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\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\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a;UACboD,IAAI,EAAGI,WAAM;UACbF,KAAK,EAAG,IAAAR,QAAE,EAAE,aAAc,CAAG;UAC7B1C,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAM4B,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAf,iBAAiB,IAAI,CAAEJ,gBAAgB,IAAIG,UAAU,iBACtD,IAAA/B,WAAA,CAAAc,GAAA,EAAClB,UAAA,CAAAmB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BtD,OAAO,EAAGgC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_coreData","_element","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationItem","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenMain","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","openGeneralSidebar","useDispatch","editSiteStore","setEditorCanvasContainerView","revisionsCount","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","push","canvas","transition","Promise","all","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","Fragment","children","title","__","isRoot","description","content","MainSidebarNavigationContent","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\taria-current={\n\t\t\t\t\tparams.path && params.path.startsWith( '/wp_global_styles' )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\treturn <SidebarNavigationItem { ...props } />;\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\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 hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\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\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,yBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qCAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,4BAAA,GAAAb,OAAA;AAAiF,IAAAc,WAAA,GAAAd,OAAA;AAnBjF;AACA;AACA;;AAQA;AACA;AACA;;AASA,MAAM;EAAEe,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAExD,SAASC,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAGN,WAAW,CAAC,CAAC;EAChC,MAAMO,wBAAwB,GAAG,IAAAC,eAAS,EACvCC,MAAM,IACP,CAAC,CAAEA,MAAM,CACRC,eACD,CAAC,CAACC,mDAAmD,CAAC,CAAC,EAAEC,MAAM,EAChE,EACD,C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W,EAAG,IAAAF,QAAE,EACf,kEACD,CAAG;MACHG,OAAO,eACN,IAAA3D,WAAA,CAAAc,GAAA,EAACf,4BAAA,CAAA6D,4BAA4B;QAACC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLV,4BAA4B,iBAC3B,IAAApD,WAAA,CAAAc,GAAA,EAAChB,qCAAA,CAAAiB,OAAoC;QACpCgD,MAAM,EAAG1C,SAAS,GAAI,CAAC,CAAI;QAC3B2C,OAAO,EAAGhB;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.MainSidebarNavigationContent = MainSidebarNavigationContent;
7
8
  exports.default = SidebarNavigationScreenMain;
8
9
  var _components = require("@wordpress/components");
9
10
  var _i18n = require("@wordpress/i18n");
@@ -25,6 +26,47 @@ var _jsxRuntime = require("react/jsx-runtime");
25
26
  * Internal dependencies
26
27
  */
27
28
 
29
+ function MainSidebarNavigationContent() {
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
31
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
32
+ uid: "navigation-navigation-item",
33
+ params: {
34
+ postType: _constants.NAVIGATION_POST_TYPE
35
+ },
36
+ withChevron: true,
37
+ icon: _icons.navigation,
38
+ children: (0, _i18n.__)('Navigation')
39
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
40
+ uid: "styles-navigation-item",
41
+ icon: _icons.styles,
42
+ children: (0, _i18n.__)('Styles')
43
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
44
+ uid: "page-navigation-item",
45
+ params: {
46
+ postType: 'page'
47
+ },
48
+ withChevron: true,
49
+ icon: _icons.page,
50
+ children: (0, _i18n.__)('Pages')
51
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
52
+ uid: "template-navigation-item",
53
+ params: {
54
+ postType: _constants.TEMPLATE_POST_TYPE
55
+ },
56
+ withChevron: true,
57
+ icon: _icons.layout,
58
+ children: (0, _i18n.__)('Templates')
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
60
+ uid: "patterns-navigation-item",
61
+ params: {
62
+ postType: _constants.PATTERN_TYPES.user
63
+ },
64
+ withChevron: true,
65
+ icon: _icons.symbol,
66
+ children: (0, _i18n.__)('Patterns')
67
+ })]
68
+ });
69
+ }
28
70
  function SidebarNavigationScreenMain() {
29
71
  const {
30
72
  setEditorCanvasContainerView
@@ -38,48 +80,7 @@ function SidebarNavigationScreenMain() {
38
80
  isRoot: true,
39
81
  title: (0, _i18n.__)('Design'),
40
82
  description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
41
- content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
42
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
43
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
44
- uid: "navigation-navigation-item",
45
- params: {
46
- postType: _constants.NAVIGATION_POST_TYPE
47
- },
48
- withChevron: true,
49
- icon: _icons.navigation,
50
- children: (0, _i18n.__)('Navigation')
51
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
52
- uid: "styles-navigation-item",
53
- withChevron: true,
54
- icon: _icons.styles,
55
- children: (0, _i18n.__)('Styles')
56
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
57
- uid: "page-navigation-item",
58
- params: {
59
- postType: 'page'
60
- },
61
- withChevron: true,
62
- icon: _icons.page,
63
- children: (0, _i18n.__)('Pages')
64
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
65
- uid: "template-navigation-item",
66
- params: {
67
- postType: _constants.TEMPLATE_POST_TYPE
68
- },
69
- withChevron: true,
70
- icon: _icons.layout,
71
- children: (0, _i18n.__)('Templates')
72
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
73
- uid: "patterns-navigation-item",
74
- params: {
75
- postType: _constants.PATTERN_TYPES.user
76
- },
77
- withChevron: true,
78
- icon: _icons.symbol,
79
- children: (0, _i18n.__)('Patterns')
80
- })]
81
- })
82
- })
83
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(MainSidebarNavigationContent, {})
83
84
  });
84
85
  }
85
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","jsx","default","isRoot","title","__","description","content","Fragment","children","jsxs","__experimentalItemGroup","uid","params","postType","NAVIGATION_POST_TYPE","withChevron","icon","navigation","SidebarNavigationItemGlobalStyles","styles","page","TEMPLATE_POST_TYPE","layout","PATTERN_TYPES","user","symbol"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAI+B,IAAAY,WAAA,GAAAZ,OAAA;AArB/B;AACA;AACA;;AAOA;AACA;AACA;;AAYe,SAASa,2BAA2BA,CAAA,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAG,IAAAC,kBAAM,EAC9C,IAAAC,iBAAW,EAAEC,YAAc,CAC5B,CAAC;;EAED;EACA,IAAAC,kBAAS,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AAM,EAAG;YAAEC,QAAQ,EAAEQ;UAAmB,CAAG;UAC3CN,WAAW;UACXC,IAAI,EAAGM,aAAQ;UAAAd,QAAA,EAEb,IAAAJ,QAAE,EAAE,WAAY;QAAC,CACG,CAAC,eACxB,IAAAZ,WAAA,CAAAQ,GAAA,EAACb,sBAAA,CAAAc,OAAqB;UACrBU,GAAG,EAAC,0BAA0B;UAC9BC,MAAM,EAAG;YAAEC,QAAQ,EAAEU,wBAAa,CAACC;UAAK,CAAG;UAC3CT,WAAW;UACXC,IAAI,EAAGS,aAAQ;UAAAjB,QAAA,EAEb,IAAAJ,QAAE,EAAE,UAAW;QAAC,CACI,CAAC;MAAA,CACd;IAAC,CACX;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","params","postType","NAVIGATION_POST_TYPE","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","TEMPLATE_POST_TYPE","layout","PATTERN_TYPES","user","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAI+B,IAAAY,WAAA,GAAAZ,OAAA;AArB/B;AACA;AACA;;AAOA;AACA;AACA;;AAYO,SAASa,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAACf,WAAA,CAAAgB,uBAAS;IAAAC,QAAA,gBACT,IAAAJ,WAAA,CAAAK,GAAA,EAACV,sBAAA,CAAAW,OAAqB;MACrBC,GAAG,EAAC,4BAA4B;MAChCC,MAAM,EAAG;QAAEC,QAAQ,EAAEC;MAAqB,CAAG;MAC7CC,WAAW;MACXC,IAAI,EAAGC,iBAAY;MAAAT,QAAA,EAEjB,IAAAU,QAAE,EAAE,YAAa;IAAC,CACE,CAAC,eACxB,IAAAd,WAAA,CAAAK,GAAA,EAACT,oCAAA,CAAAmB,iCAAiC;MACjCR,GAAG,EAAC,wBAAwB;MAC5BK,IAAI,EAAGI,aAAQ;MAAAZ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AG,IAAAlB,QAAE,EACf,kEACD,CAAG;IACHmB,OAAO,eAAG,IAAAjC,WAAA,CAAAK,GAAA,EAACJ,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
@@ -119,7 +119,7 @@ function useDuplicateNavigationMenu() {
119
119
  try {
120
120
  const savedRecord = await saveEntityRecord('postType', _.postType, {
121
121
  title: (0, _i18n.sprintf)(/* translators: %s: Navigation menu title */
122
- (0, _i18n.__)('%s (Copy)'), menuTitle),
122
+ (0, _i18n._x)('%s (Copy)', 'navigation menu'), menuTitle),
123
123
  content: navigationMenu?.content?.raw,
124
124
  status: 'publish'
125
125
  }, {