@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
@@ -1 +1 @@
1
- {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","description","content","footer","record","actions","icon","label","isPressed","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\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AAC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ignoreList":[]}
1
+ {"version":3,"names":["__","useSelect","useDispatch","store","coreStore","useCallback","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationItem","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","MainSidebarNavigationContent","jsx","_jsx","Fragment","_Fragment","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","openGeneralSidebar","setEditorCanvasContainerView","revisionsCount","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","push","canvas","transition","Promise","all","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","isRoot","description","content","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\taria-current={\n\t\t\t\t\tparams.path && params.path.startsWith( '/wp_global_styles' )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\treturn <SidebarNavigationItem { ...props } />;\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { 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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,i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AAW,CAAE,YAAY;IAC9C,MAAM6C,gBAAgB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACAZ,4BAA4B,CAAE,yBAA0B,CAAC;EAC1D,CAAC,EAAE,CAAEY,gBAAgB,EAAEZ,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMmB,YAAY,GAAGlB,cAAc,GAAG,CAAC;EACvC,MAAMmB,gBAAgB,GAAGxB,SAAS,GAAI,CAAC,CAAE,EAAEyB,QAAQ;EACnD,MAAMC,4BAA4B,GACjCH,YAAY,IAAI,CAAErB,kBAAkB,IAAIsB,gBAAgB;EACzD,oBACCzC,IAAA,CAAAE,SAAA;IAAA0C,QAAA,eACC5C,IAAA,CAACR,uBAAuB;MACvBqD,KAAK,EAAG9D,EAAE,CAAE,QAAS,CAAG;MACxB+D,MAAM;MACNC,WAAW,EAAGhE,EAAE,CACf,kEACD,CAAG;MACHiE,OAAO,eACNhD,IAAA,CAACF,4BAA4B;QAACmD,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLP,4BAA4B,iBAC3B3C,IAAA,CAACH,oCAAoC;QACpCsD,MAAM,EAAGlC,SAAS,GAAI,CAAC,CAAI;QAC3BmC,OAAO,EAAGb;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
@@ -16,7 +16,48 @@ import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-
16
16
  import { unlock } from '../../lock-unlock';
17
17
  import { store as editSiteStore } from '../../store';
18
18
  import { NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
19
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
+ export function MainSidebarNavigationContent() {
21
+ return /*#__PURE__*/_jsxs(ItemGroup, {
22
+ children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
23
+ uid: "navigation-navigation-item",
24
+ params: {
25
+ postType: NAVIGATION_POST_TYPE
26
+ },
27
+ withChevron: true,
28
+ icon: navigation,
29
+ children: __('Navigation')
30
+ }), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
31
+ uid: "styles-navigation-item",
32
+ icon: styles,
33
+ children: __('Styles')
34
+ }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
35
+ uid: "page-navigation-item",
36
+ params: {
37
+ postType: 'page'
38
+ },
39
+ withChevron: true,
40
+ icon: page,
41
+ children: __('Pages')
42
+ }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
43
+ uid: "template-navigation-item",
44
+ params: {
45
+ postType: TEMPLATE_POST_TYPE
46
+ },
47
+ withChevron: true,
48
+ icon: layout,
49
+ children: __('Templates')
50
+ }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
51
+ uid: "patterns-navigation-item",
52
+ params: {
53
+ postType: PATTERN_TYPES.user
54
+ },
55
+ withChevron: true,
56
+ icon: symbol,
57
+ children: __('Patterns')
58
+ })]
59
+ });
60
+ }
20
61
  export default function SidebarNavigationScreenMain() {
21
62
  const {
22
63
  setEditorCanvasContainerView
@@ -30,48 +71,7 @@ export default function SidebarNavigationScreenMain() {
30
71
  isRoot: true,
31
72
  title: __('Design'),
32
73
  description: __('Customize the appearance of your website using the block editor.'),
33
- content: /*#__PURE__*/_jsx(_Fragment, {
34
- children: /*#__PURE__*/_jsxs(ItemGroup, {
35
- children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
36
- uid: "navigation-navigation-item",
37
- params: {
38
- postType: NAVIGATION_POST_TYPE
39
- },
40
- withChevron: true,
41
- icon: navigation,
42
- children: __('Navigation')
43
- }), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
44
- uid: "styles-navigation-item",
45
- withChevron: true,
46
- icon: styles,
47
- children: __('Styles')
48
- }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
49
- uid: "page-navigation-item",
50
- params: {
51
- postType: 'page'
52
- },
53
- withChevron: true,
54
- icon: page,
55
- children: __('Pages')
56
- }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
57
- uid: "template-navigation-item",
58
- params: {
59
- postType: TEMPLATE_POST_TYPE
60
- },
61
- withChevron: true,
62
- icon: layout,
63
- children: __('Templates')
64
- }), /*#__PURE__*/_jsx(SidebarNavigationItem, {
65
- uid: "patterns-navigation-item",
66
- params: {
67
- postType: PATTERN_TYPES.user
68
- },
69
- withChevron: true,
70
- icon: symbol,
71
- children: __('Patterns')
72
- })]
73
- })
74
- })
74
+ content: /*#__PURE__*/_jsx(MainSidebarNavigationContent, {})
75
75
  });
76
76
  }
77
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SidebarNavigationScreenMain","setEditorCanvasContainerView","undefined","isRoot","title","description","content","children","uid","params","postType","withChevron","icon","user"],"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":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC3E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,QACP,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE/B,eAAe,SAASC,2BAA2BA,CAAA,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAGb,MAAM,CAC9CL,WAAW,CAAEO,aAAc,CAC5B,CAAC;;EAED;EACAN,SAAS,C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oB;UAAK,CAAG;UAC3CF,WAAW;UACXC,IAAI,EAAGjC,MAAQ;UAAA4B,QAAA,EAEb9B,EAAE,CAAE,UAAW;QAAC,CACI,CAAC;MAAA,CACd;IAAC,CACX;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","MainSidebarNavigationContent","children","uid","params","postType","withChevron","icon","user","SidebarNavigationScreenMain","setEditorCanvasContainerView","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":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAA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G;QAAEC,QAAQ,EAAEV;MAAmB,CAAG;MAC3CW,WAAW;MACXC,IAAI,EAAG1B,MAAQ;MAAAqB,QAAA,EAEbtB,EAAE,CAAE,WAAY;IAAC,CACG,CAAC,eACxBkB,IAAA,CAACT,qBAAqB;MACrBc,GAAG,EAAC,0BAA0B;MAC9BC,MAAM,EAAG;QAAEC,QAAQ,EAAET,aAAa,CAACY;MAAK,CAAG;MAC3CF,WAAW;MACXC,IAAI,EAAGzB,MAAQ;MAAAoB,QAAA,EAEbtB,EAAE,CAAE,UAAW;IAAC,CACI,CAAC;EAAA,CACd,CAAC;AAEd;AAEA,eAAe,SAAS6B,2BAA2BA,CAAA,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAGnB,MAAM,CAC9CL,WAAW,CAAEO,aAAc,CAC5B,CAAC;;EAED;EACAN,SAAS,CAAE,MAAM;IAChBuB,4BAA4B,CAAEC,SAAU,CAAC;EAC1C,CAAC,EAAE,CAAED,4BAA4B,CAAG,CAAC;EAErC,oBACCZ,IAAA,CAACV,uBAAuB;IACvBwB,MAAM;IACNC,KAAK,EAAGjC,EAAE,CAAE,QAAS,CAAG;IACxBkC,WAAW,EAAGlC,EAAE,CACf,kEACD,CAAG;IACHmC,OAAO,eAAGjB,IAAA,CAACG,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { store as coreStore } from '@wordpress/core-data';
5
- import { __, sprintf } from '@wordpress/i18n';
5
+ import { __, _x, sprintf } from '@wordpress/i18n';
6
6
  import { useSelect, useDispatch } from '@wordpress/data';
7
7
  import { store as noticesStore } from '@wordpress/notices';
8
8
  import { privateApis as routerPrivateApis } from '@wordpress/router';
@@ -112,7 +112,7 @@ function useDuplicateNavigationMenu() {
112
112
  try {
113
113
  const savedRecord = await saveEntityRecord('postType', postType, {
114
114
  title: sprintf(/* translators: %s: Navigation menu title */
115
- __('%s (Copy)'), menuTitle),
115
+ _x('%s (Copy)', 'navigation menu'), menuTitle),
116
116
  content: navigationMenu?.content?.raw,
117
117
  status: 'publish'
118
118
  }, {
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreStore","__","sprintf","useSelect","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","push","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.push( { postType: 'wp_navigation' } );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.push( { postType, postId: savedRecord.id } );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,GAAG;AAC5B,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAElD,SAASK,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAmB,CAAC,GAAGT,WAAW,CAAEJ,SAAU,CAAC;EACvD,MAAM;IAAEc,mBAAmB;IAAEC;EAAkB,CAAC,GAC/CX,WAAW,CAAEC,YAAa,CAAC;EAC5B,MAAMW,OAAO,GAAGL,UAAU,CAAC,CAAC;EAE5B,MAAMM,YAAY,GAAG,MAAQC,cAAc,IAAM;IACh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OAAO,EAAE9B,cAAc,EAAE8B,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACC5B,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAKyB,WAAW,EAAG;QAClBjC,mBAAmB,CAAEb,EAAE,CAAE,4BAA6B,CAAC,EAAE;UACxDsB,IAAI,EAAE;QACP,CAAE,CAAC;QACHP,OAAO,CAACQ,IAAI,CAAE;UAAEhB,QAAQ;UAAEW,MAAM,EAAE4B,WAAW,CAAC3B;QAAG,CAAE,CAAC;MACrD;IACD,CAAC,CAAC,OAAQK,KAAK,EAAG;MACjBV,iBAAiB,CAChBb,OAAO,CACN;MACAD,EAAE,CAAE,2CAA4C,CAAC,EACjDwB,KAAK,EAAEC,OACR,CAAC,EAED;QACCH,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOmB,eAAe;AACvB;AAEA,eAAe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNlC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCsB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["store","coreStore","__","_x","sprintf","useSelect","useDispatch","noticesStore","privateApis","routerPrivateApis","postType","NAVIGATION_POST_TYPE","unlock","useHistory","useDeleteNavigationMenu","deleteEntityRecord","createSuccessNotice","createErrorNotice","history","handleDelete","navigationMenu","postId","id","force","throwOnError","type","push","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction useDeleteNavigationMenu() {\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst history = useHistory();\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__( 'Navigation Menu successfully deleted.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\thistory.push( { postType: 'wp_navigation' } );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation Menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t_x( '%s (Copy)', 'navigation menu' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation Menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\thistory.push( { postType, postId: savedRecord.id } );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation Menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAs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Ae;AACvB;AAEA,eAAe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNlC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCsB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF","ignoreList":[]}
@@ -1,20 +1,20 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __, sprintf } from '@wordpress/i18n';
4
+ import { __, _x, sprintf } from '@wordpress/i18n';
5
5
  import { decodeEntities } from '@wordpress/html-entities';
6
6
 
7
7
  // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
8
8
  export default function buildNavigationLabel(title, id, status) {
9
9
  if (!title?.rendered) {
10
- /* translators: %s is the index of the menu in the list of menus. */
10
+ /* translators: %s: the index of the menu in the list of menus. */
11
11
  return sprintf(__('(no title %s)'), id);
12
12
  }
13
13
  if (status === 'publish') {
14
14
  return decodeEntities(title?.rendered);
15
15
  }
16
16
  return sprintf(
17
- // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
18
- __('%1$s (%2$s)'), decodeEntities(title?.rendered), status);
17
+ // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
18
+ _x('%1$s (%2$s)', 'menu label'), decodeEntities(title?.rendered), status);
19
19
  }
20
20
  //# sourceMappingURL=build-navigation-label.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","decodeEntities","buildNavigationLabel","title","id","status","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA,eAAe,SAASC,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAON,OAAO,CAAED,EAAE,CAAE,eAAgB,CAAC,EAAEK,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAOJ,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAON,OAAO;EACb;EACAD,EAAE,CAAE,aAAc,CAAC,EACnBE,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","sprintf","decodeEntities","buildNavigationLabel","title","id","status","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA,eAAe,SAASC,oBAAoBA,CAAEC,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAG;EACjE,IAAK,CAAEF,KAAK,EAAEG,QAAQ,EAAG;IACxB;IACA,OAAON,OAAO,CAAEF,EAAE,CAAE,eAAgB,CAAC,EAAEM,EAAG,CAAC;EAC5C;EAEA,IAAKC,MAAM,KAAK,SAAS,EAAG;IAC3B,OAAOJ,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC;EACzC;EAEA,OAAON,OAAO;EACb;EACAD,EAAE,CAAE,aAAa,EAAE,YAAa,CAAC,EACjCE,cAAc,CAAEE,KAAK,EAAEG,QAAS,CAAC,EACjCD,MACD,CAAC;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __, sprintf } from '@wordpress/i18n';
4
+ import { __, _x, sprintf } from '@wordpress/i18n';
5
5
  import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { decodeEntities } from '@wordpress/html-entities';
@@ -24,19 +24,16 @@ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
25
  function buildMenuLabel(title, id, status) {
26
26
  if (!title) {
27
- /* translators: %s is the index of the menu in the list of menus. */
27
+ /* translators: %s: the index of the menu in the list of menus. */
28
28
  return sprintf(__('(no title %s)'), id);
29
29
  }
30
30
  if (status === 'publish') {
31
31
  return decodeEntities(title);
32
32
  }
33
33
  return sprintf(
34
- // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
35
- __('%1$s (%2$s)'), decodeEntities(title), status);
34
+ // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
35
+ _x('%1$s (%2$s)', 'menu label'), decodeEntities(title), status);
36
36
  }
37
-
38
- // Save a boolean to prevent us creating a fallback more than once per session.
39
- let hasCreatedFallback = false;
40
37
  export default function SidebarNavigationScreenNavigationMenus({
41
38
  backPath
42
39
  }) {
@@ -49,16 +46,14 @@ export default function SidebarNavigationScreenNavigationMenus({
49
46
  const {
50
47
  getNavigationFallbackId
51
48
  } = unlock(useSelect(coreStore));
49
+ const isCreatingNavigationFallback = useSelect(select => select(coreStore).isResolving('getNavigationFallbackId'), []);
52
50
  const firstNavigationMenu = navigationMenus?.[0];
53
51
 
54
- // Save a boolean to prevent us creating a fallback more than once per session.
55
- if (firstNavigationMenu) {
56
- hasCreatedFallback = true;
57
- }
58
-
59
52
  // If there is no navigation menu found
60
53
  // then trigger fallback algorithm to create one.
61
- if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && !hasCreatedFallback) {
54
+ if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus &&
55
+ // Ensure a fallback navigation is created only once
56
+ !isCreatingNavigationFallback) {
62
57
  getNavigationFallbackId();
63
58
  }
64
59
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","jsx","_jsx","buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","SidebarNavigationScreenWrapper","children","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","withChevron","icon","rendered","actions","content","props","linkInfo","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\n// Save a boolean to prevent us creating a fallback more than once per session.\nlet hasCreatedFallback = false;\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// Save a boolean to prevent us creating a fallback more than once per session.\n\tif ( firstNavigationMenu ) {\n\t\thasCreatedFallback = true;\n\t}\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t! hasCreatedFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,OAAO,QACD,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SA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;QACXC,IAAI,EAAG3C,UAAY;QAAAiC,QAAA,EAEjBtB,cAAc,CAAEC,KAAK,EAAEgC,QAAQ,EAAEL,KAAK,GAAG,CAAC,EAAEzB,MAAO;MAAC,GAJhDD,EAKM,CACZ;IAAC,CACO;EAAC,CACmB,CAAC;AAEnC;AAEA,OAAO,SAASmB,8BAA8BA,CAAE;EAC/CC,QAAQ;EACRY,OAAO;EACPjC,KAAK;EACLuB,WAAW;EACXlB;AACD,CAAC,EAAG;EACH,oBACCP,IAAA,CAACT,uBAAuB;IACvBW,KAAK,EAAGA,KAAK,IAAItB,EAAE,CAAE,YAAa,CAAG;IACrCuD,OAAO,EAAGA,OAAS;IACnBV,WAAW,EAAGA,WAAW,IAAI7C,EAAE,CAAE,+BAAgC,CAAG;IACpE2B,QAAQ,EAAGA,QAAU;IACrB6B,OAAO,EAAGb;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMO,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGM;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG5C,OAAO,CAAE;IACzBqC,MAAM;IACNQ,QAAQ,EAAE;EACX,CAAE,CAAC;EACH,oBAAOvC,IAAA,CAACR,qBAAqB;IAAA,GAAM8C,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","jsx","_jsx","buildMenuLabel","title","id","status","SidebarNavigationScreenNavigationMenus","backPath","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","isCreatingNavigationFallback","select","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","SidebarNavigationScreenWrapper","children","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","withChevron","icon","rendered","actions","content","props","linkInfo","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation Menus.' ) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,OAAO,QACD,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA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E;MAAO,CAAC,EAAE0B,KAAK,kBACrD9B,IAAA,CAAC+B,WAAW;QACXC,MAAM,EAAG7B,EAAI;QAEb8B,WAAW;QACXC,IAAI,EAAG5C,UAAY;QAAAkC,QAAA,EAEjBvB,cAAc,CAAEC,KAAK,EAAEiC,QAAQ,EAAEL,KAAK,GAAG,CAAC,EAAE1B,MAAO;MAAC,GAJhDD,EAKM,CACZ;IAAC,CACO;EAAC,CACmB,CAAC;AAEnC;AAEA,OAAO,SAASoB,8BAA8BA,CAAE;EAC/CC,QAAQ;EACRY,OAAO;EACPlC,KAAK;EACLwB,WAAW;EACXpB;AACD,CAAC,EAAG;EACH,oBACCN,IAAA,CAACT,uBAAuB;IACvBW,KAAK,EAAGA,KAAK,IAAIvB,EAAE,CAAE,YAAa,CAAG;IACrCyD,OAAO,EAAGA,OAAS;IACnBV,WAAW,EAAGA,WAAW,IAAI/C,EAAE,CAAE,+BAAgC,CAAG;IACpE2B,QAAQ,EAAGA,QAAU;IACrB+B,OAAO,EAAGb;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMO,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGM;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG7C,OAAO,CAAE;IACzBsC,MAAM;IACNQ,QAAQ,EAAE;EACX,CAAE,CAAC;EACH,oBAAOxC,IAAA,CAACR,qBAAqB;IAAA,GAAM+C,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import Editor from '../editor';
5
+ import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const homeEditRoute = {
8
+ name: 'home-edit',
9
+ match: params => {
10
+ return params.canvas === 'edit';
11
+ },
12
+ areas: {
13
+ sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {}),
14
+ preview: /*#__PURE__*/_jsx(Editor, {}),
15
+ mobile: /*#__PURE__*/_jsx(Editor, {})
16
+ }
17
+ };
18
+ //# sourceMappingURL=home-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Editor","SidebarNavigationScreenMain","jsx","_jsx","homeEditRoute","name","match","params","canvas","areas","sidebar","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/home-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nexport const homeEditRoute = {\n\tname: 'home-edit',\n\tmatch: ( params ) => {\n\t\treturn params.canvas === 'edit';\n\t},\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,2BAA2B,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,OAAO,MAAMC,aAAa,GAAG;EAC5BC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OAAOA,MAAM,CAACC,MAAM,KAAK,MAAM;EAChC,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAEP,IAAA,CAACF,2BAA2B,IAAE,CAAC;IACxCU,OAAO,eAAER,IAAA,CAACH,MAAM,IAAE,CAAC;IACnBY,MAAM,eAAET,IAAA,CAACH,MAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import Editor from '../editor';
5
+ import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const homeViewRoute = {
8
+ name: 'home-view',
9
+ match: params => {
10
+ return params.canvas !== 'edit';
11
+ },
12
+ areas: {
13
+ sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {}),
14
+ preview: /*#__PURE__*/_jsx(Editor, {})
15
+ }
16
+ };
17
+ //# sourceMappingURL=home-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Editor","SidebarNavigationScreenMain","jsx","_jsx","homeViewRoute","name","match","params","canvas","areas","sidebar","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/home-view.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nexport const homeViewRoute = {\n\tname: 'home-view',\n\tmatch: ( params ) => {\n\t\treturn params.canvas !== 'edit';\n\t},\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,2BAA2B,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,OAAO,MAAMC,aAAa,GAAG;EAC5BC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OAAOA,MAAM,CAACC,MAAM,KAAK,MAAM;EAChC,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAEP,IAAA,CAACF,2BAA2B,IAAE,CAAC;IACxCU,OAAO,eAAER,IAAA,CAACH,MAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useRegistry, useDispatch } from '@wordpress/data';
5
+ import { useEffect } from '@wordpress/element';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { unlock } from '../../lock-unlock';
11
+ import { store as siteEditorStore } from '../../store';
12
+ import { homeViewRoute } from './home-view';
13
+ import { homeEditRoute } from './home-edit';
14
+ import { navigationViewRoute } from './navigation-view';
15
+ import { navigationEditRoute } from './navigation-edit';
16
+ import { navigationItemEditRoute } from './navigation-item-edit';
17
+ import { navigationItemViewRoute } from './navigation-item-view';
18
+ import { stylesEditRoute } from './styles-edit';
19
+ import { stylesViewRoute } from './styles-view';
20
+ import { patternsEditRoute } from './patterns-edit';
21
+ import { patternsViewRoute } from './patterns-view';
22
+ import { templatesEditRoute } from './templates-edit';
23
+ import { templatesListViewRoute } from './templates-list-view';
24
+ import { templatesViewRoute } from './templates-view';
25
+ import { pagesViewRoute } from './pages-view';
26
+ import { pagesEditRoute } from './pages-edit';
27
+ import { pagesListViewRoute } from './pages-list-view';
28
+ import { pagesListViewQuickEditRoute } from './pages-list-view-quick-edit';
29
+ import { pagesViewQuickEditRoute } from './pages-view-quick-edit';
30
+ const routes = [pagesListViewQuickEditRoute, pagesListViewRoute, pagesViewQuickEditRoute, pagesViewRoute, pagesEditRoute, templatesEditRoute, templatesListViewRoute, templatesViewRoute, patternsViewRoute, patternsEditRoute, stylesViewRoute, stylesEditRoute, navigationItemViewRoute, navigationItemEditRoute, navigationViewRoute, navigationEditRoute, homeViewRoute, homeEditRoute];
31
+ export function useRegisterSiteEditorRoutes() {
32
+ const registry = useRegistry();
33
+ const {
34
+ registerRoute
35
+ } = unlock(useDispatch(siteEditorStore));
36
+ useEffect(() => {
37
+ registry.batch(() => {
38
+ routes.forEach(registerRoute);
39
+ });
40
+ }, [registry, registerRoute]);
41
+ }
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRegistry","useDispatch","useEffect","unlock","store","siteEditorStore","homeViewRoute","homeEditRoute","navigationViewRoute","navigationEditRoute","navigationItemEditRoute","navigationItemViewRoute","stylesEditRoute","stylesViewRoute","patternsEditRoute","patternsViewRoute","templatesEditRoute","templatesListViewRoute","templatesViewRoute","pagesViewRoute","pagesEditRoute","pagesListViewRoute","pagesListViewQuickEditRoute","pagesViewQuickEditRoute","routes","useRegisterSiteEditorRoutes","registry","registerRoute","batch","forEach"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { homeViewRoute } from './home-view';\nimport { homeEditRoute } from './home-edit';\nimport { navigationViewRoute } from './navigation-view';\nimport { navigationEditRoute } from './navigation-edit';\nimport { navigationItemEditRoute } from './navigation-item-edit';\nimport { navigationItemViewRoute } from './navigation-item-view';\nimport { stylesEditRoute } from './styles-edit';\nimport { stylesViewRoute } from './styles-view';\nimport { patternsEditRoute } from './patterns-edit';\nimport { patternsViewRoute } from './patterns-view';\nimport { templatesEditRoute } from './templates-edit';\nimport { templatesListViewRoute } from './templates-list-view';\nimport { templatesViewRoute } from './templates-view';\nimport { pagesViewRoute } from './pages-view';\nimport { pagesEditRoute } from './pages-edit';\nimport { pagesListViewRoute } from './pages-list-view';\nimport { pagesListViewQuickEditRoute } from './pages-list-view-quick-edit';\nimport { pagesViewQuickEditRoute } from './pages-view-quick-edit';\n\nconst routes = [\n\tpagesListViewQuickEditRoute,\n\tpagesListViewRoute,\n\tpagesViewQuickEditRoute,\n\tpagesViewRoute,\n\tpagesEditRoute,\n\ttemplatesEditRoute,\n\ttemplatesListViewRoute,\n\ttemplatesViewRoute,\n\tpatternsViewRoute,\n\tpatternsEditRoute,\n\tstylesViewRoute,\n\tstylesEditRoute,\n\tnavigationItemViewRoute,\n\tnavigationItemEditRoute,\n\tnavigationViewRoute,\n\tnavigationEditRoute,\n\thomeViewRoute,\n\thomeEditRoute,\n];\n\nexport function useRegisterSiteEditorRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,W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,WAAW,CAAEI,eAAgB,CAAE,CAAC;EAClEH,SAAS,CAAE,MAAM;IAChBwB,QAAQ,CAACE,KAAK,CAAE,MAAM;MACrBJ,MAAM,CAACK,OAAO,CAAEF,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAED,QAAQ,EAAEC,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
5
+ import Editor from '../editor';
6
+ import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export const navigationEditRoute = {
9
+ name: 'navigation-edit',
10
+ match: params => {
11
+ return params.postType === NAVIGATION_POST_TYPE && !params.postId && params.canvas === 'edit';
12
+ },
13
+ areas: {
14
+ sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenus, {
15
+ backPath: {}
16
+ }),
17
+ preview: /*#__PURE__*/_jsx(Editor, {}),
18
+ mobile: /*#__PURE__*/_jsx(Editor, {})
19
+ }
20
+ };
21
+ //# sourceMappingURL=navigation-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAVIGATION_POST_TYPE","Editor","SidebarNavigationScreenNavigationMenus","jsx","_jsx","navigationEditRoute","name","match","params","postType","postId","canvas","areas","sidebar","backPath","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\n\nexport const navigationEditRoute = {\n\tname: 'navigation-edit',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.postType === NAVIGATION_POST_TYPE &&\n\t\t\t! params.postId &&\n\t\t\tparams.canvas === 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenNavigationMenus backPath={ {} } />,\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,uBAAuB;AAC5D,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,sCAAsC,MAAM,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnG,OAAO,MAAMC,mBAAmB,GAAG;EAClCC,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKT,oBAAoB,IACxC,CAAEQ,MAAM,CAACE,MAAM,IACfF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAET,IAAA,CAACF,sCAAsC;MAACY,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IACnEC,OAAO,eAAEX,IAAA,CAACH,MAAM,IAAE,CAAC;IACnBe,MAAM,eAAEZ,IAAA,CAACH,MAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
5
+ import Editor from '../editor';
6
+ import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export const navigationItemEditRoute = {
9
+ name: 'navigation-item-edit',
10
+ match: params => {
11
+ return params.postType === NAVIGATION_POST_TYPE && !!params.postId && params.canvas === 'edit';
12
+ },
13
+ areas: {
14
+ sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
15
+ backPath: {
16
+ postType: NAVIGATION_POST_TYPE
17
+ }
18
+ }),
19
+ preview: /*#__PURE__*/_jsx(Editor, {}),
20
+ mobile: /*#__PURE__*/_jsx(Editor, {})
21
+ }
22
+ };
23
+ //# sourceMappingURL=navigation-item-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAVIGATION_POST_TYPE","Editor","SidebarNavigationScreenNavigationMenu","jsx","_jsx","navigationItemEditRoute","name","match","params","postType","postId","canvas","areas","sidebar","backPath","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-item-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\n\nexport const navigationItemEditRoute = {\n\tname: 'navigation-item-edit',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.postType === NAVIGATION_POST_TYPE &&\n\t\t\t!! params.postId &&\n\t\t\tparams.canvas === 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreenNavigationMenu\n\t\t\t\tbackPath={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t/>\n\t\t),\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,uBAAuB;AAC5D,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,qCAAqC,MAAM,8CAA8C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjG,OAAO,MAAMC,uBAAuB,GAAG;EACtCC,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKT,oBAAoB,IACxC,CAAC,CAAEQ,MAAM,CAACE,MAAM,IAChBF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eACNT,IAAA,CAACF,qCAAqC;MACrCY,QAAQ,EAAG;QAAEL,QAAQ,EAAET;MAAqB;IAAG,CAC/C,CACD;IACDe,OAAO,eAAEX,IAAA,CAACH,MAAM,IAAE,CAAC;IACnBe,MAAM,eAAEZ,IAAA,CAACH,MAAM,IAAE;EAClB;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
5
+ import Editor from '../editor';
6
+ import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export const navigationItemViewRoute = {
9
+ name: 'navigation-item-view',
10
+ match: params => {
11
+ return params.postType === NAVIGATION_POST_TYPE && !!params.postId && params.canvas !== 'edit';
12
+ },
13
+ areas: {
14
+ sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
15
+ backPath: {
16
+ postType: NAVIGATION_POST_TYPE
17
+ }
18
+ }),
19
+ preview: /*#__PURE__*/_jsx(Editor, {})
20
+ }
21
+ };
22
+ //# sourceMappingURL=navigation-item-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAVIGATION_POST_TYPE","Editor","SidebarNavigationScreenNavigationMenu","jsx","_jsx","navigationItemViewRoute","name","match","params","postType","postId","canvas","areas","sidebar","backPath","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-item-view.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\n\nexport const navigationItemViewRoute = {\n\tname: 'navigation-item-view',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.postType === NAVIGATION_POST_TYPE &&\n\t\t\t!! params.postId &&\n\t\t\tparams.canvas !== 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreenNavigationMenu\n\t\t\t\tbackPath={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t/>\n\t\t),\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,uBAAuB;AAC5D,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,qCAAqC,MAAM,8CAA8C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjG,OAAO,MAAMC,uBAAuB,GAAG;EACtCC,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,QAAQ,KAAKT,oBAAoB,IACxC,CAAC,CAAEQ,MAAM,CAACE,MAAM,IAChBF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eACNT,IAAA,CAACF,qCAAqC;MACrCY,QAAQ,EAAG;QAAEL,QAAQ,EAAET;MAAqB;IAAG,CAC/C,CACD;IACDe,OAAO,eAAEX,IAAA,CAACH,MAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}